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