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(__GNUC__) && \
59  !defined(__CYGWIN__) || defined(__MINGW32__)
60#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
61/* The check above prevents the winsock2 inclusion if winsock.h already was
62   included, since they can't co-exist without problems */
63#include <winsock2.h>
64#include <ws2tcpip.h>
65#endif
66#else
67
68/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
69   libc5-based Linux systems. Only include it on system that are known to
70   require it! */
71#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
72    defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
73    defined(ANDROID) || \
74   (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
75#include <sys/select.h>
76#endif
77
78#ifndef _WIN32_WCE
79#include <sys/socket.h>
80#endif
81#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
82#include <sys/time.h>
83#endif
84#include <sys/types.h>
85#endif
86
87#ifdef __BEOS__
88#include <support/SupportDefs.h>
89#endif
90
91#ifdef  __cplusplus
92extern "C" {
93#endif
94
95typedef void CURL;
96
97/*
98 * Decorate exportable functions for Win32 and Symbian OS DLL linking.
99 * This avoids using a .def file for building libcurl.dll.
100 */
101#if (defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)) && \
102     !defined(CURL_STATICLIB)
103#if defined(BUILDING_LIBCURL)
104#define CURL_EXTERN  __declspec(dllexport)
105#else
106#define CURL_EXTERN  __declspec(dllimport)
107#endif
108#else
109
110#ifdef CURL_HIDDEN_SYMBOLS
111/*
112 * This definition is used to make external definitions visible in the
113 * shared library when symbols are hidden by default.  It makes no
114 * difference when compiling applications whether this is set or not,
115 * only when compiling the library.
116 */
117#define CURL_EXTERN CURL_EXTERN_SYMBOL
118#else
119#define CURL_EXTERN
120#endif
121#endif
122
123#ifndef curl_socket_typedef
124/* socket typedef */
125#ifdef WIN32
126typedef SOCKET curl_socket_t;
127#define CURL_SOCKET_BAD INVALID_SOCKET
128#else
129typedef int curl_socket_t;
130#define CURL_SOCKET_BAD -1
131#endif
132#define curl_socket_typedef
133#endif /* curl_socket_typedef */
134
135struct curl_httppost {
136  struct curl_httppost *next;       /* next entry in the list */
137  char *name;                       /* pointer to allocated name */
138  long namelength;                  /* length of name length */
139  char *contents;                   /* pointer to allocated data contents */
140  long contentslength;              /* length of contents field */
141  char *buffer;                     /* pointer to allocated buffer contents */
142  long bufferlength;                /* length of buffer field */
143  char *contenttype;                /* Content-Type */
144  struct curl_slist* contentheader; /* list of extra headers for this form */
145  struct curl_httppost *more;       /* if one field name has more than one
146                                       file, this link should link to following
147                                       files */
148  long flags;                       /* as defined below */
149#define HTTPPOST_FILENAME (1<<0)    /* specified content is a file name */
150#define HTTPPOST_READFILE (1<<1)    /* specified content is a file name */
151#define HTTPPOST_PTRNAME (1<<2)     /* name is only stored pointer
152                                       do not free in formfree */
153#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer
154                                       do not free in formfree */
155#define HTTPPOST_BUFFER (1<<4)      /* upload file from buffer */
156#define HTTPPOST_PTRBUFFER (1<<5)   /* upload file from pointer contents */
157#define HTTPPOST_CALLBACK (1<<6)    /* upload file contents by using the
158                                       regular read callback to get the data
159                                       and pass the given pointer as custom
160                                       pointer */
161
162  char *showfilename;               /* The file name to show. If not set, the
163                                       actual file name will be used (if this
164                                       is a file part) */
165  void *userp;                      /* custom pointer used for
166                                       HTTPPOST_CALLBACK posts */
167};
168
169typedef int (*curl_progress_callback)(void *clientp,
170                                      double dltotal,
171                                      double dlnow,
172                                      double ultotal,
173                                      double ulnow);
174
175#ifndef CURL_MAX_WRITE_SIZE
176  /* Tests have proven that 20K is a very bad buffer size for uploads on
177     Windows, while 16K for some odd reason performed a lot better.
178     We do the ifndef check to allow this value to easier be changed at build
179     time for those who feel adventurous. The practical minimum is about
180     400 bytes since libcurl uses a buffer of this size as a scratch area
181     (unrelated to network send operations). */
182#define CURL_MAX_WRITE_SIZE 16384
183#endif
184
185#ifndef CURL_MAX_HTTP_HEADER
186/* The only reason to have a max limit for this is to avoid the risk of a bad
187   server feeding libcurl with a never-ending header that will cause reallocs
188   infinitely */
189#define CURL_MAX_HTTP_HEADER (100*1024)
190#endif
191
192
193/* This is a magic return code for the write callback that, when returned,
194   will signal libcurl to pause receiving on the current transfer. */
195#define CURL_WRITEFUNC_PAUSE 0x10000001
196typedef size_t (*curl_write_callback)(char *buffer,
197                                      size_t size,
198                                      size_t nitems,
199                                      void *outstream);
200
201
202
203/* enumeration of file types */
204typedef enum {
205  CURLFILETYPE_FILE = 0,
206  CURLFILETYPE_DIRECTORY,
207  CURLFILETYPE_SYMLINK,
208  CURLFILETYPE_DEVICE_BLOCK,
209  CURLFILETYPE_DEVICE_CHAR,
210  CURLFILETYPE_NAMEDPIPE,
211  CURLFILETYPE_SOCKET,
212  CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */
213
214  CURLFILETYPE_UNKNOWN /* should never occur */
215} curlfiletype;
216
217#define CURLFINFOFLAG_KNOWN_FILENAME    (1<<0)
218#define CURLFINFOFLAG_KNOWN_FILETYPE    (1<<1)
219#define CURLFINFOFLAG_KNOWN_TIME        (1<<2)
220#define CURLFINFOFLAG_KNOWN_PERM        (1<<3)
221#define CURLFINFOFLAG_KNOWN_UID         (1<<4)
222#define CURLFINFOFLAG_KNOWN_GID         (1<<5)
223#define CURLFINFOFLAG_KNOWN_SIZE        (1<<6)
224#define CURLFINFOFLAG_KNOWN_HLINKCOUNT  (1<<7)
225
226/* Content of this structure depends on information which is known and is
227   achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man
228   page for callbacks returning this structure -- some fields are mandatory,
229   some others are optional. The FLAG field has special meaning. */
230struct curl_fileinfo {
231  char *filename;
232  curlfiletype filetype;
233  time_t time;
234  unsigned int perm;
235  int uid;
236  int gid;
237  curl_off_t size;
238  long int hardlinks;
239
240  struct {
241    /* If some of these fields is not NULL, it is a pointer to b_data. */
242    char *time;
243    char *perm;
244    char *user;
245    char *group;
246    char *target; /* pointer to the target filename of a symlink */
247  } strings;
248
249  unsigned int flags;
250
251  /* used internally */
252  char * b_data;
253  size_t b_size;
254  size_t b_used;
255};
256
257/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */
258#define CURL_CHUNK_BGN_FUNC_OK      0
259#define CURL_CHUNK_BGN_FUNC_FAIL    1 /* tell the lib to end the task */
260#define CURL_CHUNK_BGN_FUNC_SKIP    2 /* skip this chunk over */
261
262/* if splitting of data transfer is enabled, this callback is called before
263   download of an individual chunk started. Note that parameter "remains" works
264   only for FTP wildcard downloading (for now), otherwise is not used */
265typedef long (*curl_chunk_bgn_callback)(const void *transfer_info,
266                                        void *ptr,
267                                        int remains);
268
269/* return codes for CURLOPT_CHUNK_END_FUNCTION */
270#define CURL_CHUNK_END_FUNC_OK      0
271#define CURL_CHUNK_END_FUNC_FAIL    1 /* tell the lib to end the task */
272
273/* If splitting of data transfer is enabled this callback is called after
274   download of an individual chunk finished.
275   Note! After this callback was set then it have to be called FOR ALL chunks.
276   Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.
277   This is the reason why we don't need "transfer_info" parameter in this
278   callback and we are not interested in "remains" parameter too. */
279typedef long (*curl_chunk_end_callback)(void *ptr);
280
281/* return codes for FNMATCHFUNCTION */
282#define CURL_FNMATCHFUNC_MATCH    0 /* string corresponds to the pattern */
283#define CURL_FNMATCHFUNC_NOMATCH  1 /* pattern doesn't match the string */
284#define CURL_FNMATCHFUNC_FAIL     2 /* an error occurred */
285
286/* callback type for wildcard downloading pattern matching. If the
287   string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */
288typedef int (*curl_fnmatch_callback)(void *ptr,
289                                     const char *pattern,
290                                     const char *string);
291
292/* These are the return codes for the seek callbacks */
293#define CURL_SEEKFUNC_OK       0
294#define CURL_SEEKFUNC_FAIL     1 /* fail the entire transfer */
295#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so
296                                    libcurl might try other means instead */
297typedef int (*curl_seek_callback)(void *instream,
298                                  curl_off_t offset,
299                                  int origin); /* 'whence' */
300
301/* This is a return code for the read callback that, when returned, will
302   signal libcurl to immediately abort the current transfer. */
303#define CURL_READFUNC_ABORT 0x10000000
304/* This is a return code for the read callback that, when returned, will
305   signal libcurl to pause sending data on the current transfer. */
306#define CURL_READFUNC_PAUSE 0x10000001
307
308typedef size_t (*curl_read_callback)(char *buffer,
309                                      size_t size,
310                                      size_t nitems,
311                                      void *instream);
312
313typedef enum  {
314  CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
315  CURLSOCKTYPE_LAST   /* never use */
316} curlsocktype;
317
318/* The return code from the sockopt_callback can signal information back
319   to libcurl: */
320#define CURL_SOCKOPT_OK 0
321#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return
322                                CURLE_ABORTED_BY_CALLBACK */
323#define CURL_SOCKOPT_ALREADY_CONNECTED 2
324
325typedef int (*curl_sockopt_callback)(void *clientp,
326                                     curl_socket_t curlfd,
327                                     curlsocktype purpose);
328
329struct curl_sockaddr {
330  int family;
331  int socktype;
332  int protocol;
333  unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it
334                           turned really ugly and painful on the systems that
335                           lack this type */
336  struct sockaddr addr;
337};
338
339typedef curl_socket_t
340(*curl_opensocket_callback)(void *clientp,
341                            curlsocktype purpose,
342                            struct curl_sockaddr *address);
343
344typedef int
345(*curl_closesocket_callback)(void *clientp, curl_socket_t item);
346
347typedef enum {
348  CURLIOE_OK,            /* I/O operation successful */
349  CURLIOE_UNKNOWNCMD,    /* command was unknown to callback */
350  CURLIOE_FAILRESTART,   /* failed to restart the read */
351  CURLIOE_LAST           /* never use */
352} curlioerr;
353
354typedef enum  {
355  CURLIOCMD_NOP,         /* no operation */
356  CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
357  CURLIOCMD_LAST         /* never use */
358} curliocmd;
359
360typedef curlioerr (*curl_ioctl_callback)(CURL *handle,
361                                         int cmd,
362                                         void *clientp);
363
364/*
365 * The following typedef's are signatures of malloc, free, realloc, strdup and
366 * calloc respectively.  Function pointers of these types can be passed to the
367 * curl_global_init_mem() function to set user defined memory management
368 * callback routines.
369 */
370typedef void *(*curl_malloc_callback)(size_t size);
371typedef void (*curl_free_callback)(void *ptr);
372typedef void *(*curl_realloc_callback)(void *ptr, size_t size);
373typedef char *(*curl_strdup_callback)(const char *str);
374typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
375
376/* the kind of data that is passed to information_callback*/
377typedef enum {
378  CURLINFO_TEXT = 0,
379  CURLINFO_HEADER_IN,    /* 1 */
380  CURLINFO_HEADER_OUT,   /* 2 */
381  CURLINFO_DATA_IN,      /* 3 */
382  CURLINFO_DATA_OUT,     /* 4 */
383  CURLINFO_SSL_DATA_IN,  /* 5 */
384  CURLINFO_SSL_DATA_OUT, /* 6 */
385  CURLINFO_END
386} curl_infotype;
387
388typedef int (*curl_debug_callback)
389       (CURL *handle,      /* the handle/transfer this concerns */
390        curl_infotype type, /* what kind of data */
391        char *data,        /* points to the data */
392        size_t size,       /* size of the data pointed to */
393        void *userptr);    /* whatever the user please */
394
395/* All possible error codes from all sorts of curl functions. Future versions
396   may return other values, stay prepared.
397
398   Always add new return codes last. Never *EVER* remove any. The return
399   codes must remain the same!
400 */
401
402typedef enum {
403  CURLE_OK = 0,
404  CURLE_UNSUPPORTED_PROTOCOL,    /* 1 */
405  CURLE_FAILED_INIT,             /* 2 */
406  CURLE_URL_MALFORMAT,           /* 3 */
407  CURLE_NOT_BUILT_IN,            /* 4 - [was obsoleted in August 2007 for
408                                    7.17.0, reused in April 2011 for 7.21.5] */
409  CURLE_COULDNT_RESOLVE_PROXY,   /* 5 */
410  CURLE_COULDNT_RESOLVE_HOST,    /* 6 */
411  CURLE_COULDNT_CONNECT,         /* 7 */
412  CURLE_FTP_WEIRD_SERVER_REPLY,  /* 8 */
413  CURLE_REMOTE_ACCESS_DENIED,    /* 9 a service was denied by the server
414                                    due to lack of access - when login fails
415                                    this is not returned. */
416  CURLE_OBSOLETE10,              /* 10 - NOT USED */
417  CURLE_FTP_WEIRD_PASS_REPLY,    /* 11 */
418  CURLE_OBSOLETE12,              /* 12 - NOT USED */
419  CURLE_FTP_WEIRD_PASV_REPLY,    /* 13 */
420  CURLE_FTP_WEIRD_227_FORMAT,    /* 14 */
421  CURLE_FTP_CANT_GET_HOST,       /* 15 */
422  CURLE_OBSOLETE16,              /* 16 - NOT USED */
423  CURLE_FTP_COULDNT_SET_TYPE,    /* 17 */
424  CURLE_PARTIAL_FILE,            /* 18 */
425  CURLE_FTP_COULDNT_RETR_FILE,   /* 19 */
426  CURLE_OBSOLETE20,              /* 20 - NOT USED */
427  CURLE_QUOTE_ERROR,             /* 21 - quote command failure */
428  CURLE_HTTP_RETURNED_ERROR,     /* 22 */
429  CURLE_WRITE_ERROR,             /* 23 */
430  CURLE_OBSOLETE24,              /* 24 - NOT USED */
431  CURLE_UPLOAD_FAILED,           /* 25 - failed upload "command" */
432  CURLE_READ_ERROR,              /* 26 - couldn't open/read from file */
433  CURLE_OUT_OF_MEMORY,           /* 27 */
434  /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
435           instead of a memory allocation error if CURL_DOES_CONVERSIONS
436           is defined
437  */
438  CURLE_OPERATION_TIMEDOUT,      /* 28 - the timeout time was reached */
439  CURLE_OBSOLETE29,              /* 29 - NOT USED */
440  CURLE_FTP_PORT_FAILED,         /* 30 - FTP PORT operation failed */
441  CURLE_FTP_COULDNT_USE_REST,    /* 31 - the REST command failed */
442  CURLE_OBSOLETE32,              /* 32 - NOT USED */
443  CURLE_RANGE_ERROR,             /* 33 - RANGE "command" didn't work */
444  CURLE_HTTP_POST_ERROR,         /* 34 */
445  CURLE_SSL_CONNECT_ERROR,       /* 35 - wrong when connecting with SSL */
446  CURLE_BAD_DOWNLOAD_RESUME,     /* 36 - couldn't resume download */
447  CURLE_FILE_COULDNT_READ_FILE,  /* 37 */
448  CURLE_LDAP_CANNOT_BIND,        /* 38 */
449  CURLE_LDAP_SEARCH_FAILED,      /* 39 */
450  CURLE_OBSOLETE40,              /* 40 - NOT USED */
451  CURLE_FUNCTION_NOT_FOUND,      /* 41 */
452  CURLE_ABORTED_BY_CALLBACK,     /* 42 */
453  CURLE_BAD_FUNCTION_ARGUMENT,   /* 43 */
454  CURLE_OBSOLETE44,              /* 44 - NOT USED */
455  CURLE_INTERFACE_FAILED,        /* 45 - CURLOPT_INTERFACE failed */
456  CURLE_OBSOLETE46,              /* 46 - NOT USED */
457  CURLE_TOO_MANY_REDIRECTS ,     /* 47 - catch endless re-direct loops */
458  CURLE_UNKNOWN_OPTION,          /* 48 - User specified an unknown option */
459  CURLE_TELNET_OPTION_SYNTAX ,   /* 49 - Malformed telnet option */
460  CURLE_OBSOLETE50,              /* 50 - NOT USED */
461  CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
462                                     wasn't verified fine */
463  CURLE_GOT_NOTHING,             /* 52 - when this is a specific error */
464  CURLE_SSL_ENGINE_NOTFOUND,     /* 53 - SSL crypto engine not found */
465  CURLE_SSL_ENGINE_SETFAILED,    /* 54 - can not set SSL crypto engine as
466                                    default */
467  CURLE_SEND_ERROR,              /* 55 - failed sending network data */
468  CURLE_RECV_ERROR,              /* 56 - failure in receiving network data */
469  CURLE_OBSOLETE57,              /* 57 - NOT IN USE */
470  CURLE_SSL_CERTPROBLEM,         /* 58 - problem with the local certificate */
471  CURLE_SSL_CIPHER,              /* 59 - couldn't use specified cipher */
472  CURLE_SSL_CACERT,              /* 60 - problem with the CA cert (path?) */
473  CURLE_BAD_CONTENT_ENCODING,    /* 61 - Unrecognized/bad encoding */
474  CURLE_LDAP_INVALID_URL,        /* 62 - Invalid LDAP URL */
475  CURLE_FILESIZE_EXCEEDED,       /* 63 - Maximum file size exceeded */
476  CURLE_USE_SSL_FAILED,          /* 64 - Requested FTP SSL level failed */
477  CURLE_SEND_FAIL_REWIND,        /* 65 - Sending the data requires a rewind
478                                    that failed */
479  CURLE_SSL_ENGINE_INITFAILED,   /* 66 - failed to initialise ENGINE */
480  CURLE_LOGIN_DENIED,            /* 67 - user, password or similar was not
481                                    accepted and we failed to login */
482  CURLE_TFTP_NOTFOUND,           /* 68 - file not found on server */
483  CURLE_TFTP_PERM,               /* 69 - permission problem on server */
484  CURLE_REMOTE_DISK_FULL,        /* 70 - out of disk space on server */
485  CURLE_TFTP_ILLEGAL,            /* 71 - Illegal TFTP operation */
486  CURLE_TFTP_UNKNOWNID,          /* 72 - Unknown transfer ID */
487  CURLE_REMOTE_FILE_EXISTS,      /* 73 - File already exists */
488  CURLE_TFTP_NOSUCHUSER,         /* 74 - No such user */
489  CURLE_CONV_FAILED,             /* 75 - conversion failed */
490  CURLE_CONV_REQD,               /* 76 - caller must register conversion
491                                    callbacks using curl_easy_setopt options
492                                    CURLOPT_CONV_FROM_NETWORK_FUNCTION,
493                                    CURLOPT_CONV_TO_NETWORK_FUNCTION, and
494                                    CURLOPT_CONV_FROM_UTF8_FUNCTION */
495  CURLE_SSL_CACERT_BADFILE,      /* 77 - could not load CACERT file, missing
496                                    or wrong format */
497  CURLE_REMOTE_FILE_NOT_FOUND,   /* 78 - remote file not found */
498  CURLE_SSH,                     /* 79 - error from the SSH layer, somewhat
499                                    generic so the error message will be of
500                                    interest when this has happened */
501
502  CURLE_SSL_SHUTDOWN_FAILED,     /* 80 - Failed to shut down the SSL
503                                    connection */
504  CURLE_AGAIN,                   /* 81 - socket is not ready for send/recv,
505                                    wait till it's ready and try again (Added
506                                    in 7.18.2) */
507  CURLE_SSL_CRL_BADFILE,         /* 82 - could not load CRL file, missing or
508                                    wrong format (Added in 7.19.0) */
509  CURLE_SSL_ISSUER_ERROR,        /* 83 - Issuer check failed.  (Added in
510                                    7.19.0) */
511  CURLE_FTP_PRET_FAILED,         /* 84 - a PRET command failed */
512  CURLE_RTSP_CSEQ_ERROR,         /* 85 - mismatch of RTSP CSeq numbers */
513  CURLE_RTSP_SESSION_ERROR,      /* 86 - mismatch of RTSP Session Ids */
514  CURLE_FTP_BAD_FILE_LIST,       /* 87 - unable to parse FTP file list */
515  CURLE_CHUNK_FAILED,            /* 88 - chunk callback reported error */
516
517  CURL_LAST /* never use! */
518} CURLcode;
519
520#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
521                          the obsolete stuff removed! */
522
523/*  compatibility with older names */
524#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING
525
526/* The following were added in 7.21.5, April 2011 */
527#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION
528
529/* The following were added in 7.17.1 */
530/* These are scheduled to disappear by 2009 */
531#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION
532
533/* The following were added in 7.17.0 */
534/* These are scheduled to disappear by 2009 */
535#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */
536#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46
537#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44
538#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10
539#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16
540#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32
541#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29
542#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12
543#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20
544#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40
545#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24
546#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57
547#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN
548
549#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED
550#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE
551#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR
552#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL
553#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS
554#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR
555#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED
556
557/* The following were added earlier */
558
559#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT
560
561#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR
562#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED
563#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED
564
565#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
566#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
567
568/* This was the error code 50 in 7.7.3 and a few earlier versions, this
569   is no longer used by libcurl but is instead #defined here only to not
570   make programs break */
571#define CURLE_ALREADY_COMPLETE 99999
572
573#endif /*!CURL_NO_OLDIES*/
574
575/* This prototype applies to all conversion callbacks */
576typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
577
578typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl,    /* easy handle */
579                                          void *ssl_ctx, /* actually an
580                                                            OpenSSL SSL_CTX */
581                                          void *userptr);
582
583typedef enum {
584  CURLPROXY_HTTP = 0,   /* added in 7.10, new in 7.19.4 default is to use
585                           CONNECT HTTP/1.1 */
586  CURLPROXY_HTTP_1_0 = 1,   /* added in 7.19.4, force to use CONNECT
587                               HTTP/1.0  */
588  CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
589                           in 7.10 */
590  CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
591  CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
592  CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
593                                   host name rather than the IP address. added
594                                   in 7.18.0 */
595} curl_proxytype;  /* this enum was added in 7.10 */
596
597#define CURLAUTH_NONE         0       /* nothing */
598#define CURLAUTH_BASIC        (1<<0)  /* Basic (default) */
599#define CURLAUTH_DIGEST       (1<<1)  /* Digest */
600#define CURLAUTH_GSSNEGOTIATE (1<<2)  /* GSS-Negotiate */
601#define CURLAUTH_NTLM         (1<<3)  /* NTLM */
602#define CURLAUTH_DIGEST_IE    (1<<4)  /* Digest with IE flavour */
603#define CURLAUTH_ONLY         (1<<31) /* used together with a single other
604                                         type to force no auth or just that
605                                         single type */
606#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)  /* all fine types set */
607#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
608
609#define CURLSSH_AUTH_ANY       ~0     /* all types supported by the server */
610#define CURLSSH_AUTH_NONE      0      /* none allowed, silly but complete */
611#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */
612#define CURLSSH_AUTH_PASSWORD  (1<<1) /* password */
613#define CURLSSH_AUTH_HOST      (1<<2) /* host key files */
614#define CURLSSH_AUTH_KEYBOARD  (1<<3) /* keyboard interactive */
615#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
616
617#define CURL_ERROR_SIZE 256
618
619struct curl_khkey {
620  const char *key; /* points to a zero-terminated string encoded with base64
621                      if len is zero, otherwise to the "raw" data */
622  size_t len;
623  enum type {
624    CURLKHTYPE_UNKNOWN,
625    CURLKHTYPE_RSA1,
626    CURLKHTYPE_RSA,
627    CURLKHTYPE_DSS
628  } keytype;
629};
630
631/* this is the set of return values expected from the curl_sshkeycallback
632   callback */
633enum curl_khstat {
634  CURLKHSTAT_FINE_ADD_TO_FILE,
635  CURLKHSTAT_FINE,
636  CURLKHSTAT_REJECT, /* reject the connection, return an error */
637  CURLKHSTAT_DEFER,  /* do not accept it, but we can't answer right now so
638                        this causes a CURLE_DEFER error but otherwise the
639                        connection will be left intact etc */
640  CURLKHSTAT_LAST    /* not for use, only a marker for last-in-list */
641};
642
643/* this is the set of status codes pass in to the callback */
644enum curl_khmatch {
645  CURLKHMATCH_OK,       /* match */
646  CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
647  CURLKHMATCH_MISSING,  /* no matching host/key found */
648  CURLKHMATCH_LAST      /* not for use, only a marker for last-in-list */
649};
650
651typedef int
652  (*curl_sshkeycallback) (CURL *easy,     /* easy handle */
653                          const struct curl_khkey *knownkey, /* known */
654                          const struct curl_khkey *foundkey, /* found */
655                          enum curl_khmatch, /* libcurl's view on the keys */
656                          void *clientp); /* custom pointer passed from app */
657
658/* parameter for the CURLOPT_USE_SSL option */
659typedef enum {
660  CURLUSESSL_NONE,    /* do not attempt to use SSL */
661  CURLUSESSL_TRY,     /* try using SSL, proceed anyway otherwise */
662  CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
663  CURLUSESSL_ALL,     /* SSL for all communication or fail */
664  CURLUSESSL_LAST     /* not an option, never use */
665} curl_usessl;
666
667#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
668                          the obsolete stuff removed! */
669
670/* Backwards compatibility with older names */
671/* These are scheduled to disappear by 2009 */
672
673#define CURLFTPSSL_NONE CURLUSESSL_NONE
674#define CURLFTPSSL_TRY CURLUSESSL_TRY
675#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL
676#define CURLFTPSSL_ALL CURLUSESSL_ALL
677#define CURLFTPSSL_LAST CURLUSESSL_LAST
678#define curl_ftpssl curl_usessl
679#endif /*!CURL_NO_OLDIES*/
680
681/* parameter for the CURLOPT_FTP_SSL_CCC option */
682typedef enum {
683  CURLFTPSSL_CCC_NONE,    /* do not send CCC */
684  CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
685  CURLFTPSSL_CCC_ACTIVE,  /* Initiate the shutdown */
686  CURLFTPSSL_CCC_LAST     /* not an option, never use */
687} curl_ftpccc;
688
689/* parameter for the CURLOPT_FTPSSLAUTH option */
690typedef enum {
691  CURLFTPAUTH_DEFAULT, /* let libcurl decide */
692  CURLFTPAUTH_SSL,     /* use "AUTH SSL" */
693  CURLFTPAUTH_TLS,     /* use "AUTH TLS" */
694  CURLFTPAUTH_LAST /* not an option, never use */
695} curl_ftpauth;
696
697/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
698typedef enum {
699  CURLFTP_CREATE_DIR_NONE,  /* do NOT create missing dirs! */
700  CURLFTP_CREATE_DIR,       /* (FTP/SFTP) if CWD fails, try MKD and then CWD
701                               again if MKD succeeded, for SFTP this does
702                               similar magic */
703  CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
704                               again even if MKD failed! */
705  CURLFTP_CREATE_DIR_LAST   /* not an option, never use */
706} curl_ftpcreatedir;
707
708/* parameter for the CURLOPT_FTP_FILEMETHOD option */
709typedef enum {
710  CURLFTPMETHOD_DEFAULT,   /* let libcurl pick */
711  CURLFTPMETHOD_MULTICWD,  /* single CWD operation for each path part */
712  CURLFTPMETHOD_NOCWD,     /* no CWD at all */
713  CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
714  CURLFTPMETHOD_LAST       /* not an option, never use */
715} curl_ftpmethod;
716
717/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
718#define CURLPROTO_HTTP   (1<<0)
719#define CURLPROTO_HTTPS  (1<<1)
720#define CURLPROTO_FTP    (1<<2)
721#define CURLPROTO_FTPS   (1<<3)
722#define CURLPROTO_SCP    (1<<4)
723#define CURLPROTO_SFTP   (1<<5)
724#define CURLPROTO_TELNET (1<<6)
725#define CURLPROTO_LDAP   (1<<7)
726#define CURLPROTO_LDAPS  (1<<8)
727#define CURLPROTO_DICT   (1<<9)
728#define CURLPROTO_FILE   (1<<10)
729#define CURLPROTO_TFTP   (1<<11)
730#define CURLPROTO_IMAP   (1<<12)
731#define CURLPROTO_IMAPS  (1<<13)
732#define CURLPROTO_POP3   (1<<14)
733#define CURLPROTO_POP3S  (1<<15)
734#define CURLPROTO_SMTP   (1<<16)
735#define CURLPROTO_SMTPS  (1<<17)
736#define CURLPROTO_RTSP   (1<<18)
737#define CURLPROTO_RTMP   (1<<19)
738#define CURLPROTO_RTMPT  (1<<20)
739#define CURLPROTO_RTMPE  (1<<21)
740#define CURLPROTO_RTMPTE (1<<22)
741#define CURLPROTO_RTMPS  (1<<23)
742#define CURLPROTO_RTMPTS (1<<24)
743#define CURLPROTO_GOPHER (1<<25)
744#define CURLPROTO_ALL    (~0) /* enable everything */
745
746/* long may be 32 or 64 bits, but we should never depend on anything else
747   but 32 */
748#define CURLOPTTYPE_LONG          0
749#define CURLOPTTYPE_OBJECTPOINT   10000
750#define CURLOPTTYPE_FUNCTIONPOINT 20000
751#define CURLOPTTYPE_OFF_T         30000
752
753/* name is uppercase CURLOPT_<name>,
754   type is one of the defined CURLOPTTYPE_<type>
755   number is unique identifier */
756#ifdef CINIT
757#undef CINIT
758#endif
759
760#ifdef CURL_ISOCPP
761#define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu
762#else
763/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
764#define LONG          CURLOPTTYPE_LONG
765#define OBJECTPOINT   CURLOPTTYPE_OBJECTPOINT
766#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
767#define OFF_T         CURLOPTTYPE_OFF_T
768#define CINIT(name,type,number) CURLOPT_/**/name = type + number
769#endif
770
771/*
772 * This macro-mania below setups the CURLOPT_[what] enum, to be used with
773 * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]
774 * word.
775 */
776
777typedef enum {
778  /* This is the FILE * or void * the regular output should be written to. */
779  CINIT(FILE, OBJECTPOINT, 1),
780
781  /* The full URL to get/put */
782  CINIT(URL,  OBJECTPOINT, 2),
783
784  /* Port number to connect to, if other than default. */
785  CINIT(PORT, LONG, 3),
786
787  /* Name of proxy to use. */
788  CINIT(PROXY, OBJECTPOINT, 4),
789
790  /* "name:password" to use when fetching. */
791  CINIT(USERPWD, OBJECTPOINT, 5),
792
793  /* "name:password" to use with proxy. */
794  CINIT(PROXYUSERPWD, OBJECTPOINT, 6),
795
796  /* Range to get, specified as an ASCII string. */
797  CINIT(RANGE, OBJECTPOINT, 7),
798
799  /* not used */
800
801  /* Specified file stream to upload from (use as input): */
802  CINIT(INFILE, OBJECTPOINT, 9),
803
804  /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
805   * bytes big. If this is not used, error messages go to stderr instead: */
806  CINIT(ERRORBUFFER, OBJECTPOINT, 10),
807
808  /* Function that will be called to store the output (instead of fwrite). The
809   * parameters will use fwrite() syntax, make sure to follow them. */
810  CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
811
812  /* Function that will be called to read the input (instead of fread). The
813   * parameters will use fread() syntax, make sure to follow them. */
814  CINIT(READFUNCTION, FUNCTIONPOINT, 12),
815
816  /* Time-out the read operation after this amount of seconds */
817  CINIT(TIMEOUT, LONG, 13),
818
819  /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
820   * how large the file being sent really is. That allows better error
821   * checking and better verifies that the upload was successful. -1 means
822   * unknown size.
823   *
824   * For large file support, there is also a _LARGE version of the key
825   * which takes an off_t type, allowing platforms with larger off_t
826   * sizes to handle larger files.  See below for INFILESIZE_LARGE.
827   */
828  CINIT(INFILESIZE, LONG, 14),
829
830  /* POST static input fields. */
831  CINIT(POSTFIELDS, OBJECTPOINT, 15),
832
833  /* Set the referrer page (needed by some CGIs) */
834  CINIT(REFERER, OBJECTPOINT, 16),
835
836  /* Set the FTP PORT string (interface name, named or numerical IP address)
837     Use i.e '-' to use default address. */
838  CINIT(FTPPORT, OBJECTPOINT, 17),
839
840  /* Set the User-Agent string (examined by some CGIs) */
841  CINIT(USERAGENT, OBJECTPOINT, 18),
842
843  /* If the download receives less than "low speed limit" bytes/second
844   * during "low speed time" seconds, the operations is aborted.
845   * You could i.e if you have a pretty high speed connection, abort if
846   * it is less than 2000 bytes/sec during 20 seconds.
847   */
848
849  /* Set the "low speed limit" */
850  CINIT(LOW_SPEED_LIMIT, LONG, 19),
851
852  /* Set the "low speed time" */
853  CINIT(LOW_SPEED_TIME, LONG, 20),
854
855  /* Set the continuation offset.
856   *
857   * Note there is also a _LARGE version of this key which uses
858   * off_t types, allowing for large file offsets on platforms which
859   * use larger-than-32-bit off_t's.  Look below for RESUME_FROM_LARGE.
860   */
861  CINIT(RESUME_FROM, LONG, 21),
862
863  /* Set cookie in request: */
864  CINIT(COOKIE, OBJECTPOINT, 22),
865
866  /* This points to a linked list of headers, struct curl_slist kind */
867  CINIT(HTTPHEADER, OBJECTPOINT, 23),
868
869  /* This points to a linked list of post entries, struct curl_httppost */
870  CINIT(HTTPPOST, OBJECTPOINT, 24),
871
872  /* name of the file keeping your private SSL-certificate */
873  CINIT(SSLCERT, OBJECTPOINT, 25),
874
875  /* password for the SSL or SSH private key */
876  CINIT(KEYPASSWD, OBJECTPOINT, 26),
877
878  /* send TYPE parameter? */
879  CINIT(CRLF, LONG, 27),
880
881  /* send linked-list of QUOTE commands */
882  CINIT(QUOTE, OBJECTPOINT, 28),
883
884  /* send FILE * or void * to store headers to, if you use a callback it
885     is simply passed to the callback unmodified */
886  CINIT(WRITEHEADER, OBJECTPOINT, 29),
887
888  /* point to a file to read the initial cookies from, also enables
889     "cookie awareness" */
890  CINIT(COOKIEFILE, OBJECTPOINT, 31),
891
892  /* What version to specifically try to use.
893     See CURL_SSLVERSION defines below. */
894  CINIT(SSLVERSION, LONG, 32),
895
896  /* What kind of HTTP time condition to use, see defines */
897  CINIT(TIMECONDITION, LONG, 33),
898
899  /* Time to use with the above condition. Specified in number of seconds
900     since 1 Jan 1970 */
901  CINIT(TIMEVALUE, LONG, 34),
902
903  /* 35 = OBSOLETE */
904
905  /* Custom request, for customizing the get command like
906     HTTP: DELETE, TRACE and others
907     FTP: to use a different list command
908     */
909  CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),
910
911  /* HTTP request, for odd commands like DELETE, TRACE and others */
912  CINIT(STDERR, OBJECTPOINT, 37),
913
914  /* 38 is not used */
915
916  /* send linked-list of post-transfer QUOTE commands */
917  CINIT(POSTQUOTE, OBJECTPOINT, 39),
918
919  /* Pass a pointer to string of the output using full variable-replacement
920     as described elsewhere. */
921  CINIT(WRITEINFO, OBJECTPOINT, 40),
922
923  CINIT(VERBOSE, LONG, 41),      /* talk a lot */
924  CINIT(HEADER, LONG, 42),       /* throw the header out too */
925  CINIT(NOPROGRESS, LONG, 43),   /* shut off the progress meter */
926  CINIT(NOBODY, LONG, 44),       /* use HEAD to get http document */
927  CINIT(FAILONERROR, LONG, 45),  /* no output on http error codes >= 300 */
928  CINIT(UPLOAD, LONG, 46),       /* this is an upload */
929  CINIT(POST, LONG, 47),         /* HTTP POST method */
930  CINIT(DIRLISTONLY, LONG, 48),  /* bare names when listing directories */
931
932  CINIT(APPEND, LONG, 50),       /* Append instead of overwrite on upload! */
933
934  /* Specify whether to read the user+password from the .netrc or the URL.
935   * This must be one of the CURL_NETRC_* enums below. */
936  CINIT(NETRC, LONG, 51),
937
938  CINIT(FOLLOWLOCATION, LONG, 52),  /* use Location: Luke! */
939
940  CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
941  CINIT(PUT, LONG, 54),          /* HTTP PUT */
942
943  /* 55 = OBSOLETE */
944
945  /* Function that will be called instead of the internal progress display
946   * function. This function should be defined as the curl_progress_callback
947   * prototype defines. */
948  CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
949
950  /* Data passed to the progress callback */
951  CINIT(PROGRESSDATA, OBJECTPOINT, 57),
952
953  /* We want the referrer field set automatically when following locations */
954  CINIT(AUTOREFERER, LONG, 58),
955
956  /* Port of the proxy, can be set in the proxy string as well with:
957     "[host]:[port]" */
958  CINIT(PROXYPORT, LONG, 59),
959
960  /* size of the POST input data, if strlen() is not good to use */
961  CINIT(POSTFIELDSIZE, LONG, 60),
962
963  /* tunnel non-http operations through a HTTP proxy */
964  CINIT(HTTPPROXYTUNNEL, LONG, 61),
965
966  /* Set the interface string to use as outgoing network interface */
967  CINIT(INTERFACE, OBJECTPOINT, 62),
968
969  /* Set the krb4/5 security level, this also enables krb4/5 awareness.  This
970   * is a string, 'clear', 'safe', 'confidential' or 'private'.  If the string
971   * is set but doesn't match one of these, 'private' will be used.  */
972  CINIT(KRBLEVEL, OBJECTPOINT, 63),
973
974  /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
975  CINIT(SSL_VERIFYPEER, LONG, 64),
976
977  /* The CApath or CAfile used to validate the peer certificate
978     this option is used only if SSL_VERIFYPEER is true */
979  CINIT(CAINFO, OBJECTPOINT, 65),
980
981  /* 66 = OBSOLETE */
982  /* 67 = OBSOLETE */
983
984  /* Maximum number of http redirects to follow */
985  CINIT(MAXREDIRS, LONG, 68),
986
987  /* Pass a long set to 1 to get the date of the requested document (if
988     possible)! Pass a zero to shut it off. */
989  CINIT(FILETIME, LONG, 69),
990
991  /* This points to a linked list of telnet options */
992  CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
993
994  /* Max amount of cached alive connections */
995  CINIT(MAXCONNECTS, LONG, 71),
996
997  /* 72 - DEPRECATED */
998  CINIT(CLOSEPOLICY, LONG, 72),
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), /* To become OBSOLETE soon */
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  CURLOPT_LASTENTRY /* the last unused */
1487} CURLoption;
1488
1489#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
1490                          the obsolete stuff removed! */
1491
1492/* Backwards compatibility with older names */
1493/* These are scheduled to disappear by 2011 */
1494
1495/* This was added in version 7.19.1 */
1496#define CURLOPT_POST301 CURLOPT_POSTREDIR
1497
1498/* These are scheduled to disappear by 2009 */
1499
1500/* The following were added in 7.17.0 */
1501#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD
1502#define CURLOPT_FTPAPPEND CURLOPT_APPEND
1503#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY
1504#define CURLOPT_FTP_SSL CURLOPT_USE_SSL
1505
1506/* The following were added earlier */
1507
1508#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
1509#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
1510
1511#else
1512/* This is set if CURL_NO_OLDIES is defined at compile-time */
1513#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
1514#endif
1515
1516
1517  /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
1518     name resolves addresses using more than one IP protocol version, this
1519     option might be handy to force libcurl to use a specific IP version. */
1520#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP
1521                                     versions that your system allows */
1522#define CURL_IPRESOLVE_V4       1 /* resolve to ipv4 addresses */
1523#define CURL_IPRESOLVE_V6       2 /* resolve to ipv6 addresses */
1524
1525  /* three convenient "aliases" that follow the name scheme better */
1526#define CURLOPT_WRITEDATA CURLOPT_FILE
1527#define CURLOPT_READDATA  CURLOPT_INFILE
1528#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER
1529#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
1530
1531  /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
1532enum {
1533  CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
1534                             like the library to choose the best possible
1535                             for us! */
1536  CURL_HTTP_VERSION_1_0,  /* please use HTTP 1.0 in the request */
1537  CURL_HTTP_VERSION_1_1,  /* please use HTTP 1.1 in the request */
1538
1539  CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
1540};
1541
1542/*
1543 * Public API enums for RTSP requests
1544 */
1545enum {
1546    CURL_RTSPREQ_NONE, /* first in list */
1547    CURL_RTSPREQ_OPTIONS,
1548    CURL_RTSPREQ_DESCRIBE,
1549    CURL_RTSPREQ_ANNOUNCE,
1550    CURL_RTSPREQ_SETUP,
1551    CURL_RTSPREQ_PLAY,
1552    CURL_RTSPREQ_PAUSE,
1553    CURL_RTSPREQ_TEARDOWN,
1554    CURL_RTSPREQ_GET_PARAMETER,
1555    CURL_RTSPREQ_SET_PARAMETER,
1556    CURL_RTSPREQ_RECORD,
1557    CURL_RTSPREQ_RECEIVE,
1558    CURL_RTSPREQ_LAST /* last in list */
1559};
1560
1561  /* These enums are for use with the CURLOPT_NETRC option. */
1562enum CURL_NETRC_OPTION {
1563  CURL_NETRC_IGNORED,     /* The .netrc will never be read.
1564                           * This is the default. */
1565  CURL_NETRC_OPTIONAL,    /* A user:password in the URL will be preferred
1566                           * to one in the .netrc. */
1567  CURL_NETRC_REQUIRED,    /* A user:password in the URL will be ignored.
1568                           * Unless one is set programmatically, the .netrc
1569                           * will be queried. */
1570  CURL_NETRC_LAST
1571};
1572
1573enum {
1574  CURL_SSLVERSION_DEFAULT,
1575  CURL_SSLVERSION_TLSv1,
1576  CURL_SSLVERSION_SSLv2,
1577  CURL_SSLVERSION_SSLv3,
1578
1579  CURL_SSLVERSION_LAST /* never use, keep last */
1580};
1581
1582enum CURL_TLSAUTH {
1583  CURL_TLSAUTH_NONE,
1584  CURL_TLSAUTH_SRP,
1585  CURL_TLSAUTH_LAST /* never use, keep last */
1586};
1587
1588/* symbols to use with CURLOPT_POSTREDIR.
1589   CURL_REDIR_POST_301 and CURL_REDIR_POST_302 can be bitwise ORed so that
1590   CURL_REDIR_POST_301 | CURL_REDIR_POST_302 == CURL_REDIR_POST_ALL */
1591
1592#define CURL_REDIR_GET_ALL  0
1593#define CURL_REDIR_POST_301 1
1594#define CURL_REDIR_POST_302 2
1595#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302)
1596
1597typedef enum {
1598  CURL_TIMECOND_NONE,
1599
1600  CURL_TIMECOND_IFMODSINCE,
1601  CURL_TIMECOND_IFUNMODSINCE,
1602  CURL_TIMECOND_LASTMOD,
1603
1604  CURL_TIMECOND_LAST
1605} curl_TimeCond;
1606
1607
1608/* curl_strequal() and curl_strnequal() are subject for removal in a future
1609   libcurl, see lib/README.curlx for details */
1610CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2);
1611CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);
1612
1613/* name is uppercase CURLFORM_<name> */
1614#ifdef CFINIT
1615#undef CFINIT
1616#endif
1617
1618#ifdef CURL_ISOCPP
1619#define CFINIT(name) CURLFORM_ ## name
1620#else
1621/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
1622#define CFINIT(name) CURLFORM_/**/name
1623#endif
1624
1625typedef enum {
1626  CFINIT(NOTHING),        /********* the first one is unused ************/
1627
1628  /*  */
1629  CFINIT(COPYNAME),
1630  CFINIT(PTRNAME),
1631  CFINIT(NAMELENGTH),
1632  CFINIT(COPYCONTENTS),
1633  CFINIT(PTRCONTENTS),
1634  CFINIT(CONTENTSLENGTH),
1635  CFINIT(FILECONTENT),
1636  CFINIT(ARRAY),
1637  CFINIT(OBSOLETE),
1638  CFINIT(FILE),
1639
1640  CFINIT(BUFFER),
1641  CFINIT(BUFFERPTR),
1642  CFINIT(BUFFERLENGTH),
1643
1644  CFINIT(CONTENTTYPE),
1645  CFINIT(CONTENTHEADER),
1646  CFINIT(FILENAME),
1647  CFINIT(END),
1648  CFINIT(OBSOLETE2),
1649
1650  CFINIT(STREAM),
1651
1652  CURLFORM_LASTENTRY /* the last unused */
1653} CURLformoption;
1654
1655#undef CFINIT /* done */
1656
1657/* structure to be used as parameter for CURLFORM_ARRAY */
1658struct curl_forms {
1659  CURLformoption option;
1660  const char     *value;
1661};
1662
1663/* use this for multipart formpost building */
1664/* Returns code for curl_formadd()
1665 *
1666 * Returns:
1667 * CURL_FORMADD_OK             on success
1668 * CURL_FORMADD_MEMORY         if the FormInfo allocation fails
1669 * CURL_FORMADD_OPTION_TWICE   if one option is given twice for one Form
1670 * CURL_FORMADD_NULL           if a null pointer was given for a char
1671 * CURL_FORMADD_MEMORY         if the allocation of a FormInfo struct failed
1672 * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used
1673 * CURL_FORMADD_INCOMPLETE     if the some FormInfo is not complete (or error)
1674 * CURL_FORMADD_MEMORY         if a curl_httppost struct cannot be allocated
1675 * CURL_FORMADD_MEMORY         if some allocation for string copying failed.
1676 * CURL_FORMADD_ILLEGAL_ARRAY  if an illegal option is used in an array
1677 *
1678 ***************************************************************************/
1679typedef enum {
1680  CURL_FORMADD_OK, /* first, no error */
1681
1682  CURL_FORMADD_MEMORY,
1683  CURL_FORMADD_OPTION_TWICE,
1684  CURL_FORMADD_NULL,
1685  CURL_FORMADD_UNKNOWN_OPTION,
1686  CURL_FORMADD_INCOMPLETE,
1687  CURL_FORMADD_ILLEGAL_ARRAY,
1688  CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
1689
1690  CURL_FORMADD_LAST /* last */
1691} CURLFORMcode;
1692
1693/*
1694 * NAME curl_formadd()
1695 *
1696 * DESCRIPTION
1697 *
1698 * Pretty advanced function for building multi-part formposts. Each invoke
1699 * adds one part that together construct a full post. Then use
1700 * CURLOPT_HTTPPOST to send it off to libcurl.
1701 */
1702CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
1703                                      struct curl_httppost **last_post,
1704                                      ...);
1705
1706/*
1707 * callback function for curl_formget()
1708 * The void *arg pointer will be the one passed as second argument to
1709 *   curl_formget().
1710 * The character buffer passed to it must not be freed.
1711 * Should return the buffer length passed to it as the argument "len" on
1712 *   success.
1713 */
1714typedef size_t (*curl_formget_callback)(void *arg, const char *buf,
1715                                        size_t len);
1716
1717/*
1718 * NAME curl_formget()
1719 *
1720 * DESCRIPTION
1721 *
1722 * Serialize a curl_httppost struct built with curl_formadd().
1723 * Accepts a void pointer as second argument which will be passed to
1724 * the curl_formget_callback function.
1725 * Returns 0 on success.
1726 */
1727CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,
1728                             curl_formget_callback append);
1729/*
1730 * NAME curl_formfree()
1731 *
1732 * DESCRIPTION
1733 *
1734 * Free a multipart formpost previously built with curl_formadd().
1735 */
1736CURL_EXTERN void curl_formfree(struct curl_httppost *form);
1737
1738/*
1739 * NAME curl_getenv()
1740 *
1741 * DESCRIPTION
1742 *
1743 * Returns a malloc()'ed string that MUST be curl_free()ed after usage is
1744 * complete. DEPRECATED - see lib/README.curlx
1745 */
1746CURL_EXTERN char *curl_getenv(const char *variable);
1747
1748/*
1749 * NAME curl_version()
1750 *
1751 * DESCRIPTION
1752 *
1753 * Returns a static ascii string of the libcurl version.
1754 */
1755CURL_EXTERN char *curl_version(void);
1756
1757/*
1758 * NAME curl_easy_escape()
1759 *
1760 * DESCRIPTION
1761 *
1762 * Escapes URL strings (converts all letters consider illegal in URLs to their
1763 * %XX versions). This function returns a new allocated string or NULL if an
1764 * error occurred.
1765 */
1766CURL_EXTERN char *curl_easy_escape(CURL *handle,
1767                                   const char *string,
1768                                   int length);
1769
1770/* the previous version: */
1771CURL_EXTERN char *curl_escape(const char *string,
1772                              int length);
1773
1774
1775/*
1776 * NAME curl_easy_unescape()
1777 *
1778 * DESCRIPTION
1779 *
1780 * Unescapes URL encoding in strings (converts all %XX codes to their 8bit
1781 * versions). This function returns a new allocated string or NULL if an error
1782 * occurred.
1783 * Conversion Note: On non-ASCII platforms the ASCII %XX codes are
1784 * converted into the host encoding.
1785 */
1786CURL_EXTERN char *curl_easy_unescape(CURL *handle,
1787                                     const char *string,
1788                                     int length,
1789                                     int *outlength);
1790
1791/* the previous version */
1792CURL_EXTERN char *curl_unescape(const char *string,
1793                                int length);
1794
1795/*
1796 * NAME curl_free()
1797 *
1798 * DESCRIPTION
1799 *
1800 * Provided for de-allocation in the same translation unit that did the
1801 * allocation. Added in libcurl 7.10
1802 */
1803CURL_EXTERN void curl_free(void *p);
1804
1805/*
1806 * NAME curl_global_init()
1807 *
1808 * DESCRIPTION
1809 *
1810 * curl_global_init() should be invoked exactly once for each application that
1811 * uses libcurl and before any call of other libcurl functions.
1812 *
1813 * This function is not thread-safe!
1814 */
1815CURL_EXTERN CURLcode curl_global_init(long flags);
1816
1817/*
1818 * NAME curl_global_init_mem()
1819 *
1820 * DESCRIPTION
1821 *
1822 * curl_global_init() or curl_global_init_mem() should be invoked exactly once
1823 * for each application that uses libcurl.  This function can be used to
1824 * initialize libcurl and set user defined memory management callback
1825 * functions.  Users can implement memory management routines to check for
1826 * memory leaks, check for mis-use of the curl library etc.  User registered
1827 * callback routines with be invoked by this library instead of the system
1828 * memory management routines like malloc, free etc.
1829 */
1830CURL_EXTERN CURLcode curl_global_init_mem(long flags,
1831                                          curl_malloc_callback m,
1832                                          curl_free_callback f,
1833                                          curl_realloc_callback r,
1834                                          curl_strdup_callback s,
1835                                          curl_calloc_callback c);
1836
1837/*
1838 * NAME curl_global_cleanup()
1839 *
1840 * DESCRIPTION
1841 *
1842 * curl_global_cleanup() should be invoked exactly once for each application
1843 * that uses libcurl
1844 */
1845CURL_EXTERN void curl_global_cleanup(void);
1846
1847/* linked-list structure for the CURLOPT_QUOTE option (and other) */
1848struct curl_slist {
1849  char *data;
1850  struct curl_slist *next;
1851};
1852
1853/*
1854 * NAME curl_slist_append()
1855 *
1856 * DESCRIPTION
1857 *
1858 * Appends a string to a linked list. If no list exists, it will be created
1859 * first. Returns the new list, after appending.
1860 */
1861CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
1862                                                 const char *);
1863
1864/*
1865 * NAME curl_slist_free_all()
1866 *
1867 * DESCRIPTION
1868 *
1869 * free a previously built curl_slist.
1870 */
1871CURL_EXTERN void curl_slist_free_all(struct curl_slist *);
1872
1873/*
1874 * NAME curl_getdate()
1875 *
1876 * DESCRIPTION
1877 *
1878 * Returns the time, in seconds since 1 Jan 1970 of the time string given in
1879 * the first argument. The time argument in the second parameter is unused
1880 * and should be set to NULL.
1881 */
1882CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
1883
1884/* info about the certificate chain, only for OpenSSL builds. Asked
1885   for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
1886struct curl_certinfo {
1887  int num_of_certs;             /* number of certificates with information */
1888  struct curl_slist **certinfo; /* for each index in this array, there's a
1889                                   linked list with textual information in the
1890                                   format "name: value" */
1891};
1892
1893#define CURLINFO_STRING   0x100000
1894#define CURLINFO_LONG     0x200000
1895#define CURLINFO_DOUBLE   0x300000
1896#define CURLINFO_SLIST    0x400000
1897#define CURLINFO_MASK     0x0fffff
1898#define CURLINFO_TYPEMASK 0xf00000
1899
1900typedef enum {
1901  CURLINFO_NONE, /* first, never use this */
1902  CURLINFO_EFFECTIVE_URL    = CURLINFO_STRING + 1,
1903  CURLINFO_RESPONSE_CODE    = CURLINFO_LONG   + 2,
1904  CURLINFO_TOTAL_TIME       = CURLINFO_DOUBLE + 3,
1905  CURLINFO_NAMELOOKUP_TIME  = CURLINFO_DOUBLE + 4,
1906  CURLINFO_CONNECT_TIME     = CURLINFO_DOUBLE + 5,
1907  CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
1908  CURLINFO_SIZE_UPLOAD      = CURLINFO_DOUBLE + 7,
1909  CURLINFO_SIZE_DOWNLOAD    = CURLINFO_DOUBLE + 8,
1910  CURLINFO_SPEED_DOWNLOAD   = CURLINFO_DOUBLE + 9,
1911  CURLINFO_SPEED_UPLOAD     = CURLINFO_DOUBLE + 10,
1912  CURLINFO_HEADER_SIZE      = CURLINFO_LONG   + 11,
1913  CURLINFO_REQUEST_SIZE     = CURLINFO_LONG   + 12,
1914  CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG   + 13,
1915  CURLINFO_FILETIME         = CURLINFO_LONG   + 14,
1916  CURLINFO_CONTENT_LENGTH_DOWNLOAD   = CURLINFO_DOUBLE + 15,
1917  CURLINFO_CONTENT_LENGTH_UPLOAD     = CURLINFO_DOUBLE + 16,
1918  CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
1919  CURLINFO_CONTENT_TYPE     = CURLINFO_STRING + 18,
1920  CURLINFO_REDIRECT_TIME    = CURLINFO_DOUBLE + 19,
1921  CURLINFO_REDIRECT_COUNT   = CURLINFO_LONG   + 20,
1922  CURLINFO_PRIVATE          = CURLINFO_STRING + 21,
1923  CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG   + 22,
1924  CURLINFO_HTTPAUTH_AVAIL   = CURLINFO_LONG   + 23,
1925  CURLINFO_PROXYAUTH_AVAIL  = CURLINFO_LONG   + 24,
1926  CURLINFO_OS_ERRNO         = CURLINFO_LONG   + 25,
1927  CURLINFO_NUM_CONNECTS     = CURLINFO_LONG   + 26,
1928  CURLINFO_SSL_ENGINES      = CURLINFO_SLIST  + 27,
1929  CURLINFO_COOKIELIST       = CURLINFO_SLIST  + 28,
1930  CURLINFO_LASTSOCKET       = CURLINFO_LONG   + 29,
1931  CURLINFO_FTP_ENTRY_PATH   = CURLINFO_STRING + 30,
1932  CURLINFO_REDIRECT_URL     = CURLINFO_STRING + 31,
1933  CURLINFO_PRIMARY_IP       = CURLINFO_STRING + 32,
1934  CURLINFO_APPCONNECT_TIME  = CURLINFO_DOUBLE + 33,
1935  CURLINFO_CERTINFO         = CURLINFO_SLIST  + 34,
1936  CURLINFO_CONDITION_UNMET  = CURLINFO_LONG   + 35,
1937  CURLINFO_RTSP_SESSION_ID  = CURLINFO_STRING + 36,
1938  CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG   + 37,
1939  CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG   + 38,
1940  CURLINFO_RTSP_CSEQ_RECV   = CURLINFO_LONG   + 39,
1941  CURLINFO_PRIMARY_PORT     = CURLINFO_LONG   + 40,
1942  CURLINFO_LOCAL_IP         = CURLINFO_STRING + 41,
1943  CURLINFO_LOCAL_PORT       = CURLINFO_LONG   + 42,
1944  /* Fill in new entries below here! */
1945
1946  CURLINFO_LASTONE          = 42
1947} CURLINFO;
1948
1949/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
1950   CURLINFO_HTTP_CODE */
1951#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
1952
1953typedef enum {
1954  CURLCLOSEPOLICY_NONE, /* first, never use this */
1955
1956  CURLCLOSEPOLICY_OLDEST,
1957  CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
1958  CURLCLOSEPOLICY_LEAST_TRAFFIC,
1959  CURLCLOSEPOLICY_SLOWEST,
1960  CURLCLOSEPOLICY_CALLBACK,
1961
1962  CURLCLOSEPOLICY_LAST /* last, never use this */
1963} curl_closepolicy;
1964
1965#define CURL_GLOBAL_SSL (1<<0)
1966#define CURL_GLOBAL_WIN32 (1<<1)
1967#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
1968#define CURL_GLOBAL_NOTHING 0
1969#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
1970
1971
1972/*****************************************************************************
1973 * Setup defines, protos etc for the sharing stuff.
1974 */
1975
1976/* Different data locks for a single share */
1977typedef enum {
1978  CURL_LOCK_DATA_NONE = 0,
1979  /*  CURL_LOCK_DATA_SHARE is used internally to say that
1980   *  the locking is just made to change the internal state of the share
1981   *  itself.
1982   */
1983  CURL_LOCK_DATA_SHARE,
1984  CURL_LOCK_DATA_COOKIE,
1985  CURL_LOCK_DATA_DNS,
1986  CURL_LOCK_DATA_SSL_SESSION,
1987  CURL_LOCK_DATA_CONNECT,
1988  CURL_LOCK_DATA_LAST
1989} curl_lock_data;
1990
1991/* Different lock access types */
1992typedef enum {
1993  CURL_LOCK_ACCESS_NONE = 0,   /* unspecified action */
1994  CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
1995  CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
1996  CURL_LOCK_ACCESS_LAST        /* never use */
1997} curl_lock_access;
1998
1999typedef void (*curl_lock_function)(CURL *handle,
2000                                   curl_lock_data data,
2001                                   curl_lock_access locktype,
2002                                   void *userptr);
2003typedef void (*curl_unlock_function)(CURL *handle,
2004                                     curl_lock_data data,
2005                                     void *userptr);
2006
2007typedef void CURLSH;
2008
2009typedef enum {
2010  CURLSHE_OK,  /* all is fine */
2011  CURLSHE_BAD_OPTION, /* 1 */
2012  CURLSHE_IN_USE,     /* 2 */
2013  CURLSHE_INVALID,    /* 3 */
2014  CURLSHE_NOMEM,      /* out of memory */
2015  CURLSHE_LAST /* never use */
2016} CURLSHcode;
2017
2018typedef enum {
2019  CURLSHOPT_NONE,  /* don't use */
2020  CURLSHOPT_SHARE,   /* specify a data type to share */
2021  CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
2022  CURLSHOPT_LOCKFUNC,   /* pass in a 'curl_lock_function' pointer */
2023  CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
2024  CURLSHOPT_USERDATA,   /* pass in a user data pointer used in the lock/unlock
2025                           callback functions */
2026  CURLSHOPT_LAST  /* never use */
2027} CURLSHoption;
2028
2029CURL_EXTERN CURLSH *curl_share_init(void);
2030CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);
2031CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);
2032
2033/****************************************************************************
2034 * Structures for querying information about the curl library at runtime.
2035 */
2036
2037typedef enum {
2038  CURLVERSION_FIRST,
2039  CURLVERSION_SECOND,
2040  CURLVERSION_THIRD,
2041  CURLVERSION_FOURTH,
2042  CURLVERSION_LAST /* never actually use this */
2043} CURLversion;
2044
2045/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
2046   basically all programs ever that want to get version information. It is
2047   meant to be a built-in version number for what kind of struct the caller
2048   expects. If the struct ever changes, we redefine the NOW to another enum
2049   from above. */
2050#define CURLVERSION_NOW CURLVERSION_FOURTH
2051
2052typedef struct {
2053  CURLversion age;          /* age of the returned struct */
2054  const char *version;      /* LIBCURL_VERSION */
2055  unsigned int version_num; /* LIBCURL_VERSION_NUM */
2056  const char *host;         /* OS/host/cpu/machine when configured */
2057  int features;             /* bitmask, see defines below */
2058  const char *ssl_version;  /* human readable string */
2059  long ssl_version_num;     /* not used anymore, always 0 */
2060  const char *libz_version; /* human readable string */
2061  /* protocols is terminated by an entry with a NULL protoname */
2062  const char * const *protocols;
2063
2064  /* The fields below this were added in CURLVERSION_SECOND */
2065  const char *ares;
2066  int ares_num;
2067
2068  /* This field was added in CURLVERSION_THIRD */
2069  const char *libidn;
2070
2071  /* These field were added in CURLVERSION_FOURTH */
2072
2073  /* Same as '_libiconv_version' if built with HAVE_ICONV */
2074  int iconv_ver_num;
2075
2076  const char *libssh_version; /* human readable string */
2077
2078} curl_version_info_data;
2079
2080#define CURL_VERSION_IPV6      (1<<0)  /* IPv6-enabled */
2081#define CURL_VERSION_KERBEROS4 (1<<1)  /* kerberos auth is supported */
2082#define CURL_VERSION_SSL       (1<<2)  /* SSL options are present */
2083#define CURL_VERSION_LIBZ      (1<<3)  /* libz features are present */
2084#define CURL_VERSION_NTLM      (1<<4)  /* NTLM auth is supported */
2085#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */
2086#define CURL_VERSION_DEBUG     (1<<6)  /* built with debug capabilities */
2087#define CURL_VERSION_ASYNCHDNS (1<<7)  /* asynchronous dns resolves */
2088#define CURL_VERSION_SPNEGO    (1<<8)  /* SPNEGO auth */
2089#define CURL_VERSION_LARGEFILE (1<<9)  /* supports files bigger than 2GB */
2090#define CURL_VERSION_IDN       (1<<10) /* International Domain Names support */
2091#define CURL_VERSION_SSPI      (1<<11) /* SSPI is supported */
2092#define CURL_VERSION_CONV      (1<<12) /* character conversions supported */
2093#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */
2094#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */
2095
2096/*
2097 * NAME curl_version_info()
2098 *
2099 * DESCRIPTION
2100 *
2101 * This function returns a pointer to a static copy of the version info
2102 * struct. See above.
2103 */
2104CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);
2105
2106/*
2107 * NAME curl_easy_strerror()
2108 *
2109 * DESCRIPTION
2110 *
2111 * The curl_easy_strerror function may be used to turn a CURLcode value
2112 * into the equivalent human readable error string.  This is useful
2113 * for printing meaningful error messages.
2114 */
2115CURL_EXTERN const char *curl_easy_strerror(CURLcode);
2116
2117/*
2118 * NAME curl_share_strerror()
2119 *
2120 * DESCRIPTION
2121 *
2122 * The curl_share_strerror function may be used to turn a CURLSHcode value
2123 * into the equivalent human readable error string.  This is useful
2124 * for printing meaningful error messages.
2125 */
2126CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
2127
2128/*
2129 * NAME curl_easy_pause()
2130 *
2131 * DESCRIPTION
2132 *
2133 * The curl_easy_pause function pauses or unpauses transfers. Select the new
2134 * state by setting the bitmask, use the convenience defines below.
2135 *
2136 */
2137CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
2138
2139#define CURLPAUSE_RECV      (1<<0)
2140#define CURLPAUSE_RECV_CONT (0)
2141
2142#define CURLPAUSE_SEND      (1<<2)
2143#define CURLPAUSE_SEND_CONT (0)
2144
2145#define CURLPAUSE_ALL       (CURLPAUSE_RECV|CURLPAUSE_SEND)
2146#define CURLPAUSE_CONT      (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)
2147
2148#ifdef  __cplusplus
2149}
2150#endif
2151
2152/* unfortunately, the easy.h and multi.h include files need options and info
2153  stuff before they can be included! */
2154#include "easy.h" /* nothing in curl is fun without the easy stuff */
2155#include "multi.h"
2156
2157/* the typechecker doesn't work in C++ (yet) */
2158#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
2159    ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
2160    !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)
2161#include "typecheck-gcc.h"
2162#else
2163#if defined(__STDC__) && (__STDC__ >= 1)
2164/* This preprocessor magic that replaces a call with the exact same call is
2165   only done to make sure application authors pass exactly three arguments
2166   to these functions. */
2167#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
2168#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)
2169#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
2170#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
2171#endif /* __STDC__ >= 1 */
2172#endif /* gcc >= 4.3 && !__cplusplus */
2173
2174#endif /* __CURL_CURL_H */
2175