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