1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-24 09:08:49 -05:00

typecheck: CURLOPT_CONNECT_TO takes an slist too

Additionally, add an alias in curl.h for slist-using options so that
we can grep/parse those out at will.

Closes #4042
This commit is contained in:
Daniel Stenberg 2019-06-19 09:17:03 +02:00
parent 2aff76c571
commit ae99b4de1c
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
3 changed files with 16 additions and 12 deletions

View File

@ -345,6 +345,7 @@ CURLOPTTYPE_LONG 7.1
CURLOPTTYPE_OBJECTPOINT 7.1 CURLOPTTYPE_OBJECTPOINT 7.1
CURLOPTTYPE_OFF_T 7.11.0 CURLOPTTYPE_OFF_T 7.11.0
CURLOPTTYPE_STRINGPOINT 7.46.0 CURLOPTTYPE_STRINGPOINT 7.46.0
CURLOPTTYPE_SLISTPOINT 7.65.2
CURLOPT_ABSTRACT_UNIX_SOCKET 7.53.0 CURLOPT_ABSTRACT_UNIX_SOCKET 7.53.0
CURLOPT_ACCEPTTIMEOUT_MS 7.24.0 CURLOPT_ACCEPTTIMEOUT_MS 7.24.0
CURLOPT_ACCEPT_ENCODING 7.21.6 CURLOPT_ACCEPT_ENCODING 7.21.6

View File

