3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2008, 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 * $Id: curl.h,v 1.344 2008-03-18 08:14:37 mmarek Exp $
24 ***************************************************************************/
26 /* If you have problems, all libcurl docs and details are found here:
27 http://curl.haxx.se/libcurl/
30 #include "curlver.h" /* the libcurl version defines */
33 * Define WIN32 when build target is Win32 API
36 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
43 /* The include stuff here below is mainly for time_t! */
48 # include <sys/types.h>
50 #endif /* defined (vms) */
52 #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \
53 !defined(__CYGWIN__) || defined(__MINGW32__)
54 #if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
55 /* The check above prevents the winsock2 inclusion if winsock.h already was
56 included, since they can't co-exist without problems */
62 /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
63 libc5-based Linux systems. Only include it on system that are known to
65 #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || defined(__minix)
66 #include <sys/select.h>
70 #include <sys/socket.h>
75 #include <sys/types.h>
79 #include <support/SupportDefs.h>
89 * Decorate exportable functions for Win32 DLL linking.
90 * This avoids using a .def file for building libcurl.dll.
92 #if (defined(WIN32) || defined(_WIN32)) && !defined(CURL_STATICLIB)
93 #if defined(BUILDING_LIBCURL)
94 #define CURL_EXTERN __declspec(dllexport)
96 #define CURL_EXTERN __declspec(dllimport)
100 #ifdef CURL_HIDDEN_SYMBOLS
102 * This definition is used to make external definitions visibile in the
103 * shared library when symbols are hidden by default. It makes no
104 * difference when compiling applications whether this is set or not,
105 * only when compiling the library.
107 #define CURL_EXTERN CURL_EXTERN_SYMBOL
114 * We want the typedef curl_off_t setup for large file support on all
115 * platforms. We also provide a CURL_FORMAT_OFF_T define to use in *printf
116 * format strings when outputting a variable of type curl_off_t.
118 * Note: "pocc -Ze" is MSVC compatibily mode and this sets _MSC_VER!
121 #if (defined(_MSC_VER) && !defined(__POCC__)) || (defined(__LCC__) && defined(WIN32))
124 typedef long curl_off_t
;
125 #define CURL_FORMAT_OFF_T "%ld"
127 typedef signed __int64 curl_off_t
;
128 #define CURL_FORMAT_OFF_T "%I64d"
130 #else /* (_MSC_VER && !__POCC__) || (__LCC__ && WIN32) */
131 #if (defined(__GNUC__) && defined(WIN32)) || defined(__WATCOMC__)
132 /* gcc on windows or Watcom */
133 typedef long long curl_off_t
;
134 #define CURL_FORMAT_OFF_T "%I64d"
135 #else /* GCC or Watcom on Windows */
136 #if defined(__ILEC400__)
137 /* OS400 C compiler. */
138 typedef long long curl_off_t
;
139 #define CURL_FORMAT_OFF_T "%lld"
140 #else /* OS400 C compiler. */
142 /* "normal" POSIX approach, do note that this does not necessarily mean that
143 the type is >32 bits, see the SIZEOF_CURL_OFF_T define for that! */
144 typedef off_t curl_off_t
;
146 /* Check a range of defines to detect large file support. On Linux it seems
147 none of these are set by default, so if you don't explicitly switches on
148 large file support, this define will be made for "small file" support. */
149 #ifndef _FILE_OFFSET_BITS
150 #define _FILE_OFFSET_BITS 0 /* to prevent warnings in the check below */
151 #define UNDEF_FILE_OFFSET_BITS
154 #define FILESIZEBITS 0 /* to prevent warnings in the check below */
155 #define UNDEF_FILESIZEBITS
158 #if defined(_LARGE_FILES) || (_FILE_OFFSET_BITS > 32) || (FILESIZEBITS > 32) \
159 || defined(_LARGEFILE_SOURCE) || defined(_LARGEFILE64_SOURCE)
160 /* For now, we assume at least one of these to be set for large files to
162 #define CURL_FORMAT_OFF_T "%lld"
163 #else /* LARGE_FILE support */
164 #define CURL_FORMAT_OFF_T "%ld"
166 #endif /* OS400 C compiler. */
167 #endif /* GCC or Watcom on Windows */
168 #endif /* (_MSC_VER && !__POCC__) || (__LCC__ && WIN32) */
170 #ifdef UNDEF_FILE_OFFSET_BITS
171 /* this was defined above for our checks, undefine it again */
172 #undef _FILE_OFFSET_BITS
175 #ifdef UNDEF_FILESIZEBITS
176 /* this was defined above for our checks, undefine it again */
180 #ifndef curl_socket_typedef
183 typedef SOCKET curl_socket_t
;
184 #define CURL_SOCKET_BAD INVALID_SOCKET
186 typedef int curl_socket_t
;
187 #define CURL_SOCKET_BAD -1
189 #define curl_socket_typedef
190 #endif /* curl_socket_typedef */
192 struct curl_httppost
{
193 struct curl_httppost
*next
; /* next entry in the list */
194 char *name
; /* pointer to allocated name */
195 long namelength
; /* length of name length */
196 char *contents
; /* pointer to allocated data contents */
197 long contentslength
; /* length of contents field */
198 char *buffer
; /* pointer to allocated buffer contents */
199 long bufferlength
; /* length of buffer field */
200 char *contenttype
; /* Content-Type */
201 struct curl_slist
* contentheader
; /* list of extra headers for this form */
202 struct curl_httppost
*more
; /* if one field name has more than one
203 file, this link should link to following
205 long flags
; /* as defined below */
206 #define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */
207 #define HTTPPOST_READFILE (1<<1) /* specified content is a file name */
208 #define HTTPPOST_PTRNAME (1<<2) /* name is only stored pointer
209 do not free in formfree */
210 #define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer
211 do not free in formfree */
212 #define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */
213 #define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */
215 char *showfilename
; /* The file name to show. If not set, the
216 actual file name will be used (if this
220 typedef int (*curl_progress_callback
)(void *clientp
,
226 #ifndef CURL_MAX_WRITE_SIZE
227 /* Tests have proven that 20K is a very bad buffer size for uploads on
228 Windows, while 16K for some odd reason performed a lot better.
229 We do the ifndef check to allow this value to easier be changed at build
230 time for those who feel adventurous. */
231 #define CURL_MAX_WRITE_SIZE 16384
233 /* This is a magic return code for the write callback that, when returned,
234 will signal libcurl to pause receving on the current transfer. */
235 #define CURL_WRITEFUNC_PAUSE 0x10000001
236 typedef size_t (*curl_write_callback
)(char *buffer
,
241 /* This is a return code for the read callback that, when returned, will
242 signal libcurl to immediately abort the current transfer. */
243 #define CURL_READFUNC_ABORT 0x10000000
244 /* This is a return code for the read callback that, when returned, will
245 signal libcurl to pause sending data on the current transfer. */
246 #define CURL_READFUNC_PAUSE 0x10000001
247 typedef int (*curl_seek_callback
)(void *instream
,
249 int origin
); /* 'whence' */
251 typedef size_t (*curl_read_callback
)(char *buffer
,
257 CURLSOCKTYPE_IPCXN
, /* socket created for a specific IP connection */
258 CURLSOCKTYPE_LAST
/* never use */
261 typedef int (*curl_sockopt_callback
)(void *clientp
,
262 curl_socket_t curlfd
,
263 curlsocktype purpose
);
265 struct curl_sockaddr
{
269 unsigned int addrlen
; /* addrlen was a socklen_t type before 7.18.0 but it
270 turned really ugly and painful on the systems that
272 struct sockaddr addr
;
275 typedef curl_socket_t
276 (*curl_opensocket_callback
)(void *clientp
,
277 curlsocktype purpose
,
278 struct curl_sockaddr
*address
);
280 #ifndef CURL_NO_OLDIES
281 /* not used since 7.10.8, will be removed in a future release */
282 typedef int (*curl_passwd_callback
)(void *clientp
,
289 CURLIOE_OK
, /* I/O operation successful */
290 CURLIOE_UNKNOWNCMD
, /* command was unknown to callback */
291 CURLIOE_FAILRESTART
, /* failed to restart the read */
292 CURLIOE_LAST
/* never use */
296 CURLIOCMD_NOP
, /* no operation */
297 CURLIOCMD_RESTARTREAD
, /* restart the read stream from start */
298 CURLIOCMD_LAST
/* never use */
301 typedef curlioerr (*curl_ioctl_callback
)(CURL
*handle
,
306 * The following typedef's are signatures of malloc, free, realloc, strdup and
307 * calloc respectively. Function pointers of these types can be passed to the
308 * curl_global_init_mem() function to set user defined memory management
311 typedef void *(*curl_malloc_callback
)(size_t size
);
312 typedef void (*curl_free_callback
)(void *ptr
);
313 typedef void *(*curl_realloc_callback
)(void *ptr
, size_t size
);
314 typedef char *(*curl_strdup_callback
)(const char *str
);
315 typedef void *(*curl_calloc_callback
)(size_t nmemb
, size_t size
);
317 /* the kind of data that is passed to information_callback*/
320 CURLINFO_HEADER_IN
, /* 1 */
321 CURLINFO_HEADER_OUT
, /* 2 */
322 CURLINFO_DATA_IN
, /* 3 */
323 CURLINFO_DATA_OUT
, /* 4 */
324 CURLINFO_SSL_DATA_IN
, /* 5 */
325 CURLINFO_SSL_DATA_OUT
, /* 6 */
329 typedef int (*curl_debug_callback
)
330 (CURL
*handle
, /* the handle/transfer this concerns */
331 curl_infotype type
, /* what kind of data */
332 char *data
, /* points to the data */
333 size_t size
, /* size of the data pointed to */
334 void *userptr
); /* whatever the user please */
336 /* All possible error codes from all sorts of curl functions. Future versions
337 may return other values, stay prepared.
339 Always add new return codes last. Never *EVER* remove any. The return
340 codes must remain the same!
345 CURLE_UNSUPPORTED_PROTOCOL
, /* 1 */
346 CURLE_FAILED_INIT
, /* 2 */
347 CURLE_URL_MALFORMAT
, /* 3 */
348 CURLE_OBSOLETE4
, /* 4 - NOT USED */
349 CURLE_COULDNT_RESOLVE_PROXY
, /* 5 */
350 CURLE_COULDNT_RESOLVE_HOST
, /* 6 */
351 CURLE_COULDNT_CONNECT
, /* 7 */
352 CURLE_FTP_WEIRD_SERVER_REPLY
, /* 8 */
353 CURLE_REMOTE_ACCESS_DENIED
, /* 9 a service was denied by the server
354 due to lack of access - when login fails
355 this is not returned. */
356 CURLE_OBSOLETE10
, /* 10 - NOT USED */
357 CURLE_FTP_WEIRD_PASS_REPLY
, /* 11 */
358 CURLE_OBSOLETE12
, /* 12 - NOT USED */
359 CURLE_FTP_WEIRD_PASV_REPLY
, /* 13 */
360 CURLE_FTP_WEIRD_227_FORMAT
, /* 14 */
361 CURLE_FTP_CANT_GET_HOST
, /* 15 */
362 CURLE_OBSOLETE16
, /* 16 - NOT USED */
363 CURLE_FTP_COULDNT_SET_TYPE
, /* 17 */
364 CURLE_PARTIAL_FILE
, /* 18 */
365 CURLE_FTP_COULDNT_RETR_FILE
, /* 19 */
366 CURLE_OBSOLETE20
, /* 20 - NOT USED */
367 CURLE_QUOTE_ERROR
, /* 21 - quote command failure */
368 CURLE_HTTP_RETURNED_ERROR
, /* 22 */
369 CURLE_WRITE_ERROR
, /* 23 */
370 CURLE_OBSOLETE24
, /* 24 - NOT USED */
371 CURLE_UPLOAD_FAILED
, /* 25 - failed upload "command" */
372 CURLE_READ_ERROR
, /* 26 - could open/read from file */
373 CURLE_OUT_OF_MEMORY
, /* 27 */
374 /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
375 instead of a memory allocation error if CURL_DOES_CONVERSIONS
378 CURLE_OPERATION_TIMEDOUT
, /* 28 - the timeout time was reached */
379 CURLE_OBSOLETE29
, /* 29 - NOT USED */
380 CURLE_FTP_PORT_FAILED
, /* 30 - FTP PORT operation failed */
381 CURLE_FTP_COULDNT_USE_REST
, /* 31 - the REST command failed */
382 CURLE_OBSOLETE32
, /* 32 - NOT USED */
383 CURLE_RANGE_ERROR
, /* 33 - RANGE "command" didn't work */
384 CURLE_HTTP_POST_ERROR
, /* 34 */
385 CURLE_SSL_CONNECT_ERROR
, /* 35 - wrong when connecting with SSL */
386 CURLE_BAD_DOWNLOAD_RESUME
, /* 36 - couldn't resume download */
387 CURLE_FILE_COULDNT_READ_FILE
, /* 37 */
388 CURLE_LDAP_CANNOT_BIND
, /* 38 */
389 CURLE_LDAP_SEARCH_FAILED
, /* 39 */
390 CURLE_OBSOLETE40
, /* 40 - NOT USED */
391 CURLE_FUNCTION_NOT_FOUND
, /* 41 */
392 CURLE_ABORTED_BY_CALLBACK
, /* 42 */
393 CURLE_BAD_FUNCTION_ARGUMENT
, /* 43 */
394 CURLE_OBSOLETE44
, /* 44 - NOT USED */
395 CURLE_INTERFACE_FAILED
, /* 45 - CURLOPT_INTERFACE failed */
396 CURLE_OBSOLETE46
, /* 46 - NOT USED */
397 CURLE_TOO_MANY_REDIRECTS
, /* 47 - catch endless re-direct loops */
398 CURLE_UNKNOWN_TELNET_OPTION
, /* 48 - User specified an unknown option */
399 CURLE_TELNET_OPTION_SYNTAX
, /* 49 - Malformed telnet option */
400 CURLE_OBSOLETE50
, /* 50 - NOT USED */
401 CURLE_PEER_FAILED_VERIFICATION
, /* 51 - peer's certificate or fingerprint
402 wasn't verified fine */
403 CURLE_GOT_NOTHING
, /* 52 - when this is a specific error */
404 CURLE_SSL_ENGINE_NOTFOUND
, /* 53 - SSL crypto engine not found */
405 CURLE_SSL_ENGINE_SETFAILED
, /* 54 - can not set SSL crypto engine as
407 CURLE_SEND_ERROR
, /* 55 - failed sending network data */
408 CURLE_RECV_ERROR
, /* 56 - failure in receiving network data */
409 CURLE_OBSOLETE57
, /* 57 - NOT IN USE */
410 CURLE_SSL_CERTPROBLEM
, /* 58 - problem with the local certificate */
411 CURLE_SSL_CIPHER
, /* 59 - couldn't use specified cipher */
412 CURLE_SSL_CACERT
, /* 60 - problem with the CA cert (path?) */
413 CURLE_BAD_CONTENT_ENCODING
, /* 61 - Unrecognized transfer encoding */
414 CURLE_LDAP_INVALID_URL
, /* 62 - Invalid LDAP URL */
415 CURLE_FILESIZE_EXCEEDED
, /* 63 - Maximum file size exceeded */
416 CURLE_USE_SSL_FAILED
, /* 64 - Requested FTP SSL level failed */
417 CURLE_SEND_FAIL_REWIND
, /* 65 - Sending the data requires a rewind
419 CURLE_SSL_ENGINE_INITFAILED
, /* 66 - failed to initialise ENGINE */
420 CURLE_LOGIN_DENIED
, /* 67 - user, password or similar was not
421 accepted and we failed to login */
422 CURLE_TFTP_NOTFOUND
, /* 68 - file not found on server */
423 CURLE_TFTP_PERM
, /* 69 - permission problem on server */
424 CURLE_REMOTE_DISK_FULL
, /* 70 - out of disk space on server */
425 CURLE_TFTP_ILLEGAL
, /* 71 - Illegal TFTP operation */
426 CURLE_TFTP_UNKNOWNID
, /* 72 - Unknown transfer ID */
427 CURLE_REMOTE_FILE_EXISTS
, /* 73 - File already exists */
428 CURLE_TFTP_NOSUCHUSER
, /* 74 - No such user */
429 CURLE_CONV_FAILED
, /* 75 - conversion failed */
430 CURLE_CONV_REQD
, /* 76 - caller must register conversion
431 callbacks using curl_easy_setopt options
432 CURLOPT_CONV_FROM_NETWORK_FUNCTION,
433 CURLOPT_CONV_TO_NETWORK_FUNCTION, and
434 CURLOPT_CONV_FROM_UTF8_FUNCTION */
435 CURLE_SSL_CACERT_BADFILE
, /* 77 - could not load CACERT file, missing
437 CURLE_REMOTE_FILE_NOT_FOUND
, /* 78 - remote file not found */
438 CURLE_SSH
, /* 79 - error from the SSH layer, somewhat
439 generic so the error message will be of
440 interest when this has happened */
442 CURLE_SSL_SHUTDOWN_FAILED
, /* 80 - Failed to shut down the SSL
444 CURL_LAST
/* never use! */
447 #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
448 the obsolete stuff removed! */
450 /* Backwards compatibility with older names */
452 /* The following were added in 7.17.1 */
453 /* These are scheduled to disappear by 2009 */
454 #define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION
456 /* The following were added in 7.17.0 */
457 /* These are scheduled to disappear by 2009 */
458 #define CURLE_OBSOLETE CURLE_OBSOLETE50 /* noone should be using this! */
459 #define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46
460 #define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44
461 #define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10
462 #define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16
463 #define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32
464 #define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29
465 #define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12
466 #define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20
467 #define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40
468 #define CURLE_MALFORMAT_USER CURLE_OBSOLETE24
469 #define CURLE_SHARE_IN_USE CURLE_OBSOLETE57
470 #define CURLE_URL_MALFORMAT_USER CURLE_OBSOLETE4
472 #define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED
473 #define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE
474 #define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR
475 #define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL
476 #define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS
477 #define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR
478 #define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED
480 /* The following were added earlier */
482 #define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT
484 #define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR
485 #define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED
486 #define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED
488 #define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
489 #define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
491 /* This was the error code 50 in 7.7.3 and a few earlier versions, this
492 is no longer used by libcurl but is instead #defined here only to not
493 make programs break */
494 #define CURLE_ALREADY_COMPLETE 99999
496 #endif /*!CURL_NO_OLDIES*/
498 /* This prototype applies to all conversion callbacks */
499 typedef CURLcode (*curl_conv_callback
)(char *buffer
, size_t length
);
501 typedef CURLcode (*curl_ssl_ctx_callback
)(CURL
*curl
, /* easy handle */
502 void *ssl_ctx
, /* actually an
507 CURLPROXY_HTTP
= 0, /* added in 7.10 */
508 CURLPROXY_SOCKS4
= 4, /* support added in 7.15.2, enum existed already
510 CURLPROXY_SOCKS5
= 5, /* added in 7.10 */
511 CURLPROXY_SOCKS4A
= 6, /* added in 7.18.0 */
512 CURLPROXY_SOCKS5_HOSTNAME
= 7 /* Use the SOCKS5 protocol but pass along the
513 host name rather than the IP address. added
515 } curl_proxytype
; /* this enum was added in 7.10 */
517 #define CURLAUTH_NONE 0 /* nothing */
518 #define CURLAUTH_BASIC (1<<0) /* Basic (default) */
519 #define CURLAUTH_DIGEST (1<<1) /* Digest */
520 #define CURLAUTH_GSSNEGOTIATE (1<<2) /* GSS-Negotiate */
521 #define CURLAUTH_NTLM (1<<3) /* NTLM */
522 #define CURLAUTH_ANY ~0 /* all types set */
523 #define CURLAUTH_ANYSAFE (~CURLAUTH_BASIC)
525 #define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */
526 #define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */
527 #define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */
528 #define CURLSSH_AUTH_PASSWORD (1<<1) /* password */
529 #define CURLSSH_AUTH_HOST (1<<2) /* host key files */
530 #define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */
531 #define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
533 #define CURL_ERROR_SIZE 256
535 /* parameter for the CURLOPT_USE_SSL option */
537 CURLUSESSL_NONE
, /* do not attempt to use SSL */
538 CURLUSESSL_TRY
, /* try using SSL, proceed anyway otherwise */
539 CURLUSESSL_CONTROL
, /* SSL for the control connection or fail */
540 CURLUSESSL_ALL
, /* SSL for all communication or fail */
541 CURLUSESSL_LAST
/* not an option, never use */
544 #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
545 the obsolete stuff removed! */
547 /* Backwards compatibility with older names */
548 /* These are scheduled to disappear by 2009 */
550 #define CURLFTPSSL_NONE CURLUSESSL_NONE
551 #define CURLFTPSSL_TRY CURLUSESSL_TRY
552 #define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL
553 #define CURLFTPSSL_ALL CURLUSESSL_ALL
554 #define CURLFTPSSL_LAST CURLUSESSL_LAST
555 #define curl_ftpssl curl_usessl
556 #endif /*!CURL_NO_OLDIES*/
558 /* parameter for the CURLOPT_FTP_SSL_CCC option */
560 CURLFTPSSL_CCC_NONE
, /* do not send CCC */
561 CURLFTPSSL_CCC_PASSIVE
, /* Let the server initiate the shutdown */
562 CURLFTPSSL_CCC_ACTIVE
, /* Initiate the shutdown */
563 CURLFTPSSL_CCC_LAST
/* not an option, never use */
566 /* parameter for the CURLOPT_FTPSSLAUTH option */
568 CURLFTPAUTH_DEFAULT
, /* let libcurl decide */
569 CURLFTPAUTH_SSL
, /* use "AUTH SSL" */
570 CURLFTPAUTH_TLS
, /* use "AUTH TLS" */
571 CURLFTPAUTH_LAST
/* not an option, never use */
574 /* parameter for the CURLOPT_FTP_FILEMETHOD option */
576 CURLFTPMETHOD_DEFAULT
, /* let libcurl pick */
577 CURLFTPMETHOD_MULTICWD
, /* single CWD operation for each path part */
578 CURLFTPMETHOD_NOCWD
, /* no CWD at all */
579 CURLFTPMETHOD_SINGLECWD
, /* one CWD to full dir, then work on file */
580 CURLFTPMETHOD_LAST
/* not an option, never use */
583 /* long may be 32 or 64 bits, but we should never depend on anything else
585 #define CURLOPTTYPE_LONG 0
586 #define CURLOPTTYPE_OBJECTPOINT 10000
587 #define CURLOPTTYPE_FUNCTIONPOINT 20000
588 #define CURLOPTTYPE_OFF_T 30000
590 /* name is uppercase CURLOPT_<name>,
591 type is one of the defined CURLOPTTYPE_<type>
592 number is unique identifier */
597 * Figure out if we can use the ## operator, which is supported by ISO/ANSI C
598 * and C++. Some compilers support it without setting __STDC__ or __cplusplus
599 * so we need to carefully check for them too. We don't use configure-checks
600 * for these since we want these headers to remain generic and working for all
603 #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
604 defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
605 defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
607 /* This compiler is believed to have an ISO compatible preprocessor */
610 /* This compiler is believed NOT to have an ISO compatible preprocessor */
615 #define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number
617 /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
618 #define LONG CURLOPTTYPE_LONG
619 #define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
620 #define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
621 #define OFF_T CURLOPTTYPE_OFF_T
622 #define CINIT(name,type,number) CURLOPT_/**/name = type + number
626 * This macro-mania below setups the CURLOPT_[what] enum, to be used with
627 * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]
632 /* This is the FILE * or void * the regular output should be written to. */
633 CINIT(FILE, OBJECTPOINT
, 1),
635 /* The full URL to get/put */
636 CINIT(URL
, OBJECTPOINT
, 2),
638 /* Port number to connect to, if other than default. */
639 CINIT(PORT
, LONG
, 3),
641 /* Name of proxy to use. */
642 CINIT(PROXY
, OBJECTPOINT
, 4),
644 /* "name:password" to use when fetching. */
645 CINIT(USERPWD
, OBJECTPOINT
, 5),
647 /* "name:password" to use with proxy. */
648 CINIT(PROXYUSERPWD
, OBJECTPOINT
, 6),
650 /* Range to get, specified as an ASCII string. */
651 CINIT(RANGE
, OBJECTPOINT
, 7),
655 /* Specified file stream to upload from (use as input): */
656 CINIT(INFILE
, OBJECTPOINT
, 9),
658 /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
659 * bytes big. If this is not used, error messages go to stderr instead: */
660 CINIT(ERRORBUFFER
, OBJECTPOINT
, 10),
662 /* Function that will be called to store the output (instead of fwrite). The
663 * parameters will use fwrite() syntax, make sure to follow them. */
664 CINIT(WRITEFUNCTION
, FUNCTIONPOINT
, 11),
666 /* Function that will be called to read the input (instead of fread). The
667 * parameters will use fread() syntax, make sure to follow them. */
668 CINIT(READFUNCTION
, FUNCTIONPOINT
, 12),
670 /* Time-out the read operation after this amount of seconds */
671 CINIT(TIMEOUT
, LONG
, 13),
673 /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
674 * how large the file being sent really is. That allows better error
675 * checking and better verifies that the upload was succcessful. -1 means
678 * For large file support, there is also a _LARGE version of the key
679 * which takes an off_t type, allowing platforms with larger off_t
680 * sizes to handle larger files. See below for INFILESIZE_LARGE.
682 CINIT(INFILESIZE
, LONG
, 14),
684 /* POST static input fields. */
685 CINIT(POSTFIELDS
, OBJECTPOINT
, 15),
687 /* Set the referer page (needed by some CGIs) */
688 CINIT(REFERER
, OBJECTPOINT
, 16),
690 /* Set the FTP PORT string (interface name, named or numerical IP address)
691 Use i.e '-' to use default address. */
692 CINIT(FTPPORT
, OBJECTPOINT
, 17),
694 /* Set the User-Agent string (examined by some CGIs) */
695 CINIT(USERAGENT
, OBJECTPOINT
, 18),
697 /* If the download receives less than "low speed limit" bytes/second
698 * during "low speed time" seconds, the operations is aborted.
699 * You could i.e if you have a pretty high speed connection, abort if
700 * it is less than 2000 bytes/sec during 20 seconds.
703 /* Set the "low speed limit" */
704 CINIT(LOW_SPEED_LIMIT
, LONG
, 19),
706 /* Set the "low speed time" */
707 CINIT(LOW_SPEED_TIME
, LONG
, 20),
709 /* Set the continuation offset.
711 * Note there is also a _LARGE version of this key which uses
712 * off_t types, allowing for large file offsets on platforms which
713 * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
715 CINIT(RESUME_FROM
, LONG
, 21),
717 /* Set cookie in request: */
718 CINIT(COOKIE
, OBJECTPOINT
, 22),
720 /* This points to a linked list of headers, struct curl_slist kind */
721 CINIT(HTTPHEADER
, OBJECTPOINT
, 23),
723 /* This points to a linked list of post entries, struct HttpPost */
724 CINIT(HTTPPOST
, OBJECTPOINT
, 24),
726 /* name of the file keeping your private SSL-certificate */
727 CINIT(SSLCERT
, OBJECTPOINT
, 25),
729 /* password for the SSL or SSH private key */
730 CINIT(KEYPASSWD
, OBJECTPOINT
, 26),
732 /* send TYPE parameter? */
733 CINIT(CRLF
, LONG
, 27),
735 /* send linked-list of QUOTE commands */
736 CINIT(QUOTE
, OBJECTPOINT
, 28),
738 /* send FILE * or void * to store headers to, if you use a callback it
739 is simply passed to the callback unmodified */
740 CINIT(WRITEHEADER
, OBJECTPOINT
, 29),
742 /* point to a file to read the initial cookies from, also enables
743 "cookie awareness" */
744 CINIT(COOKIEFILE
, OBJECTPOINT
, 31),
746 /* What version to specifly try to use.
747 See CURL_SSLVERSION defines below. */
748 CINIT(SSLVERSION
, LONG
, 32),
750 /* What kind of HTTP time condition to use, see defines */
751 CINIT(TIMECONDITION
, LONG
, 33),
753 /* Time to use with the above condition. Specified in number of seconds
755 CINIT(TIMEVALUE
, LONG
, 34),
759 /* Custom request, for customizing the get command like
760 HTTP: DELETE, TRACE and others
761 FTP: to use a different list command
763 CINIT(CUSTOMREQUEST
, OBJECTPOINT
, 36),
765 /* HTTP request, for odd commands like DELETE, TRACE and others */
766 CINIT(STDERR
, OBJECTPOINT
, 37),
770 /* send linked-list of post-transfer QUOTE commands */
771 CINIT(POSTQUOTE
, OBJECTPOINT
, 39),
773 /* Pass a pointer to string of the output using full variable-replacement
774 as described elsewhere. */
775 CINIT(WRITEINFO
, OBJECTPOINT
, 40),
777 CINIT(VERBOSE
, LONG
, 41), /* talk a lot */
778 CINIT(HEADER
, LONG
, 42), /* throw the header out too */
779 CINIT(NOPROGRESS
, LONG
, 43), /* shut off the progress meter */
780 CINIT(NOBODY
, LONG
, 44), /* use HEAD to get http document */
781 CINIT(FAILONERROR
, LONG
, 45), /* no output on http error codes >= 300 */
782 CINIT(UPLOAD
, LONG
, 46), /* this is an upload */
783 CINIT(POST
, LONG
, 47), /* HTTP POST method */
784 CINIT(DIRLISTONLY
, LONG
, 48), /* return bare names when listing directories */
786 CINIT(APPEND
, LONG
, 50), /* Append instead of overwrite on upload! */
788 /* Specify whether to read the user+password from the .netrc or the URL.
789 * This must be one of the CURL_NETRC_* enums below. */
790 CINIT(NETRC
, LONG
, 51),
792 CINIT(FOLLOWLOCATION
, LONG
, 52), /* use Location: Luke! */
794 CINIT(TRANSFERTEXT
, LONG
, 53), /* transfer data in text/ASCII format */
795 CINIT(PUT
, LONG
, 54), /* HTTP PUT */
799 /* Function that will be called instead of the internal progress display
800 * function. This function should be defined as the curl_progress_callback
801 * prototype defines. */
802 CINIT(PROGRESSFUNCTION
, FUNCTIONPOINT
, 56),
804 /* Data passed to the progress callback */
805 CINIT(PROGRESSDATA
, OBJECTPOINT
, 57),
807 /* We want the referer field set automatically when following locations */
808 CINIT(AUTOREFERER
, LONG
, 58),
810 /* Port of the proxy, can be set in the proxy string as well with:
812 CINIT(PROXYPORT
, LONG
, 59),
814 /* size of the POST input data, if strlen() is not good to use */
815 CINIT(POSTFIELDSIZE
, LONG
, 60),
817 /* tunnel non-http operations through a HTTP proxy */
818 CINIT(HTTPPROXYTUNNEL
, LONG
, 61),
820 /* Set the interface string to use as outgoing network interface */
821 CINIT(INTERFACE
, OBJECTPOINT
, 62),
823 /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
824 * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
825 * is set but doesn't match one of these, 'private' will be used. */
826 CINIT(KRBLEVEL
, OBJECTPOINT
, 63),
828 /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
829 CINIT(SSL_VERIFYPEER
, LONG
, 64),
831 /* The CApath or CAfile used to validate the peer certificate
832 this option is used only if SSL_VERIFYPEER is true */
833 CINIT(CAINFO
, OBJECTPOINT
, 65),
838 /* Maximum number of http redirects to follow */
839 CINIT(MAXREDIRS
, LONG
, 68),
841 /* Pass a long set to 1 to get the date of the requested document (if
842 possible)! Pass a zero to shut it off. */
843 CINIT(FILETIME
, LONG
, 69),
845 /* This points to a linked list of telnet options */
846 CINIT(TELNETOPTIONS
, OBJECTPOINT
, 70),
848 /* Max amount of cached alive connections */
849 CINIT(MAXCONNECTS
, LONG
, 71),
851 /* What policy to use when closing connections when the cache is filled
853 CINIT(CLOSEPOLICY
, LONG
, 72),
857 /* Set to explicitly use a new connection for the upcoming transfer.
858 Do not use this unless you're absolutely sure of this, as it makes the
859 operation slower and is less friendly for the network. */
860 CINIT(FRESH_CONNECT
, LONG
, 74),
862 /* Set to explicitly forbid the upcoming transfer's connection to be re-used
863 when done. Do not use this unless you're absolutely sure of this, as it
864 makes the operation slower and is less friendly for the network. */
865 CINIT(FORBID_REUSE
, LONG
, 75),
867 /* Set to a file name that contains random data for libcurl to use to
868 seed the random engine when doing SSL connects. */
869 CINIT(RANDOM_FILE
, OBJECTPOINT
, 76),
871 /* Set to the Entropy Gathering Daemon socket pathname */
872 CINIT(EGDSOCKET
, OBJECTPOINT
, 77),
874 /* Time-out connect operations after this amount of seconds, if connects
875 are OK within this time, then fine... This only aborts the connect
876 phase. [Only works on unix-style/SIGALRM operating systems] */
877 CINIT(CONNECTTIMEOUT
, LONG
, 78),
879 /* Function that will be called to store headers (instead of fwrite). The
880 * parameters will use fwrite() syntax, make sure to follow them. */
881 CINIT(HEADERFUNCTION
, FUNCTIONPOINT
, 79),
883 /* Set this to force the HTTP request to get back to GET. Only really usable
884 if POST, PUT or a custom request have been used first.
886 CINIT(HTTPGET
, LONG
, 80),
888 /* Set if we should verify the Common name from the peer certificate in ssl
889 * handshake, set 1 to check existence, 2 to ensure that it matches the
890 * provided hostname. */
891 CINIT(SSL_VERIFYHOST
, LONG
, 81),
893 /* Specify which file name to write all known cookies in after completed
894 operation. Set file name to "-" (dash) to make it go to stdout. */
895 CINIT(COOKIEJAR
, OBJECTPOINT
, 82),
897 /* Specify which SSL ciphers to use */
898 CINIT(SSL_CIPHER_LIST
, OBJECTPOINT
, 83),
900 /* Specify which HTTP version to use! This must be set to one of the
901 CURL_HTTP_VERSION* enums set below. */
902 CINIT(HTTP_VERSION
, LONG
, 84),
904 /* Specificly switch on or off the FTP engine's use of the EPSV command. By
905 default, that one will always be attempted before the more traditional
907 CINIT(FTP_USE_EPSV
, LONG
, 85),
909 /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
910 CINIT(SSLCERTTYPE
, OBJECTPOINT
, 86),
912 /* name of the file keeping your private SSL-key */
913 CINIT(SSLKEY
, OBJECTPOINT
, 87),
915 /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
916 CINIT(SSLKEYTYPE
, OBJECTPOINT
, 88),
918 /* crypto engine for the SSL-sub system */
919 CINIT(SSLENGINE
, OBJECTPOINT
, 89),
921 /* set the crypto engine for the SSL-sub system as default
922 the param has no meaning...
924 CINIT(SSLENGINE_DEFAULT
, LONG
, 90),
926 /* Non-zero value means to use the global dns cache */
927 CINIT(DNS_USE_GLOBAL_CACHE
, LONG
, 91), /* To become OBSOLETE soon */
929 /* DNS cache timeout */
930 CINIT(DNS_CACHE_TIMEOUT
, LONG
, 92),
932 /* send linked-list of pre-transfer QUOTE commands (Wesley Laxton)*/
933 CINIT(PREQUOTE
, OBJECTPOINT
, 93),
935 /* set the debug function */
936 CINIT(DEBUGFUNCTION
, FUNCTIONPOINT
, 94),
938 /* set the data for the debug function */
939 CINIT(DEBUGDATA
, OBJECTPOINT
, 95),
941 /* mark this as start of a cookie session */
942 CINIT(COOKIESESSION
, LONG
, 96),
944 /* The CApath directory used to validate the peer certificate
945 this option is used only if SSL_VERIFYPEER is true */
946 CINIT(CAPATH
, OBJECTPOINT
, 97),
948 /* Instruct libcurl to use a smaller receive buffer */
949 CINIT(BUFFERSIZE
, LONG
, 98),
951 /* Instruct libcurl to not use any signal/alarm handlers, even when using
952 timeouts. This option is useful for multi-threaded applications.
953 See libcurl-the-guide for more background information. */
954 CINIT(NOSIGNAL
, LONG
, 99),
956 /* Provide a CURLShare for mutexing non-ts data */
957 CINIT(SHARE
, OBJECTPOINT
, 100),
959 /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
960 CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */
961 CINIT(PROXYTYPE
, LONG
, 101),
963 /* Set the Accept-Encoding string. Use this to tell a server you would like
964 the response to be compressed. */
965 CINIT(ENCODING
, OBJECTPOINT
, 102),
967 /* Set pointer to private data */
968 CINIT(PRIVATE
, OBJECTPOINT
, 103),
970 /* Set aliases for HTTP 200 in the HTTP Response header */
971 CINIT(HTTP200ALIASES
, OBJECTPOINT
, 104),
973 /* Continue to send authentication (user+password) when following locations,
974 even when hostname changed. This can potentionally send off the name
975 and password to whatever host the server decides. */
976 CINIT(UNRESTRICTED_AUTH
, LONG
, 105),
978 /* Specificly switch on or off the FTP engine's use of the EPRT command ( it
979 also disables the LPRT attempt). By default, those ones will always be
980 attempted before the good old traditional PORT command. */
981 CINIT(FTP_USE_EPRT
, LONG
, 106),
983 /* Set this to a bitmask value to enable the particular authentications
984 methods you like. Use this in combination with CURLOPT_USERPWD.
985 Note that setting multiple bits may cause extra network round-trips. */
986 CINIT(HTTPAUTH
, LONG
, 107),
988 /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
989 in second argument. The function must be matching the
990 curl_ssl_ctx_callback proto. */
991 CINIT(SSL_CTX_FUNCTION
, FUNCTIONPOINT
, 108),
993 /* Set the userdata for the ssl context callback function's third
995 CINIT(SSL_CTX_DATA
, OBJECTPOINT
, 109),
997 /* FTP Option that causes missing dirs to be created on the remote server */
998 CINIT(FTP_CREATE_MISSING_DIRS
, LONG
, 110),
1000 /* Set this to a bitmask value to enable the particular authentications
1001 methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
1002 Note that setting multiple bits may cause extra network round-trips. */
1003 CINIT(PROXYAUTH
, LONG
, 111),
1005 /* FTP option that changes the timeout, in seconds, associated with
1006 getting a response. This is different from transfer timeout time and
1007 essentially places a demand on the FTP server to acknowledge commands
1008 in a timely manner. */
1009 CINIT(FTP_RESPONSE_TIMEOUT
, LONG
, 112),
1011 /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
1012 tell libcurl to resolve names to those IP versions only. This only has
1013 affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
1014 CINIT(IPRESOLVE
, LONG
, 113),
1016 /* Set this option to limit the size of a file that will be downloaded from
1017 an HTTP or FTP server.
1019 Note there is also _LARGE version which adds large file support for
1020 platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
1021 CINIT(MAXFILESIZE
, LONG
, 114),
1023 /* See the comment for INFILESIZE above, but in short, specifies
1024 * the size of the file being uploaded. -1 means unknown.
1026 CINIT(INFILESIZE_LARGE
, OFF_T
, 115),
1028 /* Sets the continuation offset. There is also a LONG version of this;
1029 * look above for RESUME_FROM.
1031 CINIT(RESUME_FROM_LARGE
, OFF_T
, 116),
1033 /* Sets the maximum size of data that will be downloaded from
1034 * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
1036 CINIT(MAXFILESIZE_LARGE
, OFF_T
, 117),
1038 /* Set this option to the file name of your .netrc file you want libcurl
1039 to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
1040 a poor attempt to find the user's home directory and check for a .netrc
1042 CINIT(NETRC_FILE
, OBJECTPOINT
, 118),
1044 /* Enable SSL/TLS for FTP, pick one of:
1045 CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
1046 CURLFTPSSL_CONTROL - SSL for the control connection or fail
1047 CURLFTPSSL_ALL - SSL for all communication or fail
1049 CINIT(USE_SSL
, LONG
, 119),
1051 /* The _LARGE version of the standard POSTFIELDSIZE option */
1052 CINIT(POSTFIELDSIZE_LARGE
, OFF_T
, 120),
1054 /* Enable/disable the TCP Nagle algorithm */
1055 CINIT(TCP_NODELAY
, LONG
, 121),
1057 /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1058 /* 123 OBSOLETE. Gone in 7.16.0 */
1059 /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1060 /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1061 /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
1062 /* 127 OBSOLETE. Gone in 7.16.0 */
1063 /* 128 OBSOLETE. Gone in 7.16.0 */
1065 /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
1066 can be used to change libcurl's default action which is to first try
1067 "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
1068 response has been received.
1070 Available parameters are:
1071 CURLFTPAUTH_DEFAULT - let libcurl decide
1072 CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
1073 CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
1075 CINIT(FTPSSLAUTH
, LONG
, 129),
1077 CINIT(IOCTLFUNCTION
, FUNCTIONPOINT
, 130),
1078 CINIT(IOCTLDATA
, OBJECTPOINT
, 131),
1080 /* 132 OBSOLETE. Gone in 7.16.0 */
1081 /* 133 OBSOLETE. Gone in 7.16.0 */
1083 /* zero terminated string for pass on to the FTP server when asked for
1085 CINIT(FTP_ACCOUNT
, OBJECTPOINT
, 134),
1087 /* feed cookies into cookie engine */
1088 CINIT(COOKIELIST
, OBJECTPOINT
, 135),
1090 /* ignore Content-Length */
1091 CINIT(IGNORE_CONTENT_LENGTH
, LONG
, 136),
1093 /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
1094 response. Typically used for FTP-SSL purposes but is not restricted to
1095 that. libcurl will then instead use the same IP address it used for the
1096 control connection. */
1097 CINIT(FTP_SKIP_PASV_IP
, LONG
, 137),
1099 /* Select "file method" to use when doing FTP, see the curl_ftpmethod
1101 CINIT(FTP_FILEMETHOD
, LONG
, 138),
1103 /* Local port number to bind the socket to */
1104 CINIT(LOCALPORT
, LONG
, 139),
1106 /* Number of ports to try, including the first one set with LOCALPORT.
1107 Thus, setting it to 1 will make no additional attempts but the first.
1109 CINIT(LOCALPORTRANGE
, LONG
, 140),
1111 /* no transfer, set up connection and let application use the socket by
1112 extracting it with CURLINFO_LASTSOCKET */
1113 CINIT(CONNECT_ONLY
, LONG
, 141),
1115 /* Function that will be called to convert from the
1116 network encoding (instead of using the iconv calls in libcurl) */
1117 CINIT(CONV_FROM_NETWORK_FUNCTION
, FUNCTIONPOINT
, 142),
1119 /* Function that will be called to convert to the
1120 network encoding (instead of using the iconv calls in libcurl) */
1121 CINIT(CONV_TO_NETWORK_FUNCTION
, FUNCTIONPOINT
, 143),
1123 /* Function that will be called to convert from UTF8
1124 (instead of using the iconv calls in libcurl)
1125 Note that this is used only for SSL certificate processing */
1126 CINIT(CONV_FROM_UTF8_FUNCTION
, FUNCTIONPOINT
, 144),
1128 /* if the connection proceeds too quickly then need to slow it down */
1129 /* limit-rate: maximum number of bytes per second to send or receive */
1130 CINIT(MAX_SEND_SPEED_LARGE
, OFF_T
, 145),
1131 CINIT(MAX_RECV_SPEED_LARGE
, OFF_T
, 146),
1133 /* Pointer to command string to send if USER/PASS fails. */
1134 CINIT(FTP_ALTERNATIVE_TO_USER
, OBJECTPOINT
, 147),
1136 /* callback function for setting socket options */
1137 CINIT(SOCKOPTFUNCTION
, FUNCTIONPOINT
, 148),
1138 CINIT(SOCKOPTDATA
, OBJECTPOINT
, 149),
1140 /* set to 0 to disable session ID re-use for this transfer, default is
1142 CINIT(SSL_SESSIONID_CACHE
, LONG
, 150),
1144 /* allowed SSH authentication methods */
1145 CINIT(SSH_AUTH_TYPES
, LONG
, 151),
1147 /* Used by scp/sftp to do public/private key authentication */
1148 CINIT(SSH_PUBLIC_KEYFILE
, OBJECTPOINT
, 152),
1149 CINIT(SSH_PRIVATE_KEYFILE
, OBJECTPOINT
, 153),
1151 /* Send CCC (Clear Command Channel) after authentication */
1152 CINIT(FTP_SSL_CCC
, LONG
, 154),
1154 /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
1155 CINIT(TIMEOUT_MS
, LONG
, 155),
1156 CINIT(CONNECTTIMEOUT_MS
, LONG
, 156),
1158 /* set to zero to disable the libcurl's decoding and thus pass the raw body
1159 data to the appliction even when it is encoded/compressed */
1160 CINIT(HTTP_TRANSFER_DECODING
, LONG
, 157),
1161 CINIT(HTTP_CONTENT_DECODING
, LONG
, 158),
1163 /* Permission used when creating new files and directories on the remote
1164 server for protocols that support it, SFTP/SCP/FILE */
1165 CINIT(NEW_FILE_PERMS
, LONG
, 159),
1166 CINIT(NEW_DIRECTORY_PERMS
, LONG
, 160),
1168 /* Obey RFC 2616/10.3.2 and keep POSTs as POSTs after a 301 */
1169 CINIT(POST301
, LONG
, 161),
1171 /* used by scp/sftp to verify the host's public key */
1172 CINIT(SSH_HOST_PUBLIC_KEY_MD5
, OBJECTPOINT
, 162),
1174 /* Callback function for opening socket (instead of socket(2)). Optionally,
1175 callback is able change the address or refuse to connect returning
1176 CURL_SOCKET_BAD. The callback should have type
1177 curl_opensocket_callback */
1178 CINIT(OPENSOCKETFUNCTION
, FUNCTIONPOINT
, 163),
1179 CINIT(OPENSOCKETDATA
, OBJECTPOINT
, 164),
1181 /* POST volatile input fields. */
1182 CINIT(COPYPOSTFIELDS
, OBJECTPOINT
, 165),
1184 /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
1185 CINIT(PROXY_TRANSFER_MODE
, LONG
, 166),
1187 /* Callback function for seeking in the input stream */
1188 CINIT(SEEKFUNCTION
, FUNCTIONPOINT
, 167),
1189 CINIT(SEEKDATA
, OBJECTPOINT
, 168),
1191 CURLOPT_LASTENTRY
/* the last unused */
1194 #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
1195 the obsolete stuff removed! */
1197 /* Backwards compatibility with older names */
1198 /* These are scheduled to disappear by 2009 */
1200 /* The following were added in 7.17.0 */
1201 #define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD
1202 #define CURLOPT_FTPAPPEND CURLOPT_APPEND
1203 #define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY
1204 #define CURLOPT_FTP_SSL CURLOPT_USE_SSL
1206 /* The following were added earlier */
1208 #define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
1209 #define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
1212 /* This is set if CURL_NO_OLDIES is defined at compile-time */
1213 #undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
1217 /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
1218 name resolves addresses using more than one IP protocol version, this
1219 option might be handy to force libcurl to use a specific IP version. */
1220 #define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP
1221 versions that your system allows */
1222 #define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */
1223 #define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */
1225 /* three convenient "aliases" that follow the name scheme better */
1226 #define CURLOPT_WRITEDATA CURLOPT_FILE
1227 #define CURLOPT_READDATA CURLOPT_INFILE
1228 #define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER
1230 /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
1232 CURL_HTTP_VERSION_NONE
, /* setting this means we don't care, and that we'd
1233 like the library to choose the best possible
1235 CURL_HTTP_VERSION_1_0
, /* please use HTTP 1.0 in the request */
1236 CURL_HTTP_VERSION_1_1
, /* please use HTTP 1.1 in the request */
1238 CURL_HTTP_VERSION_LAST
/* *ILLEGAL* http version */
1241 /* These enums are for use with the CURLOPT_NETRC option. */
1242 enum CURL_NETRC_OPTION
{
1243 CURL_NETRC_IGNORED
, /* The .netrc will never be read.
1244 * This is the default. */
1245 CURL_NETRC_OPTIONAL
, /* A user:password in the URL will be preferred
1246 * to one in the .netrc. */
1247 CURL_NETRC_REQUIRED
, /* A user:password in the URL will be ignored.
1248 * Unless one is set programmatically, the .netrc
1249 * will be queried. */
1254 CURL_SSLVERSION_DEFAULT
,
1255 CURL_SSLVERSION_TLSv1
,
1256 CURL_SSLVERSION_SSLv2
,
1257 CURL_SSLVERSION_SSLv3
,
1259 CURL_SSLVERSION_LAST
/* never use, keep last */
1266 CURL_TIMECOND_IFMODSINCE
,
1267 CURL_TIMECOND_IFUNMODSINCE
,
1268 CURL_TIMECOND_LASTMOD
,
1274 /* curl_strequal() and curl_strnequal() are subject for removal in a future
1275 libcurl, see lib/README.curlx for details */
1276 CURL_EXTERN
int (curl_strequal
)(const char *s1
, const char *s2
);
1277 CURL_EXTERN
int (curl_strnequal
)(const char *s1
, const char *s2
, size_t n
);
1279 /* name is uppercase CURLFORM_<name> */
1285 #define CFINIT(name) CURLFORM_ ## name
1287 /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
1288 #define CFINIT(name) CURLFORM_/**/name
1292 CFINIT(NOTHING
), /********* the first one is unused ************/
1298 CFINIT(COPYCONTENTS
),
1299 CFINIT(PTRCONTENTS
),
1300 CFINIT(CONTENTSLENGTH
),
1301 CFINIT(FILECONTENT
),
1308 CFINIT(BUFFERLENGTH
),
1310 CFINIT(CONTENTTYPE
),
1311 CFINIT(CONTENTHEADER
),
1316 CURLFORM_LASTENTRY
/* the last unusued */
1319 #undef CFINIT /* done */
1321 /* structure to be used as parameter for CURLFORM_ARRAY */
1323 CURLformoption option
;
1327 /* use this for multipart formpost building */
1328 /* Returns code for curl_formadd()
1331 * CURL_FORMADD_OK on success
1332 * CURL_FORMADD_MEMORY if the FormInfo allocation fails
1333 * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form
1334 * CURL_FORMADD_NULL if a null pointer was given for a char
1335 * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed
1336 * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used
1337 * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error)
1338 * CURL_FORMADD_MEMORY if a HttpPost struct cannot be allocated
1339 * CURL_FORMADD_MEMORY if some allocation for string copying failed.
1340 * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array
1342 ***************************************************************************/
1344 CURL_FORMADD_OK
, /* first, no error */
1346 CURL_FORMADD_MEMORY
,
1347 CURL_FORMADD_OPTION_TWICE
,
1349 CURL_FORMADD_UNKNOWN_OPTION
,
1350 CURL_FORMADD_INCOMPLETE
,
1351 CURL_FORMADD_ILLEGAL_ARRAY
,
1352 CURL_FORMADD_DISABLED
, /* libcurl was built with this disabled */
1354 CURL_FORMADD_LAST
/* last */
1358 * NAME curl_formadd()
1362 * Pretty advanved function for building multi-part formposts. Each invoke
1363 * adds one part that together construct a full post. Then use
1364 * CURLOPT_HTTPPOST to send it off to libcurl.
1366 CURL_EXTERN CURLFORMcode
curl_formadd(struct curl_httppost
**httppost
,
1367 struct curl_httppost
**last_post
,
1371 * callback function for curl_formget()
1372 * The void *arg pointer will be the one passed as second argument to curl_formget().
1373 * The character buffer passed to it must not be freed.
1374 * Should return the buffer length passed to it as the argument "len" on success.
1376 typedef size_t (*curl_formget_callback
)(void *arg
, const char *buf
, size_t len
);
1379 * NAME curl_formget()
1383 * Serialize a curl_httppost struct built with curl_formadd().
1384 * Accepts a void pointer as second argument which will be passed to
1385 * the curl_formget_callback function.
1386 * Returns 0 on success.
1388 CURL_EXTERN
int curl_formget(struct curl_httppost
*form
, void *arg
,
1389 curl_formget_callback append
);
1391 * NAME curl_formfree()
1395 * Free a multipart formpost previously built with curl_formadd().
1397 CURL_EXTERN
void curl_formfree(struct curl_httppost
*form
);
1400 * NAME curl_getenv()
1404 * Returns a malloc()'ed string that MUST be curl_free()ed after usage is
1405 * complete. DEPRECATED - see lib/README.curlx
1407 CURL_EXTERN
char *curl_getenv(const char *variable
);
1410 * NAME curl_version()
1414 * Returns a static ascii string of the libcurl version.
1416 CURL_EXTERN
char *curl_version(void);
1419 * NAME curl_easy_escape()
1423 * Escapes URL strings (converts all letters consider illegal in URLs to their
1424 * %XX versions). This function returns a new allocated string or NULL if an
1427 CURL_EXTERN
char *curl_easy_escape(CURL
*handle
,
1431 /* the previous version: */
1432 CURL_EXTERN
char *curl_escape(const char *string
,
1437 * NAME curl_easy_unescape()
1441 * Unescapes URL encoding in strings (converts all %XX codes to their 8bit
1442 * versions). This function returns a new allocated string or NULL if an error
1444 * Conversion Note: On non-ASCII platforms the ASCII %XX codes are
1445 * converted into the host encoding.
1447 CURL_EXTERN
char *curl_easy_unescape(CURL
*handle
,
1452 /* the previous version */
1453 CURL_EXTERN
char *curl_unescape(const char *string
,
1461 * Provided for de-allocation in the same translation unit that did the
1462 * allocation. Added in libcurl 7.10
1464 CURL_EXTERN
void curl_free(void *p
);
1467 * NAME curl_global_init()
1471 * curl_global_init() should be invoked exactly once for each application that
1474 CURL_EXTERN CURLcode
curl_global_init(long flags
);
1477 * NAME curl_global_init_mem()
1481 * curl_global_init() or curl_global_init_mem() should be invoked exactly once
1482 * for each application that uses libcurl. This function can be used to
1483 * initialize libcurl and set user defined memory management callback
1484 * functions. Users can implement memory management routines to check for
1485 * memory leaks, check for mis-use of the curl library etc. User registered
1486 * callback routines with be invoked by this library instead of the system
1487 * memory management routines like malloc, free etc.
1489 CURL_EXTERN CURLcode
curl_global_init_mem(long flags
,
1490 curl_malloc_callback m
,
1491 curl_free_callback f
,
1492 curl_realloc_callback r
,
1493 curl_strdup_callback s
,
1494 curl_calloc_callback c
);
1497 * NAME curl_global_cleanup()
1501 * curl_global_cleanup() should be invoked exactly once for each application
1504 CURL_EXTERN
void curl_global_cleanup(void);
1506 /* linked-list structure for the CURLOPT_QUOTE option (and other) */
1509 struct curl_slist
*next
;
1513 * NAME curl_slist_append()
1517 * Appends a string to a linked list. If no list exists, it will be created
1518 * first. Returns the new list, after appending.
1520 CURL_EXTERN
struct curl_slist
*curl_slist_append(struct curl_slist
*,
1524 * NAME curl_slist_free_all()
1528 * free a previously built curl_slist.
1530 CURL_EXTERN
void curl_slist_free_all(struct curl_slist
*);
1533 * NAME curl_getdate()
1537 * Returns the time, in seconds since 1 Jan 1970 of the time string given in
1538 * the first argument. The time argument in the second parameter is unused
1539 * and should be set to NULL.
1541 CURL_EXTERN
time_t curl_getdate(const char *p
, const time_t *unused
);
1543 #define CURLINFO_STRING 0x100000
1544 #define CURLINFO_LONG 0x200000
1545 #define CURLINFO_DOUBLE 0x300000
1546 #define CURLINFO_SLIST 0x400000
1547 #define CURLINFO_MASK 0x0fffff
1548 #define CURLINFO_TYPEMASK 0xf00000
1551 CURLINFO_NONE
, /* first, never use this */
1552 CURLINFO_EFFECTIVE_URL
= CURLINFO_STRING
+ 1,
1553 CURLINFO_RESPONSE_CODE
= CURLINFO_LONG
+ 2,
1554 CURLINFO_TOTAL_TIME
= CURLINFO_DOUBLE
+ 3,
1555 CURLINFO_NAMELOOKUP_TIME
= CURLINFO_DOUBLE
+ 4,
1556 CURLINFO_CONNECT_TIME
= CURLINFO_DOUBLE
+ 5,
1557 CURLINFO_PRETRANSFER_TIME
= CURLINFO_DOUBLE
+ 6,
1558 CURLINFO_SIZE_UPLOAD
= CURLINFO_DOUBLE
+ 7,
1559 CURLINFO_SIZE_DOWNLOAD
= CURLINFO_DOUBLE
+ 8,
1560 CURLINFO_SPEED_DOWNLOAD
= CURLINFO_DOUBLE
+ 9,
1561 CURLINFO_SPEED_UPLOAD
= CURLINFO_DOUBLE
+ 10,
1562 CURLINFO_HEADER_SIZE
= CURLINFO_LONG
+ 11,
1563 CURLINFO_REQUEST_SIZE
= CURLINFO_LONG
+ 12,
1564 CURLINFO_SSL_VERIFYRESULT
= CURLINFO_LONG
+ 13,
1565 CURLINFO_FILETIME
= CURLINFO_LONG
+ 14,
1566 CURLINFO_CONTENT_LENGTH_DOWNLOAD
= CURLINFO_DOUBLE
+ 15,
1567 CURLINFO_CONTENT_LENGTH_UPLOAD
= CURLINFO_DOUBLE
+ 16,
1568 CURLINFO_STARTTRANSFER_TIME
= CURLINFO_DOUBLE
+ 17,
1569 CURLINFO_CONTENT_TYPE
= CURLINFO_STRING
+ 18,
1570 CURLINFO_REDIRECT_TIME
= CURLINFO_DOUBLE
+ 19,
1571 CURLINFO_REDIRECT_COUNT
= CURLINFO_LONG
+ 20,
1572 CURLINFO_PRIVATE
= CURLINFO_STRING
+ 21,
1573 CURLINFO_HTTP_CONNECTCODE
= CURLINFO_LONG
+ 22,
1574 CURLINFO_HTTPAUTH_AVAIL
= CURLINFO_LONG
+ 23,
1575 CURLINFO_PROXYAUTH_AVAIL
= CURLINFO_LONG
+ 24,
1576 CURLINFO_OS_ERRNO
= CURLINFO_LONG
+ 25,
1577 CURLINFO_NUM_CONNECTS
= CURLINFO_LONG
+ 26,
1578 CURLINFO_SSL_ENGINES
= CURLINFO_SLIST
+ 27,
1579 CURLINFO_COOKIELIST
= CURLINFO_SLIST
+ 28,
1580 CURLINFO_LASTSOCKET
= CURLINFO_LONG
+ 29,
1581 CURLINFO_FTP_ENTRY_PATH
= CURLINFO_STRING
+ 30,
1582 /* Fill in new entries below here! */
1584 CURLINFO_LASTONE
= 30
1587 /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
1588 CURLINFO_HTTP_CODE */
1589 #define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
1592 CURLCLOSEPOLICY_NONE
, /* first, never use this */
1594 CURLCLOSEPOLICY_OLDEST
,
1595 CURLCLOSEPOLICY_LEAST_RECENTLY_USED
,
1596 CURLCLOSEPOLICY_LEAST_TRAFFIC
,
1597 CURLCLOSEPOLICY_SLOWEST
,
1598 CURLCLOSEPOLICY_CALLBACK
,
1600 CURLCLOSEPOLICY_LAST
/* last, never use this */
1603 #define CURL_GLOBAL_SSL (1<<0)
1604 #define CURL_GLOBAL_WIN32 (1<<1)
1605 #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
1606 #define CURL_GLOBAL_NOTHING 0
1607 #define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
1610 /*****************************************************************************
1611 * Setup defines, protos etc for the sharing stuff.
1614 /* Different data locks for a single share */
1616 CURL_LOCK_DATA_NONE
= 0,
1617 /* CURL_LOCK_DATA_SHARE is used internaly to say that
1618 * the locking is just made to change the internal state of the share
1621 CURL_LOCK_DATA_SHARE
,
1622 CURL_LOCK_DATA_COOKIE
,
1624 CURL_LOCK_DATA_SSL_SESSION
,
1625 CURL_LOCK_DATA_CONNECT
,
1629 /* Different lock access types */
1631 CURL_LOCK_ACCESS_NONE
= 0, /* unspecified action */
1632 CURL_LOCK_ACCESS_SHARED
= 1, /* for read perhaps */
1633 CURL_LOCK_ACCESS_SINGLE
= 2, /* for write perhaps */
1634 CURL_LOCK_ACCESS_LAST
/* never use */
1637 typedef void (*curl_lock_function
)(CURL
*handle
,
1638 curl_lock_data data
,
1639 curl_lock_access locktype
,
1641 typedef void (*curl_unlock_function
)(CURL
*handle
,
1642 curl_lock_data data
,
1645 typedef void CURLSH
;
1648 CURLSHE_OK
, /* all is fine */
1649 CURLSHE_BAD_OPTION
, /* 1 */
1650 CURLSHE_IN_USE
, /* 2 */
1651 CURLSHE_INVALID
, /* 3 */
1652 CURLSHE_NOMEM
, /* out of memory */
1653 CURLSHE_LAST
/* never use */
1657 CURLSHOPT_NONE
, /* don't use */
1658 CURLSHOPT_SHARE
, /* specify a data type to share */
1659 CURLSHOPT_UNSHARE
, /* specify shich data type to stop sharing */
1660 CURLSHOPT_LOCKFUNC
, /* pass in a 'curl_lock_function' pointer */
1661 CURLSHOPT_UNLOCKFUNC
, /* pass in a 'curl_unlock_function' pointer */
1662 CURLSHOPT_USERDATA
, /* pass in a user data pointer used in the lock/unlock
1663 callback functions */
1664 CURLSHOPT_LAST
/* never use */
1667 CURL_EXTERN CURLSH
*curl_share_init(void);
1668 CURL_EXTERN CURLSHcode
curl_share_setopt(CURLSH
*, CURLSHoption option
, ...);
1669 CURL_EXTERN CURLSHcode
curl_share_cleanup(CURLSH
*);
1671 /****************************************************************************
1672 * Structures for querying information about the curl library at runtime.
1680 CURLVERSION_LAST
/* never actually use this */
1683 /* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
1684 basicly all programs ever, that want to get version information. It is
1685 meant to be a built-in version number for what kind of struct the caller
1686 expects. If the struct ever changes, we redefine the NOW to another enum
1688 #define CURLVERSION_NOW CURLVERSION_FOURTH
1691 CURLversion age
; /* age of the returned struct */
1692 const char *version
; /* LIBCURL_VERSION */
1693 unsigned int version_num
; /* LIBCURL_VERSION_NUM */
1694 const char *host
; /* OS/host/cpu/machine when configured */
1695 int features
; /* bitmask, see defines below */
1696 const char *ssl_version
; /* human readable string */
1697 long ssl_version_num
; /* not used anymore, always 0 */
1698 const char *libz_version
; /* human readable string */
1699 /* protocols is terminated by an entry with a NULL protoname */
1700 const char * const *protocols
;
1702 /* The fields below this were added in CURLVERSION_SECOND */
1706 /* This field was added in CURLVERSION_THIRD */
1709 /* These field were added in CURLVERSION_FOURTH */
1711 /* Same as '_libiconv_version' if built with HAVE_ICONV */
1714 const char *libssh_version
; /* human readable string */
1716 } curl_version_info_data
;
1718 #define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */
1719 #define CURL_VERSION_KERBEROS4 (1<<1) /* kerberos auth is supported */
1720 #define CURL_VERSION_SSL (1<<2) /* SSL options are present */
1721 #define CURL_VERSION_LIBZ (1<<3) /* libz features are present */
1722 #define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */
1723 #define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */
1724 #define CURL_VERSION_DEBUG (1<<6) /* built with debug capabilities */
1725 #define CURL_VERSION_ASYNCHDNS (1<<7) /* asynchronous dns resolves */
1726 #define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth */
1727 #define CURL_VERSION_LARGEFILE (1<<9) /* supports files bigger than 2GB */
1728 #define CURL_VERSION_IDN (1<<10) /* International Domain Names support */
1729 #define CURL_VERSION_SSPI (1<<11) /* SSPI is supported */
1730 #define CURL_VERSION_CONV (1<<12) /* character conversions are
1734 * NAME curl_version_info()
1738 * This function returns a pointer to a static copy of the version info
1739 * struct. See above.
1741 CURL_EXTERN curl_version_info_data
*curl_version_info(CURLversion
);
1744 * NAME curl_easy_strerror()
1748 * The curl_easy_strerror function may be used to turn a CURLcode value
1749 * into the equivalent human readable error string. This is useful
1750 * for printing meaningful error messages.
1752 CURL_EXTERN
const char *curl_easy_strerror(CURLcode
);
1755 * NAME curl_share_strerror()
1759 * The curl_share_strerror function may be used to turn a CURLSHcode value
1760 * into the equivalent human readable error string. This is useful
1761 * for printing meaningful error messages.
1763 CURL_EXTERN
const char *curl_share_strerror(CURLSHcode
);
1766 * NAME curl_easy_pause()
1770 * The curl_easy_pause function pauses or unpauses transfers. Select the new
1771 * state by setting the bitmask, use the convenience defines below.
1774 CURL_EXTERN CURLcode
curl_easy_pause(CURL
*handle
, int bitmask
);
1776 #define CURLPAUSE_RECV (1<<0)
1777 #define CURLPAUSE_RECV_CONT (0)
1779 #define CURLPAUSE_SEND (1<<2)
1780 #define CURLPAUSE_SEND_CONT (0)
1782 #define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND)
1783 #define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)
1789 /* unfortunately, the easy.h and multi.h include files need options and info
1790 stuff before they can be included! */
1791 #include "easy.h" /* nothing in curl is fun without the easy stuff */
1794 /* the typechecker doesn't work in C++ (yet) */
1795 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
1796 !defined(__cplusplus)
1797 #include "typecheck-gcc.h"
1799 #if defined(__STDC__) && (__STDC__ >= 1)
1800 /* This preprocessor magic that replaces a call with the exact same call is
1801 only done to make sure application authors pass exactly three arguments
1802 to these functions. */
1803 #define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
1804 #define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)
1805 #define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
1806 #define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
1807 #endif /* __STDC__ >= 1 */
1808 #endif /* gcc >= 4.3 && !__cplusplus */
1810 #endif /* __CURL_CURL_H */