Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-05 09:09:22

0001 #ifndef CURLINC_CURL_H
0002 #define CURLINC_CURL_H
0003 /***************************************************************************
0004  *                                  _   _ ____  _
0005  *  Project                     ___| | | |  _ \| |
0006  *                             / __| | | | |_) | |
0007  *                            | (__| |_| |  _ <| |___
0008  *                             \___|\___/|_| \_\_____|
0009  *
0010  * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
0011  *
0012  * This software is licensed as described in the file COPYING, which
0013  * you should have received as part of this distribution. The terms
0014  * are also available at https://curl.se/docs/copyright.html.
0015  *
0016  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
0017  * copies of the Software, and permit persons to whom the Software is
0018  * furnished to do so, under the terms of the COPYING file.
0019  *
0020  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
0021  * KIND, either express or implied.
0022  *
0023  * SPDX-License-Identifier: curl
0024  *
0025  ***************************************************************************/
0026 
0027 /*
0028  * If you have libcurl problems, all docs and details are found here:
0029  *   https://curl.se/libcurl/
0030  */
0031 
0032 #ifdef CURL_NO_OLDIES
0033 #define CURL_STRICTER /* not used since 8.11.0 */
0034 #endif
0035 
0036 /* Compile-time deprecation macros. */
0037 #if (defined(__GNUC__) &&                                              \
0038   ((__GNUC__ > 12) || ((__GNUC__ == 12) && (__GNUC_MINOR__ >= 1))) ||  \
0039   (defined(__clang__) && __clang_major__ >= 3) ||                      \
0040   defined(__IAR_SYSTEMS_ICC__)) &&                                     \
0041   !defined(__INTEL_COMPILER) &&                                        \
0042   !defined(CURL_DISABLE_DEPRECATION) && !defined(BUILDING_LIBCURL)
0043 #define CURL_DEPRECATED(version, message)                       \
0044   __attribute__((deprecated("since " # version ". " message)))
0045 #ifdef __IAR_SYSTEMS_ICC__
0046 #define CURL_IGNORE_DEPRECATION(statements) \
0047       _Pragma("diag_suppress=Pe1444") \
0048       statements \
0049       _Pragma("diag_default=Pe1444")
0050 #else
0051 #define CURL_IGNORE_DEPRECATION(statements) \
0052       _Pragma("GCC diagnostic push") \
0053       _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
0054       statements \
0055       _Pragma("GCC diagnostic pop")
0056 #endif
0057 #else
0058 #define CURL_DEPRECATED(version, message)
0059 #define CURL_IGNORE_DEPRECATION(statements)     statements
0060 #endif
0061 
0062 #include "curlver.h"         /* libcurl version defines */
0063 #include "system.h"          /* determine things runtime */
0064 
0065 #include <stdio.h>
0066 #include <limits.h>
0067 
0068 #if defined(__FreeBSD__) || defined(__MidnightBSD__)
0069 /* Needed for __FreeBSD_version or __MidnightBSD_version symbol definition */
0070 #include <sys/param.h>
0071 #endif
0072 
0073 /* The include stuff here below is mainly for time_t! */
0074 #include <sys/types.h>
0075 #include <time.h>
0076 
0077 #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
0078 #if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \
0079       defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
0080 /* The check above prevents the winsock2.h inclusion if winsock.h already was
0081    included, since they cannot co-exist without problems */
0082 #include <winsock2.h>
0083 #include <ws2tcpip.h>
0084 #endif
0085 #endif
0086 
0087 /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
0088    libc5-based Linux systems. Only include it on systems that are known to
0089    require it! */
0090 #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
0091     defined(__minix) || defined(__INTEGRITY) || \
0092     defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
0093     defined(__CYGWIN__) || defined(AMIGA) || defined(__NuttX__) || \
0094    (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) || \
0095    (defined(__MidnightBSD_version) && (__MidnightBSD_version < 100000)) || \
0096     defined(__sun__) || defined(__serenity__) || defined(__vxworks__)
0097 #include <sys/select.h>
0098 #endif
0099 
0100 #ifndef _WIN32
0101 #include <sys/socket.h>
0102 #include <sys/time.h>
0103 #endif
0104 
0105 #ifdef __cplusplus
0106 extern "C" {
0107 #endif
0108 
0109 typedef void CURL;
0110 typedef void CURLSH;
0111 
0112 /*
0113  * libcurl external API function linkage decorations.
0114  */
0115 
0116 #ifdef __has_declspec_attribute
0117 #define CURL_HAS_DECLSPEC_ATTRIBUTE(x) __has_declspec_attribute(x)
0118 #else
0119 #define CURL_HAS_DECLSPEC_ATTRIBUTE(x) 0
0120 #endif
0121 
0122 #ifdef CURL_STATICLIB
0123 #  define CURL_EXTERN
0124 #elif defined(_WIN32) || \
0125      (CURL_HAS_DECLSPEC_ATTRIBUTE(dllexport) && \
0126       CURL_HAS_DECLSPEC_ATTRIBUTE(dllimport))
0127 #  ifdef BUILDING_LIBCURL
0128 #    define CURL_EXTERN  __declspec(dllexport)
0129 #  else
0130 #    define CURL_EXTERN  __declspec(dllimport)
0131 #  endif
0132 #elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS)
0133 #  define CURL_EXTERN CURL_EXTERN_SYMBOL
0134 #else
0135 #  define CURL_EXTERN
0136 #endif
0137 
0138 #ifndef curl_socket_typedef
0139 /* socket typedef */
0140 #if defined(_WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H)
0141 typedef SOCKET curl_socket_t;
0142 #define CURL_SOCKET_BAD INVALID_SOCKET
0143 #else
0144 typedef int curl_socket_t;
0145 #define CURL_SOCKET_BAD (-1)
0146 #endif
0147 #define curl_socket_typedef
0148 #endif /* curl_socket_typedef */
0149 
0150 /* enum for the different supported SSL backends */
0151 typedef enum {
0152   CURLSSLBACKEND_NONE = 0,
0153   CURLSSLBACKEND_OPENSSL = 1,
0154   CURLSSLBACKEND_GNUTLS = 2,
0155   CURLSSLBACKEND_NSS                    CURL_DEPRECATED(8.3.0, "") = 3,
0156   CURLSSLBACKEND_OBSOLETE4 = 4,  /* Was QSOSSL. */
0157   CURLSSLBACKEND_GSKIT                  CURL_DEPRECATED(8.3.0, "") = 5,
0158   CURLSSLBACKEND_POLARSSL               CURL_DEPRECATED(7.69.0, "") = 6,
0159   CURLSSLBACKEND_WOLFSSL = 7,
0160   CURLSSLBACKEND_SCHANNEL = 8,
0161   CURLSSLBACKEND_SECURETRANSPORT        CURL_DEPRECATED(8.15.0, "") = 9,
0162   CURLSSLBACKEND_AXTLS                  CURL_DEPRECATED(7.61.0, "") = 10,
0163   CURLSSLBACKEND_MBEDTLS = 11,
0164   CURLSSLBACKEND_MESALINK               CURL_DEPRECATED(7.82.0, "") = 12,
0165   CURLSSLBACKEND_BEARSSL                CURL_DEPRECATED(8.15.0, "") = 13,
0166   CURLSSLBACKEND_RUSTLS = 14
0167 } curl_sslbackend;
0168 
0169 /* aliases for library clones and renames */
0170 #define CURLSSLBACKEND_AWSLC CURLSSLBACKEND_OPENSSL
0171 #define CURLSSLBACKEND_BORINGSSL CURLSSLBACKEND_OPENSSL
0172 #define CURLSSLBACKEND_LIBRESSL CURLSSLBACKEND_OPENSSL
0173 
0174 /* deprecated names: */
0175 #define CURLSSLBACKEND_CYASSL CURLSSLBACKEND_WOLFSSL
0176 #define CURLSSLBACKEND_DARWINSSL CURLSSLBACKEND_SECURETRANSPORT
0177 
0178 /* bits for the CURLOPT_FOLLOWLOCATION option */
0179 #define CURLFOLLOW_ALL       1L /* generic follow redirects */
0180 
0181 /* Do not use the custom method in the follow-up request if the HTTP code
0182    instructs so (301, 302, 303). */
0183 #define CURLFOLLOW_OBEYCODE  2L
0184 
0185 /* Only use the custom method in the first request, always reset in the next */
0186 #define CURLFOLLOW_FIRSTONLY 3L
0187 
0188 struct curl_httppost {
0189   struct curl_httppost *next;       /* next entry in the list */
0190   char *name;                       /* pointer to allocated name */
0191   long namelength;                  /* length of name length */
0192   char *contents;                   /* pointer to allocated data contents */
0193   long contentslength;              /* length of contents field, see also
0194                                        CURL_HTTPPOST_LARGE */
0195   char *buffer;                     /* pointer to allocated buffer contents */
0196   long bufferlength;                /* length of buffer field */
0197   char *contenttype;                /* Content-Type */
0198   struct curl_slist *contentheader; /* list of extra headers for this form */
0199   struct curl_httppost *more;       /* if one field name has more than one
0200                                        file, this link should link to following
0201                                        files */
0202   long flags;                       /* as defined below */
0203 
0204 /* specified content is a filename */
0205 #define CURL_HTTPPOST_FILENAME (1 << 0)
0206 /* specified content is a filename */
0207 #define CURL_HTTPPOST_READFILE (1 << 1)
0208 /* name is only stored pointer do not free in formfree */
0209 #define CURL_HTTPPOST_PTRNAME (1 << 2)
0210 /* contents is only stored pointer do not free in formfree */
0211 #define CURL_HTTPPOST_PTRCONTENTS (1 << 3)
0212 /* upload file from buffer */
0213 #define CURL_HTTPPOST_BUFFER (1 << 4)
0214 /* upload file from pointer contents */
0215 #define CURL_HTTPPOST_PTRBUFFER (1 << 5)
0216 /* upload file contents by using the regular read callback to get the data and
0217    pass the given pointer as custom pointer */
0218 #define CURL_HTTPPOST_CALLBACK (1 << 6)
0219 /* use size in 'contentlen', added in 7.46.0 */
0220 #define CURL_HTTPPOST_LARGE (1 << 7)
0221 
0222   char *showfilename;               /* The filename to show. If not set, the
0223                                        actual filename is used (if this is
0224                                        a file part) */
0225   void *userp;                      /* custom pointer used for
0226                                        HTTPPOST_CALLBACK posts */
0227   curl_off_t contentlen;            /* alternative length of contents
0228                                        field. Used if CURL_HTTPPOST_LARGE is
0229                                        set. Added in 7.46.0 */
0230 };
0231 
0232 /* This is a return code for the progress callback that, when returned,
0233    signals libcurl to continue executing the default progress function */
0234 #define CURL_PROGRESSFUNC_CONTINUE 0x10000001
0235 
0236 /* This is the CURLOPT_PROGRESSFUNCTION callback prototype. It is now
0237    considered deprecated but was the only choice up until 7.31.0 */
0238 typedef int (*curl_progress_callback)(void *clientp,
0239                                       double dltotal,
0240                                       double dlnow,
0241                                       double ultotal,
0242                                       double ulnow);
0243 
0244 /* This is the CURLOPT_XFERINFOFUNCTION callback prototype. It was introduced
0245    in 7.32.0, avoids the use of floating point numbers and provides more
0246    detailed information. */
0247 typedef int (*curl_xferinfo_callback)(void *clientp,
0248                                       curl_off_t dltotal,
0249                                       curl_off_t dlnow,
0250                                       curl_off_t ultotal,
0251                                       curl_off_t ulnow);
0252 
0253 #ifndef CURL_MAX_READ_SIZE
0254   /* The maximum receive buffer size configurable via CURLOPT_BUFFERSIZE. */
0255 #define CURL_MAX_READ_SIZE (10*1024*1024)
0256 #endif
0257 
0258 #ifndef CURL_MAX_WRITE_SIZE
0259   /* Tests have proven that 20K is a bad buffer size for uploads on Windows,
0260      while 16K for some odd reason performed a lot better. We do the ifndef
0261      check to allow this value to easier be changed at build time for those
0262      who feel adventurous. The practical minimum is about 400 bytes since
0263      libcurl uses a buffer of this size as a scratch area (unrelated to
0264      network send operations). */
0265 #define CURL_MAX_WRITE_SIZE 16384
0266 #endif
0267 
0268 #ifndef CURL_MAX_HTTP_HEADER
0269 /* The only reason to have a max limit for this is to avoid the risk of a bad
0270    server feeding libcurl with a never-ending header that causes reallocs
0271    infinitely */
0272 #define CURL_MAX_HTTP_HEADER (100*1024)
0273 #endif
0274 
0275 /* This is a magic return code for the write callback that, when returned,
0276    signals libcurl to pause receiving on the current transfer. */
0277 #define CURL_WRITEFUNC_PAUSE 0x10000001
0278 
0279 /* This is a magic return code for the write callback that, when returned,
0280    signals an error from the callback. */
0281 #define CURL_WRITEFUNC_ERROR 0xFFFFFFFF
0282 
0283 typedef size_t (*curl_write_callback)(char *buffer,
0284                                       size_t size,
0285                                       size_t nitems,
0286                                       void *outstream);
0287 
0288 /* This callback is called when a new resolver request is made */
0289 typedef int (*curl_resolver_start_callback)(void *resolver_state,
0290                                             void *reserved, void *userdata);
0291 
0292 /* enumeration of file types */
0293 typedef enum {
0294   CURLFILETYPE_FILE = 0,
0295   CURLFILETYPE_DIRECTORY,
0296   CURLFILETYPE_SYMLINK,
0297   CURLFILETYPE_DEVICE_BLOCK,
0298   CURLFILETYPE_DEVICE_CHAR,
0299   CURLFILETYPE_NAMEDPIPE,
0300   CURLFILETYPE_SOCKET,
0301   CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */
0302 
0303   CURLFILETYPE_UNKNOWN /* should never occur */
0304 } curlfiletype;
0305 
0306 #define CURLFINFOFLAG_KNOWN_FILENAME    (1 << 0)
0307 #define CURLFINFOFLAG_KNOWN_FILETYPE    (1 << 1)
0308 #define CURLFINFOFLAG_KNOWN_TIME        (1 << 2)
0309 #define CURLFINFOFLAG_KNOWN_PERM        (1 << 3)
0310 #define CURLFINFOFLAG_KNOWN_UID         (1 << 4)
0311 #define CURLFINFOFLAG_KNOWN_GID         (1 << 5)
0312 #define CURLFINFOFLAG_KNOWN_SIZE        (1 << 6)
0313 #define CURLFINFOFLAG_KNOWN_HLINKCOUNT  (1 << 7)
0314 
0315 /* Information about a single file, used when doing FTP wildcard matching */
0316 struct curl_fileinfo {
0317   char *filename;
0318   curlfiletype filetype;
0319   time_t time; /* always zero! */
0320   unsigned int perm;
0321   int uid;
0322   int gid;
0323   curl_off_t size;
0324   long int hardlinks;
0325 
0326   struct {
0327     /* If some of these fields is not NULL, it is a pointer to b_data. */
0328     char *time;
0329     char *perm;
0330     char *user;
0331     char *group;
0332     char *target; /* pointer to the target filename of a symlink */
0333   } strings;
0334 
0335   unsigned int flags;
0336 
0337   /* These are libcurl private struct fields. Previously used by libcurl, so
0338      they must never be interfered with. */
0339   char *b_data;
0340   size_t b_size;
0341   size_t b_used;
0342 };
0343 
0344 /* return codes for CURLOPT_CHUNK_BGN_FUNCTION */
0345 #define CURL_CHUNK_BGN_FUNC_OK      0
0346 #define CURL_CHUNK_BGN_FUNC_FAIL    1 /* tell the lib to end the task */
0347 #define CURL_CHUNK_BGN_FUNC_SKIP    2 /* skip this chunk over */
0348 
0349 /* if splitting of data transfer is enabled, this callback is called before
0350    download of an individual chunk started. Note that parameter "remains" works
0351    only for FTP wildcard downloading (for now), otherwise is not used */
0352 typedef long (*curl_chunk_bgn_callback)(const void *transfer_info,
0353                                         void *ptr,
0354                                         int remains);
0355 
0356 /* return codes for CURLOPT_CHUNK_END_FUNCTION */
0357 #define CURL_CHUNK_END_FUNC_OK      0
0358 #define CURL_CHUNK_END_FUNC_FAIL    1 /* tell the lib to end the task */
0359 
0360 /* If splitting of data transfer is enabled this callback is called after
0361    download of an individual chunk finished.
0362    Note! After this callback was set then it have to be called FOR ALL chunks.
0363    Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.
0364    This is the reason why we do not need "transfer_info" parameter in this
0365    callback and we are not interested in "remains" parameter too. */
0366 typedef long (*curl_chunk_end_callback)(void *ptr);
0367 
0368 /* return codes for FNMATCHFUNCTION */
0369 #define CURL_FNMATCHFUNC_MATCH    0 /* string corresponds to the pattern */
0370 #define CURL_FNMATCHFUNC_NOMATCH  1 /* pattern does not match the string */
0371 #define CURL_FNMATCHFUNC_FAIL     2 /* an error occurred */
0372 
0373 /* callback type for wildcard downloading pattern matching. If the
0374    string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */
0375 typedef int (*curl_fnmatch_callback)(void *ptr,
0376                                      const char *pattern,
0377                                      const char *string);
0378 
0379 /* These are the return codes for the seek callbacks */
0380 #define CURL_SEEKFUNC_OK       0
0381 #define CURL_SEEKFUNC_FAIL     1 /* fail the entire transfer */
0382 #define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so
0383                                     libcurl might try other means instead */
0384 typedef int (*curl_seek_callback)(void *instream,
0385                                   curl_off_t offset,
0386                                   int origin); /* 'whence' */
0387 
0388 /* This is a return code for the read callback that, when returned,
0389    signals libcurl to immediately abort the current transfer. */
0390 #define CURL_READFUNC_ABORT 0x10000000
0391 /* This is a return code for the read callback that, when returned,
0392    signals libcurl to pause sending data on the current transfer. */
0393 #define CURL_READFUNC_PAUSE 0x10000001
0394 
0395 /* Return code for when the trailing headers' callback has terminated
0396    without any errors */
0397 #define CURL_TRAILERFUNC_OK 0
0398 /* Return code for when was an error in the trailing header's list and we
0399   want to abort the request */
0400 #define CURL_TRAILERFUNC_ABORT 1
0401 
0402 typedef size_t (*curl_read_callback)(char *buffer,
0403                                      size_t size,
0404                                      size_t nitems,
0405                                      void *instream);
0406 
0407 typedef int (*curl_trailer_callback)(struct curl_slist **list,
0408                                      void *userdata);
0409 
0410 typedef enum {
0411   CURLSOCKTYPE_IPCXN,  /* socket created for a specific IP connection */
0412   CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */
0413   CURLSOCKTYPE_LAST    /* never use */
0414 } curlsocktype;
0415 
0416 /* The return code from the sockopt_callback can signal information back
0417    to libcurl: */
0418 #define CURL_SOCKOPT_OK 0
0419 #define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return
0420                                 CURLE_ABORTED_BY_CALLBACK */
0421 #define CURL_SOCKOPT_ALREADY_CONNECTED 2
0422 
0423 typedef int (*curl_sockopt_callback)(void *clientp,
0424                                      curl_socket_t curlfd,
0425                                      curlsocktype purpose);
0426 
0427 struct curl_sockaddr {
0428   int family;
0429   int socktype;
0430   int protocol;
0431   unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it
0432                            turned really ugly and painful on the systems that
0433                            lack this type */
0434   struct sockaddr addr;
0435 };
0436 
0437 typedef curl_socket_t
0438 (*curl_opensocket_callback)(void *clientp,
0439                             curlsocktype purpose,
0440                             struct curl_sockaddr *address);
0441 
0442 typedef int
0443 (*curl_closesocket_callback)(void *clientp, curl_socket_t item);
0444 
0445 typedef enum {
0446   CURLIOE_OK,            /* I/O operation successful */
0447   CURLIOE_UNKNOWNCMD,    /* command was unknown to callback */
0448   CURLIOE_FAILRESTART,   /* failed to restart the read */
0449   CURLIOE_LAST           /* never use */
0450 } curlioerr;
0451 
0452 typedef enum {
0453   CURLIOCMD_NOP,         /* no operation */
0454   CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
0455   CURLIOCMD_LAST         /* never use */
0456 } curliocmd;
0457 
0458 typedef curlioerr (*curl_ioctl_callback)(CURL *handle,
0459                                          int cmd,
0460                                          void *clientp);
0461 
0462 #ifndef CURL_DID_MEMORY_FUNC_TYPEDEFS
0463 /*
0464  * The following typedef's are signatures of malloc, free, realloc, strdup and
0465  * calloc respectively. Function pointers of these types can be passed to the
0466  * curl_global_init_mem() function to set user defined memory management
0467  * callback routines.
0468  */
0469 typedef void *(*curl_malloc_callback)(size_t size);
0470 typedef void (*curl_free_callback)(void *ptr);
0471 typedef void *(*curl_realloc_callback)(void *ptr, size_t size);
0472 typedef char *(*curl_strdup_callback)(const char *str);
0473 typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
0474 
0475 #define CURL_DID_MEMORY_FUNC_TYPEDEFS
0476 #endif
0477 
0478 /* the kind of data that is passed to information_callback */
0479 typedef enum {
0480   CURLINFO_TEXT = 0,
0481   CURLINFO_HEADER_IN,    /* 1 */
0482   CURLINFO_HEADER_OUT,   /* 2 */
0483   CURLINFO_DATA_IN,      /* 3 */
0484   CURLINFO_DATA_OUT,     /* 4 */
0485   CURLINFO_SSL_DATA_IN,  /* 5 */
0486   CURLINFO_SSL_DATA_OUT, /* 6 */
0487   CURLINFO_END
0488 } curl_infotype;
0489 
0490 typedef int (*curl_debug_callback)
0491        (CURL *handle,      /* the handle/transfer this concerns */
0492         curl_infotype type, /* what kind of data */
0493         char *data,        /* points to the data */
0494         size_t size,       /* size of the data pointed to */
0495         void *userptr);    /* whatever the user please */
0496 
0497 /* This is the CURLOPT_PREREQFUNCTION callback prototype. */
0498 typedef int (*curl_prereq_callback)(void *clientp,
0499                                     char *conn_primary_ip,
0500                                     char *conn_local_ip,
0501                                     int conn_primary_port,
0502                                     int conn_local_port);
0503 
0504 /* Return code for when the pre-request callback has terminated without
0505    any errors */
0506 #define CURL_PREREQFUNC_OK 0
0507 /* Return code for when the pre-request callback wants to abort the
0508    request */
0509 #define CURL_PREREQFUNC_ABORT 1
0510 
0511 /* All possible error codes from all sorts of curl functions. Future versions
0512    may return other values, stay prepared.
0513 
0514    Always add new return codes last. Never *EVER* remove any. The return
0515    codes must remain the same!
0516  */
0517 
0518 typedef enum {
0519   CURLE_OK = 0,
0520   CURLE_UNSUPPORTED_PROTOCOL,    /* 1 */
0521   CURLE_FAILED_INIT,             /* 2 */
0522   CURLE_URL_MALFORMAT,           /* 3 */
0523   CURLE_NOT_BUILT_IN,            /* 4 - [was obsoleted in August 2007 for
0524                                     7.17.0, reused in April 2011 for 7.21.5] */
0525   CURLE_COULDNT_RESOLVE_PROXY,   /* 5 */
0526   CURLE_COULDNT_RESOLVE_HOST,    /* 6 */
0527   CURLE_COULDNT_CONNECT,         /* 7 */
0528   CURLE_WEIRD_SERVER_REPLY,      /* 8 */
0529   CURLE_REMOTE_ACCESS_DENIED,    /* 9 a service was denied by the server
0530                                     due to lack of access - when login fails
0531                                     this is not returned. */
0532   CURLE_FTP_ACCEPT_FAILED,       /* 10 - [was obsoleted in April 2006 for
0533                                     7.15.4, reused in Dec 2011 for 7.24.0]*/
0534   CURLE_FTP_WEIRD_PASS_REPLY,    /* 11 */
0535   CURLE_FTP_ACCEPT_TIMEOUT,      /* 12 - timeout occurred accepting server
0536                                     [was obsoleted in August 2007 for 7.17.0,
0537                                     reused in Dec 2011 for 7.24.0]*/
0538   CURLE_FTP_WEIRD_PASV_REPLY,    /* 13 */
0539   CURLE_FTP_WEIRD_227_FORMAT,    /* 14 */
0540   CURLE_FTP_CANT_GET_HOST,       /* 15 */
0541   CURLE_HTTP2,                   /* 16 - A problem in the http2 framing layer.
0542                                     [was obsoleted in August 2007 for 7.17.0,
0543                                     reused in July 2014 for 7.38.0] */
0544   CURLE_FTP_COULDNT_SET_TYPE,    /* 17 */
0545   CURLE_PARTIAL_FILE,            /* 18 */
0546   CURLE_FTP_COULDNT_RETR_FILE,   /* 19 */
0547   CURLE_OBSOLETE20,              /* 20 - NOT USED */
0548   CURLE_QUOTE_ERROR,             /* 21 - quote command failure */
0549   CURLE_HTTP_RETURNED_ERROR,     /* 22 */
0550   CURLE_WRITE_ERROR,             /* 23 */
0551   CURLE_OBSOLETE24,              /* 24 - NOT USED */
0552   CURLE_UPLOAD_FAILED,           /* 25 - failed upload "command" */
0553   CURLE_READ_ERROR,              /* 26 - could not open/read from file */
0554   CURLE_OUT_OF_MEMORY,           /* 27 */
0555   CURLE_OPERATION_TIMEDOUT,      /* 28 - the timeout time was reached */
0556   CURLE_OBSOLETE29,              /* 29 - NOT USED */
0557   CURLE_FTP_PORT_FAILED,         /* 30 - FTP PORT operation failed */
0558   CURLE_FTP_COULDNT_USE_REST,    /* 31 - the REST command failed */
0559   CURLE_OBSOLETE32,              /* 32 - NOT USED */
0560   CURLE_RANGE_ERROR,             /* 33 - RANGE "command" did not work */
0561   CURLE_OBSOLETE34,              /* 34 */
0562   CURLE_SSL_CONNECT_ERROR,       /* 35 - wrong when connecting with SSL */
0563   CURLE_BAD_DOWNLOAD_RESUME,     /* 36 - could not resume download */
0564   CURLE_FILE_COULDNT_READ_FILE,  /* 37 */
0565   CURLE_LDAP_CANNOT_BIND,        /* 38 */
0566   CURLE_LDAP_SEARCH_FAILED,      /* 39 */
0567   CURLE_OBSOLETE40,              /* 40 - NOT USED */
0568   CURLE_OBSOLETE41,              /* 41 - NOT USED starting with 7.53.0 */
0569   CURLE_ABORTED_BY_CALLBACK,     /* 42 */
0570   CURLE_BAD_FUNCTION_ARGUMENT,   /* 43 */
0571   CURLE_OBSOLETE44,              /* 44 - NOT USED */
0572   CURLE_INTERFACE_FAILED,        /* 45 - CURLOPT_INTERFACE failed */
0573   CURLE_OBSOLETE46,              /* 46 - NOT USED */
0574   CURLE_TOO_MANY_REDIRECTS,      /* 47 - catch endless re-direct loops */
0575   CURLE_UNKNOWN_OPTION,          /* 48 - User specified an unknown option */
0576   CURLE_SETOPT_OPTION_SYNTAX,    /* 49 - Malformed setopt option */
0577   CURLE_OBSOLETE50,              /* 50 - NOT USED */
0578   CURLE_OBSOLETE51,              /* 51 - NOT USED */
0579   CURLE_GOT_NOTHING,             /* 52 - when this is a specific error */
0580   CURLE_SSL_ENGINE_NOTFOUND,     /* 53 - SSL crypto engine not found */
0581   CURLE_SSL_ENGINE_SETFAILED,    /* 54 - can not set SSL crypto engine as
0582                                     default */
0583   CURLE_SEND_ERROR,              /* 55 - failed sending network data */
0584   CURLE_RECV_ERROR,              /* 56 - failure in receiving network data */
0585   CURLE_OBSOLETE57,              /* 57 - NOT IN USE */
0586   CURLE_SSL_CERTPROBLEM,         /* 58 - problem with the local certificate */
0587   CURLE_SSL_CIPHER,              /* 59 - could not use specified cipher */
0588   CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint
0589                                      was not verified fine */
0590   CURLE_BAD_CONTENT_ENCODING,    /* 61 - Unrecognized/bad encoding */
0591   CURLE_OBSOLETE62,              /* 62 - NOT IN USE since 7.82.0 */
0592   CURLE_FILESIZE_EXCEEDED,       /* 63 - Maximum file size exceeded */
0593   CURLE_USE_SSL_FAILED,          /* 64 - Requested FTP SSL level failed */
0594   CURLE_SEND_FAIL_REWIND,        /* 65 - Sending the data requires a rewind
0595                                     that failed */
0596   CURLE_SSL_ENGINE_INITFAILED,   /* 66 - failed to initialise ENGINE */
0597   CURLE_LOGIN_DENIED,            /* 67 - user, password or similar was not
0598                                     accepted and we failed to login */
0599   CURLE_TFTP_NOTFOUND,           /* 68 - file not found on server */
0600   CURLE_TFTP_PERM,               /* 69 - permission problem on server */
0601   CURLE_REMOTE_DISK_FULL,        /* 70 - out of disk space on server */
0602   CURLE_TFTP_ILLEGAL,            /* 71 - Illegal TFTP operation */
0603   CURLE_TFTP_UNKNOWNID,          /* 72 - Unknown transfer ID */
0604   CURLE_REMOTE_FILE_EXISTS,      /* 73 - File already exists */
0605   CURLE_TFTP_NOSUCHUSER,         /* 74 - No such user */
0606   CURLE_OBSOLETE75,              /* 75 - NOT IN USE since 7.82.0 */
0607   CURLE_OBSOLETE76,              /* 76 - NOT IN USE since 7.82.0 */
0608   CURLE_SSL_CACERT_BADFILE,      /* 77 - could not load CACERT file, missing
0609                                     or wrong format */
0610   CURLE_REMOTE_FILE_NOT_FOUND,   /* 78 - remote file not found */
0611   CURLE_SSH,                     /* 79 - error from the SSH layer, somewhat
0612                                     generic so the error message is of
0613                                     interest when this has happened */
0614 
0615   CURLE_SSL_SHUTDOWN_FAILED,     /* 80 - Failed to shut down the SSL
0616                                     connection */
0617   CURLE_AGAIN,                   /* 81 - socket is not ready for send/recv,
0618                                     wait till it is ready and try again (Added
0619                                     in 7.18.2) */
0620   CURLE_SSL_CRL_BADFILE,         /* 82 - could not load CRL file, missing or
0621                                     wrong format (Added in 7.19.0) */
0622   CURLE_SSL_ISSUER_ERROR,        /* 83 - Issuer check failed.  (Added in
0623                                     7.19.0) */
0624   CURLE_FTP_PRET_FAILED,         /* 84 - a PRET command failed */
0625   CURLE_RTSP_CSEQ_ERROR,         /* 85 - mismatch of RTSP CSeq numbers */
0626   CURLE_RTSP_SESSION_ERROR,      /* 86 - mismatch of RTSP Session Ids */
0627   CURLE_FTP_BAD_FILE_LIST,       /* 87 - unable to parse FTP file list */
0628   CURLE_CHUNK_FAILED,            /* 88 - chunk callback reported error */
0629   CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the
0630                                     session is queued */
0631   CURLE_SSL_PINNEDPUBKEYNOTMATCH, /* 90 - specified pinned public key did not
0632                                      match */
0633   CURLE_SSL_INVALIDCERTSTATUS,   /* 91 - invalid certificate status */
0634   CURLE_HTTP2_STREAM,            /* 92 - stream error in HTTP/2 framing layer
0635                                     */
0636   CURLE_RECURSIVE_API_CALL,      /* 93 - an api function was called from
0637                                     inside a callback */
0638   CURLE_AUTH_ERROR,              /* 94 - an authentication function returned an
0639                                     error */
0640   CURLE_HTTP3,                   /* 95 - An HTTP/3 layer problem */
0641   CURLE_QUIC_CONNECT_ERROR,      /* 96 - QUIC connection error */
0642   CURLE_PROXY,                   /* 97 - proxy handshake error */
0643   CURLE_SSL_CLIENTCERT,          /* 98 - client-side certificate required */
0644   CURLE_UNRECOVERABLE_POLL,      /* 99 - poll/select returned fatal error */
0645   CURLE_TOO_LARGE,               /* 100 - a value/data met its maximum */
0646   CURLE_ECH_REQUIRED,            /* 101 - ECH tried but failed */
0647   CURL_LAST /* never use! */
0648 } CURLcode;
0649 
0650 #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
0651                           the obsolete stuff removed! */
0652 
0653 /* removed in 7.53.0 */
0654 #define CURLE_FUNCTION_NOT_FOUND CURLE_OBSOLETE41
0655 
0656 /* removed in 7.56.0 */
0657 #define CURLE_HTTP_POST_ERROR CURLE_OBSOLETE34
0658 
0659 /* Previously obsolete error code reused in 7.38.0 */
0660 #define CURLE_OBSOLETE16 CURLE_HTTP2
0661 
0662 /* Previously obsolete error codes reused in 7.24.0 */
0663 #define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED
0664 #define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT
0665 
0666 /*  compatibility with older names */
0667 #define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING
0668 #define CURLE_FTP_WEIRD_SERVER_REPLY CURLE_WEIRD_SERVER_REPLY
0669 
0670 /* The following were added in 7.62.0 */
0671 #define CURLE_SSL_CACERT CURLE_PEER_FAILED_VERIFICATION
0672 
0673 /* The following were added in 7.21.5, April 2011 */
0674 #define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION
0675 
0676 /* Added for 7.78.0 */
0677 #define CURLE_TELNET_OPTION_SYNTAX CURLE_SETOPT_OPTION_SYNTAX
0678 
0679 /* The following were added in 7.17.1 */
0680 /* These are scheduled to disappear by 2009 */
0681 #define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION
0682 
0683 /* The following were added in 7.17.0 */
0684 /* These are scheduled to disappear by 2009 */
0685 #define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */
0686 #define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46
0687 #define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44
0688 #define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10
0689 #define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16
0690 #define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32
0691 #define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29
0692 #define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12
0693 #define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20
0694 #define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40
0695 #define CURLE_MALFORMAT_USER CURLE_OBSOLETE24
0696 #define CURLE_SHARE_IN_USE CURLE_OBSOLETE57
0697 #define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN
0698 
0699 #define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED
0700 #define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE
0701 #define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR
0702 #define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL
0703 #define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS
0704 #define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR
0705 #define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED
0706 
0707 /* The following were added earlier */
0708 
0709 #define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT
0710 #define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR
0711 #define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED
0712 #define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED
0713 #define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
0714 #define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
0715 #define CURLE_LDAP_INVALID_URL CURLE_OBSOLETE62
0716 #define CURLE_CONV_REQD CURLE_OBSOLETE76
0717 #define CURLE_CONV_FAILED CURLE_OBSOLETE75
0718 
0719 /* This was the error code 50 in 7.7.3 and a few earlier versions, this
0720    is no longer used by libcurl but is instead #defined here only to not
0721    make programs break */
0722 #define CURLE_ALREADY_COMPLETE 99999
0723 
0724 /* Provide defines for really old option names */
0725 #define CURLOPT_FILE CURLOPT_WRITEDATA /* name changed in 7.9.7 */
0726 #define CURLOPT_INFILE CURLOPT_READDATA /* name changed in 7.9.7 */
0727 #define CURLOPT_WRITEHEADER CURLOPT_HEADERDATA
0728 
0729 /* Since long deprecated options with no code in the lib that does anything
0730    with them. */
0731 #define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40
0732 #define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72
0733 #define CURLOPT_OBSOLETE72 9999
0734 #define CURLOPT_OBSOLETE40 9999
0735 
0736 #endif /* !CURL_NO_OLDIES */
0737 
0738 /*
0739  * Proxy error codes. Returned in CURLINFO_PROXY_ERROR if CURLE_PROXY was
0740  * return for the transfers.
0741  */
0742 typedef enum {
0743   CURLPX_OK,
0744   CURLPX_BAD_ADDRESS_TYPE,
0745   CURLPX_BAD_VERSION,
0746   CURLPX_CLOSED,
0747   CURLPX_GSSAPI,
0748   CURLPX_GSSAPI_PERMSG,
0749   CURLPX_GSSAPI_PROTECTION,
0750   CURLPX_IDENTD,
0751   CURLPX_IDENTD_DIFFER,
0752   CURLPX_LONG_HOSTNAME,
0753   CURLPX_LONG_PASSWD,
0754   CURLPX_LONG_USER,
0755   CURLPX_NO_AUTH,
0756   CURLPX_RECV_ADDRESS,
0757   CURLPX_RECV_AUTH,
0758   CURLPX_RECV_CONNECT,
0759   CURLPX_RECV_REQACK,
0760   CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED,
0761   CURLPX_REPLY_COMMAND_NOT_SUPPORTED,
0762   CURLPX_REPLY_CONNECTION_REFUSED,
0763   CURLPX_REPLY_GENERAL_SERVER_FAILURE,
0764   CURLPX_REPLY_HOST_UNREACHABLE,
0765   CURLPX_REPLY_NETWORK_UNREACHABLE,
0766   CURLPX_REPLY_NOT_ALLOWED,
0767   CURLPX_REPLY_TTL_EXPIRED,
0768   CURLPX_REPLY_UNASSIGNED,
0769   CURLPX_REQUEST_FAILED,
0770   CURLPX_RESOLVE_HOST,
0771   CURLPX_SEND_AUTH,
0772   CURLPX_SEND_CONNECT,
0773   CURLPX_SEND_REQUEST,
0774   CURLPX_UNKNOWN_FAIL,
0775   CURLPX_UNKNOWN_MODE,
0776   CURLPX_USER_REJECTED,
0777   CURLPX_LAST /* never use */
0778 } CURLproxycode;
0779 
0780 /* This prototype applies to all conversion callbacks */
0781 typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
0782 
0783 typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl,    /* easy handle */
0784                                           void *ssl_ctx, /* actually an OpenSSL
0785                                                             or wolfSSL SSL_CTX,
0786                                                             or an mbedTLS
0787                                                           mbedtls_ssl_config */
0788                                           void *userptr);
0789 
0790 #define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
0791                                         to use CONNECT HTTP/1.1 */
0792 #define CURLPROXY_HTTP_1_0        1L /* force to use CONNECT HTTP/1.0
0793                                         added in 7.19.4 */
0794 #define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
0795                                         added in 7.52.0 */
0796 #define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
0797                                         added in 8.2.0 */
0798 #define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
0799                                         already in 7.10 */
0800 #define CURLPROXY_SOCKS5          5L /* added in 7.10 */
0801 #define CURLPROXY_SOCKS4A         6L /* added in 7.18.0 */
0802 #define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
0803                                         the hostname rather than the IP
0804                                         address. added in 7.18.0 */
0805 
0806 typedef enum {
0807   CURLPROXY_LAST = 8 /* never use */
0808 } curl_proxytype;  /* this enum was added in 7.10 */
0809 
0810 /*
0811  * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:
0812  *
0813  * CURLAUTH_NONE         - No HTTP authentication
0814  * CURLAUTH_BASIC        - HTTP Basic authentication (default)
0815  * CURLAUTH_DIGEST       - HTTP Digest authentication
0816  * CURLAUTH_NEGOTIATE    - HTTP Negotiate (SPNEGO) authentication
0817  * CURLAUTH_GSSNEGOTIATE - Alias for CURLAUTH_NEGOTIATE (deprecated)
0818  * CURLAUTH_NTLM         - HTTP NTLM authentication
0819  * CURLAUTH_DIGEST_IE    - HTTP Digest authentication with IE flavour
0820  * CURLAUTH_NTLM_WB      - HTTP NTLM authentication delegated to winbind helper
0821  * CURLAUTH_BEARER       - HTTP Bearer token authentication
0822  * CURLAUTH_ONLY         - Use together with a single other type to force no
0823  *                         authentication or that single type
0824  * CURLAUTH_ANY          - All fine types set
0825  * CURLAUTH_ANYSAFE      - All fine types except Basic
0826  */
0827 
0828 #define CURLAUTH_NONE         ((unsigned long)0)
0829 #define CURLAUTH_BASIC        (((unsigned long)1) << 0)
0830 #define CURLAUTH_DIGEST       (((unsigned long)1) << 1)
0831 #define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
0832 /* Deprecated since the advent of CURLAUTH_NEGOTIATE */
0833 #define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE
0834 /* Used for CURLOPT_SOCKS5_AUTH to stay terminologically correct */
0835 #define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
0836 #define CURLAUTH_NTLM         (((unsigned long)1) << 3)
0837 #define CURLAUTH_DIGEST_IE    (((unsigned long)1) << 4)
0838 #ifndef CURL_NO_OLDIES
0839   /* functionality removed since 8.8.0 */
0840 #define CURLAUTH_NTLM_WB      (((unsigned long)1) << 5)
0841 #endif
0842 #define CURLAUTH_BEARER       (((unsigned long)1) << 6)
0843 #define CURLAUTH_AWS_SIGV4    (((unsigned long)1) << 7)
0844 #define CURLAUTH_ONLY         (((unsigned long)1) << 31)
0845 #define CURLAUTH_ANY          ((~CURLAUTH_DIGEST_IE) & \
0846                                ((unsigned long)0xffffffff))
0847 #define CURLAUTH_ANYSAFE      ((~(CURLAUTH_BASIC | CURLAUTH_DIGEST_IE)) & \
0848                                ((unsigned long)0xffffffff))
0849 
0850 /* all types supported by server */
0851 #define CURLSSH_AUTH_ANY       ((unsigned long)0xffffffff)
0852 #define CURLSSH_AUTH_NONE      0L        /* none allowed, silly but complete */
0853 #define CURLSSH_AUTH_PUBLICKEY (1L << 0) /* public/private key files */
0854 #define CURLSSH_AUTH_PASSWORD  (1L << 1) /* password */
0855 #define CURLSSH_AUTH_HOST      (1L << 2) /* host key files */
0856 #define CURLSSH_AUTH_KEYBOARD  (1L << 3) /* keyboard interactive */
0857 #define CURLSSH_AUTH_AGENT     (1L << 4) /* agent (ssh-agent, pageant...) */
0858 #define CURLSSH_AUTH_GSSAPI    (1L << 5) /* gssapi (kerberos, ...) */
0859 #define CURLSSH_AUTH_DEFAULT   CURLSSH_AUTH_ANY
0860 
0861 #define CURLGSSAPI_DELEGATION_NONE        0L      /* no delegation (default) */
0862 #define CURLGSSAPI_DELEGATION_POLICY_FLAG (1L<<0) /* if permitted by policy */
0863 #define CURLGSSAPI_DELEGATION_FLAG        (1L<<1) /* delegate always */
0864 
0865 #define CURL_ERROR_SIZE 256
0866 
0867 enum curl_khtype {
0868   CURLKHTYPE_UNKNOWN,
0869   CURLKHTYPE_RSA1,
0870   CURLKHTYPE_RSA,
0871   CURLKHTYPE_DSS,
0872   CURLKHTYPE_ECDSA,
0873   CURLKHTYPE_ED25519
0874 };
0875 
0876 struct curl_khkey {
0877   const char *key; /* points to a null-terminated string encoded with base64
0878                       if len is zero, otherwise to the "raw" data */
0879   size_t len;
0880   enum curl_khtype keytype;
0881 };
0882 
0883 /* this is the set of return values expected from the curl_sshkeycallback
0884    callback */
0885 enum curl_khstat {
0886   CURLKHSTAT_FINE_ADD_TO_FILE,
0887   CURLKHSTAT_FINE,
0888   CURLKHSTAT_REJECT, /* reject the connection, return an error */
0889   CURLKHSTAT_DEFER,  /* do not accept it, but we cannot answer right now.
0890                         Causes a CURLE_PEER_FAILED_VERIFICATION error but the
0891                         connection is left intact etc */
0892   CURLKHSTAT_FINE_REPLACE, /* accept and replace the wrong key */
0893   CURLKHSTAT_LAST    /* not for use, only a marker for last-in-list */
0894 };
0895 
0896 /* this is the set of status codes pass in to the callback */
0897 enum curl_khmatch {
0898   CURLKHMATCH_OK,       /* match */
0899   CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
0900   CURLKHMATCH_MISSING,  /* no matching host/key found */
0901   CURLKHMATCH_LAST      /* not for use, only a marker for last-in-list */
0902 };
0903 
0904 typedef int
0905   (*curl_sshkeycallback) (CURL *easy,     /* easy handle */
0906                           const struct curl_khkey *knownkey, /* known */
0907                           const struct curl_khkey *foundkey, /* found */
0908                           enum curl_khmatch, /* libcurl's view on the keys */
0909                           void *clientp); /* custom pointer passed with */
0910                                           /* CURLOPT_SSH_KEYDATA */
0911 
0912 typedef int
0913   (*curl_sshhostkeycallback) (void *clientp,/* custom pointer passed */
0914                                             /* with CURLOPT_SSH_HOSTKEYDATA */
0915                           int keytype, /* CURLKHTYPE */
0916                           const char *key, /* hostkey to check */
0917                           size_t keylen); /* length of the key */
0918                           /* return CURLE_OK to accept */
0919                           /* or something else to refuse */
0920 
0921 /* parameter for the CURLOPT_USE_SSL option */
0922 #define CURLUSESSL_NONE    0L /* do not attempt to use SSL */
0923 #define CURLUSESSL_TRY     1L /* try using SSL, proceed anyway otherwise */
0924 #define CURLUSESSL_CONTROL 2L /* SSL for the control connection or fail */
0925 #define CURLUSESSL_ALL     3L /* SSL for all communication or fail */
0926 
0927 typedef enum {
0928   CURLUSESSL_LAST = 4 /* not an option, never use */
0929 } curl_usessl;
0930 
0931 /* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */
0932 
0933 /* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the
0934    name of improving interoperability with older servers. Some SSL libraries
0935    have introduced work-arounds for this flaw but those work-arounds sometimes
0936    make the SSL communication fail. To regain functionality with those broken
0937    servers, a user can this way allow the vulnerability back. */
0938 #define CURLSSLOPT_ALLOW_BEAST (1L << 0)
0939 
0940 /* - NO_REVOKE tells libcurl to disable certificate revocation checks for those
0941    SSL backends where such behavior is present. */
0942 #define CURLSSLOPT_NO_REVOKE (1L << 1)
0943 
0944 /* - NO_PARTIALCHAIN tells libcurl to *NOT* accept a partial certificate chain
0945    if possible. The OpenSSL backend has this ability. */
0946 #define CURLSSLOPT_NO_PARTIALCHAIN (1L << 2)
0947 
0948 /* - REVOKE_BEST_EFFORT tells libcurl to ignore certificate revocation offline
0949    checks and ignore missing revocation list for those SSL backends where such
0950    behavior is present. */
0951 #define CURLSSLOPT_REVOKE_BEST_EFFORT (1L << 3)
0952 
0953 /* - CURLSSLOPT_NATIVE_CA tells libcurl to use standard certificate store of
0954    operating system. Currently implemented under MS-Windows. */
0955 #define CURLSSLOPT_NATIVE_CA (1L << 4)
0956 
0957 /* - CURLSSLOPT_AUTO_CLIENT_CERT tells libcurl to automatically locate and use
0958    a client certificate for authentication. (Schannel) */
0959 #define CURLSSLOPT_AUTO_CLIENT_CERT (1L << 5)
0960 
0961 /* If possible, send data using TLS 1.3 early data */
0962 #define CURLSSLOPT_EARLYDATA (1L << 6)
0963 
0964 /* The default connection attempt delay in milliseconds for happy eyeballs.
0965    CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document
0966    this value, keep them in sync. */
0967 #define CURL_HET_DEFAULT 200L
0968 
0969 /* The default connection upkeep interval in milliseconds. */
0970 #define CURL_UPKEEP_INTERVAL_DEFAULT 60000L
0971 
0972 #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
0973                           the obsolete stuff removed! */
0974 
0975 /* Backwards compatibility with older names */
0976 /* These are scheduled to disappear by 2009 */
0977 
0978 #define CURLFTPSSL_NONE CURLUSESSL_NONE
0979 #define CURLFTPSSL_TRY CURLUSESSL_TRY
0980 #define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL
0981 #define CURLFTPSSL_ALL CURLUSESSL_ALL
0982 #define CURLFTPSSL_LAST CURLUSESSL_LAST
0983 #define curl_ftpssl curl_usessl
0984 #endif /* !CURL_NO_OLDIES */
0985 
0986 /* parameter for the CURLOPT_FTP_SSL_CCC option */
0987 #define CURLFTPSSL_CCC_NONE    0L /* do not send CCC */
0988 #define CURLFTPSSL_CCC_PASSIVE 1L /* Let the server initiate the shutdown */
0989 #define CURLFTPSSL_CCC_ACTIVE  2L /* Initiate the shutdown */
0990 
0991 typedef enum {
0992   CURLFTPSSL_CCC_LAST = 3 /* not an option, never use */
0993 } curl_ftpccc;
0994 
0995 /* parameter for the CURLOPT_FTPSSLAUTH option */
0996 #define CURLFTPAUTH_DEFAULT 0L /* let libcurl decide */
0997 #define CURLFTPAUTH_SSL     1L /* use "AUTH SSL" */
0998 #define CURLFTPAUTH_TLS     2L /* use "AUTH TLS" */
0999 
1000 typedef enum {
1001   CURLFTPAUTH_LAST = 3 /* not an option, never use */
1002 } curl_ftpauth;
1003 
1004 /* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
1005 #define CURLFTP_CREATE_DIR_NONE  0L /* do NOT create missing dirs! */
1006 #define CURLFTP_CREATE_DIR       1L /* (FTP/SFTP) if CWD fails, try MKD and
1007                                        then CWD again if MKD succeeded, for
1008                                        SFTP this does similar magic */
1009 #define CURLFTP_CREATE_DIR_RETRY 2L /* (FTP only) if CWD fails, try MKD and
1010                                        then CWD again even if MKD failed! */
1011 
1012 typedef enum {
1013   CURLFTP_CREATE_DIR_LAST = 3 /* not an option, never use */
1014 } curl_ftpcreatedir;
1015 
1016 /* parameter for the CURLOPT_FTP_FILEMETHOD option */
1017 #define CURLFTPMETHOD_DEFAULT   0L /* let libcurl pick */
1018 #define CURLFTPMETHOD_MULTICWD  1L /* single CWD operation for each path
1019                                       part */
1020 #define CURLFTPMETHOD_NOCWD     2L /* no CWD at all */
1021 #define CURLFTPMETHOD_SINGLECWD 3L /* one CWD to full dir, then work on file */
1022 
1023 typedef enum {
1024   CURLFTPMETHOD_LAST = 4 /* not an option, never use */
1025 } curl_ftpmethod;
1026 
1027 /* bitmask defines for CURLOPT_HEADEROPT */
1028 #define CURLHEADER_UNIFIED  0L
1029 #define CURLHEADER_SEPARATE (1L << 0)
1030 
1031 /* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */
1032 #define CURLALTSVC_READONLYFILE (1L << 2)
1033 #define CURLALTSVC_H1           (1L << 3)
1034 #define CURLALTSVC_H2           (1L << 4)
1035 #define CURLALTSVC_H3           (1L << 5)
1036 
1037 /* bitmask values for CURLOPT_UPLOAD_FLAGS */
1038 #define CURLULFLAG_ANSWERED (1L << 0)
1039 #define CURLULFLAG_DELETED  (1L << 1)
1040 #define CURLULFLAG_DRAFT    (1L << 2)
1041 #define CURLULFLAG_FLAGGED  (1L << 3)
1042 #define CURLULFLAG_SEEN     (1L << 4)
1043 
1044 struct curl_hstsentry {
1045   char *name;
1046   size_t namelen;
1047   unsigned int includeSubDomains:1;
1048   char expire[18]; /* YYYYMMDD HH:MM:SS [null-terminated] */
1049 };
1050 
1051 struct curl_index {
1052   size_t index; /* the provided entry's "index" or count */
1053   size_t total; /* total number of entries to save */
1054 };
1055 
1056 typedef enum {
1057   CURLSTS_OK,
1058   CURLSTS_DONE,
1059   CURLSTS_FAIL
1060 } CURLSTScode;
1061 
1062 typedef CURLSTScode (*curl_hstsread_callback)(CURL *easy,
1063                                               struct curl_hstsentry *e,
1064                                               void *userp);
1065 typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,
1066                                                struct curl_hstsentry *e,
1067                                                struct curl_index *i,
1068                                                void *userp);
1069 
1070 /* CURLHSTS_* are bits for the CURLOPT_HSTS option */
1071 #define CURLHSTS_ENABLE       (1L << 0)
1072 #define CURLHSTS_READONLYFILE (1L << 1)
1073 
1074 /* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS
1075    options. Do not use. */
1076 #define CURLPROTO_HTTP    (1L << 0)
1077 #define CURLPROTO_HTTPS   (1L << 1)
1078 #define CURLPROTO_FTP     (1L << 2)
1079 #define CURLPROTO_FTPS    (1L << 3)
1080 #define CURLPROTO_SCP     (1L << 4)
1081 #define CURLPROTO_SFTP    (1L << 5)
1082 #define CURLPROTO_TELNET  (1L << 6)
1083 #define CURLPROTO_LDAP    (1L << 7)
1084 #define CURLPROTO_LDAPS   (1L << 8)
1085 #define CURLPROTO_DICT    (1L << 9)
1086 #define CURLPROTO_FILE    (1L << 10)
1087 #define CURLPROTO_TFTP    (1L << 11)
1088 #define CURLPROTO_IMAP    (1L << 12)
1089 #define CURLPROTO_IMAPS   (1L << 13)
1090 #define CURLPROTO_POP3    (1L << 14)
1091 #define CURLPROTO_POP3S   (1L << 15)
1092 #define CURLPROTO_SMTP    (1L << 16)
1093 #define CURLPROTO_SMTPS   (1L << 17)
1094 #define CURLPROTO_RTSP    (1L << 18)
1095 #define CURLPROTO_RTMP    (1L << 19)
1096 #define CURLPROTO_RTMPT   (1L << 20)
1097 #define CURLPROTO_RTMPE   (1L << 21)
1098 #define CURLPROTO_RTMPTE  (1L << 22)
1099 #define CURLPROTO_RTMPS   (1L << 23)
1100 #define CURLPROTO_RTMPTS  (1L << 24)
1101 #define CURLPROTO_GOPHER  (1L << 25)
1102 #define CURLPROTO_SMB     (1L << 26)
1103 #define CURLPROTO_SMBS    (1L << 27)
1104 #define CURLPROTO_MQTT    (1L << 28)
1105 #define CURLPROTO_GOPHERS (1L << 29)
1106 #define CURLPROTO_ALL     ((unsigned long)0xffffffff) /* old-style enable
1107                                                          "everything" */
1108 
1109 /* long may be 32 or 64 bits, but we should never depend on anything else
1110    but 32 */
1111 #define CURLOPTTYPE_LONG          0
1112 #define CURLOPTTYPE_OBJECTPOINT   10000
1113 #define CURLOPTTYPE_FUNCTIONPOINT 20000
1114 #define CURLOPTTYPE_OFF_T         30000
1115 #define CURLOPTTYPE_BLOB          40000
1116 
1117 /* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the
1118    string options from the header file */
1119 
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))
1123 
1124 /* CURLOPT aliases that make no runtime difference */
1125 
1126 /* 'char *' argument to a string with a trailing zero */
1127 #define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT
1128 
1129 /* 'struct curl_slist *' argument */
1130 #define CURLOPTTYPE_SLISTPOINT  CURLOPTTYPE_OBJECTPOINT
1131 
1132 /* 'void *' argument passed untouched to callback */
1133 #define CURLOPTTYPE_CBPOINT     CURLOPTTYPE_OBJECTPOINT
1134 
1135 /* 'long' argument with a set of values/bitmask */
1136 #define CURLOPTTYPE_VALUES      CURLOPTTYPE_LONG
1137 
1138 /*
1139  * All CURLOPT_* values.
1140  */
1141 
1142 typedef enum {
1143   /* This is the FILE * or void * the regular output should be written to. */
1144   CURLOPT(CURLOPT_WRITEDATA, CURLOPTTYPE_CBPOINT, 1),
1145 
1146   /* The full URL to get/put */
1147   CURLOPT(CURLOPT_URL, CURLOPTTYPE_STRINGPOINT, 2),
1148 
1149   /* Port number to connect to, if other than default. */
1150   CURLOPT(CURLOPT_PORT, CURLOPTTYPE_LONG, 3),
1151 
1152   /* Name of proxy to use. */
1153   CURLOPT(CURLOPT_PROXY, CURLOPTTYPE_STRINGPOINT, 4),
1154 
1155   /* "user:password;options" to use when fetching. */
1156   CURLOPT(CURLOPT_USERPWD, CURLOPTTYPE_STRINGPOINT, 5),
1157 
1158   /* "user:password" to use with proxy. */
1159   CURLOPT(CURLOPT_PROXYUSERPWD, CURLOPTTYPE_STRINGPOINT, 6),
1160 
1161   /* Range to get, specified as an ASCII string. */
1162   CURLOPT(CURLOPT_RANGE, CURLOPTTYPE_STRINGPOINT, 7),
1163 
1164   /* not used */
1165 
1166   /* Specified file stream to upload from (use as input): */
1167   CURLOPT(CURLOPT_READDATA, CURLOPTTYPE_CBPOINT, 9),
1168 
1169   /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
1170    * bytes big. */
1171   CURLOPT(CURLOPT_ERRORBUFFER, CURLOPTTYPE_OBJECTPOINT, 10),
1172 
1173   /* Function that is called to store the output (instead of fwrite). The
1174    * parameters use fwrite() syntax, make sure to follow them. */
1175   CURLOPT(CURLOPT_WRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 11),
1176 
1177   /* Function that is called to read the input (instead of fread). The
1178    * parameters use fread() syntax, make sure to follow them. */
1179   CURLOPT(CURLOPT_READFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 12),
1180 
1181   /* Time-out the read operation after this amount of seconds */
1182   CURLOPT(CURLOPT_TIMEOUT, CURLOPTTYPE_LONG, 13),
1183 
1184   /* If CURLOPT_READDATA is used, this can be used to inform libcurl about
1185    * how large the file being sent really is. That allows better error
1186    * checking and better verifies that the upload was successful. -1 means
1187    * unknown size.
1188    *
1189    * For large file support, there is also a _LARGE version of the key
1190    * which takes an off_t type, allowing platforms with larger off_t
1191    * sizes to handle larger files. See below for INFILESIZE_LARGE.
1192    */
1193   CURLOPT(CURLOPT_INFILESIZE, CURLOPTTYPE_LONG, 14),
1194 
1195   /* POST static input fields. */
1196   CURLOPT(CURLOPT_POSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 15),
1197 
1198   /* Set the referrer page (needed by some CGIs) */
1199   CURLOPT(CURLOPT_REFERER, CURLOPTTYPE_STRINGPOINT, 16),
1200 
1201   /* Set the FTP PORT string (interface name, named or numerical IP address)
1202      Use i.e '-' to use default address. */
1203   CURLOPT(CURLOPT_FTPPORT, CURLOPTTYPE_STRINGPOINT, 17),
1204 
1205   /* Set the User-Agent string (examined by some CGIs) */
1206   CURLOPT(CURLOPT_USERAGENT, CURLOPTTYPE_STRINGPOINT, 18),
1207 
1208   /* If the download receives less than "low speed limit" bytes/second
1209    * during "low speed time" seconds, the operations is aborted.
1210    * You could i.e if you have a pretty high speed connection, abort if
1211    * it is less than 2000 bytes/sec during 20 seconds.
1212    */
1213 
1214   /* Set the "low speed limit" */
1215   CURLOPT(CURLOPT_LOW_SPEED_LIMIT, CURLOPTTYPE_LONG, 19),
1216 
1217   /* Set the "low speed time" */
1218   CURLOPT(CURLOPT_LOW_SPEED_TIME, CURLOPTTYPE_LONG, 20),
1219 
1220   /* Set the continuation offset.
1221    *
1222    * Note there is also a _LARGE version of this key which uses
1223    * off_t types, allowing for large file offsets on platforms which
1224    * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
1225    */
1226   CURLOPT(CURLOPT_RESUME_FROM, CURLOPTTYPE_LONG, 21),
1227 
1228   /* Set cookie in request: */
1229   CURLOPT(CURLOPT_COOKIE, CURLOPTTYPE_STRINGPOINT, 22),
1230 
1231   /* This points to a linked list of headers, struct curl_slist kind. This
1232      list is also used for RTSP (in spite of its name) */
1233   CURLOPT(CURLOPT_HTTPHEADER, CURLOPTTYPE_SLISTPOINT, 23),
1234 
1235   /* This points to a linked list of post entries, struct curl_httppost */
1236   CURLOPTDEPRECATED(CURLOPT_HTTPPOST, CURLOPTTYPE_OBJECTPOINT, 24,
1237                     7.56.0, "Use CURLOPT_MIMEPOST"),
1238 
1239   /* name of the file keeping your private SSL-certificate */
1240   CURLOPT(CURLOPT_SSLCERT, CURLOPTTYPE_STRINGPOINT, 25),
1241 
1242   /* password for the SSL or SSH private key */
1243   CURLOPT(CURLOPT_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 26),
1244 
1245   /* send TYPE parameter? */
1246   CURLOPT(CURLOPT_CRLF, CURLOPTTYPE_LONG, 27),
1247 
1248   /* send linked-list of QUOTE commands */
1249   CURLOPT(CURLOPT_QUOTE, CURLOPTTYPE_SLISTPOINT, 28),
1250 
1251   /* send FILE * or void * to store headers to, if you use a callback it
1252      is passed to the callback unmodified */
1253   CURLOPT(CURLOPT_HEADERDATA, CURLOPTTYPE_CBPOINT, 29),
1254 
1255   /* point to a file to read the initial cookies from, also enables
1256      "cookie awareness" */
1257   CURLOPT(CURLOPT_COOKIEFILE, CURLOPTTYPE_STRINGPOINT, 31),
1258 
1259   /* What version to specifically try to use.
1260      See CURL_SSLVERSION defines below. */
1261   CURLOPT(CURLOPT_SSLVERSION, CURLOPTTYPE_VALUES, 32),
1262 
1263   /* What kind of HTTP time condition to use, see defines */
1264   CURLOPT(CURLOPT_TIMECONDITION, CURLOPTTYPE_VALUES, 33),
1265 
1266   /* Time to use with the above condition. Specified in number of seconds
1267      since 1 Jan 1970 */
1268   CURLOPT(CURLOPT_TIMEVALUE, CURLOPTTYPE_LONG, 34),
1269 
1270   /* 35 = OBSOLETE */
1271 
1272   /* Custom request, for customizing the get command like
1273      HTTP: DELETE, TRACE and others
1274      FTP: to use a different list command
1275      */
1276   CURLOPT(CURLOPT_CUSTOMREQUEST, CURLOPTTYPE_STRINGPOINT, 36),
1277 
1278   /* FILE handle to use instead of stderr */
1279   CURLOPT(CURLOPT_STDERR, CURLOPTTYPE_OBJECTPOINT, 37),
1280 
1281   /* 38 is not used */
1282 
1283   /* send linked-list of post-transfer QUOTE commands */
1284   CURLOPT(CURLOPT_POSTQUOTE, CURLOPTTYPE_SLISTPOINT, 39),
1285 
1286   /* 40 is not used */
1287 
1288   /* talk a lot */
1289   CURLOPT(CURLOPT_VERBOSE, CURLOPTTYPE_LONG, 41),
1290 
1291   /* throw the header out too */
1292   CURLOPT(CURLOPT_HEADER, CURLOPTTYPE_LONG, 42),
1293 
1294   /* shut off the progress meter */
1295   CURLOPT(CURLOPT_NOPROGRESS, CURLOPTTYPE_LONG, 43),
1296 
1297   /* use HEAD to get http document */
1298   CURLOPT(CURLOPT_NOBODY, CURLOPTTYPE_LONG, 44),
1299 
1300   /* no output on http error codes >= 400 */
1301   CURLOPT(CURLOPT_FAILONERROR, CURLOPTTYPE_LONG, 45),
1302 
1303   /* this is an upload */
1304   CURLOPT(CURLOPT_UPLOAD, CURLOPTTYPE_LONG, 46),
1305 
1306   /* HTTP POST method */
1307   CURLOPT(CURLOPT_POST, CURLOPTTYPE_LONG, 47),
1308 
1309   /* bare names when listing directories */
1310   CURLOPT(CURLOPT_DIRLISTONLY, CURLOPTTYPE_LONG, 48),
1311 
1312   /* Append instead of overwrite on upload! */
1313   CURLOPT(CURLOPT_APPEND, CURLOPTTYPE_LONG, 50),
1314 
1315   /* Specify whether to read the user+password from the .netrc or the URL.
1316    * This must be one of the CURL_NETRC_* enums below. */
1317   CURLOPT(CURLOPT_NETRC, CURLOPTTYPE_VALUES, 51),
1318 
1319   /* use Location: Luke! */
1320   CURLOPT(CURLOPT_FOLLOWLOCATION, CURLOPTTYPE_LONG, 52),
1321 
1322    /* transfer data in text/ASCII format */
1323   CURLOPT(CURLOPT_TRANSFERTEXT, CURLOPTTYPE_LONG, 53),
1324 
1325   /* HTTP PUT */
1326   CURLOPTDEPRECATED(CURLOPT_PUT, CURLOPTTYPE_LONG, 54,
1327                     7.12.1, "Use CURLOPT_UPLOAD"),
1328 
1329   /* 55 = OBSOLETE */
1330 
1331   /* DEPRECATED
1332    * Function that is called instead of the internal progress display
1333    * function. This function should be defined as the curl_progress_callback
1334    * prototype defines. */
1335   CURLOPTDEPRECATED(CURLOPT_PROGRESSFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 56,
1336                     7.32.0, "Use CURLOPT_XFERINFOFUNCTION"),
1337 
1338   /* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION
1339      callbacks */
1340   CURLOPT(CURLOPT_XFERINFODATA, CURLOPTTYPE_CBPOINT, 57),
1341 #define CURLOPT_PROGRESSDATA CURLOPT_XFERINFODATA
1342 
1343   /* We want the referrer field set automatically when following locations */
1344   CURLOPT(CURLOPT_AUTOREFERER, CURLOPTTYPE_LONG, 58),
1345 
1346   /* Port of the proxy, can be set in the proxy string as well with:
1347      "[host]:[port]" */
1348   CURLOPT(CURLOPT_PROXYPORT, CURLOPTTYPE_LONG, 59),
1349 
1350   /* size of the POST input data, if strlen() is not good to use */
1351   CURLOPT(CURLOPT_POSTFIELDSIZE, CURLOPTTYPE_LONG, 60),
1352 
1353   /* tunnel non-http operations through an HTTP proxy */
1354   CURLOPT(CURLOPT_HTTPPROXYTUNNEL, CURLOPTTYPE_LONG, 61),
1355 
1356   /* Set the interface string to use as outgoing network interface */
1357   CURLOPT(CURLOPT_INTERFACE, CURLOPTTYPE_STRINGPOINT, 62),
1358 
1359   /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
1360    * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
1361    * is set but does not match one of these, 'private' is used. */
1362   CURLOPTDEPRECATED(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63,
1363                     8.17.0, "removed"),
1364 
1365   /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
1366   CURLOPT(CURLOPT_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 64),
1367 
1368   /* The CApath or CAfile used to validate the peer certificate
1369      this option is used only if SSL_VERIFYPEER is true */
1370   CURLOPT(CURLOPT_CAINFO, CURLOPTTYPE_STRINGPOINT, 65),
1371 
1372   /* 66 = OBSOLETE */
1373   /* 67 = OBSOLETE */
1374 
1375   /* Maximum number of http redirects to follow */
1376   CURLOPT(CURLOPT_MAXREDIRS, CURLOPTTYPE_LONG, 68),
1377 
1378   /* Pass a long set to 1 to get the date of the requested document (if
1379      possible)! Pass a zero to shut it off. */
1380   CURLOPT(CURLOPT_FILETIME, CURLOPTTYPE_LONG, 69),
1381 
1382   /* This points to a linked list of telnet options */
1383   CURLOPT(CURLOPT_TELNETOPTIONS, CURLOPTTYPE_SLISTPOINT, 70),
1384 
1385   /* Max amount of cached alive connections */
1386   CURLOPT(CURLOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 71),
1387 
1388   /* 72 = OBSOLETE */
1389   /* 73 = OBSOLETE */
1390 
1391   /* Set to explicitly use a new connection for the upcoming transfer.
1392      Do not use this unless you are absolutely sure of this, as it makes the
1393      operation slower and is less friendly for the network. */
1394   CURLOPT(CURLOPT_FRESH_CONNECT, CURLOPTTYPE_LONG, 74),
1395 
1396   /* Set to explicitly forbid the upcoming transfer's connection to be reused
1397      when done. Do not use this unless you are absolutely sure of this, as it
1398      makes the operation slower and is less friendly for the network. */
1399   CURLOPT(CURLOPT_FORBID_REUSE, CURLOPTTYPE_LONG, 75),
1400 
1401   /* Set to a filename that contains random data for libcurl to use to
1402      seed the random engine when doing SSL connects. */
1403   CURLOPTDEPRECATED(CURLOPT_RANDOM_FILE, CURLOPTTYPE_STRINGPOINT, 76,
1404                     7.84.0, "Serves no purpose anymore"),
1405 
1406   /* Set to the Entropy Gathering Daemon socket pathname */
1407   CURLOPTDEPRECATED(CURLOPT_EGDSOCKET, CURLOPTTYPE_STRINGPOINT, 77,
1408                     7.84.0, "Serves no purpose anymore"),
1409 
1410   /* Time-out connect operations after this amount of seconds, if connects are
1411      OK within this time, then fine... This only aborts the connect phase. */
1412   CURLOPT(CURLOPT_CONNECTTIMEOUT, CURLOPTTYPE_LONG, 78),
1413 
1414   /* Function that is called to store headers (instead of fwrite). The
1415    * parameters use fwrite() syntax, make sure to follow them. */
1416   CURLOPT(CURLOPT_HEADERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 79),
1417 
1418   /* Set this to force the HTTP request to get back to GET. Only really usable
1419      if POST, PUT or a custom request have been used first.
1420    */
1421   CURLOPT(CURLOPT_HTTPGET, CURLOPTTYPE_LONG, 80),
1422 
1423   /* Set if we should verify the Common name from the peer certificate in ssl
1424    * handshake, set 1 to check existence, 2 to ensure that it matches the
1425    * provided hostname. */
1426   CURLOPT(CURLOPT_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 81),
1427 
1428   /* Specify which filename to write all known cookies in after completed
1429      operation. Set filename to "-" (dash) to make it go to stdout. */
1430   CURLOPT(CURLOPT_COOKIEJAR, CURLOPTTYPE_STRINGPOINT, 82),
1431 
1432   /* Specify which TLS 1.2 (1.1, 1.0) ciphers to use */
1433   CURLOPT(CURLOPT_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 83),
1434 
1435   /* Specify which HTTP version to use! This must be set to one of the
1436      CURL_HTTP_VERSION* enums set below. */
1437   CURLOPT(CURLOPT_HTTP_VERSION, CURLOPTTYPE_VALUES, 84),
1438 
1439   /* Specifically switch on or off the FTP engine's use of the EPSV command. By
1440      default, that one is always attempted before the more traditional
1441      PASV command. */
1442   CURLOPT(CURLOPT_FTP_USE_EPSV, CURLOPTTYPE_LONG, 85),
1443 
1444   /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
1445   CURLOPT(CURLOPT_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 86),
1446 
1447   /* name of the file keeping your private SSL-key */
1448   CURLOPT(CURLOPT_SSLKEY, CURLOPTTYPE_STRINGPOINT, 87),
1449 
1450   /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
1451   CURLOPT(CURLOPT_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 88),
1452 
1453   /* crypto engine for the SSL-sub system */
1454   CURLOPT(CURLOPT_SSLENGINE, CURLOPTTYPE_STRINGPOINT, 89),
1455 
1456   /* set the crypto engine for the SSL-sub system as default
1457      the param has no meaning...
1458    */
1459   CURLOPT(CURLOPT_SSLENGINE_DEFAULT, CURLOPTTYPE_LONG, 90),
1460 
1461   /* Non-zero value means to use the global dns cache */
1462   /* DEPRECATED, do not use! */
1463   CURLOPTDEPRECATED(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91,
1464                     7.11.1, "Use CURLOPT_SHARE"),
1465 
1466   /* DNS cache timeout */
1467   CURLOPT(CURLOPT_DNS_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 92),
1468 
1469   /* send linked-list of pre-transfer QUOTE commands */
1470   CURLOPT(CURLOPT_PREQUOTE, CURLOPTTYPE_SLISTPOINT, 93),
1471 
1472   /* set the debug function */
1473   CURLOPT(CURLOPT_DEBUGFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 94),
1474 
1475   /* set the data for the debug function */
1476   CURLOPT(CURLOPT_DEBUGDATA, CURLOPTTYPE_CBPOINT, 95),
1477 
1478   /* mark this as start of a cookie session */
1479   CURLOPT(CURLOPT_COOKIESESSION, CURLOPTTYPE_LONG, 96),
1480 
1481   /* The CApath directory used to validate the peer certificate
1482      this option is used only if SSL_VERIFYPEER is true */
1483   CURLOPT(CURLOPT_CAPATH, CURLOPTTYPE_STRINGPOINT, 97),
1484 
1485   /* Instruct libcurl to use a smaller receive buffer */
1486   CURLOPT(CURLOPT_BUFFERSIZE, CURLOPTTYPE_LONG, 98),
1487 
1488   /* Instruct libcurl to not use any signal/alarm handlers, even when using
1489      timeouts. This option is useful for multi-threaded applications.
1490      See libcurl-the-guide for more background information. */
1491   CURLOPT(CURLOPT_NOSIGNAL, CURLOPTTYPE_LONG, 99),
1492 
1493   /* Provide a CURLShare for mutexing non-ts data */
1494   CURLOPT(CURLOPT_SHARE, CURLOPTTYPE_OBJECTPOINT, 100),
1495 
1496   /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
1497      CURLPROXY_HTTPS, CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and
1498      CURLPROXY_SOCKS5. */
1499   CURLOPT(CURLOPT_PROXYTYPE, CURLOPTTYPE_VALUES, 101),
1500 
1501   /* Set the Accept-Encoding string. Use this to tell a server you would like
1502      the response to be compressed. Before 7.21.6, this was known as
1503      CURLOPT_ENCODING */
1504   CURLOPT(CURLOPT_ACCEPT_ENCODING, CURLOPTTYPE_STRINGPOINT, 102),
1505 
1506   /* Set pointer to private data */
1507   CURLOPT(CURLOPT_PRIVATE, CURLOPTTYPE_OBJECTPOINT, 103),
1508 
1509   /* Set aliases for HTTP 200 in the HTTP Response header */
1510   CURLOPT(CURLOPT_HTTP200ALIASES, CURLOPTTYPE_SLISTPOINT, 104),
1511 
1512   /* Continue to send authentication (user+password) when following locations,
1513      even when hostname changed. This can potentially send off the name
1514      and password to whatever host the server decides. */
1515   CURLOPT(CURLOPT_UNRESTRICTED_AUTH, CURLOPTTYPE_LONG, 105),
1516 
1517   /* Specifically switch on or off the FTP engine's use of the EPRT command (
1518      it also disables the LPRT attempt). By default, those ones are always
1519      attempted before the good old traditional PORT command. */
1520   CURLOPT(CURLOPT_FTP_USE_EPRT, CURLOPTTYPE_LONG, 106),
1521 
1522   /* Set this to a bitmask value to enable the particular authentications
1523      methods you like. Use this in combination with CURLOPT_USERPWD.
1524      Note that setting multiple bits may cause extra network round-trips. */
1525   CURLOPT(CURLOPT_HTTPAUTH, CURLOPTTYPE_VALUES, 107),
1526 
1527   /* Set the ssl context callback function, currently only for OpenSSL or
1528      wolfSSL ssl_ctx, or mbedTLS mbedtls_ssl_config in the second argument.
1529      The function must match the curl_ssl_ctx_callback prototype. */
1530   CURLOPT(CURLOPT_SSL_CTX_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 108),
1531 
1532   /* Set the userdata for the ssl context callback function's third
1533      argument */
1534   CURLOPT(CURLOPT_SSL_CTX_DATA, CURLOPTTYPE_CBPOINT, 109),
1535 
1536   /* FTP Option that causes missing dirs to be created on the remote server.
1537      In 7.19.4 we introduced the convenience enums for this option using the
1538      CURLFTP_CREATE_DIR prefix.
1539   */
1540   CURLOPT(CURLOPT_FTP_CREATE_MISSING_DIRS, CURLOPTTYPE_LONG, 110),
1541 
1542   /* Set this to a bitmask value to enable the particular authentications
1543      methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
1544      Note that setting multiple bits may cause extra network round-trips. */
1545   CURLOPT(CURLOPT_PROXYAUTH, CURLOPTTYPE_VALUES, 111),
1546 
1547   /* Option that changes the timeout, in seconds, associated with getting a
1548      response. This is different from transfer timeout time and essentially
1549      places a demand on the server to acknowledge commands in a timely
1550      manner. For FTP, SMTP, IMAP and POP3. */
1551   CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT, CURLOPTTYPE_LONG, 112),
1552 
1553   /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
1554      tell libcurl to use those IP versions only. This only has effect on
1555      systems with support for more than one, i.e IPv4 _and_ IPv6. */
1556   CURLOPT(CURLOPT_IPRESOLVE, CURLOPTTYPE_VALUES, 113),
1557 
1558   /* Set this option to limit the size of a file that is to be downloaded from
1559      an HTTP or FTP server.
1560 
1561      Note there is also _LARGE version which adds large file support for
1562      platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
1563   CURLOPT(CURLOPT_MAXFILESIZE, CURLOPTTYPE_LONG, 114),
1564 
1565   /* See the comment for INFILESIZE above, but in short, specifies
1566    * the size of the file being uploaded.  -1 means unknown.
1567    */
1568   CURLOPT(CURLOPT_INFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 115),
1569 
1570   /* Sets the continuation offset. There is also a CURLOPTTYPE_LONG version
1571    * of this; look above for RESUME_FROM.
1572    */
1573   CURLOPT(CURLOPT_RESUME_FROM_LARGE, CURLOPTTYPE_OFF_T, 116),
1574 
1575   /* Sets the maximum size of data that is to be downloaded from
1576    * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
1577    */
1578   CURLOPT(CURLOPT_MAXFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 117),
1579 
1580   /* Set this option to the filename of your .netrc file you want libcurl
1581      to parse (using the CURLOPT_NETRC option). If not set, libcurl does
1582      a poor attempt to find the user's home directory and check for a .netrc
1583      file in there. */
1584   CURLOPT(CURLOPT_NETRC_FILE, CURLOPTTYPE_STRINGPOINT, 118),
1585 
1586   /* Enable SSL/TLS for FTP, pick one of:
1587      CURLUSESSL_TRY     - try using SSL, proceed anyway otherwise
1588      CURLUSESSL_CONTROL - SSL for the control connection or fail
1589      CURLUSESSL_ALL     - SSL for all communication or fail
1590   */
1591   CURLOPT(CURLOPT_USE_SSL, CURLOPTTYPE_VALUES, 119),
1592 
1593   /* The _LARGE version of the standard POSTFIELDSIZE option */
1594   CURLOPT(CURLOPT_POSTFIELDSIZE_LARGE, CURLOPTTYPE_OFF_T, 120),
1595 
1596   /* Enable/disable the TCP Nagle algorithm */
1597   CURLOPT(CURLOPT_TCP_NODELAY, CURLOPTTYPE_LONG, 121),
1598 
1599   /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1600   /* 123 OBSOLETE. Gone in 7.16.0 */
1601   /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1602   /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1603   /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1604   /* 127 OBSOLETE. Gone in 7.16.0 */
1605   /* 128 OBSOLETE. Gone in 7.16.0 */
1606 
1607   /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
1608      can be used to change libcurl's default action which is to first try
1609      "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
1610      response has been received.
1611 
1612      Available parameters are:
1613      CURLFTPAUTH_DEFAULT - let libcurl decide
1614      CURLFTPAUTH_SSL     - try "AUTH SSL" first, then TLS
1615      CURLFTPAUTH_TLS     - try "AUTH TLS" first, then SSL
1616   */
1617   CURLOPT(CURLOPT_FTPSSLAUTH, CURLOPTTYPE_VALUES, 129),
1618 
1619   CURLOPTDEPRECATED(CURLOPT_IOCTLFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 130,
1620                     7.18.0, "Use CURLOPT_SEEKFUNCTION"),
1621   CURLOPTDEPRECATED(CURLOPT_IOCTLDATA, CURLOPTTYPE_CBPOINT, 131,
1622                     7.18.0, "Use CURLOPT_SEEKDATA"),
1623 
1624   /* 132 OBSOLETE. Gone in 7.16.0 */
1625   /* 133 OBSOLETE. Gone in 7.16.0 */
1626 
1627   /* null-terminated string for pass on to the FTP server when asked for
1628      "account" info */
1629   CURLOPT(CURLOPT_FTP_ACCOUNT, CURLOPTTYPE_STRINGPOINT, 134),
1630 
1631   /* feed cookie into cookie engine */
1632   CURLOPT(CURLOPT_COOKIELIST, CURLOPTTYPE_STRINGPOINT, 135),
1633 
1634   /* ignore Content-Length */
1635   CURLOPT(CURLOPT_IGNORE_CONTENT_LENGTH, CURLOPTTYPE_LONG, 136),
1636 
1637   /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
1638      response. Typically used for FTP-SSL purposes but is not restricted to
1639      that. libcurl is then instead using the same IP address it used for the
1640      control connection. */
1641   CURLOPT(CURLOPT_FTP_SKIP_PASV_IP, CURLOPTTYPE_LONG, 137),
1642 
1643   /* Select "file method" to use when doing FTP, see the curl_ftpmethod
1644      above. */
1645   CURLOPT(CURLOPT_FTP_FILEMETHOD, CURLOPTTYPE_VALUES, 138),
1646 
1647   /* Local port number to bind the socket to */
1648   CURLOPT(CURLOPT_LOCALPORT, CURLOPTTYPE_LONG, 139),
1649 
1650   /* Number of ports to try, including the first one set with LOCALPORT.
1651      Thus, setting it to 1 makes no additional attempts but the first.
1652   */
1653   CURLOPT(CURLOPT_LOCALPORTRANGE, CURLOPTTYPE_LONG, 140),
1654 
1655   /* no transfer, set up connection and let application use the socket by
1656      extracting it with CURLINFO_LASTSOCKET */
1657   CURLOPT(CURLOPT_CONNECT_ONLY, CURLOPTTYPE_LONG, 141),
1658 
1659   /* Function that is called to convert from the
1660      network encoding (instead of using the iconv calls in libcurl) */
1661   CURLOPTDEPRECATED(CURLOPT_CONV_FROM_NETWORK_FUNCTION,
1662                     CURLOPTTYPE_FUNCTIONPOINT, 142,
1663                     7.82.0, "Serves no purpose anymore"),
1664 
1665   /* Function that is called to convert to the
1666      network encoding (instead of using the iconv calls in libcurl) */
1667   CURLOPTDEPRECATED(CURLOPT_CONV_TO_NETWORK_FUNCTION,
1668                     CURLOPTTYPE_FUNCTIONPOINT, 143,
1669                     7.82.0, "Serves no purpose anymore"),
1670 
1671   /* Function that is called to convert from UTF8
1672      (instead of using the iconv calls in libcurl)
1673      Note that this is used only for SSL certificate processing */
1674   CURLOPTDEPRECATED(CURLOPT_CONV_FROM_UTF8_FUNCTION,
1675                     CURLOPTTYPE_FUNCTIONPOINT, 144,
1676                     7.82.0, "Serves no purpose anymore"),
1677 
1678   /* if the connection proceeds too quickly then need to slow it down */
1679   /* limit-rate: maximum number of bytes per second to send or receive */
1680   CURLOPT(CURLOPT_MAX_SEND_SPEED_LARGE, CURLOPTTYPE_OFF_T, 145),
1681   CURLOPT(CURLOPT_MAX_RECV_SPEED_LARGE, CURLOPTTYPE_OFF_T, 146),
1682 
1683   /* Pointer to command string to send if USER/PASS fails. */
1684   CURLOPT(CURLOPT_FTP_ALTERNATIVE_TO_USER, CURLOPTTYPE_STRINGPOINT, 147),
1685 
1686   /* callback function for setting socket options */
1687   CURLOPT(CURLOPT_SOCKOPTFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 148),
1688   CURLOPT(CURLOPT_SOCKOPTDATA, CURLOPTTYPE_CBPOINT, 149),
1689 
1690   /* set to 0 to disable session ID reuse for this transfer, default is
1691      enabled (== 1) */
1692   CURLOPT(CURLOPT_SSL_SESSIONID_CACHE, CURLOPTTYPE_LONG, 150),
1693 
1694   /* allowed SSH authentication methods */
1695   CURLOPT(CURLOPT_SSH_AUTH_TYPES, CURLOPTTYPE_VALUES, 151),
1696 
1697   /* Used by scp/sftp to do public/private key authentication */
1698   CURLOPT(CURLOPT_SSH_PUBLIC_KEYFILE, CURLOPTTYPE_STRINGPOINT, 152),
1699   CURLOPT(CURLOPT_SSH_PRIVATE_KEYFILE, CURLOPTTYPE_STRINGPOINT, 153),
1700 
1701   /* Send CCC (Clear Command Channel) after authentication */
1702   CURLOPT(CURLOPT_FTP_SSL_CCC, CURLOPTTYPE_LONG, 154),
1703 
1704   /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
1705   CURLOPT(CURLOPT_TIMEOUT_MS, CURLOPTTYPE_LONG, 155),
1706   CURLOPT(CURLOPT_CONNECTTIMEOUT_MS, CURLOPTTYPE_LONG, 156),
1707 
1708   /* set to zero to disable the libcurl's decoding and thus pass the raw body
1709      data to the application even when it is encoded/compressed */
1710   CURLOPT(CURLOPT_HTTP_TRANSFER_DECODING, CURLOPTTYPE_LONG, 157),
1711   CURLOPT(CURLOPT_HTTP_CONTENT_DECODING, CURLOPTTYPE_LONG, 158),
1712 
1713   /* Permission used when creating new files and directories on the remote
1714      server for protocols that support it, SFTP/SCP/FILE */
1715   CURLOPT(CURLOPT_NEW_FILE_PERMS, CURLOPTTYPE_LONG, 159),
1716   CURLOPT(CURLOPT_NEW_DIRECTORY_PERMS, CURLOPTTYPE_LONG, 160),
1717 
1718   /* Set the behavior of POST when redirecting. Values must be set to one
1719      of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
1720   CURLOPT(CURLOPT_POSTREDIR, CURLOPTTYPE_VALUES, 161),
1721 
1722   /* used by scp/sftp to verify the host's public key */
1723   CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, CURLOPTTYPE_STRINGPOINT, 162),
1724 
1725   /* Callback function for opening socket (instead of socket(2)). Optionally,
1726      callback is able change the address or refuse to connect returning
1727      CURL_SOCKET_BAD. The callback should have type
1728      curl_opensocket_callback */
1729   CURLOPT(CURLOPT_OPENSOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 163),
1730   CURLOPT(CURLOPT_OPENSOCKETDATA, CURLOPTTYPE_CBPOINT, 164),
1731 
1732   /* POST volatile input fields. */
1733   CURLOPT(CURLOPT_COPYPOSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 165),
1734 
1735   /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
1736   CURLOPT(CURLOPT_PROXY_TRANSFER_MODE, CURLOPTTYPE_LONG, 166),
1737 
1738   /* Callback function for seeking in the input stream */
1739   CURLOPT(CURLOPT_SEEKFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 167),
1740   CURLOPT(CURLOPT_SEEKDATA, CURLOPTTYPE_CBPOINT, 168),
1741 
1742   /* CRL file */
1743   CURLOPT(CURLOPT_CRLFILE, CURLOPTTYPE_STRINGPOINT, 169),
1744 
1745   /* Issuer certificate */
1746   CURLOPT(CURLOPT_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 170),
1747 
1748   /* (IPv6) Address scope */
1749   CURLOPT(CURLOPT_ADDRESS_SCOPE, CURLOPTTYPE_LONG, 171),
1750 
1751   /* Collect certificate chain info and allow it to get retrievable with
1752      CURLINFO_CERTINFO after the transfer is complete. */
1753   CURLOPT(CURLOPT_CERTINFO, CURLOPTTYPE_LONG, 172),
1754 
1755   /* "name" and "pwd" to use when fetching. */
1756   CURLOPT(CURLOPT_USERNAME, CURLOPTTYPE_STRINGPOINT, 173),
1757   CURLOPT(CURLOPT_PASSWORD, CURLOPTTYPE_STRINGPOINT, 174),
1758 
1759     /* "name" and "pwd" to use with Proxy when fetching. */
1760   CURLOPT(CURLOPT_PROXYUSERNAME, CURLOPTTYPE_STRINGPOINT, 175),
1761   CURLOPT(CURLOPT_PROXYPASSWORD, CURLOPTTYPE_STRINGPOINT, 176),
1762 
1763   /* Comma separated list of hostnames defining no-proxy zones. These should
1764      match both hostnames directly, and hostnames within a domain. For
1765      example, local.com matches local.com and www.local.com, but NOT
1766      notlocal.com or www.notlocal.com. For compatibility with other
1767      implementations of this, .local.com is considered to be the same as
1768      local.com. A single * is the only valid wildcard, and effectively
1769      disables the use of proxy. */
1770   CURLOPT(CURLOPT_NOPROXY, CURLOPTTYPE_STRINGPOINT, 177),
1771 
1772   /* block size for TFTP transfers */
1773   CURLOPT(CURLOPT_TFTP_BLKSIZE, CURLOPTTYPE_LONG, 178),
1774 
1775   /* Socks Service */
1776   /* DEPRECATED, do not use! */
1777   CURLOPTDEPRECATED(CURLOPT_SOCKS5_GSSAPI_SERVICE,
1778                     CURLOPTTYPE_STRINGPOINT, 179,
1779                     7.49.0, "Use CURLOPT_PROXY_SERVICE_NAME"),
1780 
1781   /* Socks Service */
1782   CURLOPT(CURLOPT_SOCKS5_GSSAPI_NEC, CURLOPTTYPE_LONG, 180),
1783 
1784   /* set the bitmask for the protocols that are allowed to be used for the
1785      transfer, which thus helps the app which takes URLs from users or other
1786      external inputs and want to restrict what protocol(s) to deal
1787      with. Defaults to CURLPROTO_ALL. */
1788   CURLOPTDEPRECATED(CURLOPT_PROTOCOLS, CURLOPTTYPE_LONG, 181,
1789                     7.85.0, "Use CURLOPT_PROTOCOLS_STR"),
1790 
1791   /* set the bitmask for the protocols that libcurl is allowed to follow to,
1792      as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
1793      to be set in both bitmasks to be allowed to get redirected to. */
1794   CURLOPTDEPRECATED(CURLOPT_REDIR_PROTOCOLS, CURLOPTTYPE_LONG, 182,
1795                     7.85.0, "Use CURLOPT_REDIR_PROTOCOLS_STR"),
1796 
1797   /* set the SSH knownhost filename to use */
1798   CURLOPT(CURLOPT_SSH_KNOWNHOSTS, CURLOPTTYPE_STRINGPOINT, 183),
1799 
1800   /* set the SSH host key callback, must point to a curl_sshkeycallback
1801      function */
1802   CURLOPT(CURLOPT_SSH_KEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 184),
1803 
1804   /* set the SSH host key callback custom pointer */
1805   CURLOPT(CURLOPT_SSH_KEYDATA, CURLOPTTYPE_CBPOINT, 185),
1806 
1807   /* set the SMTP mail originator */
1808   CURLOPT(CURLOPT_MAIL_FROM, CURLOPTTYPE_STRINGPOINT, 186),
1809 
1810   /* set the list of SMTP mail receiver(s) */
1811   CURLOPT(CURLOPT_MAIL_RCPT, CURLOPTTYPE_SLISTPOINT, 187),
1812 
1813   /* FTP: send PRET before PASV */
1814   CURLOPT(CURLOPT_FTP_USE_PRET, CURLOPTTYPE_LONG, 188),
1815 
1816   /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */
1817   CURLOPT(CURLOPT_RTSP_REQUEST, CURLOPTTYPE_VALUES, 189),
1818 
1819   /* The RTSP session identifier */
1820   CURLOPT(CURLOPT_RTSP_SESSION_ID, CURLOPTTYPE_STRINGPOINT, 190),
1821 
1822   /* The RTSP stream URI */
1823   CURLOPT(CURLOPT_RTSP_STREAM_URI, CURLOPTTYPE_STRINGPOINT, 191),
1824 
1825   /* The Transport: header to use in RTSP requests */
1826   CURLOPT(CURLOPT_RTSP_TRANSPORT, CURLOPTTYPE_STRINGPOINT, 192),
1827 
1828   /* Manually initialize the client RTSP CSeq for this handle */
1829   CURLOPT(CURLOPT_RTSP_CLIENT_CSEQ, CURLOPTTYPE_LONG, 193),
1830 
1831   /* Manually initialize the server RTSP CSeq for this handle */
1832   CURLOPT(CURLOPT_RTSP_SERVER_CSEQ, CURLOPTTYPE_LONG, 194),
1833 
1834   /* The stream to pass to INTERLEAVEFUNCTION. */
1835   CURLOPT(CURLOPT_INTERLEAVEDATA, CURLOPTTYPE_CBPOINT, 195),
1836 
1837   /* Let the application define a custom write method for RTP data */
1838   CURLOPT(CURLOPT_INTERLEAVEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 196),
1839 
1840   /* Turn on wildcard matching */
1841   CURLOPT(CURLOPT_WILDCARDMATCH, CURLOPTTYPE_LONG, 197),
1842 
1843   /* Directory matching callback called before downloading of an
1844      individual file (chunk) started */
1845   CURLOPT(CURLOPT_CHUNK_BGN_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 198),
1846 
1847   /* Directory matching callback called after the file (chunk)
1848      was downloaded, or skipped */
1849   CURLOPT(CURLOPT_CHUNK_END_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 199),
1850 
1851   /* Change match (fnmatch-like) callback for wildcard matching */
1852   CURLOPT(CURLOPT_FNMATCH_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 200),
1853 
1854   /* Let the application define custom chunk data pointer */
1855   CURLOPT(CURLOPT_CHUNK_DATA, CURLOPTTYPE_CBPOINT, 201),
1856 
1857   /* FNMATCH_FUNCTION user pointer */
1858   CURLOPT(CURLOPT_FNMATCH_DATA, CURLOPTTYPE_CBPOINT, 202),
1859 
1860   /* send linked-list of name:port:address sets */
1861   CURLOPT(CURLOPT_RESOLVE, CURLOPTTYPE_SLISTPOINT, 203),
1862 
1863   /* Set a username for authenticated TLS */
1864   CURLOPT(CURLOPT_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 204),
1865 
1866   /* Set a password for authenticated TLS */
1867   CURLOPT(CURLOPT_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 205),
1868 
1869   /* Set authentication type for authenticated TLS */
1870   CURLOPT(CURLOPT_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 206),
1871 
1872   /* Set to 1 to enable the "TE:" header in HTTP requests to ask for
1873      compressed transfer-encoded responses. Set to 0 to disable the use of TE:
1874      in outgoing requests. The current default is 0, but it might change in a
1875      future libcurl release.
1876 
1877      libcurl asks for the compressed methods it knows of, and if that
1878      is not any, it does not ask for transfer-encoding at all even if this
1879      option is set to 1. */
1880   CURLOPT(CURLOPT_TRANSFER_ENCODING, CURLOPTTYPE_LONG, 207),
1881 
1882   /* Callback function for closing socket (instead of close(2)). The callback
1883      should have type curl_closesocket_callback */
1884   CURLOPT(CURLOPT_CLOSESOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 208),
1885   CURLOPT(CURLOPT_CLOSESOCKETDATA, CURLOPTTYPE_CBPOINT, 209),
1886 
1887   /* allow GSSAPI credential delegation */
1888   CURLOPT(CURLOPT_GSSAPI_DELEGATION, CURLOPTTYPE_VALUES, 210),
1889 
1890   /* Set the name servers to use for DNS resolution.
1891    * Only supported by the c-ares DNS backend */
1892   CURLOPT(CURLOPT_DNS_SERVERS, CURLOPTTYPE_STRINGPOINT, 211),
1893 
1894   /* Time-out accept operations (currently for FTP only) after this amount
1895      of milliseconds. */
1896   CURLOPT(CURLOPT_ACCEPTTIMEOUT_MS, CURLOPTTYPE_LONG, 212),
1897 
1898   /* Set TCP keepalive */
1899   CURLOPT(CURLOPT_TCP_KEEPALIVE, CURLOPTTYPE_LONG, 213),
1900 
1901   /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */
1902   CURLOPT(CURLOPT_TCP_KEEPIDLE, CURLOPTTYPE_LONG, 214),
1903   CURLOPT(CURLOPT_TCP_KEEPINTVL, CURLOPTTYPE_LONG, 215),
1904 
1905   /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */
1906   CURLOPT(CURLOPT_SSL_OPTIONS, CURLOPTTYPE_VALUES, 216),
1907 
1908   /* Set the SMTP auth originator */
1909   CURLOPT(CURLOPT_MAIL_AUTH, CURLOPTTYPE_STRINGPOINT, 217),
1910 
1911   /* Enable/disable SASL initial response */
1912   CURLOPT(CURLOPT_SASL_IR, CURLOPTTYPE_LONG, 218),
1913 
1914   /* Function that is called instead of the internal progress display
1915    * function. This function should be defined as the curl_xferinfo_callback
1916    * prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */
1917   CURLOPT(CURLOPT_XFERINFOFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 219),
1918 
1919   /* The XOAUTH2 bearer token */
1920   CURLOPT(CURLOPT_XOAUTH2_BEARER, CURLOPTTYPE_STRINGPOINT, 220),
1921 
1922   /* Set the interface string to use as outgoing network
1923    * interface for DNS requests.
1924    * Only supported by the c-ares DNS backend */
1925   CURLOPT(CURLOPT_DNS_INTERFACE, CURLOPTTYPE_STRINGPOINT, 221),
1926 
1927   /* Set the local IPv4 address to use for outgoing DNS requests.
1928    * Only supported by the c-ares DNS backend */
1929   CURLOPT(CURLOPT_DNS_LOCAL_IP4, CURLOPTTYPE_STRINGPOINT, 222),
1930 
1931   /* Set the local IPv6 address to use for outgoing DNS requests.
1932    * Only supported by the c-ares DNS backend */
1933   CURLOPT(CURLOPT_DNS_LOCAL_IP6, CURLOPTTYPE_STRINGPOINT, 223),
1934 
1935   /* Set authentication options directly */
1936   CURLOPT(CURLOPT_LOGIN_OPTIONS, CURLOPTTYPE_STRINGPOINT, 224),
1937 
1938   /* Enable/disable TLS NPN extension (http2 over ssl might fail without) */
1939   CURLOPTDEPRECATED(CURLOPT_SSL_ENABLE_NPN, CURLOPTTYPE_LONG, 225,
1940                     7.86.0, "Has no function"),
1941 
1942   /* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */
1943   CURLOPT(CURLOPT_SSL_ENABLE_ALPN, CURLOPTTYPE_LONG, 226),
1944 
1945   /* Time to wait for a response to an HTTP request containing an
1946    * Expect: 100-continue header before sending the data anyway. */
1947   CURLOPT(CURLOPT_EXPECT_100_TIMEOUT_MS, CURLOPTTYPE_LONG, 227),
1948 
1949   /* This points to a linked list of headers used for proxy requests only,
1950      struct curl_slist kind */
1951   CURLOPT(CURLOPT_PROXYHEADER, CURLOPTTYPE_SLISTPOINT, 228),
1952 
1953   /* Pass in a bitmask of "header options" */
1954   CURLOPT(CURLOPT_HEADEROPT, CURLOPTTYPE_VALUES, 229),
1955 
1956   /* The public key used to validate the peer public key */
1957   CURLOPT(CURLOPT_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 230),
1958 
1959   /* Path to Unix domain socket */
1960   CURLOPT(CURLOPT_UNIX_SOCKET_PATH, CURLOPTTYPE_STRINGPOINT, 231),
1961 
1962   /* Set if we should verify the certificate status. */
1963   CURLOPT(CURLOPT_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 232),
1964 
1965   /* Set if we should enable TLS false start. */
1966   CURLOPTDEPRECATED(CURLOPT_SSL_FALSESTART, CURLOPTTYPE_LONG, 233,
1967                     8.15.0, "Has no function"),
1968 
1969   /* Do not squash dot-dot sequences */
1970   CURLOPT(CURLOPT_PATH_AS_IS, CURLOPTTYPE_LONG, 234),
1971 
1972   /* Proxy Service Name */
1973   CURLOPT(CURLOPT_PROXY_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 235),
1974 
1975   /* Service Name */
1976   CURLOPT(CURLOPT_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 236),
1977 
1978   /* Wait/do not wait for pipe/mutex to clarify */
1979   CURLOPT(CURLOPT_PIPEWAIT, CURLOPTTYPE_LONG, 237),
1980 
1981   /* Set the protocol used when curl is given a URL without a protocol */
1982   CURLOPT(CURLOPT_DEFAULT_PROTOCOL, CURLOPTTYPE_STRINGPOINT, 238),
1983 
1984   /* Set stream weight, 1 - 256 (default is 16) */
1985   CURLOPT(CURLOPT_STREAM_WEIGHT, CURLOPTTYPE_LONG, 239),
1986 
1987   /* Set stream dependency on another curl handle */
1988   CURLOPT(CURLOPT_STREAM_DEPENDS, CURLOPTTYPE_OBJECTPOINT, 240),
1989 
1990   /* Set E-xclusive stream dependency on another curl handle */
1991   CURLOPT(CURLOPT_STREAM_DEPENDS_E, CURLOPTTYPE_OBJECTPOINT, 241),
1992 
1993   /* Do not send any tftp option requests to the server */
1994   CURLOPT(CURLOPT_TFTP_NO_OPTIONS, CURLOPTTYPE_LONG, 242),
1995 
1996   /* Linked-list of host:port:connect-to-host:connect-to-port,
1997      overrides the URL's host:port (only for the network layer) */
1998   CURLOPT(CURLOPT_CONNECT_TO, CURLOPTTYPE_SLISTPOINT, 243),
1999 
2000   /* Set TCP Fast Open */
2001   CURLOPT(CURLOPT_TCP_FASTOPEN, CURLOPTTYPE_LONG, 244),
2002 
2003   /* Continue to send data if the server responds early with an
2004    * HTTP status code >= 300 */
2005   CURLOPT(CURLOPT_KEEP_SENDING_ON_ERROR, CURLOPTTYPE_LONG, 245),
2006 
2007   /* The CApath or CAfile used to validate the proxy certificate
2008      this option is used only if PROXY_SSL_VERIFYPEER is true */
2009   CURLOPT(CURLOPT_PROXY_CAINFO, CURLOPTTYPE_STRINGPOINT, 246),
2010 
2011   /* The CApath directory used to validate the proxy certificate
2012      this option is used only if PROXY_SSL_VERIFYPEER is true */
2013   CURLOPT(CURLOPT_PROXY_CAPATH, CURLOPTTYPE_STRINGPOINT, 247),
2014 
2015   /* Set if we should verify the proxy in ssl handshake,
2016      set 1 to verify. */
2017   CURLOPT(CURLOPT_PROXY_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 248),
2018 
2019   /* Set if we should verify the Common name from the proxy certificate in ssl
2020    * handshake, set 1 to check existence, 2 to ensure that it matches
2021    * the provided hostname. */
2022   CURLOPT(CURLOPT_PROXY_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 249),
2023 
2024   /* What version to specifically try to use for proxy.
2025      See CURL_SSLVERSION defines below. */
2026   CURLOPT(CURLOPT_PROXY_SSLVERSION, CURLOPTTYPE_VALUES, 250),
2027 
2028   /* Set a username for authenticated TLS for proxy */
2029   CURLOPT(CURLOPT_PROXY_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 251),
2030 
2031   /* Set a password for authenticated TLS for proxy */
2032   CURLOPT(CURLOPT_PROXY_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 252),
2033 
2034   /* Set authentication type for authenticated TLS for proxy */
2035   CURLOPT(CURLOPT_PROXY_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 253),
2036 
2037   /* name of the file keeping your private SSL-certificate for proxy */
2038   CURLOPT(CURLOPT_PROXY_SSLCERT, CURLOPTTYPE_STRINGPOINT, 254),
2039 
2040   /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") for
2041      proxy */
2042   CURLOPT(CURLOPT_PROXY_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 255),
2043 
2044   /* name of the file keeping your private SSL-key for proxy */
2045   CURLOPT(CURLOPT_PROXY_SSLKEY, CURLOPTTYPE_STRINGPOINT, 256),
2046 
2047   /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") for
2048      proxy */
2049   CURLOPT(CURLOPT_PROXY_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 257),
2050 
2051   /* password for the SSL private key for proxy */
2052   CURLOPT(CURLOPT_PROXY_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 258),
2053 
2054   /* Specify which TLS 1.2 (1.1, 1.0) ciphers to use for proxy */
2055   CURLOPT(CURLOPT_PROXY_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 259),
2056 
2057   /* CRL file for proxy */
2058   CURLOPT(CURLOPT_PROXY_CRLFILE, CURLOPTTYPE_STRINGPOINT, 260),
2059 
2060   /* Enable/disable specific SSL features with a bitmask for proxy, see
2061      CURLSSLOPT_* */
2062   CURLOPT(CURLOPT_PROXY_SSL_OPTIONS, CURLOPTTYPE_LONG, 261),
2063 
2064   /* Name of pre proxy to use. */
2065   CURLOPT(CURLOPT_PRE_PROXY, CURLOPTTYPE_STRINGPOINT, 262),
2066 
2067   /* The public key in DER form used to validate the proxy public key
2068      this option is used only if PROXY_SSL_VERIFYPEER is true */
2069   CURLOPT(CURLOPT_PROXY_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 263),
2070 
2071   /* Path to an abstract Unix domain socket */
2072   CURLOPT(CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOPTTYPE_STRINGPOINT, 264),
2073 
2074   /* Suppress proxy CONNECT response headers from user callbacks */
2075   CURLOPT(CURLOPT_SUPPRESS_CONNECT_HEADERS, CURLOPTTYPE_LONG, 265),
2076 
2077   /* The request target, instead of extracted from the URL */
2078   CURLOPT(CURLOPT_REQUEST_TARGET, CURLOPTTYPE_STRINGPOINT, 266),
2079 
2080   /* bitmask of allowed auth methods for connections to SOCKS5 proxies */
2081   CURLOPT(CURLOPT_SOCKS5_AUTH, CURLOPTTYPE_LONG, 267),
2082 
2083   /* Enable/disable SSH compression */
2084   CURLOPT(CURLOPT_SSH_COMPRESSION, CURLOPTTYPE_LONG, 268),
2085 
2086   /* Post MIME data. */
2087   CURLOPT(CURLOPT_MIMEPOST, CURLOPTTYPE_OBJECTPOINT, 269),
2088 
2089   /* Time to use with the CURLOPT_TIMECONDITION. Specified in number of
2090      seconds since 1 Jan 1970. */
2091   CURLOPT(CURLOPT_TIMEVALUE_LARGE, CURLOPTTYPE_OFF_T, 270),
2092 
2093   /* Head start in milliseconds to give happy eyeballs. */
2094   CURLOPT(CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, CURLOPTTYPE_LONG, 271),
2095 
2096   /* Function that is called before a resolver request is made */
2097   CURLOPT(CURLOPT_RESOLVER_START_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 272),
2098 
2099   /* User data to pass to the resolver start callback. */
2100   CURLOPT(CURLOPT_RESOLVER_START_DATA, CURLOPTTYPE_CBPOINT, 273),
2101 
2102   /* send HAProxy PROXY protocol header? */
2103   CURLOPT(CURLOPT_HAPROXYPROTOCOL, CURLOPTTYPE_LONG, 274),
2104 
2105   /* shuffle addresses before use when DNS returns multiple */
2106   CURLOPT(CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOPTTYPE_LONG, 275),
2107 
2108   /* Specify which TLS 1.3 ciphers suites to use */
2109   CURLOPT(CURLOPT_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 276),
2110   CURLOPT(CURLOPT_PROXY_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 277),
2111 
2112   /* Disallow specifying username/login in URL. */
2113   CURLOPT(CURLOPT_DISALLOW_USERNAME_IN_URL, CURLOPTTYPE_LONG, 278),
2114 
2115   /* DNS-over-HTTPS URL */
2116   CURLOPT(CURLOPT_DOH_URL, CURLOPTTYPE_STRINGPOINT, 279),
2117 
2118   /* Preferred buffer size to use for uploads */
2119   CURLOPT(CURLOPT_UPLOAD_BUFFERSIZE, CURLOPTTYPE_LONG, 280),
2120 
2121   /* Time in ms between connection upkeep calls for long-lived connections. */
2122   CURLOPT(CURLOPT_UPKEEP_INTERVAL_MS, CURLOPTTYPE_LONG, 281),
2123 
2124   /* Specify URL using CURL URL API. */
2125   CURLOPT(CURLOPT_CURLU, CURLOPTTYPE_OBJECTPOINT, 282),
2126 
2127   /* add trailing data after no more data is available */
2128   CURLOPT(CURLOPT_TRAILERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 283),
2129 
2130   /* pointer to be passed to HTTP_TRAILER_FUNCTION */
2131   CURLOPT(CURLOPT_TRAILERDATA, CURLOPTTYPE_CBPOINT, 284),
2132 
2133   /* set this to 1L to allow HTTP/0.9 responses or 0L to disallow */
2134   CURLOPT(CURLOPT_HTTP09_ALLOWED, CURLOPTTYPE_LONG, 285),
2135 
2136   /* alt-svc control bitmask */
2137   CURLOPT(CURLOPT_ALTSVC_CTRL, CURLOPTTYPE_LONG, 286),
2138 
2139   /* alt-svc cache filename to possibly read from/write to */
2140   CURLOPT(CURLOPT_ALTSVC, CURLOPTTYPE_STRINGPOINT, 287),
2141 
2142   /* maximum age (idle time) of a connection to consider it for reuse
2143    * (in seconds) */
2144   CURLOPT(CURLOPT_MAXAGE_CONN, CURLOPTTYPE_LONG, 288),
2145 
2146   /* SASL authorization identity */
2147   CURLOPT(CURLOPT_SASL_AUTHZID, CURLOPTTYPE_STRINGPOINT, 289),
2148 
2149   /* allow RCPT TO command to fail for some recipients */
2150   CURLOPT(CURLOPT_MAIL_RCPT_ALLOWFAILS, CURLOPTTYPE_LONG, 290),
2151 
2152   /* the private SSL-certificate as a "blob" */
2153   CURLOPT(CURLOPT_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 291),
2154   CURLOPT(CURLOPT_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 292),
2155   CURLOPT(CURLOPT_PROXY_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 293),
2156   CURLOPT(CURLOPT_PROXY_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 294),
2157   CURLOPT(CURLOPT_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 295),
2158 
2159   /* Issuer certificate for proxy */
2160   CURLOPT(CURLOPT_PROXY_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 296),
2161   CURLOPT(CURLOPT_PROXY_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 297),
2162 
2163   /* the EC curves requested by the TLS client (RFC 8422, 5.1);
2164    * OpenSSL support via 'set_groups'/'set_curves':
2165    * https://docs.openssl.org/master/man3/SSL_CTX_set1_curves/
2166    */
2167   CURLOPT(CURLOPT_SSL_EC_CURVES, CURLOPTTYPE_STRINGPOINT, 298),
2168 
2169   /* HSTS bitmask */
2170   CURLOPT(CURLOPT_HSTS_CTRL, CURLOPTTYPE_LONG, 299),
2171   /* HSTS filename */
2172   CURLOPT(CURLOPT_HSTS, CURLOPTTYPE_STRINGPOINT, 300),
2173 
2174   /* HSTS read callback */
2175   CURLOPT(CURLOPT_HSTSREADFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 301),
2176   CURLOPT(CURLOPT_HSTSREADDATA, CURLOPTTYPE_CBPOINT, 302),
2177 
2178   /* HSTS write callback */
2179   CURLOPT(CURLOPT_HSTSWRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 303),
2180   CURLOPT(CURLOPT_HSTSWRITEDATA, CURLOPTTYPE_CBPOINT, 304),
2181 
2182   /* Parameters for V4 signature */
2183   CURLOPT(CURLOPT_AWS_SIGV4, CURLOPTTYPE_STRINGPOINT, 305),
2184 
2185   /* Same as CURLOPT_SSL_VERIFYPEER but for DoH (DNS-over-HTTPS) servers. */
2186   CURLOPT(CURLOPT_DOH_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 306),
2187 
2188   /* Same as CURLOPT_SSL_VERIFYHOST but for DoH (DNS-over-HTTPS) servers. */
2189   CURLOPT(CURLOPT_DOH_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 307),
2190 
2191   /* Same as CURLOPT_SSL_VERIFYSTATUS but for DoH (DNS-over-HTTPS) servers. */
2192   CURLOPT(CURLOPT_DOH_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 308),
2193 
2194   /* The CA certificates as "blob" used to validate the peer certificate
2195      this option is used only if SSL_VERIFYPEER is true */
2196   CURLOPT(CURLOPT_CAINFO_BLOB, CURLOPTTYPE_BLOB, 309),
2197 
2198   /* The CA certificates as "blob" used to validate the proxy certificate
2199      this option is used only if PROXY_SSL_VERIFYPEER is true */
2200   CURLOPT(CURLOPT_PROXY_CAINFO_BLOB, CURLOPTTYPE_BLOB, 310),
2201 
2202   /* used by scp/sftp to verify the host's public key */
2203   CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, CURLOPTTYPE_STRINGPOINT, 311),
2204 
2205   /* Function that is called immediately before the initial request
2206      is made on a connection (after any protocol negotiation step). */
2207   CURLOPT(CURLOPT_PREREQFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 312),
2208 
2209   /* Data passed to the CURLOPT_PREREQFUNCTION callback */
2210   CURLOPT(CURLOPT_PREREQDATA, CURLOPTTYPE_CBPOINT, 313),
2211 
2212   /* maximum age (since creation) of a connection to consider it for reuse
2213    * (in seconds) */
2214   CURLOPT(CURLOPT_MAXLIFETIME_CONN, CURLOPTTYPE_LONG, 314),
2215 
2216   /* Set MIME option flags. */
2217   CURLOPT(CURLOPT_MIME_OPTIONS, CURLOPTTYPE_LONG, 315),
2218 
2219   /* set the SSH host key callback, must point to a curl_sshkeycallback
2220      function */
2221   CURLOPT(CURLOPT_SSH_HOSTKEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 316),
2222 
2223   /* set the SSH host key callback custom pointer */
2224   CURLOPT(CURLOPT_SSH_HOSTKEYDATA, CURLOPTTYPE_CBPOINT, 317),
2225 
2226   /* specify which protocols that are allowed to be used for the transfer,
2227      which thus helps the app which takes URLs from users or other external
2228      inputs and want to restrict what protocol(s) to deal with. Defaults to
2229      all built-in protocols. */
2230   CURLOPT(CURLOPT_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 318),
2231 
2232   /* specify which protocols that libcurl is allowed to follow directs to */
2233   CURLOPT(CURLOPT_REDIR_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 319),
2234 
2235   /* WebSockets options */
2236   CURLOPT(CURLOPT_WS_OPTIONS, CURLOPTTYPE_LONG, 320),
2237 
2238   /* CA cache timeout */
2239   CURLOPT(CURLOPT_CA_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 321),
2240 
2241   /* Can leak things, gonna exit() soon */
2242   CURLOPT(CURLOPT_QUICK_EXIT, CURLOPTTYPE_LONG, 322),
2243 
2244   /* set a specific client IP for HAProxy PROXY protocol header? */
2245   CURLOPT(CURLOPT_HAPROXY_CLIENT_IP, CURLOPTTYPE_STRINGPOINT, 323),
2246 
2247   /* millisecond version */
2248   CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, CURLOPTTYPE_LONG, 324),
2249 
2250   /* set ECH configuration */
2251   CURLOPT(CURLOPT_ECH, CURLOPTTYPE_STRINGPOINT, 325),
2252 
2253   /* maximum number of keepalive probes (Linux, *BSD, macOS, etc.) */
2254   CURLOPT(CURLOPT_TCP_KEEPCNT, CURLOPTTYPE_LONG, 326),
2255 
2256   CURLOPT(CURLOPT_UPLOAD_FLAGS, CURLOPTTYPE_LONG, 327),
2257 
2258   /* set TLS supported signature algorithms */
2259   CURLOPT(CURLOPT_SSL_SIGNATURE_ALGORITHMS, CURLOPTTYPE_STRINGPOINT, 328),
2260 
2261   CURLOPT_LASTENTRY /* the last unused */
2262 } CURLoption;
2263 
2264 #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
2265                           the obsolete stuff removed! */
2266 
2267 /* Backwards compatibility with older names */
2268 /* These are scheduled to disappear by 2011 */
2269 
2270 /* This was added in version 7.19.1 */
2271 #define CURLOPT_POST301 CURLOPT_POSTREDIR
2272 
2273 /* These are scheduled to disappear by 2009 */
2274 
2275 /* The following were added in 7.17.0 */
2276 #define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD
2277 #define CURLOPT_FTPAPPEND CURLOPT_APPEND
2278 #define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY
2279 #define CURLOPT_FTP_SSL CURLOPT_USE_SSL
2280 
2281 /* The following were added earlier */
2282 
2283 #define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
2284 #define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
2285 
2286 #define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT
2287 
2288 /* Added in 8.2.0 */
2289 #define CURLOPT_MAIL_RCPT_ALLLOWFAILS CURLOPT_MAIL_RCPT_ALLOWFAILS
2290 
2291 #else
2292 /* This is set if CURL_NO_OLDIES is defined at compile-time */
2293 #undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
2294 #endif
2295 
2296 /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
2297    name resolves addresses using more than one IP protocol version, this
2298    option might be handy to force libcurl to use a specific IP version. */
2299 #define CURL_IPRESOLVE_WHATEVER 0L /* default, uses addresses to all IP
2300                                      versions that your system allows */
2301 #define CURL_IPRESOLVE_V4       1L /* uses only IPv4 addresses/connections */
2302 #define CURL_IPRESOLVE_V6       2L /* uses only IPv6 addresses/connections */
2303 
2304   /* Convenient "aliases" */
2305 #define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
2306 
2307 /* These constants are for use with the CURLOPT_HTTP_VERSION option. */
2308 #define CURL_HTTP_VERSION_NONE  0L /* setting this means we do not care, and
2309                                       that we would like the library to choose
2310                                       the best possible for us! */
2311 #define CURL_HTTP_VERSION_1_0   1L /* please use HTTP 1.0 in the request */
2312 #define CURL_HTTP_VERSION_1_1   2L /* please use HTTP 1.1 in the request */
2313 #define CURL_HTTP_VERSION_2_0   3L /* please use HTTP 2 in the request */
2314 #define CURL_HTTP_VERSION_2TLS  4L /* use version 2 for HTTPS, version 1.1 for
2315                                       HTTP */
2316 #define CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 5L /* please use HTTP 2 without
2317                                                   HTTP/1.1 Upgrade */
2318 #define CURL_HTTP_VERSION_3     30L /* Use HTTP/3, fallback to HTTP/2 or
2319                                        HTTP/1 if needed. For HTTPS only. For
2320                                        HTTP, this option makes libcurl
2321                                        return error. */
2322 #define CURL_HTTP_VERSION_3ONLY 31L /* Use HTTP/3 without fallback. For
2323                                        HTTPS only. For HTTP, this makes
2324                                        libcurl return error. */
2325 #define CURL_HTTP_VERSION_LAST  32L /* *ILLEGAL* http version */
2326 
2327 /* Convenience definition simple because the name of the version is HTTP/2 and
2328    not 2.0. The 2_0 version of the enum name was set while the version was
2329    still planned to be 2.0 and we stick to it for compatibility. */
2330 #define CURL_HTTP_VERSION_2 CURL_HTTP_VERSION_2_0
2331 
2332 /*
2333  * Public API enums for RTSP requests
2334  */
2335 
2336 #define CURL_RTSPREQ_NONE          0L
2337 #define CURL_RTSPREQ_OPTIONS       1L
2338 #define CURL_RTSPREQ_DESCRIBE      2L
2339 #define CURL_RTSPREQ_ANNOUNCE      3L
2340 #define CURL_RTSPREQ_SETUP         4L
2341 #define CURL_RTSPREQ_PLAY          5L
2342 #define CURL_RTSPREQ_PAUSE         6L
2343 #define CURL_RTSPREQ_TEARDOWN      7L
2344 #define CURL_RTSPREQ_GET_PARAMETER 8L
2345 #define CURL_RTSPREQ_SET_PARAMETER 9L
2346 #define CURL_RTSPREQ_RECORD        10L
2347 #define CURL_RTSPREQ_RECEIVE       11L
2348 #define CURL_RTSPREQ_LAST          12L /* not used */
2349 
2350   /* These enums are for use with the CURLOPT_NETRC option. */
2351 #define CURL_NETRC_IGNORED  0L /* The .netrc is never read.
2352                                   This is the default. */
2353 #define CURL_NETRC_OPTIONAL 1L /* A user:password in the URL is preferred
2354                                   to one in the .netrc. */
2355 #define CURL_NETRC_REQUIRED 2L /* A user:password in the URL is ignored.
2356                                   Unless one is set programmatically, the
2357                                   .netrc is queried. */
2358 enum CURL_NETRC_OPTION {
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 */
2361   CURL_NETRC_LAST = 3
2362 };
2363 
2364 #define CURL_SSLVERSION_DEFAULT 0L
2365 #define CURL_SSLVERSION_TLSv1   1L /* TLS 1.x */
2366 #define CURL_SSLVERSION_SSLv2   2L
2367 #define CURL_SSLVERSION_SSLv3   3L
2368 #define CURL_SSLVERSION_TLSv1_0 4L
2369 #define CURL_SSLVERSION_TLSv1_1 5L
2370 #define CURL_SSLVERSION_TLSv1_2 6L
2371 #define CURL_SSLVERSION_TLSv1_3 7L
2372 
2373 #define CURL_SSLVERSION_LAST    8L /* never use, keep last */
2374 
2375 #define CURL_SSLVERSION_MAX_NONE 0L
2376 #define CURL_SSLVERSION_MAX_DEFAULT (CURL_SSLVERSION_TLSv1   << 16)
2377 #define CURL_SSLVERSION_MAX_TLSv1_0 (CURL_SSLVERSION_TLSv1_0 << 16)
2378 #define CURL_SSLVERSION_MAX_TLSv1_1 (CURL_SSLVERSION_TLSv1_1 << 16)
2379 #define CURL_SSLVERSION_MAX_TLSv1_2 (CURL_SSLVERSION_TLSv1_2 << 16)
2380 #define CURL_SSLVERSION_MAX_TLSv1_3 (CURL_SSLVERSION_TLSv1_3 << 16)
2381 
2382 /* never use, keep last */
2383 #define CURL_SSLVERSION_MAX_LAST    (CURL_SSLVERSION_LAST    << 16)
2384 
2385 #define CURL_TLSAUTH_NONE 0L
2386 #define CURL_TLSAUTH_SRP  1L
2387 
2388 enum CURL_TLSAUTH {
2389   /* we set a single member here, to make sure we still provide the enum,
2390      but the values to use are defined above with L suffixes */
2391   CURL_TLSAUTH_LAST = 2
2392 };
2393 
2394 /* symbols to use with CURLOPT_POSTREDIR.
2395    CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303
2396    can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302
2397    | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */
2398 
2399 #define CURL_REDIR_GET_ALL  0L
2400 #define CURL_REDIR_POST_301 1L
2401 #define CURL_REDIR_POST_302 2L
2402 #define CURL_REDIR_POST_303 4L
2403 #define CURL_REDIR_POST_ALL \
2404   (CURL_REDIR_POST_301 | CURL_REDIR_POST_302 | CURL_REDIR_POST_303)
2405 
2406 #define CURL_TIMECOND_NONE         0L
2407 #define CURL_TIMECOND_IFMODSINCE   1L
2408 #define CURL_TIMECOND_IFUNMODSINCE 2L
2409 #define CURL_TIMECOND_LASTMOD      3L
2410 
2411 typedef enum {
2412   /* we set a single member here, to make sure we still provide
2413      the enum typedef, but the values to use are defined above with L
2414      suffixes */
2415   CURL_TIMECOND_LAST = 4
2416 } curl_TimeCond;
2417 
2418 /* Special size_t value signaling a null-terminated string. */
2419 #define CURL_ZERO_TERMINATED ((size_t)-1)
2420 
2421 /* curl_strequal() and curl_strnequal() are subject for removal in a future
2422    release */
2423 CURL_EXTERN int curl_strequal(const char *s1, const char *s2);
2424 CURL_EXTERN int curl_strnequal(const char *s1, const char *s2, size_t n);
2425 
2426 /* Mime/form handling support. */
2427 typedef struct curl_mime      curl_mime;      /* Mime context. */
2428 typedef struct curl_mimepart  curl_mimepart;  /* Mime part context. */
2429 
2430 /* CURLMIMEOPT_ defines are for the CURLOPT_MIME_OPTIONS option. */
2431 #define CURLMIMEOPT_FORMESCAPE (1L << 0) /* Use backslash-escaping for forms */
2432 
2433 /*
2434  * NAME curl_mime_init()
2435  *
2436  * DESCRIPTION
2437  *
2438  * Create a mime context and return its handle. The easy parameter is the
2439  * target handle.
2440  */
2441 CURL_EXTERN curl_mime *curl_mime_init(CURL *easy);
2442 
2443 /*
2444  * NAME curl_mime_free()
2445  *
2446  * DESCRIPTION
2447  *
2448  * release a mime handle and its substructures.
2449  */
2450 CURL_EXTERN void curl_mime_free(curl_mime *mime);
2451 
2452 /*
2453  * NAME curl_mime_addpart()
2454  *
2455  * DESCRIPTION
2456  *
2457  * Append a new empty part to the given mime context and return a handle to
2458  * the created part.
2459  */
2460 CURL_EXTERN curl_mimepart *curl_mime_addpart(curl_mime *mime);
2461 
2462 /*
2463  * NAME curl_mime_name()
2464  *
2465  * DESCRIPTION
2466  *
2467  * Set mime/form part name.
2468  */
2469 CURL_EXTERN CURLcode curl_mime_name(curl_mimepart *part, const char *name);
2470 
2471 /*
2472  * NAME curl_mime_filename()
2473  *
2474  * DESCRIPTION
2475  *
2476  * Set mime part remote filename.
2477  */
2478 CURL_EXTERN CURLcode curl_mime_filename(curl_mimepart *part,
2479                                         const char *filename);
2480 
2481 /*
2482  * NAME curl_mime_type()
2483  *
2484  * DESCRIPTION
2485  *
2486  * Set mime part type.
2487  */
2488 CURL_EXTERN CURLcode curl_mime_type(curl_mimepart *part, const char *mimetype);
2489 
2490 /*
2491  * NAME curl_mime_encoder()
2492  *
2493  * DESCRIPTION
2494  *
2495  * Set mime data transfer encoder.
2496  */
2497 CURL_EXTERN CURLcode curl_mime_encoder(curl_mimepart *part,
2498                                        const char *encoding);
2499 
2500 /*
2501  * NAME curl_mime_data()
2502  *
2503  * DESCRIPTION
2504  *
2505  * Set mime part data source from memory data,
2506  */
2507 CURL_EXTERN CURLcode curl_mime_data(curl_mimepart *part,
2508                                     const char *data, size_t datasize);
2509 
2510 /*
2511  * NAME curl_mime_filedata()
2512  *
2513  * DESCRIPTION
2514  *
2515  * Set mime part data source from named file.
2516  */
2517 CURL_EXTERN CURLcode curl_mime_filedata(curl_mimepart *part,
2518                                         const char *filename);
2519 
2520 /*
2521  * NAME curl_mime_data_cb()
2522  *
2523  * DESCRIPTION
2524  *
2525  * Set mime part data source from callback function.
2526  */
2527 CURL_EXTERN CURLcode curl_mime_data_cb(curl_mimepart *part,
2528                                        curl_off_t datasize,
2529                                        curl_read_callback readfunc,
2530                                        curl_seek_callback seekfunc,
2531                                        curl_free_callback freefunc,
2532                                        void *arg);
2533 
2534 /*
2535  * NAME curl_mime_subparts()
2536  *
2537  * DESCRIPTION
2538  *
2539  * Set mime part data source from subparts.
2540  */
2541 CURL_EXTERN CURLcode curl_mime_subparts(curl_mimepart *part,
2542                                         curl_mime *subparts);
2543 /*
2544  * NAME curl_mime_headers()
2545  *
2546  * DESCRIPTION
2547  *
2548  * Set mime part headers.
2549  */
2550 CURL_EXTERN CURLcode curl_mime_headers(curl_mimepart *part,
2551                                        struct curl_slist *headers,
2552                                        int take_ownership);
2553 
2554 typedef enum {
2555   /********* the first one is unused ************/
2556   CURLFORM_NOTHING         CURL_DEPRECATED(7.56.0, ""),
2557   CURLFORM_COPYNAME        CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
2558   CURLFORM_PTRNAME         CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
2559   CURLFORM_NAMELENGTH      CURL_DEPRECATED(7.56.0, ""),
2560   CURLFORM_COPYCONTENTS    CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
2561   CURLFORM_PTRCONTENTS     CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
2562   CURLFORM_CONTENTSLENGTH  CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
2563   CURLFORM_FILECONTENT     CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),
2564   CURLFORM_ARRAY           CURL_DEPRECATED(7.56.0, ""),
2565   CURLFORM_OBSOLETE,
2566   CURLFORM_FILE            CURL_DEPRECATED(7.56.0, "Use curl_mime_filedata()"),
2567 
2568   CURLFORM_BUFFER          CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),
2569   CURLFORM_BUFFERPTR       CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
2570   CURLFORM_BUFFERLENGTH    CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
2571 
2572   CURLFORM_CONTENTTYPE     CURL_DEPRECATED(7.56.0, "Use curl_mime_type()"),
2573   CURLFORM_CONTENTHEADER   CURL_DEPRECATED(7.56.0, "Use curl_mime_headers()"),
2574   CURLFORM_FILENAME        CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),
2575   CURLFORM_END,
2576   CURLFORM_OBSOLETE2,
2577 
2578   CURLFORM_STREAM          CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),
2579   CURLFORM_CONTENTLEN  /* added in 7.46.0, provide a curl_off_t length */
2580                            CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
2581 
2582   CURLFORM_LASTENTRY /* the last unused */
2583 } CURLformoption;
2584 
2585 /* structure to be used as parameter for CURLFORM_ARRAY */
2586 struct curl_forms {
2587   CURLformoption option;
2588   const char     *value;
2589 };
2590 
2591 /* use this for multipart formpost building */
2592 /* Returns code for curl_formadd()
2593  *
2594  * Returns:
2595  * CURL_FORMADD_OK             on success
2596  * CURL_FORMADD_MEMORY         if the FormInfo allocation fails
2597  * CURL_FORMADD_OPTION_TWICE   if one option is given twice for one Form
2598  * CURL_FORMADD_NULL           if a null pointer was given for a char
2599  * CURL_FORMADD_MEMORY         if the allocation of a FormInfo struct failed
2600  * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used
2601  * CURL_FORMADD_INCOMPLETE     if the some FormInfo is not complete (or error)
2602  * CURL_FORMADD_MEMORY         if a curl_httppost struct cannot be allocated
2603  * CURL_FORMADD_MEMORY         if some allocation for string copying failed.
2604  * CURL_FORMADD_ILLEGAL_ARRAY  if an illegal option is used in an array
2605  *
2606  ***************************************************************************/
2607 typedef enum {
2608   CURL_FORMADD_OK             CURL_DEPRECATED(7.56.0, ""), /* 1st, no error */
2609 
2610   CURL_FORMADD_MEMORY         CURL_DEPRECATED(7.56.0, ""),
2611   CURL_FORMADD_OPTION_TWICE   CURL_DEPRECATED(7.56.0, ""),
2612   CURL_FORMADD_NULL           CURL_DEPRECATED(7.56.0, ""),
2613   CURL_FORMADD_UNKNOWN_OPTION CURL_DEPRECATED(7.56.0, ""),
2614   CURL_FORMADD_INCOMPLETE     CURL_DEPRECATED(7.56.0, ""),
2615   CURL_FORMADD_ILLEGAL_ARRAY  CURL_DEPRECATED(7.56.0, ""),
2616   /* libcurl was built with form api disabled */
2617   CURL_FORMADD_DISABLED       CURL_DEPRECATED(7.56.0, ""),
2618 
2619   CURL_FORMADD_LAST /* last */
2620 } CURLFORMcode;
2621 
2622 /*
2623  * NAME curl_formadd()
2624  *
2625  * DESCRIPTION
2626  *
2627  * Pretty advanced function for building multi-part formposts. Each invoke
2628  * adds one part that together construct a full post. Then use
2629  * CURLOPT_HTTPPOST to send it off to libcurl.
2630  */
2631 CURL_EXTERN CURLFORMcode CURL_DEPRECATED(7.56.0, "Use curl_mime_init()")
2632 curl_formadd(struct curl_httppost **httppost,
2633              struct curl_httppost **last_post,
2634              ...);
2635 
2636 /*
2637  * callback function for curl_formget()
2638  * The void *arg pointer is the one passed as second argument to
2639  *   curl_formget().
2640  * The character buffer passed to it must not be freed.
2641  * Should return the buffer length passed to it as the argument "len" on
2642  *   success.
2643  */
2644 typedef size_t (*curl_formget_callback)(void *arg, const char *buf,
2645                                         size_t len);
2646 
2647 /*
2648  * NAME curl_formget()
2649  *
2650  * DESCRIPTION
2651  *
2652  * Serialize a curl_httppost struct built with curl_formadd().
2653  * Accepts a void pointer as second argument which is passed to
2654  * the curl_formget_callback function.
2655  * Returns 0 on success.
2656  */
2657 CURL_EXTERN int CURL_DEPRECATED(7.56.0, "")
2658 curl_formget(struct curl_httppost *form, void *arg,
2659              curl_formget_callback append);
2660 /*
2661  * NAME curl_formfree()
2662  *
2663  * DESCRIPTION
2664  *
2665  * Free a multipart formpost previously built with curl_formadd().
2666  */
2667 CURL_EXTERN void CURL_DEPRECATED(7.56.0, "Use curl_mime_free()")
2668 curl_formfree(struct curl_httppost *form);
2669 
2670 /*
2671  * NAME curl_getenv()
2672  *
2673  * DESCRIPTION
2674  *
2675  * Returns a malloc()'ed string that MUST be curl_free()ed after usage is
2676  * complete. DEPRECATED - see lib/README.curlx
2677  */
2678 CURL_EXTERN char *curl_getenv(const char *variable);
2679 
2680 /*
2681  * NAME curl_version()
2682  *
2683  * DESCRIPTION
2684  *
2685  * Returns a static ASCII string of the libcurl version.
2686  */
2687 CURL_EXTERN char *curl_version(void);
2688 
2689 /*
2690  * NAME curl_easy_escape()
2691  *
2692  * DESCRIPTION
2693  *
2694  * Escapes URL strings (converts all letters consider illegal in URLs to their
2695  * %XX versions). This function returns a new allocated string or NULL if an
2696  * error occurred.
2697  */
2698 CURL_EXTERN char *curl_easy_escape(CURL *curl,
2699                                    const char *string,
2700                                    int length);
2701 
2702 /* the previous version: */
2703 CURL_EXTERN char *curl_escape(const char *string,
2704                               int length);
2705 
2706 /*
2707  * NAME curl_easy_unescape()
2708  *
2709  * DESCRIPTION
2710  *
2711  * Unescapes URL encoding in strings (converts all %XX codes to their 8-bit
2712  * versions). This function returns a new allocated string or NULL if an error
2713  * occurred.
2714  * Conversion Note: On non-ASCII platforms the ASCII %XX codes are
2715  * converted into the host encoding.
2716  */
2717 CURL_EXTERN char *curl_easy_unescape(CURL *curl,
2718                                      const char *string,
2719                                      int inlength,
2720                                      int *outlength);
2721 
2722 /* the previous version */
2723 CURL_EXTERN char *curl_unescape(const char *string,
2724                                 int length);
2725 
2726 /*
2727  * NAME curl_free()
2728  *
2729  * DESCRIPTION
2730  *
2731  * Provided for de-allocation in the same translation unit that did the
2732  * allocation. Added in libcurl 7.10
2733  */
2734 CURL_EXTERN void curl_free(void *p);
2735 
2736 /*
2737  * NAME curl_global_init()
2738  *
2739  * DESCRIPTION
2740  *
2741  * curl_global_init() should be invoked exactly once for each application that
2742  * uses libcurl and before any call of other libcurl functions.
2743  *
2744  * This function is thread-safe if CURL_VERSION_THREADSAFE is set in the
2745  * curl_version_info_data.features flag (fetch by curl_version_info()).
2746  */
2747 CURL_EXTERN CURLcode curl_global_init(long flags);
2748 
2749 /*
2750  * NAME curl_global_init_mem()
2751  *
2752  * DESCRIPTION
2753  *
2754  * curl_global_init() or curl_global_init_mem() should be invoked exactly once
2755  * for each application that uses libcurl. This function can be used to
2756  * initialize libcurl and set user defined memory management callback
2757  * functions. Users can implement memory management routines to check for
2758  * memory leaks, check for misuse of the curl library etc. User registered
2759  * callback routines is invoked by this library instead of the system
2760  * memory management routines like malloc, free etc.
2761  */
2762 CURL_EXTERN CURLcode curl_global_init_mem(long flags,
2763                                           curl_malloc_callback m,
2764                                           curl_free_callback f,
2765                                           curl_realloc_callback r,
2766                                           curl_strdup_callback s,
2767                                           curl_calloc_callback c);
2768 
2769 /*
2770  * NAME curl_global_cleanup()
2771  *
2772  * DESCRIPTION
2773  *
2774  * curl_global_cleanup() should be invoked exactly once for each application
2775  * that uses libcurl
2776  */
2777 CURL_EXTERN void curl_global_cleanup(void);
2778 
2779 /*
2780  * NAME curl_global_trace()
2781  *
2782  * DESCRIPTION
2783  *
2784  * curl_global_trace() can be invoked at application start to
2785  * configure which components in curl should participate in tracing.
2786  *
2787  * This function is thread-safe if CURL_VERSION_THREADSAFE is set in the
2788  * curl_version_info_data.features flag (fetch by curl_version_info()).
2789  */
2790 CURL_EXTERN CURLcode curl_global_trace(const char *config);
2791 
2792 /* linked-list structure for the CURLOPT_QUOTE option (and other) */
2793 struct curl_slist {
2794   char *data;
2795   struct curl_slist *next;
2796 };
2797 
2798 /*
2799  * NAME curl_global_sslset()
2800  *
2801  * DESCRIPTION
2802  *
2803  * When built with multiple SSL backends, curl_global_sslset() allows to
2804  * choose one. This function can only be called once, and it must be called
2805  * *before* curl_global_init().
2806  *
2807  * The backend can be identified by the id (e.g. CURLSSLBACKEND_OPENSSL). The
2808  * backend can also be specified via the name parameter (passing -1 as id). If
2809  * both id and name are specified, the name is ignored. If neither id nor
2810  * name are specified, the function fails with CURLSSLSET_UNKNOWN_BACKEND
2811  * and set the "avail" pointer to the NULL-terminated list of available
2812  * backends.
2813  *
2814  * Upon success, the function returns CURLSSLSET_OK.
2815  *
2816  * If the specified SSL backend is not available, the function returns
2817  * CURLSSLSET_UNKNOWN_BACKEND and sets the "avail" pointer to a
2818  * NULL-terminated list of available SSL backends.
2819  *
2820  * The SSL backend can be set only once. If it has already been set, a
2821  * subsequent attempt to change it results in a CURLSSLSET_TOO_LATE.
2822  */
2823 
2824 struct curl_ssl_backend {
2825   curl_sslbackend id;
2826   const char *name;
2827 };
2828 typedef struct curl_ssl_backend curl_ssl_backend;
2829 
2830 typedef enum {
2831   CURLSSLSET_OK = 0,
2832   CURLSSLSET_UNKNOWN_BACKEND,
2833   CURLSSLSET_TOO_LATE,
2834   CURLSSLSET_NO_BACKENDS /* libcurl was built without any SSL support */
2835 } CURLsslset;
2836 
2837 CURL_EXTERN CURLsslset curl_global_sslset(curl_sslbackend id, const char *name,
2838                                           const curl_ssl_backend ***avail);
2839 
2840 /*
2841  * NAME curl_slist_append()
2842  *
2843  * DESCRIPTION
2844  *
2845  * Appends a string to a linked list. If no list exists, it is created first.
2846  * Returns the new list, after appending.
2847  */
2848 CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *list,
2849                                                  const char *data);
2850 
2851 /*
2852  * NAME curl_slist_free_all()
2853  *
2854  * DESCRIPTION
2855  *
2856  * free a previously built curl_slist.
2857  */
2858 CURL_EXTERN void curl_slist_free_all(struct curl_slist *list);
2859 
2860 /*
2861  * NAME curl_getdate()
2862  *
2863  * DESCRIPTION
2864  *
2865  * Returns the time, in seconds since 1 Jan 1970 of the time string given in
2866  * the first argument. The time argument in the second parameter is unused
2867  * and should be set to NULL.
2868  */
2869 CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
2870 
2871 /* info about the certificate chain, for SSL backends that support it. Asked
2872    for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
2873 struct curl_certinfo {
2874   int num_of_certs;             /* number of certificates with information */
2875   struct curl_slist **certinfo; /* for each index in this array, there is a
2876                                    linked list with textual information for a
2877                                    certificate in the format "name:content".
2878                                    eg "Subject:foo", "Issuer:bar", etc. */
2879 };
2880 
2881 /* Information about the SSL library used and the respective internal SSL
2882    handle, which can be used to obtain further information regarding the
2883    connection. Asked for with CURLINFO_TLS_SSL_PTR or CURLINFO_TLS_SESSION. */
2884 struct curl_tlssessioninfo {
2885   curl_sslbackend backend;
2886   void *internals;
2887 };
2888 
2889 #define CURLINFO_STRING   0x100000
2890 #define CURLINFO_LONG     0x200000
2891 #define CURLINFO_DOUBLE   0x300000
2892 #define CURLINFO_SLIST    0x400000
2893 #define CURLINFO_PTR      0x400000 /* same as SLIST */
2894 #define CURLINFO_SOCKET   0x500000
2895 #define CURLINFO_OFF_T    0x600000
2896 #define CURLINFO_MASK     0x0fffff
2897 #define CURLINFO_TYPEMASK 0xf00000
2898 
2899 typedef enum {
2900   CURLINFO_NONE, /* first, never use this */
2901   CURLINFO_EFFECTIVE_URL    = CURLINFO_STRING + 1,
2902   CURLINFO_RESPONSE_CODE    = CURLINFO_LONG   + 2,
2903   CURLINFO_TOTAL_TIME       = CURLINFO_DOUBLE + 3,
2904   CURLINFO_NAMELOOKUP_TIME  = CURLINFO_DOUBLE + 4,
2905   CURLINFO_CONNECT_TIME     = CURLINFO_DOUBLE + 5,
2906   CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
2907   CURLINFO_SIZE_UPLOAD CURL_DEPRECATED(7.55.0, "Use CURLINFO_SIZE_UPLOAD_T")
2908                             = CURLINFO_DOUBLE + 7,
2909   CURLINFO_SIZE_UPLOAD_T    = CURLINFO_OFF_T  + 7,
2910   CURLINFO_SIZE_DOWNLOAD
2911                        CURL_DEPRECATED(7.55.0, "Use CURLINFO_SIZE_DOWNLOAD_T")
2912                             = CURLINFO_DOUBLE + 8,
2913   CURLINFO_SIZE_DOWNLOAD_T  = CURLINFO_OFF_T  + 8,
2914   CURLINFO_SPEED_DOWNLOAD
2915                        CURL_DEPRECATED(7.55.0, "Use CURLINFO_SPEED_DOWNLOAD_T")
2916                             = CURLINFO_DOUBLE + 9,
2917   CURLINFO_SPEED_DOWNLOAD_T = CURLINFO_OFF_T  + 9,
2918   CURLINFO_SPEED_UPLOAD
2919                        CURL_DEPRECATED(7.55.0, "Use CURLINFO_SPEED_UPLOAD_T")
2920                             = CURLINFO_DOUBLE + 10,
2921   CURLINFO_SPEED_UPLOAD_T   = CURLINFO_OFF_T  + 10,
2922   CURLINFO_HEADER_SIZE      = CURLINFO_LONG   + 11,
2923   CURLINFO_REQUEST_SIZE     = CURLINFO_LONG   + 12,
2924   CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG   + 13,
2925   CURLINFO_FILETIME         = CURLINFO_LONG   + 14,
2926   CURLINFO_FILETIME_T       = CURLINFO_OFF_T  + 14,
2927   CURLINFO_CONTENT_LENGTH_DOWNLOAD
2928                        CURL_DEPRECATED(7.55.0,
2929                                       "Use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T")
2930                             = CURLINFO_DOUBLE + 15,
2931   CURLINFO_CONTENT_LENGTH_DOWNLOAD_T = CURLINFO_OFF_T  + 15,
2932   CURLINFO_CONTENT_LENGTH_UPLOAD
2933                        CURL_DEPRECATED(7.55.0,
2934                                        "Use CURLINFO_CONTENT_LENGTH_UPLOAD_T")
2935                             = CURLINFO_DOUBLE + 16,
2936   CURLINFO_CONTENT_LENGTH_UPLOAD_T   = CURLINFO_OFF_T  + 16,
2937   CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
2938   CURLINFO_CONTENT_TYPE     = CURLINFO_STRING + 18,
2939   CURLINFO_REDIRECT_TIME    = CURLINFO_DOUBLE + 19,
2940   CURLINFO_REDIRECT_COUNT   = CURLINFO_LONG   + 20,
2941   CURLINFO_PRIVATE          = CURLINFO_STRING + 21,
2942   CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG   + 22,
2943   CURLINFO_HTTPAUTH_AVAIL   = CURLINFO_LONG   + 23,
2944   CURLINFO_PROXYAUTH_AVAIL  = CURLINFO_LONG   + 24,
2945   CURLINFO_OS_ERRNO         = CURLINFO_LONG   + 25,
2946   CURLINFO_NUM_CONNECTS     = CURLINFO_LONG   + 26,
2947   CURLINFO_SSL_ENGINES      = CURLINFO_SLIST  + 27,
2948   CURLINFO_COOKIELIST       = CURLINFO_SLIST  + 28,
2949   CURLINFO_LASTSOCKET  CURL_DEPRECATED(7.45.0, "Use CURLINFO_ACTIVESOCKET")
2950                             = CURLINFO_LONG   + 29,
2951   CURLINFO_FTP_ENTRY_PATH   = CURLINFO_STRING + 30,
2952   CURLINFO_REDIRECT_URL     = CURLINFO_STRING + 31,
2953   CURLINFO_PRIMARY_IP       = CURLINFO_STRING + 32,
2954   CURLINFO_APPCONNECT_TIME  = CURLINFO_DOUBLE + 33,
2955   CURLINFO_CERTINFO         = CURLINFO_PTR    + 34,
2956   CURLINFO_CONDITION_UNMET  = CURLINFO_LONG   + 35,
2957   CURLINFO_RTSP_SESSION_ID  = CURLINFO_STRING + 36,
2958   CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG   + 37,
2959   CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG   + 38,
2960   CURLINFO_RTSP_CSEQ_RECV   = CURLINFO_LONG   + 39,
2961   CURLINFO_PRIMARY_PORT     = CURLINFO_LONG   + 40,
2962   CURLINFO_LOCAL_IP         = CURLINFO_STRING + 41,
2963   CURLINFO_LOCAL_PORT       = CURLINFO_LONG   + 42,
2964   CURLINFO_TLS_SESSION CURL_DEPRECATED(7.48.0, "Use CURLINFO_TLS_SSL_PTR")
2965                             = CURLINFO_PTR    + 43,
2966   CURLINFO_ACTIVESOCKET     = CURLINFO_SOCKET + 44,
2967   CURLINFO_TLS_SSL_PTR      = CURLINFO_PTR    + 45,
2968   CURLINFO_HTTP_VERSION     = CURLINFO_LONG   + 46,
2969   CURLINFO_PROXY_SSL_VERIFYRESULT = CURLINFO_LONG + 47,
2970   CURLINFO_PROTOCOL    CURL_DEPRECATED(7.85.0, "Use CURLINFO_SCHEME")
2971                             = CURLINFO_LONG   + 48,
2972   CURLINFO_SCHEME           = CURLINFO_STRING + 49,
2973   CURLINFO_TOTAL_TIME_T     = CURLINFO_OFF_T + 50,
2974   CURLINFO_NAMELOOKUP_TIME_T = CURLINFO_OFF_T + 51,
2975   CURLINFO_CONNECT_TIME_T   = CURLINFO_OFF_T + 52,
2976   CURLINFO_PRETRANSFER_TIME_T = CURLINFO_OFF_T + 53,
2977   CURLINFO_STARTTRANSFER_TIME_T = CURLINFO_OFF_T + 54,
2978   CURLINFO_REDIRECT_TIME_T  = CURLINFO_OFF_T + 55,
2979   CURLINFO_APPCONNECT_TIME_T = CURLINFO_OFF_T + 56,
2980   CURLINFO_RETRY_AFTER      = CURLINFO_OFF_T + 57,
2981   CURLINFO_EFFECTIVE_METHOD = CURLINFO_STRING + 58,
2982   CURLINFO_PROXY_ERROR      = CURLINFO_LONG + 59,
2983   CURLINFO_REFERER          = CURLINFO_STRING + 60,
2984   CURLINFO_CAINFO           = CURLINFO_STRING + 61,
2985   CURLINFO_CAPATH           = CURLINFO_STRING + 62,
2986   CURLINFO_XFER_ID          = CURLINFO_OFF_T + 63,
2987   CURLINFO_CONN_ID          = CURLINFO_OFF_T + 64,
2988   CURLINFO_QUEUE_TIME_T     = CURLINFO_OFF_T + 65,
2989   CURLINFO_USED_PROXY       = CURLINFO_LONG + 66,
2990   CURLINFO_POSTTRANSFER_TIME_T = CURLINFO_OFF_T + 67,
2991   CURLINFO_EARLYDATA_SENT_T = CURLINFO_OFF_T + 68,
2992   CURLINFO_HTTPAUTH_USED    = CURLINFO_LONG + 69,
2993   CURLINFO_PROXYAUTH_USED   = CURLINFO_LONG + 70,
2994   CURLINFO_SIZE_DELIVERED   = CURLINFO_OFF_T + 71,
2995   CURLINFO_LASTONE          = 71
2996 } CURLINFO;
2997 
2998 /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
2999    CURLINFO_HTTP_CODE */
3000 #define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
3001 
3002 typedef enum {
3003   CURLCLOSEPOLICY_NONE, /* first, never use this */
3004 
3005   CURLCLOSEPOLICY_OLDEST,
3006   CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
3007   CURLCLOSEPOLICY_LEAST_TRAFFIC,
3008   CURLCLOSEPOLICY_SLOWEST,
3009   CURLCLOSEPOLICY_CALLBACK,
3010 
3011   CURLCLOSEPOLICY_LAST /* last, never use this */
3012 } curl_closepolicy;
3013 
3014 #define CURL_GLOBAL_SSL (1 << 0) /* no purpose since 7.57.0 */
3015 #define CURL_GLOBAL_WIN32 (1 << 1)
3016 #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WIN32)
3017 #define CURL_GLOBAL_NOTHING 0
3018 #define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
3019 #define CURL_GLOBAL_ACK_EINTR (1 << 2)
3020 
3021 /*****************************************************************************
3022  * Setup defines, protos etc for the sharing stuff.
3023  */
3024 
3025 /* Different data locks for a single share */
3026 typedef enum {
3027   CURL_LOCK_DATA_NONE = 0,
3028   /*  CURL_LOCK_DATA_SHARE is used internally to say that the locking is made
3029    *  to change the internal state of the share itself.
3030    */
3031   CURL_LOCK_DATA_SHARE,
3032   CURL_LOCK_DATA_COOKIE,
3033   CURL_LOCK_DATA_DNS,
3034   CURL_LOCK_DATA_SSL_SESSION,
3035   CURL_LOCK_DATA_CONNECT,
3036   CURL_LOCK_DATA_PSL,
3037   CURL_LOCK_DATA_HSTS,
3038   CURL_LOCK_DATA_LAST
3039 } curl_lock_data;
3040 
3041 /* Different lock access types */
3042 typedef enum {
3043   CURL_LOCK_ACCESS_NONE = 0,   /* unspecified action */
3044   CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
3045   CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
3046   CURL_LOCK_ACCESS_LAST        /* never use */
3047 } curl_lock_access;
3048 
3049 typedef void (*curl_lock_function)(CURL *handle,
3050                                    curl_lock_data data,
3051                                    curl_lock_access locktype,
3052                                    void *userptr);
3053 typedef void (*curl_unlock_function)(CURL *handle,
3054                                      curl_lock_data data,
3055                                      void *userptr);
3056 
3057 typedef enum {
3058   CURLSHE_OK,  /* all is fine */
3059   CURLSHE_BAD_OPTION, /* 1 */
3060   CURLSHE_IN_USE,     /* 2 */
3061   CURLSHE_INVALID,    /* 3 */
3062   CURLSHE_NOMEM,      /* 4 out of memory */
3063   CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */
3064   CURLSHE_LAST        /* never use */
3065 } CURLSHcode;
3066 
3067 typedef enum {
3068   CURLSHOPT_NONE,  /* do not use */
3069   CURLSHOPT_SHARE,   /* specify a data type to share */
3070   CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
3071   CURLSHOPT_LOCKFUNC,   /* pass in a 'curl_lock_function' pointer */
3072   CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
3073   CURLSHOPT_USERDATA,   /* pass in a user data pointer used in the lock/unlock
3074                            callback functions */
3075   CURLSHOPT_LAST  /* never use */
3076 } CURLSHoption;
3077 
3078 CURL_EXTERN CURLSH *curl_share_init(void);
3079 CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...);
3080 CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *sh);
3081 
3082 /****************************************************************************
3083  * Structures for querying information about the curl library at runtime.
3084  */
3085 
3086 typedef enum {
3087   CURLVERSION_FIRST,    /* 7.10 */
3088   CURLVERSION_SECOND,   /* 7.11.1 */
3089   CURLVERSION_THIRD,    /* 7.12.0 */
3090   CURLVERSION_FOURTH,   /* 7.16.1 */
3091   CURLVERSION_FIFTH,    /* 7.57.0 */
3092   CURLVERSION_SIXTH,    /* 7.66.0 */
3093   CURLVERSION_SEVENTH,  /* 7.70.0 */
3094   CURLVERSION_EIGHTH,   /* 7.72.0 */
3095   CURLVERSION_NINTH,    /* 7.75.0 */
3096   CURLVERSION_TENTH,    /* 7.77.0 */
3097   CURLVERSION_ELEVENTH, /* 7.87.0 */
3098   CURLVERSION_TWELFTH,  /* 8.8.0 */
3099   CURLVERSION_LAST /* never actually use this */
3100 } CURLversion;
3101 
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. */
3106 #define CURLVERSION_NOW CURLVERSION_TWELFTH
3107 
3108 struct curl_version_info_data {
3109   CURLversion age;          /* age of the returned struct */
3110   const char *version;      /* LIBCURL_VERSION */
3111   unsigned int version_num; /* LIBCURL_VERSION_NUM */
3112   const char *host;         /* OS/host/cpu/machine when configured */
3113   int features;             /* bitmask, see defines below */
3114   const char *ssl_version;  /* human readable string */
3115   long ssl_version_num;     /* not used anymore, always 0 */
3116   const char *libz_version; /* human readable string */
3117   /* protocols is terminated by an entry with a NULL protoname */
3118   const char * const *protocols;
3119 
3120   /* The fields below this were added in CURLVERSION_SECOND */
3121   const char *ares;
3122   int ares_num;
3123 
3124   /* This field was added in CURLVERSION_THIRD */
3125   const char *libidn;
3126 
3127   /* These field were added in CURLVERSION_FOURTH */
3128 
3129   /* Same as '_libiconv_version' if built with HAVE_ICONV */
3130   int iconv_ver_num;
3131 
3132   const char *libssh_version; /* human readable string */
3133 
3134   /* These fields were added in CURLVERSION_FIFTH */
3135   unsigned int brotli_ver_num; /* Numeric Brotli version
3136                                   (MAJOR << 24) | (MINOR << 12) | PATCH */
3137   const char *brotli_version; /* human readable string. */
3138 
3139   /* These fields were added in CURLVERSION_SIXTH */
3140   unsigned int nghttp2_ver_num; /* Numeric nghttp2 version
3141                                    (MAJOR << 16) | (MINOR << 8) | PATCH */
3142   const char *nghttp2_version; /* human readable string. */
3143   const char *quic_version;    /* human readable quic (+ HTTP/3) library +
3144                                   version or NULL */
3145 
3146   /* These fields were added in CURLVERSION_SEVENTH */
3147   const char *cainfo;          /* the built-in default CURLOPT_CAINFO, might
3148                                   be NULL */
3149   const char *capath;          /* the built-in default CURLOPT_CAPATH, might
3150                                   be NULL */
3151 
3152   /* These fields were added in CURLVERSION_EIGHTH */
3153   unsigned int zstd_ver_num; /* Numeric Zstd version
3154                                   (MAJOR << 24) | (MINOR << 12) | PATCH */
3155   const char *zstd_version; /* human readable string. */
3156 
3157   /* These fields were added in CURLVERSION_NINTH */
3158   const char *hyper_version; /* human readable string. */
3159 
3160   /* These fields were added in CURLVERSION_TENTH */
3161   const char *gsasl_version; /* human readable string. */
3162 
3163   /* These fields were added in CURLVERSION_ELEVENTH */
3164   /* feature_names is terminated by an entry with a NULL feature name */
3165   const char * const *feature_names;
3166 
3167   /* These fields were added in CURLVERSION_TWELFTH */
3168   const char *rtmp_version; /* human readable string. */
3169 };
3170 typedef struct curl_version_info_data curl_version_info_data;
3171 
3172 #define CURL_VERSION_IPV6         (1<<0)  /* IPv6-enabled */
3173 #define CURL_VERSION_KERBEROS4    (1<<1)  /* Kerberos V4 auth is supported
3174                                              (deprecated) */
3175 #define CURL_VERSION_SSL          (1<<2)  /* SSL options are present */
3176 #define CURL_VERSION_LIBZ         (1<<3)  /* libz features are present */
3177 #define CURL_VERSION_NTLM         (1<<4)  /* NTLM auth is supported */
3178 #define CURL_VERSION_GSSNEGOTIATE (1<<5)  /* Negotiate auth is supported
3179                                              (deprecated) */
3180 #define CURL_VERSION_DEBUG        (1<<6)  /* Built with debug capabilities */
3181 #define CURL_VERSION_ASYNCHDNS    (1<<7)  /* Asynchronous DNS resolves */
3182 #define CURL_VERSION_SPNEGO       (1<<8)  /* SPNEGO auth is supported */
3183 #define CURL_VERSION_LARGEFILE    (1<<9)  /* Supports files larger than 2GB */
3184 #define CURL_VERSION_IDN          (1<<10) /* Internationized Domain Names are
3185                                              supported */
3186 #define CURL_VERSION_SSPI         (1<<11) /* Built against Windows SSPI */
3187 #define CURL_VERSION_CONV         (1<<12) /* Character conversions supported */
3188 #define CURL_VERSION_CURLDEBUG    (1<<13) /* Debug memory tracking supported
3189                                              (deprecated) */
3190 #define CURL_VERSION_TLSAUTH_SRP  (1<<14) /* TLS-SRP auth is supported */
3191 #define CURL_VERSION_NTLM_WB      (1<<15) /* NTLM delegation to winbind helper
3192                                              is supported */
3193 #define CURL_VERSION_HTTP2        (1<<16) /* HTTP2 support built-in */
3194 #define CURL_VERSION_GSSAPI       (1<<17) /* Built against a GSS-API library */
3195 #define CURL_VERSION_KERBEROS5    (1<<18) /* Kerberos V5 auth is supported */
3196 #define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */
3197 #define CURL_VERSION_PSL          (1<<20) /* Mozilla's Public Suffix List, used
3198                                              for cookie domain verification */
3199 #define CURL_VERSION_HTTPS_PROXY  (1<<21) /* HTTPS-proxy support built-in */
3200 #define CURL_VERSION_MULTI_SSL    (1<<22) /* Multiple SSL backends available */
3201 #define CURL_VERSION_BROTLI       (1<<23) /* Brotli features are present. */
3202 #define CURL_VERSION_ALTSVC       (1<<24) /* Alt-Svc handling built-in */
3203 #define CURL_VERSION_HTTP3        (1<<25) /* HTTP3 support built-in */
3204 #define CURL_VERSION_ZSTD         (1<<26) /* zstd features are present */
3205 #define CURL_VERSION_UNICODE      (1<<27) /* Unicode support on Windows */
3206 #define CURL_VERSION_HSTS         (1<<28) /* HSTS is supported */
3207 #define CURL_VERSION_GSASL        (1<<29) /* libgsasl is supported */
3208 #define CURL_VERSION_THREADSAFE   (1<<30) /* libcurl API is thread-safe */
3209 
3210 /*
3211  * NAME curl_version_info()
3212  *
3213  * DESCRIPTION
3214  *
3215  * This function returns a pointer to a static copy of the version info
3216  * struct. See above.
3217  */
3218 CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion stamp);
3219 
3220 /*
3221  * NAME curl_easy_strerror()
3222  *
3223  * DESCRIPTION
3224  *
3225  * The curl_easy_strerror function may be used to turn a CURLcode value
3226  * into the equivalent human readable error string. This is useful
3227  * for printing meaningful error messages.
3228  */
3229 CURL_EXTERN const char *curl_easy_strerror(CURLcode error);
3230 
3231 /*
3232  * NAME curl_share_strerror()
3233  *
3234  * DESCRIPTION
3235  *
3236  * The curl_share_strerror function may be used to turn a CURLSHcode value
3237  * into the equivalent human readable error string. This is useful
3238  * for printing meaningful error messages.
3239  */
3240 CURL_EXTERN const char *curl_share_strerror(CURLSHcode error);
3241 
3242 /*
3243  * NAME curl_easy_pause()
3244  *
3245  * DESCRIPTION
3246  *
3247  * The curl_easy_pause function pauses or unpauses transfers. Select the new
3248  * state by setting the action bitmask, use the convenience defines below.
3249  *
3250  */
3251 CURL_EXTERN CURLcode curl_easy_pause(CURL *curl, int action);
3252 
3253 #define CURLPAUSE_RECV      (1 << 0)
3254 #define CURLPAUSE_RECV_CONT 0
3255 
3256 #define CURLPAUSE_SEND      (1 << 2)
3257 #define CURLPAUSE_SEND_CONT 0
3258 
3259 #define CURLPAUSE_ALL       (CURLPAUSE_RECV | CURLPAUSE_SEND)
3260 #define CURLPAUSE_CONT      (CURLPAUSE_RECV_CONT | CURLPAUSE_SEND_CONT)
3261 
3262 /*
3263  * NAME curl_easy_ssls_import()
3264  *
3265  * DESCRIPTION
3266  *
3267  * The curl_easy_ssls_import function adds a previously exported SSL session
3268  * to the SSL session cache of the easy handle (or the underlying share).
3269  */
3270 CURL_EXTERN CURLcode curl_easy_ssls_import(CURL *curl,
3271                                            const char *session_key,
3272                                            const unsigned char *shmac,
3273                                            size_t shmac_len,
3274                                            const unsigned char *sdata,
3275                                            size_t sdata_len);
3276 
3277 /* This is the curl_ssls_export_cb callback prototype. It
3278  * is passed to curl_easy_ssls_export() to extract SSL sessions/tickets. */
3279 typedef CURLcode curl_ssls_export_cb(CURL *curl,
3280                                      void *userptr,
3281                                      const char *session_key,
3282                                      const unsigned char *shmac,
3283                                      size_t shmac_len,
3284                                      const unsigned char *sdata,
3285                                      size_t sdata_len,
3286                                      curl_off_t valid_until,
3287                                      int ietf_tls_id,
3288                                      const char *alpn,
3289                                      size_t earlydata_max);
3290 
3291 /*
3292  * NAME curl_easy_ssls_export()
3293  *
3294  * DESCRIPTION
3295  *
3296  * The curl_easy_ssls_export function iterates over all SSL sessions stored
3297  * in the easy handle (or underlying share) and invokes the passed
3298  * callback.
3299  *
3300  */
3301 CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *curl,
3302                                            curl_ssls_export_cb *export_fn,
3303                                            void *userptr);
3304 
3305 #ifdef __cplusplus
3306 } /* end of extern "C" */
3307 #endif
3308 
3309 /* unfortunately, the easy.h and multi.h include files need options and info
3310    stuff before they can be included! */
3311 #include "easy.h" /* nothing in curl is fun without the easy stuff */
3312 #include "multi.h"
3313 #include "urlapi.h"
3314 #include "options.h"
3315 #include "header.h"
3316 #include "websockets.h"
3317 #include "mprintf.h"
3318 
3319 /* the typechecker does not work in C++ (yet) */
3320 #if ((defined(__GNUC__) && defined(__GNUC_MINOR__) && \
3321       ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
3322     (defined(__clang__) && __clang_major__ >= 14)) && \
3323     !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)
3324 #include "typecheck-gcc.h"
3325 #else
3326 #if defined(__STDC__) && (__STDC__ >= 1)
3327 /* This preprocessor magic ensures that application authors pass exactly three
3328    arguments to these functions. For compatibility with C++ global namespace
3329    '::' and reusing these symbols as method names, while also avoiding
3330    recursive macros, use a two-stage solution. */
3331 #define curl_exactly_three_arguments(a, b, c) (a, b, c)
3332 #define curl_easy_setopt(handle, opt, param) \
3333   curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
3334 #define curl_easy_getinfo(handle, info, arg) \
3335   curl_easy_getinfo curl_exactly_three_arguments(handle, info, arg)
3336 #define curl_share_setopt(share, opt, param) \
3337   curl_share_setopt curl_exactly_three_arguments(share, opt, param)
3338 #define curl_multi_setopt(handle, opt, param) \
3339   curl_multi_setopt curl_exactly_three_arguments(handle, opt, param)
3340 #endif /* __STDC__ >= 1 */
3341 #endif /* gcc >= 4.3 && !__cplusplus && !CURL_DISABLE_TYPECHECK */
3342 
3343 #endif /* CURLINC_CURL_H */