curl.h 90 KB

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