etc.c.curl

Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.

This software is licensed as described in the file COPYING, which you should have received as part of this distribution. The terms are also available at http://curl.haxx.se/docs/copyright.html.

You may opt to use, copy, modify, merge, publish, distribute and/or sell copies of the Software, and permit persons to whom the Software is furnished to do so, under the terms of the COPYING file.

This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.

Members

Aliases

CURL
alias CURL = void
CURLFORMcode
alias CURLFORMcode = int
CURLINFO
alias CURLINFO = int
CURLM
alias CURLM = void
CURLMSG
alias CURLMSG = int
CURLMcode
alias CURLMcode = int
CURLMoption
alias CURLMoption = int
CURLSH
alias CURLSH = void
CURLSHcode
alias CURLSHcode = int
CURLSHoption
alias CURLSHoption = int
CURL_SOCKET_TIMEOUT
alias CURL_SOCKET_TIMEOUT = CURL_SOCKET_BAD
CURLcode
alias CURLcode = int
CURLoption
alias CURLoption = int
CURLversion
alias CURLversion = int
FUNCTIONPOINT
alias FUNCTIONPOINT = CURLOPTTYPE_FUNCTIONPOINT

The macro "##" is ISO C, we assume pre-ISO C doesn't support it.

LONG
alias LONG = CURLOPTTYPE_LONG
OBJECTPOINT
alias OBJECTPOINT = CURLOPTTYPE_OBJECTPOINT
OFF_T
alias OFF_T = CURLOPTTYPE_OFF_T

The macro "##" is ISO C, we assume pre-ISO C doesn't support it.

curl_TimeCond
alias curl_TimeCond = int
curl_calloc_callback
alias curl_calloc_callback = void* function(size_t nmemb, size_t size)

The following typedef's are signatures of malloc, free, realloc, strdup and calloc respectively. Function pointers of these types can be passed to the curl_global_init_mem() function to set user defined memory management callback routines.

curl_chunk_bgn_callback
alias curl_chunk_bgn_callback = c_long function(const(void)* transfer_info, void* ptr, int remains)

if splitting of data transfer is enabled, this callback is called before download of an individual chunk started. Note that parameter "remains" works only for FTP wildcard downloading (for now), otherwise is not used

curl_chunk_end_callback
alias curl_chunk_end_callback = c_long function(void* ptr)

If splitting of data transfer is enabled this callback is called after download of an individual chunk finished. Note! After this callback was set then it have to be called FOR ALL chunks. Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC. This is the reason why we don't need "transfer_info" parameter in this callback and we are not interested in "remains" parameter too.

curl_closepolicy
alias curl_closepolicy = int
curl_conv_callback
alias curl_conv_callback = CURLcode function(char* buffer, size_t length)

This prototype applies to all conversion callbacks

curl_debug_callback
alias curl_debug_callback = int function(CURL* handle, curl_infotype type, char* data, size_t size, void* userptr)
curl_fnmatch_callback
alias curl_fnmatch_callback = int function(void* ptr, in const(char)* pattern, in const(char)* string)

callback type for wildcard downloading pattern matching. If the string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc.

curl_formget_callback
alias curl_formget_callback = size_t function(void* arg, const(char)* buf, size_t len)

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.

curl_free_callback
alias curl_free_callback = void function(void* ptr)

The following typedef's are signatures of malloc, free, realloc, strdup and calloc respectively. Function pointers of these types can be passed to the curl_global_init_mem() function to set user defined memory management callback routines.

curl_ftpauth
alias curl_ftpauth = int
curl_ftpccc
alias curl_ftpccc = int
curl_ftpcreatedir
alias curl_ftpcreatedir = int
curl_ftpmethod
alias curl_ftpmethod = int
curl_infotype
alias curl_infotype = int
curl_ioctl_callback
alias curl_ioctl_callback = curlioerr function(CURL* handle, int cmd, void* clientp)
curl_lock_access
alias curl_lock_access = int
curl_lock_data
alias curl_lock_data = int
curl_lock_function
alias curl_lock_function = void function(CURL* handle, curl_lock_data data, curl_lock_access locktype, void* userptr)
curl_malloc_callback
alias curl_malloc_callback = void* function(size_t size)

The following typedef's are signatures of malloc, free, realloc, strdup and calloc respectively. Function pointers of these types can be passed to the curl_global_init_mem() function to set user defined memory management callback routines.

curl_multi_timer_callback
alias curl_multi_timer_callback = int function(CURLM* multi, c_long timeout_ms, void* userp)

Name: curl_multi_timer_callback

curl_off_t
alias curl_off_t = long

