cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: List available curl options

From: Gisle Vanem <gvanem_at_yahoo.no>
Date: Mon, 15 Dec 2014 11:34:27 +0000

Jeroen Ooms wrote:

> #define MAKE_OPTION(a) {#a, CURLOPT_##a}
>
> typedef struct {
> char name[40];
> int val;
> } keyval;
>
> keyval curl_options[] = {
> MAKE_OPTION(MUTE),
> MAKE_OPTION(ACCEPT_ENCODING),
> ... etc
> };
>
> But currently this fails when calling MAKE_OPTION with an undefined symbol.
> Is there any easy way that I can use the LIBCURL_HAS macro or a variant such
> that MAKE_OPTION will set (int val) to e.g. null or -9999999 or so, when the symbol
> does not exist in the version of libcurl that is being linked?

I've not followed this thread, but can't you use some
external tools to create the list. Like:
   grep "^ CINIT(" ../include/curl/curl.h | cut -f1 -d, | sed 's/CINIT(/CURLOPT_/'

The attached GNU-make file does this.

-- 
--gv


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2014-12-15