@ -927,7 +927,6 @@ typedef enum {
but 32 */ but 32 */
#define CURLOPTTYPE_LONG 0 #define CURLOPTTYPE_LONG 0
#define CURLOPTTYPE_OBJECTPOINT 10000 #define CURLOPTTYPE_OBJECTPOINT 10000
#define CURLOPTTYPE_STRINGPOINT 10000
#define CURLOPTTYPE_FUNCTIONPOINT 20000 #define CURLOPTTYPE_FUNCTIONPOINT 20000
#define CURLOPTTYPE_OFF_T 30000 #define CURLOPTTYPE_OFF_T 30000
@ -947,12 +946,15 @@ typedef enum {
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
#define LONG CURLOPTTYPE_LONG #define LONG CURLOPTTYPE_LONG
#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT #define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
#define STRINGPOINT CURLOPTTYPE_OBJECTPOINT
#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT #define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
#define OFF_T CURLOPTTYPE_OFF_T #define OFF_T CURLOPTTYPE_OFF_T
#define CINIT(name,type,number) CURLOPT_/**/name = type + number #define CINIT(name,type,number) CURLOPT_/**/name = type + number
#endif #endif
/* handy aliases that make no run-time difference */
#define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT
#define CURLOPTTYPE_SLISTPOINT CURLOPTTYPE_OBJECTPOINT
/* /*
* This macro-mania below setups the CURLOPT_[what] enum, to be used with * 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] * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]
@ -1050,7 +1052,7 @@ typedef enum {
/* This points to a linked list of headers, struct curl_slist kind. This /* This points to a linked list of headers, struct curl_slist kind. This
list is also used for RTSP (in spite of its name) */ list is also used for RTSP (in spite of its name) */
CINIT(HTTPHEADER, OBJECTPOINT, 23), CINIT(HTTPHEADER, SLISTPOINT, 23),
/* This points to a linked list of post entries, struct curl_httppost */ /* This points to a linked list of post entries, struct curl_httppost */
CINIT(HTTPPOST, OBJECTPOINT, 24), CINIT(HTTPPOST, OBJECTPOINT, 24),
@ -1065,7 +1067,7 @@ typedef enum {
CINIT(CRLF, LONG, 27), CINIT(CRLF, LONG, 27),
/* send linked-list of QUOTE commands */ /* send linked-list of QUOTE commands */
CINIT(QUOTE, OBJECTPOINT, 28), CINIT(QUOTE, SLISTPOINT, 28),
/* send FILE * or void * to store headers to, if you use a callback it /* send FILE * or void * to store headers to, if you use a callback it
is simply passed to the callback unmodified */ is simply passed to the callback unmodified */
@ -1100,7 +1102,7 @@ typedef enum {
/* 38 is not used */ /* 38 is not used */
/* send linked-list of post-transfer QUOTE commands */ /* send linked-list of post-transfer QUOTE commands */
CINIT(POSTQUOTE, OBJECTPOINT, 39), CINIT(POSTQUOTE, SLISTPOINT, 39),
CINIT(OBSOLETE40, OBJECTPOINT, 40), /* OBSOLETE, do not use! */ CINIT(OBSOLETE40, OBJECTPOINT, 40), /* OBSOLETE, do not use! */
@ -1176,7 +1178,7 @@ typedef enum {
CINIT(FILETIME, LONG, 69), CINIT(FILETIME, LONG, 69),
/* This points to a linked list of telnet options */ /* This points to a linked list of telnet options */
CINIT(TELNETOPTIONS, OBJECTPOINT, 70), CINIT(TELNETOPTIONS, SLISTPOINT, 70),
/* Max amount of cached alive connections */ /* Max amount of cached alive connections */
CINIT(MAXCONNECTS, LONG, 71), CINIT(MAXCONNECTS, LONG, 71),
@ -1260,7 +1262,7 @@ typedef enum {
CINIT(DNS_CACHE_TIMEOUT, LONG, 92), CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
/* send linked-list of pre-transfer QUOTE commands */ /* send linked-list of pre-transfer QUOTE commands */
CINIT(PREQUOTE, OBJECTPOINT, 93), CINIT(PREQUOTE, SLISTPOINT, 93),
/* set the debug function */ /* set the debug function */
CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94), CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
@ -1300,7 +1302,7 @@ typedef enum {
CINIT(PRIVATE, OBJECTPOINT, 103), CINIT(PRIVATE, OBJECTPOINT, 103),
/* Set aliases for HTTP 200 in the HTTP Response header */ /* Set aliases for HTTP 200 in the HTTP Response header */
CINIT(HTTP200ALIASES, OBJECTPOINT, 104), CINIT(HTTP200ALIASES, SLISTPOINT, 104),
/* Continue to send authentication (user+password) when following locations, /* Continue to send authentication (user+password) when following locations,
even when hostname changed. This can potentially send off the name even when hostname changed. This can potentially send off the name
@ -1590,7 +1592,7 @@ typedef enum {
CINIT(MAIL_FROM, STRINGPOINT, 186), CINIT(MAIL_FROM, STRINGPOINT, 186),
/* set the list of SMTP mail receiver(s) */ /* set the list of SMTP mail receiver(s) */
CINIT(MAIL_RCPT, OBJECTPOINT, 187), CINIT(MAIL_RCPT, SLISTPOINT, 187),
/* FTP: send PRET before PASV */ /* FTP: send PRET before PASV */
CINIT(FTP_USE_PRET, LONG, 188), CINIT(FTP_USE_PRET, LONG, 188),
@ -1640,7 +1642,7 @@ typedef enum {
CINIT(FNMATCH_DATA, OBJECTPOINT, 202), CINIT(FNMATCH_DATA, OBJECTPOINT, 202),
/* send linked-list of name:port:address sets */ /* send linked-list of name:port:address sets */
CINIT(RESOLVE, OBJECTPOINT, 203), CINIT(RESOLVE, SLISTPOINT, 203),
/* Set a username for authenticated TLS */ /* Set a username for authenticated TLS */
CINIT(TLSAUTH_USERNAME, STRINGPOINT, 204), CINIT(TLSAUTH_USERNAME, STRINGPOINT, 204),
@ -1730,7 +1732,7 @@ typedef enum {
/* This points to a linked list of headers used for proxy requests only, /* This points to a linked list of headers used for proxy requests only,
struct curl_slist kind */ struct curl_slist kind */
CINIT(PROXYHEADER, OBJECTPOINT, 228), CINIT(PROXYHEADER, SLISTPOINT, 228),
/* Pass in a bitmask of "header options" */ /* Pass in a bitmask of "header options" */
CINIT(HEADEROPT, LONG, 229), CINIT(HEADEROPT, LONG, 229),
@ -1777,7 +1779,7 @@ typedef enum {
/* Linked-list of host:port:connect-to-host:connect-to-port, /* Linked-list of host:port:connect-to-host:connect-to-port,
overrides the URL's host:port (only for the network layer) */ overrides the URL's host:port (only for the network layer) */
CINIT(CONNECT_TO, OBJECTPOINT, 243), CINIT(CONNECT_TO, SLISTPOINT, 243),
/* Set TCP Fast Open */ /* Set TCP Fast Open */
CINIT(TCP_FASTOPEN, LONG, 244), CINIT(TCP_FASTOPEN, LONG, 244),

View File

@ -382,6 +382,7 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_off_t,
(option) == CURLOPT_QUOTE || \ (option) == CURLOPT_QUOTE || \
(option) == CURLOPT_RESOLVE || \ (option) == CURLOPT_RESOLVE || \
(option) == CURLOPT_TELNETOPTIONS || \ (option) == CURLOPT_TELNETOPTIONS || \
(option) == CURLOPT_CONNECT_TO || \
0) 0)
/* groups of curl_easy_getinfo infos that take the same type of argument */ /* groups of curl_easy_getinfo infos that take the same type of argument */