Data type definition of curl_off_t.

curl_opensocket_callback
alias curl_opensocket_callback = curl_socket_t function(void* clientp, curlsocktype purpose, curl_sockaddr* address)
curl_progress_callback
alias curl_progress_callback = int function(void* clientp, double dltotal, double dlnow, double ultotal, double ulnow)
curl_proxytype
alias curl_proxytype = int
curl_read_callback
alias curl_read_callback = size_t function(char* buffer, size_t size, size_t nitems, void* instream)
curl_realloc_callback
alias curl_realloc_callback = void* function(void* ptr, size_t size)

The following typedef's are signatures of malloc, free, realloc, strdup and calloc respectively. Function pointers of these types can be passed to the curl_global_init_mem() function to set user defined memory management callback routines.

curl_seek_callback
alias curl_seek_callback = int function(void* instream, curl_off_t offset, int origin)
curl_socket_callback
alias curl_socket_callback = int function(CURL* easy, curl_socket_t s, int what, void* userp, void* socketp)
curl_socket_t
alias curl_socket_t = socket_t

jdrewsen - Get socket alias from std.socket

curl_sockopt_callback
alias curl_sockopt_callback = int function(void* clientp, curl_socket_t curlfd, curlsocktype purpose)
curl_sshkeycallback
alias curl_sshkeycallback = int function(CURL* easy, const(curl_khkey)* knownkey, const(curl_khkey)* foundkey, CurlKHMatch m, void* clientp)
curl_ssl_ctx_callback
alias curl_ssl_ctx_callback = CURLcode function(CURL* curl, void* ssl_ctx, void* userptr)

actually an OpenSSL SSL_CTX

curl_strdup_callback
alias curl_strdup_callback = char* function(in const(char)* str)

The following typedef's are signatures of malloc, free, realloc, strdup and calloc respectively. Function pointers of these types can be passed to the curl_global_init_mem() function to set user defined memory management callback routines.

curl_unlock_function
alias curl_unlock_function = void function(CURL* handle, curl_lock_data data, void* userptr)
curl_usessl
alias curl_usessl = int
curl_version_info_data
alias curl_version_info_data = _N28
curl_write_callback
alias curl_write_callback = size_t function(char* buffer, size_t size, size_t nitems, void* outstream)
curlfiletype
alias curlfiletype = int
curliocmd
alias curliocmd = int
curlioerr
alias curlioerr = int
curlsocktype
alias curlsocktype = int
fd_set
alias fd_set = int

tmp decl

Enums

CurlAuth
enum CurlAuth
CurlCSelect
enum CurlCSelect
CurlCallbackInfo
enum CurlCallbackInfo

the kind of data that is passed to information_callback

CurlChunkBgnFunc
enum CurlChunkBgnFunc

return codes for CURLOPT_CHUNK_BGN_FUNCTION

CurlChunkEndFunc
enum CurlChunkEndFunc

return codes for CURLOPT_CHUNK_END_FUNCTION

CurlClosePolicy
enum CurlClosePolicy
CurlError
enum CurlError

All possible error codes from all sorts of curl functions. Future versions may return other values, stay prepared.

CurlFInfoFlagKnown
enum CurlFInfoFlagKnown
CurlFileType
enum CurlFileType

enumeration of file types

CurlFnMAtchFunc
enum CurlFnMAtchFunc

return codes for FNMATCHFUNCTION

CurlFormAdd
enum CurlFormAdd

Use this for multipart formpost building

CurlFtp
enum CurlFtp

parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option

CurlFtpAuth
enum CurlFtpAuth

parameter for the CURLOPT_FTPSSLAUTH option

CurlFtpMethod
enum CurlFtpMethod

parameter for the CURLOPT_FTP_FILEMETHOD option

CurlFtpSSL
enum CurlFtpSSL

parameter for the CURLOPT_FTP_SSL_CCC option

CurlGlobal
enum CurlGlobal
CurlHttpVersion
enum CurlHttpVersion

These enums are for use with the CURLOPT_HTTP_VERSION option.

CurlInfo
enum CurlInfo
CurlIoCmd
enum CurlIoCmd
CurlIoError
enum CurlIoError
CurlIpResolve
enum CurlIpResolve

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.

CurlKHMatch
enum CurlKHMatch

this is the set of status codes pass in to the callback

CurlKHStat
enum CurlKHStat

this is the set of return values expected from the curl_sshkeycallback callback

CurlKHType
enum CurlKHType

points to a zero-terminated string encoded with base64 if len is zero, otherwise to the "raw" data

CurlLockAccess
enum CurlLockAccess

