curl.h 125 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214
  1. #ifndef CURLINC_CURL_H
  2. #define CURLINC_CURL_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 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.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. * SPDX-License-Identifier: curl
  24. *
  25. ***************************************************************************/
  26. /*
  27. * If you have libcurl problems, all docs and details are found here:
  28. * https://curl.se/libcurl/
  29. */
  30. #ifdef CURL_NO_OLDIES
  31. #define CURL_STRICTER
  32. #endif
  33. /* Compile-time deprecation macros. */
  34. #if defined(__GNUC__) && (__GNUC__ >= 6) && \
  35. !defined(__INTEL_COMPILER) && \
  36. !defined(CURL_DISABLE_DEPRECATION) && !defined(BUILDING_LIBCURL)
  37. #define CURL_DEPRECATED(version, message) \
  38. __attribute__((deprecated("since " # version ". " message)))
  39. #define CURL_IGNORE_DEPRECATION(statements) \
  40. _Pragma("GCC diagnostic push") \
  41. _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
  42. statements \
  43. _Pragma("GCC diagnostic pop")
  44. #else
  45. #define CURL_DEPRECATED(version, message)
  46. #define CURL_IGNORE_DEPRECATION(statements) statements
  47. #endif
  48. #include "curlver.h" /* libcurl version defines */
  49. #include "system.h" /* determine things run-time */
  50. /*
  51. * Define CURL_WIN32 when build target is Win32 API
  52. */
  53. #if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && \
  54. !defined(__SYMBIAN32__)
  55. #define CURL_WIN32
  56. #endif
  57. #include <stdio.h>
  58. #include <limits.h>
  59. #if (defined(__FreeBSD__) && (__FreeBSD__ >= 2)) || defined(__MidnightBSD__)
  60. /* Needed for __FreeBSD_version or __MidnightBSD_version symbol definition */
  61. #include <osreldate.h>
  62. #endif
  63. /* The include stuff here below is mainly for time_t! */
  64. #include <sys/types.h>
  65. #include <time.h>
  66. #if defined(CURL_WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
  67. #if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || \
  68. defined(__LWIP_OPT_H__) || defined(LWIP_HDR_OPT_H))
  69. /* The check above prevents the winsock2 inclusion if winsock.h already was
  70. included, since they can't co-exist without problems */
  71. #include <winsock2.h>
  72. #include <ws2tcpip.h>
  73. #endif
  74. #endif
  75. /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
  76. libc5-based Linux systems. Only include it on systems that are known to
  77. require it! */
  78. #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
  79. defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
  80. defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \
  81. defined(__CYGWIN__) || defined(AMIGA) || defined(__NuttX__) || \
  82. (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) || \
  83. (defined(__MidnightBSD_version) && (__MidnightBSD_version < 100000)) || \
  84. defined(__sun__) || defined(__serenity__)
  85. #include <sys/select.h>
  86. #endif
  87. #if !defined(CURL_WIN32) && !defined(_WIN32_WCE)
  88. #include <sys/socket.h>
  89. #endif
  90. #if !defined(CURL_WIN32)
  91. #include <sys/time.h>
  92. #endif
  93. /* Compatibility for non-Clang compilers */
  94. #ifndef __has_declspec_attribute
  95. # define __has_declspec_attribute(x) 0
  96. #endif
  97. #ifdef __cplusplus
  98. extern "C" {
  99. #endif
  100. #if defined(BUILDING_LIBCURL) || defined(CURL_STRICTER)
  101. typedef struct Curl_easy CURL;
  102. typedef struct Curl_share CURLSH;
  103. #else
  104. typedef void CURL;
  105. typedef void CURLSH;
  106. #endif
  107. /*
  108. * libcurl external API function linkage decorations.
  109. */
  110. #ifdef CURL_STATICLIB
  111. # define CURL_EXTERN
  112. #elif defined(CURL_WIN32) || defined(__SYMBIAN32__) || \
  113. (__has_declspec_attribute(dllexport) && \
  114. __has_declspec_attribute(dllimport))
  115. # if defined(BUILDING_LIBCURL)
  116. # define CURL_EXTERN __declspec(dllexport)
  117. # else
  118. # define CURL_EXTERN __declspec(dllimport)
  119. # endif
  120. #elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS)
  121. # define CURL_EXTERN CURL_EXTERN_SYMBOL
  122. #else
  123. # define CURL_EXTERN
  124. #endif
  125. #ifndef curl_socket_typedef
  126. /* socket typedef */
  127. #if defined(CURL_WIN32) && !defined(__LWIP_OPT_H__) && !defined(LWIP_HDR_OPT_H)
  128. typedef SOCKET curl_socket_t;
  129. #define CURL_SOCKET_BAD INVALID_SOCKET
  130. #else
  131. typedef int curl_socket_t;
  132. #define CURL_SOCKET_BAD -1
  133. #endif
  134. #define curl_socket_typedef
  135. #endif /* curl_socket_typedef */
  136. /* enum for the different supported SSL backends */
  137. typedef enum {
  138. CURLSSLBACKEND_NONE = 0,
  139. CURLSSLBACKEND_OPENSSL = 1,
  140. CURLSSLBACKEND_GNUTLS = 2,
  141. CURLSSLBACKEND_NSS = 3,
  142. CURLSSLBACKEND_OBSOLETE4 = 4, /* Was QSOSSL. */
  143. CURLSSLBACKEND_GSKIT = 5,
  144. CURLSSLBACKEND_POLARSSL CURL_DEPRECATED(7.69.0, "") = 6,
  145. CURLSSLBACKEND_WOLFSSL = 7,
  146. CURLSSLBACKEND_SCHANNEL = 8,
  147. CURLSSLBACKEND_SECURETRANSPORT = 9,
  148. CURLSSLBACKEND_AXTLS CURL_DEPRECATED(7.61.0, "") = 10,
  149. CURLSSLBACKEND_MBEDTLS = 11,
  150. CURLSSLBACKEND_MESALINK CURL_DEPRECATED(7.82.0, "") = 12,
  151. CURLSSLBACKEND_BEARSSL = 13,
  152. CURLSSLBACKEND_RUSTLS = 14
  153. } curl_sslbackend;
  154. /* aliases for library clones and renames */
  155. #define CURLSSLBACKEND_LIBRESSL CURLSSLBACKEND_OPENSSL
  156. #define CURLSSLBACKEND_BORINGSSL CURLSSLBACKEND_OPENSSL
  157. /* deprecated names: */
  158. #define CURLSSLBACKEND_CYASSL CURLSSLBACKEND_WOLFSSL
  159. #define CURLSSLBACKEND_DARWINSSL CURLSSLBACKEND_SECURETRANSPORT
  160. struct curl_httppost {
  161. struct curl_httppost *next; /* next entry in the list */
  162. char *name; /* pointer to allocated name */
  163. long namelength; /* length of name length */
  164. char *contents; /* pointer to allocated data contents */
  165. long contentslength; /* length of contents field, see also
  166. CURL_HTTPPOST_LARGE */
  167. char *buffer; /* pointer to allocated buffer contents */
  168. long bufferlength; /* length of buffer field */
  169. char *contenttype; /* Content-Type */
  170. struct curl_slist *contentheader; /* list of extra headers for this form */
  171. struct curl_httppost *more; /* if one field name has more than one
  172. file, this link should link to following
  173. files */
  174. long flags; /* as defined below */
  175. /* specified content is a file name */
  176. #define CURL_HTTPPOST_FILENAME (1<<0)
  177. /* specified content is a file name */
  178. #define CURL_HTTPPOST_READFILE (1<<1)
  179. /* name is only stored pointer do not free in formfree */
  180. #define CURL_HTTPPOST_PTRNAME (1<<2)
  181. /* contents is only stored pointer do not free in formfree */
  182. #define CURL_HTTPPOST_PTRCONTENTS (1<<3)
  183. /* upload file from buffer */
  184. #define CURL_HTTPPOST_BUFFER (1<<4)
  185. /* upload file from pointer contents */
  186. #define CURL_HTTPPOST_PTRBUFFER (1<<5)
  187. /* upload file contents by using the regular read callback to get the data and
  188. pass the given pointer as custom pointer */
  189. #define CURL_HTTPPOST_CALLBACK (1<<6)
  190. /* use size in 'contentlen', added in 7.46.0 */
  191. #define CURL_HTTPPOST_LARGE (1<<7)
  192. char *showfilename; /* The file name to show. If not set, the
  193. actual file name will be used (if this
  194. is a file part) */
  195. void *userp; /* custom pointer used for
  196. HTTPPOST_CALLBACK posts */
  197. curl_off_t contentlen; /* alternative length of contents
  198. field. Used if CURL_HTTPPOST_LARGE is
  199. set. Added in 7.46.0 */
  200. };
  201. /* This is a return code for the progress callback that, when returned, will
  202. signal libcurl to continue executing the default progress function */
  203. #define CURL_PROGRESSFUNC_CONTINUE 0x10000001
  204. /* This is the CURLOPT_PROGRESSFUNCTION callback prototype. It is now
  205. considered deprecated but was the only choice up until 7.31.0 */
  206. typedef int (*curl_progress_callback)(void *clientp,
  207. double dltotal,
  208. double dlnow,
  209. double ultotal,
  210. double ulnow);
  211. /* This is the CURLOPT_XFERINFOFUNCTION callback prototype. It was introduced
  212. in 7.32.0, avoids the use of floating point numbers and provides more
  213. detailed information. */
  214. typedef int (*curl_xferinfo_callback)(void *clientp,
  215. curl_off_t dltotal,
  216. curl_off_t dlnow,
  217. curl_off_t ultotal,
  218. curl_off_t ulnow);
  219. #ifndef CURL_MAX_READ_SIZE
  220. /* The maximum receive buffer size configurable via CURLOPT_BUFFERSIZE. */
  221. #define CURL_MAX_READ_SIZE (10*1024*1024)
  222. #endif
  223. #ifndef CURL_MAX_WRITE_SIZE
  224. /* Tests have proven that 20K is a very bad buffer size for uploads on
  225. Windows, while 16K for some odd reason performed a lot better.
  226. We do the ifndef check to allow this value to easier be changed at build
  227. time for those who feel adventurous. The practical minimum is about
  228. 400 bytes since libcurl uses a buffer of this size as a scratch area
  229. (unrelated to network send operations). */
  230. #define CURL_MAX_WRITE_SIZE 16384
  231. #endif
  232. #ifndef CURL_MAX_HTTP_HEADER
  233. /* The only reason to have a max limit for this is to avoid the risk of a bad
  234. server feeding libcurl with a never-ending header that will cause reallocs
  235. infinitely */
  236. #define CURL_MAX_HTTP_HEADER (100*1024)
  237. #endif
  238. /* This is a magic return code for the write callback that, when returned,
  239. will signal libcurl to pause receiving on the current transfer. */
  240. #define CURL_WRITEFUNC_PAUSE 0x10000001
  241. /* This is a magic return code for the write callback that, when returned,
  242. will signal an error from the callback. */
  243. #define CURL_WRITEFUNC_ERROR 0xFFFFFFFF
  244. typedef size_t (*curl_write_callback)(char *buffer,
  245. size_t size,
  246. size_t nitems,
  247. void *outstream);
  248. /* This callback will be called when a new resolver request is made */
  249. typedef int (*curl_resolver_start_callback)(void *resolver_state,
  250. void *reserved, void *userdata);
  251. /* enumeration of file types */
  252. typedef enum {
  253. CURLFILETYPE_FILE = 0,
  254. CURLFILETYPE_DIRECTORY,
  255. CURLFILETYPE_SYMLINK,
  256. CURLFILETYPE_DEVICE_BLOCK,
  257. CURLFILETYPE_DEVICE_CHAR,
  258. CURLFILETYPE_NAMEDPIPE,
  259. CURLFILETYPE_SOCKET,
  260. CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */
  261. CURLFILETYPE_UNKNOWN /* should never occur */
  262. } curlfiletype;
  263. #define CURLFINFOFLAG_KNOWN_FILENAME (1<<0)
  264. #define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1)
  265. #define CURLFINFOFLAG_KNOWN_TIME (1<<2)
  266. #define CURLFINFOFLAG_KNOWN_PERM (1<<3)
  267. #define CURLFINFOFLAG_KNOWN_UID (1<<4)
  268. #define CURLFINFOFLAG_KNOWN_GID (1<<5)
  269. #define CURLFINFOFLAG_KNOWN_SIZE (1<<6)
  270. #define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7)
  271. /* Information about a single file, used when doing FTP wildcard matching */
  272. struct curl_fileinfo {
  273. char *filename;
  274. curlfiletype filetype;
  275. time_t time; /* always zero! */
  276. unsigned int perm;
  277. int uid;
  278. int gid;
  279. curl_off_t size;
  280. long int hardlinks;
  281. struct {
  282. /* If some of these fields is not NULL, it is a pointer to b_data. */
  283. char *time;
  284. char *perm;
  285. char *user;
  286. char *group;
  287. char *target; /* pointer to the target filename of a symlink */
  288. } strings;
  289. unsigned int flags;
  290. /* used internally */
  291. char *b_data;
  292. size_t b_size;
  293. size_t b_used;
  294. };
  295. /* return codes for CURLOPT_CHUNK_BGN_FUNCTION */
  296. #define CURL_CHUNK_BGN_FUNC_OK 0
  297. #define CURL_CHUNK_BGN_FUNC_FAIL 1 /* tell the lib to end the task */
  298. #define CURL_CHUNK_BGN_FUNC_SKIP 2 /* skip this chunk over */
  299. /* if splitting of data transfer is enabled, this callback is called before
  300. download of an individual chunk started. Note that parameter "remains" works
  301. only for FTP wildcard downloading (for now), otherwise is not used */
  302. typedef long (*curl_chunk_bgn_callback)(const void *transfer_info,
  303. void *ptr,
  304. int remains);
  305. /* return codes for CURLOPT_CHUNK_END_FUNCTION */
  306. #define CURL_CHUNK_END_FUNC_OK 0
  307. #define CURL_CHUNK_END_FUNC_FAIL 1 /* tell the lib to end the task */
  308. /* If splitting of data transfer is enabled this callback is called after
  309. download of an individual chunk finished.
  310. Note! After this callback was set then it have to be called FOR ALL chunks.
  311. Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.
  312. This is the reason why we don't need "transfer_info" parameter in this
  313. callback and we are not interested in "remains" parameter too. */
  314. typedef long (*curl_chunk_end_callback)(void *ptr);
  315. /* return codes for FNMATCHFUNCTION */
  316. #define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */
  317. #define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern doesn't match the string */
  318. #define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */
  319. /* callback type for wildcard downloading pattern matching. If the
  320. string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */
  321. typedef int (*curl_fnmatch_callback)(void *ptr,
  322. const char *pattern,
  323. const char *string);
  324. /* These are the return codes for the seek callbacks */
  325. #define CURL_SEEKFUNC_OK 0
  326. #define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */
  327. #define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so
  328. libcurl might try other means instead */
  329. typedef int (*curl_seek_callback)(void *instream,
  330. curl_off_t offset,
  331. int origin); /* 'whence' */
  332. /* This is a return code for the read callback that, when returned, will
  333. signal libcurl to immediately abort the current transfer. */
  334. #define CURL_READFUNC_ABORT 0x10000000
  335. /* This is a return code for the read callback that, when returned, will
  336. signal libcurl to pause sending data on the current transfer. */
  337. #define CURL_READFUNC_PAUSE 0x10000001
  338. /* Return code for when the trailing headers' callback has terminated
  339. without any errors */
  340. #define CURL_TRAILERFUNC_OK 0
  341. /* Return code for when was an error in the trailing header's list and we
  342. want to abort the request */
  343. #define CURL_TRAILERFUNC_ABORT 1
  344. typedef size_t (*curl_read_callback)(char *buffer,
  345. size_t size,
  346. size_t nitems,
  347. void *instream);
  348. typedef int (*curl_trailer_callback)(struct curl_slist **list,
  349. void *userdata);
  350. typedef enum {
  351. CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
  352. CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */
  353. CURLSOCKTYPE_LAST /* never use */
  354. } curlsocktype;
  355. /* The return code from the sockopt_callback can signal information back
  356. to libcurl: */
  357. #define CURL_SOCKOPT_OK 0
  358. #define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return
  359. CURLE_ABORTED_BY_CALLBACK */
  360. #define CURL_SOCKOPT_ALREADY_CONNECTED 2
  361. typedef int (*curl_sockopt_callback)(void *clientp,
  362. curl_socket_t curlfd,
  363. curlsocktype purpose);
  364. struct curl_sockaddr {
  365. int family;
  366. int socktype;
  367. int protocol;
  368. unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it
  369. turned really ugly and painful on the systems that
  370. lack this type */
  371. struct sockaddr addr;
  372. };
  373. typedef curl_socket_t
  374. (*curl_opensocket_callback)(void *clientp,
  375. curlsocktype purpose,
  376. struct curl_sockaddr *address);
  377. typedef int
  378. (*curl_closesocket_callback)(void *clientp, curl_socket_t item);
  379. typedef enum {
  380. CURLIOE_OK, /* I/O operation successful */
  381. CURLIOE_UNKNOWNCMD, /* command was unknown to callback */
  382. CURLIOE_FAILRESTART, /* failed to restart the read */
  383. CURLIOE_LAST /* never use */
  384. } curlioerr;
  385. typedef enum {
  386. CURLIOCMD_NOP, /* no operation */
  387. CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
  388. CURLIOCMD_LAST /* never use */
  389. } curliocmd;
  390. typedef curlioerr (*curl_ioctl_callback)(CURL *handle,
  391. int cmd,
  392. void *clientp);
  393. #ifndef CURL_DID_MEMORY_FUNC_TYPEDEFS
  394. /*
  395. * The following typedef's are signatures of malloc, free, realloc, strdup and
  396. * calloc respectively. Function pointers of these types can be passed to the
  397. * curl_global_init_mem() function to set user defined memory management
  398. * callback routines.
  399. */
  400. typedef void *(*curl_malloc_callback)(size_t size);
  401. typedef void (*curl_free_callback)(void *ptr);
  402. typedef void *(*curl_realloc_callback)(void *ptr, size_t size);
  403. typedef char *(*curl_strdup_callback)(const char *str);
  404. typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
  405. #define CURL_DID_MEMORY_FUNC_TYPEDEFS
  406. #endif
  407. /* the kind of data that is passed to information_callback */
  408. typedef enum {
  409. CURLINFO_TEXT = 0,
  410. CURLINFO_HEADER_IN, /* 1 */
  411. CURLINFO_HEADER_OUT, /* 2 */
  412. CURLINFO_DATA_IN, /* 3 */
  413. CURLINFO_DATA_OUT, /* 4 */
  414. CURLINFO_SSL_DATA_IN, /* 5 */
  415. CURLINFO_SSL_DATA_OUT, /* 6 */
  416. CURLINFO_END
  417. } curl_infotype;
  418. typedef int (*curl_debug_callback)
  419. (CURL *handle, /* the handle/transfer this concerns */
  420. curl_infotype type, /* what kind of data */
  421. char *data, /* points to the data */
  422. size_t size, /* size of the data pointed to */
  423. void *userptr); /* whatever the user please */
  424. /* This is the CURLOPT_PREREQFUNCTION callback prototype. */
  425. typedef int (*curl_prereq_callback)(void *clientp,
  426. char *conn_primary_ip,
  427. char *conn_local_ip,
  428. int conn_primary_port,
  429. int conn_local_port);
  430. /* Return code for when the pre-request callback has terminated without
  431. any errors */
  432. #define CURL_PREREQFUNC_OK 0
  433. /* Return code for when the pre-request callback wants to abort the
  434. request */
  435. #define CURL_PREREQFUNC_ABORT 1
  436. /* All possible error codes from all sorts of curl functions. Future versions
  437. may return other values, stay prepared.
  438. Always add new return codes last. Never *EVER* remove any. The return
  439. codes must remain the same!
  440. */
  441. typedef enum {
  442. CURLE_OK = 0,
  443. CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
  444. CURLE_FAILED_INIT, /* 2 */
  445. CURLE_URL_MALFORMAT, /* 3 */
  446. CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for
  447. 7.17.0, reused in April 2011 for 7.21.5] */
  448. CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
  449. CURLE_COULDNT_RESOLVE_HOST, /* 6 */
  450. CURLE_COULDNT_CONNECT, /* 7 */
  451. CURLE_WEIRD_SERVER_REPLY, /* 8 */
  452. CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
  453. due to lack of access - when login fails
  454. this is not returned. */
  455. CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for
  456. 7.15.4, reused in Dec 2011 for 7.24.0]*/
  457. CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
  458. CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server
  459. [was obsoleted in August 2007 for 7.17.0,
  460. reused in Dec 2011 for 7.24.0]*/
  461. CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
  462. CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
  463. CURLE_FTP_CANT_GET_HOST, /* 15 */
  464. CURLE_HTTP2, /* 16 - A problem in the http2 framing layer.
  465. [was obsoleted in August 2007 for 7.17.0,
  466. reused in July 2014 for 7.38.0] */
  467. CURLE_FTP_COULDNT_SET_TYPE, /* 17 */
  468. CURLE_PARTIAL_FILE, /* 18 */
  469. CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
  470. CURLE_OBSOLETE20, /* 20 - NOT USED */
  471. CURLE_QUOTE_ERROR, /* 21 - quote command failure */
  472. CURLE_HTTP_RETURNED_ERROR, /* 22 */
  473. CURLE_WRITE_ERROR, /* 23 */
  474. CURLE_OBSOLETE24, /* 24 - NOT USED */
  475. CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
  476. CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
  477. CURLE_OUT_OF_MEMORY, /* 27 */
  478. CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
  479. CURLE_OBSOLETE29, /* 29 - NOT USED */
  480. CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
  481. CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */
  482. CURLE_OBSOLETE32, /* 32 - NOT USED */
  483. CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
  484. CURLE_HTTP_POST_ERROR, /* 34 */
  485. CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
  486. CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
  487. CURLE_FILE_COULDNT_READ_FILE, /* 37 */
  488. CURLE_LDAP_CANNOT_BIND, /* 38 */
  489. CURLE_LDAP_SEARCH_FAILED, /* 39 */
  490. CURLE_OBSOLETE40, /* 40 - NOT USED */
  491. CURLE_FUNCTION_NOT_FOUND, /* 41 - NOT USED starting with 7.53.0 */
  492. CURLE_ABORTED_BY_CALLBACK, /* 42 */
  493. CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */
  494. CURLE_OBSOLETE44, /* 44 - NOT USED */
  495. CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
  496. CURLE_OBSOLETE46, /* 46 - NOT USED */
  497. CURLE_TOO_MANY_REDIRECTS, /* 47 - catch endless re-direct loops */
  498. CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */
  499. CURLE_SETOPT_OPTION_SYNTAX, /* 49 - Malformed setopt option */
  500. CURLE_OBSOLETE50, /* 50 - NOT USED */
  501. CURLE_OBSOLETE51, /* 51 - NOT USED */
  502. CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
  503. CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
  504. CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
  505. default */
  506. CURLE_SEND_ERROR, /* 55 - failed sending network data */
  507. CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
  508. CURLE_OBSOLETE57, /* 57 - NOT IN USE */
  509. CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
  510. CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
  511. CURLE_PEER_FAILED_VERIFICATION, /* 60 - peer's certificate or fingerprint
  512. wasn't verified fine */
  513. CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */
  514. CURLE_OBSOLETE62, /* 62 - NOT IN USE since 7.82.0 */
  515. CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
  516. CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
  517. CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
  518. that failed */
  519. CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
  520. CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
  521. accepted and we failed to login */
  522. CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */
  523. CURLE_TFTP_PERM, /* 69 - permission problem on server */
  524. CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */
  525. CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */
  526. CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
  527. CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
  528. CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
  529. CURLE_OBSOLETE75, /* 75 - NOT IN USE since 7.82.0 */
  530. CURLE_OBSOLETE76, /* 76 - NOT IN USE since 7.82.0 */
  531. CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
  532. or wrong format */
  533. CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
  534. CURLE_SSH, /* 79 - error from the SSH layer, somewhat
  535. generic so the error message will be of
  536. interest when this has happened */
  537. CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
  538. connection */
  539. CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
  540. wait till it's ready and try again (Added
  541. in 7.18.2) */
  542. CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or
  543. wrong format (Added in 7.19.0) */
  544. CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in
  545. 7.19.0) */
  546. CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */
  547. CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */
  548. CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */
  549. CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */
  550. CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */
  551. CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the
  552. session will be queued */
  553. CURLE_SSL_PINNEDPUBKEYNOTMATCH, /* 90 - specified pinned public key did not
  554. match */
  555. CURLE_SSL_INVALIDCERTSTATUS, /* 91 - invalid certificate status */
  556. CURLE_HTTP2_STREAM, /* 92 - stream error in HTTP/2 framing layer
  557. */
  558. CURLE_RECURSIVE_API_CALL, /* 93 - an api function was called from
  559. inside a callback */
  560. CURLE_AUTH_ERROR, /* 94 - an authentication function returned an
  561. error */
  562. CURLE_HTTP3, /* 95 - An HTTP/3 layer problem */
  563. CURLE_QUIC_CONNECT_ERROR, /* 96 - QUIC connection error */
  564. CURLE_PROXY, /* 97 - proxy handshake error */
  565. CURLE_SSL_CLIENTCERT, /* 98 - client-side certificate required */
  566. CURLE_UNRECOVERABLE_POLL, /* 99 - poll/select returned fatal error */
  567. CURL_LAST /* never use! */
  568. } CURLcode;
  569. #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
  570. the obsolete stuff removed! */
  571. /* Previously obsolete error code re-used in 7.38.0 */
  572. #define CURLE_OBSOLETE16 CURLE_HTTP2
  573. /* Previously obsolete error codes re-used in 7.24.0 */
  574. #define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED
  575. #define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT
  576. /* compatibility with older names */
  577. #define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING
  578. #define CURLE_FTP_WEIRD_SERVER_REPLY CURLE_WEIRD_SERVER_REPLY
  579. /* The following were added in 7.62.0 */
  580. #define CURLE_SSL_CACERT CURLE_PEER_FAILED_VERIFICATION
  581. /* The following were added in 7.21.5, April 2011 */
  582. #define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION
  583. /* Added for 7.78.0 */
  584. #define CURLE_TELNET_OPTION_SYNTAX CURLE_SETOPT_OPTION_SYNTAX
  585. /* The following were added in 7.17.1 */
  586. /* These are scheduled to disappear by 2009 */
  587. #define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION
  588. /* The following were added in 7.17.0 */
  589. /* These are scheduled to disappear by 2009 */
  590. #define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */
  591. #define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46
  592. #define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44
  593. #define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10
  594. #define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16
  595. #define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32
  596. #define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29
  597. #define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12
  598. #define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20
  599. #define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40
  600. #define CURLE_MALFORMAT_USER CURLE_OBSOLETE24
  601. #define CURLE_SHARE_IN_USE CURLE_OBSOLETE57
  602. #define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN
  603. #define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED
  604. #define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE
  605. #define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR
  606. #define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL
  607. #define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS
  608. #define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR
  609. #define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED
  610. /* The following were added earlier */
  611. #define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT
  612. #define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR
  613. #define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED
  614. #define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED
  615. #define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
  616. #define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
  617. #define CURLE_LDAP_INVALID_URL CURLE_OBSOLETE62
  618. #define CURLE_CONV_REQD CURLE_OBSOLETE76
  619. #define CURLE_CONV_FAILED CURLE_OBSOLETE75
  620. /* This was the error code 50 in 7.7.3 and a few earlier versions, this
  621. is no longer used by libcurl but is instead #defined here only to not
  622. make programs break */
  623. #define CURLE_ALREADY_COMPLETE 99999
  624. /* Provide defines for really old option names */
  625. #define CURLOPT_FILE CURLOPT_WRITEDATA /* name changed in 7.9.7 */
  626. #define CURLOPT_INFILE CURLOPT_READDATA /* name changed in 7.9.7 */
  627. #define CURLOPT_WRITEHEADER CURLOPT_HEADERDATA
  628. /* Since long deprecated options with no code in the lib that does anything
  629. with them. */
  630. #define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40
  631. #define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72
  632. #endif /* !CURL_NO_OLDIES */
  633. /*
  634. * Proxy error codes. Returned in CURLINFO_PROXY_ERROR if CURLE_PROXY was
  635. * return for the transfers.
  636. */
  637. typedef enum {
  638. CURLPX_OK,
  639. CURLPX_BAD_ADDRESS_TYPE,
  640. CURLPX_BAD_VERSION,
  641. CURLPX_CLOSED,
  642. CURLPX_GSSAPI,
  643. CURLPX_GSSAPI_PERMSG,
  644. CURLPX_GSSAPI_PROTECTION,
  645. CURLPX_IDENTD,
  646. CURLPX_IDENTD_DIFFER,
  647. CURLPX_LONG_HOSTNAME,
  648. CURLPX_LONG_PASSWD,
  649. CURLPX_LONG_USER,
  650. CURLPX_NO_AUTH,
  651. CURLPX_RECV_ADDRESS,
  652. CURLPX_RECV_AUTH,
  653. CURLPX_RECV_CONNECT,
  654. CURLPX_RECV_REQACK,
  655. CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED,
  656. CURLPX_REPLY_COMMAND_NOT_SUPPORTED,
  657. CURLPX_REPLY_CONNECTION_REFUSED,
  658. CURLPX_REPLY_GENERAL_SERVER_FAILURE,
  659. CURLPX_REPLY_HOST_UNREACHABLE,
  660. CURLPX_REPLY_NETWORK_UNREACHABLE,
  661. CURLPX_REPLY_NOT_ALLOWED,
  662. CURLPX_REPLY_TTL_EXPIRED,
  663. CURLPX_REPLY_UNASSIGNED,
  664. CURLPX_REQUEST_FAILED,
  665. CURLPX_RESOLVE_HOST,
  666. CURLPX_SEND_AUTH,
  667. CURLPX_SEND_CONNECT,
  668. CURLPX_SEND_REQUEST,
  669. CURLPX_UNKNOWN_FAIL,
  670. CURLPX_UNKNOWN_MODE,
  671. CURLPX_USER_REJECTED,
  672. CURLPX_LAST /* never use */
  673. } CURLproxycode;
  674. /* This prototype applies to all conversion callbacks */
  675. typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
  676. typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */
  677. void *ssl_ctx, /* actually an OpenSSL
  678. or WolfSSL SSL_CTX,
  679. or an mbedTLS
  680. mbedtls_ssl_config */
  681. void *userptr);
  682. typedef enum {
  683. CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
  684. CONNECT HTTP/1.1 */
  685. CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
  686. HTTP/1.0 */
  687. CURLPROXY_HTTPS = 2, /* added in 7.52.0 */
  688. CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
  689. in 7.10 */
  690. CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
  691. CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
  692. CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
  693. host name rather than the IP address. added
  694. in 7.18.0 */
  695. } curl_proxytype; /* this enum was added in 7.10 */
  696. /*
  697. * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:
  698. *
  699. * CURLAUTH_NONE - No HTTP authentication
  700. * CURLAUTH_BASIC - HTTP Basic authentication (default)
  701. * CURLAUTH_DIGEST - HTTP Digest authentication
  702. * CURLAUTH_NEGOTIATE - HTTP Negotiate (SPNEGO) authentication
  703. * CURLAUTH_GSSNEGOTIATE - Alias for CURLAUTH_NEGOTIATE (deprecated)
  704. * CURLAUTH_NTLM - HTTP NTLM authentication
  705. * CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour
  706. * CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper
  707. * CURLAUTH_BEARER - HTTP Bearer token authentication
  708. * CURLAUTH_ONLY - Use together with a single other type to force no
  709. * authentication or just that single type
  710. * CURLAUTH_ANY - All fine types set
  711. * CURLAUTH_ANYSAFE - All fine types except Basic
  712. */
  713. #define CURLAUTH_NONE ((unsigned long)0)
  714. #define CURLAUTH_BASIC (((unsigned long)1)<<0)
  715. #define CURLAUTH_DIGEST (((unsigned long)1)<<1)
  716. #define CURLAUTH_NEGOTIATE (((unsigned long)1)<<2)
  717. /* Deprecated since the advent of CURLAUTH_NEGOTIATE */
  718. #define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE
  719. /* Used for CURLOPT_SOCKS5_AUTH to stay terminologically correct */
  720. #define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
  721. #define CURLAUTH_NTLM (((unsigned long)1)<<3)
  722. #define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)
  723. #define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)
  724. #define CURLAUTH_BEARER (((unsigned long)1)<<6)
  725. #define CURLAUTH_AWS_SIGV4 (((unsigned long)1)<<7)
  726. #define CURLAUTH_ONLY (((unsigned long)1)<<31)
  727. #define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
  728. #define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
  729. #define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */
  730. #define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */
  731. #define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */
  732. #define CURLSSH_AUTH_PASSWORD (1<<1) /* password */
  733. #define CURLSSH_AUTH_HOST (1<<2) /* host key files */
  734. #define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */
  735. #define CURLSSH_AUTH_AGENT (1<<4) /* agent (ssh-agent, pageant...) */
  736. #define CURLSSH_AUTH_GSSAPI (1<<5) /* gssapi (kerberos, ...) */
  737. #define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
  738. #define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */
  739. #define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */
  740. #define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */
  741. #define CURL_ERROR_SIZE 256
  742. enum curl_khtype {
  743. CURLKHTYPE_UNKNOWN,
  744. CURLKHTYPE_RSA1,
  745. CURLKHTYPE_RSA,
  746. CURLKHTYPE_DSS,
  747. CURLKHTYPE_ECDSA,
  748. CURLKHTYPE_ED25519
  749. };
  750. struct curl_khkey {
  751. const char *key; /* points to a null-terminated string encoded with base64
  752. if len is zero, otherwise to the "raw" data */
  753. size_t len;
  754. enum curl_khtype keytype;
  755. };
  756. /* this is the set of return values expected from the curl_sshkeycallback
  757. callback */
  758. enum curl_khstat {
  759. CURLKHSTAT_FINE_ADD_TO_FILE,
  760. CURLKHSTAT_FINE,
  761. CURLKHSTAT_REJECT, /* reject the connection, return an error */
  762. CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now.
  763. Causes a CURLE_PEER_FAILED_VERIFICATION error but the
  764. connection will be left intact etc */
  765. CURLKHSTAT_FINE_REPLACE, /* accept and replace the wrong key */
  766. CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
  767. };
  768. /* this is the set of status codes pass in to the callback */
  769. enum curl_khmatch {
  770. CURLKHMATCH_OK, /* match */
  771. CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
  772. CURLKHMATCH_MISSING, /* no matching host/key found */
  773. CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */
  774. };
  775. typedef int
  776. (*curl_sshkeycallback) (CURL *easy, /* easy handle */
  777. const struct curl_khkey *knownkey, /* known */
  778. const struct curl_khkey *foundkey, /* found */
  779. enum curl_khmatch, /* libcurl's view on the keys */
  780. void *clientp); /* custom pointer passed with */
  781. /* CURLOPT_SSH_KEYDATA */
  782. typedef int
  783. (*curl_sshhostkeycallback) (void *clientp,/* custom pointer passed */
  784. /* with CURLOPT_SSH_HOSTKEYDATA */
  785. int keytype, /* CURLKHTYPE */
  786. const char *key, /* hostkey to check */
  787. size_t keylen); /* length of the key */
  788. /* return CURLE_OK to accept */
  789. /* or something else to refuse */
  790. /* parameter for the CURLOPT_USE_SSL option */
  791. typedef enum {
  792. CURLUSESSL_NONE, /* do not attempt to use SSL */
  793. CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */
  794. CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
  795. CURLUSESSL_ALL, /* SSL for all communication or fail */
  796. CURLUSESSL_LAST /* not an option, never use */
  797. } curl_usessl;
  798. /* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */
  799. /* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the
  800. name of improving interoperability with older servers. Some SSL libraries
  801. have introduced work-arounds for this flaw but those work-arounds sometimes
  802. make the SSL communication fail. To regain functionality with those broken
  803. servers, a user can this way allow the vulnerability back. */
  804. #define CURLSSLOPT_ALLOW_BEAST (1<<0)
  805. /* - NO_REVOKE tells libcurl to disable certificate revocation checks for those
  806. SSL backends where such behavior is present. */
  807. #define CURLSSLOPT_NO_REVOKE (1<<1)
  808. /* - NO_PARTIALCHAIN tells libcurl to *NOT* accept a partial certificate chain
  809. if possible. The OpenSSL backend has this ability. */
  810. #define CURLSSLOPT_NO_PARTIALCHAIN (1<<2)
  811. /* - REVOKE_BEST_EFFORT tells libcurl to ignore certificate revocation offline
  812. checks and ignore missing revocation list for those SSL backends where such
  813. behavior is present. */
  814. #define CURLSSLOPT_REVOKE_BEST_EFFORT (1<<3)
  815. /* - CURLSSLOPT_NATIVE_CA tells libcurl to use standard certificate store of
  816. operating system. Currently implemented under MS-Windows. */
  817. #define CURLSSLOPT_NATIVE_CA (1<<4)
  818. /* - CURLSSLOPT_AUTO_CLIENT_CERT tells libcurl to automatically locate and use
  819. a client certificate for authentication. (Schannel) */
  820. #define CURLSSLOPT_AUTO_CLIENT_CERT (1<<5)
  821. /* The default connection attempt delay in milliseconds for happy eyeballs.
  822. CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS.3 and happy-eyeballs-timeout-ms.d document
  823. this value, keep them in sync. */
  824. #define CURL_HET_DEFAULT 200L
  825. /* The default connection upkeep interval in milliseconds. */
  826. #define CURL_UPKEEP_INTERVAL_DEFAULT 60000L
  827. #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
  828. the obsolete stuff removed! */
  829. /* Backwards compatibility with older names */
  830. /* These are scheduled to disappear by 2009 */
  831. #define CURLFTPSSL_NONE CURLUSESSL_NONE
  832. #define CURLFTPSSL_TRY CURLUSESSL_TRY
  833. #define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL
  834. #define CURLFTPSSL_ALL CURLUSESSL_ALL
  835. #define CURLFTPSSL_LAST CURLUSESSL_LAST
  836. #define curl_ftpssl curl_usessl
  837. #endif /* !CURL_NO_OLDIES */
  838. /* parameter for the CURLOPT_FTP_SSL_CCC option */
  839. typedef enum {
  840. CURLFTPSSL_CCC_NONE, /* do not send CCC */
  841. CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
  842. CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */
  843. CURLFTPSSL_CCC_LAST /* not an option, never use */
  844. } curl_ftpccc;
  845. /* parameter for the CURLOPT_FTPSSLAUTH option */
  846. typedef enum {
  847. CURLFTPAUTH_DEFAULT, /* let libcurl decide */
  848. CURLFTPAUTH_SSL, /* use "AUTH SSL" */
  849. CURLFTPAUTH_TLS, /* use "AUTH TLS" */
  850. CURLFTPAUTH_LAST /* not an option, never use */
  851. } curl_ftpauth;
  852. /* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
  853. typedef enum {
  854. CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */
  855. CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD
  856. again if MKD succeeded, for SFTP this does
  857. similar magic */
  858. CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
  859. again even if MKD failed! */
  860. CURLFTP_CREATE_DIR_LAST /* not an option, never use */
  861. } curl_ftpcreatedir;
  862. /* parameter for the CURLOPT_FTP_FILEMETHOD option */
  863. typedef enum {
  864. CURLFTPMETHOD_DEFAULT, /* let libcurl pick */
  865. CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */
  866. CURLFTPMETHOD_NOCWD, /* no CWD at all */
  867. CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
  868. CURLFTPMETHOD_LAST /* not an option, never use */
  869. } curl_ftpmethod;
  870. /* bitmask defines for CURLOPT_HEADEROPT */
  871. #define CURLHEADER_UNIFIED 0
  872. #define CURLHEADER_SEPARATE (1<<0)
  873. /* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */
  874. #define CURLALTSVC_READONLYFILE (1<<2)
  875. #define CURLALTSVC_H1 (1<<3)
  876. #define CURLALTSVC_H2 (1<<4)
  877. #define CURLALTSVC_H3 (1<<5)
  878. struct curl_hstsentry {
  879. char *name;
  880. size_t namelen;
  881. unsigned int includeSubDomains:1;
  882. char expire[18]; /* YYYYMMDD HH:MM:SS [null-terminated] */
  883. };
  884. struct curl_index {
  885. size_t index; /* the provided entry's "index" or count */
  886. size_t total; /* total number of entries to save */
  887. };
  888. typedef enum {
  889. CURLSTS_OK,
  890. CURLSTS_DONE,
  891. CURLSTS_FAIL
  892. } CURLSTScode;
  893. typedef CURLSTScode (*curl_hstsread_callback)(CURL *easy,
  894. struct curl_hstsentry *e,
  895. void *userp);
  896. typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,
  897. struct curl_hstsentry *e,
  898. struct curl_index *i,
  899. void *userp);
  900. /* CURLHSTS_* are bits for the CURLOPT_HSTS option */
  901. #define CURLHSTS_ENABLE (long)(1<<0)
  902. #define CURLHSTS_READONLYFILE (long)(1<<1)
  903. /* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS
  904. options. Do not use. */
  905. #define CURLPROTO_HTTP (1<<0)
  906. #define CURLPROTO_HTTPS (1<<1)
  907. #define CURLPROTO_FTP (1<<2)
  908. #define CURLPROTO_FTPS (1<<3)
  909. #define CURLPROTO_SCP (1<<4)
  910. #define CURLPROTO_SFTP (1<<5)
  911. #define CURLPROTO_TELNET (1<<6)
  912. #define CURLPROTO_LDAP (1<<7)
  913. #define CURLPROTO_LDAPS (1<<8)
  914. #define CURLPROTO_DICT (1<<9)
  915. #define CURLPROTO_FILE (1<<10)
  916. #define CURLPROTO_TFTP (1<<11)
  917. #define CURLPROTO_IMAP (1<<12)
  918. #define CURLPROTO_IMAPS (1<<13)
  919. #define CURLPROTO_POP3 (1<<14)
  920. #define CURLPROTO_POP3S (1<<15)
  921. #define CURLPROTO_SMTP (1<<16)
  922. #define CURLPROTO_SMTPS (1<<17)
  923. #define CURLPROTO_RTSP (1<<18)
  924. #define CURLPROTO_RTMP (1<<19)
  925. #define CURLPROTO_RTMPT (1<<20)
  926. #define CURLPROTO_RTMPE (1<<21)
  927. #define CURLPROTO_RTMPTE (1<<22)
  928. #define CURLPROTO_RTMPS (1<<23)
  929. #define CURLPROTO_RTMPTS (1<<24)
  930. #define CURLPROTO_GOPHER (1<<25)
  931. #define CURLPROTO_SMB (1<<26)
  932. #define CURLPROTO_SMBS (1<<27)
  933. #define CURLPROTO_MQTT (1<<28)
  934. #define CURLPROTO_GOPHERS (1<<29)
  935. #define CURLPROTO_ALL (~0) /* enable everything */
  936. /* long may be 32 or 64 bits, but we should never depend on anything else
  937. but 32 */
  938. #define CURLOPTTYPE_LONG 0
  939. #define CURLOPTTYPE_OBJECTPOINT 10000
  940. #define CURLOPTTYPE_FUNCTIONPOINT 20000
  941. #define CURLOPTTYPE_OFF_T 30000
  942. #define CURLOPTTYPE_BLOB 40000
  943. /* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the
  944. string options from the header file */
  945. #define CURLOPT(na,t,nu) na = t + nu
  946. #define CURLOPTDEPRECATED(na,t,nu,v,m) na CURL_DEPRECATED(v,m) = t + nu
  947. /* CURLOPT aliases that make no run-time difference */
  948. /* 'char *' argument to a string with a trailing zero */
  949. #define CURLOPTTYPE_STRINGPOINT CURLOPTTYPE_OBJECTPOINT
  950. /* 'struct curl_slist *' argument */
  951. #define CURLOPTTYPE_SLISTPOINT CURLOPTTYPE_OBJECTPOINT
  952. /* 'void *' argument passed untouched to callback */
  953. #define CURLOPTTYPE_CBPOINT CURLOPTTYPE_OBJECTPOINT
  954. /* 'long' argument with a set of values/bitmask */
  955. #define CURLOPTTYPE_VALUES CURLOPTTYPE_LONG
  956. /*
  957. * All CURLOPT_* values.
  958. */
  959. typedef enum {
  960. /* This is the FILE * or void * the regular output should be written to. */
  961. CURLOPT(CURLOPT_WRITEDATA, CURLOPTTYPE_CBPOINT, 1),
  962. /* The full URL to get/put */
  963. CURLOPT(CURLOPT_URL, CURLOPTTYPE_STRINGPOINT, 2),
  964. /* Port number to connect to, if other than default. */
  965. CURLOPT(CURLOPT_PORT, CURLOPTTYPE_LONG, 3),
  966. /* Name of proxy to use. */
  967. CURLOPT(CURLOPT_PROXY, CURLOPTTYPE_STRINGPOINT, 4),
  968. /* "user:password;options" to use when fetching. */
  969. CURLOPT(CURLOPT_USERPWD, CURLOPTTYPE_STRINGPOINT, 5),
  970. /* "user:password" to use with proxy. */
  971. CURLOPT(CURLOPT_PROXYUSERPWD, CURLOPTTYPE_STRINGPOINT, 6),
  972. /* Range to get, specified as an ASCII string. */
  973. CURLOPT(CURLOPT_RANGE, CURLOPTTYPE_STRINGPOINT, 7),
  974. /* not used */
  975. /* Specified file stream to upload from (use as input): */
  976. CURLOPT(CURLOPT_READDATA, CURLOPTTYPE_CBPOINT, 9),
  977. /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
  978. * bytes big. */
  979. CURLOPT(CURLOPT_ERRORBUFFER, CURLOPTTYPE_OBJECTPOINT, 10),
  980. /* Function that will be called to store the output (instead of fwrite). The
  981. * parameters will use fwrite() syntax, make sure to follow them. */
  982. CURLOPT(CURLOPT_WRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 11),
  983. /* Function that will be called to read the input (instead of fread). The
  984. * parameters will use fread() syntax, make sure to follow them. */
  985. CURLOPT(CURLOPT_READFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 12),
  986. /* Time-out the read operation after this amount of seconds */
  987. CURLOPT(CURLOPT_TIMEOUT, CURLOPTTYPE_LONG, 13),
  988. /* If CURLOPT_READDATA is used, this can be used to inform libcurl about
  989. * how large the file being sent really is. That allows better error
  990. * checking and better verifies that the upload was successful. -1 means
  991. * unknown size.
  992. *
  993. * For large file support, there is also a _LARGE version of the key
  994. * which takes an off_t type, allowing platforms with larger off_t
  995. * sizes to handle larger files. See below for INFILESIZE_LARGE.
  996. */
  997. CURLOPT(CURLOPT_INFILESIZE, CURLOPTTYPE_LONG, 14),
  998. /* POST static input fields. */
  999. CURLOPT(CURLOPT_POSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 15),
  1000. /* Set the referrer page (needed by some CGIs) */
  1001. CURLOPT(CURLOPT_REFERER, CURLOPTTYPE_STRINGPOINT, 16),
  1002. /* Set the FTP PORT string (interface name, named or numerical IP address)
  1003. Use i.e '-' to use default address. */
  1004. CURLOPT(CURLOPT_FTPPORT, CURLOPTTYPE_STRINGPOINT, 17),
  1005. /* Set the User-Agent string (examined by some CGIs) */
  1006. CURLOPT(CURLOPT_USERAGENT, CURLOPTTYPE_STRINGPOINT, 18),
  1007. /* If the download receives less than "low speed limit" bytes/second
  1008. * during "low speed time" seconds, the operations is aborted.
  1009. * You could i.e if you have a pretty high speed connection, abort if
  1010. * it is less than 2000 bytes/sec during 20 seconds.
  1011. */
  1012. /* Set the "low speed limit" */
  1013. CURLOPT(CURLOPT_LOW_SPEED_LIMIT, CURLOPTTYPE_LONG, 19),
  1014. /* Set the "low speed time" */
  1015. CURLOPT(CURLOPT_LOW_SPEED_TIME, CURLOPTTYPE_LONG, 20),
  1016. /* Set the continuation offset.
  1017. *
  1018. * Note there is also a _LARGE version of this key which uses
  1019. * off_t types, allowing for large file offsets on platforms which
  1020. * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
  1021. */
  1022. CURLOPT(CURLOPT_RESUME_FROM, CURLOPTTYPE_LONG, 21),
  1023. /* Set cookie in request: */
  1024. CURLOPT(CURLOPT_COOKIE, CURLOPTTYPE_STRINGPOINT, 22),
  1025. /* This points to a linked list of headers, struct curl_slist kind. This
  1026. list is also used for RTSP (in spite of its name) */
  1027. CURLOPT(CURLOPT_HTTPHEADER, CURLOPTTYPE_SLISTPOINT, 23),
  1028. /* This points to a linked list of post entries, struct curl_httppost */
  1029. CURLOPTDEPRECATED(CURLOPT_HTTPPOST, CURLOPTTYPE_OBJECTPOINT, 24,
  1030. 7.56.0, "Use CURLOPT_MIMEPOST"),
  1031. /* name of the file keeping your private SSL-certificate */
  1032. CURLOPT(CURLOPT_SSLCERT, CURLOPTTYPE_STRINGPOINT, 25),
  1033. /* password for the SSL or SSH private key */
  1034. CURLOPT(CURLOPT_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 26),
  1035. /* send TYPE parameter? */
  1036. CURLOPT(CURLOPT_CRLF, CURLOPTTYPE_LONG, 27),
  1037. /* send linked-list of QUOTE commands */
  1038. CURLOPT(CURLOPT_QUOTE, CURLOPTTYPE_SLISTPOINT, 28),
  1039. /* send FILE * or void * to store headers to, if you use a callback it
  1040. is simply passed to the callback unmodified */
  1041. CURLOPT(CURLOPT_HEADERDATA, CURLOPTTYPE_CBPOINT, 29),
  1042. /* point to a file to read the initial cookies from, also enables
  1043. "cookie awareness" */
  1044. CURLOPT(CURLOPT_COOKIEFILE, CURLOPTTYPE_STRINGPOINT, 31),
  1045. /* What version to specifically try to use.
  1046. See CURL_SSLVERSION defines below. */
  1047. CURLOPT(CURLOPT_SSLVERSION, CURLOPTTYPE_VALUES, 32),
  1048. /* What kind of HTTP time condition to use, see defines */
  1049. CURLOPT(CURLOPT_TIMECONDITION, CURLOPTTYPE_VALUES, 33),
  1050. /* Time to use with the above condition. Specified in number of seconds
  1051. since 1 Jan 1970 */
  1052. CURLOPT(CURLOPT_TIMEVALUE, CURLOPTTYPE_LONG, 34),
  1053. /* 35 = OBSOLETE */
  1054. /* Custom request, for customizing the get command like
  1055. HTTP: DELETE, TRACE and others
  1056. FTP: to use a different list command
  1057. */
  1058. CURLOPT(CURLOPT_CUSTOMREQUEST, CURLOPTTYPE_STRINGPOINT, 36),
  1059. /* FILE handle to use instead of stderr */
  1060. CURLOPT(CURLOPT_STDERR, CURLOPTTYPE_OBJECTPOINT, 37),
  1061. /* 38 is not used */
  1062. /* send linked-list of post-transfer QUOTE commands */
  1063. CURLOPT(CURLOPT_POSTQUOTE, CURLOPTTYPE_SLISTPOINT, 39),
  1064. /* OBSOLETE, do not use! */
  1065. CURLOPT(CURLOPT_OBSOLETE40, CURLOPTTYPE_OBJECTPOINT, 40),
  1066. /* talk a lot */
  1067. CURLOPT(CURLOPT_VERBOSE, CURLOPTTYPE_LONG, 41),
  1068. /* throw the header out too */
  1069. CURLOPT(CURLOPT_HEADER, CURLOPTTYPE_LONG, 42),
  1070. /* shut off the progress meter */
  1071. CURLOPT(CURLOPT_NOPROGRESS, CURLOPTTYPE_LONG, 43),
  1072. /* use HEAD to get http document */
  1073. CURLOPT(CURLOPT_NOBODY, CURLOPTTYPE_LONG, 44),
  1074. /* no output on http error codes >= 400 */
  1075. CURLOPT(CURLOPT_FAILONERROR, CURLOPTTYPE_LONG, 45),
  1076. /* this is an upload */
  1077. CURLOPT(CURLOPT_UPLOAD, CURLOPTTYPE_LONG, 46),
  1078. /* HTTP POST method */
  1079. CURLOPT(CURLOPT_POST, CURLOPTTYPE_LONG, 47),
  1080. /* bare names when listing directories */
  1081. CURLOPT(CURLOPT_DIRLISTONLY, CURLOPTTYPE_LONG, 48),
  1082. /* Append instead of overwrite on upload! */
  1083. CURLOPT(CURLOPT_APPEND, CURLOPTTYPE_LONG, 50),
  1084. /* Specify whether to read the user+password from the .netrc or the URL.
  1085. * This must be one of the CURL_NETRC_* enums below. */
  1086. CURLOPT(CURLOPT_NETRC, CURLOPTTYPE_VALUES, 51),
  1087. /* use Location: Luke! */
  1088. CURLOPT(CURLOPT_FOLLOWLOCATION, CURLOPTTYPE_LONG, 52),
  1089. /* transfer data in text/ASCII format */
  1090. CURLOPT(CURLOPT_TRANSFERTEXT, CURLOPTTYPE_LONG, 53),
  1091. /* HTTP PUT */
  1092. CURLOPTDEPRECATED(CURLOPT_PUT, CURLOPTTYPE_LONG, 54,
  1093. 7.12.1, "Use CURLOPT_UPLOAD"),
  1094. /* 55 = OBSOLETE */
  1095. /* DEPRECATED
  1096. * Function that will be called instead of the internal progress display
  1097. * function. This function should be defined as the curl_progress_callback
  1098. * prototype defines. */
  1099. CURLOPTDEPRECATED(CURLOPT_PROGRESSFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 56,
  1100. 7.32.0, "Use CURLOPT_XFERINFOFUNCTION"),
  1101. /* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION
  1102. callbacks */
  1103. CURLOPT(CURLOPT_XFERINFODATA, CURLOPTTYPE_CBPOINT, 57),
  1104. #define CURLOPT_PROGRESSDATA CURLOPT_XFERINFODATA
  1105. /* We want the referrer field set automatically when following locations */
  1106. CURLOPT(CURLOPT_AUTOREFERER, CURLOPTTYPE_LONG, 58),
  1107. /* Port of the proxy, can be set in the proxy string as well with:
  1108. "[host]:[port]" */
  1109. CURLOPT(CURLOPT_PROXYPORT, CURLOPTTYPE_LONG, 59),
  1110. /* size of the POST input data, if strlen() is not good to use */
  1111. CURLOPT(CURLOPT_POSTFIELDSIZE, CURLOPTTYPE_LONG, 60),
  1112. /* tunnel non-http operations through an HTTP proxy */
  1113. CURLOPT(CURLOPT_HTTPPROXYTUNNEL, CURLOPTTYPE_LONG, 61),
  1114. /* Set the interface string to use as outgoing network interface */
  1115. CURLOPT(CURLOPT_INTERFACE, CURLOPTTYPE_STRINGPOINT, 62),
  1116. /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
  1117. * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
  1118. * is set but doesn't match one of these, 'private' will be used. */
  1119. CURLOPT(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63),
  1120. /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
  1121. CURLOPT(CURLOPT_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 64),
  1122. /* The CApath or CAfile used to validate the peer certificate
  1123. this option is used only if SSL_VERIFYPEER is true */
  1124. CURLOPT(CURLOPT_CAINFO, CURLOPTTYPE_STRINGPOINT, 65),
  1125. /* 66 = OBSOLETE */
  1126. /* 67 = OBSOLETE */
  1127. /* Maximum number of http redirects to follow */
  1128. CURLOPT(CURLOPT_MAXREDIRS, CURLOPTTYPE_LONG, 68),
  1129. /* Pass a long set to 1 to get the date of the requested document (if
  1130. possible)! Pass a zero to shut it off. */
  1131. CURLOPT(CURLOPT_FILETIME, CURLOPTTYPE_LONG, 69),
  1132. /* This points to a linked list of telnet options */
  1133. CURLOPT(CURLOPT_TELNETOPTIONS, CURLOPTTYPE_SLISTPOINT, 70),
  1134. /* Max amount of cached alive connections */
  1135. CURLOPT(CURLOPT_MAXCONNECTS, CURLOPTTYPE_LONG, 71),
  1136. /* OBSOLETE, do not use! */
  1137. CURLOPT(CURLOPT_OBSOLETE72, CURLOPTTYPE_LONG, 72),
  1138. /* 73 = OBSOLETE */
  1139. /* Set to explicitly use a new connection for the upcoming transfer.
  1140. Do not use this unless you're absolutely sure of this, as it makes the
  1141. operation slower and is less friendly for the network. */
  1142. CURLOPT(CURLOPT_FRESH_CONNECT, CURLOPTTYPE_LONG, 74),
  1143. /* Set to explicitly forbid the upcoming transfer's connection to be re-used
  1144. when done. Do not use this unless you're absolutely sure of this, as it
  1145. makes the operation slower and is less friendly for the network. */
  1146. CURLOPT(CURLOPT_FORBID_REUSE, CURLOPTTYPE_LONG, 75),
  1147. /* Set to a file name that contains random data for libcurl to use to
  1148. seed the random engine when doing SSL connects. */
  1149. CURLOPTDEPRECATED(CURLOPT_RANDOM_FILE, CURLOPTTYPE_STRINGPOINT, 76,
  1150. 7.84.0, "Serves no purpose anymore"),
  1151. /* Set to the Entropy Gathering Daemon socket pathname */
  1152. CURLOPTDEPRECATED(CURLOPT_EGDSOCKET, CURLOPTTYPE_STRINGPOINT, 77,
  1153. 7.84.0, "Serves no purpose anymore"),
  1154. /* Time-out connect operations after this amount of seconds, if connects are
  1155. OK within this time, then fine... This only aborts the connect phase. */
  1156. CURLOPT(CURLOPT_CONNECTTIMEOUT, CURLOPTTYPE_LONG, 78),
  1157. /* Function that will be called to store headers (instead of fwrite). The
  1158. * parameters will use fwrite() syntax, make sure to follow them. */
  1159. CURLOPT(CURLOPT_HEADERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 79),
  1160. /* Set this to force the HTTP request to get back to GET. Only really usable
  1161. if POST, PUT or a custom request have been used first.
  1162. */
  1163. CURLOPT(CURLOPT_HTTPGET, CURLOPTTYPE_LONG, 80),
  1164. /* Set if we should verify the Common name from the peer certificate in ssl
  1165. * handshake, set 1 to check existence, 2 to ensure that it matches the
  1166. * provided hostname. */
  1167. CURLOPT(CURLOPT_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 81),
  1168. /* Specify which file name to write all known cookies in after completed
  1169. operation. Set file name to "-" (dash) to make it go to stdout. */
  1170. CURLOPT(CURLOPT_COOKIEJAR, CURLOPTTYPE_STRINGPOINT, 82),
  1171. /* Specify which SSL ciphers to use */
  1172. CURLOPT(CURLOPT_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 83),
  1173. /* Specify which HTTP version to use! This must be set to one of the
  1174. CURL_HTTP_VERSION* enums set below. */
  1175. CURLOPT(CURLOPT_HTTP_VERSION, CURLOPTTYPE_VALUES, 84),
  1176. /* Specifically switch on or off the FTP engine's use of the EPSV command. By
  1177. default, that one will always be attempted before the more traditional
  1178. PASV command. */
  1179. CURLOPT(CURLOPT_FTP_USE_EPSV, CURLOPTTYPE_LONG, 85),
  1180. /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
  1181. CURLOPT(CURLOPT_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 86),
  1182. /* name of the file keeping your private SSL-key */
  1183. CURLOPT(CURLOPT_SSLKEY, CURLOPTTYPE_STRINGPOINT, 87),
  1184. /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
  1185. CURLOPT(CURLOPT_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 88),
  1186. /* crypto engine for the SSL-sub system */
  1187. CURLOPT(CURLOPT_SSLENGINE, CURLOPTTYPE_STRINGPOINT, 89),
  1188. /* set the crypto engine for the SSL-sub system as default
  1189. the param has no meaning...
  1190. */
  1191. CURLOPT(CURLOPT_SSLENGINE_DEFAULT, CURLOPTTYPE_LONG, 90),
  1192. /* Non-zero value means to use the global dns cache */
  1193. /* DEPRECATED, do not use! */
  1194. CURLOPTDEPRECATED(CURLOPT_DNS_USE_GLOBAL_CACHE, CURLOPTTYPE_LONG, 91,
  1195. 7.11.1, "Use CURLOPT_SHARE"),
  1196. /* DNS cache timeout */
  1197. CURLOPT(CURLOPT_DNS_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 92),
  1198. /* send linked-list of pre-transfer QUOTE commands */
  1199. CURLOPT(CURLOPT_PREQUOTE, CURLOPTTYPE_SLISTPOINT, 93),
  1200. /* set the debug function */
  1201. CURLOPT(CURLOPT_DEBUGFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 94),
  1202. /* set the data for the debug function */
  1203. CURLOPT(CURLOPT_DEBUGDATA, CURLOPTTYPE_CBPOINT, 95),
  1204. /* mark this as start of a cookie session */
  1205. CURLOPT(CURLOPT_COOKIESESSION, CURLOPTTYPE_LONG, 96),
  1206. /* The CApath directory used to validate the peer certificate
  1207. this option is used only if SSL_VERIFYPEER is true */
  1208. CURLOPT(CURLOPT_CAPATH, CURLOPTTYPE_STRINGPOINT, 97),
  1209. /* Instruct libcurl to use a smaller receive buffer */
  1210. CURLOPT(CURLOPT_BUFFERSIZE, CURLOPTTYPE_LONG, 98),
  1211. /* Instruct libcurl to not use any signal/alarm handlers, even when using
  1212. timeouts. This option is useful for multi-threaded applications.
  1213. See libcurl-the-guide for more background information. */
  1214. CURLOPT(CURLOPT_NOSIGNAL, CURLOPTTYPE_LONG, 99),
  1215. /* Provide a CURLShare for mutexing non-ts data */
  1216. CURLOPT(CURLOPT_SHARE, CURLOPTTYPE_OBJECTPOINT, 100),
  1217. /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
  1218. CURLPROXY_HTTPS, CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and
  1219. CURLPROXY_SOCKS5. */
  1220. CURLOPT(CURLOPT_PROXYTYPE, CURLOPTTYPE_VALUES, 101),
  1221. /* Set the Accept-Encoding string. Use this to tell a server you would like
  1222. the response to be compressed. Before 7.21.6, this was known as
  1223. CURLOPT_ENCODING */
  1224. CURLOPT(CURLOPT_ACCEPT_ENCODING, CURLOPTTYPE_STRINGPOINT, 102),
  1225. /* Set pointer to private data */
  1226. CURLOPT(CURLOPT_PRIVATE, CURLOPTTYPE_OBJECTPOINT, 103),
  1227. /* Set aliases for HTTP 200 in the HTTP Response header */
  1228. CURLOPT(CURLOPT_HTTP200ALIASES, CURLOPTTYPE_SLISTPOINT, 104),
  1229. /* Continue to send authentication (user+password) when following locations,
  1230. even when hostname changed. This can potentially send off the name
  1231. and password to whatever host the server decides. */
  1232. CURLOPT(CURLOPT_UNRESTRICTED_AUTH, CURLOPTTYPE_LONG, 105),
  1233. /* Specifically switch on or off the FTP engine's use of the EPRT command (
  1234. it also disables the LPRT attempt). By default, those ones will always be
  1235. attempted before the good old traditional PORT command. */
  1236. CURLOPT(CURLOPT_FTP_USE_EPRT, CURLOPTTYPE_LONG, 106),
  1237. /* Set this to a bitmask value to enable the particular authentications
  1238. methods you like. Use this in combination with CURLOPT_USERPWD.
  1239. Note that setting multiple bits may cause extra network round-trips. */
  1240. CURLOPT(CURLOPT_HTTPAUTH, CURLOPTTYPE_VALUES, 107),
  1241. /* Set the ssl context callback function, currently only for OpenSSL or
  1242. WolfSSL ssl_ctx, or mbedTLS mbedtls_ssl_config in the second argument.
  1243. The function must match the curl_ssl_ctx_callback prototype. */
  1244. CURLOPT(CURLOPT_SSL_CTX_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 108),
  1245. /* Set the userdata for the ssl context callback function's third
  1246. argument */
  1247. CURLOPT(CURLOPT_SSL_CTX_DATA, CURLOPTTYPE_CBPOINT, 109),
  1248. /* FTP Option that causes missing dirs to be created on the remote server.
  1249. In 7.19.4 we introduced the convenience enums for this option using the
  1250. CURLFTP_CREATE_DIR prefix.
  1251. */
  1252. CURLOPT(CURLOPT_FTP_CREATE_MISSING_DIRS, CURLOPTTYPE_LONG, 110),
  1253. /* Set this to a bitmask value to enable the particular authentications
  1254. methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
  1255. Note that setting multiple bits may cause extra network round-trips. */
  1256. CURLOPT(CURLOPT_PROXYAUTH, CURLOPTTYPE_VALUES, 111),
  1257. /* Option that changes the timeout, in seconds, associated with getting a
  1258. response. This is different from transfer timeout time and essentially
  1259. places a demand on the server to acknowledge commands in a timely
  1260. manner. For FTP, SMTP, IMAP and POP3. */
  1261. CURLOPT(CURLOPT_SERVER_RESPONSE_TIMEOUT, CURLOPTTYPE_LONG, 112),
  1262. /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
  1263. tell libcurl to use those IP versions only. This only has effect on
  1264. systems with support for more than one, i.e IPv4 _and_ IPv6. */
  1265. CURLOPT(CURLOPT_IPRESOLVE, CURLOPTTYPE_VALUES, 113),
  1266. /* Set this option to limit the size of a file that will be downloaded from
  1267. an HTTP or FTP server.
  1268. Note there is also _LARGE version which adds large file support for
  1269. platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
  1270. CURLOPT(CURLOPT_MAXFILESIZE, CURLOPTTYPE_LONG, 114),
  1271. /* See the comment for INFILESIZE above, but in short, specifies
  1272. * the size of the file being uploaded. -1 means unknown.
  1273. */
  1274. CURLOPT(CURLOPT_INFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 115),
  1275. /* Sets the continuation offset. There is also a CURLOPTTYPE_LONG version
  1276. * of this; look above for RESUME_FROM.
  1277. */
  1278. CURLOPT(CURLOPT_RESUME_FROM_LARGE, CURLOPTTYPE_OFF_T, 116),
  1279. /* Sets the maximum size of data that will be downloaded from
  1280. * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
  1281. */
  1282. CURLOPT(CURLOPT_MAXFILESIZE_LARGE, CURLOPTTYPE_OFF_T, 117),
  1283. /* Set this option to the file name of your .netrc file you want libcurl
  1284. to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
  1285. a poor attempt to find the user's home directory and check for a .netrc
  1286. file in there. */
  1287. CURLOPT(CURLOPT_NETRC_FILE, CURLOPTTYPE_STRINGPOINT, 118),
  1288. /* Enable SSL/TLS for FTP, pick one of:
  1289. CURLUSESSL_TRY - try using SSL, proceed anyway otherwise
  1290. CURLUSESSL_CONTROL - SSL for the control connection or fail
  1291. CURLUSESSL_ALL - SSL for all communication or fail
  1292. */
  1293. CURLOPT(CURLOPT_USE_SSL, CURLOPTTYPE_VALUES, 119),
  1294. /* The _LARGE version of the standard POSTFIELDSIZE option */
  1295. CURLOPT(CURLOPT_POSTFIELDSIZE_LARGE, CURLOPTTYPE_OFF_T, 120),
  1296. /* Enable/disable the TCP Nagle algorithm */
  1297. CURLOPT(CURLOPT_TCP_NODELAY, CURLOPTTYPE_LONG, 121),
  1298. /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  1299. /* 123 OBSOLETE. Gone in 7.16.0 */
  1300. /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  1301. /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  1302. /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
  1303. /* 127 OBSOLETE. Gone in 7.16.0 */
  1304. /* 128 OBSOLETE. Gone in 7.16.0 */
  1305. /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
  1306. can be used to change libcurl's default action which is to first try
  1307. "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
  1308. response has been received.
  1309. Available parameters are:
  1310. CURLFTPAUTH_DEFAULT - let libcurl decide
  1311. CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
  1312. CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
  1313. */
  1314. CURLOPT(CURLOPT_FTPSSLAUTH, CURLOPTTYPE_VALUES, 129),
  1315. CURLOPTDEPRECATED(CURLOPT_IOCTLFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 130,
  1316. 7.18.0, "Use CURLOPT_SEEKFUNCTION"),
  1317. CURLOPTDEPRECATED(CURLOPT_IOCTLDATA, CURLOPTTYPE_CBPOINT, 131,
  1318. 7.18.0, "Use CURLOPT_SEEKDATA"),
  1319. /* 132 OBSOLETE. Gone in 7.16.0 */
  1320. /* 133 OBSOLETE. Gone in 7.16.0 */
  1321. /* null-terminated string for pass on to the FTP server when asked for
  1322. "account" info */
  1323. CURLOPT(CURLOPT_FTP_ACCOUNT, CURLOPTTYPE_STRINGPOINT, 134),
  1324. /* feed cookie into cookie engine */
  1325. CURLOPT(CURLOPT_COOKIELIST, CURLOPTTYPE_STRINGPOINT, 135),
  1326. /* ignore Content-Length */
  1327. CURLOPT(CURLOPT_IGNORE_CONTENT_LENGTH, CURLOPTTYPE_LONG, 136),
  1328. /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
  1329. response. Typically used for FTP-SSL purposes but is not restricted to
  1330. that. libcurl will then instead use the same IP address it used for the
  1331. control connection. */
  1332. CURLOPT(CURLOPT_FTP_SKIP_PASV_IP, CURLOPTTYPE_LONG, 137),
  1333. /* Select "file method" to use when doing FTP, see the curl_ftpmethod
  1334. above. */
  1335. CURLOPT(CURLOPT_FTP_FILEMETHOD, CURLOPTTYPE_VALUES, 138),
  1336. /* Local port number to bind the socket to */
  1337. CURLOPT(CURLOPT_LOCALPORT, CURLOPTTYPE_LONG, 139),
  1338. /* Number of ports to try, including the first one set with LOCALPORT.
  1339. Thus, setting it to 1 will make no additional attempts but the first.
  1340. */
  1341. CURLOPT(CURLOPT_LOCALPORTRANGE, CURLOPTTYPE_LONG, 140),
  1342. /* no transfer, set up connection and let application use the socket by
  1343. extracting it with CURLINFO_LASTSOCKET */
  1344. CURLOPT(CURLOPT_CONNECT_ONLY, CURLOPTTYPE_LONG, 141),
  1345. /* Function that will be called to convert from the
  1346. network encoding (instead of using the iconv calls in libcurl) */
  1347. CURLOPTDEPRECATED(CURLOPT_CONV_FROM_NETWORK_FUNCTION,
  1348. CURLOPTTYPE_FUNCTIONPOINT, 142,
  1349. 7.82.0, "Serves no purpose anymore"),
  1350. /* Function that will be called to convert to the
  1351. network encoding (instead of using the iconv calls in libcurl) */
  1352. CURLOPTDEPRECATED(CURLOPT_CONV_TO_NETWORK_FUNCTION,
  1353. CURLOPTTYPE_FUNCTIONPOINT, 143,
  1354. 7.82.0, "Serves no purpose anymore"),
  1355. /* Function that will be called to convert from UTF8
  1356. (instead of using the iconv calls in libcurl)
  1357. Note that this is used only for SSL certificate processing */
  1358. CURLOPTDEPRECATED(CURLOPT_CONV_FROM_UTF8_FUNCTION,
  1359. CURLOPTTYPE_FUNCTIONPOINT, 144,
  1360. 7.82.0, "Serves no purpose anymore"),
  1361. /* if the connection proceeds too quickly then need to slow it down */
  1362. /* limit-rate: maximum number of bytes per second to send or receive */
  1363. CURLOPT(CURLOPT_MAX_SEND_SPEED_LARGE, CURLOPTTYPE_OFF_T, 145),
  1364. CURLOPT(CURLOPT_MAX_RECV_SPEED_LARGE, CURLOPTTYPE_OFF_T, 146),
  1365. /* Pointer to command string to send if USER/PASS fails. */
  1366. CURLOPT(CURLOPT_FTP_ALTERNATIVE_TO_USER, CURLOPTTYPE_STRINGPOINT, 147),
  1367. /* callback function for setting socket options */
  1368. CURLOPT(CURLOPT_SOCKOPTFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 148),
  1369. CURLOPT(CURLOPT_SOCKOPTDATA, CURLOPTTYPE_CBPOINT, 149),
  1370. /* set to 0 to disable session ID re-use for this transfer, default is
  1371. enabled (== 1) */
  1372. CURLOPT(CURLOPT_SSL_SESSIONID_CACHE, CURLOPTTYPE_LONG, 150),
  1373. /* allowed SSH authentication methods */
  1374. CURLOPT(CURLOPT_SSH_AUTH_TYPES, CURLOPTTYPE_VALUES, 151),
  1375. /* Used by scp/sftp to do public/private key authentication */
  1376. CURLOPT(CURLOPT_SSH_PUBLIC_KEYFILE, CURLOPTTYPE_STRINGPOINT, 152),
  1377. CURLOPT(CURLOPT_SSH_PRIVATE_KEYFILE, CURLOPTTYPE_STRINGPOINT, 153),
  1378. /* Send CCC (Clear Command Channel) after authentication */
  1379. CURLOPT(CURLOPT_FTP_SSL_CCC, CURLOPTTYPE_LONG, 154),
  1380. /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
  1381. CURLOPT(CURLOPT_TIMEOUT_MS, CURLOPTTYPE_LONG, 155),
  1382. CURLOPT(CURLOPT_CONNECTTIMEOUT_MS, CURLOPTTYPE_LONG, 156),
  1383. /* set to zero to disable the libcurl's decoding and thus pass the raw body
  1384. data to the application even when it is encoded/compressed */
  1385. CURLOPT(CURLOPT_HTTP_TRANSFER_DECODING, CURLOPTTYPE_LONG, 157),
  1386. CURLOPT(CURLOPT_HTTP_CONTENT_DECODING, CURLOPTTYPE_LONG, 158),
  1387. /* Permission used when creating new files and directories on the remote
  1388. server for protocols that support it, SFTP/SCP/FILE */
  1389. CURLOPT(CURLOPT_NEW_FILE_PERMS, CURLOPTTYPE_LONG, 159),
  1390. CURLOPT(CURLOPT_NEW_DIRECTORY_PERMS, CURLOPTTYPE_LONG, 160),
  1391. /* Set the behavior of POST when redirecting. Values must be set to one
  1392. of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
  1393. CURLOPT(CURLOPT_POSTREDIR, CURLOPTTYPE_VALUES, 161),
  1394. /* used by scp/sftp to verify the host's public key */
  1395. CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_MD5, CURLOPTTYPE_STRINGPOINT, 162),
  1396. /* Callback function for opening socket (instead of socket(2)). Optionally,
  1397. callback is able change the address or refuse to connect returning
  1398. CURL_SOCKET_BAD. The callback should have type
  1399. curl_opensocket_callback */
  1400. CURLOPT(CURLOPT_OPENSOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 163),
  1401. CURLOPT(CURLOPT_OPENSOCKETDATA, CURLOPTTYPE_CBPOINT, 164),
  1402. /* POST volatile input fields. */
  1403. CURLOPT(CURLOPT_COPYPOSTFIELDS, CURLOPTTYPE_OBJECTPOINT, 165),
  1404. /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
  1405. CURLOPT(CURLOPT_PROXY_TRANSFER_MODE, CURLOPTTYPE_LONG, 166),
  1406. /* Callback function for seeking in the input stream */
  1407. CURLOPT(CURLOPT_SEEKFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 167),
  1408. CURLOPT(CURLOPT_SEEKDATA, CURLOPTTYPE_CBPOINT, 168),
  1409. /* CRL file */
  1410. CURLOPT(CURLOPT_CRLFILE, CURLOPTTYPE_STRINGPOINT, 169),
  1411. /* Issuer certificate */
  1412. CURLOPT(CURLOPT_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 170),
  1413. /* (IPv6) Address scope */
  1414. CURLOPT(CURLOPT_ADDRESS_SCOPE, CURLOPTTYPE_LONG, 171),
  1415. /* Collect certificate chain info and allow it to get retrievable with
  1416. CURLINFO_CERTINFO after the transfer is complete. */
  1417. CURLOPT(CURLOPT_CERTINFO, CURLOPTTYPE_LONG, 172),
  1418. /* "name" and "pwd" to use when fetching. */
  1419. CURLOPT(CURLOPT_USERNAME, CURLOPTTYPE_STRINGPOINT, 173),
  1420. CURLOPT(CURLOPT_PASSWORD, CURLOPTTYPE_STRINGPOINT, 174),
  1421. /* "name" and "pwd" to use with Proxy when fetching. */
  1422. CURLOPT(CURLOPT_PROXYUSERNAME, CURLOPTTYPE_STRINGPOINT, 175),
  1423. CURLOPT(CURLOPT_PROXYPASSWORD, CURLOPTTYPE_STRINGPOINT, 176),
  1424. /* Comma separated list of hostnames defining no-proxy zones. These should
  1425. match both hostnames directly, and hostnames within a domain. For
  1426. example, local.com will match local.com and www.local.com, but NOT
  1427. notlocal.com or www.notlocal.com. For compatibility with other
  1428. implementations of this, .local.com will be considered to be the same as
  1429. local.com. A single * is the only valid wildcard, and effectively
  1430. disables the use of proxy. */
  1431. CURLOPT(CURLOPT_NOPROXY, CURLOPTTYPE_STRINGPOINT, 177),
  1432. /* block size for TFTP transfers */
  1433. CURLOPT(CURLOPT_TFTP_BLKSIZE, CURLOPTTYPE_LONG, 178),
  1434. /* Socks Service */
  1435. /* DEPRECATED, do not use! */
  1436. CURLOPTDEPRECATED(CURLOPT_SOCKS5_GSSAPI_SERVICE,
  1437. CURLOPTTYPE_STRINGPOINT, 179,
  1438. 7.49.0, "Use CURLOPT_PROXY_SERVICE_NAME"),
  1439. /* Socks Service */
  1440. CURLOPT(CURLOPT_SOCKS5_GSSAPI_NEC, CURLOPTTYPE_LONG, 180),
  1441. /* set the bitmask for the protocols that are allowed to be used for the
  1442. transfer, which thus helps the app which takes URLs from users or other
  1443. external inputs and want to restrict what protocol(s) to deal
  1444. with. Defaults to CURLPROTO_ALL. */
  1445. CURLOPTDEPRECATED(CURLOPT_PROTOCOLS, CURLOPTTYPE_LONG, 181,
  1446. 7.85.0, "Use CURLOPT_PROTOCOLS_STR"),
  1447. /* set the bitmask for the protocols that libcurl is allowed to follow to,
  1448. as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
  1449. to be set in both bitmasks to be allowed to get redirected to. */
  1450. CURLOPTDEPRECATED(CURLOPT_REDIR_PROTOCOLS, CURLOPTTYPE_LONG, 182,
  1451. 7.85.0, "Use CURLOPT_REDIR_PROTOCOLS_STR"),
  1452. /* set the SSH knownhost file name to use */
  1453. CURLOPT(CURLOPT_SSH_KNOWNHOSTS, CURLOPTTYPE_STRINGPOINT, 183),
  1454. /* set the SSH host key callback, must point to a curl_sshkeycallback
  1455. function */
  1456. CURLOPT(CURLOPT_SSH_KEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 184),
  1457. /* set the SSH host key callback custom pointer */
  1458. CURLOPT(CURLOPT_SSH_KEYDATA, CURLOPTTYPE_CBPOINT, 185),
  1459. /* set the SMTP mail originator */
  1460. CURLOPT(CURLOPT_MAIL_FROM, CURLOPTTYPE_STRINGPOINT, 186),
  1461. /* set the list of SMTP mail receiver(s) */
  1462. CURLOPT(CURLOPT_MAIL_RCPT, CURLOPTTYPE_SLISTPOINT, 187),
  1463. /* FTP: send PRET before PASV */
  1464. CURLOPT(CURLOPT_FTP_USE_PRET, CURLOPTTYPE_LONG, 188),
  1465. /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */
  1466. CURLOPT(CURLOPT_RTSP_REQUEST, CURLOPTTYPE_VALUES, 189),
  1467. /* The RTSP session identifier */
  1468. CURLOPT(CURLOPT_RTSP_SESSION_ID, CURLOPTTYPE_STRINGPOINT, 190),
  1469. /* The RTSP stream URI */
  1470. CURLOPT(CURLOPT_RTSP_STREAM_URI, CURLOPTTYPE_STRINGPOINT, 191),
  1471. /* The Transport: header to use in RTSP requests */
  1472. CURLOPT(CURLOPT_RTSP_TRANSPORT, CURLOPTTYPE_STRINGPOINT, 192),
  1473. /* Manually initialize the client RTSP CSeq for this handle */
  1474. CURLOPT(CURLOPT_RTSP_CLIENT_CSEQ, CURLOPTTYPE_LONG, 193),
  1475. /* Manually initialize the server RTSP CSeq for this handle */
  1476. CURLOPT(CURLOPT_RTSP_SERVER_CSEQ, CURLOPTTYPE_LONG, 194),
  1477. /* The stream to pass to INTERLEAVEFUNCTION. */
  1478. CURLOPT(CURLOPT_INTERLEAVEDATA, CURLOPTTYPE_CBPOINT, 195),
  1479. /* Let the application define a custom write method for RTP data */
  1480. CURLOPT(CURLOPT_INTERLEAVEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 196),
  1481. /* Turn on wildcard matching */
  1482. CURLOPT(CURLOPT_WILDCARDMATCH, CURLOPTTYPE_LONG, 197),
  1483. /* Directory matching callback called before downloading of an
  1484. individual file (chunk) started */
  1485. CURLOPT(CURLOPT_CHUNK_BGN_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 198),
  1486. /* Directory matching callback called after the file (chunk)
  1487. was downloaded, or skipped */
  1488. CURLOPT(CURLOPT_CHUNK_END_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 199),
  1489. /* Change match (fnmatch-like) callback for wildcard matching */
  1490. CURLOPT(CURLOPT_FNMATCH_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 200),
  1491. /* Let the application define custom chunk data pointer */
  1492. CURLOPT(CURLOPT_CHUNK_DATA, CURLOPTTYPE_CBPOINT, 201),
  1493. /* FNMATCH_FUNCTION user pointer */
  1494. CURLOPT(CURLOPT_FNMATCH_DATA, CURLOPTTYPE_CBPOINT, 202),
  1495. /* send linked-list of name:port:address sets */
  1496. CURLOPT(CURLOPT_RESOLVE, CURLOPTTYPE_SLISTPOINT, 203),
  1497. /* Set a username for authenticated TLS */
  1498. CURLOPT(CURLOPT_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 204),
  1499. /* Set a password for authenticated TLS */
  1500. CURLOPT(CURLOPT_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 205),
  1501. /* Set authentication type for authenticated TLS */
  1502. CURLOPT(CURLOPT_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 206),
  1503. /* Set to 1 to enable the "TE:" header in HTTP requests to ask for
  1504. compressed transfer-encoded responses. Set to 0 to disable the use of TE:
  1505. in outgoing requests. The current default is 0, but it might change in a
  1506. future libcurl release.
  1507. libcurl will ask for the compressed methods it knows of, and if that
  1508. isn't any, it will not ask for transfer-encoding at all even if this
  1509. option is set to 1.
  1510. */
  1511. CURLOPT(CURLOPT_TRANSFER_ENCODING, CURLOPTTYPE_LONG, 207),
  1512. /* Callback function for closing socket (instead of close(2)). The callback
  1513. should have type curl_closesocket_callback */
  1514. CURLOPT(CURLOPT_CLOSESOCKETFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 208),
  1515. CURLOPT(CURLOPT_CLOSESOCKETDATA, CURLOPTTYPE_CBPOINT, 209),
  1516. /* allow GSSAPI credential delegation */
  1517. CURLOPT(CURLOPT_GSSAPI_DELEGATION, CURLOPTTYPE_VALUES, 210),
  1518. /* Set the name servers to use for DNS resolution */
  1519. CURLOPT(CURLOPT_DNS_SERVERS, CURLOPTTYPE_STRINGPOINT, 211),
  1520. /* Time-out accept operations (currently for FTP only) after this amount
  1521. of milliseconds. */
  1522. CURLOPT(CURLOPT_ACCEPTTIMEOUT_MS, CURLOPTTYPE_LONG, 212),
  1523. /* Set TCP keepalive */
  1524. CURLOPT(CURLOPT_TCP_KEEPALIVE, CURLOPTTYPE_LONG, 213),
  1525. /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */
  1526. CURLOPT(CURLOPT_TCP_KEEPIDLE, CURLOPTTYPE_LONG, 214),
  1527. CURLOPT(CURLOPT_TCP_KEEPINTVL, CURLOPTTYPE_LONG, 215),
  1528. /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */
  1529. CURLOPT(CURLOPT_SSL_OPTIONS, CURLOPTTYPE_VALUES, 216),
  1530. /* Set the SMTP auth originator */
  1531. CURLOPT(CURLOPT_MAIL_AUTH, CURLOPTTYPE_STRINGPOINT, 217),
  1532. /* Enable/disable SASL initial response */
  1533. CURLOPT(CURLOPT_SASL_IR, CURLOPTTYPE_LONG, 218),
  1534. /* Function that will be called instead of the internal progress display
  1535. * function. This function should be defined as the curl_xferinfo_callback
  1536. * prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */
  1537. CURLOPT(CURLOPT_XFERINFOFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 219),
  1538. /* The XOAUTH2 bearer token */
  1539. CURLOPT(CURLOPT_XOAUTH2_BEARER, CURLOPTTYPE_STRINGPOINT, 220),
  1540. /* Set the interface string to use as outgoing network
  1541. * interface for DNS requests.
  1542. * Only supported by the c-ares DNS backend */
  1543. CURLOPT(CURLOPT_DNS_INTERFACE, CURLOPTTYPE_STRINGPOINT, 221),
  1544. /* Set the local IPv4 address to use for outgoing DNS requests.
  1545. * Only supported by the c-ares DNS backend */
  1546. CURLOPT(CURLOPT_DNS_LOCAL_IP4, CURLOPTTYPE_STRINGPOINT, 222),
  1547. /* Set the local IPv6 address to use for outgoing DNS requests.
  1548. * Only supported by the c-ares DNS backend */
  1549. CURLOPT(CURLOPT_DNS_LOCAL_IP6, CURLOPTTYPE_STRINGPOINT, 223),
  1550. /* Set authentication options directly */
  1551. CURLOPT(CURLOPT_LOGIN_OPTIONS, CURLOPTTYPE_STRINGPOINT, 224),
  1552. /* Enable/disable TLS NPN extension (http2 over ssl might fail without) */
  1553. CURLOPTDEPRECATED(CURLOPT_SSL_ENABLE_NPN, CURLOPTTYPE_LONG, 225,
  1554. 7.86.0, "Has no function"),
  1555. /* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */
  1556. CURLOPT(CURLOPT_SSL_ENABLE_ALPN, CURLOPTTYPE_LONG, 226),
  1557. /* Time to wait for a response to an HTTP request containing an
  1558. * Expect: 100-continue header before sending the data anyway. */
  1559. CURLOPT(CURLOPT_EXPECT_100_TIMEOUT_MS, CURLOPTTYPE_LONG, 227),
  1560. /* This points to a linked list of headers used for proxy requests only,
  1561. struct curl_slist kind */
  1562. CURLOPT(CURLOPT_PROXYHEADER, CURLOPTTYPE_SLISTPOINT, 228),
  1563. /* Pass in a bitmask of "header options" */
  1564. CURLOPT(CURLOPT_HEADEROPT, CURLOPTTYPE_VALUES, 229),
  1565. /* The public key in DER form used to validate the peer public key
  1566. this option is used only if SSL_VERIFYPEER is true */
  1567. CURLOPT(CURLOPT_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 230),
  1568. /* Path to Unix domain socket */
  1569. CURLOPT(CURLOPT_UNIX_SOCKET_PATH, CURLOPTTYPE_STRINGPOINT, 231),
  1570. /* Set if we should verify the certificate status. */
  1571. CURLOPT(CURLOPT_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 232),
  1572. /* Set if we should enable TLS false start. */
  1573. CURLOPT(CURLOPT_SSL_FALSESTART, CURLOPTTYPE_LONG, 233),
  1574. /* Do not squash dot-dot sequences */
  1575. CURLOPT(CURLOPT_PATH_AS_IS, CURLOPTTYPE_LONG, 234),
  1576. /* Proxy Service Name */
  1577. CURLOPT(CURLOPT_PROXY_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 235),
  1578. /* Service Name */
  1579. CURLOPT(CURLOPT_SERVICE_NAME, CURLOPTTYPE_STRINGPOINT, 236),
  1580. /* Wait/don't wait for pipe/mutex to clarify */
  1581. CURLOPT(CURLOPT_PIPEWAIT, CURLOPTTYPE_LONG, 237),
  1582. /* Set the protocol used when curl is given a URL without a protocol */
  1583. CURLOPT(CURLOPT_DEFAULT_PROTOCOL, CURLOPTTYPE_STRINGPOINT, 238),
  1584. /* Set stream weight, 1 - 256 (default is 16) */
  1585. CURLOPT(CURLOPT_STREAM_WEIGHT, CURLOPTTYPE_LONG, 239),
  1586. /* Set stream dependency on another CURL handle */
  1587. CURLOPT(CURLOPT_STREAM_DEPENDS, CURLOPTTYPE_OBJECTPOINT, 240),
  1588. /* Set E-xclusive stream dependency on another CURL handle */
  1589. CURLOPT(CURLOPT_STREAM_DEPENDS_E, CURLOPTTYPE_OBJECTPOINT, 241),
  1590. /* Do not send any tftp option requests to the server */
  1591. CURLOPT(CURLOPT_TFTP_NO_OPTIONS, CURLOPTTYPE_LONG, 242),
  1592. /* Linked-list of host:port:connect-to-host:connect-to-port,
  1593. overrides the URL's host:port (only for the network layer) */
  1594. CURLOPT(CURLOPT_CONNECT_TO, CURLOPTTYPE_SLISTPOINT, 243),
  1595. /* Set TCP Fast Open */
  1596. CURLOPT(CURLOPT_TCP_FASTOPEN, CURLOPTTYPE_LONG, 244),
  1597. /* Continue to send data if the server responds early with an
  1598. * HTTP status code >= 300 */
  1599. CURLOPT(CURLOPT_KEEP_SENDING_ON_ERROR, CURLOPTTYPE_LONG, 245),
  1600. /* The CApath or CAfile used to validate the proxy certificate
  1601. this option is used only if PROXY_SSL_VERIFYPEER is true */
  1602. CURLOPT(CURLOPT_PROXY_CAINFO, CURLOPTTYPE_STRINGPOINT, 246),
  1603. /* The CApath directory used to validate the proxy certificate
  1604. this option is used only if PROXY_SSL_VERIFYPEER is true */
  1605. CURLOPT(CURLOPT_PROXY_CAPATH, CURLOPTTYPE_STRINGPOINT, 247),
  1606. /* Set if we should verify the proxy in ssl handshake,
  1607. set 1 to verify. */
  1608. CURLOPT(CURLOPT_PROXY_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 248),
  1609. /* Set if we should verify the Common name from the proxy certificate in ssl
  1610. * handshake, set 1 to check existence, 2 to ensure that it matches
  1611. * the provided hostname. */
  1612. CURLOPT(CURLOPT_PROXY_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 249),
  1613. /* What version to specifically try to use for proxy.
  1614. See CURL_SSLVERSION defines below. */
  1615. CURLOPT(CURLOPT_PROXY_SSLVERSION, CURLOPTTYPE_VALUES, 250),
  1616. /* Set a username for authenticated TLS for proxy */
  1617. CURLOPT(CURLOPT_PROXY_TLSAUTH_USERNAME, CURLOPTTYPE_STRINGPOINT, 251),
  1618. /* Set a password for authenticated TLS for proxy */
  1619. CURLOPT(CURLOPT_PROXY_TLSAUTH_PASSWORD, CURLOPTTYPE_STRINGPOINT, 252),
  1620. /* Set authentication type for authenticated TLS for proxy */
  1621. CURLOPT(CURLOPT_PROXY_TLSAUTH_TYPE, CURLOPTTYPE_STRINGPOINT, 253),
  1622. /* name of the file keeping your private SSL-certificate for proxy */
  1623. CURLOPT(CURLOPT_PROXY_SSLCERT, CURLOPTTYPE_STRINGPOINT, 254),
  1624. /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") for
  1625. proxy */
  1626. CURLOPT(CURLOPT_PROXY_SSLCERTTYPE, CURLOPTTYPE_STRINGPOINT, 255),
  1627. /* name of the file keeping your private SSL-key for proxy */
  1628. CURLOPT(CURLOPT_PROXY_SSLKEY, CURLOPTTYPE_STRINGPOINT, 256),
  1629. /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") for
  1630. proxy */
  1631. CURLOPT(CURLOPT_PROXY_SSLKEYTYPE, CURLOPTTYPE_STRINGPOINT, 257),
  1632. /* password for the SSL private key for proxy */
  1633. CURLOPT(CURLOPT_PROXY_KEYPASSWD, CURLOPTTYPE_STRINGPOINT, 258),
  1634. /* Specify which SSL ciphers to use for proxy */
  1635. CURLOPT(CURLOPT_PROXY_SSL_CIPHER_LIST, CURLOPTTYPE_STRINGPOINT, 259),
  1636. /* CRL file for proxy */
  1637. CURLOPT(CURLOPT_PROXY_CRLFILE, CURLOPTTYPE_STRINGPOINT, 260),
  1638. /* Enable/disable specific SSL features with a bitmask for proxy, see
  1639. CURLSSLOPT_* */
  1640. CURLOPT(CURLOPT_PROXY_SSL_OPTIONS, CURLOPTTYPE_LONG, 261),
  1641. /* Name of pre proxy to use. */
  1642. CURLOPT(CURLOPT_PRE_PROXY, CURLOPTTYPE_STRINGPOINT, 262),
  1643. /* The public key in DER form used to validate the proxy public key
  1644. this option is used only if PROXY_SSL_VERIFYPEER is true */
  1645. CURLOPT(CURLOPT_PROXY_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 263),
  1646. /* Path to an abstract Unix domain socket */
  1647. CURLOPT(CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOPTTYPE_STRINGPOINT, 264),
  1648. /* Suppress proxy CONNECT response headers from user callbacks */
  1649. CURLOPT(CURLOPT_SUPPRESS_CONNECT_HEADERS, CURLOPTTYPE_LONG, 265),
  1650. /* The request target, instead of extracted from the URL */
  1651. CURLOPT(CURLOPT_REQUEST_TARGET, CURLOPTTYPE_STRINGPOINT, 266),
  1652. /* bitmask of allowed auth methods for connections to SOCKS5 proxies */
  1653. CURLOPT(CURLOPT_SOCKS5_AUTH, CURLOPTTYPE_LONG, 267),
  1654. /* Enable/disable SSH compression */
  1655. CURLOPT(CURLOPT_SSH_COMPRESSION, CURLOPTTYPE_LONG, 268),
  1656. /* Post MIME data. */
  1657. CURLOPT(CURLOPT_MIMEPOST, CURLOPTTYPE_OBJECTPOINT, 269),
  1658. /* Time to use with the CURLOPT_TIMECONDITION. Specified in number of
  1659. seconds since 1 Jan 1970. */
  1660. CURLOPT(CURLOPT_TIMEVALUE_LARGE, CURLOPTTYPE_OFF_T, 270),
  1661. /* Head start in milliseconds to give happy eyeballs. */
  1662. CURLOPT(CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, CURLOPTTYPE_LONG, 271),
  1663. /* Function that will be called before a resolver request is made */
  1664. CURLOPT(CURLOPT_RESOLVER_START_FUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 272),
  1665. /* User data to pass to the resolver start callback. */
  1666. CURLOPT(CURLOPT_RESOLVER_START_DATA, CURLOPTTYPE_CBPOINT, 273),
  1667. /* send HAProxy PROXY protocol header? */
  1668. CURLOPT(CURLOPT_HAPROXYPROTOCOL, CURLOPTTYPE_LONG, 274),
  1669. /* shuffle addresses before use when DNS returns multiple */
  1670. CURLOPT(CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOPTTYPE_LONG, 275),
  1671. /* Specify which TLS 1.3 ciphers suites to use */
  1672. CURLOPT(CURLOPT_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 276),
  1673. CURLOPT(CURLOPT_PROXY_TLS13_CIPHERS, CURLOPTTYPE_STRINGPOINT, 277),
  1674. /* Disallow specifying username/login in URL. */
  1675. CURLOPT(CURLOPT_DISALLOW_USERNAME_IN_URL, CURLOPTTYPE_LONG, 278),
  1676. /* DNS-over-HTTPS URL */
  1677. CURLOPT(CURLOPT_DOH_URL, CURLOPTTYPE_STRINGPOINT, 279),
  1678. /* Preferred buffer size to use for uploads */
  1679. CURLOPT(CURLOPT_UPLOAD_BUFFERSIZE, CURLOPTTYPE_LONG, 280),
  1680. /* Time in ms between connection upkeep calls for long-lived connections. */
  1681. CURLOPT(CURLOPT_UPKEEP_INTERVAL_MS, CURLOPTTYPE_LONG, 281),
  1682. /* Specify URL using CURL URL API. */
  1683. CURLOPT(CURLOPT_CURLU, CURLOPTTYPE_OBJECTPOINT, 282),
  1684. /* add trailing data just after no more data is available */
  1685. CURLOPT(CURLOPT_TRAILERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 283),
  1686. /* pointer to be passed to HTTP_TRAILER_FUNCTION */
  1687. CURLOPT(CURLOPT_TRAILERDATA, CURLOPTTYPE_CBPOINT, 284),
  1688. /* set this to 1L to allow HTTP/0.9 responses or 0L to disallow */
  1689. CURLOPT(CURLOPT_HTTP09_ALLOWED, CURLOPTTYPE_LONG, 285),
  1690. /* alt-svc control bitmask */
  1691. CURLOPT(CURLOPT_ALTSVC_CTRL, CURLOPTTYPE_LONG, 286),
  1692. /* alt-svc cache file name to possibly read from/write to */
  1693. CURLOPT(CURLOPT_ALTSVC, CURLOPTTYPE_STRINGPOINT, 287),
  1694. /* maximum age (idle time) of a connection to consider it for reuse
  1695. * (in seconds) */
  1696. CURLOPT(CURLOPT_MAXAGE_CONN, CURLOPTTYPE_LONG, 288),
  1697. /* SASL authorization identity */
  1698. CURLOPT(CURLOPT_SASL_AUTHZID, CURLOPTTYPE_STRINGPOINT, 289),
  1699. /* allow RCPT TO command to fail for some recipients */
  1700. CURLOPT(CURLOPT_MAIL_RCPT_ALLLOWFAILS, CURLOPTTYPE_LONG, 290),
  1701. /* the private SSL-certificate as a "blob" */
  1702. CURLOPT(CURLOPT_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 291),
  1703. CURLOPT(CURLOPT_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 292),
  1704. CURLOPT(CURLOPT_PROXY_SSLCERT_BLOB, CURLOPTTYPE_BLOB, 293),
  1705. CURLOPT(CURLOPT_PROXY_SSLKEY_BLOB, CURLOPTTYPE_BLOB, 294),
  1706. CURLOPT(CURLOPT_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 295),
  1707. /* Issuer certificate for proxy */
  1708. CURLOPT(CURLOPT_PROXY_ISSUERCERT, CURLOPTTYPE_STRINGPOINT, 296),
  1709. CURLOPT(CURLOPT_PROXY_ISSUERCERT_BLOB, CURLOPTTYPE_BLOB, 297),
  1710. /* the EC curves requested by the TLS client (RFC 8422, 5.1);
  1711. * OpenSSL support via 'set_groups'/'set_curves':
  1712. * https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html
  1713. */
  1714. CURLOPT(CURLOPT_SSL_EC_CURVES, CURLOPTTYPE_STRINGPOINT, 298),
  1715. /* HSTS bitmask */
  1716. CURLOPT(CURLOPT_HSTS_CTRL, CURLOPTTYPE_LONG, 299),
  1717. /* HSTS file name */
  1718. CURLOPT(CURLOPT_HSTS, CURLOPTTYPE_STRINGPOINT, 300),
  1719. /* HSTS read callback */
  1720. CURLOPT(CURLOPT_HSTSREADFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 301),
  1721. CURLOPT(CURLOPT_HSTSREADDATA, CURLOPTTYPE_CBPOINT, 302),
  1722. /* HSTS write callback */
  1723. CURLOPT(CURLOPT_HSTSWRITEFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 303),
  1724. CURLOPT(CURLOPT_HSTSWRITEDATA, CURLOPTTYPE_CBPOINT, 304),
  1725. /* Parameters for V4 signature */
  1726. CURLOPT(CURLOPT_AWS_SIGV4, CURLOPTTYPE_STRINGPOINT, 305),
  1727. /* Same as CURLOPT_SSL_VERIFYPEER but for DoH (DNS-over-HTTPS) servers. */
  1728. CURLOPT(CURLOPT_DOH_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 306),
  1729. /* Same as CURLOPT_SSL_VERIFYHOST but for DoH (DNS-over-HTTPS) servers. */
  1730. CURLOPT(CURLOPT_DOH_SSL_VERIFYHOST, CURLOPTTYPE_LONG, 307),
  1731. /* Same as CURLOPT_SSL_VERIFYSTATUS but for DoH (DNS-over-HTTPS) servers. */
  1732. CURLOPT(CURLOPT_DOH_SSL_VERIFYSTATUS, CURLOPTTYPE_LONG, 308),
  1733. /* The CA certificates as "blob" used to validate the peer certificate
  1734. this option is used only if SSL_VERIFYPEER is true */
  1735. CURLOPT(CURLOPT_CAINFO_BLOB, CURLOPTTYPE_BLOB, 309),
  1736. /* The CA certificates as "blob" used to validate the proxy certificate
  1737. this option is used only if PROXY_SSL_VERIFYPEER is true */
  1738. CURLOPT(CURLOPT_PROXY_CAINFO_BLOB, CURLOPTTYPE_BLOB, 310),
  1739. /* used by scp/sftp to verify the host's public key */
  1740. CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, CURLOPTTYPE_STRINGPOINT, 311),
  1741. /* Function that will be called immediately before the initial request
  1742. is made on a connection (after any protocol negotiation step). */
  1743. CURLOPT(CURLOPT_PREREQFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 312),
  1744. /* Data passed to the CURLOPT_PREREQFUNCTION callback */
  1745. CURLOPT(CURLOPT_PREREQDATA, CURLOPTTYPE_CBPOINT, 313),
  1746. /* maximum age (since creation) of a connection to consider it for reuse
  1747. * (in seconds) */
  1748. CURLOPT(CURLOPT_MAXLIFETIME_CONN, CURLOPTTYPE_LONG, 314),
  1749. /* Set MIME option flags. */
  1750. CURLOPT(CURLOPT_MIME_OPTIONS, CURLOPTTYPE_LONG, 315),
  1751. /* set the SSH host key callback, must point to a curl_sshkeycallback
  1752. function */
  1753. CURLOPT(CURLOPT_SSH_HOSTKEYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 316),
  1754. /* set the SSH host key callback custom pointer */
  1755. CURLOPT(CURLOPT_SSH_HOSTKEYDATA, CURLOPTTYPE_CBPOINT, 317),
  1756. /* specify which protocols that are allowed to be used for the transfer,
  1757. which thus helps the app which takes URLs from users or other external
  1758. inputs and want to restrict what protocol(s) to deal with. Defaults to
  1759. all built-in protocols. */
  1760. CURLOPT(CURLOPT_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 318),
  1761. /* specify which protocols that libcurl is allowed to follow directs to */
  1762. CURLOPT(CURLOPT_REDIR_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 319),
  1763. /* websockets options */
  1764. CURLOPT(CURLOPT_WS_OPTIONS, CURLOPTTYPE_LONG, 320),
  1765. /* CA cache timeout */
  1766. CURLOPT(CURLOPT_CA_CACHE_TIMEOUT, CURLOPTTYPE_LONG, 321),
  1767. /* Can leak things, gonna exit() soon */
  1768. CURLOPT(CURLOPT_QUICK_EXIT, CURLOPTTYPE_LONG, 322),
  1769. CURLOPT_LASTENTRY /* the last unused */
  1770. } CURLoption;
  1771. #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
  1772. the obsolete stuff removed! */
  1773. /* Backwards compatibility with older names */
  1774. /* These are scheduled to disappear by 2011 */
  1775. /* This was added in version 7.19.1 */
  1776. #define CURLOPT_POST301 CURLOPT_POSTREDIR
  1777. /* These are scheduled to disappear by 2009 */
  1778. /* The following were added in 7.17.0 */
  1779. #define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD
  1780. #define CURLOPT_FTPAPPEND CURLOPT_APPEND
  1781. #define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY
  1782. #define CURLOPT_FTP_SSL CURLOPT_USE_SSL
  1783. /* The following were added earlier */
  1784. #define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
  1785. #define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
  1786. /* */
  1787. #define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT
  1788. #else
  1789. /* This is set if CURL_NO_OLDIES is defined at compile-time */
  1790. #undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
  1791. #endif
  1792. /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
  1793. name resolves addresses using more than one IP protocol version, this
  1794. option might be handy to force libcurl to use a specific IP version. */
  1795. #define CURL_IPRESOLVE_WHATEVER 0 /* default, uses addresses to all IP
  1796. versions that your system allows */
  1797. #define CURL_IPRESOLVE_V4 1 /* uses only IPv4 addresses/connections */
  1798. #define CURL_IPRESOLVE_V6 2 /* uses only IPv6 addresses/connections */
  1799. /* Convenient "aliases" */
  1800. #define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER
  1801. /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
  1802. enum {
  1803. CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
  1804. like the library to choose the best possible
  1805. for us! */
  1806. CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
  1807. CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
  1808. CURL_HTTP_VERSION_2_0, /* please use HTTP 2 in the request */
  1809. CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */
  1810. CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1
  1811. Upgrade */
  1812. CURL_HTTP_VERSION_3 = 30, /* Use HTTP/3, fallback to HTTP/2 or HTTP/1 if
  1813. needed. For HTTPS only. For HTTP, this option
  1814. makes libcurl return error. */
  1815. CURL_HTTP_VERSION_3ONLY = 31, /* Use HTTP/3 without fallback. For HTTPS
  1816. only. For HTTP, this makes libcurl
  1817. return error. */
  1818. CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
  1819. };
  1820. /* Convenience definition simple because the name of the version is HTTP/2 and
  1821. not 2.0. The 2_0 version of the enum name was set while the version was
  1822. still planned to be 2.0 and we stick to it for compatibility. */
  1823. #define CURL_HTTP_VERSION_2 CURL_HTTP_VERSION_2_0
  1824. /*
  1825. * Public API enums for RTSP requests
  1826. */
  1827. enum {
  1828. CURL_RTSPREQ_NONE, /* first in list */
  1829. CURL_RTSPREQ_OPTIONS,
  1830. CURL_RTSPREQ_DESCRIBE,
  1831. CURL_RTSPREQ_ANNOUNCE,
  1832. CURL_RTSPREQ_SETUP,
  1833. CURL_RTSPREQ_PLAY,
  1834. CURL_RTSPREQ_PAUSE,
  1835. CURL_RTSPREQ_TEARDOWN,
  1836. CURL_RTSPREQ_GET_PARAMETER,
  1837. CURL_RTSPREQ_SET_PARAMETER,
  1838. CURL_RTSPREQ_RECORD,
  1839. CURL_RTSPREQ_RECEIVE,
  1840. CURL_RTSPREQ_LAST /* last in list */
  1841. };
  1842. /* These enums are for use with the CURLOPT_NETRC option. */
  1843. enum CURL_NETRC_OPTION {
  1844. CURL_NETRC_IGNORED, /* The .netrc will never be read.
  1845. * This is the default. */
  1846. CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred
  1847. * to one in the .netrc. */
  1848. CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored.
  1849. * Unless one is set programmatically, the .netrc
  1850. * will be queried. */
  1851. CURL_NETRC_LAST
  1852. };
  1853. enum {
  1854. CURL_SSLVERSION_DEFAULT,
  1855. CURL_SSLVERSION_TLSv1, /* TLS 1.x */
  1856. CURL_SSLVERSION_SSLv2,
  1857. CURL_SSLVERSION_SSLv3,
  1858. CURL_SSLVERSION_TLSv1_0,
  1859. CURL_SSLVERSION_TLSv1_1,
  1860. CURL_SSLVERSION_TLSv1_2,
  1861. CURL_SSLVERSION_TLSv1_3,
  1862. CURL_SSLVERSION_LAST /* never use, keep last */
  1863. };
  1864. enum {
  1865. CURL_SSLVERSION_MAX_NONE = 0,
  1866. CURL_SSLVERSION_MAX_DEFAULT = (CURL_SSLVERSION_TLSv1 << 16),
  1867. CURL_SSLVERSION_MAX_TLSv1_0 = (CURL_SSLVERSION_TLSv1_0 << 16),
  1868. CURL_SSLVERSION_MAX_TLSv1_1 = (CURL_SSLVERSION_TLSv1_1 << 16),
  1869. CURL_SSLVERSION_MAX_TLSv1_2 = (CURL_SSLVERSION_TLSv1_2 << 16),
  1870. CURL_SSLVERSION_MAX_TLSv1_3 = (CURL_SSLVERSION_TLSv1_3 << 16),
  1871. /* never use, keep last */
  1872. CURL_SSLVERSION_MAX_LAST = (CURL_SSLVERSION_LAST << 16)
  1873. };
  1874. enum CURL_TLSAUTH {
  1875. CURL_TLSAUTH_NONE,
  1876. CURL_TLSAUTH_SRP,
  1877. CURL_TLSAUTH_LAST /* never use, keep last */
  1878. };
  1879. /* symbols to use with CURLOPT_POSTREDIR.
  1880. CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303
  1881. can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302
  1882. | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */
  1883. #define CURL_REDIR_GET_ALL 0
  1884. #define CURL_REDIR_POST_301 1
  1885. #define CURL_REDIR_POST_302 2
  1886. #define CURL_REDIR_POST_303 4
  1887. #define CURL_REDIR_POST_ALL \
  1888. (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
  1889. typedef enum {
  1890. CURL_TIMECOND_NONE,
  1891. CURL_TIMECOND_IFMODSINCE,
  1892. CURL_TIMECOND_IFUNMODSINCE,
  1893. CURL_TIMECOND_LASTMOD,
  1894. CURL_TIMECOND_LAST
  1895. } curl_TimeCond;
  1896. /* Special size_t value signaling a null-terminated string. */
  1897. #define CURL_ZERO_TERMINATED ((size_t) -1)
  1898. /* curl_strequal() and curl_strnequal() are subject for removal in a future
  1899. release */
  1900. CURL_EXTERN int curl_strequal(const char *s1, const char *s2);
  1901. CURL_EXTERN int curl_strnequal(const char *s1, const char *s2, size_t n);
  1902. /* Mime/form handling support. */
  1903. typedef struct curl_mime curl_mime; /* Mime context. */
  1904. typedef struct curl_mimepart curl_mimepart; /* Mime part context. */
  1905. /* CURLMIMEOPT_ defines are for the CURLOPT_MIME_OPTIONS option. */
  1906. #define CURLMIMEOPT_FORMESCAPE (1<<0) /* Use backslash-escaping for forms. */
  1907. /*
  1908. * NAME curl_mime_init()
  1909. *
  1910. * DESCRIPTION
  1911. *
  1912. * Create a mime context and return its handle. The easy parameter is the
  1913. * target handle.
  1914. */
  1915. CURL_EXTERN curl_mime *curl_mime_init(CURL *easy);
  1916. /*
  1917. * NAME curl_mime_free()
  1918. *
  1919. * DESCRIPTION
  1920. *
  1921. * release a mime handle and its substructures.
  1922. */
  1923. CURL_EXTERN void curl_mime_free(curl_mime *mime);
  1924. /*
  1925. * NAME curl_mime_addpart()
  1926. *
  1927. * DESCRIPTION
  1928. *
  1929. * Append a new empty part to the given mime context and return a handle to
  1930. * the created part.
  1931. */
  1932. CURL_EXTERN curl_mimepart *curl_mime_addpart(curl_mime *mime);
  1933. /*
  1934. * NAME curl_mime_name()
  1935. *
  1936. * DESCRIPTION
  1937. *
  1938. * Set mime/form part name.
  1939. */
  1940. CURL_EXTERN CURLcode curl_mime_name(curl_mimepart *part, const char *name);
  1941. /*
  1942. * NAME curl_mime_filename()
  1943. *
  1944. * DESCRIPTION
  1945. *
  1946. * Set mime part remote file name.
  1947. */
  1948. CURL_EXTERN CURLcode curl_mime_filename(curl_mimepart *part,
  1949. const char *filename);
  1950. /*
  1951. * NAME curl_mime_type()
  1952. *
  1953. * DESCRIPTION
  1954. *
  1955. * Set mime part type.
  1956. */
  1957. CURL_EXTERN CURLcode curl_mime_type(curl_mimepart *part, const char *mimetype);
  1958. /*
  1959. * NAME curl_mime_encoder()
  1960. *
  1961. * DESCRIPTION
  1962. *
  1963. * Set mime data transfer encoder.
  1964. */
  1965. CURL_EXTERN CURLcode curl_mime_encoder(curl_mimepart *part,
  1966. const char *encoding);
  1967. /*
  1968. * NAME curl_mime_data()
  1969. *
  1970. * DESCRIPTION
  1971. *
  1972. * Set mime part data source from memory data,
  1973. */
  1974. CURL_EXTERN CURLcode curl_mime_data(curl_mimepart *part,
  1975. const char *data, size_t datasize);
  1976. /*
  1977. * NAME curl_mime_filedata()
  1978. *
  1979. * DESCRIPTION
  1980. *
  1981. * Set mime part data source from named file.
  1982. */
  1983. CURL_EXTERN CURLcode curl_mime_filedata(curl_mimepart *part,
  1984. const char *filename);
  1985. /*
  1986. * NAME curl_mime_data_cb()
  1987. *
  1988. * DESCRIPTION
  1989. *
  1990. * Set mime part data source from callback function.
  1991. */
  1992. CURL_EXTERN CURLcode curl_mime_data_cb(curl_mimepart *part,
  1993. curl_off_t datasize,
  1994. curl_read_callback readfunc,
  1995. curl_seek_callback seekfunc,
  1996. curl_free_callback freefunc,
  1997. void *arg);
  1998. /*
  1999. * NAME curl_mime_subparts()
  2000. *
  2001. * DESCRIPTION
  2002. *
  2003. * Set mime part data source from subparts.
  2004. */
  2005. CURL_EXTERN CURLcode curl_mime_subparts(curl_mimepart *part,
  2006. curl_mime *subparts);
  2007. /*
  2008. * NAME curl_mime_headers()
  2009. *
  2010. * DESCRIPTION
  2011. *
  2012. * Set mime part headers.
  2013. */
  2014. CURL_EXTERN CURLcode curl_mime_headers(curl_mimepart *part,
  2015. struct curl_slist *headers,
  2016. int take_ownership);
  2017. typedef enum {
  2018. /********* the first one is unused ************/
  2019. CURLFORM_NOTHING CURL_DEPRECATED(7.56.0, ""),
  2020. CURLFORM_COPYNAME CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
  2021. CURLFORM_PTRNAME CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
  2022. CURLFORM_NAMELENGTH CURL_DEPRECATED(7.56.0, ""),
  2023. CURLFORM_COPYCONTENTS CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
  2024. CURLFORM_PTRCONTENTS CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
  2025. CURLFORM_CONTENTSLENGTH CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
  2026. CURLFORM_FILECONTENT CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),
  2027. CURLFORM_ARRAY CURL_DEPRECATED(7.56.0, ""),
  2028. CURLFORM_OBSOLETE,
  2029. CURLFORM_FILE CURL_DEPRECATED(7.56.0, "Use curl_mime_filedata()"),
  2030. CURLFORM_BUFFER CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),
  2031. CURLFORM_BUFFERPTR CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
  2032. CURLFORM_BUFFERLENGTH CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
  2033. CURLFORM_CONTENTTYPE CURL_DEPRECATED(7.56.0, "Use curl_mime_type()"),
  2034. CURLFORM_CONTENTHEADER CURL_DEPRECATED(7.56.0, "Use curl_mime_headers()"),
  2035. CURLFORM_FILENAME CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),
  2036. CURLFORM_END,
  2037. CURLFORM_OBSOLETE2,
  2038. CURLFORM_STREAM CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),
  2039. CURLFORM_CONTENTLEN /* added in 7.46.0, provide a curl_off_t length */
  2040. CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
  2041. CURLFORM_LASTENTRY /* the last unused */
  2042. } CURLformoption;
  2043. /* structure to be used as parameter for CURLFORM_ARRAY */
  2044. struct curl_forms {
  2045. CURLformoption option;
  2046. const char *value;
  2047. };
  2048. /* use this for multipart formpost building */
  2049. /* Returns code for curl_formadd()
  2050. *
  2051. * Returns:
  2052. * CURL_FORMADD_OK on success
  2053. * CURL_FORMADD_MEMORY if the FormInfo allocation fails
  2054. * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form
  2055. * CURL_FORMADD_NULL if a null pointer was given for a char
  2056. * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed
  2057. * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used
  2058. * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error)
  2059. * CURL_FORMADD_MEMORY if a curl_httppost struct cannot be allocated
  2060. * CURL_FORMADD_MEMORY if some allocation for string copying failed.
  2061. * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array
  2062. *
  2063. ***************************************************************************/
  2064. typedef enum {
  2065. CURL_FORMADD_OK CURL_DEPRECATED(7.56.0, ""), /* 1st, no error */
  2066. CURL_FORMADD_MEMORY CURL_DEPRECATED(7.56.0, ""),
  2067. CURL_FORMADD_OPTION_TWICE CURL_DEPRECATED(7.56.0, ""),
  2068. CURL_FORMADD_NULL CURL_DEPRECATED(7.56.0, ""),
  2069. CURL_FORMADD_UNKNOWN_OPTION CURL_DEPRECATED(7.56.0, ""),
  2070. CURL_FORMADD_INCOMPLETE CURL_DEPRECATED(7.56.0, ""),
  2071. CURL_FORMADD_ILLEGAL_ARRAY CURL_DEPRECATED(7.56.0, ""),
  2072. /* libcurl was built with form api disabled */
  2073. CURL_FORMADD_DISABLED CURL_DEPRECATED(7.56.0, ""),
  2074. CURL_FORMADD_LAST /* last */
  2075. } CURLFORMcode;
  2076. /*
  2077. * NAME curl_formadd()
  2078. *
  2079. * DESCRIPTION
  2080. *
  2081. * Pretty advanced function for building multi-part formposts. Each invoke
  2082. * adds one part that together construct a full post. Then use
  2083. * CURLOPT_HTTPPOST to send it off to libcurl.
  2084. */
  2085. CURL_EXTERN CURLFORMcode CURL_DEPRECATED(7.56.0, "Use curl_mime_init()")
  2086. curl_formadd(struct curl_httppost **httppost,
  2087. struct curl_httppost **last_post,
  2088. ...);
  2089. /*
  2090. * callback function for curl_formget()
  2091. * The void *arg pointer will be the one passed as second argument to
  2092. * curl_formget().
  2093. * The character buffer passed to it must not be freed.
  2094. * Should return the buffer length passed to it as the argument "len" on
  2095. * success.
  2096. */
  2097. typedef size_t (*curl_formget_callback)(void *arg, const char *buf,
  2098. size_t len);
  2099. /*
  2100. * NAME curl_formget()
  2101. *
  2102. * DESCRIPTION
  2103. *
  2104. * Serialize a curl_httppost struct built with curl_formadd().
  2105. * Accepts a void pointer as second argument which will be passed to
  2106. * the curl_formget_callback function.
  2107. * Returns 0 on success.
  2108. */
  2109. CURL_EXTERN int CURL_DEPRECATED(7.56.0, "")
  2110. curl_formget(struct curl_httppost *form, void *arg,
  2111. curl_formget_callback append);
  2112. /*
  2113. * NAME curl_formfree()
  2114. *
  2115. * DESCRIPTION
  2116. *
  2117. * Free a multipart formpost previously built with curl_formadd().
  2118. */
  2119. CURL_EXTERN void CURL_DEPRECATED(7.56.0, "Use curl_mime_free()")
  2120. curl_formfree(struct curl_httppost *form);
  2121. /*
  2122. * NAME curl_getenv()
  2123. *
  2124. * DESCRIPTION
  2125. *
  2126. * Returns a malloc()'ed string that MUST be curl_free()ed after usage is
  2127. * complete. DEPRECATED - see lib/README.curlx
  2128. */
  2129. CURL_EXTERN char *curl_getenv(const char *variable);
  2130. /*
  2131. * NAME curl_version()
  2132. *
  2133. * DESCRIPTION
  2134. *
  2135. * Returns a static ascii string of the libcurl version.
  2136. */
  2137. CURL_EXTERN char *curl_version(void);
  2138. /*
  2139. * NAME curl_easy_escape()
  2140. *
  2141. * DESCRIPTION
  2142. *
  2143. * Escapes URL strings (converts all letters consider illegal in URLs to their
  2144. * %XX versions). This function returns a new allocated string or NULL if an
  2145. * error occurred.
  2146. */
  2147. CURL_EXTERN char *curl_easy_escape(CURL *handle,
  2148. const char *string,
  2149. int length);
  2150. /* the previous version: */
  2151. CURL_EXTERN char *curl_escape(const char *string,
  2152. int length);
  2153. /*
  2154. * NAME curl_easy_unescape()
  2155. *
  2156. * DESCRIPTION
  2157. *
  2158. * Unescapes URL encoding in strings (converts all %XX codes to their 8bit
  2159. * versions). This function returns a new allocated string or NULL if an error
  2160. * occurred.
  2161. * Conversion Note: On non-ASCII platforms the ASCII %XX codes are
  2162. * converted into the host encoding.
  2163. */
  2164. CURL_EXTERN char *curl_easy_unescape(CURL *handle,
  2165. const char *string,
  2166. int length,
  2167. int *outlength);
  2168. /* the previous version */
  2169. CURL_EXTERN char *curl_unescape(const char *string,
  2170. int length);
  2171. /*
  2172. * NAME curl_free()
  2173. *
  2174. * DESCRIPTION
  2175. *
  2176. * Provided for de-allocation in the same translation unit that did the
  2177. * allocation. Added in libcurl 7.10
  2178. */
  2179. CURL_EXTERN void curl_free(void *p);
  2180. /*
  2181. * NAME curl_global_init()
  2182. *
  2183. * DESCRIPTION
  2184. *
  2185. * curl_global_init() should be invoked exactly once for each application that
  2186. * uses libcurl and before any call of other libcurl functions.
  2187. * This function is thread-safe if CURL_VERSION_THREADSAFE is set in the
  2188. * curl_version_info_data.features flag (fetch by curl_version_info()).
  2189. */
  2190. CURL_EXTERN CURLcode curl_global_init(long flags);
  2191. /*
  2192. * NAME curl_global_init_mem()
  2193. *
  2194. * DESCRIPTION
  2195. *
  2196. * curl_global_init() or curl_global_init_mem() should be invoked exactly once
  2197. * for each application that uses libcurl. This function can be used to
  2198. * initialize libcurl and set user defined memory management callback
  2199. * functions. Users can implement memory management routines to check for
  2200. * memory leaks, check for mis-use of the curl library etc. User registered
  2201. * callback routines will be invoked by this library instead of the system
  2202. * memory management routines like malloc, free etc.
  2203. */
  2204. CURL_EXTERN CURLcode curl_global_init_mem(long flags,
  2205. curl_malloc_callback m,
  2206. curl_free_callback f,
  2207. curl_realloc_callback r,
  2208. curl_strdup_callback s,
  2209. curl_calloc_callback c);
  2210. /*
  2211. * NAME curl_global_cleanup()
  2212. *
  2213. * DESCRIPTION
  2214. *
  2215. * curl_global_cleanup() should be invoked exactly once for each application
  2216. * that uses libcurl
  2217. */
  2218. CURL_EXTERN void curl_global_cleanup(void);
  2219. /* linked-list structure for the CURLOPT_QUOTE option (and other) */
  2220. struct curl_slist {
  2221. char *data;
  2222. struct curl_slist *next;
  2223. };
  2224. /*
  2225. * NAME curl_global_sslset()
  2226. *
  2227. * DESCRIPTION
  2228. *
  2229. * When built with multiple SSL backends, curl_global_sslset() allows to
  2230. * choose one. This function can only be called once, and it must be called
  2231. * *before* curl_global_init().
  2232. *
  2233. * The backend can be identified by the id (e.g. CURLSSLBACKEND_OPENSSL). The
  2234. * backend can also be specified via the name parameter (passing -1 as id).
  2235. * If both id and name are specified, the name will be ignored. If neither id
  2236. * nor name are specified, the function will fail with
  2237. * CURLSSLSET_UNKNOWN_BACKEND and set the "avail" pointer to the
  2238. * NULL-terminated list of available backends.
  2239. *
  2240. * Upon success, the function returns CURLSSLSET_OK.
  2241. *
  2242. * If the specified SSL backend is not available, the function returns
  2243. * CURLSSLSET_UNKNOWN_BACKEND and sets the "avail" pointer to a NULL-terminated
  2244. * list of available SSL backends.
  2245. *
  2246. * The SSL backend can be set only once. If it has already been set, a
  2247. * subsequent attempt to change it will result in a CURLSSLSET_TOO_LATE.
  2248. */
  2249. struct curl_ssl_backend {
  2250. curl_sslbackend id;
  2251. const char *name;
  2252. };
  2253. typedef struct curl_ssl_backend curl_ssl_backend;
  2254. typedef enum {
  2255. CURLSSLSET_OK = 0,
  2256. CURLSSLSET_UNKNOWN_BACKEND,
  2257. CURLSSLSET_TOO_LATE,
  2258. CURLSSLSET_NO_BACKENDS /* libcurl was built without any SSL support */
  2259. } CURLsslset;
  2260. CURL_EXTERN CURLsslset curl_global_sslset(curl_sslbackend id, const char *name,
  2261. const curl_ssl_backend ***avail);
  2262. /*
  2263. * NAME curl_slist_append()
  2264. *
  2265. * DESCRIPTION
  2266. *
  2267. * Appends a string to a linked list. If no list exists, it will be created
  2268. * first. Returns the new list, after appending.
  2269. */
  2270. CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *list,
  2271. const char *data);
  2272. /*
  2273. * NAME curl_slist_free_all()
  2274. *
  2275. * DESCRIPTION
  2276. *
  2277. * free a previously built curl_slist.
  2278. */
  2279. CURL_EXTERN void curl_slist_free_all(struct curl_slist *list);
  2280. /*
  2281. * NAME curl_getdate()
  2282. *
  2283. * DESCRIPTION
  2284. *
  2285. * Returns the time, in seconds since 1 Jan 1970 of the time string given in
  2286. * the first argument. The time argument in the second parameter is unused
  2287. * and should be set to NULL.
  2288. */
  2289. CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
  2290. /* info about the certificate chain, only for OpenSSL, GnuTLS, Schannel, NSS
  2291. and GSKit builds. Asked for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
  2292. struct curl_certinfo {
  2293. int num_of_certs; /* number of certificates with information */
  2294. struct curl_slist **certinfo; /* for each index in this array, there's a
  2295. linked list with textual information in the
  2296. format "name: value" */
  2297. };
  2298. /* Information about the SSL library used and the respective internal SSL
  2299. handle, which can be used to obtain further information regarding the
  2300. connection. Asked for with CURLINFO_TLS_SSL_PTR or CURLINFO_TLS_SESSION. */
  2301. struct curl_tlssessioninfo {
  2302. curl_sslbackend backend;
  2303. void *internals;
  2304. };
  2305. #define CURLINFO_STRING 0x100000
  2306. #define CURLINFO_LONG 0x200000
  2307. #define CURLINFO_DOUBLE 0x300000
  2308. #define CURLINFO_SLIST 0x400000
  2309. #define CURLINFO_PTR 0x400000 /* same as SLIST */
  2310. #define CURLINFO_SOCKET 0x500000
  2311. #define CURLINFO_OFF_T 0x600000
  2312. #define CURLINFO_MASK 0x0fffff
  2313. #define CURLINFO_TYPEMASK 0xf00000
  2314. typedef enum {
  2315. CURLINFO_NONE, /* first, never use this */
  2316. CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,
  2317. CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,
  2318. CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,
  2319. CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
  2320. CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
  2321. CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
  2322. CURLINFO_SIZE_UPLOAD CURL_DEPRECATED(7.55.0, "Use CURLINFO_SIZE_UPLOAD_T")
  2323. = CURLINFO_DOUBLE + 7,
  2324. CURLINFO_SIZE_UPLOAD_T = CURLINFO_OFF_T + 7,
  2325. CURLINFO_SIZE_DOWNLOAD
  2326. CURL_DEPRECATED(7.55.0, "Use CURLINFO_SIZE_DOWNLOAD_T")
  2327. = CURLINFO_DOUBLE + 8,
  2328. CURLINFO_SIZE_DOWNLOAD_T = CURLINFO_OFF_T + 8,
  2329. CURLINFO_SPEED_DOWNLOAD
  2330. CURL_DEPRECATED(7.55.0, "Use CURLINFO_SPEED_DOWNLOAD_T")
  2331. = CURLINFO_DOUBLE + 9,
  2332. CURLINFO_SPEED_DOWNLOAD_T = CURLINFO_OFF_T + 9,
  2333. CURLINFO_SPEED_UPLOAD
  2334. CURL_DEPRECATED(7.55.0, "Use CURLINFO_SPEED_UPLOAD_T")
  2335. = CURLINFO_DOUBLE + 10,
  2336. CURLINFO_SPEED_UPLOAD_T = CURLINFO_OFF_T + 10,
  2337. CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
  2338. CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
  2339. CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
  2340. CURLINFO_FILETIME = CURLINFO_LONG + 14,
  2341. CURLINFO_FILETIME_T = CURLINFO_OFF_T + 14,
  2342. CURLINFO_CONTENT_LENGTH_DOWNLOAD
  2343. CURL_DEPRECATED(7.55.0,
  2344. "Use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T")
  2345. = CURLINFO_DOUBLE + 15,
  2346. CURLINFO_CONTENT_LENGTH_DOWNLOAD_T = CURLINFO_OFF_T + 15,
  2347. CURLINFO_CONTENT_LENGTH_UPLOAD
  2348. CURL_DEPRECATED(7.55.0,
  2349. "Use CURLINFO_CONTENT_LENGTH_UPLOAD_T")
  2350. = CURLINFO_DOUBLE + 16,
  2351. CURLINFO_CONTENT_LENGTH_UPLOAD_T = CURLINFO_OFF_T + 16,
  2352. CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
  2353. CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
  2354. CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,
  2355. CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,
  2356. CURLINFO_PRIVATE = CURLINFO_STRING + 21,
  2357. CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
  2358. CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
  2359. CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
  2360. CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
  2361. CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
  2362. CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
  2363. CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
  2364. CURLINFO_LASTSOCKET CURL_DEPRECATED(7.45.0, "Use CURLINFO_ACTIVESOCKET")
  2365. = CURLINFO_LONG + 29,
  2366. CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
  2367. CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
  2368. CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
  2369. CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
  2370. CURLINFO_CERTINFO = CURLINFO_PTR + 34,
  2371. CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
  2372. CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36,
  2373. CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37,
  2374. CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38,
  2375. CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39,
  2376. CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40,
  2377. CURLINFO_LOCAL_IP = CURLINFO_STRING + 41,
  2378. CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42,
  2379. CURLINFO_TLS_SESSION CURL_DEPRECATED(7.48.0, "Use CURLINFO_TLS_SSL_PTR")
  2380. = CURLINFO_PTR + 43,
  2381. CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44,
  2382. CURLINFO_TLS_SSL_PTR = CURLINFO_PTR + 45,
  2383. CURLINFO_HTTP_VERSION = CURLINFO_LONG + 46,
  2384. CURLINFO_PROXY_SSL_VERIFYRESULT = CURLINFO_LONG + 47,
  2385. CURLINFO_PROTOCOL CURL_DEPRECATED(7.85.0, "Use CURLINFO_SCHEME")
  2386. = CURLINFO_LONG + 48,
  2387. CURLINFO_SCHEME = CURLINFO_STRING + 49,
  2388. CURLINFO_TOTAL_TIME_T = CURLINFO_OFF_T + 50,
  2389. CURLINFO_NAMELOOKUP_TIME_T = CURLINFO_OFF_T + 51,
  2390. CURLINFO_CONNECT_TIME_T = CURLINFO_OFF_T + 52,
  2391. CURLINFO_PRETRANSFER_TIME_T = CURLINFO_OFF_T + 53,
  2392. CURLINFO_STARTTRANSFER_TIME_T = CURLINFO_OFF_T + 54,
  2393. CURLINFO_REDIRECT_TIME_T = CURLINFO_OFF_T + 55,
  2394. CURLINFO_APPCONNECT_TIME_T = CURLINFO_OFF_T + 56,
  2395. CURLINFO_RETRY_AFTER = CURLINFO_OFF_T + 57,
  2396. CURLINFO_EFFECTIVE_METHOD = CURLINFO_STRING + 58,
  2397. CURLINFO_PROXY_ERROR = CURLINFO_LONG + 59,
  2398. CURLINFO_REFERER = CURLINFO_STRING + 60,
  2399. CURLINFO_CAINFO = CURLINFO_STRING + 61,
  2400. CURLINFO_CAPATH = CURLINFO_STRING + 62,
  2401. CURLINFO_LASTONE = 62
  2402. } CURLINFO;
  2403. /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
  2404. CURLINFO_HTTP_CODE */
  2405. #define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
  2406. typedef enum {
  2407. CURLCLOSEPOLICY_NONE, /* first, never use this */
  2408. CURLCLOSEPOLICY_OLDEST,
  2409. CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
  2410. CURLCLOSEPOLICY_LEAST_TRAFFIC,
  2411. CURLCLOSEPOLICY_SLOWEST,
  2412. CURLCLOSEPOLICY_CALLBACK,
  2413. CURLCLOSEPOLICY_LAST /* last, never use this */
  2414. } curl_closepolicy;
  2415. #define CURL_GLOBAL_SSL (1<<0) /* no purpose since 7.57.0 */
  2416. #define CURL_GLOBAL_WIN32 (1<<1)
  2417. #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
  2418. #define CURL_GLOBAL_NOTHING 0
  2419. #define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
  2420. #define CURL_GLOBAL_ACK_EINTR (1<<2)
  2421. /*****************************************************************************
  2422. * Setup defines, protos etc for the sharing stuff.
  2423. */
  2424. /* Different data locks for a single share */
  2425. typedef enum {
  2426. CURL_LOCK_DATA_NONE = 0,
  2427. /* CURL_LOCK_DATA_SHARE is used internally to say that
  2428. * the locking is just made to change the internal state of the share
  2429. * itself.
  2430. */
  2431. CURL_LOCK_DATA_SHARE,
  2432. CURL_LOCK_DATA_COOKIE,
  2433. CURL_LOCK_DATA_DNS,
  2434. CURL_LOCK_DATA_SSL_SESSION,
  2435. CURL_LOCK_DATA_CONNECT,
  2436. CURL_LOCK_DATA_PSL,
  2437. CURL_LOCK_DATA_HSTS,
  2438. CURL_LOCK_DATA_LAST
  2439. } curl_lock_data;
  2440. /* Different lock access types */
  2441. typedef enum {
  2442. CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */
  2443. CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
  2444. CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
  2445. CURL_LOCK_ACCESS_LAST /* never use */
  2446. } curl_lock_access;
  2447. typedef void (*curl_lock_function)(CURL *handle,
  2448. curl_lock_data data,
  2449. curl_lock_access locktype,
  2450. void *userptr);
  2451. typedef void (*curl_unlock_function)(CURL *handle,
  2452. curl_lock_data data,
  2453. void *userptr);
  2454. typedef enum {
  2455. CURLSHE_OK, /* all is fine */
  2456. CURLSHE_BAD_OPTION, /* 1 */
  2457. CURLSHE_IN_USE, /* 2 */
  2458. CURLSHE_INVALID, /* 3 */
  2459. CURLSHE_NOMEM, /* 4 out of memory */
  2460. CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */
  2461. CURLSHE_LAST /* never use */
  2462. } CURLSHcode;
  2463. typedef enum {
  2464. CURLSHOPT_NONE, /* don't use */
  2465. CURLSHOPT_SHARE, /* specify a data type to share */
  2466. CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
  2467. CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
  2468. CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
  2469. CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock
  2470. callback functions */
  2471. CURLSHOPT_LAST /* never use */
  2472. } CURLSHoption;
  2473. CURL_EXTERN CURLSH *curl_share_init(void);
  2474. CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *share, CURLSHoption option,
  2475. ...);
  2476. CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *share);
  2477. /****************************************************************************
  2478. * Structures for querying information about the curl library at runtime.
  2479. */
  2480. typedef enum {
  2481. CURLVERSION_FIRST,
  2482. CURLVERSION_SECOND,
  2483. CURLVERSION_THIRD,
  2484. CURLVERSION_FOURTH,
  2485. CURLVERSION_FIFTH,
  2486. CURLVERSION_SIXTH,
  2487. CURLVERSION_SEVENTH,
  2488. CURLVERSION_EIGHTH,
  2489. CURLVERSION_NINTH,
  2490. CURLVERSION_TENTH,
  2491. CURLVERSION_ELEVENTH,
  2492. CURLVERSION_LAST /* never actually use this */
  2493. } CURLversion;
  2494. /* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
  2495. basically all programs ever that want to get version information. It is
  2496. meant to be a built-in version number for what kind of struct the caller
  2497. expects. If the struct ever changes, we redefine the NOW to another enum
  2498. from above. */
  2499. #define CURLVERSION_NOW CURLVERSION_ELEVENTH
  2500. struct curl_version_info_data {
  2501. CURLversion age; /* age of the returned struct */
  2502. const char *version; /* LIBCURL_VERSION */
  2503. unsigned int version_num; /* LIBCURL_VERSION_NUM */
  2504. const char *host; /* OS/host/cpu/machine when configured */
  2505. int features; /* bitmask, see defines below */
  2506. const char *ssl_version; /* human readable string */
  2507. long ssl_version_num; /* not used anymore, always 0 */
  2508. const char *libz_version; /* human readable string */
  2509. /* protocols is terminated by an entry with a NULL protoname */
  2510. const char * const *protocols;
  2511. /* The fields below this were added in CURLVERSION_SECOND */
  2512. const char *ares;
  2513. int ares_num;
  2514. /* This field was added in CURLVERSION_THIRD */
  2515. const char *libidn;
  2516. /* These field were added in CURLVERSION_FOURTH */
  2517. /* Same as '_libiconv_version' if built with HAVE_ICONV */
  2518. int iconv_ver_num;
  2519. const char *libssh_version; /* human readable string */
  2520. /* These fields were added in CURLVERSION_FIFTH */
  2521. unsigned int brotli_ver_num; /* Numeric Brotli version
  2522. (MAJOR << 24) | (MINOR << 12) | PATCH */
  2523. const char *brotli_version; /* human readable string. */
  2524. /* These fields were added in CURLVERSION_SIXTH */
  2525. unsigned int nghttp2_ver_num; /* Numeric nghttp2 version
  2526. (MAJOR << 16) | (MINOR << 8) | PATCH */
  2527. const char *nghttp2_version; /* human readable string. */
  2528. const char *quic_version; /* human readable quic (+ HTTP/3) library +
  2529. version or NULL */
  2530. /* These fields were added in CURLVERSION_SEVENTH */
  2531. const char *cainfo; /* the built-in default CURLOPT_CAINFO, might
  2532. be NULL */
  2533. const char *capath; /* the built-in default CURLOPT_CAPATH, might
  2534. be NULL */
  2535. /* These fields were added in CURLVERSION_EIGHTH */
  2536. unsigned int zstd_ver_num; /* Numeric Zstd version
  2537. (MAJOR << 24) | (MINOR << 12) | PATCH */
  2538. const char *zstd_version; /* human readable string. */
  2539. /* These fields were added in CURLVERSION_NINTH */
  2540. const char *hyper_version; /* human readable string. */
  2541. /* These fields were added in CURLVERSION_TENTH */
  2542. const char *gsasl_version; /* human readable string. */
  2543. /* These fields were added in CURLVERSION_ELEVENTH */
  2544. /* feature_names is terminated by an entry with a NULL feature name */
  2545. const char * const *feature_names;
  2546. };
  2547. typedef struct curl_version_info_data curl_version_info_data;
  2548. #define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */
  2549. #define CURL_VERSION_KERBEROS4 (1<<1) /* Kerberos V4 auth is supported
  2550. (deprecated) */
  2551. #define CURL_VERSION_SSL (1<<2) /* SSL options are present */
  2552. #define CURL_VERSION_LIBZ (1<<3) /* libz features are present */
  2553. #define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */
  2554. #define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth is supported
  2555. (deprecated) */
  2556. #define CURL_VERSION_DEBUG (1<<6) /* Built with debug capabilities */
  2557. #define CURL_VERSION_ASYNCHDNS (1<<7) /* Asynchronous DNS resolves */
  2558. #define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth is supported */
  2559. #define CURL_VERSION_LARGEFILE (1<<9) /* Supports files larger than 2GB */
  2560. #define CURL_VERSION_IDN (1<<10) /* Internationized Domain Names are
  2561. supported */
  2562. #define CURL_VERSION_SSPI (1<<11) /* Built against Windows SSPI */
  2563. #define CURL_VERSION_CONV (1<<12) /* Character conversions supported */
  2564. #define CURL_VERSION_CURLDEBUG (1<<13) /* Debug memory tracking supported */
  2565. #define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */
  2566. #define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegation to winbind helper
  2567. is supported */
  2568. #define CURL_VERSION_HTTP2 (1<<16) /* HTTP2 support built-in */
  2569. #define CURL_VERSION_GSSAPI (1<<17) /* Built against a GSS-API library */
  2570. #define CURL_VERSION_KERBEROS5 (1<<18) /* Kerberos V5 auth is supported */
  2571. #define CURL_VERSION_UNIX_SOCKETS (1<<19) /* Unix domain sockets support */
  2572. #define CURL_VERSION_PSL (1<<20) /* Mozilla's Public Suffix List, used
  2573. for cookie domain verification */
  2574. #define CURL_VERSION_HTTPS_PROXY (1<<21) /* HTTPS-proxy support built-in */
  2575. #define CURL_VERSION_MULTI_SSL (1<<22) /* Multiple SSL backends available */
  2576. #define CURL_VERSION_BROTLI (1<<23) /* Brotli features are present. */
  2577. #define CURL_VERSION_ALTSVC (1<<24) /* Alt-Svc handling built-in */
  2578. #define CURL_VERSION_HTTP3 (1<<25) /* HTTP3 support built-in */
  2579. #define CURL_VERSION_ZSTD (1<<26) /* zstd features are present */
  2580. #define CURL_VERSION_UNICODE (1<<27) /* Unicode support on Windows */
  2581. #define CURL_VERSION_HSTS (1<<28) /* HSTS is supported */
  2582. #define CURL_VERSION_GSASL (1<<29) /* libgsasl is supported */
  2583. #define CURL_VERSION_THREADSAFE (1<<30) /* libcurl API is thread-safe */
  2584. /*
  2585. * NAME curl_version_info()
  2586. *
  2587. * DESCRIPTION
  2588. *
  2589. * This function returns a pointer to a static copy of the version info
  2590. * struct. See above.
  2591. */
  2592. CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);
  2593. /*
  2594. * NAME curl_easy_strerror()
  2595. *
  2596. * DESCRIPTION
  2597. *
  2598. * The curl_easy_strerror function may be used to turn a CURLcode value
  2599. * into the equivalent human readable error string. This is useful
  2600. * for printing meaningful error messages.
  2601. */
  2602. CURL_EXTERN const char *curl_easy_strerror(CURLcode);
  2603. /*
  2604. * NAME curl_share_strerror()
  2605. *
  2606. * DESCRIPTION
  2607. *
  2608. * The curl_share_strerror function may be used to turn a CURLSHcode value
  2609. * into the equivalent human readable error string. This is useful
  2610. * for printing meaningful error messages.
  2611. */
  2612. CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
  2613. /*
  2614. * NAME curl_easy_pause()
  2615. *
  2616. * DESCRIPTION
  2617. *
  2618. * The curl_easy_pause function pauses or unpauses transfers. Select the new
  2619. * state by setting the bitmask, use the convenience defines below.
  2620. *
  2621. */
  2622. CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
  2623. #define CURLPAUSE_RECV (1<<0)
  2624. #define CURLPAUSE_RECV_CONT (0)
  2625. #define CURLPAUSE_SEND (1<<2)
  2626. #define CURLPAUSE_SEND_CONT (0)
  2627. #define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND)
  2628. #define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)
  2629. #ifdef __cplusplus
  2630. } /* end of extern "C" */
  2631. #endif
  2632. /* unfortunately, the easy.h and multi.h include files need options and info
  2633. stuff before they can be included! */
  2634. #include "easy.h" /* nothing in curl is fun without the easy stuff */
  2635. #include "multi.h"
  2636. #include "urlapi.h"
  2637. #include "options.h"
  2638. #include "header.h"
  2639. #include "websockets.h"
  2640. /* the typechecker doesn't work in C++ (yet) */
  2641. #if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
  2642. ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
  2643. !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)
  2644. #include "typecheck-gcc.h"
  2645. #else
  2646. #if defined(__STDC__) && (__STDC__ >= 1)
  2647. /* This preprocessor magic that replaces a call with the exact same call is
  2648. only done to make sure application authors pass exactly three arguments
  2649. to these functions. */
  2650. #define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
  2651. #define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)
  2652. #define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
  2653. #define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
  2654. #endif /* __STDC__ >= 1 */
  2655. #endif /* gcc >= 4.3 && !__cplusplus && !CURL_DISABLE_TYPECHECK */
  2656. #endif /* CURLINC_CURL_H */