curl.h 125 KB

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