source: azure_iot_hub/trunk/curl-7.57.0/include/curl/curl.h@ 389

Last change on this file since 389 was 389, checked in by coas-nagasima, 5 years ago

ビルドが通るよう更新

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