42
42
!defined(CURL_DISABLE_DEPRECATION ) && !defined(BUILDING_LIBCURL )
43
43
#define CURL_DEPRECATED (version , message ) \
44
44
__attribute__((deprecated("since " # version ". " message)))
45
- #if defined( __IAR_SYSTEMS_ICC__ )
45
+ #ifdef __IAR_SYSTEMS_ICC__
46
46
#define CURL_IGNORE_DEPRECATION (statements ) \
47
47
_Pragma("diag_suppress=Pe1444") \
48
48
statements \
97
97
#include <sys/select.h>
98
98
#endif
99
99
100
- #if !defined( _WIN32 ) && !defined( _WIN32_WCE )
100
+ #ifndef _WIN32
101
101
#include <sys/socket.h>
102
- #endif
103
-
104
- #if !defined(_WIN32 )
105
102
#include <sys/time.h>
106
103
#endif
107
104
108
- /* Compatibility for non-Clang compilers */
109
- #ifndef __has_declspec_attribute
110
- # define __has_declspec_attribute (x ) 0
111
- #endif
112
-
113
105
#ifdef __cplusplus
114
106
extern "C" {
115
107
#endif
@@ -121,11 +113,17 @@ typedef void CURLSH;
121
113
* libcurl external API function linkage decorations.
122
114
*/
123
115
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
+
124
122
#ifdef CURL_STATICLIB
125
123
# define CURL_EXTERN
126
124
#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 ))
129
127
# if defined(BUILDING_LIBCURL )
130
128
# define CURL_EXTERN __declspec(dllexport)
131
129
# else
@@ -177,6 +175,16 @@ typedef enum {
177
175
#define CURLSSLBACKEND_CYASSL CURLSSLBACKEND_WOLFSSL
178
176
#define CURLSSLBACKEND_DARWINSSL CURLSSLBACKEND_SECURETRANSPORT
179
177
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
+
180
188
struct curl_httppost {
181
189
struct curl_httppost * next ; /* next entry in the list */
182
190
char * name ; /* pointer to allocated name */
@@ -637,7 +645,20 @@ typedef enum {
637
645
CURLE_UNRECOVERABLE_POLL , /* 99 - poll/select returned fatal error */
638
646
CURLE_TOO_LARGE , /* 100 - a value/data met its maximum */
639
647
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
641
662
} CURLcode ;
642
663
643
664
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
@@ -906,12 +927,13 @@ typedef int
906
927
907
928
908
929
/* 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
+
909
935
typedef 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 */
915
937
} curl_usessl ;
916
938
917
939
/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */
@@ -1015,6 +1037,12 @@ typedef enum {
1015
1037
#define CURLALTSVC_H2 (1<<4)
1016
1038
#define CURLALTSVC_H3 (1<<5)
1017
1039
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)
1018
1046
1019
1047
struct curl_hstsentry {
1020
1048
char * name ;
@@ -2228,6 +2256,8 @@ typedef enum {
2228
2256
/* maximum number of keepalive probes (Linux, *BSD, macOS, etc.) */
2229
2257
CURLOPT (CURLOPT_TCP_KEEPCNT , CURLOPTTYPE_LONG , 326 ),
2230
2258
2259
+ CURLOPT (CURLOPT_UPLOAD_FLAGS , CURLOPTTYPE_LONG , 327 ),
2260
+
2231
2261
CURLOPT_LASTENTRY /* the last unused */
2232
2262
} CURLoption ;
2233
2263
@@ -2276,26 +2306,25 @@ typedef enum {
2276
2306
/* Convenient "aliases" */
2277
2307
#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
2278
2308
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 */
2299
2328
2300
2329
/* Convenience definition simple because the name of the version is HTTP/2 and
2301
2330
not 2.0. The 2_0 version of the enum name was set while the version was
@@ -2305,32 +2334,33 @@ enum {
2305
2334
/*
2306
2335
* Public API enums for RTSP requests
2307
2336
*/
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 */
2323
2351
2324
2352
/* 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. */
2325
2360
enum 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
2334
2364
};
2335
2365
2336
2366
#define CURL_SSLVERSION_DEFAULT 0
@@ -2354,10 +2384,13 @@ enum CURL_NETRC_OPTION {
2354
2384
/* never use, keep last */
2355
2385
#define CURL_SSLVERSION_MAX_LAST (CURL_SSLVERSION_LAST << 16)
2356
2386
2387
+ #define CURL_TLSAUTH_NONE 0L
2388
+ #define CURL_TLSAUTH_SRP 1L
2389
+
2357
2390
enum 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
2361
2394
};
2362
2395
2363
2396
/* symbols to use with CURLOPT_POSTREDIR.
@@ -2372,14 +2405,16 @@ enum CURL_TLSAUTH {
2372
2405
#define CURL_REDIR_POST_ALL \
2373
2406
(CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
2374
2407
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
2381
2412
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
2383
2418
} curl_TimeCond ;
2384
2419
2385
2420
/* Special size_t value signaling a null-terminated string. */
0 commit comments