curl.h 91 KB

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