• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef CURLINC_CURL_H
2 #define CURLINC_CURL_H
3 /***************************************************************************
4  *                                  _   _ ____  _
5  *  Project                     ___| | | |  _ \| |
6  *                             / __| | | | |_) | |
7  *                            | (__| |_| |  _ <| |___
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
12  * This software is licensed as described in the file COPYING, which
13  * you should have received as part of this distribution. The terms
14  * are also available at https://curl.se/docs/copyright.html.
15  *
16  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17  * copies of the Software, and permit persons to whom the Software is
18  * furnished to do so, under the terms of the COPYING file.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  * SPDX-License-Identifier: curl
24  *
25  ***************************************************************************/
26 
27 /*
28  * If you have libcurl problems, all docs and details are found here:
29  *   https://curl.se/libcurl/
30  */
31 
32 #ifdef CURL_NO_OLDIES
33 #define CURL_STRICTER
34 #endif
35 
36 /* Compile-time deprecation macros. */
37 #if defined(__GNUC__) &&                                                \
38   ((__GNUC__ > 12) || ((__GNUC__ == 12) && (__GNUC_MINOR__ >= 1 ))) &&  \
39   !defined(__INTEL_COMPILER) &&                                         \
40   !defined(CURL_DISABLE_DEPRECATION) && !defined(BUILDING_LIBCURL)
41 #define CURL_DEPRECATED(version, message)                       \
42   __attribute__((deprecated("since " # version ". " message)))
43 #define CURL_IGNORE_DEPRECATION(statements) \
44       _Pragma("GCC diagnostic push") \
45       _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
46       statements \
47       _Pragma("GCC diagnostic pop")
48 #else
49 #define CURL_DEPRECATED(version, message)
50 #define CURL_IGNORE_DEPRECATION(statements)     statements
51 #endif
52 
53 #include "curlver.h"         /* libcurl version defines   */
54 #include "system.h"          /* determine things run-time */
55 
56 #include <stdio.h>
57 #include <limits.h>
58 
59 #if defined(__FreeBSD__) || defined(__MidnightBSD__)
60 /* Needed for __FreeBSD_version or __MidnightBSD_version symbol definition */
61 #include <sys/param.h>
62 #endif
63 
64 /* The include stuff here below is mainly for time_t! */
65 #include <sys/types.h>
66 #include <time.h>
67 
68 #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
69 #if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \
70       defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
71 /* The check above prevents the winsock2 inclusion if winsock.h already was
72    included, since they can't co-exist without problems */
73 #include <winsock2.h>
74 #include <ws2tcpip.h>
75 #endif
76 #endif
77 
78 /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
79    libc5-based Linux systems. Only include it on systems that are known to
80    require it! */
81 #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
82     defined(__minix) || defined(__INTEGRITY) || \
83     defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
84     defined(__CYGWIN__) || defined(AMIGA) || defined(__NuttX__) || \
85    (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) || \
86    (defined(__MidnightBSD_version) && (__MidnightBSD_version < 100000)) || \
87     defined(__sun__) || defined(__serenity__) || defined(__vxworks__)
88 #include <sys/select.h>
89 #endif
90 
91 #if !defined(_WIN32) && !defined(_WIN32_WCE)
92 #include <sys/socket.h>
93 #endif
94 
95 #if !defined(_WIN32)
96 #include <sys/time.h>
97 #endif
98 
99 /* Compatibility for non-Clang compilers */
100 #ifndef __has_declspec_attribute
101 #  define __has_declspec_attribute(x) 0
102 #endif
103 
104 #ifdef  __cplusplus
105 extern "C" {
106 #endif
107 
108 #if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER)
109 typedef struct Curl_easy CURL;
110 typedef struct Curl_share CURLSH;
111 #else
112 typedef void CURL;
113 typedef void CURLSH;
114 #endif
115 
116 /*
117  * libcurl external API function linkage decorations.
118  */
119 
120 #ifdef CURL_STATICLIB
121 #  define CURL_EXTERN
122 #elif defined(_WIN32) || \
123      (__has_declspec_attribute(dllexport) && \
124       __has_declspec_attribute(dllimport))
125 #  if defined(BUILDING_LIBCURL)
126 #    define CURL_EXTERN  __declspec(dllexport)
127 #  else
128 #    define CURL_EXTERN  __declspec(dllimport)
129 #  endif
130 #elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS)
131 #  define CURL_EXTERN CURL_EXTERN_SYMBOL
132 #else
133 #  define CURL_EXTERN
134 #endif
135 
136 #ifndef curl_socket_typedef
137 /* socket typedef */
138 #if defined(_WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H)
139 typedef SOCKET curl_socket_t;
140 #define CURL_SOCKET_BAD INVALID_SOCKET
141 #else
142 typedef int curl_socket_t;
143 #define CURL_SOCKET_BAD -1
144 #endif
145 #define curl_socket_typedef
146 #endif /* curl_socket_typedef */
147 
148 /* enum for the different supported SSL backends */
149 typedef enum {
150   CURLSSLBACKEND_NONE = 0,
151   CURLSSLBACKEND_OPENSSL = 1,
152   CURLSSLBACKEND_GNUTLS = 2,
153   CURLSSLBACKEND_NSS                    CURL_DEPRECATED(8.3.0, "") = 3,
154   CURLSSLBACKEND_OBSOLETE4 = 4,  /* Was QSOSSL. */
155   CURLSSLBACKEND_GSKIT                  CURL_DEPRECATED(8.3.0, "") = 5,
156   CURLSSLBACKEND_POLARSSL               CURL_DEPRECATED(7.69.0, "") = 6,
157   CURLSSLBACKEND_WOLFSSL = 7,
158   CURLSSLBACKEND_SCHANNEL = 8,
159   CURLSSLBACKEND_SECURETRANSPORT = 9,
160   CURLSSLBACKEND_AXTLS                  CURL_DEPRECATED(7.61.0, "") = 10,
161   CURLSSLBACKEND_MBEDTLS = 11,
162   CURLSSLBACKEND_MESALINK               CURL_DEPRECATED(7.82.0, "") = 12,
163   CURLSSLBACKEND_BEARSSL = 13,
164   CURLSSLBACKEND_RUSTLS = 14
165 } curl_sslbackend;
166 
167 /* aliases for library clones and renames */
168 #define CURLSSLBACKEND_AWSLC CURLSSLBACKEND_OPENSSL
169 #define CURLSSLBACKEND_BORINGSSL CURLSSLBACKEND_OPENSSL
170 #define CURLSSLBACKEND_LIBRESSL CURLSSLBACKEND_OPENSSL
171 
172 /* deprecated names: */
173 #define CURLSSLBACKEND_CYASSL CURLSSLBACKEND_WOLFSSL
174 #define CURLSSLBACKEND_DARWINSSL CURLSSLBACKEND_SECURETRANSPORT
175 
176 struct curl_httppost {
177   struct curl_httppost *next;       /* next entry in the list */
178   char *name;                       /* pointer to allocated name */
179   long namelength;                  /* length of name length */
180   char *contents;                   /* pointer to allocated data contents */
181   long contentslength;              /* length of contents field, see also
182                                        CURL_HTTPPOST_LARGE */
183   char *buffer;                     /* pointer to allocated buffer contents */
184   long bufferlength;                /* length of buffer field */
185   char *contenttype;                /* Content-Type */
186   struct curl_slist *contentheader; /* list of extra headers for this form */
187   struct curl_httppost *more;       /* if one field name has more than one
188                                        file, this link should link to following
189                                        files */
190   long flags;                       /* as defined below */
191 
192 /* specified content is a file name */
193 #define CURL_HTTPPOST_FILENAME (1<<0)
194 /* specified content is a file name */
195 #define CURL_HTTPPOST_READFILE (1<<1)
196 /* name is only stored pointer do not free in formfree */
197 #define CURL_HTTPPOST_PTRNAME (1<<2)
198 /* contents is only stored pointer do not free in formfree */
199 #define CURL_HTTPPOST_PTRCONTENTS (1<<3)
200 /* upload file from buffer */
201 #define CURL_HTTPPOST_BUFFER (1<<4)
202 /* upload file from pointer contents */
203 #define CURL_HTTPPOST_PTRBUFFER (1<<5)
204 /* upload file contents by using the regular read callback to get the data and
205    pass the given pointer as custom pointer */
206 #define CURL_HTTPPOST_CALLBACK (1<<6)
207 /* use size in 'contentlen', added in 7.46.0 */
208 #define CURL_HTTPPOST_LARGE (1<<7)
209 
210   char *showfilename;               /* The file name to show. If not set, the
211                                        actual file name will be used (if this
212                                        is a file part) */
213   void *userp;                      /* custom pointer used for
214                                        HTTPPOST_CALLBACK posts */
215   curl_off_t contentlen;            /* alternative length of contents
216                                        field. Used if CURL_HTTPPOST_LARGE is
217                                        set. Added in 7.46.0 */
218 };
219 
220 
221 /* This is a return code for the progress callback that, when returned, will
222    signal libcurl to continue executing the default progress function */
223 #define CURL_PROGRESSFUNC_CONTINUE 0x10000001
224 
225 /* This is the CURLOPT_PROGRESSFUNCTION callback prototype. It is now
226    considered deprecated but was the only choice up until 7.31.0 */
227 typedef int (*curl_progress_callback)(void *clientp,
228                                       double dltotal,
229                                       double dlnow,
230                                       double ultotal,
231                                       double ulnow);
232 
233 /* This is the CURLOPT_XFERINFOFUNCTION callback prototype. It was introduced
234    in 7.32.0, avoids the use of floating point numbers and provides more
235    detailed information. */
236 typedef int (*curl_xferinfo_callback)(void *clientp,
237                                       curl_off_t dltotal,
238                                       curl_off_t dlnow,
239                                       curl_off_t ultotal,
240                                       curl_off_t ulnow);
241 
242 #ifndef CURL_MAX_READ_SIZE
243   /* The maximum receive buffer size configurable via CURLOPT_BUFFERSIZE. */
244 #define CURL_MAX_READ_SIZE (10*1024*1024)
245 #endif
246 
247 #ifndef CURL_MAX_WRITE_SIZE
248   /* Tests have proven that 20K is a very bad buffer size for uploads on
249      Windows, while 16K for some odd reason performed a lot better.
250      We do the ifndef check to allow this value to easier be changed at build
251      time for those who feel adventurous. The practical minimum is about
252      400 bytes since libcurl uses a buffer of this size as a scratch area
253      (unrelated to network send operations). */
254 #define CURL_MAX_WRITE_SIZE 16384
255 #endif
256 
257 #ifndef CURL_MAX_HTTP_HEADER
258 /* The only reason to have a max limit for this is to avoid the risk of a bad
259    server feeding libcurl with a never-ending header that will cause reallocs
260    infinitely */
261 #define CURL_MAX_HTTP_HEADER (100*1024)
262 #endif
263 
264 /* This is a magic return code for the write callback that, when returned,
265    will signal libcurl to pause receiving on the current transfer. */
266 #define CURL_WRITEFUNC_PAUSE 0x10000001
267 
268 /* This is a magic return code for the write callback that, when returned,
269    will signal an error from the callback. */
270 #define CURL_WRITEFUNC_ERROR 0xFFFFFFFF
271 
272 typedef size_t (*curl_write_callback)(char *buffer,
273                                       size_t size,
274                                       size_t nitems,
275                                       void *outstream);
276 
277 /* This callback will be called when a new resolver request is made */
278 typedef int (*curl_resolver_start_callback)(void *resolver_state,
279                                             void *reserved, void *userdata);
280 
281 /* enumeration of file types */
282 typedef enum {
283   CURLFILETYPE_FILE = 0,
284   CURLFILETYPE_DIRECTORY,
285   CURLFILETYPE_SYMLINK,
286   CURLFILETYPE_DEVICE_BLOCK,
287   CURLFILETYPE_DEVICE_CHAR,
288   CURLFILETYPE_NAMEDPIPE,
289   CURLFILETYPE_SOCKET,
290   CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */
291 
292   CURLFILETYPE_UNKNOWN /* should never occur */
293 } curlfiletype;
294 
295 #define CURLFINFOFLAG_KNOWN_FILENAME    (1<<0)
296 #define CURLFINFOFLAG_KNOWN_FILETYPE    (1<<1)
297 #define CURLFINFOFLAG_KNOWN_TIME        (1<<2)
298 #define CURLFINFOFLAG_KNOWN_PERM        (1<<3)
299 #define CURLFINFOFLAG_KNOWN_UID         (1<<4)
300 #define CURLFINFOFLAG_KNOWN_GID         (1<<5)
301 #define CURLFINFOFLAG_KNOWN_SIZE        (1<<6)
302 #define CURLFINFOFLAG_KNOWN_HLINKCOUNT  (1<<7)
303 
304 /* Information about a single file, used when doing FTP wildcard matching */
305 struct curl_fileinfo {
306   char *filename;
307   curlfiletype filetype;
308   time_t time; /* always zero! */
309   unsigned int perm;
310   int uid;
311   int gid;
312   curl_off_t size;
313   long int hardlinks;
314 
315   struct {
316     /* If some of these fields is not NULL, it is a pointer to b_data. */
317     char *time;
318     char *perm;
319     char *user;
320     char *group;
321     char *target; /* pointer to the target filename of a symlink */
322   } strings;
323 
324   unsigned int flags;
325 
326   /* These are libcurl private struct fields. Previously used by libcurl, so
327      they must never be interfered with. */
328   char *b_data;
329   size_t b_size;
330   size_t b_used;
331 };
332 
333 /* return codes for CURLOPT_CHUNK_BGN_FUNCTION */
334 #define CURL_CHUNK_BGN_FUNC_OK      0
335 #define CURL_CHUNK_BGN_FUNC_FAIL    1 /* tell the lib to end the task */
336 #define CURL_CHUNK_BGN_FUNC_SKIP    2 /* skip this chunk over */
337 
338 /* if splitting of data transfer is enabled, this callback is called before
339    download of an individual chunk started. Note that parameter "remains" works
340    only for FTP wildcard downloading (for now), otherwise is not used */
341 typedef long (*curl_chunk_bgn_callback)(const void *transfer_info,
342                                         void *ptr,
343                                         int remains);
344 
345 /* return codes for CURLOPT_CHUNK_END_FUNCTION */
346 #define CURL_CHUNK_END_FUNC_OK      0
347 #define CURL_CHUNK_END_FUNC_FAIL    1 /* tell the lib to end the task */
348 
349 /* If splitting of data transfer is enabled this callback is called after
350    download of an individual chunk finished.
351    Note! After this callback was set then it have to be called FOR ALL chunks.
352    Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.
353    This is the reason why we don't need "transfer_info" parameter in this
354    callback and we are not interested in "remains" parameter too. */
355 typedef long (*curl_chunk_end_callback)(void *ptr);
356 
357 /* return codes for FNMATCHFUNCTION */
358 #define CURL_FNMATCHFUNC_MATCH    0 /* string corresponds to the pattern */
359 #define CURL_FNMATCHFUNC_NOMATCH  1 /* pattern doesn't match the string */
360 #define CURL_FNMATCHFUNC_FAIL     2 /* an error occurred */
361 
362 /* callback type for wildcard downloading pattern matching. If the
363    string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */
364 typedef int (*curl_fnmatch_callback)(void *ptr,
365                                      const char *pattern,
366                                      const char *string);
367 
368 /* These are the return codes for the seek callbacks */
369 #define CURL_SEEKFUNC_OK       0
370 #define CURL_SEEKFUNC_FAIL     1 /* fail the entire transfer */
371 #define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so
372                                     libcurl might try other means instead */
373 typedef int (*curl_seek_callback)(void *instream,
374                                   curl_off_t offset,
375                                   int origin); /* 'whence' */
376 
377 /* This is a return code for the read callback that, when returned, will
378    signal libcurl to immediately abort the current transfer. */
379 #define CURL_READFUNC_ABORT 0x10000000
380 #define CURL_MAX_SSL_ERR_LEN 512
381 #define CURL_MAX_CIPHER_NUM 512
382 /* This is a return code for the read callback that, when returned, will
383    signal libcurl to pause sending data on the current transfer. */
384 #define CURL_READFUNC_PAUSE 0x10000001
385 
386 /* Return code for when the trailing headers' callback has terminated
387    without any errors */
388 #define CURL_TRAILERFUNC_OK 0
389 /* Return code for when was an error in the trailing header's list and we
390   want to abort the request */
391 #define CURL_TRAILERFUNC_ABORT 1
392 
393 typedef size_t (*curl_read_callback)(char *buffer,
394                                       size_t size,
395                                       size_t nitems,
396                                       void *instream);
397 
398 typedef int (*curl_trailer_callback)(struct curl_slist **list,
399                                       void *userdata);
400 
401 typedef enum {
402   CURLSOCKTYPE_IPCXN,  /* socket created for a specific IP connection */
403   CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */
404   CURLSOCKTYPE_LAST    /* never use */
405 } curlsocktype;
406 
407 /* The return code from the sockopt_callback can signal information back
408    to libcurl: */
409 #define CURL_SOCKOPT_OK 0
410 #define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return
411                                 CURLE_ABORTED_BY_CALLBACK */
412 #define CURL_SOCKOPT_ALREADY_CONNECTED 2
413 
414 typedef int (*curl_sockopt_callback)(void *clientp,
415                                      curl_socket_t curlfd,
416                                      curlsocktype purpose);
417 
418 struct curl_sockaddr {
419   int family;
420   int socktype;
421   int protocol;
422   unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it
423                            turned really ugly and painful on the systems that
424                            lack this type */
425   struct sockaddr addr;
426 };
427 
428 typedef curl_socket_t
429 (*curl_opensocket_callback)(void *clientp,
430                             curlsocktype purpose,
431                             struct curl_sockaddr *address);
432 
433 typedef int
434 (*curl_closesocket_callback)(void *clientp, curl_socket_t item);
435 
436 typedef enum {
437   CURLIOE_OK,            /* I/O operation successful */
438   CURLIOE_UNKNOWNCMD,    /* command was unknown to callback */
439   CURLIOE_FAILRESTART,   /* failed to restart the read */
440   CURLIOE_LAST           /* never use */
441 } curlioerr;
442 
443 typedef enum {
444   CURLIOCMD_NOP,         /* no operation */
445   CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
446   CURLIOCMD_LAST         /* never use */
447 } curliocmd;
448 
449 typedef curlioerr (*curl_ioctl_callback)(CURL *handle,
450                                          int cmd,
451                                          void *clientp);
452 
453 #ifndef CURL_DID_MEMORY_FUNC_TYPEDEFS
454 /*
455  * The following typedef's are signatures of malloc, free, realloc, strdup and
456  * calloc respectively.  Function pointers of these types can be passed to the
457  * curl_global_init_mem() function to set user defined memory management
458  * callback routines.
459  */
460 typedef void *(*curl_malloc_callback)(size_t size);
461 typedef void (*curl_free_callback)(void *ptr);
462 typedef void *(*curl_realloc_callback)(void *ptr, size_t size);
463 typedef char *(*curl_strdup_callback)(const char *str);
464 typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
465 
466 #define CURL_DID_MEMORY_FUNC_TYPEDEFS
467 #endif
468 
469 /* the kind of data that is passed to information_callback */
470 typedef enum {
471   CURLINFO_TEXT = 0,
472   CURLINFO_HEADER_IN,    /* 1 */
473   CURLINFO_HEADER_OUT,   /* 2 */
474   CURLINFO_DATA_IN,      /* 3 */
475   CURLINFO_DATA_OUT,     /* 4 */
476   CURLINFO_SSL_DATA_IN,  /* 5 */
477   CURLINFO_SSL_DATA_OUT, /* 6 */
478   CURLINFO_END
479 } curl_infotype;
480 
481 typedef int (*curl_debug_callback)
482        (CURL *handle,      /* the handle/transfer this concerns */
483         curl_infotype type, /* what kind of data */
484         char *data,        /* points to the data */
485         size_t size,       /* size of the data pointed to */
486         void *userptr);    /* whatever the user please */
487 
488 /* This is the CURLOPT_PREREQFUNCTION callback prototype. */
489 typedef int (*curl_prereq_callback)(void *clientp,
490                                     char *conn_primary_ip,
491                                     char *conn_local_ip,
492                                     int conn_primary_port,
493                                     int conn_local_port);
494 
495 /* Return code for when the pre-request callback has terminated without
496    any errors */
497 #define CURL_PREREQFUNC_OK 0
498 /* Return code for when the pre-request callback wants to abort the
499    request */
500 #define CURL_PREREQFUNC_ABORT 1
501 
502 /* All possible error codes from all sorts of curl functions. Future versions
503    may return other values, stay prepared.
504 
505    Always add new return codes last. Never *EVER* remove any. The return
506    codes must remain the same!
507  */
508 
509 typedef enum {
510   CURLE_OK = 0,
511   CURLE_UNSUPPORTED_PROTOCOL,    /* 1 */
512   CURLE_FAILED_INIT,             /* 2 */
513   CURLE_URL_MALFORMAT,           /* 3 */
514   CURLE_NOT_BUILT_IN,            /* 4 - [was obsoleted in August 2007 for
515                                     7.17.0, reused in April 2011 for 7.21.5] */
516   CURLE_COULDNT_RESOLVE_PROXY,   /* 5 */
517   CURLE_COULDNT_RESOLVE_HOST,    /* 6 */
518   CURLE_COULDNT_CONNECT,         /* 7 */
519   CURLE_WEIRD_SERVER_REPLY,      /* 8 */
520   CURLE_REMOTE_ACCESS_DENIED,    /* 9 a service was denied by the server
521                                     due to lack of access - when login fails
522                                     this is not returned. */
523   CURLE_FTP_ACCEPT_FAILED,       /* 10 - [was obsoleted in April 2006 for
524                                     7.15.4, reused in Dec 2011 for 7.24.0]*/
525   CURLE_FTP_WEIRD_PASS_REPLY,    /* 11 */
526   CURLE_FTP_ACCEPT_TIMEOUT,      /* 12 - timeout occurred accepting server
527                                     [was obsoleted in August 2007 for 7.17.0,
528                                     reused in Dec 2011 for 7.24.0]*/
529   CURLE_FTP_WEIRD_PASV_REPLY,    /* 13 */
530   CURLE_FTP_WEIRD_227_FORMAT,    /* 14 */
531   CURLE_FTP_CANT_GET_HOST,       /* 15 */
532   CURLE_HTTP2,                   /* 16 - A problem in the http2 framing layer.
533                                     [was obsoleted in August 2007 for 7.17.0,
534                                     reused in July 2014 for 7.38.0] */
535   CURLE_FTP_COULDNT_SET_TYPE,    /* 17 */
536   CURLE_PARTIAL_FILE,            /* 18 */
537   CURLE_FTP_COULDNT_RETR_FILE,   /* 19 */
538   CURLE_OBSOLETE20,              /* 20 - NOT USED */
539   CURLE_QUOTE_ERROR,             /* 21 - quote command failure */
540   CURLE_HTTP_RETURNED_ERROR,     /* 22 */
541   CURLE_WRITE_ERROR,             /* 23 */
542   CURLE_OBSOLETE24,              /* 24 - NOT USED */
543   CURLE_UPLOAD_FAILED,           /* 25 - failed upload "command" */
544   CURLE_READ_ERROR,              /* 26 - couldn't open/read from file */
545   CURLE_OUT_OF_MEMORY,           /* 27 */
546   CURLE_OPERATION_TIMEDOUT,      /* 28 - the timeout time was reached */
547   CURLE_OBSOLETE29,              /* 29 - NOT USED */
548   CURLE_FTP_PORT_FAILED,         /* 30 - FTP PORT operation failed */
549   CURLE_FTP_COULDNT_USE_REST,    /* 31 - the REST command failed */
550   CURLE_OBSOLETE32,              /* 32 - NOT USED */
551   CURLE_RANGE_ERROR,             /* 33 - RANGE "command" didn't work */
552   CURLE_HTTP_POST_ERROR,         /* 34 */
553   CURLE_SSL_CONNECT_ERROR,       /* 35 - wrong when connecting with SSL */
554   CURLE_BAD_DOWNLOAD_RESUME,     /* 36 - couldn't resume download */
555   CURLE_FILE_COULDNT_READ_FILE,  /* 37 */
556   CURLE_LDAP_CANNOT_BIND,        /* 38 */
557   CURLE_LDAP_SEARCH_FAILED,      /* 39 */
558   CURLE_OBSOLETE40,              /* 40 - NOT USED */
559   CURLE_FUNCTION_NOT_FOUND,      /* 41 - NOT USED starting with 7.53.0 */
560   CURLE_ABORTED_BY_CALLBACK,     /* 42 */
561   CURLE_BAD_FUNCTION_ARGUMENT,   /* 43 */
562   CURLE_OBSOLETE44,              /* 44 - NOT USED */
563   CURLE_INTERFACE_FAILED,        /* 45 - CURLOPT_INTERFACE failed */
564   CURLE_OBSOLETE46,              /* 46 - NOT USED */
565   CURLE_TOO_MANY_REDIRECTS,      /* 47 - catch endless re-direct loops */
566   CURLE_UNKNOWN_OPTION,          /* 48 - User specified an unknown option */
567   CURLE_SETOPT_OPTION_SYNTAX,    /* 49 - Malformed setopt option */
568   CURLE_OBSOLETE50,              /* 50 - NOT USED */
569   CURLE_OBSOLETE51,              /* 51 - NOT USED */
570   CURLE_GOT_NOTHING,             /* 52 - when this is a specific error */
571   CURLE_SSL_ENGINE_NOTFOUND,     /* 53 - SSL crypto engine not found */
572   CURLE_SSL_ENGINE_SETFAILED,    /* 54 - can not set SSL crypto engine as
573                                     default */
574   CURLE_SEND_ERROR,              /* 55 - failed sending network data */
575   CURLE_RECV_ERROR,              /* 56 - failure in receiving network data */
576   CURLE_OBSOLETE57,              /* 57 - NOT IN USE */
577   CURLE_SSL_CERTPROBLEM,         /* 58 - problem with the local certificate */
578   CURLE_SSL_CIPHER,              /* 59 - couldn't use specified cipher */
579   CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint
580                                      wasn't verified fine */
581   CURLE_BAD_CONTENT_ENCODING,    /* 61 - Unrecognized/bad encoding */
582   CURLE_OBSOLETE62,              /* 62 - NOT IN USE since 7.82.0 */
583   CURLE_FILESIZE_EXCEEDED,       /* 63 - Maximum file size exceeded */
584   CURLE_USE_SSL_FAILED,          /* 64 - Requested FTP SSL level failed */
585   CURLE_SEND_FAIL_REWIND,        /* 65 - Sending the data requires a rewind
586                                     that failed */
587   CURLE_SSL_ENGINE_INITFAILED,   /* 66 - failed to initialise ENGINE */
588   CURLE_LOGIN_DENIED,            /* 67 - user, password or similar was not
589                                     accepted and we failed to login */
590   CURLE_TFTP_NOTFOUND,           /* 68 - file not found on server */
591   CURLE_TFTP_PERM,               /* 69 - permission problem on server */
592   CURLE_REMOTE_DISK_FULL,        /* 70 - out of disk space on server */
593   CURLE_TFTP_ILLEGAL,            /* 71 - Illegal TFTP operation */
594   CURLE_TFTP_UNKNOWNID,          /* 72 - Unknown transfer ID */
595   CURLE_REMOTE_FILE_EXISTS,      /* 73 - File already exists */
596   CURLE_TFTP_NOSUCHUSER,         /* 74 - No such user */
597   CURLE_OBSOLETE75,              /* 75 - NOT IN USE since 7.82.0 */
598   CURLE_OBSOLETE76,              /* 76 - NOT IN USE since 7.82.0 */
599   CURLE_SSL_CACERT_BADFILE,      /* 77 - could not load CACERT file, missing
600                                     or wrong format */
601   CURLE_REMOTE_FILE_NOT_FOUND,   /* 78 - remote file not found */
602   CURLE_SSH,                     /* 79 - error from the SSH layer, somewhat
603                                     generic so the error message will be of
604                                     interest when this has happened */
605 
606   CURLE_SSL_SHUTDOWN_FAILED,     /* 80 - Failed to shut down the SSL
607                                     connection */
608   CURLE_AGAIN,                   /* 81 - socket is not ready for send/recv,
609                                     wait till it's ready and try again (Added
610                                     in 7.18.2) */
611   CURLE_SSL_CRL_BADFILE,         /* 82 - could not load CRL file, missing or
612                                     wrong format (Added in 7.19.0) */
613   CURLE_SSL_ISSUER_ERROR,        /* 83 - Issuer check failed.  (Added in
614                                     7.19.0) */
615   CURLE_FTP_PRET_FAILED,         /* 84 - a PRET command failed */
616   CURLE_RTSP_CSEQ_ERROR,         /* 85 - mismatch of RTSP CSeq numbers */
617   CURLE_RTSP_SESSION_ERROR,      /* 86 - mismatch of RTSP Session Ids */
618   CURLE_FTP_BAD_FILE_LIST,       /* 87 - unable to parse FTP file list */
619   CURLE_CHUNK_FAILED,            /* 88 - chunk callback reported error */
620   CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the
621                                     session will be queued */
622   CURLE_SSL_PINNEDPUBKEYNOTMATCH, /* 90 - specified pinned public key did not
623                                      match */
624   CURLE_SSL_INVALIDCERTSTATUS,   /* 91 - invalid certificate status */
625   CURLE_HTTP2_STREAM,            /* 92 - stream error in HTTP/2 framing layer
626                                     */
627   CURLE_RECURSIVE_API_CALL,      /* 93 - an api function was called from
628                                     inside a callback */
629   CURLE_AUTH_ERROR,              /* 94 - an authentication function returned an
630                                     error */
631   CURLE_HTTP3,                   /* 95 - An HTTP/3 layer problem */
632   CURLE_QUIC_CONNECT_ERROR,      /* 96 - QUIC connection error */
633   CURLE_PROXY,                   /* 97 - proxy handshake error */
634   CURLE_SSL_CLIENTCERT,          /* 98 - client-side certificate required */
635   CURLE_UNRECOVERABLE_POLL,      /* 99 - poll/select returned fatal error */
636   CURLE_TOO_LARGE,               /* 100 - a value/data met its maximum */
637   CURLE_ECH_REQUIRED,            /* 101 - ECH tried but failed */
638   CURL_LAST /* never use! */
639 } CURLcode;
640 
641 #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
642                           the obsolete stuff removed! */
643 
644 /* Previously obsolete error code reused in 7.38.0 */
645 #define CURLE_OBSOLETE16 CURLE_HTTP2
646 
647 /* Previously obsolete error codes reused in 7.24.0 */
648 #define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED
649 #define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT
650 
651 /*  compatibility with older names */
652 #define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING
653 #define CURLE_FTP_WEIRD_SERVER_REPLY CURLE_WEIRD_SERVER_REPLY
654 
655 /* The following were added in 7.62.0 */
656 #define CURLE_SSL_CACERT CURLE_PEER_FAILED_VERIFICATION
657 
658 /* The following were added in 7.21.5, April 2011 */
659 #define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION
660 
661 /* Added for 7.78.0 */
662 #define CURLE_TELNET_OPTION_SYNTAX CURLE_SETOPT_OPTION_SYNTAX
663 
664 /* The following were added in 7.17.1 */
665 /* These are scheduled to disappear by 2009 */
666 #define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION
667 
668 /* The following were added in 7.17.0 */
669 /* These are scheduled to disappear by 2009 */
670 #define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */
671 #define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46
672 #define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44
673 #define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10
674 #define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16
675 #define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32
676 #define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29
677 #define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12
678 #define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20
679 #define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40
680 #define CURLE_MALFORMAT_USER CURLE_OBSOLETE24
681 #define CURLE_SHARE_IN_USE CURLE_OBSOLETE57
682 #define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN
683 
684 #define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED
685 #define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE
686 #define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR
687 #define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL
688 #define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS
689 #define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR
690 #define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED
691 
692 /* The following were added earlier */
693 
694 #define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT
695 #define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR
696 #define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED
697 #define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED
698 #define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
699 #define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
700 #define CURLE_LDAP_INVALID_URL CURLE_OBSOLETE62
701 #define CURLE_CONV_REQD CURLE_OBSOLETE76
702 #define CURLE_CONV_FAILED CURLE_OBSOLETE75
703 
704 /* This was the error code 50 in 7.7.3 and a few earlier versions, this
705    is no longer used by libcurl but is instead #defined here only to not
706    make programs break */
707 #define CURLE_ALREADY_COMPLETE 99999
708 
709 /* Provide defines for really old option names */
710 #define CURLOPT_FILE CURLOPT_WRITEDATA /* name changed in 7.9.7 */
711 #define CURLOPT_INFILE CURLOPT_READDATA /* name changed in 7.9.7 */
712 #define CURLOPT_WRITEHEADER CURLOPT_HEADERDATA
713 
714 /* Since long deprecated options with no code in the lib that does anything
715    with them. */
716 #define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40
717 #define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72
718 
719 #endif /* !CURL_NO_OLDIES */
720 
721 /*
722  * Proxy error codes. Returned in CURLINFO_PROXY_ERROR if CURLE_PROXY was
723  * return for the transfers.
724  */
725 typedef enum {
726   CURLPX_OK,
727   CURLPX_BAD_ADDRESS_TYPE,
728   CURLPX_BAD_VERSION,
729   CURLPX_CLOSED,
730   CURLPX_GSSAPI,
731   CURLPX_GSSAPI_PERMSG,
732   CURLPX_GSSAPI_PROTECTION,
733   CURLPX_IDENTD,
734   CURLPX_IDENTD_DIFFER,
735   CURLPX_LONG_HOSTNAME,
736   CURLPX_LONG_PASSWD,
737   CURLPX_LONG_USER,
738   CURLPX_NO_AUTH,
739   CURLPX_RECV_ADDRESS,
740   CURLPX_RECV_AUTH,
741   CURLPX_RECV_CONNECT,
742   CURLPX_RECV_REQACK,
743   CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED,
744   CURLPX_REPLY_COMMAND_NOT_SUPPORTED,
745   CURLPX_REPLY_CONNECTION_REFUSED,
746   CURLPX_REPLY_GENERAL_SERVER_FAILURE,
747   CURLPX_REPLY_HOST_UNREACHABLE,
748   CURLPX_REPLY_NETWORK_UNREACHABLE,
749   CURLPX_REPLY_NOT_ALLOWED,
750   CURLPX_REPLY_TTL_EXPIRED,
751   CURLPX_REPLY_UNASSIGNED,
752   CURLPX_REQUEST_FAILED,
753   CURLPX_RESOLVE_HOST,
754   CURLPX_SEND_AUTH,
755   CURLPX_SEND_CONNECT,
756   CURLPX_SEND_REQUEST,
757   CURLPX_UNKNOWN_FAIL,
758   CURLPX_UNKNOWN_MODE,
759   CURLPX_USER_REJECTED,
760   CURLPX_LAST /* never use */
761 } CURLproxycode;
762 
763 /* This prototype applies to all conversion callbacks */
764 typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
765 
766 typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl,    /* easy handle */
767                                           void *ssl_ctx, /* actually an OpenSSL
768                                                             or WolfSSL SSL_CTX,
769                                                             or an mbedTLS
770                                                           mbedtls_ssl_config */
771                                           void *userptr);
772 
773 typedef enum {
774   CURLPROXY_HTTP = 0,   /* added in 7.10, new in 7.19.4 default is to use
775                            CONNECT HTTP/1.1 */
776   CURLPROXY_HTTP_1_0 = 1,   /* added in 7.19.4, force to use CONNECT
777                                HTTP/1.0  */
778   CURLPROXY_HTTPS = 2,  /* HTTPS but stick to HTTP/1 added in 7.52.0 */
779   CURLPROXY_HTTPS2 = 3, /* HTTPS and attempt HTTP/2 added in 8.2.0 */
780   CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
781                            in 7.10 */
782   CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
783   CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
784   CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
785                                    host name rather than the IP address. added
786                                    in 7.18.0 */
787 } curl_proxytype;  /* this enum was added in 7.10 */
788 
789 /*
790  * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:
791  *
792  * CURLAUTH_NONE         - No HTTP authentication
793  * CURLAUTH_BASIC        - HTTP Basic authentication (default)
794  * CURLAUTH_DIGEST       - HTTP Digest authentication
795  * CURLAUTH_NEGOTIATE    - HTTP Negotiate (SPNEGO) authentication
796  * CURLAUTH_GSSNEGOTIATE - Alias for CURLAUTH_NEGOTIATE (deprecated)
797  * CURLAUTH_NTLM         - HTTP NTLM authentication
798  * CURLAUTH_DIGEST_IE    - HTTP Digest authentication with IE flavour
799  * CURLAUTH_NTLM_WB      - HTTP NTLM authentication delegated to winbind helper
800  * CURLAUTH_BEARER       - HTTP Bearer token authentication
801  * CURLAUTH_ONLY         - Use together with a single other type to force no
802  *                         authentication or just that single type
803  * CURLAUTH_ANY          - All fine types set
804  * CURLAUTH_ANYSAFE      - All fine types except Basic
805  */
806 
807 #define CURLAUTH_NONE         ((unsigned long)0)
808 #define CURLAUTH_BASIC        (((unsigned long)1)<<0)
809 #define CURLAUTH_DIGEST       (((unsigned long)1)<<1)
810 #define CURLAUTH_NEGOTIATE    (((unsigned long)1)<<2)
811 /* Deprecated since the advent of CURLAUTH_NEGOTIATE */
812 #define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE
813 /* Used for CURLOPT_SOCKS5_AUTH to stay terminologically correct */
814 #define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
815 #define CURLAUTH_NTLM         (((unsigned long)1)<<3)
816 #define CURLAUTH_DIGEST_IE    (((unsigned long)1)<<4)
817 #ifndef CURL_NO_OLDIES
818   /* functionality removed since 8.8.0 */
819 #define CURLAUTH_NTLM_WB      (((unsigned long)1)<<5)
820 #endif
821 #define CURLAUTH_BEARER       (((unsigned long)1)<<6)
822 #define CURLAUTH_AWS_SIGV4    (((unsigned long)1)<<7)
823 #define CURLAUTH_ONLY         (((unsigned long)1)<<31)
824 #define CURLAUTH_ANY          (~CURLAUTH_DIGEST_IE)
825 #define CURLAUTH_ANYSAFE      (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
826 
827 #define CURLSSH_AUTH_ANY       ~0     /* all types supported by the server */
828 #define CURLSSH_AUTH_NONE      0      /* none allowed, silly but complete */
829 #define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */
830 #define CURLSSH_AUTH_PASSWORD  (1<<1) /* password */
831 #define CURLSSH_AUTH_HOST      (1<<2) /* host key files */
832 #define CURLSSH_AUTH_KEYBOARD  (1<<3) /* keyboard interactive */
833 #define CURLSSH_AUTH_AGENT     (1<<4) /* agent (ssh-agent, pageant...) */
834 #define CURLSSH_AUTH_GSSAPI    (1<<5) /* gssapi (kerberos, ...) */
835 #define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
836 
837 #define CURLGSSAPI_DELEGATION_NONE        0      /* no delegation (default) */
838 #define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */
839 #define CURLGSSAPI_DELEGATION_FLAG        (1<<1) /* delegate always */
840 
841 #define CURL_ERROR_SIZE 256
842 
843 enum curl_khtype {
844   CURLKHTYPE_UNKNOWN,
845   CURLKHTYPE_RSA1,
846   CURLKHTYPE_RSA,
847   CURLKHTYPE_DSS,
848   CURLKHTYPE_ECDSA,
849   CURLKHTYPE_ED25519
850 };
851 
852 struct curl_khkey {
853   const char *key; /* points to a null-terminated string encoded with base64
854                       if len is zero, otherwise to the "raw" data */
855   size_t len;
856   enum curl_khtype keytype;
857 };
858 
859 /* this is the set of return values expected from the curl_sshkeycallback
860    callback */
861 enum curl_khstat {
862   CURLKHSTAT_FINE_ADD_TO_FILE,
863   CURLKHSTAT_FINE,
864   CURLKHSTAT_REJECT, /* reject the connection, return an error */
865   CURLKHSTAT_DEFER,  /* do not accept it, but we can't answer right now.
866                         Causes a CURLE_PEER_FAILED_VERIFICATION error but the
867                         connection will be left intact etc */
868   CURLKHSTAT_FINE_REPLACE, /* accept and replace the wrong key */
869   CURLKHSTAT_LAST    /* not for use, only a marker for last-in-list */
870 };
871 
872 /* this is the set of status codes pass in to the callback */
873 enum curl_khmatch {
874   CURLKHMATCH_OK,       /* match */
875   CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
876   CURLKHMATCH_MISSING,  /* no matching host/key found */
877   CURLKHMATCH_LAST      /* not for use, only a marker for last-in-list */
878 };
879 
880 typedef int
881   (*curl_sshkeycallback) (CURL *easy,     /* easy handle */
882                           const struct curl_khkey *knownkey, /* known */
883                           const struct curl_khkey *foundkey, /* found */
884                           enum curl_khmatch, /* libcurl's view on the keys */
885                           void *clientp); /* custom pointer passed with */
886                                           /* CURLOPT_SSH_KEYDATA */
887 
888 typedef int
889   (*curl_sshhostkeycallback) (void *clientp,/* custom pointer passed */
890                                             /* with CURLOPT_SSH_HOSTKEYDATA */
891                           int keytype, /* CURLKHTYPE */
892                           const char *key, /* hostkey to check */
893                           size_t keylen); /* length of the key */
894                           /* return CURLE_OK to accept */
895                           /* or something else to refuse */
896 
897 
898 /* parameter for the CURLOPT_USE_SSL option */
899 typedef enum {
900   CURLUSESSL_NONE,    /* do not attempt to use SSL */
901   CURLUSESSL_TRY,     /* try using SSL, proceed anyway otherwise */
902   CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
903   CURLUSESSL_ALL,     /* SSL for all communication or fail */
904   CURLUSESSL_LAST     /* not an option, never use */
905 } curl_usessl;
906 
907 /* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */
908 
909 /* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the
910    name of improving interoperability with older servers. Some SSL libraries
911    have introduced work-arounds for this flaw but those work-arounds sometimes
912    make the SSL communication fail. To regain functionality with those broken
913    servers, a user can this way allow the vulnerability back. */
914 #define CURLSSLOPT_ALLOW_BEAST (1<<0)
915 
916 /* - NO_REVOKE tells libcurl to disable certificate revocation checks for those
917    SSL backends where such behavior is present. */
918 #define CURLSSLOPT_NO_REVOKE (1<<1)
919 
920 /* - NO_PARTIALCHAIN tells libcurl to *NOT* accept a partial certificate chain
921    if possible. The OpenSSL backend has this ability. */
922 #define CURLSSLOPT_NO_PARTIALCHAIN (1<<2)
923 
924 /* - REVOKE_BEST_EFFORT tells libcurl to ignore certificate revocation offline
925    checks and ignore missing revocation list for those SSL backends where such
926    behavior is present. */
927 #define CURLSSLOPT_REVOKE_BEST_EFFORT (1<<3)
928 
929 /* - CURLSSLOPT_NATIVE_CA tells libcurl to use standard certificate store of
930    operating system. Currently implemented under MS-Windows. */
931 #define CURLSSLOPT_NATIVE_CA (1<<4)
932 
933 /* - CURLSSLOPT_AUTO_CLIENT_CERT tells libcurl to automatically locate and use
934    a client certificate for authentication. (Schannel) */
935 #define CURLSSLOPT_AUTO_CLIENT_CERT (1<<5)
936 
937 /* The default connection attempt delay in milliseconds for happy eyeballs.
938    CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document
939    this value, keep them in sync. */
940 #define CURL_HET_DEFAULT 200L
941 
942 /* The default connection upkeep interval in milliseconds. */
943 #define CURL_UPKEEP_INTERVAL_DEFAULT 60000L
944 
945 #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
946                           the obsolete stuff removed! */
947 
948 /* Backwards compatibility with older names */
949 /* These are scheduled to disappear by 2009 */
950 
951 #define CURLFTPSSL_NONE CURLUSESSL_NONE
952 #define CURLFTPSSL_TRY CURLUSESSL_TRY
953 #define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL
954 #define CURLFTPSSL_ALL CURLUSESSL_ALL
955 #define CURLFTPSSL_LAST CURLUSESSL_LAST
956 #define curl_ftpssl curl_usessl
957 #endif /* !CURL_NO_OLDIES */
958 
959 /* parameter for the CURLOPT_FTP_SSL_CCC option */
960 typedef enum {
961   CURLFTPSSL_CCC_NONE,    /* do not send CCC */
962   CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
963   CURLFTPSSL_CCC_ACTIVE,  /* Initiate the shutdown */
964   CURLFTPSSL_CCC_LAST     /* not an option, never use */
965 } curl_ftpccc;
966 
967 /* parameter for the CURLOPT_FTPSSLAUTH option */
968 typedef enum {
969   CURLFTPAUTH_DEFAULT, /* let libcurl decide */
970   CURLFTPAUTH_SSL,     /* use "AUTH SSL" */
971   CURLFTPAUTH_TLS,     /* use "AUTH TLS" */
972   CURLFTPAUTH_LAST /* not an option, never use */
973 } curl_ftpauth;
974 
975 /* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
976 typedef enum {
977   CURLFTP_CREATE_DIR_NONE,  /* do NOT create missing dirs! */
978   CURLFTP_CREATE_DIR,       /* (FTP/SFTP) if CWD fails, try MKD and then CWD
979                                again if MKD succeeded, for SFTP this does
980                                similar magic */
981   CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
982                                again even if MKD failed! */
983   CURLFTP_CREATE_DIR_LAST   /* not an option, never use */
984 } curl_ftpcreatedir;
985 
986 /* parameter for the CURLOPT_FTP_FILEMETHOD option */
987 typedef enum {
988   CURLFTPMETHOD_DEFAULT,   /* let libcurl pick */
989   CURLFTPMETHOD_MULTICWD,  /* single CWD operation for each path part */
990   CURLFTPMETHOD_NOCWD,     /* no CWD at all */
991   CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
992   CURLFTPMETHOD_LAST       /* not an option, never use */
993 } curl_ftpmethod;
994 
995 /* bitmask defines for CURLOPT_HEADEROPT */
996 #define CURLHEADER_UNIFIED  0
997 #define CURLHEADER_SEPARATE (1<<0)
998 
999 /* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */
1000 #define CURLALTSVC_READONLYFILE (1<<2)
1001 #define CURLALTSVC_H1           (1<<3)
1002 #define CURLALTSVC_H2           (1<<4)
1003 #define CURLALTSVC_H3           (1<<5)
1004 
1005 
1006 struct curl_hstsentry {
1007   char *name;
1008   size_t namelen;
1009   unsigned int includeSubDomains:1;
1010   char expire[18]; /* YYYYMMDD HH:MM:SS [null-terminated] */
1011 };
1012 
1013 struct curl_index {
1014   size_t index; /* the provided entry's "index" or count */
1015   size_t total; /* total number of entries to save */
1016 };
1017 
1018 typedef enum {
1019   CURLSTS_OK,
1020   CURLSTS_DONE,
1021   CURLSTS_FAIL
1022 } CURLSTScode;
1023 
1024 typedef CURLSTScode (*curl_hstsread_callback)(CURL *easy,
1025                                               struct curl_hstsentry *e,
1026                                               void *userp);
1027 typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,
1028                                                struct curl_hstsentry *e,
1029                                                struct curl_index *i,
1030                                                void *userp);
1031 
1032 /* CURLHSTS_* are bits for the CURLOPT_HSTS option */
1033 #define CURLHSTS_ENABLE       (long)(1<<0)
1034 #define CURLHSTS_READONLYFILE (long)(1<<1)
1035 
1036 /* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS
1037    options. Do not use. */
1038 #define CURLPROTO_HTTP   (1<<0)
1039 #define CURLPROTO_HTTPS  (1<<1)
1040 #define CURLPROTO_FTP    (1<<2)
1041 #define CURLPROTO_FTPS   (1<<3)
1042 #define CURLPROTO_SCP    (1<<4)
1043 #define CURLPROTO_SFTP   (1<<5)
1044 #define CURLPROTO_TELNET (1<<6)
1045 #define CURLPROTO_LDAP   (1<<7)
1046 #define CURLPROTO_LDAPS  (1<<8)
1047 #define CURLPROTO_DICT   (1<<9)
1048 #define CURLPROTO_FILE   (1<<10)
1049 #define CURLPROTO_TFTP   (1<<11)
1050 #define CURLPROTO_IMAP   (1<<12)
1051 #define CURLPROTO_IMAPS  (1<<13)
1052 #define CURLPROTO_POP3   (1<<14)
1053 #define CURLPROTO_POP3S  (1<<15)
1054 #define CURLPROTO_SMTP   (1<<16)
1055 #define CURLPROTO_SMTPS  (1<<17)
1056 #define CURLPROTO_RTSP   (1<<18)
1057 #define CURLPROTO_RTMP   (1<<19)
1058 #define CURLPROTO_RTMPT  (1<<20)
1059 #define CURLPROTO_RTMPE  (1<<21)
1060 #define CURLPROTO_RTMPTE (1<<22)
1061 #define CURLPROTO_RTMPS  (1<<23)
1062 #define CURLPROTO_RTMPTS (1<<24)
1063 #define CURLPROTO_GOPHER (1<<25)
1064 #define CURLPROTO_SMB    (1<<26)
1065 #define CURLPROTO_SMBS   (1<<27)
1066 #define CURLPROTO_MQTT   (1<<28)
1067 #define CURLPROTO_GOPHERS (1<<29)
1068 #define CURLPROTO_ALL    (~0) /* enable everything */
1069 
1070 /* long may be 32 or 64 bits, but we should never depend on anything else
1071    but 32 */
1072 #define CURLOPTTYPE_LONG          0
1073 #define CURLOPTTYPE_OBJECTPOINT   10000
1074 #define CURLOPTTYPE_FUNCTIONPOINT 20000
1075 #define CURLOPTTYPE_OFF_T         30000
1076 #define CURLOPTTYPE_BLOB          40000
1077 
1078 /* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the
1079    string options from the header file */
1080 
1081 
1082 #define CURLOPT(na,t,nu) na = t + nu
1083 #define CURLOPTDEPRECATED(na,t,nu,v,m) na CURL_DEPRECATED(v,m) = t + nu
1084 
1085 /* CURLOPT aliases that make no run-time difference */
1086 
1087 /* 'char *' argument to a string with a trailing zero */
1088 #define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT
1089 
1090 /* 'struct curl_slist *' argument */
1091 #define CURLOPTTYPE_SLISTPOINT  CURLOPTTYPE_OBJECTPOINT
1092 
1093 /* 'void *' argument passed untouched to callback */
1094 #define CURLOPTTYPE_CBPOINT     CURLOPTTYPE_OBJECTPOINT
1095 
1096 /* 'long' argument with a set of values/bitmask */
1097 #define CURLOPTTYPE_VALUES      CURLOPTTYPE_LONG
1098 
1099 /*
1100  * All CURLOPT_* values.
1101  */
1102 
1103 typedef enum {
1104   /* This is the FILE * or void * the regular output should be written to. */
1105   CURLOPT(CURLOPT_WRITEDATA, CURLOPTTYPE_CBPOINT, 1),
1106 
1107   /* The full URL to get/put */
1108   CURLOPT(CURLOPT_URL, CURLOPTTYPE_STRINGPOINT, 2),
1109 
1110   /* Port number to connect to, if other than default. */
1111   CURLOPT(CURLOPT_PORT, CURLOPTTYPE_LONG, 3),
1112 
1113   /* Name of proxy to use. */
1114   CURLOPT(CURLOPT_PROXY, CURLOPTTYPE_STRINGPOINT, 4),
1115 
1116   /* "user:password;options" to use when fetching. */
1117   CURLOPT(CURLOPT_USERPWD, CURLOPTTYPE_STRINGPOINT, 5),
1118 
1119   /* "user:password" to use with proxy. */
1120   CURLOPT(CURLOPT_PROXYUSERPWD, CURLOPTTYPE_STRINGPOINT, 6),
1121 
1122   /* Range to get, specified as an ASCII string. */
1123   CURLOPT(CURLOPT_RANGE, CURLOPTTYPE_STRINGPOINT, 7),
1124 
1125   /* not used */
1126 
1127   /* Specified file stream to upload from (use as input): */
1128   CURLOPT(CURLOPT_READDATA, CURLOPTTYPE_CBPOINT, 9),
1129 
1130   /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
1131    * bytes big. */
1132   CURLOPT(CURLOPT_ERRORBUFFER, CURLOPTTYPE_OBJECTPOINT, 10),
1133 
1134   /* Function that will be called to store the output (instead of fwrite). The
1135    * parameters will use fwrite() syntax, make sure to follow them. */
1136   CURLOPT(CURLOPT_WRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 11),
1137 
1138   /* Function that will be called to read the input (instead of fread). The
1139    * parameters will use fread() syntax, make sure to follow them. */
1140   CURLOPT(CURLOPT_READFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 12),
1141 
1142   /* Time-out the read operation after this amount of seconds */
1143   CURLOPT(CURLOPT_TIMEOUT, CURLOPTTYPE_LONG, 13),
1144 
1145   /* If CURLOPT_READDATA is used, this can be used to inform libcurl about
1146    * how large the file being sent really is. That allows better error
1147    * checking and better verifies that the upload was successful. -1 means
1148    * unknown size.
1149    *
1150    * For large file support, there is also a _LARGE version of the key
1151    * which takes an off_t type, allowing platforms with larger off_t
1152    * sizes to handle larger files.  See below for INFILESIZE_LARGE.
1153    */
1154   CURLOPT(CURLOPT_INFILESIZE, CURLOPTTYPE_LONG, 14),
1155 
1156   /* POST static input fields. */
1157   CURLOPT(CURLOPT_POSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 15),
1158 
1159   /* Set the referrer page (needed by some CGIs) */
1160   CURLOPT(CURLOPT_REFERER, CURLOPTTYPE_STRINGPOINT, 16),
1161 
1162   /* Set the FTP PORT string (interface name, named or numerical IP address)
1163      Use i.e '-' to use default address. */
1164   CURLOPT(CURLOPT_FTPPORT, CURLOPTTYPE_STRINGPOINT, 17),
1165 
1166   /* Set the User-Agent string (examined by some CGIs) */
1167   CURLOPT(CURLOPT_USERAGENT, CURLOPTTYPE_STRINGPOINT, 18),
1168 
1169   /* If the download receives less than "low speed limit" bytes/second
1170    * during "low speed time" seconds, the operations is aborted.
1171    * You could i.e if you have a pretty high speed connection, abort if
1172    * it is less than 2000 bytes/sec during 20 seconds.
1173    */
1174 
1175   /* Set the "low speed limit" */
1176   CURLOPT(CURLOPT_LOW_SPEED_LIMIT, CURLOPTTYPE_LONG, 19),
1177 
1178   /* Set the "low speed time" */
1179   CURLOPT(CURLOPT_LOW_SPEED_TIME, CURLOPTTYPE_LONG, 20),
1180 
1181   /* Set the continuation offset.
1182    *
1183    * Note there is also a _LARGE version of this key which uses
1184    * off_t types, allowing for large file offsets on platforms which
1185    * use larger-than-32-bit off_t's.  Look below for RESUME_FROM_LARGE.
1186    */
1187   CURLOPT(CURLOPT_RESUME_FROM, CURLOPTTYPE_LONG, 21),
1188 
1189   /* Set cookie in request: */
1190   CURLOPT(CURLOPT_COOKIE, CURLOPTTYPE_STRINGPOINT, 22),
1191 
1192   /* This points to a linked list of headers, struct curl_slist kind. This
1193      list is also used for RTSP (in spite of its name) */
1194   CURLOPT(CURLOPT_HTTPHEADER, CURLOPTTYPE_SLISTPOINT, 23),
1195 
1196   /* This points to a linked list of post entries, struct curl_httppost */
1197   CURLOPTDEPRECATED(CURLOPT_HTTPPOST, CURLOPTTYPE_OBJECTPOINT, 24,
1198                     7.56.0, "Use CURLOPT_MIMEPOST"),
1199 
1200   /* name of the file keeping your private SSL-certificate */
1201   CURLOPT(CURLOPT_SSLCERT, CURLOPTTYPE_STRINGPOINT, 25),
1202 
1203   /* password for the SSL or SSH private key */
1204   CURLOPT(CURLOPT_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 26),
1205 
1206   /* send TYPE parameter? */
1207   CURLOPT(CURLOPT_CRLF, CURLOPTTYPE_LONG, 27),
1208 
1209   /* send linked-list of QUOTE commands */
1210   CURLOPT(CURLOPT_QUOTE, CURLOPTTYPE_SLISTPOINT, 28),
1211 
1212   /* send FILE * or void * to store headers to, if you use a callback it
1213      is simply passed to the callback unmodified */
1214   CURLOPT(CURLOPT_HEADERDATA, CURLOPTTYPE_CBPOINT, 29),
1215 
1216   /* point to a file to read the initial cookies from, also enables
1217      "cookie awareness" */
1218   CURLOPT(CURLOPT_COOKIEFILE, CURLOPTTYPE_STRINGPOINT, 31),
1219 
1220   /* What version to specifically try to use.
1221      See CURL_SSLVERSION defines below. */
1222   CURLOPT(CURLOPT_SSLVERSION, CURLOPTTYPE_VALUES, 32),
1223 
1224   /* What kind of HTTP time condition to use, see defines */
1225   CURLOPT(CURLOPT_TIMECONDITION, CURLOPTTYPE_VALUES, 33),
1226 
1227   /* Time to use with the above condition. Specified in number of seconds
1228      since 1 Jan 1970 */
1229   CURLOPT(CURLOPT_TIMEVALUE, CURLOPTTYPE_LONG, 34),
1230 
1231   /* 35 = OBSOLETE */
1232 
1233   /* Custom request, for customizing the get command like
1234      HTTP: DELETE, TRACE and others
1235      FTP: to use a different list command
1236      */
1237   CURLOPT(CURLOPT_CUSTOMREQUEST, CURLOPTTYPE_STRINGPOINT, 36),
1238 
1239   /* FILE handle to use instead of stderr */
1240   CURLOPT(CURLOPT_STDERR, CURLOPTTYPE_OBJECTPOINT, 37),
1241 
1242   /* 38 is not used */
1243 
1244   /* send linked-list of post-transfer QUOTE commands */
1245   CURLOPT(CURLOPT_POSTQUOTE, CURLOPTTYPE_SLISTPOINT, 39),
1246 
1247    /* OBSOLETE, do not use! */
1248   CURLOPT(CURLOPT_OBSOLETE40, CURLOPTTYPE_OBJECTPOINT, 40),
1249 
1250   /* talk a lot */
1251   CURLOPT(CURLOPT_VERBOSE, CURLOPTTYPE_LONG, 41),
1252 
1253   /* throw the header out too */
1254   CURLOPT(CURLOPT_HEADER, CURLOPTTYPE_LONG, 42),
1255 
1256   /* shut off the progress meter */
1257   CURLOPT(CURLOPT_NOPROGRESS, CURLOPTTYPE_LONG, 43),
1258 
1259   /* use HEAD to get http document */
1260   CURLOPT(CURLOPT_NOBODY, CURLOPTTYPE_LONG, 44),
1261 
1262   /* no output on http error codes >= 400 */
1263   CURLOPT(CURLOPT_FAILONERROR, CURLOPTTYPE_LONG, 45),
1264 
1265   /* this is an upload */
1266   CURLOPT(CURLOPT_UPLOAD, CURLOPTTYPE_LONG, 46),
1267 
1268   /* HTTP POST method */
1269   CURLOPT(CURLOPT_POST, CURLOPTTYPE_LONG, 47),
1270 
1271   /* bare names when listing directories */
1272   CURLOPT(CURLOPT_DIRLISTONLY, CURLOPTTYPE_LONG, 48),
1273 
1274   /* Append instead of overwrite on upload! */
1275   CURLOPT(CURLOPT_APPEND, CURLOPTTYPE_LONG, 50),
1276 
1277   /* Specify whether to read the user+password from the .netrc or the URL.
1278    * This must be one of the CURL_NETRC_* enums below. */
1279   CURLOPT(CURLOPT_NETRC, CURLOPTTYPE_VALUES, 51),
1280 
1281   /* use Location: Luke! */
1282   CURLOPT(CURLOPT_FOLLOWLOCATION, CURLOPTTYPE_LONG, 52),
1283 
1284    /* transfer data in text/ASCII format */
1285   CURLOPT(CURLOPT_TRANSFERTEXT, CURLOPTTYPE_LONG, 53),
1286 
1287   /* HTTP PUT */
1288   CURLOPTDEPRECATED(CURLOPT_PUT, CURLOPTTYPE_LONG, 54,
1289                     7.12.1, "Use CURLOPT_UPLOAD"),
1290 
1291   /* 55 = OBSOLETE */
1292 
1293   /* DEPRECATED
1294    * Function that will be called instead of the internal progress display
1295    * function. This function should be defined as the curl_progress_callback
1296    * prototype defines. */
1297   CURLOPTDEPRECATED(CURLOPT_PROGRESSFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 56,
1298                     7.32.0, "Use CURLOPT_XFERINFOFUNCTION"),
1299 
1300   /* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION
1301      callbacks */
1302   CURLOPT(CURLOPT_XFERINFODATA, CURLOPTTYPE_CBPOINT, 57),
1303 #define CURLOPT_PROGRESSDATA CURLOPT_XFERINFODATA
1304 
1305   /* We want the referrer field set automatically when following locations */
1306   CURLOPT(CURLOPT_AUTOREFERER, CURLOPTTYPE_LONG, 58),
1307 
1308   /* Port of the proxy, can be set in the proxy string as well with:
1309      "[host]:[port]" */
1310   CURLOPT(CURLOPT_PROXYPORT, CURLOPTTYPE_LONG, 59),
1311 
1312   /* size of the POST input data, if strlen() is not good to use */
1313   CURLOPT(CURLOPT_POSTFIELDSIZE, CURLOPTTYPE_LONG, 60),
1314 
1315   /* tunnel non-http operations through an HTTP proxy */
1316   CURLOPT(CURLOPT_HTTPPROXYTUNNEL, CURLOPTTYPE_LONG, 61),
1317 
1318   /* Set the interface string to use as outgoing network interface */
1319   CURLOPT(CURLOPT_INTERFACE, CURLOPTTYPE_STRINGPOINT, 62),
1320 
1321   /* Set the krb4/5 security level, this also enables krb4/5 awareness.  This
1322    * is a string, 'clear', 'safe', 'confidential' or 'private'.  If the string
1323    * is set but doesn't match one of these, 'private' will be used.  */
1324   CURLOPT(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63),
1325 
1326   /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
1327   CURLOPT(CURLOPT_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 64),
1328 
1329   /* The CApath or CAfile used to validate the peer certificate
1330      this option is used only if SSL_VERIFYPEER is true */
1331   CURLOPT(CURLOPT_CAINFO, CURLOPTTYPE_STRINGPOINT, 65),
1332 
1333   /* 66 = OBSOLETE */
1334   /* 67 = OBSOLETE */
1335 
1336   /* Maximum number of http redirects to follow */
1337   CURLOPT(CURLOPT_MAXREDIRS, CURLOPTTYPE_LONG, 68),
1338 
1339   /* Pass a long set to 1 to get the date of the requested document (if
1340      possible)! Pass a zero to shut it off. */
1341   CURLOPT(CURLOPT_FILETIME, CURLOPTTYPE_LONG, 69),
1342 
1343   /* This points to a linked list of telnet options */
1344   CURLOPT(CURLOPT_TELNETOPTIONS, CURLOPTTYPE_SLISTPOINT, 70),
1345 
1346   /* Max amount of cached alive connections */
1347   CURLOPT(CURLOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 71),
1348 
1349   /* OBSOLETE, do not use! */
1350   CURLOPT(CURLOPT_OBSOLETE72, CURLOPTTYPE_LONG, 72),
1351 
1352   /* 73 = OBSOLETE */
1353 
1354   /* Set to explicitly use a new connection for the upcoming transfer.
1355      Do not use this unless you're absolutely sure of this, as it makes the
1356      operation slower and is less friendly for the network. */
1357   CURLOPT(CURLOPT_FRESH_CONNECT, CURLOPTTYPE_LONG, 74),
1358 
1359   /* Set to explicitly forbid the upcoming transfer's connection to be reused
1360      when done. Do not use this unless you're absolutely sure of this, as it
1361      makes the operation slower and is less friendly for the network. */
1362   CURLOPT(CURLOPT_FORBID_REUSE, CURLOPTTYPE_LONG, 75),
1363 
1364   /* Set to a file name that contains random data for libcurl to use to
1365      seed the random engine when doing SSL connects. */
1366   CURLOPTDEPRECATED(CURLOPT_RANDOM_FILE, CURLOPTTYPE_STRINGPOINT, 76,
1367                     7.84.0, "Serves no purpose anymore"),
1368 
1369   /* Set to the Entropy Gathering Daemon socket pathname */
1370   CURLOPTDEPRECATED(CURLOPT_EGDSOCKET, CURLOPTTYPE_STRINGPOINT, 77,
1371                     7.84.0, "Serves no purpose anymore"),
1372 
1373   /* Time-out connect operations after this amount of seconds, if connects are
1374      OK within this time, then fine... This only aborts the connect phase. */
1375   CURLOPT(CURLOPT_CONNECTTIMEOUT, CURLOPTTYPE_LONG, 78),
1376 
1377   /* Function that will be called to store headers (instead of fwrite). The
1378    * parameters will use fwrite() syntax, make sure to follow them. */
1379   CURLOPT(CURLOPT_HEADERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 79),
1380 
1381   /* Set this to force the HTTP request to get back to GET. Only really usable
1382      if POST, PUT or a custom request have been used first.
1383    */
1384   CURLOPT(CURLOPT_HTTPGET, CURLOPTTYPE_LONG, 80),
1385 
1386   /* Set if we should verify the Common name from the peer certificate in ssl
1387    * handshake, set 1 to check existence, 2 to ensure that it matches the
1388    * provided hostname. */
1389   CURLOPT(CURLOPT_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 81),
1390 
1391   /* Specify which file name to write all known cookies in after completed
1392      operation. Set file name to "-" (dash) to make it go to stdout. */
1393   CURLOPT(CURLOPT_COOKIEJAR, CURLOPTTYPE_STRINGPOINT, 82),
1394 
1395   /* Specify which SSL ciphers to use */
1396   CURLOPT(CURLOPT_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 83),
1397 
1398   /* Specify which HTTP version to use! This must be set to one of the
1399      CURL_HTTP_VERSION* enums set below. */
1400   CURLOPT(CURLOPT_HTTP_VERSION, CURLOPTTYPE_VALUES, 84),
1401 
1402   /* Specifically switch on or off the FTP engine's use of the EPSV command. By
1403      default, that one will always be attempted before the more traditional
1404      PASV command. */
1405   CURLOPT(CURLOPT_FTP_USE_EPSV, CURLOPTTYPE_LONG, 85),
1406 
1407   /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
1408   CURLOPT(CURLOPT_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 86),
1409 
1410   /* name of the file keeping your private SSL-key */
1411   CURLOPT(CURLOPT_SSLKEY, CURLOPTTYPE_STRINGPOINT, 87),
1412 
1413   /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
1414   CURLOPT(CURLOPT_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 88),
1415 
1416   /* crypto engine for the SSL-sub system */
1417   CURLOPT(CURLOPT_SSLENGINE, CURLOPTTYPE_STRINGPOINT, 89),
1418 
1419   /* set the crypto engine for the SSL-sub system as default
1420      the param has no meaning...
1421    */
1422   CURLOPT(CURLOPT_SSLENGINE_DEFAULT, CURLOPTTYPE_LONG, 90),
1423 
1424   /* Non-zero value means to use the global dns cache */
1425   /* DEPRECATED, do not use! */
1426   CURLOPTDEPRECATED(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91,
1427                     7.11.1, "Use CURLOPT_SHARE"),
1428 
1429   /* DNS cache timeout */
1430   CURLOPT(CURLOPT_DNS_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 92),
1431 
1432   /* send linked-list of pre-transfer QUOTE commands */
1433   CURLOPT(CURLOPT_PREQUOTE, CURLOPTTYPE_SLISTPOINT, 93),
1434 
1435   /* set the debug function */
1436   CURLOPT(CURLOPT_DEBUGFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 94),
1437 
1438   /* set the data for the debug function */
1439   CURLOPT(CURLOPT_DEBUGDATA, CURLOPTTYPE_CBPOINT, 95),
1440 
1441   /* mark this as start of a cookie session */
1442   CURLOPT(CURLOPT_COOKIESESSION, CURLOPTTYPE_LONG, 96),
1443 
1444   /* The CApath directory used to validate the peer certificate
1445      this option is used only if SSL_VERIFYPEER is true */
1446   CURLOPT(CURLOPT_CAPATH, CURLOPTTYPE_STRINGPOINT, 97),
1447 
1448   /* Instruct libcurl to use a smaller receive buffer */
1449   CURLOPT(CURLOPT_BUFFERSIZE, CURLOPTTYPE_LONG, 98),
1450 
1451   /* Instruct libcurl to not use any signal/alarm handlers, even when using
1452      timeouts. This option is useful for multi-threaded applications.
1453      See libcurl-the-guide for more background information. */
1454   CURLOPT(CURLOPT_NOSIGNAL, CURLOPTTYPE_LONG, 99),
1455 
1456   /* Provide a CURLShare for mutexing non-ts data */
1457   CURLOPT(CURLOPT_SHARE, CURLOPTTYPE_OBJECTPOINT, 100),
1458 
1459   /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
1460      CURLPROXY_HTTPS, CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and
1461      CURLPROXY_SOCKS5. */
1462   CURLOPT(CURLOPT_PROXYTYPE, CURLOPTTYPE_VALUES, 101),
1463 
1464   /* Set the Accept-Encoding string. Use this to tell a server you would like
1465      the response to be compressed. Before 7.21.6, this was known as
1466      CURLOPT_ENCODING */
1467   CURLOPT(CURLOPT_ACCEPT_ENCODING, CURLOPTTYPE_STRINGPOINT, 102),
1468 
1469   /* Set pointer to private data */
1470   CURLOPT(CURLOPT_PRIVATE, CURLOPTTYPE_OBJECTPOINT, 103),
1471 
1472   /* Set aliases for HTTP 200 in the HTTP Response header */
1473   CURLOPT(CURLOPT_HTTP200ALIASES, CURLOPTTYPE_SLISTPOINT, 104),
1474 
1475   /* Continue to send authentication (user+password) when following locations,
1476      even when hostname changed. This can potentially send off the name
1477      and password to whatever host the server decides. */
1478   CURLOPT(CURLOPT_UNRESTRICTED_AUTH, CURLOPTTYPE_LONG, 105),
1479 
1480   /* Specifically switch on or off the FTP engine's use of the EPRT command (
1481      it also disables the LPRT attempt). By default, those ones will always be
1482      attempted before the good old traditional PORT command. */
1483   CURLOPT(CURLOPT_FTP_USE_EPRT, CURLOPTTYPE_LONG, 106),
1484 
1485   /* Set this to a bitmask value to enable the particular authentications
1486      methods you like. Use this in combination with CURLOPT_USERPWD.
1487      Note that setting multiple bits may cause extra network round-trips. */
1488   CURLOPT(CURLOPT_HTTPAUTH, CURLOPTTYPE_VALUES, 107),
1489 
1490   /* Set the ssl context callback function, currently only for OpenSSL or
1491      WolfSSL ssl_ctx, or mbedTLS mbedtls_ssl_config in the second argument.
1492      The function must match the curl_ssl_ctx_callback prototype. */
1493   CURLOPT(CURLOPT_SSL_CTX_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 108),
1494 
1495   /* Set the userdata for the ssl context callback function's third
1496      argument */
1497   CURLOPT(CURLOPT_SSL_CTX_DATA, CURLOPTTYPE_CBPOINT, 109),
1498 
1499   /* FTP Option that causes missing dirs to be created on the remote server.
1500      In 7.19.4 we introduced the convenience enums for this option using the
1501      CURLFTP_CREATE_DIR prefix.
1502   */
1503   CURLOPT(CURLOPT_FTP_CREATE_MISSING_DIRS, CURLOPTTYPE_LONG, 110),
1504 
1505   /* Set this to a bitmask value to enable the particular authentications
1506      methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
1507      Note that setting multiple bits may cause extra network round-trips. */
1508   CURLOPT(CURLOPT_PROXYAUTH, CURLOPTTYPE_VALUES, 111),
1509 
1510   /* Option that changes the timeout, in seconds, associated with getting a
1511      response.  This is different from transfer timeout time and essentially
1512      places a demand on the server to acknowledge commands in a timely
1513      manner. For FTP, SMTP, IMAP and POP3. */
1514   CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT, CURLOPTTYPE_LONG, 112),
1515 
1516   /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
1517      tell libcurl to use those IP versions only. This only has effect on
1518      systems with support for more than one, i.e IPv4 _and_ IPv6. */
1519   CURLOPT(CURLOPT_IPRESOLVE, CURLOPTTYPE_VALUES, 113),
1520 
1521   /* Set this option to limit the size of a file that will be downloaded from
1522      an HTTP or FTP server.
1523 
1524      Note there is also _LARGE version which adds large file support for
1525      platforms which have larger off_t sizes.  See MAXFILESIZE_LARGE below. */
1526   CURLOPT(CURLOPT_MAXFILESIZE, CURLOPTTYPE_LONG, 114),
1527 
1528   /* See the comment for INFILESIZE above, but in short, specifies
1529    * the size of the file being uploaded.  -1 means unknown.
1530    */
1531   CURLOPT(CURLOPT_INFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 115),
1532 
1533   /* Sets the continuation offset.  There is also a CURLOPTTYPE_LONG version
1534    * of this; look above for RESUME_FROM.
1535    */
1536   CURLOPT(CURLOPT_RESUME_FROM_LARGE, CURLOPTTYPE_OFF_T, 116),
1537 
1538   /* Sets the maximum size of data that will be downloaded from
1539    * an HTTP or FTP server.  See MAXFILESIZE above for the LONG version.
1540    */
1541   CURLOPT(CURLOPT_MAXFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 117),
1542 
1543   /* Set this option to the file name of your .netrc file you want libcurl
1544      to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
1545      a poor attempt to find the user's home directory and check for a .netrc
1546      file in there. */
1547   CURLOPT(CURLOPT_NETRC_FILE, CURLOPTTYPE_STRINGPOINT, 118),
1548 
1549   /* Enable SSL/TLS for FTP, pick one of:
1550      CURLUSESSL_TRY     - try using SSL, proceed anyway otherwise
1551      CURLUSESSL_CONTROL - SSL for the control connection or fail
1552      CURLUSESSL_ALL     - SSL for all communication or fail
1553   */
1554   CURLOPT(CURLOPT_USE_SSL, CURLOPTTYPE_VALUES, 119),
1555 
1556   /* The _LARGE version of the standard POSTFIELDSIZE option */
1557   CURLOPT(CURLOPT_POSTFIELDSIZE_LARGE, CURLOPTTYPE_OFF_T, 120),
1558 
1559   /* Enable/disable the TCP Nagle algorithm */
1560   CURLOPT(CURLOPT_TCP_NODELAY, CURLOPTTYPE_LONG, 121),
1561 
1562   /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1563   /* 123 OBSOLETE. Gone in 7.16.0 */
1564   /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1565   /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1566   /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1567   /* 127 OBSOLETE. Gone in 7.16.0 */
1568   /* 128 OBSOLETE. Gone in 7.16.0 */
1569 
1570   /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
1571      can be used to change libcurl's default action which is to first try
1572      "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
1573      response has been received.
1574 
1575      Available parameters are:
1576      CURLFTPAUTH_DEFAULT - let libcurl decide
1577      CURLFTPAUTH_SSL     - try "AUTH SSL" first, then TLS
1578      CURLFTPAUTH_TLS     - try "AUTH TLS" first, then SSL
1579   */
1580   CURLOPT(CURLOPT_FTPSSLAUTH, CURLOPTTYPE_VALUES, 129),
1581 
1582   CURLOPTDEPRECATED(CURLOPT_IOCTLFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 130,
1583                     7.18.0, "Use CURLOPT_SEEKFUNCTION"),
1584   CURLOPTDEPRECATED(CURLOPT_IOCTLDATA, CURLOPTTYPE_CBPOINT, 131,
1585                     7.18.0, "Use CURLOPT_SEEKDATA"),
1586 
1587   /* 132 OBSOLETE. Gone in 7.16.0 */
1588   /* 133 OBSOLETE. Gone in 7.16.0 */
1589 
1590   /* null-terminated string for pass on to the FTP server when asked for
1591      "account" info */
1592   CURLOPT(CURLOPT_FTP_ACCOUNT, CURLOPTTYPE_STRINGPOINT, 134),
1593 
1594   /* feed cookie into cookie engine */
1595   CURLOPT(CURLOPT_COOKIELIST, CURLOPTTYPE_STRINGPOINT, 135),
1596 
1597   /* ignore Content-Length */
1598   CURLOPT(CURLOPT_IGNORE_CONTENT_LENGTH, CURLOPTTYPE_LONG, 136),
1599 
1600   /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
1601      response. Typically used for FTP-SSL purposes but is not restricted to
1602      that. libcurl will then instead use the same IP address it used for the
1603      control connection. */
1604   CURLOPT(CURLOPT_FTP_SKIP_PASV_IP, CURLOPTTYPE_LONG, 137),
1605 
1606   /* Select "file method" to use when doing FTP, see the curl_ftpmethod
1607      above. */
1608   CURLOPT(CURLOPT_FTP_FILEMETHOD, CURLOPTTYPE_VALUES, 138),
1609 
1610   /* Local port number to bind the socket to */
1611   CURLOPT(CURLOPT_LOCALPORT, CURLOPTTYPE_LONG, 139),
1612 
1613   /* Number of ports to try, including the first one set with LOCALPORT.
1614      Thus, setting it to 1 will make no additional attempts but the first.
1615   */
1616   CURLOPT(CURLOPT_LOCALPORTRANGE, CURLOPTTYPE_LONG, 140),
1617 
1618   /* no transfer, set up connection and let application use the socket by
1619      extracting it with CURLINFO_LASTSOCKET */
1620   CURLOPT(CURLOPT_CONNECT_ONLY, CURLOPTTYPE_LONG, 141),
1621 
1622   /* Function that will be called to convert from the
1623      network encoding (instead of using the iconv calls in libcurl) */
1624   CURLOPTDEPRECATED(CURLOPT_CONV_FROM_NETWORK_FUNCTION,
1625                     CURLOPTTYPE_FUNCTIONPOINT, 142,
1626                     7.82.0, "Serves no purpose anymore"),
1627 
1628   /* Function that will be called to convert to the
1629      network encoding (instead of using the iconv calls in libcurl) */
1630   CURLOPTDEPRECATED(CURLOPT_CONV_TO_NETWORK_FUNCTION,
1631                     CURLOPTTYPE_FUNCTIONPOINT, 143,
1632                     7.82.0, "Serves no purpose anymore"),
1633 
1634   /* Function that will be called to convert from UTF8
1635      (instead of using the iconv calls in libcurl)
1636      Note that this is used only for SSL certificate processing */
1637   CURLOPTDEPRECATED(CURLOPT_CONV_FROM_UTF8_FUNCTION,
1638                     CURLOPTTYPE_FUNCTIONPOINT, 144,
1639                     7.82.0, "Serves no purpose anymore"),
1640 
1641   /* if the connection proceeds too quickly then need to slow it down */
1642   /* limit-rate: maximum number of bytes per second to send or receive */
1643   CURLOPT(CURLOPT_MAX_SEND_SPEED_LARGE, CURLOPTTYPE_OFF_T, 145),
1644   CURLOPT(CURLOPT_MAX_RECV_SPEED_LARGE, CURLOPTTYPE_OFF_T, 146),
1645 
1646   /* Pointer to command string to send if USER/PASS fails. */
1647   CURLOPT(CURLOPT_FTP_ALTERNATIVE_TO_USER, CURLOPTTYPE_STRINGPOINT, 147),
1648 
1649   /* callback function for setting socket options */
1650   CURLOPT(CURLOPT_SOCKOPTFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 148),
1651   CURLOPT(CURLOPT_SOCKOPTDATA, CURLOPTTYPE_CBPOINT, 149),
1652 
1653   /* set to 0 to disable session ID reuse for this transfer, default is
1654      enabled (== 1) */
1655   CURLOPT(CURLOPT_SSL_SESSIONID_CACHE, CURLOPTTYPE_LONG, 150),
1656 
1657   /* allowed SSH authentication methods */
1658   CURLOPT(CURLOPT_SSH_AUTH_TYPES, CURLOPTTYPE_VALUES, 151),
1659 
1660   /* Used by scp/sftp to do public/private key authentication */
1661   CURLOPT(CURLOPT_SSH_PUBLIC_KEYFILE, CURLOPTTYPE_STRINGPOINT, 152),
1662   CURLOPT(CURLOPT_SSH_PRIVATE_KEYFILE, CURLOPTTYPE_STRINGPOINT, 153),
1663 
1664   /* Send CCC (Clear Command Channel) after authentication */
1665   CURLOPT(CURLOPT_FTP_SSL_CCC, CURLOPTTYPE_LONG, 154),
1666 
1667   /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
1668   CURLOPT(CURLOPT_TIMEOUT_MS, CURLOPTTYPE_LONG, 155),
1669   CURLOPT(CURLOPT_CONNECTTIMEOUT_MS, CURLOPTTYPE_LONG, 156),
1670 
1671   /* set to zero to disable the libcurl's decoding and thus pass the raw body
1672      data to the application even when it is encoded/compressed */
1673   CURLOPT(CURLOPT_HTTP_TRANSFER_DECODING, CURLOPTTYPE_LONG, 157),
1674   CURLOPT(CURLOPT_HTTP_CONTENT_DECODING, CURLOPTTYPE_LONG, 158),
1675 
1676   /* Permission used when creating new files and directories on the remote
1677      server for protocols that support it, SFTP/SCP/FILE */
1678   CURLOPT(CURLOPT_NEW_FILE_PERMS, CURLOPTTYPE_LONG, 159),
1679   CURLOPT(CURLOPT_NEW_DIRECTORY_PERMS, CURLOPTTYPE_LONG, 160),
1680 
1681   /* Set the behavior of POST when redirecting. Values must be set to one
1682      of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
1683   CURLOPT(CURLOPT_POSTREDIR, CURLOPTTYPE_VALUES, 161),
1684 
1685   /* used by scp/sftp to verify the host's public key */
1686   CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, CURLOPTTYPE_STRINGPOINT, 162),
1687 
1688   /* Callback function for opening socket (instead of socket(2)). Optionally,
1689      callback is able change the address or refuse to connect returning
1690      CURL_SOCKET_BAD.  The callback should have type
1691      curl_opensocket_callback */
1692   CURLOPT(CURLOPT_OPENSOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 163),
1693   CURLOPT(CURLOPT_OPENSOCKETDATA, CURLOPTTYPE_CBPOINT, 164),
1694 
1695   /* POST volatile input fields. */
1696   CURLOPT(CURLOPT_COPYPOSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 165),
1697 
1698   /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
1699   CURLOPT(CURLOPT_PROXY_TRANSFER_MODE, CURLOPTTYPE_LONG, 166),
1700 
1701   /* Callback function for seeking in the input stream */
1702   CURLOPT(CURLOPT_SEEKFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 167),
1703   CURLOPT(CURLOPT_SEEKDATA, CURLOPTTYPE_CBPOINT, 168),
1704 
1705   /* CRL file */
1706   CURLOPT(CURLOPT_CRLFILE, CURLOPTTYPE_STRINGPOINT, 169),
1707 
1708   /* Issuer certificate */
1709   CURLOPT(CURLOPT_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 170),
1710 
1711   /* (IPv6) Address scope */
1712   CURLOPT(CURLOPT_ADDRESS_SCOPE, CURLOPTTYPE_LONG, 171),
1713 
1714   /* Collect certificate chain info and allow it to get retrievable with
1715      CURLINFO_CERTINFO after the transfer is complete. */
1716   CURLOPT(CURLOPT_CERTINFO, CURLOPTTYPE_LONG, 172),
1717 
1718   /* "name" and "pwd" to use when fetching. */
1719   CURLOPT(CURLOPT_USERNAME, CURLOPTTYPE_STRINGPOINT, 173),
1720   CURLOPT(CURLOPT_PASSWORD, CURLOPTTYPE_STRINGPOINT, 174),
1721 
1722     /* "name" and "pwd" to use with Proxy when fetching. */
1723   CURLOPT(CURLOPT_PROXYUSERNAME, CURLOPTTYPE_STRINGPOINT, 175),
1724   CURLOPT(CURLOPT_PROXYPASSWORD, CURLOPTTYPE_STRINGPOINT, 176),
1725 
1726   /* Comma separated list of hostnames defining no-proxy zones. These should
1727      match both hostnames directly, and hostnames within a domain. For
1728      example, local.com will match local.com and www.local.com, but NOT
1729      notlocal.com or www.notlocal.com. For compatibility with other
1730      implementations of this, .local.com will be considered to be the same as
1731      local.com. A single * is the only valid wildcard, and effectively
1732      disables the use of proxy. */
1733   CURLOPT(CURLOPT_NOPROXY, CURLOPTTYPE_STRINGPOINT, 177),
1734 
1735   /* block size for TFTP transfers */
1736   CURLOPT(CURLOPT_TFTP_BLKSIZE, CURLOPTTYPE_LONG, 178),
1737 
1738   /* Socks Service */
1739   /* DEPRECATED, do not use! */
1740   CURLOPTDEPRECATED(CURLOPT_SOCKS5_GSSAPI_SERVICE,
1741                     CURLOPTTYPE_STRINGPOINT, 179,
1742                     7.49.0, "Use CURLOPT_PROXY_SERVICE_NAME"),
1743 
1744   /* Socks Service */
1745   CURLOPT(CURLOPT_SOCKS5_GSSAPI_NEC, CURLOPTTYPE_LONG, 180),
1746 
1747   /* set the bitmask for the protocols that are allowed to be used for the
1748      transfer, which thus helps the app which takes URLs from users or other
1749      external inputs and want to restrict what protocol(s) to deal
1750      with. Defaults to CURLPROTO_ALL. */
1751   CURLOPTDEPRECATED(CURLOPT_PROTOCOLS, CURLOPTTYPE_LONG, 181,
1752                     7.85.0, "Use CURLOPT_PROTOCOLS_STR"),
1753 
1754   /* set the bitmask for the protocols that libcurl is allowed to follow to,
1755      as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
1756      to be set in both bitmasks to be allowed to get redirected to. */
1757   CURLOPTDEPRECATED(CURLOPT_REDIR_PROTOCOLS, CURLOPTTYPE_LONG, 182,
1758                     7.85.0, "Use CURLOPT_REDIR_PROTOCOLS_STR"),
1759 
1760   /* set the SSH knownhost file name to use */
1761   CURLOPT(CURLOPT_SSH_KNOWNHOSTS, CURLOPTTYPE_STRINGPOINT, 183),
1762 
1763   /* set the SSH host key callback, must point to a curl_sshkeycallback
1764      function */
1765   CURLOPT(CURLOPT_SSH_KEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 184),
1766 
1767   /* set the SSH host key callback custom pointer */
1768   CURLOPT(CURLOPT_SSH_KEYDATA, CURLOPTTYPE_CBPOINT, 185),
1769 
1770   /* set the SMTP mail originator */
1771   CURLOPT(CURLOPT_MAIL_FROM, CURLOPTTYPE_STRINGPOINT, 186),
1772 
1773   /* set the list of SMTP mail receiver(s) */
1774   CURLOPT(CURLOPT_MAIL_RCPT, CURLOPTTYPE_SLISTPOINT, 187),
1775 
1776   /* FTP: send PRET before PASV */
1777   CURLOPT(CURLOPT_FTP_USE_PRET, CURLOPTTYPE_LONG, 188),
1778 
1779   /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */
1780   CURLOPT(CURLOPT_RTSP_REQUEST, CURLOPTTYPE_VALUES, 189),
1781 
1782   /* The RTSP session identifier */
1783   CURLOPT(CURLOPT_RTSP_SESSION_ID, CURLOPTTYPE_STRINGPOINT, 190),
1784 
1785   /* The RTSP stream URI */
1786   CURLOPT(CURLOPT_RTSP_STREAM_URI, CURLOPTTYPE_STRINGPOINT, 191),
1787 
1788   /* The Transport: header to use in RTSP requests */
1789   CURLOPT(CURLOPT_RTSP_TRANSPORT, CURLOPTTYPE_STRINGPOINT, 192),
1790 
1791   /* Manually initialize the client RTSP CSeq for this handle */
1792   CURLOPT(CURLOPT_RTSP_CLIENT_CSEQ, CURLOPTTYPE_LONG, 193),
1793 
1794   /* Manually initialize the server RTSP CSeq for this handle */
1795   CURLOPT(CURLOPT_RTSP_SERVER_CSEQ, CURLOPTTYPE_LONG, 194),
1796 
1797   /* The stream to pass to INTERLEAVEFUNCTION. */
1798   CURLOPT(CURLOPT_INTERLEAVEDATA, CURLOPTTYPE_CBPOINT, 195),
1799 
1800   /* Let the application define a custom write method for RTP data */
1801   CURLOPT(CURLOPT_INTERLEAVEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 196),
1802 
1803   /* Turn on wildcard matching */
1804   CURLOPT(CURLOPT_WILDCARDMATCH, CURLOPTTYPE_LONG, 197),
1805 
1806   /* Directory matching callback called before downloading of an
1807      individual file (chunk) started */
1808   CURLOPT(CURLOPT_CHUNK_BGN_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 198),
1809 
1810   /* Directory matching callback called after the file (chunk)
1811      was downloaded, or skipped */
1812   CURLOPT(CURLOPT_CHUNK_END_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 199),
1813 
1814   /* Change match (fnmatch-like) callback for wildcard matching */
1815   CURLOPT(CURLOPT_FNMATCH_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 200),
1816 
1817   /* Let the application define custom chunk data pointer */
1818   CURLOPT(CURLOPT_CHUNK_DATA, CURLOPTTYPE_CBPOINT, 201),
1819 
1820   /* FNMATCH_FUNCTION user pointer */
1821   CURLOPT(CURLOPT_FNMATCH_DATA, CURLOPTTYPE_CBPOINT, 202),
1822 
1823   /* send linked-list of name:port:address sets */
1824   CURLOPT(CURLOPT_RESOLVE, CURLOPTTYPE_SLISTPOINT, 203),
1825 
1826   /* Set a username for authenticated TLS */
1827   CURLOPT(CURLOPT_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 204),
1828 
1829   /* Set a password for authenticated TLS */
1830   CURLOPT(CURLOPT_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 205),
1831 
1832   /* Set authentication type for authenticated TLS */
1833   CURLOPT(CURLOPT_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 206),
1834 
1835   /* Set to 1 to enable the "TE:" header in HTTP requests to ask for
1836      compressed transfer-encoded responses. Set to 0 to disable the use of TE:
1837      in outgoing requests. The current default is 0, but it might change in a
1838      future libcurl release.
1839 
1840      libcurl will ask for the compressed methods it knows of, and if that
1841      isn't any, it will not ask for transfer-encoding at all even if this
1842      option is set to 1.
1843 
1844   */
1845   CURLOPT(CURLOPT_TRANSFER_ENCODING, CURLOPTTYPE_LONG, 207),
1846 
1847   /* Callback function for closing socket (instead of close(2)). The callback
1848      should have type curl_closesocket_callback */
1849   CURLOPT(CURLOPT_CLOSESOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 208),
1850   CURLOPT(CURLOPT_CLOSESOCKETDATA, CURLOPTTYPE_CBPOINT, 209),
1851 
1852   /* allow GSSAPI credential delegation */
1853   CURLOPT(CURLOPT_GSSAPI_DELEGATION, CURLOPTTYPE_VALUES, 210),
1854 
1855   /* Set the name servers to use for DNS resolution.
1856    * Only supported by the c-ares DNS backend */
1857   CURLOPT(CURLOPT_DNS_SERVERS, CURLOPTTYPE_STRINGPOINT, 211),
1858 
1859   /* Time-out accept operations (currently for FTP only) after this amount
1860      of milliseconds. */
1861   CURLOPT(CURLOPT_ACCEPTTIMEOUT_MS, CURLOPTTYPE_LONG, 212),
1862 
1863   /* Set TCP keepalive */
1864   CURLOPT(CURLOPT_TCP_KEEPALIVE, CURLOPTTYPE_LONG, 213),
1865 
1866   /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */
1867   CURLOPT(CURLOPT_TCP_KEEPIDLE, CURLOPTTYPE_LONG, 214),
1868   CURLOPT(CURLOPT_TCP_KEEPINTVL, CURLOPTTYPE_LONG, 215),
1869 
1870   /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */
1871   CURLOPT(CURLOPT_SSL_OPTIONS, CURLOPTTYPE_VALUES, 216),
1872 
1873   /* Set the SMTP auth originator */
1874   CURLOPT(CURLOPT_MAIL_AUTH, CURLOPTTYPE_STRINGPOINT, 217),
1875 
1876   /* Enable/disable SASL initial response */
1877   CURLOPT(CURLOPT_SASL_IR, CURLOPTTYPE_LONG, 218),
1878 
1879   /* Function that will be called instead of the internal progress display
1880    * function. This function should be defined as the curl_xferinfo_callback
1881    * prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */
1882   CURLOPT(CURLOPT_XFERINFOFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 219),
1883 
1884   /* The XOAUTH2 bearer token */
1885   CURLOPT(CURLOPT_XOAUTH2_BEARER, CURLOPTTYPE_STRINGPOINT, 220),
1886 
1887   /* Set the interface string to use as outgoing network
1888    * interface for DNS requests.
1889    * Only supported by the c-ares DNS backend */
1890   CURLOPT(CURLOPT_DNS_INTERFACE, CURLOPTTYPE_STRINGPOINT, 221),
1891 
1892   /* Set the local IPv4 address to use for outgoing DNS requests.
1893    * Only supported by the c-ares DNS backend */
1894   CURLOPT(CURLOPT_DNS_LOCAL_IP4, CURLOPTTYPE_STRINGPOINT, 222),
1895 
1896   /* Set the local IPv6 address to use for outgoing DNS requests.
1897    * Only supported by the c-ares DNS backend */
1898   CURLOPT(CURLOPT_DNS_LOCAL_IP6, CURLOPTTYPE_STRINGPOINT, 223),
1899 
1900   /* Set authentication options directly */
1901   CURLOPT(CURLOPT_LOGIN_OPTIONS, CURLOPTTYPE_STRINGPOINT, 224),
1902 
1903   /* Enable/disable TLS NPN extension (http2 over ssl might fail without) */
1904   CURLOPTDEPRECATED(CURLOPT_SSL_ENABLE_NPN, CURLOPTTYPE_LONG, 225,
1905                     7.86.0, "Has no function"),
1906 
1907   /* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */
1908   CURLOPT(CURLOPT_SSL_ENABLE_ALPN, CURLOPTTYPE_LONG, 226),
1909 
1910   /* Time to wait for a response to an HTTP request containing an
1911    * Expect: 100-continue header before sending the data anyway. */
1912   CURLOPT(CURLOPT_EXPECT_100_TIMEOUT_MS, CURLOPTTYPE_LONG, 227),
1913 
1914   /* This points to a linked list of headers used for proxy requests only,
1915      struct curl_slist kind */
1916   CURLOPT(CURLOPT_PROXYHEADER, CURLOPTTYPE_SLISTPOINT, 228),
1917 
1918   /* Pass in a bitmask of "header options" */
1919   CURLOPT(CURLOPT_HEADEROPT, CURLOPTTYPE_VALUES, 229),
1920 
1921   /* The public key in DER form used to validate the peer public key
1922      this option is used only if SSL_VERIFYPEER is true */
1923   CURLOPT(CURLOPT_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 230),
1924 
1925   /* Path to Unix domain socket */
1926   CURLOPT(CURLOPT_UNIX_SOCKET_PATH, CURLOPTTYPE_STRINGPOINT, 231),
1927 
1928   /* Set if we should verify the certificate status. */
1929   CURLOPT(CURLOPT_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 232),
1930 
1931   /* Set if we should enable TLS false start. */
1932   CURLOPT(CURLOPT_SSL_FALSESTART, CURLOPTTYPE_LONG, 233),
1933 
1934   /* Do not squash dot-dot sequences */
1935   CURLOPT(CURLOPT_PATH_AS_IS, CURLOPTTYPE_LONG, 234),
1936 
1937   /* Proxy Service Name */
1938   CURLOPT(CURLOPT_PROXY_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 235),
1939 
1940   /* Service Name */
1941   CURLOPT(CURLOPT_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 236),
1942 
1943   /* Wait/don't wait for pipe/mutex to clarify */
1944   CURLOPT(CURLOPT_PIPEWAIT, CURLOPTTYPE_LONG, 237),
1945 
1946   /* Set the protocol used when curl is given a URL without a protocol */
1947   CURLOPT(CURLOPT_DEFAULT_PROTOCOL, CURLOPTTYPE_STRINGPOINT, 238),
1948 
1949   /* Set stream weight, 1 - 256 (default is 16) */
1950   CURLOPT(CURLOPT_STREAM_WEIGHT, CURLOPTTYPE_LONG, 239),
1951 
1952   /* Set stream dependency on another CURL handle */
1953   CURLOPT(CURLOPT_STREAM_DEPENDS, CURLOPTTYPE_OBJECTPOINT, 240),
1954 
1955   /* Set E-xclusive stream dependency on another CURL handle */
1956   CURLOPT(CURLOPT_STREAM_DEPENDS_E, CURLOPTTYPE_OBJECTPOINT, 241),
1957 
1958   /* Do not send any tftp option requests to the server */
1959   CURLOPT(CURLOPT_TFTP_NO_OPTIONS, CURLOPTTYPE_LONG, 242),
1960 
1961   /* Linked-list of host:port:connect-to-host:connect-to-port,
1962      overrides the URL's host:port (only for the network layer) */
1963   CURLOPT(CURLOPT_CONNECT_TO, CURLOPTTYPE_SLISTPOINT, 243),
1964 
1965   /* Set TCP Fast Open */
1966   CURLOPT(CURLOPT_TCP_FASTOPEN, CURLOPTTYPE_LONG, 244),
1967 
1968   /* Continue to send data if the server responds early with an
1969    * HTTP status code >= 300 */
1970   CURLOPT(CURLOPT_KEEP_SENDING_ON_ERROR, CURLOPTTYPE_LONG, 245),
1971 
1972   /* The CApath or CAfile used to validate the proxy certificate
1973      this option is used only if PROXY_SSL_VERIFYPEER is true */
1974   CURLOPT(CURLOPT_PROXY_CAINFO, CURLOPTTYPE_STRINGPOINT, 246),
1975 
1976   /* The CApath directory used to validate the proxy certificate
1977      this option is used only if PROXY_SSL_VERIFYPEER is true */
1978   CURLOPT(CURLOPT_PROXY_CAPATH, CURLOPTTYPE_STRINGPOINT, 247),
1979 
1980   /* Set if we should verify the proxy in ssl handshake,
1981      set 1 to verify. */
1982   CURLOPT(CURLOPT_PROXY_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 248),
1983 
1984   /* Set if we should verify the Common name from the proxy certificate in ssl
1985    * handshake, set 1 to check existence, 2 to ensure that it matches
1986    * the provided hostname. */
1987   CURLOPT(CURLOPT_PROXY_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 249),
1988 
1989   /* What version to specifically try to use for proxy.
1990      See CURL_SSLVERSION defines below. */
1991   CURLOPT(CURLOPT_PROXY_SSLVERSION, CURLOPTTYPE_VALUES, 250),
1992 
1993   /* Set a username for authenticated TLS for proxy */
1994   CURLOPT(CURLOPT_PROXY_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 251),
1995 
1996   /* Set a password for authenticated TLS for proxy */
1997   CURLOPT(CURLOPT_PROXY_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 252),
1998 
1999   /* Set authentication type for authenticated TLS for proxy */
2000   CURLOPT(CURLOPT_PROXY_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 253),
2001 
2002   /* name of the file keeping your private SSL-certificate for proxy */
2003   CURLOPT(CURLOPT_PROXY_SSLCERT, CURLOPTTYPE_STRINGPOINT, 254),
2004 
2005   /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") for
2006      proxy */
2007   CURLOPT(CURLOPT_PROXY_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 255),
2008 
2009   /* name of the file keeping your private SSL-key for proxy */
2010   CURLOPT(CURLOPT_PROXY_SSLKEY, CURLOPTTYPE_STRINGPOINT, 256),
2011 
2012   /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") for
2013      proxy */
2014   CURLOPT(CURLOPT_PROXY_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 257),
2015 
2016   /* password for the SSL private key for proxy */
2017   CURLOPT(CURLOPT_PROXY_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 258),
2018 
2019   /* Specify which SSL ciphers to use for proxy */
2020   CURLOPT(CURLOPT_PROXY_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 259),
2021 
2022   /* CRL file for proxy */
2023   CURLOPT(CURLOPT_PROXY_CRLFILE, CURLOPTTYPE_STRINGPOINT, 260),
2024 
2025   /* Enable/disable specific SSL features with a bitmask for proxy, see
2026      CURLSSLOPT_* */
2027   CURLOPT(CURLOPT_PROXY_SSL_OPTIONS, CURLOPTTYPE_LONG, 261),
2028 
2029   /* Name of pre proxy to use. */
2030   CURLOPT(CURLOPT_PRE_PROXY, CURLOPTTYPE_STRINGPOINT, 262),
2031 
2032   /* The public key in DER form used to validate the proxy public key
2033      this option is used only if PROXY_SSL_VERIFYPEER is true */
2034   CURLOPT(CURLOPT_PROXY_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 263),
2035 
2036   /* Path to an abstract Unix domain socket */
2037   CURLOPT(CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOPTTYPE_STRINGPOINT, 264),
2038 
2039   /* Suppress proxy CONNECT response headers from user callbacks */
2040   CURLOPT(CURLOPT_SUPPRESS_CONNECT_HEADERS, CURLOPTTYPE_LONG, 265),
2041 
2042   /* The request target, instead of extracted from the URL */
2043   CURLOPT(CURLOPT_REQUEST_TARGET, CURLOPTTYPE_STRINGPOINT, 266),
2044 
2045   /* bitmask of allowed auth methods for connections to SOCKS5 proxies */
2046   CURLOPT(CURLOPT_SOCKS5_AUTH, CURLOPTTYPE_LONG, 267),
2047 
2048   /* Enable/disable SSH compression */
2049   CURLOPT(CURLOPT_SSH_COMPRESSION, CURLOPTTYPE_LONG, 268),
2050 
2051   /* Post MIME data. */
2052   CURLOPT(CURLOPT_MIMEPOST, CURLOPTTYPE_OBJECTPOINT, 269),
2053 
2054   /* Time to use with the CURLOPT_TIMECONDITION. Specified in number of
2055      seconds since 1 Jan 1970. */
2056   CURLOPT(CURLOPT_TIMEVALUE_LARGE, CURLOPTTYPE_OFF_T, 270),
2057 
2058   /* Head start in milliseconds to give happy eyeballs. */
2059   CURLOPT(CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, CURLOPTTYPE_LONG, 271),
2060 
2061   /* Function that will be called before a resolver request is made */
2062   CURLOPT(CURLOPT_RESOLVER_START_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 272),
2063 
2064   /* User data to pass to the resolver start callback. */
2065   CURLOPT(CURLOPT_RESOLVER_START_DATA, CURLOPTTYPE_CBPOINT, 273),
2066 
2067   /* send HAProxy PROXY protocol header? */
2068   CURLOPT(CURLOPT_HAPROXYPROTOCOL, CURLOPTTYPE_LONG, 274),
2069 
2070   /* shuffle addresses before use when DNS returns multiple */
2071   CURLOPT(CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOPTTYPE_LONG, 275),
2072 
2073   /* Specify which TLS 1.3 ciphers suites to use */
2074   CURLOPT(CURLOPT_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 276),
2075   CURLOPT(CURLOPT_PROXY_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 277),
2076 
2077   /* Disallow specifying username/login in URL. */
2078   CURLOPT(CURLOPT_DISALLOW_USERNAME_IN_URL, CURLOPTTYPE_LONG, 278),
2079 
2080   /* DNS-over-HTTPS URL */
2081   CURLOPT(CURLOPT_DOH_URL, CURLOPTTYPE_STRINGPOINT, 279),
2082 
2083   /* Preferred buffer size to use for uploads */
2084   CURLOPT(CURLOPT_UPLOAD_BUFFERSIZE, CURLOPTTYPE_LONG, 280),
2085 
2086   /* Time in ms between connection upkeep calls for long-lived connections. */
2087   CURLOPT(CURLOPT_UPKEEP_INTERVAL_MS, CURLOPTTYPE_LONG, 281),
2088 
2089   /* Specify URL using CURL URL API. */
2090   CURLOPT(CURLOPT_CURLU, CURLOPTTYPE_OBJECTPOINT, 282),
2091 
2092   /* add trailing data just after no more data is available */
2093   CURLOPT(CURLOPT_TRAILERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 283),
2094 
2095   /* pointer to be passed to HTTP_TRAILER_FUNCTION */
2096   CURLOPT(CURLOPT_TRAILERDATA, CURLOPTTYPE_CBPOINT, 284),
2097 
2098   /* set this to 1L to allow HTTP/0.9 responses or 0L to disallow */
2099   CURLOPT(CURLOPT_HTTP09_ALLOWED, CURLOPTTYPE_LONG, 285),
2100 
2101   /* alt-svc control bitmask */
2102   CURLOPT(CURLOPT_ALTSVC_CTRL, CURLOPTTYPE_LONG, 286),
2103 
2104   /* alt-svc cache file name to possibly read from/write to */
2105   CURLOPT(CURLOPT_ALTSVC, CURLOPTTYPE_STRINGPOINT, 287),
2106 
2107   /* maximum age (idle time) of a connection to consider it for reuse
2108    * (in seconds) */
2109   CURLOPT(CURLOPT_MAXAGE_CONN, CURLOPTTYPE_LONG, 288),
2110 
2111   /* SASL authorization identity */
2112   CURLOPT(CURLOPT_SASL_AUTHZID, CURLOPTTYPE_STRINGPOINT, 289),
2113 
2114   /* allow RCPT TO command to fail for some recipients */
2115   CURLOPT(CURLOPT_MAIL_RCPT_ALLOWFAILS, CURLOPTTYPE_LONG, 290),
2116 
2117   /* the private SSL-certificate as a "blob" */
2118   CURLOPT(CURLOPT_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 291),
2119   CURLOPT(CURLOPT_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 292),
2120   CURLOPT(CURLOPT_PROXY_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 293),
2121   CURLOPT(CURLOPT_PROXY_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 294),
2122   CURLOPT(CURLOPT_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 295),
2123 
2124   /* Issuer certificate for proxy */
2125   CURLOPT(CURLOPT_PROXY_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 296),
2126   CURLOPT(CURLOPT_PROXY_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 297),
2127 
2128   /* the EC curves requested by the TLS client (RFC 8422, 5.1);
2129    * OpenSSL support via 'set_groups'/'set_curves':
2130    * https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html
2131    */
2132   CURLOPT(CURLOPT_SSL_EC_CURVES, CURLOPTTYPE_STRINGPOINT, 298),
2133 
2134   /* HSTS bitmask */
2135   CURLOPT(CURLOPT_HSTS_CTRL, CURLOPTTYPE_LONG, 299),
2136   /* HSTS file name */
2137   CURLOPT(CURLOPT_HSTS, CURLOPTTYPE_STRINGPOINT, 300),
2138 
2139   /* HSTS read callback */
2140   CURLOPT(CURLOPT_HSTSREADFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 301),
2141   CURLOPT(CURLOPT_HSTSREADDATA, CURLOPTTYPE_CBPOINT, 302),
2142 
2143   /* HSTS write callback */
2144   CURLOPT(CURLOPT_HSTSWRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 303),
2145   CURLOPT(CURLOPT_HSTSWRITEDATA, CURLOPTTYPE_CBPOINT, 304),
2146 
2147   /* Parameters for V4 signature */
2148   CURLOPT(CURLOPT_AWS_SIGV4, CURLOPTTYPE_STRINGPOINT, 305),
2149 
2150   /* Same as CURLOPT_SSL_VERIFYPEER but for DoH (DNS-over-HTTPS) servers. */
2151   CURLOPT(CURLOPT_DOH_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 306),
2152 
2153   /* Same as CURLOPT_SSL_VERIFYHOST but for DoH (DNS-over-HTTPS) servers. */
2154   CURLOPT(CURLOPT_DOH_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 307),
2155 
2156   /* Same as CURLOPT_SSL_VERIFYSTATUS but for DoH (DNS-over-HTTPS) servers. */
2157   CURLOPT(CURLOPT_DOH_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 308),
2158 
2159   /* The CA certificates as "blob" used to validate the peer certificate
2160      this option is used only if SSL_VERIFYPEER is true */
2161   CURLOPT(CURLOPT_CAINFO_BLOB, CURLOPTTYPE_BLOB, 309),
2162 
2163   /* The CA certificates as "blob" used to validate the proxy certificate
2164      this option is used only if PROXY_SSL_VERIFYPEER is true */
2165   CURLOPT(CURLOPT_PROXY_CAINFO_BLOB, CURLOPTTYPE_BLOB, 310),
2166 
2167   /* used by scp/sftp to verify the host's public key */
2168   CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, CURLOPTTYPE_STRINGPOINT, 311),
2169 
2170   /* Function that will be called immediately before the initial request
2171      is made on a connection (after any protocol negotiation step).  */
2172   CURLOPT(CURLOPT_PREREQFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 312),
2173 
2174   /* Data passed to the CURLOPT_PREREQFUNCTION callback */
2175   CURLOPT(CURLOPT_PREREQDATA, CURLOPTTYPE_CBPOINT, 313),
2176 
2177   /* maximum age (since creation) of a connection to consider it for reuse
2178    * (in seconds) */
2179   CURLOPT(CURLOPT_MAXLIFETIME_CONN, CURLOPTTYPE_LONG, 314),
2180 
2181   /* Set MIME option flags. */
2182   CURLOPT(CURLOPT_MIME_OPTIONS, CURLOPTTYPE_LONG, 315),
2183 
2184   /* set the SSH host key callback, must point to a curl_sshkeycallback
2185      function */
2186   CURLOPT(CURLOPT_SSH_HOSTKEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 316),
2187 
2188   /* set the SSH host key callback custom pointer */
2189   CURLOPT(CURLOPT_SSH_HOSTKEYDATA, CURLOPTTYPE_CBPOINT, 317),
2190 
2191   /* specify which protocols that are allowed to be used for the transfer,
2192      which thus helps the app which takes URLs from users or other external
2193      inputs and want to restrict what protocol(s) to deal with. Defaults to
2194      all built-in protocols. */
2195   CURLOPT(CURLOPT_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 318),
2196 
2197   /* specify which protocols that libcurl is allowed to follow directs to */
2198   CURLOPT(CURLOPT_REDIR_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 319),
2199 
2200   /* websockets options */
2201   CURLOPT(CURLOPT_WS_OPTIONS, CURLOPTTYPE_LONG, 320),
2202 
2203   /* CA cache timeout */
2204   CURLOPT(CURLOPT_CA_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 321),
2205 
2206   /* Can leak things, gonna exit() soon */
2207   CURLOPT(CURLOPT_QUICK_EXIT, CURLOPTTYPE_LONG, 322),
2208 
2209   /* set a specific client IP for HAProxy PROXY protocol header? */
2210   CURLOPT(CURLOPT_HAPROXY_CLIENT_IP, CURLOPTTYPE_STRINGPOINT, 323),
2211 
2212   /* millisecond version */
2213   CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, CURLOPTTYPE_LONG, 324),
2214 
2215     /* set ECH configuration  */
2216   CURLOPT(CURLOPT_ECH, CURLOPTTYPE_STRINGPOINT, 325),
2217 
2218   CURLOPT_LASTENTRY /* the last unused */
2219 } CURLoption;
2220 
2221 #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
2222                           the obsolete stuff removed! */
2223 
2224 /* Backwards compatibility with older names */
2225 /* These are scheduled to disappear by 2011 */
2226 
2227 /* This was added in version 7.19.1 */
2228 #define CURLOPT_POST301 CURLOPT_POSTREDIR
2229 
2230 /* These are scheduled to disappear by 2009 */
2231 
2232 /* The following were added in 7.17.0 */
2233 #define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD
2234 #define CURLOPT_FTPAPPEND CURLOPT_APPEND
2235 #define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY
2236 #define CURLOPT_FTP_SSL CURLOPT_USE_SSL
2237 
2238 /* The following were added earlier */
2239 
2240 #define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
2241 #define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
2242 
2243 /* */
2244 #define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT
2245 
2246 /* Added in 8.2.0 */
2247 #define CURLOPT_MAIL_RCPT_ALLLOWFAILS CURLOPT_MAIL_RCPT_ALLOWFAILS
2248 
2249 #else
2250 /* This is set if CURL_NO_OLDIES is defined at compile-time */
2251 #undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
2252 #endif
2253 
2254 
2255   /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
2256      name resolves addresses using more than one IP protocol version, this
2257      option might be handy to force libcurl to use a specific IP version. */
2258 #define CURL_IPRESOLVE_WHATEVER 0 /* default, uses addresses to all IP
2259                                      versions that your system allows */
2260 #define CURL_IPRESOLVE_V4       1 /* uses only IPv4 addresses/connections */
2261 #define CURL_IPRESOLVE_V6       2 /* uses only IPv6 addresses/connections */
2262 
2263   /* Convenient "aliases" */
2264 #define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
2265 
2266   /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
2267 enum {
2268   CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
2269                              like the library to choose the best possible
2270                              for us! */
2271   CURL_HTTP_VERSION_1_0,  /* please use HTTP 1.0 in the request */
2272   CURL_HTTP_VERSION_1_1,  /* please use HTTP 1.1 in the request */
2273   CURL_HTTP_VERSION_2_0,  /* please use HTTP 2 in the request */
2274   CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
2275   CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE,  /* please use HTTP 2 without HTTP/1.1
2276                                            Upgrade */
2277   CURL_HTTP_VERSION_3 = 30, /* Use HTTP/3, fallback to HTTP/2 or HTTP/1 if
2278                                needed. For HTTPS only. For HTTP, this option
2279                                makes libcurl return error. */
2280   CURL_HTTP_VERSION_3ONLY = 31, /* Use HTTP/3 without fallback. For HTTPS
2281                                    only. For HTTP, this makes libcurl
2282                                    return error. */
2283 
2284   CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
2285 };
2286 
2287 /* Convenience definition simple because the name of the version is HTTP/2 and
2288    not 2.0. The 2_0 version of the enum name was set while the version was
2289    still planned to be 2.0 and we stick to it for compatibility. */
2290 #define CURL_HTTP_VERSION_2 CURL_HTTP_VERSION_2_0
2291 
2292 /*
2293  * Public API enums for RTSP requests
2294  */
2295 enum {
2296     CURL_RTSPREQ_NONE, /* first in list */
2297     CURL_RTSPREQ_OPTIONS,
2298     CURL_RTSPREQ_DESCRIBE,
2299     CURL_RTSPREQ_ANNOUNCE,
2300     CURL_RTSPREQ_SETUP,
2301     CURL_RTSPREQ_PLAY,
2302     CURL_RTSPREQ_PAUSE,
2303     CURL_RTSPREQ_TEARDOWN,
2304     CURL_RTSPREQ_GET_PARAMETER,
2305     CURL_RTSPREQ_SET_PARAMETER,
2306     CURL_RTSPREQ_RECORD,
2307     CURL_RTSPREQ_RECEIVE,
2308     CURL_RTSPREQ_LAST /* last in list */
2309 };
2310 
2311   /* These enums are for use with the CURLOPT_NETRC option. */
2312 enum CURL_NETRC_OPTION {
2313   CURL_NETRC_IGNORED,     /* The .netrc will never be read.
2314                            * This is the default. */
2315   CURL_NETRC_OPTIONAL,    /* A user:password in the URL will be preferred
2316                            * to one in the .netrc. */
2317   CURL_NETRC_REQUIRED,    /* A user:password in the URL will be ignored.
2318                            * Unless one is set programmatically, the .netrc
2319                            * will be queried. */
2320   CURL_NETRC_LAST
2321 };
2322 
2323 #define CURL_SSLVERSION_DEFAULT 0
2324 #define CURL_SSLVERSION_TLSv1   1 /* TLS 1.x */
2325 #define CURL_SSLVERSION_SSLv2   2
2326 #define CURL_SSLVERSION_SSLv3   3
2327 #define CURL_SSLVERSION_TLSv1_0 4
2328 #define CURL_SSLVERSION_TLSv1_1 5
2329 #define CURL_SSLVERSION_TLSv1_2 6
2330 #define CURL_SSLVERSION_TLSv1_3 7
2331 
2332 #define CURL_SSLVERSION_LAST 8 /* never use, keep last */
2333 
2334 #define CURL_SSLVERSION_MAX_NONE 0
2335 #define CURL_SSLVERSION_MAX_DEFAULT (CURL_SSLVERSION_TLSv1   << 16)
2336 #define CURL_SSLVERSION_MAX_TLSv1_0 (CURL_SSLVERSION_TLSv1_0 << 16)
2337 #define CURL_SSLVERSION_MAX_TLSv1_1 (CURL_SSLVERSION_TLSv1_1 << 16)
2338 #define CURL_SSLVERSION_MAX_TLSv1_2 (CURL_SSLVERSION_TLSv1_2 << 16)
2339 #define CURL_SSLVERSION_MAX_TLSv1_3 (CURL_SSLVERSION_TLSv1_3 << 16)
2340 
2341   /* never use, keep last */
2342 #define CURL_SSLVERSION_MAX_LAST    (CURL_SSLVERSION_LAST    << 16)
2343 
2344 enum CURL_TLSAUTH {
2345   CURL_TLSAUTH_NONE,
2346   CURL_TLSAUTH_SRP,
2347   CURL_TLSAUTH_LAST /* never use, keep last */
2348 };
2349 
2350 /* symbols to use with CURLOPT_POSTREDIR.
2351    CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303
2352    can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302
2353    | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */
2354 
2355 #define CURL_REDIR_GET_ALL  0
2356 #define CURL_REDIR_POST_301 1
2357 #define CURL_REDIR_POST_302 2
2358 #define CURL_REDIR_POST_303 4
2359 #define CURL_REDIR_POST_ALL \
2360     (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
2361 
2362 typedef enum {
2363   CURL_TIMECOND_NONE,
2364 
2365   CURL_TIMECOND_IFMODSINCE,
2366   CURL_TIMECOND_IFUNMODSINCE,
2367   CURL_TIMECOND_LASTMOD,
2368 
2369   CURL_TIMECOND_LAST
2370 } curl_TimeCond;
2371 
2372 /* Special size_t value signaling a null-terminated string. */
2373 #define CURL_ZERO_TERMINATED ((size_t) -1)
2374 
2375 /* curl_strequal() and curl_strnequal() are subject for removal in a future
2376    release */
2377 CURL_EXTERN int curl_strequal(const char *s1, const char *s2);
2378 CURL_EXTERN int curl_strnequal(const char *s1, const char *s2, size_t n);
2379 
2380 /* Mime/form handling support. */
2381 typedef struct curl_mime      curl_mime;      /* Mime context. */
2382 typedef struct curl_mimepart  curl_mimepart;  /* Mime part context. */
2383 
2384 /* CURLMIMEOPT_ defines are for the CURLOPT_MIME_OPTIONS option. */
2385 #define CURLMIMEOPT_FORMESCAPE  (1<<0) /* Use backslash-escaping for forms. */
2386 
2387 /*
2388  * NAME curl_mime_init()
2389  *
2390  * DESCRIPTION
2391  *
2392  * Create a mime context and return its handle. The easy parameter is the
2393  * target handle.
2394  */
2395 CURL_EXTERN curl_mime *curl_mime_init(CURL *easy);
2396 
2397 /*
2398  * NAME curl_mime_init_with_boundary()
2399  *
2400  * DESCRIPTION
2401  *
2402  * Create a mime context and return its handle. The easy parameter is the
2403  * target handle. The boundary parameter is a user-defined boundary to separate
2404  * the multi-part formdata. the length parameter is the length of boundary.
2405  */
2406 CURL_EXTERN curl_mime *curl_mime_init_with_boundary(CURL *easy, const char *boundary, size_t length);
2407 
2408 /*
2409  * NAME curl_boundary_max_length()
2410  *
2411  * DESCRIPTION
2412  *
2413  * Return the max length of boundary.
2414  */
2415 CURL_EXTERN size_t curl_boundary_max_length(void);
2416 
2417 /*
2418  * NAME curl_mime_free()
2419  *
2420  * DESCRIPTION
2421  *
2422  * release a mime handle and its substructures.
2423  */
2424 CURL_EXTERN void curl_mime_free(curl_mime *mime);
2425 
2426 /*
2427  * NAME curl_mime_addpart()
2428  *
2429  * DESCRIPTION
2430  *
2431  * Append a new empty part to the given mime context and return a handle to
2432  * the created part.
2433  */
2434 CURL_EXTERN curl_mimepart *curl_mime_addpart(curl_mime *mime);
2435 
2436 /*
2437  * NAME curl_mime_name()
2438  *
2439  * DESCRIPTION
2440  *
2441  * Set mime/form part name.
2442  */
2443 CURL_EXTERN CURLcode curl_mime_name(curl_mimepart *part, const char *name);
2444 
2445 /*
2446  * NAME curl_mime_filename()
2447  *
2448  * DESCRIPTION
2449  *
2450  * Set mime part remote file name.
2451  */
2452 CURL_EXTERN CURLcode curl_mime_filename(curl_mimepart *part,
2453                                         const char *filename);
2454 
2455 /*
2456  * NAME curl_mime_type()
2457  *
2458  * DESCRIPTION
2459  *
2460  * Set mime part type.
2461  */
2462 CURL_EXTERN CURLcode curl_mime_type(curl_mimepart *part, const char *mimetype);
2463 
2464 /*
2465  * NAME curl_mime_encoder()
2466  *
2467  * DESCRIPTION
2468  *
2469  * Set mime data transfer encoder.
2470  */
2471 CURL_EXTERN CURLcode curl_mime_encoder(curl_mimepart *part,
2472                                        const char *encoding);
2473 
2474 /*
2475  * NAME curl_mime_data()
2476  *
2477  * DESCRIPTION
2478  *
2479  * Set mime part data source from memory data,
2480  */
2481 CURL_EXTERN CURLcode curl_mime_data(curl_mimepart *part,
2482                                     const char *data, size_t datasize);
2483 
2484 /*
2485  * NAME curl_mime_filedata()
2486  *
2487  * DESCRIPTION
2488  *
2489  * Set mime part data source from named file.
2490  */
2491 CURL_EXTERN CURLcode curl_mime_filedata(curl_mimepart *part,
2492                                         const char *filename);
2493 
2494 /*
2495  * NAME curl_mime_data_cb()
2496  *
2497  * DESCRIPTION
2498  *
2499  * Set mime part data source from callback function.
2500  */
2501 CURL_EXTERN CURLcode curl_mime_data_cb(curl_mimepart *part,
2502                                        curl_off_t datasize,
2503                                        curl_read_callback readfunc,
2504                                        curl_seek_callback seekfunc,
2505                                        curl_free_callback freefunc,
2506                                        void *arg);
2507 
2508 /*
2509  * NAME curl_mime_subparts()
2510  *
2511  * DESCRIPTION
2512  *
2513  * Set mime part data source from subparts.
2514  */
2515 CURL_EXTERN CURLcode curl_mime_subparts(curl_mimepart *part,
2516                                         curl_mime *subparts);
2517 /*
2518  * NAME curl_mime_headers()
2519  *
2520  * DESCRIPTION
2521  *
2522  * Set mime part headers.
2523  */
2524 CURL_EXTERN CURLcode curl_mime_headers(curl_mimepart *part,
2525                                        struct curl_slist *headers,
2526                                        int take_ownership);
2527 
2528 typedef enum {
2529   /********* the first one is unused ************/
2530   CURLFORM_NOTHING         CURL_DEPRECATED(7.56.0, ""),
2531   CURLFORM_COPYNAME        CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
2532   CURLFORM_PTRNAME         CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
2533   CURLFORM_NAMELENGTH      CURL_DEPRECATED(7.56.0, ""),
2534   CURLFORM_COPYCONTENTS    CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
2535   CURLFORM_PTRCONTENTS     CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
2536   CURLFORM_CONTENTSLENGTH  CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
2537   CURLFORM_FILECONTENT     CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),
2538   CURLFORM_ARRAY           CURL_DEPRECATED(7.56.0, ""),
2539   CURLFORM_OBSOLETE,
2540   CURLFORM_FILE            CURL_DEPRECATED(7.56.0, "Use curl_mime_filedata()"),
2541 
2542   CURLFORM_BUFFER          CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),
2543   CURLFORM_BUFFERPTR       CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
2544   CURLFORM_BUFFERLENGTH    CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
2545 
2546   CURLFORM_CONTENTTYPE     CURL_DEPRECATED(7.56.0, "Use curl_mime_type()"),
2547   CURLFORM_CONTENTHEADER   CURL_DEPRECATED(7.56.0, "Use curl_mime_headers()"),
2548   CURLFORM_FILENAME        CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),
2549   CURLFORM_END,
2550   CURLFORM_OBSOLETE2,
2551 
2552   CURLFORM_STREAM          CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),
2553   CURLFORM_CONTENTLEN  /* added in 7.46.0, provide a curl_off_t length */
2554                            CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
2555 
2556   CURLFORM_LASTENTRY /* the last unused */
2557 } CURLformoption;
2558 
2559 /* structure to be used as parameter for CURLFORM_ARRAY */
2560 struct curl_forms {
2561   CURLformoption option;
2562   const char     *value;
2563 };
2564 
2565 /* use this for multipart formpost building */
2566 /* Returns code for curl_formadd()
2567  *
2568  * Returns:
2569  * CURL_FORMADD_OK             on success
2570  * CURL_FORMADD_MEMORY         if the FormInfo allocation fails
2571  * CURL_FORMADD_OPTION_TWICE   if one option is given twice for one Form
2572  * CURL_FORMADD_NULL           if a null pointer was given for a char
2573  * CURL_FORMADD_MEMORY         if the allocation of a FormInfo struct failed
2574  * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used
2575  * CURL_FORMADD_INCOMPLETE     if the some FormInfo is not complete (or error)
2576  * CURL_FORMADD_MEMORY         if a curl_httppost struct cannot be allocated
2577  * CURL_FORMADD_MEMORY         if some allocation for string copying failed.
2578  * CURL_FORMADD_ILLEGAL_ARRAY  if an illegal option is used in an array
2579  *
2580  ***************************************************************************/
2581 typedef enum {
2582   CURL_FORMADD_OK             CURL_DEPRECATED(7.56.0, ""), /* 1st, no error */
2583 
2584   CURL_FORMADD_MEMORY         CURL_DEPRECATED(7.56.0, ""),
2585   CURL_FORMADD_OPTION_TWICE   CURL_DEPRECATED(7.56.0, ""),
2586   CURL_FORMADD_NULL           CURL_DEPRECATED(7.56.0, ""),
2587   CURL_FORMADD_UNKNOWN_OPTION CURL_DEPRECATED(7.56.0, ""),
2588   CURL_FORMADD_INCOMPLETE     CURL_DEPRECATED(7.56.0, ""),
2589   CURL_FORMADD_ILLEGAL_ARRAY  CURL_DEPRECATED(7.56.0, ""),
2590   /* libcurl was built with form api disabled */
2591   CURL_FORMADD_DISABLED       CURL_DEPRECATED(7.56.0, ""),
2592 
2593   CURL_FORMADD_LAST /* last */
2594 } CURLFORMcode;
2595 
2596 /*
2597  * NAME curl_formadd()
2598  *
2599  * DESCRIPTION
2600  *
2601  * Pretty advanced function for building multi-part formposts. Each invoke
2602  * adds one part that together construct a full post. Then use
2603  * CURLOPT_HTTPPOST to send it off to libcurl.
2604  */
2605 CURL_EXTERN CURLFORMcode CURL_DEPRECATED(7.56.0, "Use curl_mime_init()")
2606 curl_formadd(struct curl_httppost **httppost,
2607              struct curl_httppost **last_post,
2608              ...);
2609 
2610 /*
2611  * callback function for curl_formget()
2612  * The void *arg pointer will be the one passed as second argument to
2613  *   curl_formget().
2614  * The character buffer passed to it must not be freed.
2615  * Should return the buffer length passed to it as the argument "len" on
2616  *   success.
2617  */
2618 typedef size_t (*curl_formget_callback)(void *arg, const char *buf,
2619                                         size_t len);
2620 
2621 /*
2622  * NAME curl_formget()
2623  *
2624  * DESCRIPTION
2625  *
2626  * Serialize a curl_httppost struct built with curl_formadd().
2627  * Accepts a void pointer as second argument which will be passed to
2628  * the curl_formget_callback function.
2629  * Returns 0 on success.
2630  */
2631 CURL_EXTERN int CURL_DEPRECATED(7.56.0, "")
2632 curl_formget(struct curl_httppost *form, void *arg,
2633              curl_formget_callback append);
2634 /*
2635  * NAME curl_formfree()
2636  *
2637  * DESCRIPTION
2638  *
2639  * Free a multipart formpost previously built with curl_formadd().
2640  */
2641 CURL_EXTERN void CURL_DEPRECATED(7.56.0, "Use curl_mime_free()")
2642 curl_formfree(struct curl_httppost *form);
2643 
2644 /*
2645  * NAME curl_getenv()
2646  *
2647  * DESCRIPTION
2648  *
2649  * Returns a malloc()'ed string that MUST be curl_free()ed after usage is
2650  * complete. DEPRECATED - see lib/README.curlx
2651  */
2652 CURL_EXTERN char *curl_getenv(const char *variable);
2653 
2654 /*
2655  * NAME curl_version()
2656  *
2657  * DESCRIPTION
2658  *
2659  * Returns a static ascii string of the libcurl version.
2660  */
2661 CURL_EXTERN char *curl_version(void);
2662 
2663 /*
2664  * NAME curl_easy_escape()
2665  *
2666  * DESCRIPTION
2667  *
2668  * Escapes URL strings (converts all letters consider illegal in URLs to their
2669  * %XX versions). This function returns a new allocated string or NULL if an
2670  * error occurred.
2671  */
2672 CURL_EXTERN char *curl_easy_escape(CURL *handle,
2673                                    const char *string,
2674                                    int length);
2675 
2676 /* the previous version: */
2677 CURL_EXTERN char *curl_escape(const char *string,
2678                               int length);
2679 
2680 
2681 /*
2682  * NAME curl_easy_unescape()
2683  *
2684  * DESCRIPTION
2685  *
2686  * Unescapes URL encoding in strings (converts all %XX codes to their 8bit
2687  * versions). This function returns a new allocated string or NULL if an error
2688  * occurred.
2689  * Conversion Note: On non-ASCII platforms the ASCII %XX codes are
2690  * converted into the host encoding.
2691  */
2692 CURL_EXTERN char *curl_easy_unescape(CURL *handle,
2693                                      const char *string,
2694                                      int length,
2695                                      int *outlength);
2696 
2697 /* the previous version */
2698 CURL_EXTERN char *curl_unescape(const char *string,
2699                                 int length);
2700 
2701 /*
2702  * NAME curl_free()
2703  *
2704  * DESCRIPTION
2705  *
2706  * Provided for de-allocation in the same translation unit that did the
2707  * allocation. Added in libcurl 7.10
2708  */
2709 CURL_EXTERN void curl_free(void *p);
2710 
2711 /*
2712  * NAME curl_global_init()
2713  *
2714  * DESCRIPTION
2715  *
2716  * curl_global_init() should be invoked exactly once for each application that
2717  * uses libcurl and before any call of other libcurl functions.
2718 
2719  * This function is thread-safe if CURL_VERSION_THREADSAFE is set in the
2720  * curl_version_info_data.features flag (fetch by curl_version_info()).
2721 
2722  */
2723 CURL_EXTERN CURLcode curl_global_init(long flags);
2724 
2725 /*
2726  * NAME curl_global_init_mem()
2727  *
2728  * DESCRIPTION
2729  *
2730  * curl_global_init() or curl_global_init_mem() should be invoked exactly once
2731  * for each application that uses libcurl.  This function can be used to
2732  * initialize libcurl and set user defined memory management callback
2733  * functions.  Users can implement memory management routines to check for
2734  * memory leaks, check for mis-use of the curl library etc.  User registered
2735  * callback routines will be invoked by this library instead of the system
2736  * memory management routines like malloc, free etc.
2737  */
2738 CURL_EXTERN CURLcode curl_global_init_mem(long flags,
2739                                           curl_malloc_callback m,
2740                                           curl_free_callback f,
2741                                           curl_realloc_callback r,
2742                                           curl_strdup_callback s,
2743                                           curl_calloc_callback c);
2744 
2745 /*
2746  * NAME curl_global_cleanup()
2747  *
2748  * DESCRIPTION
2749  *
2750  * curl_global_cleanup() should be invoked exactly once for each application
2751  * that uses libcurl
2752  */
2753 CURL_EXTERN void curl_global_cleanup(void);
2754 
2755 /*
2756  * NAME curl_global_trace()
2757  *
2758  * DESCRIPTION
2759  *
2760  * curl_global_trace() can be invoked at application start to
2761  * configure which components in curl should participate in tracing.
2762 
2763  * This function is thread-safe if CURL_VERSION_THREADSAFE is set in the
2764  * curl_version_info_data.features flag (fetch by curl_version_info()).
2765 
2766  */
2767 CURL_EXTERN CURLcode curl_global_trace(const char *config);
2768 
2769 /* linked-list structure for the CURLOPT_QUOTE option (and other) */
2770 struct curl_slist {
2771   char *data;
2772   struct curl_slist *next;
2773 };
2774 
2775 /*
2776  * NAME curl_global_sslset()
2777  *
2778  * DESCRIPTION
2779  *
2780  * When built with multiple SSL backends, curl_global_sslset() allows to
2781  * choose one. This function can only be called once, and it must be called
2782  * *before* curl_global_init().
2783  *
2784  * The backend can be identified by the id (e.g. CURLSSLBACKEND_OPENSSL). The
2785  * backend can also be specified via the name parameter (passing -1 as id).
2786  * If both id and name are specified, the name will be ignored. If neither id
2787  * nor name are specified, the function will fail with
2788  * CURLSSLSET_UNKNOWN_BACKEND and set the "avail" pointer to the
2789  * NULL-terminated list of available backends.
2790  *
2791  * Upon success, the function returns CURLSSLSET_OK.
2792  *
2793  * If the specified SSL backend is not available, the function returns
2794  * CURLSSLSET_UNKNOWN_BACKEND and sets the "avail" pointer to a NULL-terminated
2795  * list of available SSL backends.
2796  *
2797  * The SSL backend can be set only once. If it has already been set, a
2798  * subsequent attempt to change it will result in a CURLSSLSET_TOO_LATE.
2799  */
2800 
2801 struct curl_ssl_backend {
2802   curl_sslbackend id;
2803   const char *name;
2804 };
2805 typedef struct curl_ssl_backend curl_ssl_backend;
2806 
2807 typedef enum {
2808   CURLSSLSET_OK = 0,
2809   CURLSSLSET_UNKNOWN_BACKEND,
2810   CURLSSLSET_TOO_LATE,
2811   CURLSSLSET_NO_BACKENDS /* libcurl was built without any SSL support */
2812 } CURLsslset;
2813 
2814 CURL_EXTERN CURLsslset curl_global_sslset(curl_sslbackend id, const char *name,
2815                                           const curl_ssl_backend ***avail);
2816 
2817 /*
2818  * NAME curl_slist_append()
2819  *
2820  * DESCRIPTION
2821  *
2822  * Appends a string to a linked list. If no list exists, it will be created
2823  * first. Returns the new list, after appending.
2824  */
2825 CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *list,
2826                                                  const char *data);
2827 
2828 /*
2829  * NAME curl_slist_free_all()
2830  *
2831  * DESCRIPTION
2832  *
2833  * free a previously built curl_slist.
2834  */
2835 CURL_EXTERN void curl_slist_free_all(struct curl_slist *list);
2836 
2837 /*
2838  * NAME curl_getdate()
2839  *
2840  * DESCRIPTION
2841  *
2842  * Returns the time, in seconds since 1 Jan 1970 of the time string given in
2843  * the first argument. The time argument in the second parameter is unused
2844  * and should be set to NULL.
2845  */
2846 CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
2847 
2848 /* info about the certificate chain, for SSL backends that support it. Asked
2849    for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
2850 struct curl_certinfo {
2851   int num_of_certs;             /* number of certificates with information */
2852   struct curl_slist **certinfo; /* for each index in this array, there's a
2853                                    linked list with textual information for a
2854                                    certificate in the format "name:content".
2855                                    eg "Subject:foo", "Issuer:bar", etc. */
2856 };
2857 
2858 /* Information about the SSL library used and the respective internal SSL
2859    handle, which can be used to obtain further information regarding the
2860    connection. Asked for with CURLINFO_TLS_SSL_PTR or CURLINFO_TLS_SESSION. */
2861 struct curl_tlssessioninfo {
2862   curl_sslbackend backend;
2863   void *internals;
2864 };
2865 
2866 #define CURLINFO_STRING   0x100000
2867 #define CURLINFO_LONG     0x200000
2868 #define CURLINFO_DOUBLE   0x300000
2869 #define CURLINFO_SLIST    0x400000
2870 #define CURLINFO_PTR      0x400000 /* same as SLIST */
2871 #define CURLINFO_SOCKET   0x500000
2872 #define CURLINFO_OFF_T    0x600000
2873 #define CURLINFO_P_STRING 0xe00000
2874 #define CURLINFO_MASK     0x0fffff
2875 #define CURLINFO_TYPEMASK 0xf00000
2876 
2877 typedef enum {
2878   CURLINFO_NONE, /* first, never use this */
2879   CURLINFO_EFFECTIVE_URL    = CURLINFO_STRING + 1,
2880   CURLINFO_RESPONSE_CODE    = CURLINFO_LONG   + 2,
2881   CURLINFO_TOTAL_TIME       = CURLINFO_DOUBLE + 3,
2882   CURLINFO_NAMELOOKUP_TIME  = CURLINFO_DOUBLE + 4,
2883   CURLINFO_CONNECT_TIME     = CURLINFO_DOUBLE + 5,
2884   CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
2885   CURLINFO_SIZE_UPLOAD CURL_DEPRECATED(7.55.0, "Use CURLINFO_SIZE_UPLOAD_T")
2886                             = CURLINFO_DOUBLE + 7,
2887   CURLINFO_SIZE_UPLOAD_T    = CURLINFO_OFF_T  + 7,
2888   CURLINFO_SIZE_DOWNLOAD
2889                        CURL_DEPRECATED(7.55.0, "Use CURLINFO_SIZE_DOWNLOAD_T")
2890                             = CURLINFO_DOUBLE + 8,
2891   CURLINFO_SIZE_DOWNLOAD_T  = CURLINFO_OFF_T  + 8,
2892   CURLINFO_SPEED_DOWNLOAD
2893                        CURL_DEPRECATED(7.55.0, "Use CURLINFO_SPEED_DOWNLOAD_T")
2894                             = CURLINFO_DOUBLE + 9,
2895   CURLINFO_SPEED_DOWNLOAD_T = CURLINFO_OFF_T  + 9,
2896   CURLINFO_SPEED_UPLOAD
2897                        CURL_DEPRECATED(7.55.0, "Use CURLINFO_SPEED_UPLOAD_T")
2898                             = CURLINFO_DOUBLE + 10,
2899   CURLINFO_SPEED_UPLOAD_T   = CURLINFO_OFF_T  + 10,
2900   CURLINFO_HEADER_SIZE      = CURLINFO_LONG   + 11,
2901   CURLINFO_REQUEST_SIZE     = CURLINFO_LONG   + 12,
2902   CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG   + 13,
2903   CURLINFO_FILETIME         = CURLINFO_LONG   + 14,
2904   CURLINFO_FILETIME_T       = CURLINFO_OFF_T  + 14,
2905   CURLINFO_CONTENT_LENGTH_DOWNLOAD
2906                        CURL_DEPRECATED(7.55.0,
2907                                       "Use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T")
2908                             = CURLINFO_DOUBLE + 15,
2909   CURLINFO_CONTENT_LENGTH_DOWNLOAD_T = CURLINFO_OFF_T  + 15,
2910   CURLINFO_CONTENT_LENGTH_UPLOAD
2911                        CURL_DEPRECATED(7.55.0,
2912                                        "Use CURLINFO_CONTENT_LENGTH_UPLOAD_T")
2913                             = CURLINFO_DOUBLE + 16,
2914   CURLINFO_CONTENT_LENGTH_UPLOAD_T   = CURLINFO_OFF_T  + 16,
2915   CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
2916   CURLINFO_CONTENT_TYPE     = CURLINFO_STRING + 18,
2917   CURLINFO_REDIRECT_TIME    = CURLINFO_DOUBLE + 19,
2918   CURLINFO_REDIRECT_COUNT   = CURLINFO_LONG   + 20,
2919   CURLINFO_PRIVATE          = CURLINFO_STRING + 21,
2920   CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG   + 22,
2921   CURLINFO_HTTPAUTH_AVAIL   = CURLINFO_LONG   + 23,
2922   CURLINFO_PROXYAUTH_AVAIL  = CURLINFO_LONG   + 24,
2923   CURLINFO_OS_ERRNO         = CURLINFO_LONG   + 25,
2924   CURLINFO_NUM_CONNECTS     = CURLINFO_LONG   + 26,
2925   CURLINFO_SSL_ENGINES      = CURLINFO_SLIST  + 27,
2926   CURLINFO_COOKIELIST       = CURLINFO_SLIST  + 28,
2927   CURLINFO_LASTSOCKET  CURL_DEPRECATED(7.45.0, "Use CURLINFO_ACTIVESOCKET")
2928                             = CURLINFO_LONG   + 29,
2929   CURLINFO_FTP_ENTRY_PATH   = CURLINFO_STRING + 30,
2930   CURLINFO_REDIRECT_URL     = CURLINFO_STRING + 31,
2931   CURLINFO_PRIMARY_IP       = CURLINFO_STRING + 32,
2932   CURLINFO_APPCONNECT_TIME  = CURLINFO_DOUBLE + 33,
2933   CURLINFO_CERTINFO         = CURLINFO_PTR    + 34,
2934   CURLINFO_CONDITION_UNMET  = CURLINFO_LONG   + 35,
2935   CURLINFO_RTSP_SESSION_ID  = CURLINFO_STRING + 36,
2936   CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG   + 37,
2937   CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG   + 38,
2938   CURLINFO_RTSP_CSEQ_RECV   = CURLINFO_LONG   + 39,
2939   CURLINFO_PRIMARY_PORT     = CURLINFO_LONG   + 40,
2940   CURLINFO_LOCAL_IP         = CURLINFO_STRING + 41,
2941   CURLINFO_LOCAL_PORT       = CURLINFO_LONG   + 42,
2942   CURLINFO_TLS_SESSION CURL_DEPRECATED(7.48.0, "Use CURLINFO_TLS_SSL_PTR")
2943                             = CURLINFO_PTR    + 43,
2944   CURLINFO_ACTIVESOCKET     = CURLINFO_SOCKET + 44,
2945   CURLINFO_TLS_SSL_PTR      = CURLINFO_PTR    + 45,
2946   CURLINFO_HTTP_VERSION     = CURLINFO_LONG   + 46,
2947   CURLINFO_PROXY_SSL_VERIFYRESULT = CURLINFO_LONG + 47,
2948   CURLINFO_PROTOCOL    CURL_DEPRECATED(7.85.0, "Use CURLINFO_SCHEME")
2949                             = CURLINFO_LONG   + 48,
2950   CURLINFO_SCHEME           = CURLINFO_STRING + 49,
2951   CURLINFO_TOTAL_TIME_T     = CURLINFO_OFF_T + 50,
2952   CURLINFO_NAMELOOKUP_TIME_T = CURLINFO_OFF_T + 51,
2953   CURLINFO_CONNECT_TIME_T   = CURLINFO_OFF_T + 52,
2954   CURLINFO_PRETRANSFER_TIME_T = CURLINFO_OFF_T + 53,
2955   CURLINFO_STARTTRANSFER_TIME_T = CURLINFO_OFF_T + 54,
2956   CURLINFO_REDIRECT_TIME_T  = CURLINFO_OFF_T + 55,
2957   CURLINFO_APPCONNECT_TIME_T = CURLINFO_OFF_T + 56,
2958   CURLINFO_RETRY_AFTER      = CURLINFO_OFF_T + 57,
2959   CURLINFO_EFFECTIVE_METHOD = CURLINFO_STRING + 58,
2960   CURLINFO_PROXY_ERROR      = CURLINFO_LONG + 59,
2961   CURLINFO_REFERER          = CURLINFO_STRING + 60,
2962   CURLINFO_CAINFO           = CURLINFO_STRING + 61,
2963   CURLINFO_CAPATH           = CURLINFO_STRING + 62,
2964   CURLINFO_XFER_ID          = CURLINFO_OFF_T + 63,
2965   CURLINFO_CONN_ID          = CURLINFO_OFF_T + 64,
2966   CURLINFO_QUEUE_TIME_T     = CURLINFO_OFF_T + 65,
2967   CURLINFO_SSL_ERROR        = CURLINFO_STRING + 999,
2968   CURLINFO_MIN_TLS_VERSION  = CURLINFO_LONG + 1000,
2969   CURLINFO_MAX_TLS_VERSION  = CURLINFO_LONG + 1001,
2970   CURLINFO_CIPHER_NUM       = CURLINFO_LONG + 1002,
2971   CURLINFO_CIPHERS          = CURLINFO_P_STRING + 1003,
2972   CURLINFO_LAST_POLLIN_TIME           = CURLINFO_LONG + 1004,
2973   CURLINFO_LAST_OS_POLLIN_TIME        = CURLINFO_LONG + 1005,
2974   CURLINFO_LAST_POLLOUT_TIME          = CURLINFO_LONG + 1006,
2975   CURLINFO_LAST_OS_POLLOUT_TIME       = CURLINFO_LONG + 1007,
2976   CURLINFO_LAST_SSL_RECV_SIZE         = CURLINFO_LONG + 1008,
2977   CURLINFO_LAST_SSL_SEND_SIZE         = CURLINFO_LONG + 1009,
2978   CURLINFO_TOTAL_SSL_RECV_SIZE        = CURLINFO_LONG + 1010,
2979   CURLINFO_TOTAL_SSL_SEND_SIZE        = CURLINFO_LONG + 1011,
2980   CURLINFO_LAST_RECV_SSL_ERROR        = CURLINFO_STRING + 1012,
2981   CURLINFO_LAST_SEND_SSL_ERROR        = CURLINFO_STRING + 1013,
2982   CURLINFO_LAST_RECV_ERRNO            = CURLINFO_LONG + 1014,
2983   CURLINFO_LAST_SEND_ERRNO            = CURLINFO_LONG + 1015,
2984   CURLINFO_SSL_CONNECT_ERRNO          = CURLINFO_LONG + 1016,
2985   CURLINFO_TCP_CONNECT_ERRNO          = CURLINFO_LONG + 1017,
2986   CURLINFO_USED_PROXY       = CURLINFO_LONG + 66,
2987   CURLINFO_LASTONE          = 66
2988 } CURLINFO;
2989 
2990 /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
2991    CURLINFO_HTTP_CODE */
2992 #define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
2993 
2994 typedef enum {
2995   CURLCLOSEPOLICY_NONE, /* first, never use this */
2996 
2997   CURLCLOSEPOLICY_OLDEST,
2998   CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
2999   CURLCLOSEPOLICY_LEAST_TRAFFIC,
3000   CURLCLOSEPOLICY_SLOWEST,
3001   CURLCLOSEPOLICY_CALLBACK,
3002 
3003   CURLCLOSEPOLICY_LAST /* last, never use this */
3004 } curl_closepolicy;
3005 
3006 #define CURL_GLOBAL_SSL (1<<0) /* no purpose since 7.57.0 */
3007 #define CURL_GLOBAL_WIN32 (1<<1)
3008 #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
3009 #define CURL_GLOBAL_NOTHING 0
3010 #define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
3011 #define CURL_GLOBAL_ACK_EINTR (1<<2)
3012 
3013 
3014 /*****************************************************************************
3015  * Setup defines, protos etc for the sharing stuff.
3016  */
3017 
3018 /* Different data locks for a single share */
3019 typedef enum {
3020   CURL_LOCK_DATA_NONE = 0,
3021   /*  CURL_LOCK_DATA_SHARE is used internally to say that
3022    *  the locking is just made to change the internal state of the share
3023    *  itself.
3024    */
3025   CURL_LOCK_DATA_SHARE,
3026   CURL_LOCK_DATA_COOKIE,
3027   CURL_LOCK_DATA_DNS,
3028   CURL_LOCK_DATA_SSL_SESSION,
3029   CURL_LOCK_DATA_CONNECT,
3030   CURL_LOCK_DATA_PSL,
3031   CURL_LOCK_DATA_HSTS,
3032   CURL_LOCK_DATA_LAST
3033 } curl_lock_data;
3034 
3035 /* Different lock access types */
3036 typedef enum {
3037   CURL_LOCK_ACCESS_NONE = 0,   /* unspecified action */
3038   CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
3039   CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
3040   CURL_LOCK_ACCESS_LAST        /* never use */
3041 } curl_lock_access;
3042 
3043 typedef void (*curl_lock_function)(CURL *handle,
3044                                    curl_lock_data data,
3045                                    curl_lock_access locktype,
3046                                    void *userptr);
3047 typedef void (*curl_unlock_function)(CURL *handle,
3048                                      curl_lock_data data,
3049                                      void *userptr);
3050 
3051 
3052 typedef enum {
3053   CURLSHE_OK,  /* all is fine */
3054   CURLSHE_BAD_OPTION, /* 1 */
3055   CURLSHE_IN_USE,     /* 2 */
3056   CURLSHE_INVALID,    /* 3 */
3057   CURLSHE_NOMEM,      /* 4 out of memory */
3058   CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */
3059   CURLSHE_LAST        /* never use */
3060 } CURLSHcode;
3061 
3062 typedef enum {
3063   CURLSHOPT_NONE,  /* don't use */
3064   CURLSHOPT_SHARE,   /* specify a data type to share */
3065   CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
3066   CURLSHOPT_LOCKFUNC,   /* pass in a 'curl_lock_function' pointer */
3067   CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
3068   CURLSHOPT_USERDATA,   /* pass in a user data pointer used in the lock/unlock
3069                            callback functions */
3070   CURLSHOPT_LAST  /* never use */
3071 } CURLSHoption;
3072 
3073 CURL_EXTERN CURLSH *curl_share_init(void);
3074 CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option,
3075                                          ...);
3076 CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *share);
3077 
3078 /****************************************************************************
3079  * Structures for querying information about the curl library at runtime.
3080  */
3081 
3082 typedef enum {
3083   CURLVERSION_FIRST,    /* 7.10 */
3084   CURLVERSION_SECOND,   /* 7.11.1 */
3085   CURLVERSION_THIRD,    /* 7.12.0 */
3086   CURLVERSION_FOURTH,   /* 7.16.1 */
3087   CURLVERSION_FIFTH,    /* 7.57.0 */
3088   CURLVERSION_SIXTH,    /* 7.66.0 */
3089   CURLVERSION_SEVENTH,  /* 7.70.0 */
3090   CURLVERSION_EIGHTH,   /* 7.72.0 */
3091   CURLVERSION_NINTH,    /* 7.75.0 */
3092   CURLVERSION_TENTH,    /* 7.77.0 */
3093   CURLVERSION_ELEVENTH, /* 7.87.0 */
3094   CURLVERSION_TWELFTH,  /* 8.8.0 */
3095   CURLVERSION_LAST /* never actually use this */
3096 } CURLversion;
3097 
3098 /* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
3099    basically all programs ever that want to get version information. It is
3100    meant to be a built-in version number for what kind of struct the caller
3101    expects. If the struct ever changes, we redefine the NOW to another enum
3102    from above. */
3103 #define CURLVERSION_NOW CURLVERSION_TWELFTH
3104 
3105 struct curl_version_info_data {
3106   CURLversion age;          /* age of the returned struct */
3107   const char *version;      /* LIBCURL_VERSION */
3108   unsigned int version_num; /* LIBCURL_VERSION_NUM */
3109   const char *host;         /* OS/host/cpu/machine when configured */
3110   int features;             /* bitmask, see defines below */
3111   const char *ssl_version;  /* human readable string */
3112   long ssl_version_num;     /* not used anymore, always 0 */
3113   const char *libz_version; /* human readable string */
3114   /* protocols is terminated by an entry with a NULL protoname */
3115   const char * const *protocols;
3116 
3117   /* The fields below this were added in CURLVERSION_SECOND */
3118   const char *ares;
3119   int ares_num;
3120 
3121   /* This field was added in CURLVERSION_THIRD */
3122   const char *libidn;
3123 
3124   /* These field were added in CURLVERSION_FOURTH */
3125 
3126   /* Same as '_libiconv_version' if built with HAVE_ICONV */
3127   int iconv_ver_num;
3128 
3129   const char *libssh_version; /* human readable string */
3130 
3131   /* These fields were added in CURLVERSION_FIFTH */
3132   unsigned int brotli_ver_num; /* Numeric Brotli version
3133                                   (MAJOR << 24) | (MINOR << 12) | PATCH */
3134   const char *brotli_version; /* human readable string. */
3135 
3136   /* These fields were added in CURLVERSION_SIXTH */
3137   unsigned int nghttp2_ver_num; /* Numeric nghttp2 version
3138                                    (MAJOR << 16) | (MINOR << 8) | PATCH */
3139   const char *nghttp2_version; /* human readable string. */
3140   const char *quic_version;    /* human readable quic (+ HTTP/3) library +
3141                                   version or NULL */
3142 
3143   /* These fields were added in CURLVERSION_SEVENTH */
3144   const char *cainfo;          /* the built-in default CURLOPT_CAINFO, might
3145                                   be NULL */
3146   const char *capath;          /* the built-in default CURLOPT_CAPATH, might
3147                                   be NULL */
3148 
3149   /* These fields were added in CURLVERSION_EIGHTH */
3150   unsigned int zstd_ver_num; /* Numeric Zstd version
3151                                   (MAJOR << 24) | (MINOR << 12) | PATCH */
3152   const char *zstd_version; /* human readable string. */
3153 
3154   /* These fields were added in CURLVERSION_NINTH */
3155   const char *hyper_version; /* human readable string. */
3156 
3157   /* These fields were added in CURLVERSION_TENTH */
3158   const char *gsasl_version; /* human readable string. */
3159 
3160   /* These fields were added in CURLVERSION_ELEVENTH */
3161   /* feature_names is terminated by an entry with a NULL feature name */
3162   const char * const *feature_names;
3163 
3164   /* These fields were added in CURLVERSION_TWELFTH */
3165   const char *rtmp_version; /* human readable string. */
3166 };
3167 typedef struct curl_version_info_data curl_version_info_data;
3168 
3169 #define CURL_VERSION_IPV6         (1<<0)  /* IPv6-enabled */
3170 #define CURL_VERSION_KERBEROS4    (1<<1)  /* Kerberos V4 auth is supported
3171                                              (deprecated) */
3172 #define CURL_VERSION_SSL          (1<<2)  /* SSL options are present */
3173 #define CURL_VERSION_LIBZ         (1<<3)  /* libz features are present */
3174 #define CURL_VERSION_NTLM         (1<<4)  /* NTLM auth is supported */
3175 #define CURL_VERSION_GSSNEGOTIATE (1<<5)  /* Negotiate auth is supported
3176                                              (deprecated) */
3177 #define CURL_VERSION_DEBUG        (1<<6)  /* Built with debug capabilities */
3178 #define CURL_VERSION_ASYNCHDNS    (1<<7)  /* Asynchronous DNS resolves */
3179 #define CURL_VERSION_SPNEGO       (1<<8)  /* SPNEGO auth is supported */
3180 #define CURL_VERSION_LARGEFILE    (1<<9)  /* Supports files larger than 2GB */
3181 #define CURL_VERSION_IDN          (1<<10) /* Internationized Domain Names are
3182                                              supported */
3183 #define CURL_VERSION_SSPI         (1<<11) /* Built against Windows SSPI */
3184 #define CURL_VERSION_CONV         (1<<12) /* Character conversions supported */
3185 #define CURL_VERSION_CURLDEBUG    (1<<13) /* Debug memory tracking supported */
3186 #define CURL_VERSION_TLSAUTH_SRP  (1<<14) /* TLS-SRP auth is supported */
3187 #define CURL_VERSION_NTLM_WB      (1<<15) /* NTLM delegation to winbind helper
3188                                              is supported */
3189 #define CURL_VERSION_HTTP2        (1<<16) /* HTTP2 support built-in */
3190 #define CURL_VERSION_GSSAPI       (1<<17) /* Built against a GSS-API library */
3191 #define CURL_VERSION_KERBEROS5    (1<<18) /* Kerberos V5 auth is supported */
3192 #define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */
3193 #define CURL_VERSION_PSL          (1<<20) /* Mozilla's Public Suffix List, used
3194                                              for cookie domain verification */
3195 #define CURL_VERSION_HTTPS_PROXY  (1<<21) /* HTTPS-proxy support built-in */
3196 #define CURL_VERSION_MULTI_SSL    (1<<22) /* Multiple SSL backends available */
3197 #define CURL_VERSION_BROTLI       (1<<23) /* Brotli features are present. */
3198 #define CURL_VERSION_ALTSVC       (1<<24) /* Alt-Svc handling built-in */
3199 #define CURL_VERSION_HTTP3        (1<<25) /* HTTP3 support built-in */
3200 #define CURL_VERSION_ZSTD         (1<<26) /* zstd features are present */
3201 #define CURL_VERSION_UNICODE      (1<<27) /* Unicode support on Windows */
3202 #define CURL_VERSION_HSTS         (1<<28) /* HSTS is supported */
3203 #define CURL_VERSION_GSASL        (1<<29) /* libgsasl is supported */
3204 #define CURL_VERSION_THREADSAFE   (1<<30) /* libcurl API is thread-safe */
3205 
3206 /*
3207  * NAME curl_version_info()
3208  *
3209  * DESCRIPTION
3210  *
3211  * This function returns a pointer to a static copy of the version info
3212  * struct. See above.
3213  */
3214 CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);
3215 
3216 /*
3217  * NAME curl_easy_strerror()
3218  *
3219  * DESCRIPTION
3220  *
3221  * The curl_easy_strerror function may be used to turn a CURLcode value
3222  * into the equivalent human readable error string.  This is useful
3223  * for printing meaningful error messages.
3224  */
3225 CURL_EXTERN const char *curl_easy_strerror(CURLcode);
3226 
3227 /*
3228  * NAME curl_share_strerror()
3229  *
3230  * DESCRIPTION
3231  *
3232  * The curl_share_strerror function may be used to turn a CURLSHcode value
3233  * into the equivalent human readable error string.  This is useful
3234  * for printing meaningful error messages.
3235  */
3236 CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
3237 
3238 /*
3239  * NAME curl_easy_pause()
3240  *
3241  * DESCRIPTION
3242  *
3243  * The curl_easy_pause function pauses or unpauses transfers. Select the new
3244  * state by setting the bitmask, use the convenience defines below.
3245  *
3246  */
3247 CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
3248 
3249 #define CURLPAUSE_RECV      (1<<0)
3250 #define CURLPAUSE_RECV_CONT (0)
3251 
3252 #define CURLPAUSE_SEND      (1<<2)
3253 #define CURLPAUSE_SEND_CONT (0)
3254 
3255 #define CURLPAUSE_ALL       (CURLPAUSE_RECV|CURLPAUSE_SEND)
3256 #define CURLPAUSE_CONT      (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)
3257 
3258 #ifdef  __cplusplus
3259 } /* end of extern "C" */
3260 #endif
3261 
3262 /* unfortunately, the easy.h and multi.h include files need options and info
3263   stuff before they can be included! */
3264 #include "easy.h" /* nothing in curl is fun without the easy stuff */
3265 #include "multi.h"
3266 #include "urlapi.h"
3267 #include "options.h"
3268 #include "header.h"
3269 #include "websockets.h"
3270 #include "mprintf.h"
3271 
3272 /* the typechecker doesn't work in C++ (yet) */
3273 #if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
3274     ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
3275     !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)
3276 #include "typecheck-gcc.h"
3277 #else
3278 #if defined(__STDC__) && (__STDC__ >= 1)
3279 /* This preprocessor magic that replaces a call with the exact same call is
3280    only done to make sure application authors pass exactly three arguments
3281    to these functions. */
3282 #define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
3283 #define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)
3284 #define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
3285 #define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
3286 #endif /* __STDC__ >= 1 */
3287 #endif /* gcc >= 4.3 && !__cplusplus && !CURL_DISABLE_TYPECHECK */
3288 
3289 #endif /* CURLINC_CURL_H */
3290