summaryrefslogtreecommitdiff
path: root/libs/libcurl/include/curl/curl.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libcurl/include/curl/curl.h')
-rw-r--r--libs/libcurl/include/curl/curl.h177
1 files changed, 106 insertions, 71 deletions
diff --git a/libs/libcurl/include/curl/curl.h b/libs/libcurl/include/curl/curl.h
index 2e88c867fd..18a0a9b9d8 100644
--- a/libs/libcurl/include/curl/curl.h
+++ b/libs/libcurl/include/curl/curl.h
@@ -42,7 +42,7 @@
!defined(CURL_DISABLE_DEPRECATION) && !defined(BUILDING_LIBCURL)
#define CURL_DEPRECATED(version, message) \
__attribute__((deprecated("since " # version ". " message)))
-#if defined(__IAR_SYSTEMS_ICC__)
+#ifdef __IAR_SYSTEMS_ICC__
#define CURL_IGNORE_DEPRECATION(statements) \
_Pragma("diag_suppress=Pe1444") \
statements \
@@ -97,19 +97,11 @@
#include <sys/select.h>
#endif
-#if !defined(_WIN32) && !defined(_WIN32_WCE)
+#ifndef _WIN32
#include <sys/socket.h>
-#endif
-
-#if !defined(_WIN32)
#include <sys/time.h>
#endif
-/* Compatibility for non-Clang compilers */
-#ifndef __has_declspec_attribute
-# define __has_declspec_attribute(x) 0
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -121,11 +113,17 @@ typedef void CURLSH;
* libcurl external API function linkage decorations.
*/
+#ifdef __has_declspec_attribute
+#define CURL_HAS_DECLSPEC_ATTRIBUTE(x) __has_declspec_attribute(x)
+#else
+#define CURL_HAS_DECLSPEC_ATTRIBUTE(x) 0
+#endif
+
#ifdef CURL_STATICLIB
# define CURL_EXTERN
#elif defined(_WIN32) || \
- (__has_declspec_attribute(dllexport) && \
- __has_declspec_attribute(dllimport))
+ (CURL_HAS_DECLSPEC_ATTRIBUTE(dllexport) && \
+ CURL_HAS_DECLSPEC_ATTRIBUTE(dllimport))
# if defined(BUILDING_LIBCURL)
# define CURL_EXTERN __declspec(dllexport)
# else
@@ -177,6 +175,16 @@ typedef enum {
#define CURLSSLBACKEND_CYASSL CURLSSLBACKEND_WOLFSSL
#define CURLSSLBACKEND_DARWINSSL CURLSSLBACKEND_SECURETRANSPORT
+/* bits for the CURLOPT_FOLLOWLOCATION option */
+#define CURLFOLLOW_ALL 1L /* generic follow redirects */
+
+/* Do not use the custom method in the follow-up request if the HTTP code
+ instructs so (301, 302, 303). */
+#define CURLFOLLOW_OBEYCODE 2L
+
+/* Only use the custom method in the first request, always reset in the next */
+#define CURLFOLLOW_FIRSTONLY 3L
+
struct curl_httppost {
struct curl_httppost *next; /* next entry in the list */
char *name; /* pointer to allocated name */
@@ -637,7 +645,20 @@ typedef enum {
CURLE_UNRECOVERABLE_POLL, /* 99 - poll/select returned fatal error */
CURLE_TOO_LARGE, /* 100 - a value/data met its maximum */
CURLE_ECH_REQUIRED, /* 101 - ECH tried but failed */
- CURL_LAST /* never use! */
+ CURL_LAST, /* never use! */
+
+ CURLE_RESERVED115 = 115, /* 115-126 - used in tests */
+ CURLE_RESERVED116 = 116,
+ CURLE_RESERVED117 = 117,
+ CURLE_RESERVED118 = 118,
+ CURLE_RESERVED119 = 119,
+ CURLE_RESERVED120 = 120,
+ CURLE_RESERVED121 = 121,
+ CURLE_RESERVED122 = 122,
+ CURLE_RESERVED123 = 123,
+ CURLE_RESERVED124 = 124,
+ CURLE_RESERVED125 = 125,
+ CURLE_RESERVED126 = 126
} CURLcode;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
@@ -906,12 +927,13 @@ typedef int
/* parameter for the CURLOPT_USE_SSL option */
+#define CURLUSESSL_NONE 0L /* do not attempt to use SSL */
+#define CURLUSESSL_TRY 1L /* try using SSL, proceed anyway otherwise */
+#define CURLUSESSL_CONTROL 2L /* SSL for the control connection or fail */
+#define CURLUSESSL_ALL 3L /* SSL for all communication or fail */
+
typedef enum {
- CURLUSESSL_NONE, /* do not attempt to use SSL */
- CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */
- CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
- CURLUSESSL_ALL, /* SSL for all communication or fail */
- CURLUSESSL_LAST /* not an option, never use */
+ CURLUSESSL_LAST = 4 /* not an option, never use */
} curl_usessl;
/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */
@@ -1015,6 +1037,12 @@ typedef enum {
#define CURLALTSVC_H2 (1<<4)
#define CURLALTSVC_H3 (1<<5)
+/* bitmask values for CURLOPT_UPLOAD_FLAGS */
+#define CURLULFLAG_ANSWERED (1L<<0)
+#define CURLULFLAG_DELETED (1L<<1)
+#define CURLULFLAG_DRAFT (1L<<2)
+#define CURLULFLAG_FLAGGED (1L<<3)
+#define CURLULFLAG_SEEN (1L<<4)
struct curl_hstsentry {
char *name;
@@ -2228,6 +2256,8 @@ typedef enum {
/* maximum number of keepalive probes (Linux, *BSD, macOS, etc.) */
CURLOPT(CURLOPT_TCP_KEEPCNT, CURLOPTTYPE_LONG, 326),
+ CURLOPT(CURLOPT_UPLOAD_FLAGS, CURLOPTTYPE_LONG, 327),
+
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
@@ -2276,26 +2306,25 @@ typedef enum {
/* Convenient "aliases" */
#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
- /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
-enum {
- CURL_HTTP_VERSION_NONE, /* setting this means we do not care, and that we
- would like the library to choose the best
- possible for us! */
- CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
- CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
- CURL_HTTP_VERSION_2_0, /* please use HTTP 2 in the request */
- CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
- CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1
- Upgrade */
- CURL_HTTP_VERSION_3 = 30, /* Use HTTP/3, fallback to HTTP/2 or HTTP/1 if
- needed. For HTTPS only. For HTTP, this option
- makes libcurl return error. */
- CURL_HTTP_VERSION_3ONLY = 31, /* Use HTTP/3 without fallback. For HTTPS
- only. For HTTP, this makes libcurl
- return error. */
-
- CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
-};
+/* These constants are for use with the CURLOPT_HTTP_VERSION option. */
+#define CURL_HTTP_VERSION_NONE 0L /* setting this means we do not care, and
+ that we would like the library to choose
+ the best possible for us! */
+#define CURL_HTTP_VERSION_1_0 1L /* please use HTTP 1.0 in the request */
+#define CURL_HTTP_VERSION_1_1 2L /* please use HTTP 1.1 in the request */
+#define CURL_HTTP_VERSION_2_0 3L /* please use HTTP 2 in the request */
+#define CURL_HTTP_VERSION_2TLS 4L /* use version 2 for HTTPS, version 1.1 for
+ HTTP */
+#define CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 5L /* please use HTTP 2 without
+ HTTP/1.1 Upgrade */
+#define CURL_HTTP_VERSION_3 30L /* Use HTTP/3, fallback to HTTP/2 or
+ HTTP/1 if needed. For HTTPS only. For
+ HTTP, this option makes libcurl
+ return error. */
+#define CURL_HTTP_VERSION_3ONLY 31L /* Use HTTP/3 without fallback. For
+ HTTPS only. For HTTP, this makes
+ libcurl return error. */
+#define CURL_HTTP_VERSION_LAST 32L /* *ILLEGAL* http version */
/* Convenience definition simple because the name of the version is HTTP/2 and
not 2.0. The 2_0 version of the enum name was set while the version was
@@ -2305,32 +2334,33 @@ enum {
/*
* Public API enums for RTSP requests
*/
-enum {
- CURL_RTSPREQ_NONE, /* first in list */
- CURL_RTSPREQ_OPTIONS,
- CURL_RTSPREQ_DESCRIBE,
- CURL_RTSPREQ_ANNOUNCE,
- CURL_RTSPREQ_SETUP,
- CURL_RTSPREQ_PLAY,
- CURL_RTSPREQ_PAUSE,
- CURL_RTSPREQ_TEARDOWN,
- CURL_RTSPREQ_GET_PARAMETER,
- CURL_RTSPREQ_SET_PARAMETER,
- CURL_RTSPREQ_RECORD,
- CURL_RTSPREQ_RECEIVE,
- CURL_RTSPREQ_LAST /* last in list */
-};
+
+#define CURL_RTSPREQ_NONE 0L
+#define CURL_RTSPREQ_OPTIONS 1L
+#define CURL_RTSPREQ_DESCRIBE 2L
+#define CURL_RTSPREQ_ANNOUNCE 3L
+#define CURL_RTSPREQ_SETUP 4L
+#define CURL_RTSPREQ_PLAY 5L
+#define CURL_RTSPREQ_PAUSE 6L
+#define CURL_RTSPREQ_TEARDOWN 7L
+#define CURL_RTSPREQ_GET_PARAMETER 8L
+#define CURL_RTSPREQ_SET_PARAMETER 9L
+#define CURL_RTSPREQ_RECORD 10L
+#define CURL_RTSPREQ_RECEIVE 11L
+#define CURL_RTSPREQ_LAST 12L /* not used */
/* These enums are for use with the CURLOPT_NETRC option. */
+#define CURL_NETRC_IGNORED 0L /* The .netrc will never be read.
+ This is the default. */
+#define CURL_NETRC_OPTIONAL 1L /* A user:password in the URL will be preferred
+ to one in the .netrc. */
+#define CURL_NETRC_REQUIRED 2L /* A user:password in the URL will be ignored.
+ Unless one is set programmatically, the
+ .netrc will be queried. */
enum CURL_NETRC_OPTION {
- CURL_NETRC_IGNORED, /* The .netrc will never be read.
- * This is the default. */
- CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred
- * to one in the .netrc. */
- CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored.
- * Unless one is set programmatically, the .netrc
- * will be queried. */
- CURL_NETRC_LAST
+ /* we set a single member here, just to make sure we still provide the enum,
+ but the values to use are defined above with L suffixes */
+ CURL_NETRC_LAST = 3
};
#define CURL_SSLVERSION_DEFAULT 0
@@ -2354,10 +2384,13 @@ enum CURL_NETRC_OPTION {
/* never use, keep last */
#define CURL_SSLVERSION_MAX_LAST (CURL_SSLVERSION_LAST << 16)
+#define CURL_TLSAUTH_NONE 0L
+#define CURL_TLSAUTH_SRP 1L
+
enum CURL_TLSAUTH {
- CURL_TLSAUTH_NONE,
- CURL_TLSAUTH_SRP,
- CURL_TLSAUTH_LAST /* never use, keep last */
+ /* we set a single member here, just to make sure we still provide the enum,
+ but the values to use are defined above with L suffixes */
+ CURL_TLSAUTH_LAST = 2
};
/* symbols to use with CURLOPT_POSTREDIR.
@@ -2372,14 +2405,16 @@ enum CURL_TLSAUTH {
#define CURL_REDIR_POST_ALL \
(CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
-typedef enum {
- CURL_TIMECOND_NONE,
-
- CURL_TIMECOND_IFMODSINCE,
- CURL_TIMECOND_IFUNMODSINCE,
- CURL_TIMECOND_LASTMOD,
+#define CURL_TIMECOND_NONE 0L
+#define CURL_TIMECOND_IFMODSINCE 1L
+#define CURL_TIMECOND_IFUNMODSINCE 2L
+#define CURL_TIMECOND_LASTMOD 3L
- CURL_TIMECOND_LAST
+typedef enum {
+ /* we set a single member here, just to make sure we still provide
+ the enum typedef, but the values to use are defined above with L
+ suffixes */
+ CURL_TIMECOND_LAST = 4
} curl_TimeCond;
/* Special size_t value signaling a null-terminated string. */