Different lock access types

CurlLockData
enum CurlLockData

Different data locks for a single share

CurlM
enum CurlM
CurlMOption
enum CurlMOption
CurlMsg
enum CurlMsg
CurlNetRcOption
enum CurlNetRcOption

These enums are for use with the CURLOPT_NETRC option.

CurlOption
enum CurlOption
CurlPause
enum CurlPause
CurlPoll
enum CurlPoll

Name: curl_multi_socket() and curl_multi_socket_all()

CurlProto
enum CurlProto

CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options

CurlProxy
enum CurlProxy
CurlReadFunc
enum CurlReadFunc
CurlRedir
enum CurlRedir

symbols to use with CURLOPT_POSTREDIR. CURL_REDIR_POST_301 and CURL_REDIR_POST_302 can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302 == CURL_REDIR_POST_ALL

CurlRtspReq
enum CurlRtspReq

Public API enums for RTSP requests

CurlSeek
enum CurlSeek

These are the return codes for the seek callbacks

CurlSeekPos
enum CurlSeekPos

seek whence...

CurlShError
enum CurlShError
CurlShOption
enum CurlShOption

pass in a user data pointer used in the lock/unlock callback functions

CurlSockType
enum CurlSockType
CurlSshAuth
enum CurlSshAuth
CurlSslVersion
enum CurlSslVersion
CurlTimeCond
enum CurlTimeCond
CurlTlsAuth
enum CurlTlsAuth
CurlUseSSL
enum CurlUseSSL

parameter for the CURLOPT_USE_SSL option

CurlVer
enum CurlVer

Structures for querying information about the curl library at runtime.

CurlVersion
enum CurlVersion

Functions

curl_easy_cleanup
void curl_easy_cleanup(CURL* curl)
curl_easy_duphandle
CURL* curl_easy_duphandle(CURL* curl)

Name: curl_easy_duphandle()

curl_easy_escape
char* curl_easy_escape(CURL* handle, const(char)* string, int length)

Name: curl_easy_escape()

curl_easy_getinfo
CURLcode curl_easy_getinfo(CURL* curl, CURLINFO info, ...)

Name: curl_easy_getinfo()

curl_easy_init
CURL* curl_easy_init()
curl_easy_pause
CURLcode curl_easy_pause(CURL* handle, int bitmask)

Name: curl_easy_pause()

curl_easy_perform
CURLcode curl_easy_perform(CURL* curl)
curl_easy_recv
CURLcode curl_easy_recv(CURL* curl, void* buffer, size_t buflen, size_t* n)

Name: curl_easy_recv()

curl_easy_reset
void curl_easy_reset(CURL* curl)

Name: curl_easy_reset()

curl_easy_send
CURLcode curl_easy_send(CURL* curl, void* buffer, size_t buflen, size_t* n)

Name: curl_easy_send()

curl_easy_setopt
CURLcode curl_easy_setopt(CURL* curl, CURLoption option, ...)
curl_easy_strerror
const(char)* curl_easy_strerror(CURLcode )

Name: curl_easy_strerror()

curl_easy_unescape
char* curl_easy_unescape(CURL* handle, const(char)* string, int length, int* outlength)

Name: curl_easy_unescape()

curl_escape
char* curl_escape(const(char)* string, int length)

the previous version:

curl_formadd
CURLFORMcode curl_formadd(curl_httppost** httppost, curl_httppost** last_post, ...)

Name: curl_formadd()

curl_formfree
void curl_formfree(curl_httppost* form)

Name: curl_formfree()

curl_formget
int curl_formget(curl_httppost* form, void* arg, curl_formget_callback append)

Name: curl_formget()

curl_free
void curl_free(void* p)

Name: curl_free()

curl_getdate
time_t curl_getdate(const(char)* p, const(time_t)* unused)

Name: curl_getdate()

curl_getenv
char* curl_getenv(const(char)* variable)

Name: curl_getenv()

curl_global_cleanup
void curl_global_cleanup()

Name: curl_global_cleanup()

curl_global_init
CURLcode curl_global_init(c_long flags)

Name: curl_global_init()

curl_global_init_mem
CURLcode curl_global_init_mem(c_long flags, curl_malloc_callback m, curl_free_callback f, curl_realloc_callback r, curl_strdup_callback s, curl_calloc_callback c)

Name: curl_global_init_mem()

curl_multi_add_handle
CURLMcode curl_multi_add_handle(CURLM* multi_handle, CURL* curl_handle)

Name: curl_multi_add_handle()

curl_multi_assign
CURLMcode curl_multi_assign(CURLM* multi_handle, curl_socket_t sockfd, void* sockp)

