/cocos2dx/platform/third_party/win32/curl/curl.h

https://bitbucket.org/Tsiannian/cocos2d-x · C++ Header · 2141 lines · 1016 code · 364 blank · 761 comment · 30 complexity · 637ab423010f2f26eadbacbe1ec33953 MD5 · raw file

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