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