cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: List available curl options

From: Jeroen Ooms <jeroenooms_at_gmail.com>
Date: Sun, 14 Dec 2014 17:57:41 -0800

On Sat, Dec 13, 2014 at 2:32 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
> In addition to that, we provide docs/libcurl/symbols.pl, with which you
> can generate a header file...

Thank you, that gets me almost here. My goal is to create a list of all
options and their symbol names whe compiling the library. Currently I use:

#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?

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-12-15