toolkit/crashreporter/google-breakpad/src/third_party/curl/curl.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/crashreporter/google-breakpad/src/third_party/curl/curl.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,1936 @@
     1.4 +#ifndef __CURL_CURL_H
     1.5 +#define __CURL_CURL_H
     1.6 +/***************************************************************************
     1.7 + *                                  _   _ ____  _
     1.8 + *  Project                     ___| | | |  _ \| |
     1.9 + *                             / __| | | | |_) | |
    1.10 + *                            | (__| |_| |  _ <| |___
    1.11 + *                             \___|\___/|_| \_\_____|
    1.12 + *
    1.13 + * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
    1.14 + *
    1.15 + * This software is licensed as described in the file COPYING, which
    1.16 + * you should have received as part of this distribution. The terms
    1.17 + * are also available at http://curl.haxx.se/docs/copyright.html.
    1.18 + *
    1.19 + * You may opt to use, copy, modify, merge, publish, distribute and/or sell
    1.20 + * copies of the Software, and permit persons to whom the Software is
    1.21 + * furnished to do so, under the terms of the COPYING file.
    1.22 + *
    1.23 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
    1.24 + * KIND, either express or implied.
    1.25 + *
    1.26 + * $Id: curl.h,v 1.396 2009-10-16 13:30:31 yangtse Exp $
    1.27 + ***************************************************************************/
    1.28 +
    1.29 +/*
    1.30 + * If you have libcurl problems, all docs and details are found here:
    1.31 + *   http://curl.haxx.se/libcurl/
    1.32 + *
    1.33 + * curl-library mailing list subscription and unsubscription web interface:
    1.34 + *   http://cool.haxx.se/mailman/listinfo/curl-library/
    1.35 + */
    1.36 +
    1.37 +/*
    1.38 + * Leading 'curl' path on the 'curlbuild.h' include statement is
    1.39 + * required to properly allow building outside of the source tree,
    1.40 + * due to the fact that in this case 'curlbuild.h' is generated in
    1.41 + * a subdirectory of the build tree while 'curl.h actually remains
    1.42 + * in a subdirectory of the source tree.
    1.43 + */
    1.44 +
    1.45 +#include "third_party/curl/curlver.h"         /* libcurl version defines   */
    1.46 +#include "third_party/curl/curlbuild.h"       /* libcurl build definitions */
    1.47 +#include "third_party/curl/curlrules.h"       /* libcurl rules enforcement */
    1.48 +
    1.49 +/*
    1.50 + * Define WIN32 when build target is Win32 API
    1.51 + */
    1.52 +
    1.53 +#if (defined(_WIN32) || defined(__WIN32__)) && \
    1.54 +     !defined(WIN32) && !defined(__SYMBIAN32__)
    1.55 +#define WIN32
    1.56 +#endif
    1.57 +
    1.58 +#include <stdio.h>
    1.59 +#include <limits.h>
    1.60 +
    1.61 +/* The include stuff here below is mainly for time_t! */
    1.62 +#include <sys/types.h>
    1.63 +#include <time.h>
    1.64 +
    1.65 +#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \
    1.66 +  !defined(__CYGWIN__) || defined(__MINGW32__)
    1.67 +#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
    1.68 +/* The check above prevents the winsock2 inclusion if winsock.h already was
    1.69 +   included, since they can't co-exist without problems */
    1.70 +#include <winsock2.h>
    1.71 +#include <ws2tcpip.h>
    1.72 +#endif
    1.73 +#else
    1.74 +
    1.75 +/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
    1.76 +   libc5-based Linux systems. Only include it on system that are known to
    1.77 +   require it! */
    1.78 +#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
    1.79 +    defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
    1.80 +    defined(ANDROID)
    1.81 +#include <sys/select.h>
    1.82 +#endif
    1.83 +
    1.84 +#ifndef _WIN32_WCE
    1.85 +#include <sys/socket.h>
    1.86 +#endif
    1.87 +#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
    1.88 +#include <sys/time.h>
    1.89 +#endif
    1.90 +#include <sys/types.h>
    1.91 +#endif
    1.92 +
    1.93 +#ifdef __BEOS__
    1.94 +#include <support/SupportDefs.h>
    1.95 +#endif
    1.96 +
    1.97 +#ifdef  __cplusplus
    1.98 +extern "C" {
    1.99 +#endif
   1.100 +
   1.101 +typedef void CURL;
   1.102 +
   1.103 +/*
   1.104 + * Decorate exportable functions for Win32 and Symbian OS DLL linking.
   1.105 + * This avoids using a .def file for building libcurl.dll.
   1.106 + */
   1.107 +#if (defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)) && \
   1.108 +     !defined(CURL_STATICLIB)
   1.109 +#if defined(BUILDING_LIBCURL)
   1.110 +#define CURL_EXTERN  __declspec(dllexport)
   1.111 +#else
   1.112 +#define CURL_EXTERN  __declspec(dllimport)
   1.113 +#endif
   1.114 +#else
   1.115 +
   1.116 +#ifdef CURL_HIDDEN_SYMBOLS
   1.117 +/*
   1.118 + * This definition is used to make external definitions visible in the
   1.119 + * shared library when symbols are hidden by default.  It makes no
   1.120 + * difference when compiling applications whether this is set or not,
   1.121 + * only when compiling the library.
   1.122 + */
   1.123 +#define CURL_EXTERN CURL_EXTERN_SYMBOL
   1.124 +#else
   1.125 +#define CURL_EXTERN
   1.126 +#endif
   1.127 +#endif
   1.128 +
   1.129 +#ifndef curl_socket_typedef
   1.130 +/* socket typedef */
   1.131 +#ifdef WIN32
   1.132 +typedef SOCKET curl_socket_t;
   1.133 +#define CURL_SOCKET_BAD INVALID_SOCKET
   1.134 +#else
   1.135 +typedef int curl_socket_t;
   1.136 +#define CURL_SOCKET_BAD -1
   1.137 +#endif
   1.138 +#define curl_socket_typedef
   1.139 +#endif /* curl_socket_typedef */
   1.140 +
   1.141 +struct curl_httppost {
   1.142 +  struct curl_httppost *next;       /* next entry in the list */
   1.143 +  char *name;                       /* pointer to allocated name */
   1.144 +  long namelength;                  /* length of name length */
   1.145 +  char *contents;                   /* pointer to allocated data contents */
   1.146 +  long contentslength;              /* length of contents field */
   1.147 +  char *buffer;                     /* pointer to allocated buffer contents */
   1.148 +  long bufferlength;                /* length of buffer field */
   1.149 +  char *contenttype;                /* Content-Type */
   1.150 +  struct curl_slist* contentheader; /* list of extra headers for this form */
   1.151 +  struct curl_httppost *more;       /* if one field name has more than one
   1.152 +                                       file, this link should link to following
   1.153 +                                       files */
   1.154 +  long flags;                       /* as defined below */
   1.155 +#define HTTPPOST_FILENAME (1<<0)    /* specified content is a file name */
   1.156 +#define HTTPPOST_READFILE (1<<1)    /* specified content is a file name */
   1.157 +#define HTTPPOST_PTRNAME (1<<2)     /* name is only stored pointer
   1.158 +                                       do not free in formfree */
   1.159 +#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer
   1.160 +                                       do not free in formfree */
   1.161 +#define HTTPPOST_BUFFER (1<<4)      /* upload file from buffer */
   1.162 +#define HTTPPOST_PTRBUFFER (1<<5)   /* upload file from pointer contents */
   1.163 +#define HTTPPOST_CALLBACK (1<<6)    /* upload file contents by using the
   1.164 +                                       regular read callback to get the data
   1.165 +                                       and pass the given pointer as custom
   1.166 +                                       pointer */
   1.167 +
   1.168 +  char *showfilename;               /* The file name to show. If not set, the
   1.169 +                                       actual file name will be used (if this
   1.170 +                                       is a file part) */
   1.171 +  void *userp;                      /* custom pointer used for
   1.172 +                                       HTTPPOST_CALLBACK posts */
   1.173 +};
   1.174 +
   1.175 +typedef int (*curl_progress_callback)(void *clientp,
   1.176 +                                      double dltotal,
   1.177 +                                      double dlnow,
   1.178 +                                      double ultotal,
   1.179 +                                      double ulnow);
   1.180 +
   1.181 +#ifndef CURL_MAX_WRITE_SIZE
   1.182 +  /* Tests have proven that 20K is a very bad buffer size for uploads on
   1.183 +     Windows, while 16K for some odd reason performed a lot better.
   1.184 +     We do the ifndef check to allow this value to easier be changed at build
   1.185 +     time for those who feel adventurous. */
   1.186 +#define CURL_MAX_WRITE_SIZE 16384
   1.187 +#endif
   1.188 +
   1.189 +#ifndef CURL_MAX_HTTP_HEADER
   1.190 +/* The only reason to have a max limit for this is to avoid the risk of a bad
   1.191 +   server feeding libcurl with a never-ending header that will cause reallocs
   1.192 +   infinitely */
   1.193 +#define CURL_MAX_HTTP_HEADER (100*1024)
   1.194 +#endif
   1.195 +
   1.196 +
   1.197 +/* This is a magic return code for the write callback that, when returned,
   1.198 +   will signal libcurl to pause receiving on the current transfer. */
   1.199 +#define CURL_WRITEFUNC_PAUSE 0x10000001
   1.200 +typedef size_t (*curl_write_callback)(char *buffer,
   1.201 +                                      size_t size,
   1.202 +                                      size_t nitems,
   1.203 +                                      void *outstream);
   1.204 +
   1.205 +/* These are the return codes for the seek callbacks */
   1.206 +#define CURL_SEEKFUNC_OK       0
   1.207 +#define CURL_SEEKFUNC_FAIL     1 /* fail the entire transfer */
   1.208 +#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so
   1.209 +                                    libcurl might try other means instead */
   1.210 +typedef int (*curl_seek_callback)(void *instream,
   1.211 +                                  curl_off_t offset,
   1.212 +                                  int origin); /* 'whence' */
   1.213 +
   1.214 +/* This is a return code for the read callback that, when returned, will
   1.215 +   signal libcurl to immediately abort the current transfer. */
   1.216 +#define CURL_READFUNC_ABORT 0x10000000
   1.217 +/* This is a return code for the read callback that, when returned, will
   1.218 +   signal libcurl to pause sending data on the current transfer. */
   1.219 +#define CURL_READFUNC_PAUSE 0x10000001
   1.220 +
   1.221 +typedef size_t (*curl_read_callback)(char *buffer,
   1.222 +                                      size_t size,
   1.223 +                                      size_t nitems,
   1.224 +                                      void *instream);
   1.225 +
   1.226 +typedef enum  {
   1.227 +  CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
   1.228 +  CURLSOCKTYPE_LAST   /* never use */
   1.229 +} curlsocktype;
   1.230 +
   1.231 +typedef int (*curl_sockopt_callback)(void *clientp,
   1.232 +                                     curl_socket_t curlfd,
   1.233 +                                     curlsocktype purpose);
   1.234 +
   1.235 +struct curl_sockaddr {
   1.236 +  int family;
   1.237 +  int socktype;
   1.238 +  int protocol;
   1.239 +  unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it
   1.240 +                           turned really ugly and painful on the systems that
   1.241 +                           lack this type */
   1.242 +  struct sockaddr addr;
   1.243 +};
   1.244 +
   1.245 +typedef curl_socket_t
   1.246 +(*curl_opensocket_callback)(void *clientp,
   1.247 +                            curlsocktype purpose,
   1.248 +                            struct curl_sockaddr *address);
   1.249 +
   1.250 +#ifndef CURL_NO_OLDIES
   1.251 +  /* not used since 7.10.8, will be removed in a future release */
   1.252 +typedef int (*curl_passwd_callback)(void *clientp,
   1.253 +                                    const char *prompt,
   1.254 +                                    char *buffer,
   1.255 +                                    int buflen);
   1.256 +#endif
   1.257 +
   1.258 +typedef enum {
   1.259 +  CURLIOE_OK,            /* I/O operation successful */
   1.260 +  CURLIOE_UNKNOWNCMD,    /* command was unknown to callback */
   1.261 +  CURLIOE_FAILRESTART,   /* failed to restart the read */
   1.262 +  CURLIOE_LAST           /* never use */
   1.263 +} curlioerr;
   1.264 +
   1.265 +typedef enum  {
   1.266 +  CURLIOCMD_NOP,         /* no operation */
   1.267 +  CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
   1.268 +  CURLIOCMD_LAST         /* never use */
   1.269 +} curliocmd;
   1.270 +
   1.271 +typedef curlioerr (*curl_ioctl_callback)(CURL *handle,
   1.272 +                                         int cmd,
   1.273 +                                         void *clientp);
   1.274 +
   1.275 +/*
   1.276 + * The following typedef's are signatures of malloc, free, realloc, strdup and
   1.277 + * calloc respectively.  Function pointers of these types can be passed to the
   1.278 + * curl_global_init_mem() function to set user defined memory management
   1.279 + * callback routines.
   1.280 + */
   1.281 +typedef void *(*curl_malloc_callback)(size_t size);
   1.282 +typedef void (*curl_free_callback)(void *ptr);
   1.283 +typedef void *(*curl_realloc_callback)(void *ptr, size_t size);
   1.284 +typedef char *(*curl_strdup_callback)(const char *str);
   1.285 +typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
   1.286 +
   1.287 +/* the kind of data that is passed to information_callback*/
   1.288 +typedef enum {
   1.289 +  CURLINFO_TEXT = 0,
   1.290 +  CURLINFO_HEADER_IN,    /* 1 */
   1.291 +  CURLINFO_HEADER_OUT,   /* 2 */
   1.292 +  CURLINFO_DATA_IN,      /* 3 */
   1.293 +  CURLINFO_DATA_OUT,     /* 4 */
   1.294 +  CURLINFO_SSL_DATA_IN,  /* 5 */
   1.295 +  CURLINFO_SSL_DATA_OUT, /* 6 */
   1.296 +  CURLINFO_END
   1.297 +} curl_infotype;
   1.298 +
   1.299 +typedef int (*curl_debug_callback)
   1.300 +       (CURL *handle,      /* the handle/transfer this concerns */
   1.301 +        curl_infotype type, /* what kind of data */
   1.302 +        char *data,        /* points to the data */
   1.303 +        size_t size,       /* size of the data pointed to */
   1.304 +        void *userptr);    /* whatever the user please */
   1.305 +
   1.306 +/* All possible error codes from all sorts of curl functions. Future versions
   1.307 +   may return other values, stay prepared.
   1.308 +
   1.309 +   Always add new return codes last. Never *EVER* remove any. The return
   1.310 +   codes must remain the same!
   1.311 + */
   1.312 +
   1.313 +typedef enum {
   1.314 +  CURLE_OK = 0,
   1.315 +  CURLE_UNSUPPORTED_PROTOCOL,    /* 1 */
   1.316 +  CURLE_FAILED_INIT,             /* 2 */
   1.317 +  CURLE_URL_MALFORMAT,           /* 3 */
   1.318 +  CURLE_OBSOLETE4,               /* 4 - NOT USED */
   1.319 +  CURLE_COULDNT_RESOLVE_PROXY,   /* 5 */
   1.320 +  CURLE_COULDNT_RESOLVE_HOST,    /* 6 */
   1.321 +  CURLE_COULDNT_CONNECT,         /* 7 */
   1.322 +  CURLE_FTP_WEIRD_SERVER_REPLY,  /* 8 */
   1.323 +  CURLE_REMOTE_ACCESS_DENIED,    /* 9 a service was denied by the server
   1.324 +                                    due to lack of access - when login fails
   1.325 +                                    this is not returned. */
   1.326 +  CURLE_OBSOLETE10,              /* 10 - NOT USED */
   1.327 +  CURLE_FTP_WEIRD_PASS_REPLY,    /* 11 */
   1.328 +  CURLE_OBSOLETE12,              /* 12 - NOT USED */
   1.329 +  CURLE_FTP_WEIRD_PASV_REPLY,    /* 13 */
   1.330 +  CURLE_FTP_WEIRD_227_FORMAT,    /* 14 */
   1.331 +  CURLE_FTP_CANT_GET_HOST,       /* 15 */
   1.332 +  CURLE_OBSOLETE16,              /* 16 - NOT USED */
   1.333 +  CURLE_FTP_COULDNT_SET_TYPE,    /* 17 */
   1.334 +  CURLE_PARTIAL_FILE,            /* 18 */
   1.335 +  CURLE_FTP_COULDNT_RETR_FILE,   /* 19 */
   1.336 +  CURLE_OBSOLETE20,              /* 20 - NOT USED */
   1.337 +  CURLE_QUOTE_ERROR,             /* 21 - quote command failure */
   1.338 +  CURLE_HTTP_RETURNED_ERROR,     /* 22 */
   1.339 +  CURLE_WRITE_ERROR,             /* 23 */
   1.340 +  CURLE_OBSOLETE24,              /* 24 - NOT USED */
   1.341 +  CURLE_UPLOAD_FAILED,           /* 25 - failed upload "command" */
   1.342 +  CURLE_READ_ERROR,              /* 26 - couldn't open/read from file */
   1.343 +  CURLE_OUT_OF_MEMORY,           /* 27 */
   1.344 +  /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
   1.345 +           instead of a memory allocation error if CURL_DOES_CONVERSIONS
   1.346 +           is defined
   1.347 +  */
   1.348 +  CURLE_OPERATION_TIMEDOUT,      /* 28 - the timeout time was reached */
   1.349 +  CURLE_OBSOLETE29,              /* 29 - NOT USED */
   1.350 +  CURLE_FTP_PORT_FAILED,         /* 30 - FTP PORT operation failed */
   1.351 +  CURLE_FTP_COULDNT_USE_REST,    /* 31 - the REST command failed */
   1.352 +  CURLE_OBSOLETE32,              /* 32 - NOT USED */
   1.353 +  CURLE_RANGE_ERROR,             /* 33 - RANGE "command" didn't work */
   1.354 +  CURLE_HTTP_POST_ERROR,         /* 34 */
   1.355 +  CURLE_SSL_CONNECT_ERROR,       /* 35 - wrong when connecting with SSL */
   1.356 +  CURLE_BAD_DOWNLOAD_RESUME,     /* 36 - couldn't resume download */
   1.357 +  CURLE_FILE_COULDNT_READ_FILE,  /* 37 */
   1.358 +  CURLE_LDAP_CANNOT_BIND,        /* 38 */
   1.359 +  CURLE_LDAP_SEARCH_FAILED,      /* 39 */
   1.360 +  CURLE_OBSOLETE40,              /* 40 - NOT USED */
   1.361 +  CURLE_FUNCTION_NOT_FOUND,      /* 41 */
   1.362 +  CURLE_ABORTED_BY_CALLBACK,     /* 42 */
   1.363 +  CURLE_BAD_FUNCTION_ARGUMENT,   /* 43 */
   1.364 +  CURLE_OBSOLETE44,              /* 44 - NOT USED */
   1.365 +  CURLE_INTERFACE_FAILED,        /* 45 - CURLOPT_INTERFACE failed */
   1.366 +  CURLE_OBSOLETE46,              /* 46 - NOT USED */
   1.367 +  CURLE_TOO_MANY_REDIRECTS ,     /* 47 - catch endless re-direct loops */
   1.368 +  CURLE_UNKNOWN_TELNET_OPTION,   /* 48 - User specified an unknown option */
   1.369 +  CURLE_TELNET_OPTION_SYNTAX ,   /* 49 - Malformed telnet option */
   1.370 +  CURLE_OBSOLETE50,              /* 50 - NOT USED */
   1.371 +  CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
   1.372 +                                     wasn't verified fine */
   1.373 +  CURLE_GOT_NOTHING,             /* 52 - when this is a specific error */
   1.374 +  CURLE_SSL_ENGINE_NOTFOUND,     /* 53 - SSL crypto engine not found */
   1.375 +  CURLE_SSL_ENGINE_SETFAILED,    /* 54 - can not set SSL crypto engine as
   1.376 +                                    default */
   1.377 +  CURLE_SEND_ERROR,              /* 55 - failed sending network data */
   1.378 +  CURLE_RECV_ERROR,              /* 56 - failure in receiving network data */
   1.379 +  CURLE_OBSOLETE57,              /* 57 - NOT IN USE */
   1.380 +  CURLE_SSL_CERTPROBLEM,         /* 58 - problem with the local certificate */
   1.381 +  CURLE_SSL_CIPHER,              /* 59 - couldn't use specified cipher */
   1.382 +  CURLE_SSL_CACERT,              /* 60 - problem with the CA cert (path?) */
   1.383 +  CURLE_BAD_CONTENT_ENCODING,    /* 61 - Unrecognized transfer encoding */
   1.384 +  CURLE_LDAP_INVALID_URL,        /* 62 - Invalid LDAP URL */
   1.385 +  CURLE_FILESIZE_EXCEEDED,       /* 63 - Maximum file size exceeded */
   1.386 +  CURLE_USE_SSL_FAILED,          /* 64 - Requested FTP SSL level failed */
   1.387 +  CURLE_SEND_FAIL_REWIND,        /* 65 - Sending the data requires a rewind
   1.388 +                                    that failed */
   1.389 +  CURLE_SSL_ENGINE_INITFAILED,   /* 66 - failed to initialise ENGINE */
   1.390 +  CURLE_LOGIN_DENIED,            /* 67 - user, password or similar was not
   1.391 +                                    accepted and we failed to login */
   1.392 +  CURLE_TFTP_NOTFOUND,           /* 68 - file not found on server */
   1.393 +  CURLE_TFTP_PERM,               /* 69 - permission problem on server */
   1.394 +  CURLE_REMOTE_DISK_FULL,        /* 70 - out of disk space on server */
   1.395 +  CURLE_TFTP_ILLEGAL,            /* 71 - Illegal TFTP operation */
   1.396 +  CURLE_TFTP_UNKNOWNID,          /* 72 - Unknown transfer ID */
   1.397 +  CURLE_REMOTE_FILE_EXISTS,      /* 73 - File already exists */
   1.398 +  CURLE_TFTP_NOSUCHUSER,         /* 74 - No such user */
   1.399 +  CURLE_CONV_FAILED,             /* 75 - conversion failed */
   1.400 +  CURLE_CONV_REQD,               /* 76 - caller must register conversion
   1.401 +                                    callbacks using curl_easy_setopt options
   1.402 +                                    CURLOPT_CONV_FROM_NETWORK_FUNCTION,
   1.403 +                                    CURLOPT_CONV_TO_NETWORK_FUNCTION, and
   1.404 +                                    CURLOPT_CONV_FROM_UTF8_FUNCTION */
   1.405 +  CURLE_SSL_CACERT_BADFILE,      /* 77 - could not load CACERT file, missing
   1.406 +                                    or wrong format */
   1.407 +  CURLE_REMOTE_FILE_NOT_FOUND,   /* 78 - remote file not found */
   1.408 +  CURLE_SSH,                     /* 79 - error from the SSH layer, somewhat
   1.409 +                                    generic so the error message will be of
   1.410 +                                    interest when this has happened */
   1.411 +
   1.412 +  CURLE_SSL_SHUTDOWN_FAILED,     /* 80 - Failed to shut down the SSL
   1.413 +                                    connection */
   1.414 +  CURLE_AGAIN,                   /* 81 - socket is not ready for send/recv,
   1.415 +                                    wait till it's ready and try again (Added
   1.416 +                                    in 7.18.2) */
   1.417 +  CURLE_SSL_CRL_BADFILE,         /* 82 - could not load CRL file, missing or
   1.418 +                                    wrong format (Added in 7.19.0) */
   1.419 +  CURLE_SSL_ISSUER_ERROR,        /* 83 - Issuer check failed.  (Added in
   1.420 +                                    7.19.0) */
   1.421 +  CURL_LAST /* never use! */
   1.422 +} CURLcode;
   1.423 +
   1.424 +#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
   1.425 +                          the obsolete stuff removed! */
   1.426 +
   1.427 +/* Backwards compatibility with older names */
   1.428 +
   1.429 +/* The following were added in 7.17.1 */
   1.430 +/* These are scheduled to disappear by 2009 */
   1.431 +#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION
   1.432 +
   1.433 +/* The following were added in 7.17.0 */
   1.434 +/* These are scheduled to disappear by 2009 */
   1.435 +#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* noone should be using this! */
   1.436 +#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46
   1.437 +#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44
   1.438 +#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10
   1.439 +#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16
   1.440 +#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32
   1.441 +#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29
   1.442 +#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12
   1.443 +#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20
   1.444 +#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40
   1.445 +#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24
   1.446 +#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57
   1.447 +#define CURLE_URL_MALFORMAT_USER CURLE_OBSOLETE4
   1.448 +
   1.449 +#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED
   1.450 +#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE
   1.451 +#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR
   1.452 +#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL
   1.453 +#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS
   1.454 +#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR
   1.455 +#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED
   1.456 +
   1.457 +/* The following were added earlier */
   1.458 +
   1.459 +#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT
   1.460 +
   1.461 +#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR
   1.462 +#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED
   1.463 +#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED
   1.464 +
   1.465 +#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
   1.466 +#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
   1.467 +
   1.468 +/* This was the error code 50 in 7.7.3 and a few earlier versions, this
   1.469 +   is no longer used by libcurl but is instead #defined here only to not
   1.470 +   make programs break */
   1.471 +#define CURLE_ALREADY_COMPLETE 99999
   1.472 +
   1.473 +#endif /*!CURL_NO_OLDIES*/
   1.474 +
   1.475 +/* This prototype applies to all conversion callbacks */
   1.476 +typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
   1.477 +
   1.478 +typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl,    /* easy handle */
   1.479 +                                          void *ssl_ctx, /* actually an
   1.480 +                                                            OpenSSL SSL_CTX */
   1.481 +                                          void *userptr);
   1.482 +
   1.483 +typedef enum {
   1.484 +  CURLPROXY_HTTP = 0,   /* added in 7.10, new in 7.19.4 default is to use
   1.485 +                           CONNECT HTTP/1.1 */
   1.486 +  CURLPROXY_HTTP_1_0 = 1,   /* added in 7.19.4, force to use CONNECT
   1.487 +                               HTTP/1.0  */
   1.488 +  CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
   1.489 +                           in 7.10 */
   1.490 +  CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
   1.491 +  CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
   1.492 +  CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
   1.493 +                                   host name rather than the IP address. added
   1.494 +                                   in 7.18.0 */
   1.495 +} curl_proxytype;  /* this enum was added in 7.10 */
   1.496 +
   1.497 +#define CURLAUTH_NONE         0       /* nothing */
   1.498 +#define CURLAUTH_BASIC        (1<<0)  /* Basic (default) */
   1.499 +#define CURLAUTH_DIGEST       (1<<1)  /* Digest */
   1.500 +#define CURLAUTH_GSSNEGOTIATE (1<<2)  /* GSS-Negotiate */
   1.501 +#define CURLAUTH_NTLM         (1<<3)  /* NTLM */
   1.502 +#define CURLAUTH_DIGEST_IE    (1<<4)  /* Digest with IE flavour */
   1.503 +#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)  /* all fine types set */
   1.504 +#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
   1.505 +
   1.506 +#define CURLSSH_AUTH_ANY       ~0     /* all types supported by the server */
   1.507 +#define CURLSSH_AUTH_NONE      0      /* none allowed, silly but complete */
   1.508 +#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */
   1.509 +#define CURLSSH_AUTH_PASSWORD  (1<<1) /* password */
   1.510 +#define CURLSSH_AUTH_HOST      (1<<2) /* host key files */
   1.511 +#define CURLSSH_AUTH_KEYBOARD  (1<<3) /* keyboard interactive */
   1.512 +#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
   1.513 +
   1.514 +#define CURL_ERROR_SIZE 256
   1.515 +
   1.516 +struct curl_khkey {
   1.517 +  const char *key; /* points to a zero-terminated string encoded with base64
   1.518 +                      if len is zero, otherwise to the "raw" data */
   1.519 +  size_t len;
   1.520 +  enum type {
   1.521 +    CURLKHTYPE_UNKNOWN,
   1.522 +    CURLKHTYPE_RSA1,
   1.523 +    CURLKHTYPE_RSA,
   1.524 +    CURLKHTYPE_DSS
   1.525 +  } keytype;
   1.526 +};
   1.527 +
   1.528 +/* this is the set of return values expected from the curl_sshkeycallback
   1.529 +   callback */
   1.530 +enum curl_khstat {
   1.531 +  CURLKHSTAT_FINE_ADD_TO_FILE,
   1.532 +  CURLKHSTAT_FINE,
   1.533 +  CURLKHSTAT_REJECT, /* reject the connection, return an error */
   1.534 +  CURLKHSTAT_DEFER,  /* do not accept it, but we can't answer right now so
   1.535 +                        this causes a CURLE_DEFER error but otherwise the
   1.536 +                        connection will be left intact etc */
   1.537 +  CURLKHSTAT_LAST    /* not for use, only a marker for last-in-list */
   1.538 +};
   1.539 +
   1.540 +/* this is the set of status codes pass in to the callback */
   1.541 +enum curl_khmatch {
   1.542 +  CURLKHMATCH_OK,       /* match */
   1.543 +  CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
   1.544 +  CURLKHMATCH_MISSING,  /* no matching host/key found */
   1.545 +  CURLKHMATCH_LAST      /* not for use, only a marker for last-in-list */
   1.546 +};
   1.547 +
   1.548 +typedef int
   1.549 +  (*curl_sshkeycallback) (CURL *easy,     /* easy handle */
   1.550 +                          const struct curl_khkey *knownkey, /* known */
   1.551 +                          const struct curl_khkey *foundkey, /* found */
   1.552 +                          enum curl_khmatch, /* libcurl's view on the keys */
   1.553 +                          void *clientp); /* custom pointer passed from app */
   1.554 +
   1.555 +/* parameter for the CURLOPT_USE_SSL option */
   1.556 +typedef enum {
   1.557 +  CURLUSESSL_NONE,    /* do not attempt to use SSL */
   1.558 +  CURLUSESSL_TRY,     /* try using SSL, proceed anyway otherwise */
   1.559 +  CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
   1.560 +  CURLUSESSL_ALL,     /* SSL for all communication or fail */
   1.561 +  CURLUSESSL_LAST     /* not an option, never use */
   1.562 +} curl_usessl;
   1.563 +
   1.564 +#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
   1.565 +                          the obsolete stuff removed! */
   1.566 +
   1.567 +/* Backwards compatibility with older names */
   1.568 +/* These are scheduled to disappear by 2009 */
   1.569 +
   1.570 +#define CURLFTPSSL_NONE CURLUSESSL_NONE
   1.571 +#define CURLFTPSSL_TRY CURLUSESSL_TRY
   1.572 +#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL
   1.573 +#define CURLFTPSSL_ALL CURLUSESSL_ALL
   1.574 +#define CURLFTPSSL_LAST CURLUSESSL_LAST
   1.575 +#define curl_ftpssl curl_usessl
   1.576 +#endif /*!CURL_NO_OLDIES*/
   1.577 +
   1.578 +/* parameter for the CURLOPT_FTP_SSL_CCC option */
   1.579 +typedef enum {
   1.580 +  CURLFTPSSL_CCC_NONE,    /* do not send CCC */
   1.581 +  CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
   1.582 +  CURLFTPSSL_CCC_ACTIVE,  /* Initiate the shutdown */
   1.583 +  CURLFTPSSL_CCC_LAST     /* not an option, never use */
   1.584 +} curl_ftpccc;
   1.585 +
   1.586 +/* parameter for the CURLOPT_FTPSSLAUTH option */
   1.587 +typedef enum {
   1.588 +  CURLFTPAUTH_DEFAULT, /* let libcurl decide */
   1.589 +  CURLFTPAUTH_SSL,     /* use "AUTH SSL" */
   1.590 +  CURLFTPAUTH_TLS,     /* use "AUTH TLS" */
   1.591 +  CURLFTPAUTH_LAST /* not an option, never use */
   1.592 +} curl_ftpauth;
   1.593 +
   1.594 +/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
   1.595 +typedef enum {
   1.596 +  CURLFTP_CREATE_DIR_NONE,  /* do NOT create missing dirs! */
   1.597 +  CURLFTP_CREATE_DIR,       /* (FTP/SFTP) if CWD fails, try MKD and then CWD
   1.598 +                               again if MKD succeeded, for SFTP this does
   1.599 +                               similar magic */
   1.600 +  CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
   1.601 +                               again even if MKD failed! */
   1.602 +  CURLFTP_CREATE_DIR_LAST   /* not an option, never use */
   1.603 +} curl_ftpcreatedir;
   1.604 +
   1.605 +/* parameter for the CURLOPT_FTP_FILEMETHOD option */
   1.606 +typedef enum {
   1.607 +  CURLFTPMETHOD_DEFAULT,   /* let libcurl pick */
   1.608 +  CURLFTPMETHOD_MULTICWD,  /* single CWD operation for each path part */
   1.609 +  CURLFTPMETHOD_NOCWD,     /* no CWD at all */
   1.610 +  CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
   1.611 +  CURLFTPMETHOD_LAST       /* not an option, never use */
   1.612 +} curl_ftpmethod;
   1.613 +
   1.614 +/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
   1.615 +#define CURLPROTO_HTTP   (1<<0)
   1.616 +#define CURLPROTO_HTTPS  (1<<1)
   1.617 +#define CURLPROTO_FTP    (1<<2)
   1.618 +#define CURLPROTO_FTPS   (1<<3)
   1.619 +#define CURLPROTO_SCP    (1<<4)
   1.620 +#define CURLPROTO_SFTP   (1<<5)
   1.621 +#define CURLPROTO_TELNET (1<<6)
   1.622 +#define CURLPROTO_LDAP   (1<<7)
   1.623 +#define CURLPROTO_LDAPS  (1<<8)
   1.624 +#define CURLPROTO_DICT   (1<<9)
   1.625 +#define CURLPROTO_FILE   (1<<10)
   1.626 +#define CURLPROTO_TFTP   (1<<11)
   1.627 +#define CURLPROTO_ALL    (~0) /* enable everything */
   1.628 +
   1.629 +/* long may be 32 or 64 bits, but we should never depend on anything else
   1.630 +   but 32 */
   1.631 +#define CURLOPTTYPE_LONG          0
   1.632 +#define CURLOPTTYPE_OBJECTPOINT   10000
   1.633 +#define CURLOPTTYPE_FUNCTIONPOINT 20000
   1.634 +#define CURLOPTTYPE_OFF_T         30000
   1.635 +
   1.636 +/* name is uppercase CURLOPT_<name>,
   1.637 +   type is one of the defined CURLOPTTYPE_<type>
   1.638 +   number is unique identifier */
   1.639 +#ifdef CINIT
   1.640 +#undef CINIT
   1.641 +#endif
   1.642 +
   1.643 +#ifdef CURL_ISOCPP
   1.644 +#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number
   1.645 +#else
   1.646 +/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
   1.647 +#define LONG          CURLOPTTYPE_LONG
   1.648 +#define OBJECTPOINT   CURLOPTTYPE_OBJECTPOINT
   1.649 +#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
   1.650 +#define OFF_T         CURLOPTTYPE_OFF_T
   1.651 +#define CINIT(name,type,number) CURLOPT_/**/name = type + number
   1.652 +#endif
   1.653 +
   1.654 +/*
   1.655 + * This macro-mania below setups the CURLOPT_[what] enum, to be used with
   1.656 + * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]
   1.657 + * word.
   1.658 + */
   1.659 +
   1.660 +typedef enum {
   1.661 +  /* This is the FILE * or void * the regular output should be written to. */
   1.662 +  CINIT(FILE, OBJECTPOINT, 1),
   1.663 +
   1.664 +  /* The full URL to get/put */
   1.665 +  CINIT(URL,  OBJECTPOINT, 2),
   1.666 +
   1.667 +  /* Port number to connect to, if other than default. */
   1.668 +  CINIT(PORT, LONG, 3),
   1.669 +
   1.670 +  /* Name of proxy to use. */
   1.671 +  CINIT(PROXY, OBJECTPOINT, 4),
   1.672 +
   1.673 +  /* "name:password" to use when fetching. */
   1.674 +  CINIT(USERPWD, OBJECTPOINT, 5),
   1.675 +
   1.676 +  /* "name:password" to use with proxy. */
   1.677 +  CINIT(PROXYUSERPWD, OBJECTPOINT, 6),
   1.678 +
   1.679 +  /* Range to get, specified as an ASCII string. */
   1.680 +  CINIT(RANGE, OBJECTPOINT, 7),
   1.681 +
   1.682 +  /* not used */
   1.683 +
   1.684 +  /* Specified file stream to upload from (use as input): */
   1.685 +  CINIT(INFILE, OBJECTPOINT, 9),
   1.686 +
   1.687 +  /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
   1.688 +   * bytes big. If this is not used, error messages go to stderr instead: */
   1.689 +  CINIT(ERRORBUFFER, OBJECTPOINT, 10),
   1.690 +
   1.691 +  /* Function that will be called to store the output (instead of fwrite). The
   1.692 +   * parameters will use fwrite() syntax, make sure to follow them. */
   1.693 +  CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
   1.694 +
   1.695 +  /* Function that will be called to read the input (instead of fread). The
   1.696 +   * parameters will use fread() syntax, make sure to follow them. */
   1.697 +  CINIT(READFUNCTION, FUNCTIONPOINT, 12),
   1.698 +
   1.699 +  /* Time-out the read operation after this amount of seconds */
   1.700 +  CINIT(TIMEOUT, LONG, 13),
   1.701 +
   1.702 +  /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
   1.703 +   * how large the file being sent really is. That allows better error
   1.704 +   * checking and better verifies that the upload was successful. -1 means
   1.705 +   * unknown size.
   1.706 +   *
   1.707 +   * For large file support, there is also a _LARGE version of the key
   1.708 +   * which takes an off_t type, allowing platforms with larger off_t
   1.709 +   * sizes to handle larger files.  See below for INFILESIZE_LARGE.
   1.710 +   */
   1.711 +  CINIT(INFILESIZE, LONG, 14),
   1.712 +
   1.713 +  /* POST static input fields. */
   1.714 +  CINIT(POSTFIELDS, OBJECTPOINT, 15),
   1.715 +
   1.716 +  /* Set the referrer page (needed by some CGIs) */
   1.717 +  CINIT(REFERER, OBJECTPOINT, 16),
   1.718 +
   1.719 +  /* Set the FTP PORT string (interface name, named or numerical IP address)
   1.720 +     Use i.e '-' to use default address. */
   1.721 +  CINIT(FTPPORT, OBJECTPOINT, 17),
   1.722 +
   1.723 +  /* Set the User-Agent string (examined by some CGIs) */
   1.724 +  CINIT(USERAGENT, OBJECTPOINT, 18),
   1.725 +
   1.726 +  /* If the download receives less than "low speed limit" bytes/second
   1.727 +   * during "low speed time" seconds, the operations is aborted.
   1.728 +   * You could i.e if you have a pretty high speed connection, abort if
   1.729 +   * it is less than 2000 bytes/sec during 20 seconds.
   1.730 +   */
   1.731 +
   1.732 +  /* Set the "low speed limit" */
   1.733 +  CINIT(LOW_SPEED_LIMIT, LONG, 19),
   1.734 +
   1.735 +  /* Set the "low speed time" */
   1.736 +  CINIT(LOW_SPEED_TIME, LONG, 20),
   1.737 +
   1.738 +  /* Set the continuation offset.
   1.739 +   *
   1.740 +   * Note there is also a _LARGE version of this key which uses
   1.741 +   * off_t types, allowing for large file offsets on platforms which
   1.742 +   * use larger-than-32-bit off_t's.  Look below for RESUME_FROM_LARGE.
   1.743 +   */
   1.744 +  CINIT(RESUME_FROM, LONG, 21),
   1.745 +
   1.746 +  /* Set cookie in request: */
   1.747 +  CINIT(COOKIE, OBJECTPOINT, 22),
   1.748 +
   1.749 +  /* This points to a linked list of headers, struct curl_slist kind */
   1.750 +  CINIT(HTTPHEADER, OBJECTPOINT, 23),
   1.751 +
   1.752 +  /* This points to a linked list of post entries, struct curl_httppost */
   1.753 +  CINIT(HTTPPOST, OBJECTPOINT, 24),
   1.754 +
   1.755 +  /* name of the file keeping your private SSL-certificate */
   1.756 +  CINIT(SSLCERT, OBJECTPOINT, 25),
   1.757 +
   1.758 +  /* password for the SSL or SSH private key */
   1.759 +  CINIT(KEYPASSWD, OBJECTPOINT, 26),
   1.760 +
   1.761 +  /* send TYPE parameter? */
   1.762 +  CINIT(CRLF, LONG, 27),
   1.763 +
   1.764 +  /* send linked-list of QUOTE commands */
   1.765 +  CINIT(QUOTE, OBJECTPOINT, 28),
   1.766 +
   1.767 +  /* send FILE * or void * to store headers to, if you use a callback it
   1.768 +     is simply passed to the callback unmodified */
   1.769 +  CINIT(WRITEHEADER, OBJECTPOINT, 29),
   1.770 +
   1.771 +  /* point to a file to read the initial cookies from, also enables
   1.772 +     "cookie awareness" */
   1.773 +  CINIT(COOKIEFILE, OBJECTPOINT, 31),
   1.774 +
   1.775 +  /* What version to specifically try to use.
   1.776 +     See CURL_SSLVERSION defines below. */
   1.777 +  CINIT(SSLVERSION, LONG, 32),
   1.778 +
   1.779 +  /* What kind of HTTP time condition to use, see defines */
   1.780 +  CINIT(TIMECONDITION, LONG, 33),
   1.781 +
   1.782 +  /* Time to use with the above condition. Specified in number of seconds
   1.783 +     since 1 Jan 1970 */
   1.784 +  CINIT(TIMEVALUE, LONG, 34),
   1.785 +
   1.786 +  /* 35 = OBSOLETE */
   1.787 +
   1.788 +  /* Custom request, for customizing the get command like
   1.789 +     HTTP: DELETE, TRACE and others
   1.790 +     FTP: to use a different list command
   1.791 +     */
   1.792 +  CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),
   1.793 +
   1.794 +  /* HTTP request, for odd commands like DELETE, TRACE and others */
   1.795 +  CINIT(STDERR, OBJECTPOINT, 37),
   1.796 +
   1.797 +  /* 38 is not used */
   1.798 +
   1.799 +  /* send linked-list of post-transfer QUOTE commands */
   1.800 +  CINIT(POSTQUOTE, OBJECTPOINT, 39),
   1.801 +
   1.802 +  /* Pass a pointer to string of the output using full variable-replacement
   1.803 +     as described elsewhere. */
   1.804 +  CINIT(WRITEINFO, OBJECTPOINT, 40),
   1.805 +
   1.806 +  CINIT(VERBOSE, LONG, 41),      /* talk a lot */
   1.807 +  CINIT(HEADER, LONG, 42),       /* throw the header out too */
   1.808 +  CINIT(NOPROGRESS, LONG, 43),   /* shut off the progress meter */
   1.809 +  CINIT(NOBODY, LONG, 44),       /* use HEAD to get http document */
   1.810 +  CINIT(FAILONERROR, LONG, 45),  /* no output on http error codes >= 300 */
   1.811 +  CINIT(UPLOAD, LONG, 46),       /* this is an upload */
   1.812 +  CINIT(POST, LONG, 47),         /* HTTP POST method */
   1.813 +  CINIT(DIRLISTONLY, LONG, 48),  /* return bare names when listing directories */
   1.814 +
   1.815 +  CINIT(APPEND, LONG, 50),       /* Append instead of overwrite on upload! */
   1.816 +
   1.817 +  /* Specify whether to read the user+password from the .netrc or the URL.
   1.818 +   * This must be one of the CURL_NETRC_* enums below. */
   1.819 +  CINIT(NETRC, LONG, 51),
   1.820 +
   1.821 +  CINIT(FOLLOWLOCATION, LONG, 52),  /* use Location: Luke! */
   1.822 +
   1.823 +  CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
   1.824 +  CINIT(PUT, LONG, 54),          /* HTTP PUT */
   1.825 +
   1.826 +  /* 55 = OBSOLETE */
   1.827 +
   1.828 +  /* Function that will be called instead of the internal progress display
   1.829 +   * function. This function should be defined as the curl_progress_callback
   1.830 +   * prototype defines. */
   1.831 +  CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
   1.832 +
   1.833 +  /* Data passed to the progress callback */
   1.834 +  CINIT(PROGRESSDATA, OBJECTPOINT, 57),
   1.835 +
   1.836 +  /* We want the referrer field set automatically when following locations */
   1.837 +  CINIT(AUTOREFERER, LONG, 58),
   1.838 +
   1.839 +  /* Port of the proxy, can be set in the proxy string as well with:
   1.840 +     "[host]:[port]" */
   1.841 +  CINIT(PROXYPORT, LONG, 59),
   1.842 +
   1.843 +  /* size of the POST input data, if strlen() is not good to use */
   1.844 +  CINIT(POSTFIELDSIZE, LONG, 60),
   1.845 +
   1.846 +  /* tunnel non-http operations through a HTTP proxy */
   1.847 +  CINIT(HTTPPROXYTUNNEL, LONG, 61),
   1.848 +
   1.849 +  /* Set the interface string to use as outgoing network interface */
   1.850 +  CINIT(INTERFACE, OBJECTPOINT, 62),
   1.851 +
   1.852 +  /* Set the krb4/5 security level, this also enables krb4/5 awareness.  This
   1.853 +   * is a string, 'clear', 'safe', 'confidential' or 'private'.  If the string
   1.854 +   * is set but doesn't match one of these, 'private' will be used.  */
   1.855 +  CINIT(KRBLEVEL, OBJECTPOINT, 63),
   1.856 +
   1.857 +  /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
   1.858 +  CINIT(SSL_VERIFYPEER, LONG, 64),
   1.859 +
   1.860 +  /* The CApath or CAfile used to validate the peer certificate
   1.861 +     this option is used only if SSL_VERIFYPEER is true */
   1.862 +  CINIT(CAINFO, OBJECTPOINT, 65),
   1.863 +
   1.864 +  /* 66 = OBSOLETE */
   1.865 +  /* 67 = OBSOLETE */
   1.866 +
   1.867 +  /* Maximum number of http redirects to follow */
   1.868 +  CINIT(MAXREDIRS, LONG, 68),
   1.869 +
   1.870 +  /* Pass a long set to 1 to get the date of the requested document (if
   1.871 +     possible)! Pass a zero to shut it off. */
   1.872 +  CINIT(FILETIME, LONG, 69),
   1.873 +
   1.874 +  /* This points to a linked list of telnet options */
   1.875 +  CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
   1.876 +
   1.877 +  /* Max amount of cached alive connections */
   1.878 +  CINIT(MAXCONNECTS, LONG, 71),
   1.879 +
   1.880 +  /* What policy to use when closing connections when the cache is filled
   1.881 +     up */
   1.882 +  CINIT(CLOSEPOLICY, LONG, 72),
   1.883 +
   1.884 +  /* 73 = OBSOLETE */
   1.885 +
   1.886 +  /* Set to explicitly use a new connection for the upcoming transfer.
   1.887 +     Do not use this unless you're absolutely sure of this, as it makes the
   1.888 +     operation slower and is less friendly for the network. */
   1.889 +  CINIT(FRESH_CONNECT, LONG, 74),
   1.890 +
   1.891 +  /* Set to explicitly forbid the upcoming transfer's connection to be re-used
   1.892 +     when done. Do not use this unless you're absolutely sure of this, as it
   1.893 +     makes the operation slower and is less friendly for the network. */
   1.894 +  CINIT(FORBID_REUSE, LONG, 75),
   1.895 +
   1.896 +  /* Set to a file name that contains random data for libcurl to use to
   1.897 +     seed the random engine when doing SSL connects. */
   1.898 +  CINIT(RANDOM_FILE, OBJECTPOINT, 76),
   1.899 +
   1.900 +  /* Set to the Entropy Gathering Daemon socket pathname */
   1.901 +  CINIT(EGDSOCKET, OBJECTPOINT, 77),
   1.902 +
   1.903 +  /* Time-out connect operations after this amount of seconds, if connects
   1.904 +     are OK within this time, then fine... This only aborts the connect
   1.905 +     phase. [Only works on unix-style/SIGALRM operating systems] */
   1.906 +  CINIT(CONNECTTIMEOUT, LONG, 78),
   1.907 +
   1.908 +  /* Function that will be called to store headers (instead of fwrite). The
   1.909 +   * parameters will use fwrite() syntax, make sure to follow them. */
   1.910 +  CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
   1.911 +
   1.912 +  /* Set this to force the HTTP request to get back to GET. Only really usable
   1.913 +     if POST, PUT or a custom request have been used first.
   1.914 +   */
   1.915 +  CINIT(HTTPGET, LONG, 80),
   1.916 +
   1.917 +  /* Set if we should verify the Common name from the peer certificate in ssl
   1.918 +   * handshake, set 1 to check existence, 2 to ensure that it matches the
   1.919 +   * provided hostname. */
   1.920 +  CINIT(SSL_VERIFYHOST, LONG, 81),
   1.921 +
   1.922 +  /* Specify which file name to write all known cookies in after completed
   1.923 +     operation. Set file name to "-" (dash) to make it go to stdout. */
   1.924 +  CINIT(COOKIEJAR, OBJECTPOINT, 82),
   1.925 +
   1.926 +  /* Specify which SSL ciphers to use */
   1.927 +  CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),
   1.928 +
   1.929 +  /* Specify which HTTP version to use! This must be set to one of the
   1.930 +     CURL_HTTP_VERSION* enums set below. */
   1.931 +  CINIT(HTTP_VERSION, LONG, 84),
   1.932 +
   1.933 +  /* Specifically switch on or off the FTP engine's use of the EPSV command. By
   1.934 +     default, that one will always be attempted before the more traditional
   1.935 +     PASV command. */
   1.936 +  CINIT(FTP_USE_EPSV, LONG, 85),
   1.937 +
   1.938 +  /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
   1.939 +  CINIT(SSLCERTTYPE, OBJECTPOINT, 86),
   1.940 +
   1.941 +  /* name of the file keeping your private SSL-key */
   1.942 +  CINIT(SSLKEY, OBJECTPOINT, 87),
   1.943 +
   1.944 +  /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
   1.945 +  CINIT(SSLKEYTYPE, OBJECTPOINT, 88),
   1.946 +
   1.947 +  /* crypto engine for the SSL-sub system */
   1.948 +  CINIT(SSLENGINE, OBJECTPOINT, 89),
   1.949 +
   1.950 +  /* set the crypto engine for the SSL-sub system as default
   1.951 +     the param has no meaning...
   1.952 +   */
   1.953 +  CINIT(SSLENGINE_DEFAULT, LONG, 90),
   1.954 +
   1.955 +  /* Non-zero value means to use the global dns cache */
   1.956 +  CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */
   1.957 +
   1.958 +  /* DNS cache timeout */
   1.959 +  CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
   1.960 +
   1.961 +  /* send linked-list of pre-transfer QUOTE commands */
   1.962 +  CINIT(PREQUOTE, OBJECTPOINT, 93),
   1.963 +
   1.964 +  /* set the debug function */
   1.965 +  CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
   1.966 +
   1.967 +  /* set the data for the debug function */
   1.968 +  CINIT(DEBUGDATA, OBJECTPOINT, 95),
   1.969 +
   1.970 +  /* mark this as start of a cookie session */
   1.971 +  CINIT(COOKIESESSION, LONG, 96),
   1.972 +
   1.973 +  /* The CApath directory used to validate the peer certificate
   1.974 +     this option is used only if SSL_VERIFYPEER is true */
   1.975 +  CINIT(CAPATH, OBJECTPOINT, 97),
   1.976 +
   1.977 +  /* Instruct libcurl to use a smaller receive buffer */
   1.978 +  CINIT(BUFFERSIZE, LONG, 98),
   1.979 +
   1.980 +  /* Instruct libcurl to not use any signal/alarm handlers, even when using
   1.981 +     timeouts. This option is useful for multi-threaded applications.
   1.982 +     See libcurl-the-guide for more background information. */
   1.983 +  CINIT(NOSIGNAL, LONG, 99),
   1.984 +
   1.985 +  /* Provide a CURLShare for mutexing non-ts data */
   1.986 +  CINIT(SHARE, OBJECTPOINT, 100),
   1.987 +
   1.988 +  /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
   1.989 +     CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */
   1.990 +  CINIT(PROXYTYPE, LONG, 101),
   1.991 +
   1.992 +  /* Set the Accept-Encoding string. Use this to tell a server you would like
   1.993 +     the response to be compressed. */
   1.994 +  CINIT(ENCODING, OBJECTPOINT, 102),
   1.995 +
   1.996 +  /* Set pointer to private data */
   1.997 +  CINIT(PRIVATE, OBJECTPOINT, 103),
   1.998 +
   1.999 +  /* Set aliases for HTTP 200 in the HTTP Response header */
  1.1000 +  CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
  1.1001 +
  1.1002 +  /* Continue to send authentication (user+password) when following locations,
  1.1003 +     even when hostname changed. This can potentially send off the name
  1.1004 +     and password to whatever host the server decides. */
  1.1005 +  CINIT(UNRESTRICTED_AUTH, LONG, 105),
  1.1006 +
  1.1007 +  /* Specifically switch on or off the FTP engine's use of the EPRT command ( it
  1.1008 +     also disables the LPRT attempt). By default, those ones will always be
  1.1009 +     attempted before the good old traditional PORT command. */
  1.1010 +  CINIT(FTP_USE_EPRT, LONG, 106),
  1.1011 +
  1.1012 +  /* Set this to a bitmask value to enable the particular authentications
  1.1013 +     methods you like. Use this in combination with CURLOPT_USERPWD.
  1.1014 +     Note that setting multiple bits may cause extra network round-trips. */
  1.1015 +  CINIT(HTTPAUTH, LONG, 107),
  1.1016 +
  1.1017 +  /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
  1.1018 +     in second argument. The function must be matching the
  1.1019 +     curl_ssl_ctx_callback proto. */
  1.1020 +  CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
  1.1021 +
  1.1022 +  /* Set the userdata for the ssl context callback function's third
  1.1023 +     argument */
  1.1024 +  CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
  1.1025 +
  1.1026 +  /* FTP Option that causes missing dirs to be created on the remote server.
  1.1027 +     In 7.19.4 we introduced the convenience enums for this option using the
  1.1028 +     CURLFTP_CREATE_DIR prefix.
  1.1029 +  */
  1.1030 +  CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
  1.1031 +
  1.1032 +  /* Set this to a bitmask value to enable the particular authentications
  1.1033 +     methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
  1.1034 +     Note that setting multiple bits may cause extra network round-trips. */
  1.1035 +  CINIT(PROXYAUTH, LONG, 111),
  1.1036 +
  1.1037 +  /* FTP option that changes the timeout, in seconds, associated with
  1.1038 +     getting a response.  This is different from transfer timeout time and
  1.1039 +     essentially places a demand on the FTP server to acknowledge commands
  1.1040 +     in a timely manner. */
  1.1041 +  CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
  1.1042 +
  1.1043 +  /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
  1.1044 +     tell libcurl to resolve names to those IP versions only. This only has
  1.1045 +     affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
  1.1046 +  CINIT(IPRESOLVE, LONG, 113),
  1.1047 +
  1.1048 +  /* Set this option to limit the size of a file that will be downloaded from
  1.1049 +     an HTTP or FTP server.
  1.1050 +
  1.1051 +     Note there is also _LARGE version which adds large file support for
  1.1052 +     platforms which have larger off_t sizes.  See MAXFILESIZE_LARGE below. */
  1.1053 +  CINIT(MAXFILESIZE, LONG, 114),
  1.1054 +
  1.1055 +  /* See the comment for INFILESIZE above, but in short, specifies
  1.1056 +   * the size of the file being uploaded.  -1 means unknown.
  1.1057 +   */
  1.1058 +  CINIT(INFILESIZE_LARGE, OFF_T, 115),
  1.1059 +
  1.1060 +  /* Sets the continuation offset.  There is also a LONG version of this;
  1.1061 +   * look above for RESUME_FROM.
  1.1062 +   */
  1.1063 +  CINIT(RESUME_FROM_LARGE, OFF_T, 116),
  1.1064 +
  1.1065 +  /* Sets the maximum size of data that will be downloaded from
  1.1066 +   * an HTTP or FTP server.  See MAXFILESIZE above for the LONG version.
  1.1067 +   */
  1.1068 +  CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
  1.1069 +
  1.1070 +  /* Set this option to the file name of your .netrc file you want libcurl
  1.1071 +     to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
  1.1072 +     a poor attempt to find the user's home directory and check for a .netrc
  1.1073 +     file in there. */
  1.1074 +  CINIT(NETRC_FILE, OBJECTPOINT, 118),
  1.1075 +
  1.1076 +  /* Enable SSL/TLS for FTP, pick one of:
  1.1077 +     CURLFTPSSL_TRY     - try using SSL, proceed anyway otherwise
  1.1078 +     CURLFTPSSL_CONTROL - SSL for the control connection or fail
  1.1079 +     CURLFTPSSL_ALL     - SSL for all communication or fail
  1.1080 +  */
  1.1081 +  CINIT(USE_SSL, LONG, 119),
  1.1082 +
  1.1083 +  /* The _LARGE version of the standard POSTFIELDSIZE option */
  1.1084 +  CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
  1.1085 +
  1.1086 +  /* Enable/disable the TCP Nagle algorithm */
  1.1087 +  CINIT(TCP_NODELAY, LONG, 121),
  1.1088 +
  1.1089 +  /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  1.1090 +  /* 123 OBSOLETE. Gone in 7.16.0 */
  1.1091 +  /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  1.1092 +  /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  1.1093 +  /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  1.1094 +  /* 127 OBSOLETE. Gone in 7.16.0 */
  1.1095 +  /* 128 OBSOLETE. Gone in 7.16.0 */
  1.1096 +
  1.1097 +  /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
  1.1098 +     can be used to change libcurl's default action which is to first try
  1.1099 +     "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
  1.1100 +     response has been received.
  1.1101 +
  1.1102 +     Available parameters are:
  1.1103 +     CURLFTPAUTH_DEFAULT - let libcurl decide
  1.1104 +     CURLFTPAUTH_SSL     - try "AUTH SSL" first, then TLS
  1.1105 +     CURLFTPAUTH_TLS     - try "AUTH TLS" first, then SSL
  1.1106 +  */
  1.1107 +  CINIT(FTPSSLAUTH, LONG, 129),
  1.1108 +
  1.1109 +  CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
  1.1110 +  CINIT(IOCTLDATA, OBJECTPOINT, 131),
  1.1111 +
  1.1112 +  /* 132 OBSOLETE. Gone in 7.16.0 */
  1.1113 +  /* 133 OBSOLETE. Gone in 7.16.0 */
  1.1114 +
  1.1115 +  /* zero terminated string for pass on to the FTP server when asked for
  1.1116 +     "account" info */
  1.1117 +  CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),
  1.1118 +
  1.1119 +  /* feed cookies into cookie engine */
  1.1120 +  CINIT(COOKIELIST, OBJECTPOINT, 135),
  1.1121 +
  1.1122 +  /* ignore Content-Length */
  1.1123 +  CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
  1.1124 +
  1.1125 +  /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
  1.1126 +     response. Typically used for FTP-SSL purposes but is not restricted to
  1.1127 +     that. libcurl will then instead use the same IP address it used for the
  1.1128 +     control connection. */
  1.1129 +  CINIT(FTP_SKIP_PASV_IP, LONG, 137),
  1.1130 +
  1.1131 +  /* Select "file method" to use when doing FTP, see the curl_ftpmethod
  1.1132 +     above. */
  1.1133 +  CINIT(FTP_FILEMETHOD, LONG, 138),
  1.1134 +
  1.1135 +  /* Local port number to bind the socket to */
  1.1136 +  CINIT(LOCALPORT, LONG, 139),
  1.1137 +
  1.1138 +  /* Number of ports to try, including the first one set with LOCALPORT.
  1.1139 +     Thus, setting it to 1 will make no additional attempts but the first.
  1.1140 +  */
  1.1141 +  CINIT(LOCALPORTRANGE, LONG, 140),
  1.1142 +
  1.1143 +  /* no transfer, set up connection and let application use the socket by
  1.1144 +     extracting it with CURLINFO_LASTSOCKET */
  1.1145 +  CINIT(CONNECT_ONLY, LONG, 141),
  1.1146 +
  1.1147 +  /* Function that will be called to convert from the
  1.1148 +     network encoding (instead of using the iconv calls in libcurl) */
  1.1149 +  CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
  1.1150 +
  1.1151 +  /* Function that will be called to convert to the
  1.1152 +     network encoding (instead of using the iconv calls in libcurl) */
  1.1153 +  CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
  1.1154 +
  1.1155 +  /* Function that will be called to convert from UTF8
  1.1156 +     (instead of using the iconv calls in libcurl)
  1.1157 +     Note that this is used only for SSL certificate processing */
  1.1158 +  CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
  1.1159 +
  1.1160 +  /* if the connection proceeds too quickly then need to slow it down */
  1.1161 +  /* limit-rate: maximum number of bytes per second to send or receive */
  1.1162 +  CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
  1.1163 +  CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
  1.1164 +
  1.1165 +  /* Pointer to command string to send if USER/PASS fails. */
  1.1166 +  CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
  1.1167 +
  1.1168 +  /* callback function for setting socket options */
  1.1169 +  CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
  1.1170 +  CINIT(SOCKOPTDATA, OBJECTPOINT, 149),
  1.1171 +
  1.1172 +  /* set to 0 to disable session ID re-use for this transfer, default is
  1.1173 +     enabled (== 1) */
  1.1174 +  CINIT(SSL_SESSIONID_CACHE, LONG, 150),
  1.1175 +
  1.1176 +  /* allowed SSH authentication methods */
  1.1177 +  CINIT(SSH_AUTH_TYPES, LONG, 151),
  1.1178 +
  1.1179 +  /* Used by scp/sftp to do public/private key authentication */
  1.1180 +  CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),
  1.1181 +  CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),
  1.1182 +
  1.1183 +  /* Send CCC (Clear Command Channel) after authentication */
  1.1184 +  CINIT(FTP_SSL_CCC, LONG, 154),
  1.1185 +
  1.1186 +  /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
  1.1187 +  CINIT(TIMEOUT_MS, LONG, 155),
  1.1188 +  CINIT(CONNECTTIMEOUT_MS, LONG, 156),
  1.1189 +
  1.1190 +  /* set to zero to disable the libcurl's decoding and thus pass the raw body
  1.1191 +     data to the application even when it is encoded/compressed */
  1.1192 +  CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
  1.1193 +  CINIT(HTTP_CONTENT_DECODING, LONG, 158),
  1.1194 +
  1.1195 +  /* Permission used when creating new files and directories on the remote
  1.1196 +     server for protocols that support it, SFTP/SCP/FILE */
  1.1197 +  CINIT(NEW_FILE_PERMS, LONG, 159),
  1.1198 +  CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
  1.1199 +
  1.1200 +  /* Set the behaviour of POST when redirecting. Values must be set to one
  1.1201 +     of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
  1.1202 +  CINIT(POSTREDIR, LONG, 161),
  1.1203 +
  1.1204 +  /* used by scp/sftp to verify the host's public key */
  1.1205 +  CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),
  1.1206 +
  1.1207 +  /* Callback function for opening socket (instead of socket(2)). Optionally,
  1.1208 +     callback is able change the address or refuse to connect returning
  1.1209 +     CURL_SOCKET_BAD.  The callback should have type
  1.1210 +     curl_opensocket_callback */
  1.1211 +  CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
  1.1212 +  CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
  1.1213 +
  1.1214 +  /* POST volatile input fields. */
  1.1215 +  CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
  1.1216 +
  1.1217 +  /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
  1.1218 +  CINIT(PROXY_TRANSFER_MODE, LONG, 166),
  1.1219 +
  1.1220 +  /* Callback function for seeking in the input stream */
  1.1221 +  CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
  1.1222 +  CINIT(SEEKDATA, OBJECTPOINT, 168),
  1.1223 +
  1.1224 +  /* CRL file */
  1.1225 +  CINIT(CRLFILE, OBJECTPOINT, 169),
  1.1226 +
  1.1227 +  /* Issuer certificate */
  1.1228 +  CINIT(ISSUERCERT, OBJECTPOINT, 170),
  1.1229 +
  1.1230 +  /* (IPv6) Address scope */
  1.1231 +  CINIT(ADDRESS_SCOPE, LONG, 171),
  1.1232 +
  1.1233 +  /* Collect certificate chain info and allow it to get retrievable with
  1.1234 +     CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only
  1.1235 +     working with OpenSSL-powered builds. */
  1.1236 +  CINIT(CERTINFO, LONG, 172),
  1.1237 +
  1.1238 +  /* "name" and "pwd" to use when fetching. */
  1.1239 +  CINIT(USERNAME, OBJECTPOINT, 173),
  1.1240 +  CINIT(PASSWORD, OBJECTPOINT, 174),
  1.1241 +
  1.1242 +    /* "name" and "pwd" to use with Proxy when fetching. */
  1.1243 +  CINIT(PROXYUSERNAME, OBJECTPOINT, 175),
  1.1244 +  CINIT(PROXYPASSWORD, OBJECTPOINT, 176),
  1.1245 +
  1.1246 +  /* Comma separated list of hostnames defining no-proxy zones. These should
  1.1247 +     match both hostnames directly, and hostnames within a domain. For
  1.1248 +     example, local.com will match local.com and www.local.com, but NOT
  1.1249 +     notlocal.com or www.notlocal.com. For compatibility with other
  1.1250 +     implementations of this, .local.com will be considered to be the same as
  1.1251 +     local.com. A single * is the only valid wildcard, and effectively
  1.1252 +     disables the use of proxy. */
  1.1253 +  CINIT(NOPROXY, OBJECTPOINT, 177),
  1.1254 +
  1.1255 +  /* block size for TFTP transfers */
  1.1256 +  CINIT(TFTP_BLKSIZE, LONG, 178),
  1.1257 +
  1.1258 +  /* Socks Service */
  1.1259 +  CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),
  1.1260 +
  1.1261 +  /* Socks Service */
  1.1262 +  CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
  1.1263 +
  1.1264 +  /* set the bitmask for the protocols that are allowed to be used for the
  1.1265 +     transfer, which thus helps the app which takes URLs from users or other
  1.1266 +     external inputs and want to restrict what protocol(s) to deal
  1.1267 +     with. Defaults to CURLPROTO_ALL. */
  1.1268 +  CINIT(PROTOCOLS, LONG, 181),
  1.1269 +
  1.1270 +  /* set the bitmask for the protocols that libcurl is allowed to follow to,
  1.1271 +     as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
  1.1272 +     to be set in both bitmasks to be allowed to get redirected to. Defaults
  1.1273 +     to all protocols except FILE and SCP. */
  1.1274 +  CINIT(REDIR_PROTOCOLS, LONG, 182),
  1.1275 +
  1.1276 +  /* set the SSH knownhost file name to use */
  1.1277 +  CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),
  1.1278 +
  1.1279 +  /* set the SSH host key callback, must point to a curl_sshkeycallback
  1.1280 +     function */
  1.1281 +  CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
  1.1282 +
  1.1283 +  /* set the SSH host key callback custom pointer */
  1.1284 +  CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
  1.1285 +
  1.1286 +  CURLOPT_LASTENTRY /* the last unused */
  1.1287 +} CURLoption;
  1.1288 +
  1.1289 +#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
  1.1290 +                          the obsolete stuff removed! */
  1.1291 +
  1.1292 +/* Backwards compatibility with older names */
  1.1293 +/* These are scheduled to disappear by 2011 */
  1.1294 +
  1.1295 +/* This was added in version 7.19.1 */
  1.1296 +#define CURLOPT_POST301 CURLOPT_POSTREDIR
  1.1297 +
  1.1298 +/* These are scheduled to disappear by 2009 */
  1.1299 +
  1.1300 +/* The following were added in 7.17.0 */
  1.1301 +#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD
  1.1302 +#define CURLOPT_FTPAPPEND CURLOPT_APPEND
  1.1303 +#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY
  1.1304 +#define CURLOPT_FTP_SSL CURLOPT_USE_SSL
  1.1305 +
  1.1306 +/* The following were added earlier */
  1.1307 +
  1.1308 +#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
  1.1309 +#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
  1.1310 +
  1.1311 +#else
  1.1312 +/* This is set if CURL_NO_OLDIES is defined at compile-time */
  1.1313 +#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
  1.1314 +#endif
  1.1315 +
  1.1316 +
  1.1317 +  /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
  1.1318 +     name resolves addresses using more than one IP protocol version, this
  1.1319 +     option might be handy to force libcurl to use a specific IP version. */
  1.1320 +#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP
  1.1321 +                                     versions that your system allows */
  1.1322 +#define CURL_IPRESOLVE_V4       1 /* resolve to ipv4 addresses */
  1.1323 +#define CURL_IPRESOLVE_V6       2 /* resolve to ipv6 addresses */
  1.1324 +
  1.1325 +  /* three convenient "aliases" that follow the name scheme better */
  1.1326 +#define CURLOPT_WRITEDATA CURLOPT_FILE
  1.1327 +#define CURLOPT_READDATA  CURLOPT_INFILE
  1.1328 +#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER
  1.1329 +
  1.1330 +  /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
  1.1331 +enum {
  1.1332 +  CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
  1.1333 +                             like the library to choose the best possible
  1.1334 +                             for us! */
  1.1335 +  CURL_HTTP_VERSION_1_0,  /* please use HTTP 1.0 in the request */
  1.1336 +  CURL_HTTP_VERSION_1_1,  /* please use HTTP 1.1 in the request */
  1.1337 +
  1.1338 +  CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
  1.1339 +};
  1.1340 +
  1.1341 +  /* These enums are for use with the CURLOPT_NETRC option. */
  1.1342 +enum CURL_NETRC_OPTION {
  1.1343 +  CURL_NETRC_IGNORED,     /* The .netrc will never be read.
  1.1344 +                           * This is the default. */
  1.1345 +  CURL_NETRC_OPTIONAL,    /* A user:password in the URL will be preferred
  1.1346 +                           * to one in the .netrc. */
  1.1347 +  CURL_NETRC_REQUIRED,    /* A user:password in the URL will be ignored.
  1.1348 +                           * Unless one is set programmatically, the .netrc
  1.1349 +                           * will be queried. */
  1.1350 +  CURL_NETRC_LAST
  1.1351 +};
  1.1352 +
  1.1353 +enum {
  1.1354 +  CURL_SSLVERSION_DEFAULT,
  1.1355 +  CURL_SSLVERSION_TLSv1,
  1.1356 +  CURL_SSLVERSION_SSLv2,
  1.1357 +  CURL_SSLVERSION_SSLv3,
  1.1358 +
  1.1359 +  CURL_SSLVERSION_LAST /* never use, keep last */
  1.1360 +};
  1.1361 +
  1.1362 +/* symbols to use with CURLOPT_POSTREDIR.
  1.1363 +   CURL_REDIR_POST_301 and CURL_REDIR_POST_302 can be bitwise ORed so that
  1.1364 +   CURL_REDIR_POST_301 | CURL_REDIR_POST_302 == CURL_REDIR_POST_ALL */
  1.1365 +
  1.1366 +#define CURL_REDIR_GET_ALL  0
  1.1367 +#define CURL_REDIR_POST_301 1
  1.1368 +#define CURL_REDIR_POST_302 2
  1.1369 +#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302)
  1.1370 +
  1.1371 +typedef enum {
  1.1372 +  CURL_TIMECOND_NONE,
  1.1373 +
  1.1374 +  CURL_TIMECOND_IFMODSINCE,
  1.1375 +  CURL_TIMECOND_IFUNMODSINCE,
  1.1376 +  CURL_TIMECOND_LASTMOD,
  1.1377 +
  1.1378 +  CURL_TIMECOND_LAST
  1.1379 +} curl_TimeCond;
  1.1380 +
  1.1381 +
  1.1382 +/* curl_strequal() and curl_strnequal() are subject for removal in a future
  1.1383 +   libcurl, see lib/README.curlx for details */
  1.1384 +CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2);
  1.1385 +CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);
  1.1386 +
  1.1387 +/* name is uppercase CURLFORM_<name> */
  1.1388 +#ifdef CFINIT
  1.1389 +#undef CFINIT
  1.1390 +#endif
  1.1391 +
  1.1392 +#ifdef CURL_ISOCPP
  1.1393 +#define CFINIT(name) CURLFORM_ ## name
  1.1394 +#else
  1.1395 +/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
  1.1396 +#define CFINIT(name) CURLFORM_/**/name
  1.1397 +#endif
  1.1398 +
  1.1399 +typedef enum {
  1.1400 +  CFINIT(NOTHING),        /********* the first one is unused ************/
  1.1401 +
  1.1402 +  /*  */
  1.1403 +  CFINIT(COPYNAME),
  1.1404 +  CFINIT(PTRNAME),
  1.1405 +  CFINIT(NAMELENGTH),
  1.1406 +  CFINIT(COPYCONTENTS),
  1.1407 +  CFINIT(PTRCONTENTS),
  1.1408 +  CFINIT(CONTENTSLENGTH),
  1.1409 +  CFINIT(FILECONTENT),
  1.1410 +  CFINIT(ARRAY),
  1.1411 +  CFINIT(OBSOLETE),
  1.1412 +  CFINIT(FILE),
  1.1413 +
  1.1414 +  CFINIT(BUFFER),
  1.1415 +  CFINIT(BUFFERPTR),
  1.1416 +  CFINIT(BUFFERLENGTH),
  1.1417 +
  1.1418 +  CFINIT(CONTENTTYPE),
  1.1419 +  CFINIT(CONTENTHEADER),
  1.1420 +  CFINIT(FILENAME),
  1.1421 +  CFINIT(END),
  1.1422 +  CFINIT(OBSOLETE2),
  1.1423 +
  1.1424 +  CFINIT(STREAM),
  1.1425 +
  1.1426 +  CURLFORM_LASTENTRY /* the last unused */
  1.1427 +} CURLformoption;
  1.1428 +
  1.1429 +#undef CFINIT /* done */
  1.1430 +
  1.1431 +/* structure to be used as parameter for CURLFORM_ARRAY */
  1.1432 +struct curl_forms {
  1.1433 +  CURLformoption option;
  1.1434 +  const char     *value;
  1.1435 +};
  1.1436 +
  1.1437 +/* use this for multipart formpost building */
  1.1438 +/* Returns code for curl_formadd()
  1.1439 + *
  1.1440 + * Returns:
  1.1441 + * CURL_FORMADD_OK             on success
  1.1442 + * CURL_FORMADD_MEMORY         if the FormInfo allocation fails
  1.1443 + * CURL_FORMADD_OPTION_TWICE   if one option is given twice for one Form
  1.1444 + * CURL_FORMADD_NULL           if a null pointer was given for a char
  1.1445 + * CURL_FORMADD_MEMORY         if the allocation of a FormInfo struct failed
  1.1446 + * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used
  1.1447 + * CURL_FORMADD_INCOMPLETE     if the some FormInfo is not complete (or error)
  1.1448 + * CURL_FORMADD_MEMORY         if a curl_httppost struct cannot be allocated
  1.1449 + * CURL_FORMADD_MEMORY         if some allocation for string copying failed.
  1.1450 + * CURL_FORMADD_ILLEGAL_ARRAY  if an illegal option is used in an array
  1.1451 + *
  1.1452 + ***************************************************************************/
  1.1453 +typedef enum {
  1.1454 +  CURL_FORMADD_OK, /* first, no error */
  1.1455 +
  1.1456 +  CURL_FORMADD_MEMORY,
  1.1457 +  CURL_FORMADD_OPTION_TWICE,
  1.1458 +  CURL_FORMADD_NULL,
  1.1459 +  CURL_FORMADD_UNKNOWN_OPTION,
  1.1460 +  CURL_FORMADD_INCOMPLETE,
  1.1461 +  CURL_FORMADD_ILLEGAL_ARRAY,
  1.1462 +  CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
  1.1463 +
  1.1464 +  CURL_FORMADD_LAST /* last */
  1.1465 +} CURLFORMcode;
  1.1466 +
  1.1467 +/*
  1.1468 + * NAME curl_formadd()
  1.1469 + *
  1.1470 + * DESCRIPTION
  1.1471 + *
  1.1472 + * Pretty advanced function for building multi-part formposts. Each invoke
  1.1473 + * adds one part that together construct a full post. Then use
  1.1474 + * CURLOPT_HTTPPOST to send it off to libcurl.
  1.1475 + */
  1.1476 +CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
  1.1477 +                                      struct curl_httppost **last_post,
  1.1478 +                                      ...);
  1.1479 +
  1.1480 +/*
  1.1481 + * callback function for curl_formget()
  1.1482 + * The void *arg pointer will be the one passed as second argument to
  1.1483 + *   curl_formget().
  1.1484 + * The character buffer passed to it must not be freed.
  1.1485 + * Should return the buffer length passed to it as the argument "len" on
  1.1486 + *   success.
  1.1487 + */
  1.1488 +typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len);
  1.1489 +
  1.1490 +/*
  1.1491 + * NAME curl_formget()
  1.1492 + *
  1.1493 + * DESCRIPTION
  1.1494 + *
  1.1495 + * Serialize a curl_httppost struct built with curl_formadd().
  1.1496 + * Accepts a void pointer as second argument which will be passed to
  1.1497 + * the curl_formget_callback function.
  1.1498 + * Returns 0 on success.
  1.1499 + */
  1.1500 +CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,
  1.1501 +                             curl_formget_callback append);
  1.1502 +/*
  1.1503 + * NAME curl_formfree()
  1.1504 + *
  1.1505 + * DESCRIPTION
  1.1506 + *
  1.1507 + * Free a multipart formpost previously built with curl_formadd().
  1.1508 + */
  1.1509 +CURL_EXTERN void curl_formfree(struct curl_httppost *form);
  1.1510 +
  1.1511 +/*
  1.1512 + * NAME curl_getenv()
  1.1513 + *
  1.1514 + * DESCRIPTION
  1.1515 + *
  1.1516 + * Returns a malloc()'ed string that MUST be curl_free()ed after usage is
  1.1517 + * complete. DEPRECATED - see lib/README.curlx
  1.1518 + */
  1.1519 +CURL_EXTERN char *curl_getenv(const char *variable);
  1.1520 +
  1.1521 +/*
  1.1522 + * NAME curl_version()
  1.1523 + *
  1.1524 + * DESCRIPTION
  1.1525 + *
  1.1526 + * Returns a static ascii string of the libcurl version.
  1.1527 + */
  1.1528 +CURL_EXTERN char *curl_version(void);
  1.1529 +
  1.1530 +/*
  1.1531 + * NAME curl_easy_escape()
  1.1532 + *
  1.1533 + * DESCRIPTION
  1.1534 + *
  1.1535 + * Escapes URL strings (converts all letters consider illegal in URLs to their
  1.1536 + * %XX versions). This function returns a new allocated string or NULL if an
  1.1537 + * error occurred.
  1.1538 + */
  1.1539 +CURL_EXTERN char *curl_easy_escape(CURL *handle,
  1.1540 +                                   const char *string,
  1.1541 +                                   int length);
  1.1542 +
  1.1543 +/* the previous version: */
  1.1544 +CURL_EXTERN char *curl_escape(const char *string,
  1.1545 +                              int length);
  1.1546 +
  1.1547 +
  1.1548 +/*
  1.1549 + * NAME curl_easy_unescape()
  1.1550 + *
  1.1551 + * DESCRIPTION
  1.1552 + *
  1.1553 + * Unescapes URL encoding in strings (converts all %XX codes to their 8bit
  1.1554 + * versions). This function returns a new allocated string or NULL if an error
  1.1555 + * occurred.
  1.1556 + * Conversion Note: On non-ASCII platforms the ASCII %XX codes are
  1.1557 + * converted into the host encoding.
  1.1558 + */
  1.1559 +CURL_EXTERN char *curl_easy_unescape(CURL *handle,
  1.1560 +                                     const char *string,
  1.1561 +                                     int length,
  1.1562 +                                     int *outlength);
  1.1563 +
  1.1564 +/* the previous version */
  1.1565 +CURL_EXTERN char *curl_unescape(const char *string,
  1.1566 +                                int length);
  1.1567 +
  1.1568 +/*
  1.1569 + * NAME curl_free()
  1.1570 + *
  1.1571 + * DESCRIPTION
  1.1572 + *
  1.1573 + * Provided for de-allocation in the same translation unit that did the
  1.1574 + * allocation. Added in libcurl 7.10
  1.1575 + */
  1.1576 +CURL_EXTERN void curl_free(void *p);
  1.1577 +
  1.1578 +/*
  1.1579 + * NAME curl_global_init()
  1.1580 + *
  1.1581 + * DESCRIPTION
  1.1582 + *
  1.1583 + * curl_global_init() should be invoked exactly once for each application that
  1.1584 + * uses libcurl and before any call of other libcurl functions.
  1.1585 + *
  1.1586 + * This function is not thread-safe!
  1.1587 + */
  1.1588 +CURL_EXTERN CURLcode curl_global_init(long flags);
  1.1589 +
  1.1590 +/*
  1.1591 + * NAME curl_global_init_mem()
  1.1592 + *
  1.1593 + * DESCRIPTION
  1.1594 + *
  1.1595 + * curl_global_init() or curl_global_init_mem() should be invoked exactly once
  1.1596 + * for each application that uses libcurl.  This function can be used to
  1.1597 + * initialize libcurl and set user defined memory management callback
  1.1598 + * functions.  Users can implement memory management routines to check for
  1.1599 + * memory leaks, check for mis-use of the curl library etc.  User registered
  1.1600 + * callback routines with be invoked by this library instead of the system
  1.1601 + * memory management routines like malloc, free etc.
  1.1602 + */
  1.1603 +CURL_EXTERN CURLcode curl_global_init_mem(long flags,
  1.1604 +                                          curl_malloc_callback m,
  1.1605 +                                          curl_free_callback f,
  1.1606 +                                          curl_realloc_callback r,
  1.1607 +                                          curl_strdup_callback s,
  1.1608 +                                          curl_calloc_callback c);
  1.1609 +
  1.1610 +/*
  1.1611 + * NAME curl_global_cleanup()
  1.1612 + *
  1.1613 + * DESCRIPTION
  1.1614 + *
  1.1615 + * curl_global_cleanup() should be invoked exactly once for each application
  1.1616 + * that uses libcurl
  1.1617 + */
  1.1618 +CURL_EXTERN void curl_global_cleanup(void);
  1.1619 +
  1.1620 +/* linked-list structure for the CURLOPT_QUOTE option (and other) */
  1.1621 +struct curl_slist {
  1.1622 +  char *data;
  1.1623 +  struct curl_slist *next;
  1.1624 +};
  1.1625 +
  1.1626 +/*
  1.1627 + * NAME curl_slist_append()
  1.1628 + *
  1.1629 + * DESCRIPTION
  1.1630 + *
  1.1631 + * Appends a string to a linked list. If no list exists, it will be created
  1.1632 + * first. Returns the new list, after appending.
  1.1633 + */
  1.1634 +CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
  1.1635 +                                                 const char *);
  1.1636 +
  1.1637 +/*
  1.1638 + * NAME curl_slist_free_all()
  1.1639 + *
  1.1640 + * DESCRIPTION
  1.1641 + *
  1.1642 + * free a previously built curl_slist.
  1.1643 + */
  1.1644 +CURL_EXTERN void curl_slist_free_all(struct curl_slist *);
  1.1645 +
  1.1646 +/*
  1.1647 + * NAME curl_getdate()
  1.1648 + *
  1.1649 + * DESCRIPTION
  1.1650 + *
  1.1651 + * Returns the time, in seconds since 1 Jan 1970 of the time string given in
  1.1652 + * the first argument. The time argument in the second parameter is unused
  1.1653 + * and should be set to NULL.
  1.1654 + */
  1.1655 +CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
  1.1656 +
  1.1657 +/* info about the certificate chain, only for OpenSSL builds. Asked
  1.1658 +   for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
  1.1659 +struct curl_certinfo {
  1.1660 +  int num_of_certs;             /* number of certificates with information */
  1.1661 +  struct curl_slist **certinfo; /* for each index in this array, there's a
  1.1662 +                                   linked list with textual information in the
  1.1663 +                                   format "name: value" */
  1.1664 +};
  1.1665 +
  1.1666 +#define CURLINFO_STRING   0x100000
  1.1667 +#define CURLINFO_LONG     0x200000
  1.1668 +#define CURLINFO_DOUBLE   0x300000
  1.1669 +#define CURLINFO_SLIST    0x400000
  1.1670 +#define CURLINFO_MASK     0x0fffff
  1.1671 +#define CURLINFO_TYPEMASK 0xf00000
  1.1672 +
  1.1673 +typedef enum {
  1.1674 +  CURLINFO_NONE, /* first, never use this */
  1.1675 +  CURLINFO_EFFECTIVE_URL    = CURLINFO_STRING + 1,
  1.1676 +  CURLINFO_RESPONSE_CODE    = CURLINFO_LONG   + 2,
  1.1677 +  CURLINFO_TOTAL_TIME       = CURLINFO_DOUBLE + 3,
  1.1678 +  CURLINFO_NAMELOOKUP_TIME  = CURLINFO_DOUBLE + 4,
  1.1679 +  CURLINFO_CONNECT_TIME     = CURLINFO_DOUBLE + 5,
  1.1680 +  CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
  1.1681 +  CURLINFO_SIZE_UPLOAD      = CURLINFO_DOUBLE + 7,
  1.1682 +  CURLINFO_SIZE_DOWNLOAD    = CURLINFO_DOUBLE + 8,
  1.1683 +  CURLINFO_SPEED_DOWNLOAD   = CURLINFO_DOUBLE + 9,
  1.1684 +  CURLINFO_SPEED_UPLOAD     = CURLINFO_DOUBLE + 10,
  1.1685 +  CURLINFO_HEADER_SIZE      = CURLINFO_LONG   + 11,
  1.1686 +  CURLINFO_REQUEST_SIZE     = CURLINFO_LONG   + 12,
  1.1687 +  CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG   + 13,
  1.1688 +  CURLINFO_FILETIME         = CURLINFO_LONG   + 14,
  1.1689 +  CURLINFO_CONTENT_LENGTH_DOWNLOAD   = CURLINFO_DOUBLE + 15,
  1.1690 +  CURLINFO_CONTENT_LENGTH_UPLOAD     = CURLINFO_DOUBLE + 16,
  1.1691 +  CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
  1.1692 +  CURLINFO_CONTENT_TYPE     = CURLINFO_STRING + 18,
  1.1693 +  CURLINFO_REDIRECT_TIME    = CURLINFO_DOUBLE + 19,
  1.1694 +  CURLINFO_REDIRECT_COUNT   = CURLINFO_LONG   + 20,
  1.1695 +  CURLINFO_PRIVATE          = CURLINFO_STRING + 21,
  1.1696 +  CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG   + 22,
  1.1697 +  CURLINFO_HTTPAUTH_AVAIL   = CURLINFO_LONG   + 23,
  1.1698 +  CURLINFO_PROXYAUTH_AVAIL  = CURLINFO_LONG   + 24,
  1.1699 +  CURLINFO_OS_ERRNO         = CURLINFO_LONG   + 25,
  1.1700 +  CURLINFO_NUM_CONNECTS     = CURLINFO_LONG   + 26,
  1.1701 +  CURLINFO_SSL_ENGINES      = CURLINFO_SLIST  + 27,
  1.1702 +  CURLINFO_COOKIELIST       = CURLINFO_SLIST  + 28,
  1.1703 +  CURLINFO_LASTSOCKET       = CURLINFO_LONG   + 29,
  1.1704 +  CURLINFO_FTP_ENTRY_PATH   = CURLINFO_STRING + 30,
  1.1705 +  CURLINFO_REDIRECT_URL     = CURLINFO_STRING + 31,
  1.1706 +  CURLINFO_PRIMARY_IP       = CURLINFO_STRING + 32,
  1.1707 +  CURLINFO_APPCONNECT_TIME  = CURLINFO_DOUBLE + 33,
  1.1708 +  CURLINFO_CERTINFO         = CURLINFO_SLIST  + 34,
  1.1709 +  CURLINFO_CONDITION_UNMET  = CURLINFO_LONG   + 35,
  1.1710 +  /* Fill in new entries below here! */
  1.1711 +
  1.1712 +  CURLINFO_LASTONE          = 35
  1.1713 +} CURLINFO;
  1.1714 +
  1.1715 +/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
  1.1716 +   CURLINFO_HTTP_CODE */
  1.1717 +#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
  1.1718 +
  1.1719 +typedef enum {
  1.1720 +  CURLCLOSEPOLICY_NONE, /* first, never use this */
  1.1721 +
  1.1722 +  CURLCLOSEPOLICY_OLDEST,
  1.1723 +  CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
  1.1724 +  CURLCLOSEPOLICY_LEAST_TRAFFIC,
  1.1725 +  CURLCLOSEPOLICY_SLOWEST,
  1.1726 +  CURLCLOSEPOLICY_CALLBACK,
  1.1727 +
  1.1728 +  CURLCLOSEPOLICY_LAST /* last, never use this */
  1.1729 +} curl_closepolicy;
  1.1730 +
  1.1731 +#define CURL_GLOBAL_SSL (1<<0)
  1.1732 +#define CURL_GLOBAL_WIN32 (1<<1)
  1.1733 +#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
  1.1734 +#define CURL_GLOBAL_NOTHING 0
  1.1735 +#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
  1.1736 +
  1.1737 +
  1.1738 +/*****************************************************************************
  1.1739 + * Setup defines, protos etc for the sharing stuff.
  1.1740 + */
  1.1741 +
  1.1742 +/* Different data locks for a single share */
  1.1743 +typedef enum {
  1.1744 +  CURL_LOCK_DATA_NONE = 0,
  1.1745 +  /*  CURL_LOCK_DATA_SHARE is used internally to say that
  1.1746 +   *  the locking is just made to change the internal state of the share
  1.1747 +   *  itself.
  1.1748 +   */
  1.1749 +  CURL_LOCK_DATA_SHARE,
  1.1750 +  CURL_LOCK_DATA_COOKIE,
  1.1751 +  CURL_LOCK_DATA_DNS,
  1.1752 +  CURL_LOCK_DATA_SSL_SESSION,
  1.1753 +  CURL_LOCK_DATA_CONNECT,
  1.1754 +  CURL_LOCK_DATA_LAST
  1.1755 +} curl_lock_data;
  1.1756 +
  1.1757 +/* Different lock access types */
  1.1758 +typedef enum {
  1.1759 +  CURL_LOCK_ACCESS_NONE = 0,   /* unspecified action */
  1.1760 +  CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
  1.1761 +  CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
  1.1762 +  CURL_LOCK_ACCESS_LAST        /* never use */
  1.1763 +} curl_lock_access;
  1.1764 +
  1.1765 +typedef void (*curl_lock_function)(CURL *handle,
  1.1766 +                                   curl_lock_data data,
  1.1767 +                                   curl_lock_access locktype,
  1.1768 +                                   void *userptr);
  1.1769 +typedef void (*curl_unlock_function)(CURL *handle,
  1.1770 +                                     curl_lock_data data,
  1.1771 +                                     void *userptr);
  1.1772 +
  1.1773 +typedef void CURLSH;
  1.1774 +
  1.1775 +typedef enum {
  1.1776 +  CURLSHE_OK,  /* all is fine */
  1.1777 +  CURLSHE_BAD_OPTION, /* 1 */
  1.1778 +  CURLSHE_IN_USE,     /* 2 */
  1.1779 +  CURLSHE_INVALID,    /* 3 */
  1.1780 +  CURLSHE_NOMEM,      /* out of memory */
  1.1781 +  CURLSHE_LAST /* never use */
  1.1782 +} CURLSHcode;
  1.1783 +
  1.1784 +typedef enum {
  1.1785 +  CURLSHOPT_NONE,  /* don't use */
  1.1786 +  CURLSHOPT_SHARE,   /* specify a data type to share */
  1.1787 +  CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
  1.1788 +  CURLSHOPT_LOCKFUNC,   /* pass in a 'curl_lock_function' pointer */
  1.1789 +  CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
  1.1790 +  CURLSHOPT_USERDATA,   /* pass in a user data pointer used in the lock/unlock
  1.1791 +                           callback functions */
  1.1792 +  CURLSHOPT_LAST  /* never use */
  1.1793 +} CURLSHoption;
  1.1794 +
  1.1795 +CURL_EXTERN CURLSH *curl_share_init(void);
  1.1796 +CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);
  1.1797 +CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);
  1.1798 +
  1.1799 +/****************************************************************************
  1.1800 + * Structures for querying information about the curl library at runtime.
  1.1801 + */
  1.1802 +
  1.1803 +typedef enum {
  1.1804 +  CURLVERSION_FIRST,
  1.1805 +  CURLVERSION_SECOND,
  1.1806 +  CURLVERSION_THIRD,
  1.1807 +  CURLVERSION_FOURTH,
  1.1808 +  CURLVERSION_LAST /* never actually use this */
  1.1809 +} CURLversion;
  1.1810 +
  1.1811 +/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
  1.1812 +   basically all programs ever that want to get version information. It is
  1.1813 +   meant to be a built-in version number for what kind of struct the caller
  1.1814 +   expects. If the struct ever changes, we redefine the NOW to another enum
  1.1815 +   from above. */
  1.1816 +#define CURLVERSION_NOW CURLVERSION_FOURTH
  1.1817 +
  1.1818 +typedef struct {
  1.1819 +  CURLversion age;          /* age of the returned struct */
  1.1820 +  const char *version;      /* LIBCURL_VERSION */
  1.1821 +  unsigned int version_num; /* LIBCURL_VERSION_NUM */
  1.1822 +  const char *host;         /* OS/host/cpu/machine when configured */
  1.1823 +  int features;             /* bitmask, see defines below */
  1.1824 +  const char *ssl_version;  /* human readable string */
  1.1825 +  long ssl_version_num;     /* not used anymore, always 0 */
  1.1826 +  const char *libz_version; /* human readable string */
  1.1827 +  /* protocols is terminated by an entry with a NULL protoname */
  1.1828 +  const char * const *protocols;
  1.1829 +
  1.1830 +  /* The fields below this were added in CURLVERSION_SECOND */
  1.1831 +  const char *ares;
  1.1832 +  int ares_num;
  1.1833 +
  1.1834 +  /* This field was added in CURLVERSION_THIRD */
  1.1835 +  const char *libidn;
  1.1836 +
  1.1837 +  /* These field were added in CURLVERSION_FOURTH */
  1.1838 +
  1.1839 +  /* Same as '_libiconv_version' if built with HAVE_ICONV */
  1.1840 +  int iconv_ver_num;
  1.1841 +
  1.1842 +  const char *libssh_version; /* human readable string */
  1.1843 +
  1.1844 +} curl_version_info_data;
  1.1845 +
  1.1846 +#define CURL_VERSION_IPV6      (1<<0)  /* IPv6-enabled */
  1.1847 +#define CURL_VERSION_KERBEROS4 (1<<1)  /* kerberos auth is supported */
  1.1848 +#define CURL_VERSION_SSL       (1<<2)  /* SSL options are present */
  1.1849 +#define CURL_VERSION_LIBZ      (1<<3)  /* libz features are present */
  1.1850 +#define CURL_VERSION_NTLM      (1<<4)  /* NTLM auth is supported */
  1.1851 +#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */
  1.1852 +#define CURL_VERSION_DEBUG     (1<<6)  /* built with debug capabilities */
  1.1853 +#define CURL_VERSION_ASYNCHDNS (1<<7)  /* asynchronous dns resolves */
  1.1854 +#define CURL_VERSION_SPNEGO    (1<<8)  /* SPNEGO auth */
  1.1855 +#define CURL_VERSION_LARGEFILE (1<<9)  /* supports files bigger than 2GB */
  1.1856 +#define CURL_VERSION_IDN       (1<<10) /* International Domain Names support */
  1.1857 +#define CURL_VERSION_SSPI      (1<<11) /* SSPI is supported */
  1.1858 +#define CURL_VERSION_CONV      (1<<12) /* character conversions supported */
  1.1859 +#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */
  1.1860 +
  1.1861 +/*
  1.1862 + * NAME curl_version_info()
  1.1863 + *
  1.1864 + * DESCRIPTION
  1.1865 + *
  1.1866 + * This function returns a pointer to a static copy of the version info
  1.1867 + * struct. See above.
  1.1868 + */
  1.1869 +CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);
  1.1870 +
  1.1871 +/*
  1.1872 + * NAME curl_easy_strerror()
  1.1873 + *
  1.1874 + * DESCRIPTION
  1.1875 + *
  1.1876 + * The curl_easy_strerror function may be used to turn a CURLcode value
  1.1877 + * into the equivalent human readable error string.  This is useful
  1.1878 + * for printing meaningful error messages.
  1.1879 + */
  1.1880 +CURL_EXTERN const char *curl_easy_strerror(CURLcode);
  1.1881 +
  1.1882 +/*
  1.1883 + * NAME curl_share_strerror()
  1.1884 + *
  1.1885 + * DESCRIPTION
  1.1886 + *
  1.1887 + * The curl_share_strerror function may be used to turn a CURLSHcode value
  1.1888 + * into the equivalent human readable error string.  This is useful
  1.1889 + * for printing meaningful error messages.
  1.1890 + */
  1.1891 +CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
  1.1892 +
  1.1893 +/*
  1.1894 + * NAME curl_easy_pause()
  1.1895 + *
  1.1896 + * DESCRIPTION
  1.1897 + *
  1.1898 + * The curl_easy_pause function pauses or unpauses transfers. Select the new
  1.1899 + * state by setting the bitmask, use the convenience defines below.
  1.1900 + *
  1.1901 + */
  1.1902 +CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
  1.1903 +
  1.1904 +#define CURLPAUSE_RECV      (1<<0)
  1.1905 +#define CURLPAUSE_RECV_CONT (0)
  1.1906 +
  1.1907 +#define CURLPAUSE_SEND      (1<<2)
  1.1908 +#define CURLPAUSE_SEND_CONT (0)
  1.1909 +
  1.1910 +#define CURLPAUSE_ALL       (CURLPAUSE_RECV|CURLPAUSE_SEND)
  1.1911 +#define CURLPAUSE_CONT      (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)
  1.1912 +
  1.1913 +#ifdef  __cplusplus
  1.1914 +}
  1.1915 +#endif
  1.1916 +
  1.1917 +/* unfortunately, the easy.h and multi.h include files need options and info
  1.1918 +  stuff before they can be included! */
  1.1919 +#include "easy.h" /* nothing in curl is fun without the easy stuff */
  1.1920 +#include "multi.h"
  1.1921 +
  1.1922 +/* the typechecker doesn't work in C++ (yet) */
  1.1923 +#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
  1.1924 +    ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
  1.1925 +    !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)
  1.1926 +#include "typecheck-gcc.h"
  1.1927 +#else
  1.1928 +#if defined(__STDC__) && (__STDC__ >= 1)
  1.1929 +/* This preprocessor magic that replaces a call with the exact same call is
  1.1930 +   only done to make sure application authors pass exactly three arguments
  1.1931 +   to these functions. */
  1.1932 +#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
  1.1933 +#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)
  1.1934 +#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
  1.1935 +#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
  1.1936 +#endif /* __STDC__ >= 1 */
  1.1937 +#endif /* gcc >= 4.3 && !__cplusplus */
  1.1938 +
  1.1939 +#endif /* __CURL_CURL_H */

mercurial