Name: curl_multi_assign()

curl_multi_cleanup
CURLMcode curl_multi_cleanup(CURLM* multi_handle)

Name: curl_multi_cleanup()

curl_multi_fdset
CURLMcode curl_multi_fdset(CURLM* multi_handle, fd_set* read_fd_set, fd_set* write_fd_set, fd_set* exc_fd_set, int* max_fd)
curl_multi_info_read
CURLMsg* curl_multi_info_read(CURLM* multi_handle, int* msgs_in_queue)

Name: curl_multi_info_read()

curl_multi_init
CURLM* curl_multi_init()

Name: curl_multi_init()

curl_multi_perform
CURLMcode curl_multi_perform(CURLM* multi_handle, int* running_handles)

Name: curl_multi_perform()

curl_multi_remove_handle
CURLMcode curl_multi_remove_handle(CURLM* multi_handle, CURL* curl_handle)

Name: curl_multi_remove_handle()

curl_multi_setopt
CURLMcode curl_multi_setopt(CURLM* multi_handle, CURLMoption option, ...)

Name: curl_multi_setopt()

curl_multi_socket
CURLMcode curl_multi_socket(CURLM* multi_handle, curl_socket_t s, int* running_handles)
curl_multi_socket_action
CURLMcode curl_multi_socket_action(CURLM* multi_handle, curl_socket_t s, int ev_bitmask, int* running_handles)
curl_multi_socket_all
CURLMcode curl_multi_socket_all(CURLM* multi_handle, int* running_handles)

Name: curl_multi_timer_callback

curl_multi_strerror
const(char)* curl_multi_strerror(CURLMcode )

Name: curl_multi_strerror()

curl_multi_timeout
CURLMcode curl_multi_timeout(CURLM* multi_handle, c_long* milliseconds)

Name: curl_multi_timeout()

curl_share_cleanup
CURLSHcode curl_share_cleanup(CURLSH* )
curl_share_init
CURLSH* curl_share_init()
curl_share_setopt
CURLSHcode curl_share_setopt(CURLSH* , CURLSHoption option, ...)
curl_share_strerror
const(char)* curl_share_strerror(CURLSHcode )

Name: curl_share_strerror()

curl_slist_append
curl_slist* curl_slist_append(curl_slist* , const(char)* )

Name: curl_slist_append()

curl_slist_free_all
void curl_slist_free_all(curl_slist* )

Name: curl_slist_free_all()

curl_strequal
int curl_strequal(const(char)* s1, const(char)* s2)
curl_strnequal
int curl_strnequal(const(char)* s1, const(char)* s2, size_t n)

curl_strequal() and curl_strnequal() are subject for removal in a future libcurl, see lib/README.curlx for details

curl_unescape
char* curl_unescape(const(char)* string, int length)

the previous version

curl_version
char* curl_version()

Name: curl_version()

curl_version_info
curl_version_info_data* curl_version_info(CURLversion )

Name: curl_version_info()

Manifest constants

CURLINFO_DOUBLE
enum CURLINFO_DOUBLE;
CURLINFO_HTTP_CODE
enum CURLINFO_HTTP_CODE;

CURLINFO_RESPONSE_CODE is the new name for the option previously known as CURLINFO_HTTP_CODE

CURLINFO_LONG
enum CURLINFO_LONG;
CURLINFO_MASK
enum CURLINFO_MASK;
CURLINFO_SLIST
enum CURLINFO_SLIST;
CURLINFO_STRING
enum CURLINFO_STRING;
CURLINFO_TYPEMASK
enum CURLINFO_TYPEMASK;
CURLM_CALL_MULTI_SOCKET
enum CURLM_CALL_MULTI_SOCKET;

just to make code nicer when using curl_multi_socket() you can now check for CURLM_CALL_MULTI_SOCKET too in the same style it works for curl_multi_perform() and CURLM_CALL_MULTI_PERFORM

CURLOPTTYPE_FUNCTIONPOINT
enum CURLOPTTYPE_FUNCTIONPOINT;

long may be 32 or 64 bits, but we should never depend on anything else but 32

CURLOPTTYPE_LONG
enum CURLOPTTYPE_LONG;
CURLOPTTYPE_OBJECTPOINT
enum CURLOPTTYPE_OBJECTPOINT;
CURLOPTTYPE_OFF_T
enum CURLOPTTYPE_OFF_T;

long may be 32 or 64 bits, but we should never depend on anything else but 32

