📄 curl.h
字号:
/* Instruct libcurl to use a smaller receive buffer */ CINIT(BUFFERSIZE, LONG, 98), /* Instruct libcurl to not use any signal/alarm handlers, even when using timeouts. This option is useful for multi-threaded applications. See libcurl-the-guide for more background information. */ CINIT(NOSIGNAL, LONG, 99), /* Provide a CURLShare for mutexing non-ts data */ CINIT(SHARE, OBJECTPOINT, 100), /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), CURLPROXY_SOCKS4 and CURLPROXY_SOCKS5. */ CINIT(PROXYTYPE, LONG, 101), /* Set the Accept-Encoding string. Use this to tell a server you would like the response to be compressed. */ CINIT(ENCODING, OBJECTPOINT, 102), /* Set pointer to private data */ CINIT(PRIVATE, OBJECTPOINT, 103), /* Set aliases for HTTP 200 in the HTTP Response header */ CINIT(HTTP200ALIASES, OBJECTPOINT, 104), /* Continue to send authentication (user+password) when following locations, even when hostname changed. This can potentionally send off the name and password to whatever host the server decides. */ CINIT(UNRESTRICTED_AUTH, LONG, 105), /* Specificly switch on or off the FTP engine's use of the EPRT command ( it also disables the LPRT attempt). By default, those ones will always be attempted before the good old traditional PORT command. */ CINIT(FTP_USE_EPRT, LONG, 106), /* Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_USERPWD. Note that setting multiple bits may cause extra network round-trips. */ CINIT(HTTPAUTH, LONG, 107), /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx in second argument. The function must be matching the curl_ssl_ctx_callback proto. */ CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108), /* Set the userdata for the ssl context callback function's third argument */ CINIT(SSL_CTX_DATA, OBJECTPOINT, 109), /* FTP Option that causes missing dirs to be created on the remote server */ CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110), /* Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. Note that setting multiple bits may cause extra network round-trips. */ CINIT(PROXYAUTH, LONG, 111), /* FTP option that changes the timeout, in seconds, associated with getting a response. This is different from transfer timeout time and essentially places a demand on the FTP server to acknowledge commands in a timely manner. */ CINIT(FTP_RESPONSE_TIMEOUT, LONG , 112), /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to tell libcurl to resolve names to those IP versions only. This only has affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */ CINIT(IPRESOLVE, LONG, 113), /* Set this option to limit the size of a file that will be downloaded from an HTTP or FTP server. Note there is also _LARGE version which adds large file support for platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */ CINIT(MAXFILESIZE, LONG, 114), /* See the comment for INFILESIZE above, but in short, specifies * the size of the file being uploaded. -1 means unknown. */ CINIT(INFILESIZE_LARGE, OFF_T, 115), /* Sets the continuation offset. There is also a LONG version of this; * look above for RESUME_FROM. */ CINIT(RESUME_FROM_LARGE, OFF_T, 116), /* Sets the maximum size of data that will be downloaded from * an HTTP or FTP server. See MAXFILESIZE above for the LONG version. */ CINIT(MAXFILESIZE_LARGE, OFF_T, 117), /* Set this option to the file name of your .netrc file you want libcurl to parse (using the CURLOPT_NETRC option). If not set, libcurl will do a poor attempt to find the user's home directory and check for a .netrc file in there. */ CINIT(NETRC_FILE, OBJECTPOINT, 118), /* Enable SSL/TLS for FTP, pick one of: CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise CURLFTPSSL_CONTROL - SSL for the control connection or fail CURLFTPSSL_ALL - SSL for all communication or fail */ CINIT(FTP_SSL, LONG, 119), /* The _LARGE version of the standard POSTFIELDSIZE option */ CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120), /* Enable/disable the TCP Nagle algorithm */ CINIT(TCP_NODELAY, LONG, 121), /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* When doing 3rd party transfer, set the source user and password with this */ CINIT(SOURCE_USERPWD, OBJECTPOINT, 123), /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* When doing 3rd party transfer, set the source pre-quote linked list of commands with this */ CINIT(SOURCE_PREQUOTE, OBJECTPOINT, 127), /* When doing 3rd party transfer, set the source post-quote linked list of commands with this */ CINIT(SOURCE_POSTQUOTE, OBJECTPOINT, 128), /* When FTP over SSL/TLS is selected (with CURLOPT_FTP_SSL), this option can be used to change libcurl's default action which is to first try "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK response has been received. Available parameters are: CURLFTPAUTH_DEFAULT - let libcurl decide CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL */ CINIT(FTPSSLAUTH, LONG, 129), CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130), CINIT(IOCTLDATA, OBJECTPOINT, 131), /* To make a 3rd party transfer, set the source URL with this */ CINIT(SOURCE_URL, OBJECTPOINT, 132), /* When doing 3rd party transfer, set the source quote linked list of commands with this */ CINIT(SOURCE_QUOTE, OBJECTPOINT, 133), /* zero terminated string for pass on to the FTP server when asked for "account" info */ CINIT(FTP_ACCOUNT, OBJECTPOINT, 134), /* feed cookies into cookie engine */ CINIT(COOKIELIST, OBJECTPOINT, 135), /* ignore Content-Length */ CINIT(IGNORE_CONTENT_LENGTH, LONG, 136), /* Set to non-zero to skip the IP address received in a 227 PASV FTP server response. Typically used for FTP-SSL purposes but is not restricted to that. libcurl will then instead use the same IP address it used for the control connection. */ CINIT(FTP_SKIP_PASV_IP, LONG, 137), /* Select "file method" to use when doing FTP, see the curl_ftpmethod above. */ CINIT(FTP_FILEMETHOD, LONG, 138), /* Local port number to bind the socket to */ CINIT(LOCALPORT, LONG, 139), /* Number of ports to try, including the first one set with LOCALPORT. Thus, setting it to 1 will make no additional attempts but the first. */ CINIT(LOCALPORTRANGE, LONG, 140), /* no transfer, set up connection and let application use the socket by extracting it with CURLINFO_LASTSOCKET */ CINIT(CONNECT_ONLY, LONG, 141), /* Function that will be called to convert from the network encoding (instead of using the iconv calls in libcurl) */ CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142), /* Function that will be called to convert to the network encoding (instead of using the iconv calls in libcurl) */ CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143), /* Function that will be called to convert from UTF8 (instead of using the iconv calls in libcurl) Note that this is used only for SSL certificate processing */ CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144), /* if the connection proceeds too quickly then need to slow it down */ /* limit-rate: maximum number of bytes per second to send or receive */ CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145), CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146), /* Pointer to command string to send if USER/PASS fails. */ CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147), CURLOPT_LASTENTRY /* the last unused */} CURLoption; /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host name resolves addresses using more than one IP protocol version, this option might be handy to force libcurl to use a specific IP version. */#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP versions that your system allows */#define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */#define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */ /* three convenient "aliases" that follow the name scheme better */#define CURLOPT_WRITEDATA CURLOPT_FILE#define CURLOPT_READDATA CURLOPT_INFILE#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all the obsolete stuff removed! */#define CURLOPT_HTTPREQUEST -1#define CURLOPT_FTPASCII CURLOPT_TRANSFERTEXT#define CURLOPT_MUTE -2#define CURLOPT_PASSWDFUNCTION -3#define CURLOPT_PASSWDDATA -4#define CURLOPT_CLOSEFUNCTION -5#define CURLOPT_SOURCE_HOST -6#define CURLOPT_SOURCE_PATH -7#define CURLOPT_SOURCE_PORT -8#define CURLOPT_PASV_HOST -9#else/* This is set if CURL_NO_OLDIES is defined at compile-time */#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */#endif /* These enums are for use with the CURLOPT_HTTP_VERSION option. */enum { CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd like the library to choose the best possible for us! */ CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */}; /* These enums are for use with the CURLOPT_NETRC option. */enum CURL_NETRC_OPTION { CURL_NETRC_IGNORED, /* The .netrc will never be read. * This is the default. */ CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred * to one in the .netrc. */ CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored. * Unless one is set programmatically, the .netrc * will be queried. */ CURL_NETRC_LAST};enum { CURL_SSLVERSION_DEFAULT, CURL_SSLVERSION_TLSv1, CURL_SSLVERSION_SSLv2, CURL_SSLVERSION_SSLv3, CURL_SSLVERSION_LAST /* never use, keep last */};typedef enum { CURL_TIMECOND_NONE, CURL_TIMECOND_IFMODSINCE, CURL_TIMECOND_IFUNMODSINCE, CURL_TIMECOND_LASTMOD, CURL_TIMECOND_LAST} curl_TimeCond;#ifdef __BEOS__#include <support/SupportDefs.h>#endif/* curl_strequal() and curl_strnequal() are subject for removal in a future libcurl, see lib/README.curlx for details */CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2);CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);/* name is uppercase CURLFORM_<name> */#ifdef CFINIT#undef CFINIT#endif#ifdef CURL_ISOCPP#define CFINIT(name) CURLFORM_ ## name#else/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */#define CFINIT(name) CURLFORM_/**/name#endiftypedef enum { CFINIT(NOTHING), /********* the first one is unused ************/ /* */ CFINIT(COPYNAME), CFINIT(PTRNAME), CFINIT(NAMELENGTH), CFINIT(COPYCONTENTS), CFINIT(PTRCONTENTS), CFINIT(CONTENTSLENGTH), CFINIT(FILECONTENT), CFINIT(ARRAY), CFINIT(OBSOLETE), CFINIT(FILE), CFINIT(BUFFER), CFINIT(BUFFERPTR), CFINIT(BUFFERLENGTH), CFINIT(CONTENTTYPE), CFINIT(CONTENTHEADER), CFINIT(FILENAME), CFINIT(END), CFINIT(OBSOLETE2), CURLFORM_LASTENTRY /* the last unusued */} CURLformoption;#undef CFINIT /* done *//* structure to be used as parameter for CURLFORM_ARRAY */struct curl_forms { CURLformoption option; const char *value;};/* use this for multipart formpost building *//* Returns code for curl_formadd() * * Returns: * CURL_FORMADD_OK on success * CURL_FORMADD_MEMORY if the FormInfo allocation fails * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form * CURL_FORMADD_NULL if a null pointer was given for a char * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error) * CURL_FORMADD_MEMORY if a HttpPost struct cannot be allocated * CURL_FORMADD_MEMORY if some allocation for string copying failed. * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array * ***************************************************************************/typedef enum { CURL_FORMADD_OK, /* first, no error */ CURL_FORMADD_MEMORY, CURL_FORMADD_OPTION_TWICE, CURL_FORMADD_NULL, CURL_FORMADD_UNKNOWN_OPTION, CURL_FORMADD_INCOMPLETE, CURL_FORMADD_ILLEGAL_ARRAY, CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */ CURL_FORMADD_LAST /* last */} CURLFORMcode;/* * NAME curl_formadd() * * DESCRIPTION * * Pretty advanved function for building multi-part formposts. Each invoke * adds one part that together construct a full post. Then use * CURLOPT_HTTPPOST to send it off to libcurl. */CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost, struct curl_httppost **last_post, ...);/* * callback function for curl_formget() * The void *arg pointer will be the one passed as second argument to curl_formget(). * The character buffer passed to it must not be freed. * Should return the buffer length passed to it as the argument "len" on success. */typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len);/*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -