5959#define CURL_IGNORE_DEPRECATION (statements ) statements
6060#endif
6161
62- #include "curlver.h" /* libcurl version defines */
62+ #include "curlver.h" /* libcurl version defines */
6363#include "system.h" /* determine things runtime */
6464
6565#include <stdio.h>
@@ -142,7 +142,7 @@ typedef SOCKET curl_socket_t;
142142#define CURL_SOCKET_BAD INVALID_SOCKET
143143#else
144144typedef int curl_socket_t ;
145- #define CURL_SOCKET_BAD -1
145+ #define CURL_SOCKET_BAD (-1)
146146#endif
147147#define curl_socket_typedef
148148#endif /* curl_socket_typedef */
@@ -820,7 +820,7 @@ typedef enum {
820820 * CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper
821821 * CURLAUTH_BEARER - HTTP Bearer token authentication
822822 * CURLAUTH_ONLY - Use together with a single other type to force no
823- * authentication or just that single type
823+ * authentication or that single type
824824 * CURLAUTH_ANY - All fine types set
825825 * CURLAUTH_ANYSAFE - All fine types except Basic
826826 */
@@ -842,10 +842,13 @@ typedef enum {
842842#define CURLAUTH_BEARER (((unsigned long)1) << 6)
843843#define CURLAUTH_AWS_SIGV4 (((unsigned long)1) << 7)
844844#define CURLAUTH_ONLY (((unsigned long)1) << 31)
845- #define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
846- #define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC | CURLAUTH_DIGEST_IE))
845+ #define CURLAUTH_ANY ((~CURLAUTH_DIGEST_IE) & \
846+ ((unsigned long)0xffffffff))
847+ #define CURLAUTH_ANYSAFE ((~(CURLAUTH_BASIC | CURLAUTH_DIGEST_IE)) & \
848+ ((unsigned long)0xffffffff))
847849
848- #define CURLSSH_AUTH_ANY ~0L /* all types supported by server */
850+ /* all types supported by server */
851+ #define CURLSSH_AUTH_ANY ((unsigned long)0xffffffff)
849852#define CURLSSH_AUTH_NONE 0L /* none allowed, silly but complete */
850853#define CURLSSH_AUTH_PUBLICKEY (1L << 0) /* public/private key files */
851854#define CURLSSH_AUTH_PASSWORD (1L << 1) /* password */
@@ -1100,7 +1103,8 @@ typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,
11001103#define CURLPROTO_SMBS (1L << 27)
11011104#define CURLPROTO_MQTT (1L << 28)
11021105#define CURLPROTO_GOPHERS (1L << 29)
1103- #define CURLPROTO_ALL (~0L) /* enable everything */
1106+ #define CURLPROTO_ALL ((unsigned long)0xffffffff) /* old-style enable
1107+ "everything" */
11041108
11051109/* long may be 32 or 64 bits, but we should never depend on anything else
11061110 but 32 */
@@ -1113,8 +1117,9 @@ typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,
11131117/* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the
11141118 string options from the header file */
11151119
1116- #define CURLOPT (na ,t ,nu ) na = t + nu
1117- #define CURLOPTDEPRECATED (na ,t ,nu ,v ,m ) na CURL_DEPRECATED(v,m) = t + nu
1120+ #define CURLOPT (na , t , nu ) na = ((t) + (nu))
1121+ #define CURLOPTDEPRECATED (na , t , nu , v , m ) na CURL_DEPRECATED(v, m) \
1122+ = ((t) + (nu))
11181123
11191124/* CURLOPT aliases that make no runtime difference */
11201125
@@ -1244,7 +1249,7 @@ typedef enum {
12441249 CURLOPT (CURLOPT_QUOTE , CURLOPTTYPE_SLISTPOINT , 28 ),
12451250
12461251 /* send FILE * or void * to store headers to, if you use a callback it
1247- is simply passed to the callback unmodified */
1252+ is passed to the callback unmodified */
12481253 CURLOPT (CURLOPT_HEADERDATA , CURLOPTTYPE_CBPOINT , 29 ),
12491254
12501255 /* point to a file to read the initial cookies from, also enables
@@ -1353,7 +1358,7 @@ typedef enum {
13531358
13541359 /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
13551360 * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
1356- * is set but does not match one of these, 'private' will be used. */
1361+ * is set but does not match one of these, 'private' will be used. */
13571362 CURLOPTDEPRECATED (CURLOPT_KRBLEVEL , CURLOPTTYPE_STRINGPOINT , 63 ,
13581363 8.17 .0 , "removed "),
13591364
@@ -2119,7 +2124,7 @@ typedef enum {
21192124 /* Specify URL using CURL URL API. */
21202125 CURLOPT (CURLOPT_CURLU , CURLOPTTYPE_OBJECTPOINT , 282 ),
21212126
2122- /* add trailing data just after no more data is available */
2127+ /* add trailing data after no more data is available */
21232128 CURLOPT (CURLOPT_TRAILERFUNCTION , CURLOPTTYPE_FUNCTIONPOINT , 283 ),
21242129
21252130 /* pointer to be passed to HTTP_TRAILER_FUNCTION */
@@ -2198,7 +2203,7 @@ typedef enum {
21982203 CURLOPT (CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 , CURLOPTTYPE_STRINGPOINT , 311 ),
21992204
22002205 /* Function that will be called immediately before the initial request
2201- is made on a connection (after any protocol negotiation step). */
2206+ is made on a connection (after any protocol negotiation step). */
22022207 CURLOPT (CURLOPT_PREREQFUNCTION , CURLOPTTYPE_FUNCTIONPOINT , 312 ),
22032208
22042209 /* Data passed to the CURLOPT_PREREQFUNCTION callback */
@@ -2278,7 +2283,6 @@ typedef enum {
22782283#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
22792284#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
22802285
2281- /* */
22822286#define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT
22832287
22842288/* Added in 8.2.0 */
@@ -2352,8 +2356,8 @@ typedef enum {
23522356 Unless one is set programmatically, the
23532357 .netrc will be queried. */
23542358enum CURL_NETRC_OPTION {
2355- /* we set a single member here, just to make sure we still provide the enum,
2356- but the values to use are defined above with L suffixes */
2359+ /* we set a single member here, to make sure we still provide the enum, but
2360+ the values to use are defined above with L suffixes */
23572361 CURL_NETRC_LAST = 3
23582362};
23592363
@@ -2382,7 +2386,7 @@ enum CURL_NETRC_OPTION {
23822386#define CURL_TLSAUTH_SRP 1L
23832387
23842388enum CURL_TLSAUTH {
2385- /* we set a single member here, just to make sure we still provide the enum,
2389+ /* we set a single member here, to make sure we still provide the enum,
23862390 but the values to use are defined above with L suffixes */
23872391 CURL_TLSAUTH_LAST = 2
23882392};
@@ -2405,7 +2409,7 @@ enum CURL_TLSAUTH {
24052409#define CURL_TIMECOND_LASTMOD 3L
24062410
24072411typedef enum {
2408- /* we set a single member here, just to make sure we still provide
2412+ /* we set a single member here, to make sure we still provide
24092413 the enum typedef, but the values to use are defined above with L
24102414 suffixes */
24112415 CURL_TIMECOND_LAST = 4
@@ -2704,7 +2708,7 @@ CURL_EXTERN char *curl_escape(const char *string,
27042708 *
27052709 * DESCRIPTION
27062710 *
2707- * Unescapes URL encoding in strings (converts all %XX codes to their 8bit
2711+ * Unescapes URL encoding in strings (converts all %XX codes to their 8-bit
27082712 * versions). This function returns a new allocated string or NULL if an error
27092713 * occurred.
27102714 * Conversion Note: On non-ASCII platforms the ASCII %XX codes are
@@ -3020,9 +3024,8 @@ typedef enum {
30203024/* Different data locks for a single share */
30213025typedef enum {
30223026 CURL_LOCK_DATA_NONE = 0 ,
3023- /* CURL_LOCK_DATA_SHARE is used internally to say that
3024- * the locking is just made to change the internal state of the share
3025- * itself.
3027+ /* CURL_LOCK_DATA_SHARE is used internally to say that the locking is made
3028+ * to change the internal state of the share itself.
30263029 */
30273030 CURL_LOCK_DATA_SHARE ,
30283031 CURL_LOCK_DATA_COOKIE ,
@@ -3096,11 +3099,10 @@ typedef enum {
30963099 CURLVERSION_LAST /* never actually use this */
30973100} CURLversion ;
30983101
3099- /* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
3100- basically all programs ever that want to get version information. It is
3101- meant to be a built-in version number for what kind of struct the caller
3102- expects. If the struct ever changes, we redefine the NOW to another enum
3103- from above. */
3102+ /* The 'CURLVERSION_NOW' is the symbolic name meant to be used by programs
3103+ that want to get version information. It is meant to be a built-in
3104+ version number for what kind of struct the caller expects. If the struct
3105+ ever changes, we redefine the NOW to another enum from above. */
31043106#define CURLVERSION_NOW CURLVERSION_TWELFTH
31053107
31063108struct curl_version_info_data {
@@ -3183,7 +3185,8 @@ typedef struct curl_version_info_data curl_version_info_data;
31833185 supported */
31843186#define CURL_VERSION_SSPI (1<<11) /* Built against Windows SSPI */
31853187#define CURL_VERSION_CONV (1<<12) /* Character conversions supported */
3186- #define CURL_VERSION_CURLDEBUG (1<<13) /* Debug memory tracking supported */
3188+ #define CURL_VERSION_CURLDEBUG (1<<13) /* Debug memory tracking supported
3189+ (deprecated) */
31873190#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */
31883191#define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegation to winbind helper
31893192 is supported */
@@ -3212,7 +3215,7 @@ typedef struct curl_version_info_data curl_version_info_data;
32123215 * This function returns a pointer to a static copy of the version info
32133216 * struct. See above.
32143217 */
3215- CURL_EXTERN curl_version_info_data * curl_version_info (CURLversion );
3218+ CURL_EXTERN curl_version_info_data * curl_version_info (CURLversion stamp );
32163219
32173220/*
32183221 * NAME curl_easy_strerror()
@@ -3223,7 +3226,7 @@ CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);
32233226 * into the equivalent human readable error string. This is useful
32243227 * for printing meaningful error messages.
32253228 */
3226- CURL_EXTERN const char * curl_easy_strerror (CURLcode );
3229+ CURL_EXTERN const char * curl_easy_strerror (CURLcode error );
32273230
32283231/*
32293232 * NAME curl_share_strerror()
@@ -3234,7 +3237,7 @@ CURL_EXTERN const char *curl_easy_strerror(CURLcode);
32343237 * into the equivalent human readable error string. This is useful
32353238 * for printing meaningful error messages.
32363239 */
3237- CURL_EXTERN const char * curl_share_strerror (CURLSHcode );
3240+ CURL_EXTERN const char * curl_share_strerror (CURLSHcode error );
32383241
32393242/*
32403243 * NAME curl_easy_pause()
@@ -3248,10 +3251,10 @@ CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
32483251CURL_EXTERN CURLcode curl_easy_pause (CURL * handle , int bitmask );
32493252
32503253#define CURLPAUSE_RECV (1 << 0)
3251- #define CURLPAUSE_RECV_CONT (0)
3254+ #define CURLPAUSE_RECV_CONT 0
32523255
32533256#define CURLPAUSE_SEND (1 << 2)
3254- #define CURLPAUSE_SEND_CONT (0)
3257+ #define CURLPAUSE_SEND_CONT 0
32553258
32563259#define CURLPAUSE_ALL (CURLPAUSE_RECV | CURLPAUSE_SEND)
32573260#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT | CURLPAUSE_SEND_CONT)
@@ -3304,7 +3307,7 @@ CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *handle,
33043307#endif
33053308
33063309/* unfortunately, the easy.h and multi.h include files need options and info
3307- stuff before they can be included! */
3310+ stuff before they can be included! */
33083311#include "easy.h" /* nothing in curl is fun without the easy stuff */
33093312#include "multi.h"
33103313#include "urlapi.h"
@@ -3323,11 +3326,16 @@ CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *handle,
33233326#if defined(__STDC__ ) && (__STDC__ >= 1 )
33243327/* This preprocessor magic that replaces a call with the exact same call is
33253328 only done to make sure application authors pass exactly three arguments
3326- to these functions. */
3327- #define curl_easy_setopt (handle ,opt ,param ) curl_easy_setopt(handle,opt,param)
3328- #define curl_easy_getinfo (handle ,info ,arg ) curl_easy_getinfo(handle,info,arg)
3329- #define curl_share_setopt (share ,opt ,param ) curl_share_setopt(share,opt,param)
3330- #define curl_multi_setopt (handle ,opt ,param ) curl_multi_setopt(handle,opt,param)
3329+ to these functions. Use recursive macros to allow using these symbols via
3330+ the C++ global namespace '::' or reusing them as method names. */
3331+ #define curl_easy_setopt (handle , opt , param ) \
3332+ curl_easy_setopt(handle, opt, param)
3333+ #define curl_easy_getinfo (handle , info , arg ) \
3334+ curl_easy_getinfo(handle, info, arg)
3335+ #define curl_share_setopt (share , opt , param ) \
3336+ curl_share_setopt(share, opt, param)
3337+ #define curl_multi_setopt (handle , opt , param ) \
3338+ curl_multi_setopt(handle, opt, param)
33313339#endif /* __STDC__ >= 1 */
33323340#endif /* gcc >= 4.3 && !__cplusplus && !CURL_DISABLE_TYPECHECK */
33333341
0 commit comments