Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2119 lines
77 KiB

  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_ANY (~CURLAUTH_DIGEST_IE) /* all fine types set */
  518. #define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
  519. #define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */
  520. #define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */
  521. #define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */
  522. #define CURLSSH_AUTH_PASSWORD (1<<1) /* password */
  523. #define CURLSSH_AUTH_HOST (1<<2) /* host key files */
  524. #define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */
  525. #define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
  526. #define CURL_ERROR_SIZE 256
  527. struct curl_khkey {
  528. const char *key; /* points to a zero-terminated string encoded with base64
  529. if len is zero, otherwise to the "raw" data */
  530. size_t len;
  531. enum type {
  532. CURLKHTYPE_UNKNOWN,
  533. CURLKHTYPE_RSA1,
  534. CURLKHTYPE_RSA,
  535. CURLKHTYPE_DSS
  536. } keytype;
  537. };
  538. /* this is the set of return values expected from the curl_sshkeycallback
  539. callback */
  540. enum curl_khstat {
  541. CURLKHSTAT_FINE_ADD_TO_FILE,
  542. CURLKHSTAT_FINE,
  543. CURLKHSTAT_REJECT, /* reject the connection, return an error */
  544. CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
  545. this causes a CURLE_DEFER error but otherwise the
  546. connection will be left intact etc */
  547. CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
  548. };
  549. /* this is the set of status codes pass in to the callback */
  550. enum curl_khmatch {
  551. CURLKHMATCH_OK, /* match */
  552. CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
  553. CURLKHMATCH_MISSING, /* no matching host/key found */
  554. CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */
  555. };
  556. typedef int
  557. (*curl_sshkeycallback) (CURL *easy, /* easy handle */
  558. const struct curl_khkey *knownkey, /* known */
  559. const struct curl_khkey *foundkey, /* found */
  560. enum curl_khmatch, /* libcurl's view on the keys */
  561. void *clientp); /* custom pointer passed from app */
  562. /* parameter for the CURLOPT_USE_SSL option */
  563. typedef enum {
  564. CURLUSESSL_NONE, /* do not attempt to use SSL */
  565. CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */
  566. CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
  567. CURLUSESSL_ALL, /* SSL for all communication or fail */
  568. CURLUSESSL_LAST /* not an option, never use */
  569. } curl_usessl;
  570. #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
  571. the obsolete stuff removed! */
  572. /* Backwards compatibility with older names */
  573. /* These are scheduled to disappear by 2009 */
  574. #define CURLFTPSSL_NONE CURLUSESSL_NONE
  575. #define CURLFTPSSL_TRY CURLUSESSL_TRY
  576. #define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL
  577. #define CURLFTPSSL_ALL CURLUSESSL_ALL
  578. #define CURLFTPSSL_LAST CURLUSESSL_LAST
  579. #define curl_ftpssl curl_usessl
  580. #endif /*!CURL_NO_OLDIES*/
  581. /* parameter for the CURLOPT_FTP_SSL_CCC option */
  582. typedef enum {
  583. CURLFTPSSL_CCC_NONE, /* do not send CCC */
  584. CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
  585. CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */
  586. CURLFTPSSL_CCC_LAST /* not an option, never use */
  587. } curl_ftpccc;
  588. /* parameter for the CURLOPT_FTPSSLAUTH option */
  589. typedef enum {
  590. CURLFTPAUTH_DEFAULT, /* let libcurl decide */
  591. CURLFTPAUTH_SSL, /* use "AUTH SSL" */
  592. CURLFTPAUTH_TLS, /* use "AUTH TLS" */
  593. CURLFTPAUTH_LAST /* not an option, never use */
  594. } curl_ftpauth;
  595. /* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
  596. typedef enum {
  597. CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */
  598. CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD
  599. again if MKD succeeded, for SFTP this does
  600. similar magic */
  601. CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
  602. again even if MKD failed! */
  603. CURLFTP_CREATE_DIR_LAST /* not an option, never use */
  604. } curl_ftpcreatedir;
  605. /* parameter for the CURLOPT_FTP_FILEMETHOD option */
  606. typedef enum {
  607. CURLFTPMETHOD_DEFAULT, /* let libcurl pick */
  608. CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */
  609. CURLFTPMETHOD_NOCWD, /* no CWD at all */
  610. CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
  611. CURLFTPMETHOD_LAST /* not an option, never use */
  612. } curl_ftpmethod;
  613. /* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
  614. #define CURLPROTO_HTTP (1<<0)
  615. #define CURLPROTO_HTTPS (1<<1)
  616. #define CURLPROTO_FTP (1<<2)
  617. #define CURLPROTO_FTPS (1<<3)
  618. #define CURLPROTO_SCP (1<<4)
  619. #define CURLPROTO_SFTP (1<<5)
  620. #define CURLPROTO_TELNET (1<<6)
  621. #define CURLPROTO_LDAP (1<<7)
  622. #define CURLPROTO_LDAPS (1<<8)
  623. #define CURLPROTO_DICT (1<<9)
  624. #define CURLPROTO_FILE (1<<10)
  625. #define CURLPROTO_TFTP (1<<11)
  626. #define CURLPROTO_IMAP (1<<12)
  627. #define CURLPROTO_IMAPS (1<<13)
  628. #define CURLPROTO_POP3 (1<<14)
  629. #define CURLPROTO_POP3S (1<<15)
  630. #define CURLPROTO_SMTP (1<<16)
  631. #define CURLPROTO_SMTPS (1<<17)
  632. #define CURLPROTO_RTSP (1<<18)
  633. #define CURLPROTO_RTMP (1<<19)
  634. #define CURLPROTO_RTMPT (1<<20)
  635. #define CURLPROTO_RTMPE (1<<21)
  636. #define CURLPROTO_RTMPTE (1<<22)
  637. #define CURLPROTO_RTMPS (1<<23)
  638. #define CURLPROTO_RTMPTS (1<<24)
  639. #define CURLPROTO_GOPHER (1<<25)
  640. #define CURLPROTO_ALL (~0) /* enable everything */
  641. /* long may be 32 or 64 bits, but we should never depend on anything else
  642. but 32 */
  643. #define CURLOPTTYPE_LONG 0
  644. #define CURLOPTTYPE_OBJECTPOINT 10000
  645. #define CURLOPTTYPE_FUNCTIONPOINT 20000
  646. #define CURLOPTTYPE_OFF_T 30000
  647. /* name is uppercase CURLOPT_<name>,
  648. type is one of the defined CURLOPTTYPE_<type>
  649. number is unique identifier */
  650. #ifdef CINIT
  651. #undef CINIT
  652. #endif
  653. #ifdef CURL_ISOCPP
  654. #define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number
  655. #else
  656. /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
  657. #define LONG CURLOPTTYPE_LONG
  658. #define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
  659. #define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
  660. #define OFF_T CURLOPTTYPE_OFF_T
  661. #define CINIT(name,type,number) CURLOPT_/**/name = type + number
  662. #endif
  663. /*
  664. * This macro-mania below setups the CURLOPT_[what] enum, to be used with
  665. * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]
  666. * word.
  667. */
  668. typedef enum {
  669. /* This is the FILE * or void * the regular output should be written to. */
  670. CINIT(FILE, OBJECTPOINT, 1),
  671. /* The full URL to get/put */
  672. CINIT(URL, OBJECTPOINT, 2),
  673. /* Port number to connect to, if other than default. */
  674. CINIT(PORT, LONG, 3),
  675. /* Name of proxy to use. */
  676. CINIT(PROXY, OBJECTPOINT, 4),
  677. /* "name:password" to use when fetching. */
  678. CINIT(USERPWD, OBJECTPOINT, 5),
  679. /* "name:password" to use with proxy. */
  680. CINIT(PROXYUSERPWD, OBJECTPOINT, 6),
  681. /* Range to get, specified as an ASCII string. */
  682. CINIT(RANGE, OBJECTPOINT, 7),
  683. /* not used */
  684. /* Specified file stream to upload from (use as input): */
  685. CINIT(INFILE, OBJECTPOINT, 9),
  686. /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
  687. * bytes big. If this is not used, error messages go to stderr instead: */
  688. CINIT(ERRORBUFFER, OBJECTPOINT, 10),
  689. /* Function that will be called to store the output (instead of fwrite). The
  690. * parameters will use fwrite() syntax, make sure to follow them. */
  691. CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
  692. /* Function that will be called to read the input (instead of fread). The
  693. * parameters will use fread() syntax, make sure to follow them. */
  694. CINIT(READFUNCTION, FUNCTIONPOINT, 12),
  695. /* Time-out the read operation after this amount of seconds */
  696. CINIT(TIMEOUT, LONG, 13),
  697. /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
  698. * how large the file being sent really is. That allows better error
  699. * checking and better verifies that the upload was successful. -1 means
  700. * unknown size.
  701. *
  702. * For large file support, there is also a _LARGE version of the key
  703. * which takes an off_t type, allowing platforms with larger off_t
  704. * sizes to handle larger files. See below for INFILESIZE_LARGE.
  705. */
  706. CINIT(INFILESIZE, LONG, 14),
  707. /* POST static input fields. */
  708. CINIT(POSTFIELDS, OBJECTPOINT, 15),
  709. /* Set the referrer page (needed by some CGIs) */
  710. CINIT(REFERER, OBJECTPOINT, 16),
  711. /* Set the FTP PORT string (interface name, named or numerical IP address)
  712. Use i.e '-' to use default address. */
  713. CINIT(FTPPORT, OBJECTPOINT, 17),
  714. /* Set the User-Agent string (examined by some CGIs) */
  715. CINIT(USERAGENT, OBJECTPOINT, 18),
  716. /* If the download receives less than "low speed limit" bytes/second
  717. * during "low speed time" seconds, the operations is aborted.
  718. * You could i.e if you have a pretty high speed connection, abort if
  719. * it is less than 2000 bytes/sec during 20 seconds.
  720. */
  721. /* Set the "low speed limit" */
  722. CINIT(LOW_SPEED_LIMIT, LONG, 19),
  723. /* Set the "low speed time" */
  724. CINIT(LOW_SPEED_TIME, LONG, 20),
  725. /* Set the continuation offset.
  726. *
  727. * Note there is also a _LARGE version of this key which uses
  728. * off_t types, allowing for large file offsets on platforms which
  729. * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
  730. */
  731. CINIT(RESUME_FROM, LONG, 21),
  732. /* Set cookie in request: */
  733. CINIT(COOKIE, OBJECTPOINT, 22),
  734. /* This points to a linked list of headers, struct curl_slist kind */
  735. CINIT(HTTPHEADER, OBJECTPOINT, 23),
  736. /* This points to a linked list of post entries, struct curl_httppost */
  737. CINIT(HTTPPOST, OBJECTPOINT, 24),
  738. /* name of the file keeping your private SSL-certificate */
  739. CINIT(SSLCERT, OBJECTPOINT, 25),
  740. /* password for the SSL or SSH private key */
  741. CINIT(KEYPASSWD, OBJECTPOINT, 26),
  742. /* send TYPE parameter? */
  743. CINIT(CRLF, LONG, 27),
  744. /* send linked-list of QUOTE commands */
  745. CINIT(QUOTE, OBJECTPOINT, 28),
  746. /* send FILE * or void * to store headers to, if you use a callback it
  747. is simply passed to the callback unmodified */
  748. CINIT(WRITEHEADER, OBJECTPOINT, 29),
  749. /* point to a file to read the initial cookies from, also enables
  750. "cookie awareness" */
  751. CINIT(COOKIEFILE, OBJECTPOINT, 31),
  752. /* What version to specifically try to use.
  753. See CURL_SSLVERSION defines below. */
  754. CINIT(SSLVERSION, LONG, 32),
  755. /* What kind of HTTP time condition to use, see defines */
  756. CINIT(TIMECONDITION, LONG, 33),
  757. /* Time to use with the above condition. Specified in number of seconds
  758. since 1 Jan 1970 */
  759. CINIT(TIMEVALUE, LONG, 34),
  760. /* 35 = OBSOLETE */
  761. /* Custom request, for customizing the get command like
  762. HTTP: DELETE, TRACE and others
  763. FTP: to use a different list command
  764. */
  765. CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),
  766. /* HTTP request, for odd commands like DELETE, TRACE and others */
  767. CINIT(STDERR, OBJECTPOINT, 37),
  768. /* 38 is not used */
  769. /* send linked-list of post-transfer QUOTE commands */
  770. CINIT(POSTQUOTE, OBJECTPOINT, 39),
  771. /* Pass a pointer to string of the output using full variable-replacement
  772. as described elsewhere. */
  773. CINIT(WRITEINFO, OBJECTPOINT, 40),
  774. CINIT(VERBOSE, LONG, 41), /* talk a lot */
  775. CINIT(HEADER, LONG, 42), /* throw the header out too */
  776. CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */
  777. CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */
  778. CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */
  779. CINIT(UPLOAD, LONG, 46), /* this is an upload */
  780. CINIT(POST, LONG, 47), /* HTTP POST method */
  781. CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */
  782. CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
  783. /* Specify whether to read the user+password from the .netrc or the URL.
  784. * This must be one of the CURL_NETRC_* enums below. */
  785. CINIT(NETRC, LONG, 51),
  786. CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
  787. CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
  788. CINIT(PUT, LONG, 54), /* HTTP PUT */
  789. /* 55 = OBSOLETE */
  790. /* Function that will be called instead of the internal progress display
  791. * function. This function should be defined as the curl_progress_callback
  792. * prototype defines. */
  793. CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
  794. /* Data passed to the progress callback */
  795. CINIT(PROGRESSDATA, OBJECTPOINT, 57),
  796. /* We want the referrer field set automatically when following locations */
  797. CINIT(AUTOREFERER, LONG, 58),
  798. /* Port of the proxy, can be set in the proxy string as well with:
  799. "[host]:[port]" */
  800. CINIT(PROXYPORT, LONG, 59),
  801. /* size of the POST input data, if strlen() is not good to use */
  802. CINIT(POSTFIELDSIZE, LONG, 60),
  803. /* tunnel non-http operations through a HTTP proxy */
  804. CINIT(HTTPPROXYTUNNEL, LONG, 61),
  805. /* Set the interface string to use as outgoing network interface */
  806. CINIT(INTERFACE, OBJECTPOINT, 62),
  807. /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
  808. * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
  809. * is set but doesn't match one of these, 'private' will be used. */
  810. CINIT(KRBLEVEL, OBJECTPOINT, 63),
  811. /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
  812. CINIT(SSL_VERIFYPEER, LONG, 64),
  813. /* The CApath or CAfile used to validate the peer certificate
  814. this option is used only if SSL_VERIFYPEER is true */
  815. CINIT(CAINFO, OBJECTPOINT, 65),
  816. /* 66 = OBSOLETE */
  817. /* 67 = OBSOLETE */
  818. /* Maximum number of http redirects to follow */
  819. CINIT(MAXREDIRS, LONG, 68),
  820. /* Pass a long set to 1 to get the date of the requested document (if
  821. possible)! Pass a zero to shut it off. */
  822. CINIT(FILETIME, LONG, 69),
  823. /* This points to a linked list of telnet options */
  824. CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
  825. /* Max amount of cached alive connections */
  826. CINIT(MAXCONNECTS, LONG, 71),
  827. /* What policy to use when closing connections when the cache is filled
  828. up */
  829. CINIT(CLOSEPOLICY, LONG, 72),
  830. /* 73 = OBSOLETE */
  831. /* Set to explicitly use a new connection for the upcoming transfer.
  832. Do not use this unless you're absolutely sure of this, as it makes the
  833. operation slower and is less friendly for the network. */
  834. CINIT(FRESH_CONNECT, LONG, 74),
  835. /* Set to explicitly forbid the upcoming transfer's connection to be re-used
  836. when done. Do not use this unless you're absolutely sure of this, as it
  837. makes the operation slower and is less friendly for the network. */
  838. CINIT(FORBID_REUSE, LONG, 75),
  839. /* Set to a file name that contains random data for libcurl to use to
  840. seed the random engine when doing SSL connects. */
  841. CINIT(RANDOM_FILE, OBJECTPOINT, 76),
  842. /* Set to the Entropy Gathering Daemon socket pathname */
  843. CINIT(EGDSOCKET, OBJECTPOINT, 77),
  844. /* Time-out connect operations after this amount of seconds, if connects
  845. are OK within this time, then fine... This only aborts the connect
  846. phase. [Only works on unix-style/SIGALRM operating systems] */
  847. CINIT(CONNECTTIMEOUT, LONG, 78),
  848. /* Function that will be called to store headers (instead of fwrite). The
  849. * parameters will use fwrite() syntax, make sure to follow them. */
  850. CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
  851. /* Set this to force the HTTP request to get back to GET. Only really usable
  852. if POST, PUT or a custom request have been used first.
  853. */
  854. CINIT(HTTPGET, LONG, 80),
  855. /* Set if we should verify the Common name from the peer certificate in ssl
  856. * handshake, set 1 to check existence, 2 to ensure that it matches the
  857. * provided hostname. */
  858. CINIT(SSL_VERIFYHOST, LONG, 81),
  859. /* Specify which file name to write all known cookies in after completed
  860. operation. Set file name to "-" (dash) to make it go to stdout. */
  861. CINIT(COOKIEJAR, OBJECTPOINT, 82),
  862. /* Specify which SSL ciphers to use */
  863. CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),
  864. /* Specify which HTTP version to use! This must be set to one of the
  865. CURL_HTTP_VERSION* enums set below. */
  866. CINIT(HTTP_VERSION, LONG, 84),
  867. /* Specifically switch on or off the FTP engine's use of the EPSV command. By
  868. default, that one will always be attempted before the more traditional
  869. PASV command. */
  870. CINIT(FTP_USE_EPSV, LONG, 85),
  871. /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
  872. CINIT(SSLCERTTYPE, OBJECTPOINT, 86),
  873. /* name of the file keeping your private SSL-key */
  874. CINIT(SSLKEY, OBJECTPOINT, 87),
  875. /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
  876. CINIT(SSLKEYTYPE, OBJECTPOINT, 88),
  877. /* crypto engine for the SSL-sub system */
  878. CINIT(SSLENGINE, OBJECTPOINT, 89),
  879. /* set the crypto engine for the SSL-sub system as default
  880. the param has no meaning...
  881. */
  882. CINIT(SSLENGINE_DEFAULT, LONG, 90),
  883. /* Non-zero value means to use the global dns cache */
  884. CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */
  885. /* DNS cache timeout */
  886. CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
  887. /* send linked-list of pre-transfer QUOTE commands */
  888. CINIT(PREQUOTE, OBJECTPOINT, 93),
  889. /* set the debug function */
  890. CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
  891. /* set the data for the debug function */
  892. CINIT(DEBUGDATA, OBJECTPOINT, 95),
  893. /* mark this as start of a cookie session */
  894. CINIT(COOKIESESSION, LONG, 96),
  895. /* The CApath directory used to validate the peer certificate
  896. this option is used only if SSL_VERIFYPEER is true */
  897. CINIT(CAPATH, OBJECTPOINT, 97),
  898. /* Instruct libcurl to use a smaller receive buffer */
  899. CINIT(BUFFERSIZE, LONG, 98),
  900. /* Instruct libcurl to not use any signal/alarm handlers, even when using
  901. timeouts. This option is useful for multi-threaded applications.
  902. See libcurl-the-guide for more background information. */
  903. CINIT(NOSIGNAL, LONG, 99),
  904. /* Provide a CURLShare for mutexing non-ts data */
  905. CINIT(SHARE, OBJECTPOINT, 100),
  906. /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
  907. CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */
  908. CINIT(PROXYTYPE, LONG, 101),
  909. /* Set the Accept-Encoding string. Use this to tell a server you would like
  910. the response to be compressed. */
  911. CINIT(ENCODING, OBJECTPOINT, 102),
  912. /* Set pointer to private data */
  913. CINIT(PRIVATE, OBJECTPOINT, 103),
  914. /* Set aliases for HTTP 200 in the HTTP Response header */
  915. CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
  916. /* Continue to send authentication (user+password) when following locations,
  917. even when hostname changed. This can potentially send off the name
  918. and password to whatever host the server decides. */
  919. CINIT(UNRESTRICTED_AUTH, LONG, 105),
  920. /* Specifically switch on or off the FTP engine's use of the EPRT command ( it
  921. also disables the LPRT attempt). By default, those ones will always be
  922. attempted before the good old traditional PORT command. */
  923. CINIT(FTP_USE_EPRT, LONG, 106),
  924. /* Set this to a bitmask value to enable the particular authentications
  925. methods you like. Use this in combination with CURLOPT_USERPWD.
  926. Note that setting multiple bits may cause extra network round-trips. */
  927. CINIT(HTTPAUTH, LONG, 107),
  928. /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
  929. in second argument. The function must be matching the
  930. curl_ssl_ctx_callback proto. */
  931. CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
  932. /* Set the userdata for the ssl context callback function's third
  933. argument */
  934. CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
  935. /* FTP Option that causes missing dirs to be created on the remote server.
  936. In 7.19.4 we introduced the convenience enums for this option using the
  937. CURLFTP_CREATE_DIR prefix.
  938. */
  939. CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
  940. /* Set this to a bitmask value to enable the particular authentications
  941. methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
  942. Note that setting multiple bits may cause extra network round-trips. */
  943. CINIT(PROXYAUTH, LONG, 111),
  944. /* FTP option that changes the timeout, in seconds, associated with
  945. getting a response. This is different from transfer timeout time and
  946. essentially places a demand on the FTP server to acknowledge commands
  947. in a timely manner. */
  948. CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
  949. #define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT
  950. /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
  951. tell libcurl to resolve names to those IP versions only. This only has
  952. affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
  953. CINIT(IPRESOLVE, LONG, 113),
  954. /* Set this option to limit the size of a file that will be downloaded from
  955. an HTTP or FTP server.
  956. Note there is also _LARGE version which adds large file support for
  957. platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
  958. CINIT(MAXFILESIZE, LONG, 114),
  959. /* See the comment for INFILESIZE above, but in short, specifies
  960. * the size of the file being uploaded. -1 means unknown.
  961. */
  962. CINIT(INFILESIZE_LARGE, OFF_T, 115),
  963. /* Sets the continuation offset. There is also a LONG version of this;
  964. * look above for RESUME_FROM.
  965. */
  966. CINIT(RESUME_FROM_LARGE, OFF_T, 116),
  967. /* Sets the maximum size of data that will be downloaded from
  968. * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
  969. */
  970. CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
  971. /* Set this option to the file name of your .netrc file you want libcurl
  972. to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
  973. a poor attempt to find the user's home directory and check for a .netrc
  974. file in there. */
  975. CINIT(NETRC_FILE, OBJECTPOINT, 118),
  976. /* Enable SSL/TLS for FTP, pick one of:
  977. CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
  978. CURLFTPSSL_CONTROL - SSL for the control connection or fail
  979. CURLFTPSSL_ALL - SSL for all communication or fail
  980. */
  981. CINIT(USE_SSL, LONG, 119),
  982. /* The _LARGE version of the standard POSTFIELDSIZE option */
  983. CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
  984. /* Enable/disable the TCP Nagle algorithm */
  985. CINIT(TCP_NODELAY, LONG, 121),
  986. /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  987. /* 123 OBSOLETE. Gone in 7.16.0 */
  988. /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  989. /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  990. /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  991. /* 127 OBSOLETE. Gone in 7.16.0 */
  992. /* 128 OBSOLETE. Gone in 7.16.0 */
  993. /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
  994. can be used to change libcurl's default action which is to first try
  995. "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
  996. response has been received.
  997. Available parameters are:
  998. CURLFTPAUTH_DEFAULT - let libcurl decide
  999. CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
  1000. CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
  1001. */
  1002. CINIT(FTPSSLAUTH, LONG, 129),
  1003. CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
  1004. CINIT(IOCTLDATA, OBJECTPOINT, 131),
  1005. /* 132 OBSOLETE. Gone in 7.16.0 */
  1006. /* 133 OBSOLETE. Gone in 7.16.0 */
  1007. /* zero terminated string for pass on to the FTP server when asked for
  1008. "account" info */
  1009. CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),
  1010. /* feed cookies into cookie engine */
  1011. CINIT(COOKIELIST, OBJECTPOINT, 135),
  1012. /* ignore Content-Length */
  1013. CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
  1014. /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
  1015. response. Typically used for FTP-SSL purposes but is not restricted to
  1016. that. libcurl will then instead use the same IP address it used for the
  1017. control connection. */
  1018. CINIT(FTP_SKIP_PASV_IP, LONG, 137),
  1019. /* Select "file method" to use when doing FTP, see the curl_ftpmethod
  1020. above. */
  1021. CINIT(FTP_FILEMETHOD, LONG, 138),
  1022. /* Local port number to bind the socket to */
  1023. CINIT(LOCALPORT, LONG, 139),
  1024. /* Number of ports to try, including the first one set with LOCALPORT.
  1025. Thus, setting it to 1 will make no additional attempts but the first.
  1026. */
  1027. CINIT(LOCALPORTRANGE, LONG, 140),
  1028. /* no transfer, set up connection and let application use the socket by
  1029. extracting it with CURLINFO_LASTSOCKET */
  1030. CINIT(CONNECT_ONLY, LONG, 141),
  1031. /* Function that will be called to convert from the
  1032. network encoding (instead of using the iconv calls in libcurl) */
  1033. CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
  1034. /* Function that will be called to convert to the
  1035. network encoding (instead of using the iconv calls in libcurl) */
  1036. CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
  1037. /* Function that will be called to convert from UTF8
  1038. (instead of using the iconv calls in libcurl)
  1039. Note that this is used only for SSL certificate processing */
  1040. CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
  1041. /* if the connection proceeds too quickly then need to slow it down */
  1042. /* limit-rate: maximum number of bytes per second to send or receive */
  1043. CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
  1044. CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
  1045. /* Pointer to command string to send if USER/PASS fails. */
  1046. CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
  1047. /* callback function for setting socket options */
  1048. CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
  1049. CINIT(SOCKOPTDATA, OBJECTPOINT, 149),
  1050. /* set to 0 to disable session ID re-use for this transfer, default is
  1051. enabled (== 1) */
  1052. CINIT(SSL_SESSIONID_CACHE, LONG, 150),
  1053. /* allowed SSH authentication methods */
  1054. CINIT(SSH_AUTH_TYPES, LONG, 151),
  1055. /* Used by scp/sftp to do public/private key authentication */
  1056. CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),
  1057. CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),
  1058. /* Send CCC (Clear Command Channel) after authentication */
  1059. CINIT(FTP_SSL_CCC, LONG, 154),
  1060. /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
  1061. CINIT(TIMEOUT_MS, LONG, 155),
  1062. CINIT(CONNECTTIMEOUT_MS, LONG, 156),
  1063. /* set to zero to disable the libcurl's decoding and thus pass the raw body
  1064. data to the application even when it is encoded/compressed */
  1065. CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
  1066. CINIT(HTTP_CONTENT_DECODING, LONG, 158),
  1067. /* Permission used when creating new files and directories on the remote
  1068. server for protocols that support it, SFTP/SCP/FILE */
  1069. CINIT(NEW_FILE_PERMS, LONG, 159),
  1070. CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
  1071. /* Set the behaviour of POST when redirecting. Values must be set to one
  1072. of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
  1073. CINIT(POSTREDIR, LONG, 161),
  1074. /* used by scp/sftp to verify the host's public key */
  1075. CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),
  1076. /* Callback function for opening socket (instead of socket(2)). Optionally,
  1077. callback is able change the address or refuse to connect returning
  1078. CURL_SOCKET_BAD. The callback should have type
  1079. curl_opensocket_callback */
  1080. CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
  1081. CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
  1082. /* POST volatile input fields. */
  1083. CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
  1084. /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
  1085. CINIT(PROXY_TRANSFER_MODE, LONG, 166),
  1086. /* Callback function for seeking in the input stream */
  1087. CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
  1088. CINIT(SEEKDATA, OBJECTPOINT, 168),
  1089. /* CRL file */
  1090. CINIT(CRLFILE, OBJECTPOINT, 169),
  1091. /* Issuer certificate */
  1092. CINIT(ISSUERCERT, OBJECTPOINT, 170),
  1093. /* (IPv6) Address scope */
  1094. CINIT(ADDRESS_SCOPE, LONG, 171),
  1095. /* Collect certificate chain info and allow it to get retrievable with
  1096. CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only
  1097. working with OpenSSL-powered builds. */
  1098. CINIT(CERTINFO, LONG, 172),
  1099. /* "name" and "pwd" to use when fetching. */
  1100. CINIT(USERNAME, OBJECTPOINT, 173),
  1101. CINIT(PASSWORD, OBJECTPOINT, 174),
  1102. /* "name" and "pwd" to use with Proxy when fetching. */
  1103. CINIT(PROXYUSERNAME, OBJECTPOINT, 175),
  1104. CINIT(PROXYPASSWORD, OBJECTPOINT, 176),
  1105. /* Comma separated list of hostnames defining no-proxy zones. These should
  1106. match both hostnames directly, and hostnames within a domain. For
  1107. example, local.com will match local.com and www.local.com, but NOT
  1108. notlocal.com or www.notlocal.com. For compatibility with other
  1109. implementations of this, .local.com will be considered to be the same as
  1110. local.com. A single * is the only valid wildcard, and effectively
  1111. disables the use of proxy. */
  1112. CINIT(NOPROXY, OBJECTPOINT, 177),
  1113. /* block size for TFTP transfers */
  1114. CINIT(TFTP_BLKSIZE, LONG, 178),
  1115. /* Socks Service */
  1116. CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),
  1117. /* Socks Service */
  1118. CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
  1119. /* set the bitmask for the protocols that are allowed to be used for the
  1120. transfer, which thus helps the app which takes URLs from users or other
  1121. external inputs and want to restrict what protocol(s) to deal
  1122. with. Defaults to CURLPROTO_ALL. */
  1123. CINIT(PROTOCOLS, LONG, 181),
  1124. /* set the bitmask for the protocols that libcurl is allowed to follow to,
  1125. as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
  1126. to be set in both bitmasks to be allowed to get redirected to. Defaults
  1127. to all protocols except FILE and SCP. */
  1128. CINIT(REDIR_PROTOCOLS, LONG, 182),
  1129. /* set the SSH knownhost file name to use */
  1130. CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),
  1131. /* set the SSH host key callback, must point to a curl_sshkeycallback
  1132. function */
  1133. CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
  1134. /* set the SSH host key callback custom pointer */
  1135. CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
  1136. /* set the SMTP mail originator */
  1137. CINIT(MAIL_FROM, OBJECTPOINT, 186),
  1138. /* set the SMTP mail receiver(s) */
  1139. CINIT(MAIL_RCPT, OBJECTPOINT, 187),
  1140. /* FTP: send PRET before PASV */
  1141. CINIT(FTP_USE_PRET, LONG, 188),
  1142. /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */
  1143. CINIT(RTSP_REQUEST, LONG, 189),
  1144. /* The RTSP session identifier */
  1145. CINIT(RTSP_SESSION_ID, OBJECTPOINT, 190),
  1146. /* The RTSP stream URI */
  1147. CINIT(RTSP_STREAM_URI, OBJECTPOINT, 191),
  1148. /* The Transport: header to use in RTSP requests */
  1149. CINIT(RTSP_TRANSPORT, OBJECTPOINT, 192),
  1150. /* Manually initialize the client RTSP CSeq for this handle */
  1151. CINIT(RTSP_CLIENT_CSEQ, LONG, 193),
  1152. /* Manually initialize the server RTSP CSeq for this handle */
  1153. CINIT(RTSP_SERVER_CSEQ, LONG, 194),
  1154. /* The stream to pass to INTERLEAVEFUNCTION. */
  1155. CINIT(INTERLEAVEDATA, OBJECTPOINT, 195),
  1156. /* Let the application define a custom write method for RTP data */
  1157. CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196),
  1158. /* Turn on wildcard matching */
  1159. CINIT(WILDCARDMATCH, LONG, 197),
  1160. /* Directory matching callback called before downloading of an
  1161. individual file (chunk) started */
  1162. CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198),
  1163. /* Directory matching callback called after the file (chunk)
  1164. was downloaded, or skipped */
  1165. CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199),
  1166. /* Change match (fnmatch-like) callback for wildcard matching */
  1167. CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200),
  1168. /* Let the application define custom chunk data pointer */
  1169. CINIT(CHUNK_DATA, OBJECTPOINT, 201),
  1170. /* FNMATCH_FUNCTION user pointer */
  1171. CINIT(FNMATCH_DATA, OBJECTPOINT, 202),
  1172. CURLOPT_LASTENTRY /* the last unused */
  1173. } CURLoption;
  1174. #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
  1175. the obsolete stuff removed! */
  1176. /* Backwards compatibility with older names */
  1177. /* These are scheduled to disappear by 2011 */
  1178. /* This was added in version 7.19.1 */
  1179. #define CURLOPT_POST301 CURLOPT_POSTREDIR
  1180. /* These are scheduled to disappear by 2009 */
  1181. /* The following were added in 7.17.0 */
  1182. #define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD
  1183. #define CURLOPT_FTPAPPEND CURLOPT_APPEND
  1184. #define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY
  1185. #define CURLOPT_FTP_SSL CURLOPT_USE_SSL
  1186. /* The following were added earlier */
  1187. #define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
  1188. #define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
  1189. #else
  1190. /* This is set if CURL_NO_OLDIES is defined at compile-time */
  1191. #undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
  1192. #endif
  1193. /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
  1194. name resolves addresses using more than one IP protocol version, this
  1195. option might be handy to force libcurl to use a specific IP version. */
  1196. #define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP
  1197. versions that your system allows */
  1198. #define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */
  1199. #define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */
  1200. /* three convenient "aliases" that follow the name scheme better */
  1201. #define CURLOPT_WRITEDATA CURLOPT_FILE
  1202. #define CURLOPT_READDATA CURLOPT_INFILE
  1203. #define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER
  1204. #define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
  1205. /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
  1206. enum {
  1207. CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
  1208. like the library to choose the best possible
  1209. for us! */
  1210. CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
  1211. CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
  1212. CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
  1213. };
  1214. /*
  1215. * Public API enums for RTSP requests
  1216. */
  1217. enum {
  1218. CURL_RTSPREQ_NONE, /* first in list */
  1219. CURL_RTSPREQ_OPTIONS,
  1220. CURL_RTSPREQ_DESCRIBE,
  1221. CURL_RTSPREQ_ANNOUNCE,
  1222. CURL_RTSPREQ_SETUP,
  1223. CURL_RTSPREQ_PLAY,
  1224. CURL_RTSPREQ_PAUSE,
  1225. CURL_RTSPREQ_TEARDOWN,
  1226. CURL_RTSPREQ_GET_PARAMETER,
  1227. CURL_RTSPREQ_SET_PARAMETER,
  1228. CURL_RTSPREQ_RECORD,
  1229. CURL_RTSPREQ_RECEIVE,
  1230. CURL_RTSPREQ_LAST /* last in list */
  1231. };
  1232. /* These enums are for use with the CURLOPT_NETRC option. */
  1233. enum CURL_NETRC_OPTION {
  1234. CURL_NETRC_IGNORED, /* The .netrc will never be read.
  1235. * This is the default. */
  1236. CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred
  1237. * to one in the .netrc. */
  1238. CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored.
  1239. * Unless one is set programmatically, the .netrc
  1240. * will be queried. */
  1241. CURL_NETRC_LAST
  1242. };
  1243. enum {
  1244. CURL_SSLVERSION_DEFAULT,
  1245. CURL_SSLVERSION_TLSv1,
  1246. CURL_SSLVERSION_SSLv2,
  1247. CURL_SSLVERSION_SSLv3,
  1248. CURL_SSLVERSION_LAST /* never use, keep last */
  1249. };
  1250. /* symbols to use with CURLOPT_POSTREDIR.
  1251. CURL_REDIR_POST_301 and CURL_REDIR_POST_302 can be bitwise ORed so that
  1252. CURL_REDIR_POST_301 | CURL_REDIR_POST_302 == CURL_REDIR_POST_ALL */
  1253. #define CURL_REDIR_GET_ALL 0
  1254. #define CURL_REDIR_POST_301 1
  1255. #define CURL_REDIR_POST_302 2
  1256. #define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302)
  1257. typedef enum {
  1258. CURL_TIMECOND_NONE,
  1259. CURL_TIMECOND_IFMODSINCE,
  1260. CURL_TIMECOND_IFUNMODSINCE,
  1261. CURL_TIMECOND_LASTMOD,
  1262. CURL_TIMECOND_LAST
  1263. } curl_TimeCond;
  1264. /* curl_strequal() and curl_strnequal() are subject for removal in a future
  1265. libcurl, see lib/README.curlx for details */
  1266. CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2);
  1267. CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);
  1268. /* name is uppercase CURLFORM_<name> */
  1269. #ifdef CFINIT
  1270. #undef CFINIT
  1271. #endif
  1272. #ifdef CURL_ISOCPP
  1273. #define CFINIT(name) CURLFORM_ ## name
  1274. #else
  1275. /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
  1276. #define CFINIT(name) CURLFORM_/**/name
  1277. #endif
  1278. typedef enum {
  1279. CFINIT(NOTHING), /********* the first one is unused ************/
  1280. /* */
  1281. CFINIT(COPYNAME),
  1282. CFINIT(PTRNAME),
  1283. CFINIT(NAMELENGTH),
  1284. CFINIT(COPYCONTENTS),
  1285. CFINIT(PTRCONTENTS),
  1286. CFINIT(CONTENTSLENGTH),
  1287. CFINIT(FILECONTENT),
  1288. CFINIT(ARRAY),
  1289. CFINIT(OBSOLETE),
  1290. CFINIT(FILE),
  1291. CFINIT(BUFFER),
  1292. CFINIT(BUFFERPTR),
  1293. CFINIT(BUFFERLENGTH),
  1294. CFINIT(CONTENTTYPE),
  1295. CFINIT(CONTENTHEADER),
  1296. CFINIT(FILENAME),
  1297. CFINIT(END),
  1298. CFINIT(OBSOLETE2),
  1299. CFINIT(STREAM),
  1300. CURLFORM_LASTENTRY /* the last unused */
  1301. } CURLformoption;
  1302. #undef CFINIT /* done */
  1303. /* structure to be used as parameter for CURLFORM_ARRAY */
  1304. struct curl_forms {
  1305. CURLformoption option;
  1306. const char *value;
  1307. };
  1308. /* use this for multipart formpost building */
  1309. /* Returns code for curl_formadd()
  1310. *
  1311. * Returns:
  1312. * CURL_FORMADD_OK on success
  1313. * CURL_FORMADD_MEMORY if the FormInfo allocation fails
  1314. * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form
  1315. * CURL_FORMADD_NULL if a null pointer was given for a char
  1316. * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed
  1317. * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used
  1318. * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error)
  1319. * CURL_FORMADD_MEMORY if a curl_httppost struct cannot be allocated
  1320. * CURL_FORMADD_MEMORY if some allocation for string copying failed.
  1321. * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array
  1322. *
  1323. ***************************************************************************/
  1324. typedef enum {
  1325. CURL_FORMADD_OK, /* first, no error */
  1326. CURL_FORMADD_MEMORY,
  1327. CURL_FORMADD_OPTION_TWICE,
  1328. CURL_FORMADD_NULL,
  1329. CURL_FORMADD_UNKNOWN_OPTION,
  1330. CURL_FORMADD_INCOMPLETE,
  1331. CURL_FORMADD_ILLEGAL_ARRAY,
  1332. CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
  1333. CURL_FORMADD_LAST /* last */
  1334. } CURLFORMcode;
  1335. /*
  1336. * NAME curl_formadd()
  1337. *
  1338. * DESCRIPTION
  1339. *
  1340. * Pretty advanced function for building multi-part formposts. Each invoke
  1341. * adds one part that together construct a full post. Then use
  1342. * CURLOPT_HTTPPOST to send it off to libcurl.
  1343. */
  1344. CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
  1345. struct curl_httppost **last_post,
  1346. ...);
  1347. /*
  1348. * callback function for curl_formget()
  1349. * The void *arg pointer will be the one passed as second argument to
  1350. * curl_formget().
  1351. * The character buffer passed to it must not be freed.
  1352. * Should return the buffer length passed to it as the argument "len" on
  1353. * success.
  1354. */
  1355. typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len);
  1356. /*
  1357. * NAME curl_formget()
  1358. *
  1359. * DESCRIPTION
  1360. *
  1361. * Serialize a curl_httppost struct built with curl_formadd().
  1362. * Accepts a void pointer as second argument which will be passed to
  1363. * the curl_formget_callback function.
  1364. * Returns 0 on success.
  1365. */
  1366. CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,
  1367. curl_formget_callback append);
  1368. /*
  1369. * NAME curl_formfree()
  1370. *
  1371. * DESCRIPTION
  1372. *
  1373. * Free a multipart formpost previously built with curl_formadd().
  1374. */
  1375. CURL_EXTERN void curl_formfree(struct curl_httppost *form);
  1376. /*
  1377. * NAME curl_getenv()
  1378. *
  1379. * DESCRIPTION
  1380. *
  1381. * Returns a malloc()'ed string that MUST be curl_free()ed after usage is
  1382. * complete. DEPRECATED - see lib/README.curlx
  1383. */
  1384. CURL_EXTERN char *curl_getenv(const char *variable);
  1385. /*
  1386. * NAME curl_version()
  1387. *
  1388. * DESCRIPTION
  1389. *
  1390. * Returns a static ascii string of the libcurl version.
  1391. */
  1392. CURL_EXTERN char *curl_version(void);
  1393. /*
  1394. * NAME curl_easy_escape()
  1395. *
  1396. * DESCRIPTION
  1397. *
  1398. * Escapes URL strings (converts all letters consider illegal in URLs to their
  1399. * %XX versions). This function returns a new allocated string or NULL if an
  1400. * error occurred.
  1401. */
  1402. CURL_EXTERN char *curl_easy_escape(CURL *handle,
  1403. const char *string,
  1404. int length);
  1405. /* the previous version: */
  1406. CURL_EXTERN char *curl_escape(const char *string,
  1407. int length);
  1408. /*
  1409. * NAME curl_easy_unescape()
  1410. *
  1411. * DESCRIPTION
  1412. *
  1413. * Unescapes URL encoding in strings (converts all %XX codes to their 8bit
  1414. * versions). This function returns a new allocated string or NULL if an error
  1415. * occurred.
  1416. * Conversion Note: On non-ASCII platforms the ASCII %XX codes are
  1417. * converted into the host encoding.
  1418. */
  1419. CURL_EXTERN char *curl_easy_unescape(CURL *handle,
  1420. const char *string,
  1421. int length,
  1422. int *outlength);
  1423. /* the previous version */
  1424. CURL_EXTERN char *curl_unescape(const char *string,
  1425. int length);
  1426. /*
  1427. * NAME curl_free()
  1428. *
  1429. * DESCRIPTION
  1430. *
  1431. * Provided for de-allocation in the same translation unit that did the
  1432. * allocation. Added in libcurl 7.10
  1433. */
  1434. CURL_EXTERN void curl_free(void *p);
  1435. /*
  1436. * NAME curl_global_init()
  1437. *
  1438. * DESCRIPTION
  1439. *
  1440. * curl_global_init() should be invoked exactly once for each application that
  1441. * uses libcurl and before any call of other libcurl functions.
  1442. *
  1443. * This function is not thread-safe!
  1444. */
  1445. CURL_EXTERN CURLcode curl_global_init(long flags);
  1446. /*
  1447. * NAME curl_global_init_mem()
  1448. *
  1449. * DESCRIPTION
  1450. *
  1451. * curl_global_init() or curl_global_init_mem() should be invoked exactly once
  1452. * for each application that uses libcurl. This function can be used to
  1453. * initialize libcurl and set user defined memory management callback
  1454. * functions. Users can implement memory management routines to check for
  1455. * memory leaks, check for mis-use of the curl library etc. User registered
  1456. * callback routines with be invoked by this library instead of the system
  1457. * memory management routines like malloc, free etc.
  1458. */
  1459. CURL_EXTERN CURLcode curl_global_init_mem(long flags,
  1460. curl_malloc_callback m,
  1461. curl_free_callback f,
  1462. curl_realloc_callback r,
  1463. curl_strdup_callback s,
  1464. curl_calloc_callback c);
  1465. /*
  1466. * NAME curl_global_cleanup()
  1467. *
  1468. * DESCRIPTION
  1469. *
  1470. * curl_global_cleanup() should be invoked exactly once for each application
  1471. * that uses libcurl
  1472. */
  1473. CURL_EXTERN void curl_global_cleanup(void);
  1474. /* linked-list structure for the CURLOPT_QUOTE option (and other) */
  1475. struct curl_slist {
  1476. char *data;
  1477. struct curl_slist *next;
  1478. };
  1479. /*
  1480. * NAME curl_slist_append()
  1481. *
  1482. * DESCRIPTION
  1483. *
  1484. * Appends a string to a linked list. If no list exists, it will be created
  1485. * first. Returns the new list, after appending.
  1486. */
  1487. CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
  1488. const char *);
  1489. /*
  1490. * NAME curl_slist_free_all()
  1491. *
  1492. * DESCRIPTION
  1493. *
  1494. * free a previously built curl_slist.
  1495. */
  1496. CURL_EXTERN void curl_slist_free_all(struct curl_slist *);
  1497. /*
  1498. * NAME curl_getdate()
  1499. *
  1500. * DESCRIPTION
  1501. *
  1502. * Returns the time, in seconds since 1 Jan 1970 of the time string given in
  1503. * the first argument. The time argument in the second parameter is unused
  1504. * and should be set to NULL.
  1505. */
  1506. CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
  1507. /* info about the certificate chain, only for OpenSSL builds. Asked
  1508. for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
  1509. struct curl_certinfo {
  1510. int num_of_certs; /* number of certificates with information */
  1511. struct curl_slist **certinfo; /* for each index in this array, there's a
  1512. linked list with textual information in the
  1513. format "name: value" */
  1514. };
  1515. #define CURLINFO_STRING 0x100000
  1516. #define CURLINFO_LONG 0x200000
  1517. #define CURLINFO_DOUBLE 0x300000
  1518. #define CURLINFO_SLIST 0x400000
  1519. #define CURLINFO_MASK 0x0fffff
  1520. #define CURLINFO_TYPEMASK 0xf00000
  1521. typedef enum {
  1522. CURLINFO_NONE, /* first, never use this */
  1523. CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,
  1524. CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,
  1525. CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,
  1526. CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
  1527. CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
  1528. CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
  1529. CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
  1530. CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
  1531. CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9,
  1532. CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10,
  1533. CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
  1534. CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
  1535. CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
  1536. CURLINFO_FILETIME = CURLINFO_LONG + 14,
  1537. CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15,
  1538. CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16,
  1539. CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
  1540. CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
  1541. CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,
  1542. CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,
  1543. CURLINFO_PRIVATE = CURLINFO_STRING + 21,
  1544. CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
  1545. CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
  1546. CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
  1547. CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
  1548. CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
  1549. CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
  1550. CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
  1551. CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
  1552. CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
  1553. CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
  1554. CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
  1555. CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
  1556. CURLINFO_CERTINFO = CURLINFO_SLIST + 34,
  1557. CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
  1558. CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36,
  1559. CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37,
  1560. CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38,
  1561. CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39,
  1562. CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40,
  1563. CURLINFO_LOCAL_IP = CURLINFO_STRING + 41,
  1564. CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42,
  1565. /* Fill in new entries below here! */
  1566. CURLINFO_LASTONE = 42
  1567. } CURLINFO;
  1568. /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
  1569. CURLINFO_HTTP_CODE */
  1570. #define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
  1571. typedef enum {
  1572. CURLCLOSEPOLICY_NONE, /* first, never use this */
  1573. CURLCLOSEPOLICY_OLDEST,
  1574. CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
  1575. CURLCLOSEPOLICY_LEAST_TRAFFIC,
  1576. CURLCLOSEPOLICY_SLOWEST,
  1577. CURLCLOSEPOLICY_CALLBACK,
  1578. CURLCLOSEPOLICY_LAST /* last, never use this */
  1579. } curl_closepolicy;
  1580. #define CURL_GLOBAL_SSL (1<<0)
  1581. #define CURL_GLOBAL_WIN32 (1<<1)
  1582. #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
  1583. #define CURL_GLOBAL_NOTHING 0
  1584. #define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
  1585. /*****************************************************************************
  1586. * Setup defines, protos etc for the sharing stuff.
  1587. */
  1588. /* Different data locks for a single share */
  1589. typedef enum {
  1590. CURL_LOCK_DATA_NONE = 0,
  1591. /* CURL_LOCK_DATA_SHARE is used internally to say that
  1592. * the locking is just made to change the internal state of the share
  1593. * itself.
  1594. */
  1595. CURL_LOCK_DATA_SHARE,
  1596. CURL_LOCK_DATA_COOKIE,
  1597. CURL_LOCK_DATA_DNS,
  1598. CURL_LOCK_DATA_SSL_SESSION,
  1599. CURL_LOCK_DATA_CONNECT,
  1600. CURL_LOCK_DATA_LAST
  1601. } curl_lock_data;
  1602. /* Different lock access types */
  1603. typedef enum {
  1604. CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */
  1605. CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
  1606. CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
  1607. CURL_LOCK_ACCESS_LAST /* never use */
  1608. } curl_lock_access;
  1609. typedef void (*curl_lock_function)(CURL *handle,
  1610. curl_lock_data data,
  1611. curl_lock_access locktype,
  1612. void *userptr);
  1613. typedef void (*curl_unlock_function)(CURL *handle,
  1614. curl_lock_data data,
  1615. void *userptr);
  1616. typedef void CURLSH;
  1617. typedef enum {
  1618. CURLSHE_OK, /* all is fine */
  1619. CURLSHE_BAD_OPTION, /* 1 */
  1620. CURLSHE_IN_USE, /* 2 */
  1621. CURLSHE_INVALID, /* 3 */
  1622. CURLSHE_NOMEM, /* out of memory */
  1623. CURLSHE_LAST /* never use */
  1624. } CURLSHcode;
  1625. typedef enum {
  1626. CURLSHOPT_NONE, /* don't use */
  1627. CURLSHOPT_SHARE, /* specify a data type to share */
  1628. CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
  1629. CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
  1630. CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
  1631. CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock
  1632. callback functions */
  1633. CURLSHOPT_LAST /* never use */
  1634. } CURLSHoption;
  1635. CURL_EXTERN CURLSH *curl_share_init(void);
  1636. CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);
  1637. CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);
  1638. /****************************************************************************
  1639. * Structures for querying information about the curl library at runtime.
  1640. */
  1641. typedef enum {
  1642. CURLVERSION_FIRST,
  1643. CURLVERSION_SECOND,
  1644. CURLVERSION_THIRD,
  1645. CURLVERSION_FOURTH,
  1646. CURLVERSION_LAST /* never actually use this */
  1647. } CURLversion;
  1648. /* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
  1649. basically all programs ever that want to get version information. It is
  1650. meant to be a built-in version number for what kind of struct the caller
  1651. expects. If the struct ever changes, we redefine the NOW to another enum
  1652. from above. */
  1653. #define CURLVERSION_NOW CURLVERSION_FOURTH
  1654. typedef struct {
  1655. CURLversion age; /* age of the returned struct */
  1656. const char *version; /* LIBCURL_VERSION */
  1657. unsigned int version_num; /* LIBCURL_VERSION_NUM */
  1658. const char *host; /* OS/host/cpu/machine when configured */
  1659. int features; /* bitmask, see defines below */
  1660. const char *ssl_version; /* human readable string */
  1661. long ssl_version_num; /* not used anymore, always 0 */
  1662. const char *libz_version; /* human readable string */
  1663. /* protocols is terminated by an entry with a NULL protoname */
  1664. const char * const *protocols;
  1665. /* The fields below this were added in CURLVERSION_SECOND */
  1666. const char *ares;
  1667. int ares_num;
  1668. /* This field was added in CURLVERSION_THIRD */
  1669. const char *libidn;
  1670. /* These field were added in CURLVERSION_FOURTH */
  1671. /* Same as '_libiconv_version' if built with HAVE_ICONV */
  1672. int iconv_ver_num;
  1673. const char *libssh_version; /* human readable string */
  1674. } curl_version_info_data;
  1675. #define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */
  1676. #define CURL_VERSION_KERBEROS4 (1<<1) /* kerberos auth is supported */
  1677. #define CURL_VERSION_SSL (1<<2) /* SSL options are present */
  1678. #define CURL_VERSION_LIBZ (1<<3) /* libz features are present */
  1679. #define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */
  1680. #define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */
  1681. #define CURL_VERSION_DEBUG (1<<6) /* built with debug capabilities */
  1682. #define CURL_VERSION_ASYNCHDNS (1<<7) /* asynchronous dns resolves */
  1683. #define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth */
  1684. #define CURL_VERSION_LARGEFILE (1<<9) /* supports files bigger than 2GB */
  1685. #define CURL_VERSION_IDN (1<<10) /* International Domain Names support */
  1686. #define CURL_VERSION_SSPI (1<<11) /* SSPI is supported */
  1687. #define CURL_VERSION_CONV (1<<12) /* character conversions supported */
  1688. #define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */
  1689. /*
  1690. * NAME curl_version_info()
  1691. *
  1692. * DESCRIPTION
  1693. *
  1694. * This function returns a pointer to a static copy of the version info
  1695. * struct. See above.
  1696. */
  1697. CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);
  1698. /*
  1699. * NAME curl_easy_strerror()
  1700. *
  1701. * DESCRIPTION
  1702. *
  1703. * The curl_easy_strerror function may be used to turn a CURLcode value
  1704. * into the equivalent human readable error string. This is useful
  1705. * for printing meaningful error messages.
  1706. */
  1707. CURL_EXTERN const char *curl_easy_strerror(CURLcode);
  1708. /*
  1709. * NAME curl_share_strerror()
  1710. *
  1711. * DESCRIPTION
  1712. *
  1713. * The curl_share_strerror function may be used to turn a CURLSHcode value
  1714. * into the equivalent human readable error string. This is useful
  1715. * for printing meaningful error messages.
  1716. */
  1717. CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
  1718. /*
  1719. * NAME curl_easy_pause()
  1720. *
  1721. * DESCRIPTION
  1722. *
  1723. * The curl_easy_pause function pauses or unpauses transfers. Select the new
  1724. * state by setting the bitmask, use the convenience defines below.
  1725. *
  1726. */
  1727. CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
  1728. #define CURLPAUSE_RECV (1<<0)
  1729. #define CURLPAUSE_RECV_CONT (0)
  1730. #define CURLPAUSE_SEND (1<<2)
  1731. #define CURLPAUSE_SEND_CONT (0)
  1732. #define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND)
  1733. #define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)
  1734. #ifdef __cplusplus
  1735. }
  1736. #endif
  1737. /* unfortunately, the easy.h and multi.h include files need options and info
  1738. stuff before they can be included! */
  1739. #include "easy.h" /* nothing in curl is fun without the easy stuff */
  1740. #include "multi.h"
  1741. /* the typechecker doesn't work in C++ (yet) */
  1742. #if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
  1743. ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
  1744. !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)
  1745. #include "typecheck-gcc.h"
  1746. #else
  1747. #if defined(__STDC__) && (__STDC__ >= 1)
  1748. /* This preprocessor magic that replaces a call with the exact same call is
  1749. only done to make sure application authors pass exactly three arguments
  1750. to these functions. */
  1751. #define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
  1752. #define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)
  1753. #define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
  1754. #define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
  1755. #endif /* __STDC__ >= 1 */
  1756. #endif /* gcc >= 4.3 && !__cplusplus */
  1757. #endif /* __CURL_CURL_H */