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