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