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