4242 !defined(CURL_DISABLE_DEPRECATION ) && !defined(BUILDING_LIBCURL )
4343#define CURL_DEPRECATED (version , message ) \
4444 __attribute__((deprecated("since " # version ". " message)))
45- #if defined( __IAR_SYSTEMS_ICC__ )
45+ #ifdef __IAR_SYSTEMS_ICC__
4646#define CURL_IGNORE_DEPRECATION (statements ) \
4747 _Pragma("diag_suppress=Pe1444") \
4848 statements \
9797#include <sys/select.h>
9898#endif
9999
100- #if !defined( _WIN32 ) && !defined( _WIN32_WCE )
100+ #ifndef _WIN32
101101#include <sys/socket.h>
102- #endif
103-
104- #if !defined(_WIN32 )
105102#include <sys/time.h>
106103#endif
107104
108- /* Compatibility for non-Clang compilers */
109- #ifndef __has_declspec_attribute
110- # define __has_declspec_attribute (x ) 0
111- #endif
112-
113105#ifdef __cplusplus
114106extern "C" {
115107#endif
@@ -121,11 +113,17 @@ typedef void CURLSH;
121113 * libcurl external API function linkage decorations.
122114 */
123115
116+ #ifdef __has_declspec_attribute
117+ #define CURL_HAS_DECLSPEC_ATTRIBUTE (x ) __has_declspec_attribute(x)
118+ #else
119+ #define CURL_HAS_DECLSPEC_ATTRIBUTE (x ) 0
120+ #endif
121+
124122#ifdef CURL_STATICLIB
125123# define CURL_EXTERN
126124#elif defined(_WIN32 ) || \
127- (__has_declspec_attribute (dllexport ) && \
128- __has_declspec_attribute (dllimport ))
125+ (CURL_HAS_DECLSPEC_ATTRIBUTE (dllexport ) && \
126+ CURL_HAS_DECLSPEC_ATTRIBUTE (dllimport ))
129127# if defined(BUILDING_LIBCURL )
130128# define CURL_EXTERN __declspec(dllexport)
131129# else
@@ -177,6 +175,16 @@ typedef enum {
177175#define CURLSSLBACKEND_CYASSL CURLSSLBACKEND_WOLFSSL
178176#define CURLSSLBACKEND_DARWINSSL CURLSSLBACKEND_SECURETRANSPORT
179177
178+ /* bits for the CURLOPT_FOLLOWLOCATION option */
179+ #define CURLFOLLOW_ALL 1L /* generic follow redirects */
180+
181+ /* Do not use the custom method in the follow-up request if the HTTP code
182+ instructs so (301, 302, 303). */
183+ #define CURLFOLLOW_OBEYCODE 2L
184+
185+ /* Only use the custom method in the first request, always reset in the next */
186+ #define CURLFOLLOW_FIRSTONLY 3L
187+
180188struct curl_httppost {
181189 struct curl_httppost * next ; /* next entry in the list */
182190 char * name ; /* pointer to allocated name */
@@ -637,7 +645,20 @@ typedef enum {
637645 CURLE_UNRECOVERABLE_POLL , /* 99 - poll/select returned fatal error */
638646 CURLE_TOO_LARGE , /* 100 - a value/data met its maximum */
639647 CURLE_ECH_REQUIRED , /* 101 - ECH tried but failed */
640- CURL_LAST /* never use! */
648+ CURL_LAST , /* never use! */
649+
650+ CURLE_RESERVED115 = 115 , /* 115-126 - used in tests */
651+ CURLE_RESERVED116 = 116 ,
652+ CURLE_RESERVED117 = 117 ,
653+ CURLE_RESERVED118 = 118 ,
654+ CURLE_RESERVED119 = 119 ,
655+ CURLE_RESERVED120 = 120 ,
656+ CURLE_RESERVED121 = 121 ,
657+ CURLE_RESERVED122 = 122 ,
658+ CURLE_RESERVED123 = 123 ,
659+ CURLE_RESERVED124 = 124 ,
660+ CURLE_RESERVED125 = 125 ,
661+ CURLE_RESERVED126 = 126
641662} CURLcode ;
642663
643664#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
@@ -906,12 +927,13 @@ typedef int
906927
907928
908929/* parameter for the CURLOPT_USE_SSL option */
930+ #define CURLUSESSL_NONE 0L /* do not attempt to use SSL */
931+ #define CURLUSESSL_TRY 1L /* try using SSL, proceed anyway otherwise */
932+ #define CURLUSESSL_CONTROL 2L /* SSL for the control connection or fail */
933+ #define CURLUSESSL_ALL 3L /* SSL for all communication or fail */
934+
909935typedef enum {
910- CURLUSESSL_NONE , /* do not attempt to use SSL */
911- CURLUSESSL_TRY , /* try using SSL, proceed anyway otherwise */
912- CURLUSESSL_CONTROL , /* SSL for the control connection or fail */
913- CURLUSESSL_ALL , /* SSL for all communication or fail */
914- CURLUSESSL_LAST /* not an option, never use */
936+ CURLUSESSL_LAST = 4 /* not an option, never use */
915937} curl_usessl ;
916938
917939/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */
@@ -1015,6 +1037,12 @@ typedef enum {
10151037#define CURLALTSVC_H2 (1<<4)
10161038#define CURLALTSVC_H3 (1<<5)
10171039
1040+ /* bitmask values for CURLOPT_UPLOAD_FLAGS */
1041+ #define CURLULFLAG_ANSWERED (1L<<0)
1042+ #define CURLULFLAG_DELETED (1L<<1)
1043+ #define CURLULFLAG_DRAFT (1L<<2)
1044+ #define CURLULFLAG_FLAGGED (1L<<3)
1045+ #define CURLULFLAG_SEEN (1L<<4)
10181046
10191047struct curl_hstsentry {
10201048 char * name ;
@@ -2228,6 +2256,8 @@ typedef enum {
22282256 /* maximum number of keepalive probes (Linux, *BSD, macOS, etc.) */
22292257 CURLOPT (CURLOPT_TCP_KEEPCNT , CURLOPTTYPE_LONG , 326 ),
22302258
2259+ CURLOPT (CURLOPT_UPLOAD_FLAGS , CURLOPTTYPE_LONG , 327 ),
2260+
22312261 CURLOPT_LASTENTRY /* the last unused */
22322262} CURLoption ;
22332263
@@ -2276,26 +2306,25 @@ typedef enum {
22762306 /* Convenient "aliases" */
22772307#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
22782308
2279- /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
2280- enum {
2281- CURL_HTTP_VERSION_NONE , /* setting this means we do not care, and that we
2282- would like the library to choose the best
2283- possible for us! */
2284- CURL_HTTP_VERSION_1_0 , /* please use HTTP 1.0 in the request */
2285- CURL_HTTP_VERSION_1_1 , /* please use HTTP 1.1 in the request */
2286- CURL_HTTP_VERSION_2_0 , /* please use HTTP 2 in the request */
2287- CURL_HTTP_VERSION_2TLS , /* use version 2 for HTTPS, version 1.1 for HTTP */
2288- CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE , /* please use HTTP 2 without HTTP/1.1
2289- Upgrade */
2290- CURL_HTTP_VERSION_3 = 30 , /* Use HTTP/3, fallback to HTTP/2 or HTTP/1 if
2291- needed. For HTTPS only. For HTTP, this option
2292- makes libcurl return error. */
2293- CURL_HTTP_VERSION_3ONLY = 31 , /* Use HTTP/3 without fallback. For HTTPS
2294- only. For HTTP, this makes libcurl
2295- return error. */
2296-
2297- CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
2298- };
2309+ /* These constants are for use with the CURLOPT_HTTP_VERSION option. */
2310+ #define CURL_HTTP_VERSION_NONE 0L /* setting this means we do not care, and
2311+ that we would like the library to choose
2312+ the best possible for us! */
2313+ #define CURL_HTTP_VERSION_1_0 1L /* please use HTTP 1.0 in the request */
2314+ #define CURL_HTTP_VERSION_1_1 2L /* please use HTTP 1.1 in the request */
2315+ #define CURL_HTTP_VERSION_2_0 3L /* please use HTTP 2 in the request */
2316+ #define CURL_HTTP_VERSION_2TLS 4L /* use version 2 for HTTPS, version 1.1 for
2317+ HTTP */
2318+ #define CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 5L /* please use HTTP 2 without
2319+ HTTP/1.1 Upgrade */
2320+ #define CURL_HTTP_VERSION_3 30L /* Use HTTP/3, fallback to HTTP/2 or
2321+ HTTP/1 if needed. For HTTPS only. For
2322+ HTTP, this option makes libcurl
2323+ return error. */
2324+ #define CURL_HTTP_VERSION_3ONLY 31L /* Use HTTP/3 without fallback. For
2325+ HTTPS only. For HTTP, this makes
2326+ libcurl return error. */
2327+ #define CURL_HTTP_VERSION_LAST 32L /* *ILLEGAL* http version */
22992328
23002329/* Convenience definition simple because the name of the version is HTTP/2 and
23012330 not 2.0. The 2_0 version of the enum name was set while the version was
@@ -2305,32 +2334,33 @@ enum {
23052334/*
23062335 * Public API enums for RTSP requests
23072336 */
2308- enum {
2309- CURL_RTSPREQ_NONE , /* first in list */
2310- CURL_RTSPREQ_OPTIONS ,
2311- CURL_RTSPREQ_DESCRIBE ,
2312- CURL_RTSPREQ_ANNOUNCE ,
2313- CURL_RTSPREQ_SETUP ,
2314- CURL_RTSPREQ_PLAY ,
2315- CURL_RTSPREQ_PAUSE ,
2316- CURL_RTSPREQ_TEARDOWN ,
2317- CURL_RTSPREQ_GET_PARAMETER ,
2318- CURL_RTSPREQ_SET_PARAMETER ,
2319- CURL_RTSPREQ_RECORD ,
2320- CURL_RTSPREQ_RECEIVE ,
2321- CURL_RTSPREQ_LAST /* last in list */
2322- };
2337+
2338+ #define CURL_RTSPREQ_NONE 0L
2339+ #define CURL_RTSPREQ_OPTIONS 1L
2340+ #define CURL_RTSPREQ_DESCRIBE 2L
2341+ #define CURL_RTSPREQ_ANNOUNCE 3L
2342+ #define CURL_RTSPREQ_SETUP 4L
2343+ #define CURL_RTSPREQ_PLAY 5L
2344+ #define CURL_RTSPREQ_PAUSE 6L
2345+ #define CURL_RTSPREQ_TEARDOWN 7L
2346+ #define CURL_RTSPREQ_GET_PARAMETER 8L
2347+ #define CURL_RTSPREQ_SET_PARAMETER 9L
2348+ #define CURL_RTSPREQ_RECORD 10L
2349+ #define CURL_RTSPREQ_RECEIVE 11L
2350+ #define CURL_RTSPREQ_LAST 12L /* not used */
23232351
23242352 /* These enums are for use with the CURLOPT_NETRC option. */
2353+ #define CURL_NETRC_IGNORED 0L /* The .netrc will never be read.
2354+ This is the default. */
2355+ #define CURL_NETRC_OPTIONAL 1L /* A user:password in the URL will be preferred
2356+ to one in the .netrc. */
2357+ #define CURL_NETRC_REQUIRED 2L /* A user:password in the URL will be ignored.
2358+ Unless one is set programmatically, the
2359+ .netrc will be queried. */
23252360enum CURL_NETRC_OPTION {
2326- CURL_NETRC_IGNORED , /* The .netrc will never be read.
2327- * This is the default. */
2328- CURL_NETRC_OPTIONAL , /* A user:password in the URL will be preferred
2329- * to one in the .netrc. */
2330- CURL_NETRC_REQUIRED , /* A user:password in the URL will be ignored.
2331- * Unless one is set programmatically, the .netrc
2332- * will be queried. */
2333- CURL_NETRC_LAST
2361+ /* we set a single member here, just to make sure we still provide the enum,
2362+ but the values to use are defined above with L suffixes */
2363+ CURL_NETRC_LAST = 3
23342364};
23352365
23362366#define CURL_SSLVERSION_DEFAULT 0
@@ -2354,10 +2384,13 @@ enum CURL_NETRC_OPTION {
23542384 /* never use, keep last */
23552385#define CURL_SSLVERSION_MAX_LAST (CURL_SSLVERSION_LAST << 16)
23562386
2387+ #define CURL_TLSAUTH_NONE 0L
2388+ #define CURL_TLSAUTH_SRP 1L
2389+
23572390enum CURL_TLSAUTH {
2358- CURL_TLSAUTH_NONE ,
2359- CURL_TLSAUTH_SRP ,
2360- CURL_TLSAUTH_LAST /* never use, keep last */
2391+ /* we set a single member here, just to make sure we still provide the enum ,
2392+ but the values to use are defined above with L suffixes */
2393+ CURL_TLSAUTH_LAST = 2
23612394};
23622395
23632396/* symbols to use with CURLOPT_POSTREDIR.
@@ -2372,14 +2405,16 @@ enum CURL_TLSAUTH {
23722405#define CURL_REDIR_POST_ALL \
23732406 (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
23742407
2375- typedef enum {
2376- CURL_TIMECOND_NONE ,
2377-
2378- CURL_TIMECOND_IFMODSINCE ,
2379- CURL_TIMECOND_IFUNMODSINCE ,
2380- CURL_TIMECOND_LASTMOD ,
2408+ #define CURL_TIMECOND_NONE 0L
2409+ #define CURL_TIMECOND_IFMODSINCE 1L
2410+ #define CURL_TIMECOND_IFUNMODSINCE 2L
2411+ #define CURL_TIMECOND_LASTMOD 3L
23812412
2382- CURL_TIMECOND_LAST
2413+ typedef enum {
2414+ /* we set a single member here, just to make sure we still provide
2415+ the enum typedef, but the values to use are defined above with L
2416+ suffixes */
2417+ CURL_TIMECOND_LAST = 4
23832418} curl_TimeCond ;
23842419
23852420/* Special size_t value signaling a null-terminated string. */
0 commit comments