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