curl.h 80 KB

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