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