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