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