CURLOPT_HEADERDATA
enum CURLOPT_HEADERDATA;
CURLOPT_READDATA
enum CURLOPT_READDATA;
CURLOPT_RTSPHEADER
enum CURLOPT_RTSPHEADER;

three convenient "aliases" that follow the name scheme better

CURLOPT_SERVER_RESPONSE_TIMEOUT
enum CURLOPT_SERVER_RESPONSE_TIMEOUT;
CURLOPT_WRITEDATA
enum CURLOPT_WRITEDATA;

three convenient "aliases" that follow the name scheme better

CURLVERSION_NOW
enum CURLVERSION_NOW;

The 'CURLVERSION_NOW' is the symbolic name meant to be used by basically all programs ever that want to get version information. It is meant to be a built-in version number for what kind of struct the caller expects. If the struct ever changes, we redefine the NOW to another enum from above.

CURL_ERROR_SIZE
enum CURL_ERROR_SIZE;
CURL_MAX_HTTP_HEADER
enum CURL_MAX_HTTP_HEADER;

The only reason to have a max limit for this is to avoid the risk of a bad server feeding libcurl with a never-ending header that will cause reallocs infinitely

CURL_MAX_WRITE_SIZE
enum CURL_MAX_WRITE_SIZE;

Tests have proven that 20K is a very bad buffer size for uploads on Windows, while 16K for some odd reason performed a lot better. We do the ifndef check to allow this value to easier be changed at build time for those who feel adventurous. The practical minimum is about 400 bytes since libcurl uses a buffer of this size as a scratch area (unrelated to network send operations).

CURL_WRITEFUNC_PAUSE
enum CURL_WRITEFUNC_PAUSE;

This is a magic return code for the write callback that, when returned, will signal libcurl to pause receiving on the current transfer.

HTTPPOST_BUFFER
enum HTTPPOST_BUFFER;

upload file from buffer

HTTPPOST_CALLBACK
enum HTTPPOST_CALLBACK;

upload file contents by using the regular read callback to get the data and pass the given pointer as custom pointer

HTTPPOST_FILENAME
enum HTTPPOST_FILENAME;

specified content is a file name

HTTPPOST_PTRBUFFER
enum HTTPPOST_PTRBUFFER;

upload file from pointer contents

HTTPPOST_PTRCONTENTS
enum HTTPPOST_PTRCONTENTS;

contents is only stored pointer do not free in formfree

HTTPPOST_PTRNAME
enum HTTPPOST_PTRNAME;

name is only stored pointer do not free in formfree

HTTPPOST_READFILE
enum HTTPPOST_READFILE;

specified content is a file name

LIBCURL_COPYRIGHT
enum LIBCURL_COPYRIGHT;

This is the global package copyright

LIBCURL_TIMESTAMP
enum LIBCURL_TIMESTAMP;

This is the date and time when the full source package was created. The timestamp is not stored in git, as the timestamp is properly set in the tarballs by the maketgz script.

LIBCURL_VERSION
enum LIBCURL_VERSION;

This is the version number of the libcurl package from which this header file origins:

LIBCURL_VERSION_MAJOR
enum LIBCURL_VERSION_MAJOR;
LIBCURL_VERSION_MINOR
enum LIBCURL_VERSION_MINOR;

The numeric version number is also available "in parts" by using these constants

LIBCURL_VERSION_NUM
enum LIBCURL_VERSION_NUM;

This is the numeric version of the libcurl version number, meant for easier parsing and comparions by programs. The LIBCURL_VERSION_NUM define will always follow this syntax:

LIBCURL_VERSION_PATCH
enum LIBCURL_VERSION_PATCH;

The numeric version number is also available "in parts" by using these constants

Structs

CURLMsg
struct CURLMsg
_N2
struct _N2

If some of these fields is not NULL, it is a pointer to b_data.

_N28
struct _N28
curl_certinfo
struct curl_certinfo

info about the certificate chain, only for OpenSSL builds. Asked for with CURLOPT_CERTINFO / CURLINFO_CERTINFO

curl_fileinfo
struct curl_fileinfo

Content of this structure depends on information which is known and is achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man page for callbacks returning this structure -- some fields are mandatory, some others are optional. The FLAG field has special meaning.

curl_forms
struct curl_forms

structure to be used as parameter for CURLFORM_ARRAY

curl_httppost
struct curl_httppost
curl_khkey
struct curl_khkey
curl_slist
struct curl_slist

linked-list structure for the CURLOPT_QUOTE option (and other)

curl_sockaddr
struct curl_sockaddr

addrlen was a socklen_t type before 7.18.0 but it turned really ugly and painful on the systems that lack this type

Unions

_N31
union _N31

Meta