Re: HTTPS with OpenSSL

new topic     » goto parent     » topic index » view thread      » older message » newer message
ghaberek said...

Ugh. I forgot how craptacular the CURLOPT macros are. The authors even refer to this as macro-mania.

/* 
 * This macro-mania below setups the CURLOPT_[what] enum, to be used with 
 * curl_easy_setopt(). The first argument in the CINIT() macro is the [what] 
 * word. 
 */ 
 
typedef enum { 
  /* This is the FILE * or void * the regular output should be written to. */ 
  CINIT(WRITEDATA, OBJECTPOINT, 1), 
 
  /* The full URL to get/put */ 
  CINIT(URL, STRINGPOINT, 2), 
 
  /* Port number to connect to, if other than default. */ 
  CINIT(PORT, LONG, 3), 
 
  /* Name of proxy to use. */ 
  CINIT(PROXY, STRINGPOINT, 4), 
 
  ... 

-Greg

May I suggest running it through the C preprocessor (e.g. gcc -E) ? That produces the following output for me:

 typedef enum { 
 
 CURLOPT_ WRITEDATA = 10000 + 1, 
 
 CURLOPT_ URL = 10000 + 2, 
 
 CURLOPT_ PORT = 0 + 3, 
 
 CURLOPT_ PROXY = 10000 + 4, 
 
 CURLOPT_ USERPWD = 10000 + 5, 
 
 CURLOPT_ PROXYUSERPWD = 10000 + 6, 
 
 CURLOPT_ RANGE = 10000 + 7, 
 
 
 CURLOPT_ READDATA = 10000 + 9, 
 
 
 CURLOPT_ ERRORBUFFER = 10000 + 10, 
 
... 

You'll probably have to do this one per platform+arch combo, but the post-processed output is probably a lot easier to deal with...

(A shame that "gcc -E" doesn't have an option to process everything _except_ #include statements, though...)

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu