/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

Large files are truncated click here to view the full 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 libcu…