Update curl bindings to 8.17

This commit is contained in:
Jeroen van Rijn
2025-12-04 14:58:45 +01:00
parent be943e9757
commit 6ef91e2658
14 changed files with 627 additions and 353 deletions

232
vendor/curl/c/curl.h vendored
View File

@@ -102,7 +102,7 @@
#include <sys/time.h>
#endif
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
#endif
@@ -124,7 +124,7 @@ typedef void CURLSH;
#elif defined(_WIN32) || \
(CURL_HAS_DECLSPEC_ATTRIBUTE(dllexport) && \
CURL_HAS_DECLSPEC_ATTRIBUTE(dllimport))
# if defined(BUILDING_LIBCURL)
# ifdef BUILDING_LIBCURL
# define CURL_EXTERN __declspec(dllexport)
# else
# define CURL_EXTERN __declspec(dllimport)
@@ -401,12 +401,12 @@ typedef int (*curl_seek_callback)(void *instream,
#define CURL_TRAILERFUNC_ABORT 1
typedef size_t (*curl_read_callback)(char *buffer,
size_t size,
size_t nitems,
void *instream);
size_t size,
size_t nitems,
void *instream);
typedef int (*curl_trailer_callback)(struct curl_slist **list,
void *userdata);
void *userdata);
typedef enum {
CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
@@ -788,20 +788,24 @@ typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */
mbedtls_ssl_config */
void *userptr);
#define CURLPROXY_HTTP 0L /* added in 7.10, new in 7.19.4 default is
to use CONNECT HTTP/1.1 */
#define CURLPROXY_HTTP_1_0 1L /* force to use CONNECT HTTP/1.0
added in 7.19.4 */
#define CURLPROXY_HTTPS 2L /* HTTPS but stick to HTTP/1
added in 7.52.0 */
#define CURLPROXY_HTTPS2 3L /* HTTPS and attempt HTTP/2
added in 8.2.0 */
#define CURLPROXY_SOCKS4 4L /* support added in 7.15.2, enum existed
already in 7.10 */
#define CURLPROXY_SOCKS5 5L /* added in 7.10 */
#define CURLPROXY_SOCKS4A 6L /* added in 7.18.0 */
#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
the hostname rather than the IP
address. added in 7.18.0 */
typedef enum {
CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
CONNECT HTTP/1.1 */
CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
HTTP/1.0 */
CURLPROXY_HTTPS = 2, /* HTTPS but stick to HTTP/1 added in 7.52.0 */
CURLPROXY_HTTPS2 = 3, /* HTTPS and attempt HTTP/2 added in 8.2.0 */
CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
in 7.10 */
CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
hostname rather than the IP address. added
in 7.18.0 */
CURLPROXY_LAST = 8 /* never use */
} curl_proxytype; /* this enum was added in 7.10 */
/*
@@ -842,19 +846,19 @@ typedef enum {
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */
#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */
#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */
#define CURLSSH_AUTH_PASSWORD (1<<1) /* password */
#define CURLSSH_AUTH_HOST (1<<2) /* host key files */
#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */
#define CURLSSH_AUTH_AGENT (1<<4) /* agent (ssh-agent, pageant...) */
#define CURLSSH_AUTH_GSSAPI (1<<5) /* gssapi (kerberos, ...) */
#define CURLSSH_AUTH_ANY ~0L /* all types supported by the server */
#define CURLSSH_AUTH_NONE 0L /* none allowed, silly but complete */
#define CURLSSH_AUTH_PUBLICKEY (1L<<0) /* public/private key files */
#define CURLSSH_AUTH_PASSWORD (1L<<1) /* password */
#define CURLSSH_AUTH_HOST (1L<<2) /* host key files */
#define CURLSSH_AUTH_KEYBOARD (1L<<3) /* keyboard interactive */
#define CURLSSH_AUTH_AGENT (1L<<4) /* agent (ssh-agent, pageant...) */
#define CURLSSH_AUTH_GSSAPI (1L<<5) /* gssapi (kerberos, ...) */
#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
#define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */
#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */
#define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */
#define CURLGSSAPI_DELEGATION_NONE 0L /* no delegation (default) */
#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1L<<0) /* if permitted by policy */
#define CURLGSSAPI_DELEGATION_FLAG (1L<<1) /* delegate always */
#define CURL_ERROR_SIZE 256
@@ -979,50 +983,55 @@ typedef enum {
#endif /* !CURL_NO_OLDIES */
/* parameter for the CURLOPT_FTP_SSL_CCC option */
#define CURLFTPSSL_CCC_NONE 0L /* do not send CCC */
#define CURLFTPSSL_CCC_PASSIVE 1L /* Let the server initiate the shutdown */
#define CURLFTPSSL_CCC_ACTIVE 2L /* Initiate the shutdown */
typedef enum {
CURLFTPSSL_CCC_NONE, /* do not send CCC */
CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */
CURLFTPSSL_CCC_LAST /* not an option, never use */
CURLFTPSSL_CCC_LAST = 3 /* not an option, never use */
} curl_ftpccc;
/* parameter for the CURLOPT_FTPSSLAUTH option */
#define CURLFTPAUTH_DEFAULT 0L /* let libcurl decide */
#define CURLFTPAUTH_SSL 1L /* use "AUTH SSL" */
#define CURLFTPAUTH_TLS 2L /* use "AUTH TLS" */
typedef enum {
CURLFTPAUTH_DEFAULT, /* let libcurl decide */
CURLFTPAUTH_SSL, /* use "AUTH SSL" */
CURLFTPAUTH_TLS, /* use "AUTH TLS" */
CURLFTPAUTH_LAST /* not an option, never use */
CURLFTPAUTH_LAST = 3 /* not an option, never use */
} curl_ftpauth;
/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
#define CURLFTP_CREATE_DIR_NONE 0L /* do NOT create missing dirs! */
#define CURLFTP_CREATE_DIR 1L /* (FTP/SFTP) if CWD fails, try MKD and
then CWD again if MKD succeeded, for
SFTP this does similar magic */
#define CURLFTP_CREATE_DIR_RETRY 2L /* (FTP only) if CWD fails, try MKD and
then CWD again even if MKD failed! */
typedef enum {
CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */
CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD
again if MKD succeeded, for SFTP this does
similar magic */
CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
again even if MKD failed! */
CURLFTP_CREATE_DIR_LAST /* not an option, never use */
CURLFTP_CREATE_DIR_LAST = 3 /* not an option, never use */
} curl_ftpcreatedir;
/* parameter for the CURLOPT_FTP_FILEMETHOD option */
#define CURLFTPMETHOD_DEFAULT 0L /* let libcurl pick */
#define CURLFTPMETHOD_MULTICWD 1L /* single CWD operation for each path
part */
#define CURLFTPMETHOD_NOCWD 2L /* no CWD at all */
#define CURLFTPMETHOD_SINGLECWD 3L /* one CWD to full dir, then work on file */
typedef enum {
CURLFTPMETHOD_DEFAULT, /* let libcurl pick */
CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */
CURLFTPMETHOD_NOCWD, /* no CWD at all */
CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
CURLFTPMETHOD_LAST /* not an option, never use */
CURLFTPMETHOD_LAST = 4 /* not an option, never use */
} curl_ftpmethod;
/* bitmask defines for CURLOPT_HEADEROPT */
#define CURLHEADER_UNIFIED 0
#define CURLHEADER_SEPARATE (1<<0)
#define CURLHEADER_UNIFIED 0L
#define CURLHEADER_SEPARATE (1L<<0)
/* CURLALTSVC_* are bits for the CURLOPT_ALTSVC_CTRL option */
#define CURLALTSVC_READONLYFILE (1<<2)
#define CURLALTSVC_H1 (1<<3)
#define CURLALTSVC_H2 (1<<4)
#define CURLALTSVC_H3 (1<<5)
#define CURLALTSVC_READONLYFILE (1L<<2)
#define CURLALTSVC_H1 (1L<<3)
#define CURLALTSVC_H2 (1L<<4)
#define CURLALTSVC_H3 (1L<<5)
/* bitmask values for CURLOPT_UPLOAD_FLAGS */
#define CURLULFLAG_ANSWERED (1L<<0)
@@ -1058,42 +1067,42 @@ typedef CURLSTScode (*curl_hstswrite_callback)(CURL *easy,
void *userp);
/* CURLHSTS_* are bits for the CURLOPT_HSTS option */
#define CURLHSTS_ENABLE (long)(1<<0)
#define CURLHSTS_READONLYFILE (long)(1<<1)
#define CURLHSTS_ENABLE (1L<<0)
#define CURLHSTS_READONLYFILE (1L<<1)
/* The CURLPROTO_ defines below are for the **deprecated** CURLOPT_*PROTOCOLS
options. Do not use. */
#define CURLPROTO_HTTP (1<<0)
#define CURLPROTO_HTTPS (1<<1)
#define CURLPROTO_FTP (1<<2)
#define CURLPROTO_FTPS (1<<3)
#define CURLPROTO_SCP (1<<4)
#define CURLPROTO_SFTP (1<<5)
#define CURLPROTO_TELNET (1<<6)
#define CURLPROTO_LDAP (1<<7)
#define CURLPROTO_LDAPS (1<<8)
#define CURLPROTO_DICT (1<<9)
#define CURLPROTO_FILE (1<<10)
#define CURLPROTO_TFTP (1<<11)
#define CURLPROTO_IMAP (1<<12)
#define CURLPROTO_IMAPS (1<<13)
#define CURLPROTO_POP3 (1<<14)
#define CURLPROTO_POP3S (1<<15)
#define CURLPROTO_SMTP (1<<16)
#define CURLPROTO_SMTPS (1<<17)
#define CURLPROTO_RTSP (1<<18)
#define CURLPROTO_RTMP (1<<19)
#define CURLPROTO_RTMPT (1<<20)
#define CURLPROTO_RTMPE (1<<21)
#define CURLPROTO_RTMPTE (1<<22)
#define CURLPROTO_RTMPS (1<<23)
#define CURLPROTO_RTMPTS (1<<24)
#define CURLPROTO_GOPHER (1<<25)
#define CURLPROTO_SMB (1<<26)
#define CURLPROTO_SMBS (1<<27)
#define CURLPROTO_MQTT (1<<28)
#define CURLPROTO_GOPHERS (1<<29)
#define CURLPROTO_ALL (~0) /* enable everything */
#define CURLPROTO_HTTP (1L<<0)
#define CURLPROTO_HTTPS (1L<<1)
#define CURLPROTO_FTP (1L<<2)
#define CURLPROTO_FTPS (1L<<3)
#define CURLPROTO_SCP (1L<<4)
#define CURLPROTO_SFTP (1L<<5)
#define CURLPROTO_TELNET (1L<<6)
#define CURLPROTO_LDAP (1L<<7)
#define CURLPROTO_LDAPS (1L<<8)
#define CURLPROTO_DICT (1L<<9)
#define CURLPROTO_FILE (1L<<10)
#define CURLPROTO_TFTP (1L<<11)
#define CURLPROTO_IMAP (1L<<12)
#define CURLPROTO_IMAPS (1L<<13)
#define CURLPROTO_POP3 (1L<<14)
#define CURLPROTO_POP3S (1L<<15)
#define CURLPROTO_SMTP (1L<<16)
#define CURLPROTO_SMTPS (1L<<17)
#define CURLPROTO_RTSP (1L<<18)
#define CURLPROTO_RTMP (1L<<19)
#define CURLPROTO_RTMPT (1L<<20)
#define CURLPROTO_RTMPE (1L<<21)
#define CURLPROTO_RTMPTE (1L<<22)
#define CURLPROTO_RTMPS (1L<<23)
#define CURLPROTO_RTMPTS (1L<<24)
#define CURLPROTO_GOPHER (1L<<25)
#define CURLPROTO_SMB (1L<<26)
#define CURLPROTO_SMBS (1L<<27)
#define CURLPROTO_MQTT (1L<<28)
#define CURLPROTO_GOPHERS (1L<<29)
#define CURLPROTO_ALL (~0L) /* enable everything */
/* long may be 32 or 64 bits, but we should never depend on anything else
but 32 */
@@ -1348,7 +1357,8 @@ typedef enum {
/* Set the krb4/5 security level, this also enables krb4/5 awareness. This
* is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
* is set but does not match one of these, 'private' will be used. */
CURLOPT(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63),
CURLOPTDEPRECATED(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63,
8.17.0, "removed"),
/* Set if we should verify the peer in ssl handshake, set 1 to verify. */
CURLOPT(CURLOPT_SSL_VERIFYPEER, CURLOPTTYPE_LONG, 64),
@@ -1943,8 +1953,7 @@ typedef enum {
/* Pass in a bitmask of "header options" */
CURLOPT(CURLOPT_HEADEROPT, CURLOPTTYPE_VALUES, 229),
/* The public key in DER form used to validate the peer public key
this option is used only if SSL_VERIFYPEER is true */
/* The public key used to validate the peer public key */
CURLOPT(CURLOPT_PINNEDPUBLICKEY, CURLOPTTYPE_STRINGPOINT, 230),
/* Path to Unix domain socket */
@@ -2354,18 +2363,18 @@ enum CURL_NETRC_OPTION {
CURL_NETRC_LAST = 3
};
#define CURL_SSLVERSION_DEFAULT 0
#define CURL_SSLVERSION_TLSv1 1 /* TLS 1.x */
#define CURL_SSLVERSION_SSLv2 2
#define CURL_SSLVERSION_SSLv3 3
#define CURL_SSLVERSION_TLSv1_0 4
#define CURL_SSLVERSION_TLSv1_1 5
#define CURL_SSLVERSION_TLSv1_2 6
#define CURL_SSLVERSION_TLSv1_3 7
#define CURL_SSLVERSION_DEFAULT 0L
#define CURL_SSLVERSION_TLSv1 1L /* TLS 1.x */
#define CURL_SSLVERSION_SSLv2 2L
#define CURL_SSLVERSION_SSLv3 3L
#define CURL_SSLVERSION_TLSv1_0 4L
#define CURL_SSLVERSION_TLSv1_1 5L
#define CURL_SSLVERSION_TLSv1_2 6L
#define CURL_SSLVERSION_TLSv1_3 7L
#define CURL_SSLVERSION_LAST 8 /* never use, keep last */
#define CURL_SSLVERSION_LAST 8L /* never use, keep last */
#define CURL_SSLVERSION_MAX_NONE 0
#define CURL_SSLVERSION_MAX_NONE 0L
#define CURL_SSLVERSION_MAX_DEFAULT (CURL_SSLVERSION_TLSv1 << 16)
#define CURL_SSLVERSION_MAX_TLSv1_0 (CURL_SSLVERSION_TLSv1_0 << 16)
#define CURL_SSLVERSION_MAX_TLSv1_1 (CURL_SSLVERSION_TLSv1_1 << 16)
@@ -2389,10 +2398,10 @@ enum CURL_TLSAUTH {
can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302
| CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */
#define CURL_REDIR_GET_ALL 0
#define CURL_REDIR_POST_301 1
#define CURL_REDIR_POST_302 2
#define CURL_REDIR_POST_303 4
#define CURL_REDIR_GET_ALL 0L
#define CURL_REDIR_POST_301 1L
#define CURL_REDIR_POST_302 2L
#define CURL_REDIR_POST_303 4L
#define CURL_REDIR_POST_ALL \
(CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
@@ -2421,7 +2430,7 @@ typedef struct curl_mime curl_mime; /* Mime context. */
typedef struct curl_mimepart curl_mimepart; /* Mime part context. */
/* CURLMIMEOPT_ defines are for the CURLOPT_MIME_OPTIONS option. */
#define CURLMIMEOPT_FORMESCAPE (1<<0) /* Use backslash-escaping for forms. */
#define CURLMIMEOPT_FORMESCAPE (1L<<0) /* Use backslash-escaping for forms. */
/*
* NAME curl_mime_init()
@@ -2750,7 +2759,7 @@ CURL_EXTERN CURLcode curl_global_init(long flags);
* for each application that uses libcurl. This function can be used to
* initialize libcurl and set user defined memory management callback
* functions. Users can implement memory management routines to check for
* memory leaks, check for mis-use of the curl library etc. User registered
* memory leaks, check for misuse of the curl library etc. User registered
* callback routines will be invoked by this library instead of the system
* memory management routines like malloc, free etc.
*/
@@ -3302,7 +3311,7 @@ CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *handle,
void *userptr);
#ifdef __cplusplus
#ifdef __cplusplus
} /* end of extern "C" */
#endif
@@ -3317,8 +3326,9 @@ CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *handle,
#include "mprintf.h"
/* the typechecker does not work in C++ (yet) */
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
#if ((defined(__GNUC__) && defined(__GNUC_MINOR__) && \
((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
(defined(__clang__) && __clang_major__ >= 14)) && \
!defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)
#include "typecheck-gcc.h"
#else

View File

@@ -32,14 +32,13 @@
/* This is the version number of the libcurl package from which this header
file origins: */
#define LIBCURL_VERSION "8.15.0"
#define LIBCURL_VERSION "8.17.0-DEV"
/* The numeric version number is also available "in parts" by using these
defines: */
#define LIBCURL_VERSION_MAJOR 8
#define LIBCURL_VERSION_MINOR 15
#define LIBCURL_VERSION_MINOR 17
#define LIBCURL_VERSION_PATCH 0
/* This is the numeric version of the libcurl version number, meant for easier
parsing and comparisons by programs. The LIBCURL_VERSION_NUM define will
always follow this syntax:
@@ -59,7 +58,7 @@
CURL_VERSION_BITS() macro since curl's own configure script greps for it
and needs it to contain the full number.
*/
#define LIBCURL_VERSION_NUM 0x080f00
#define LIBCURL_VERSION_NUM 0x081100
/*
* This is the date and time when the full source package was created. The
@@ -70,7 +69,7 @@
*
* "2007-11-23"
*/
#define LIBCURL_TIMESTAMP "2025-07-16"
#define LIBCURL_TIMESTAMP "[unreleased]"
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
#define CURL_AT_LEAST_VERSION(x,y,z) \

View File

@@ -23,7 +23,7 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
#endif
@@ -118,7 +118,7 @@ CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
*/
CURL_EXTERN CURLcode curl_easy_upkeep(CURL *curl);
#ifdef __cplusplus
#ifdef __cplusplus
} /* end of extern "C" */
#endif

View File

@@ -24,7 +24,7 @@
*
***************************************************************************/
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -28,7 +28,7 @@
#include <stdio.h> /* needed for FILE */
#include "curl.h" /* for CURL_EXTERN */
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
#endif
@@ -38,7 +38,7 @@ extern "C" {
defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
!defined(CURL_NO_FMT_CHECKS)
#if defined(__MINGW32__) && !defined(__clang__)
#if defined(__MINGW_PRINTF_FORMAT) /* mingw-w64 3.0.0+. Needs stdio.h. */
#ifdef __MINGW_PRINTF_FORMAT /* mingw-w64 3.0.0+. Needs stdio.h. */
#define CURL_TEMP_PRINTF(fmt, arg) \
__attribute__((format(__MINGW_PRINTF_FORMAT, fmt, arg)))
#else
@@ -78,7 +78,7 @@ CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args)
#undef CURL_TEMP_PRINTF
#ifdef __cplusplus
#ifdef __cplusplus
} /* end of extern "C" */
#endif

74
vendor/curl/c/multi.h vendored
View File

@@ -50,7 +50,7 @@
*/
#include "curl.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
#endif
@@ -395,9 +395,29 @@ typedef enum {
/* maximum number of concurrent streams to support on a connection */
CURLOPT(CURLMOPT_MAX_CONCURRENT_STREAMS, CURLOPTTYPE_LONG, 16),
/* network has changed, adjust caches/connection reuse */
CURLOPT(CURLMOPT_NETWORK_CHANGED, CURLOPTTYPE_LONG, 17),
/* This is the notify callback function pointer */
CURLOPT(CURLMOPT_NOTIFYFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 18),
/* This is the argument passed to the notify callback */
CURLOPT(CURLMOPT_NOTIFYDATA, CURLOPTTYPE_OBJECTPOINT, 19),
CURLMOPT_LASTENTRY /* the last unused */
} CURLMoption;
/* Definition of bits for the CURLMOPT_NETWORK_CHANGED argument: */
/* - CURLMNWC_CLEAR_CONNS tells libcurl to prevent further reuse of existing
connections. Connections that are idle will be closed. Ongoing transfers
will continue with the connection they have. */
#define CURLMNWC_CLEAR_CONNS (1L<<0)
/* - CURLMNWC_CLEAR_DNS tells libcurl to prevent further reuse of existing
connections. Connections that are idle will be closed. Ongoing transfers
will continue with the connection they have. */
#define CURLMNWC_CLEAR_DNS (1L<<0)
/*
* Name: curl_multi_setopt()
@@ -434,6 +454,38 @@ CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
*/
CURL_EXTERN CURL **curl_multi_get_handles(CURLM *multi_handle);
typedef enum {
CURLMINFO_NONE, /* first, never use this */
/* The number of easy handles currently managed by the multi handle,
* e.g. have been added but not yet removed. */
CURLMINFO_XFERS_CURRENT = 1,
/* The number of easy handles running, e.g. not done and not queueing. */
CURLMINFO_XFERS_RUNNING = 2,
/* The number of easy handles waiting to start, e.g. for a connection
* to become available due to limits on parallelism, max connections
* or other factors. */
CURLMINFO_XFERS_PENDING = 3,
/* The number of easy handles finished, waiting for their results to
* be read via `curl_multi_info_read()`. */
CURLMINFO_XFERS_DONE = 4,
/* The total number of easy handles added to the multi handle, ever. */
CURLMINFO_XFERS_ADDED = 5,
CURLMINFO_LASTENTRY /* the last unused */
} CURLMinfo_offt;
/*
* Name: curl_multi_get_offt()
*
* Desc: Retrieves a numeric value for the `CURLMINFO_*` enums.
*
* Returns: CULRM_OK or error when value could not be obtained.
*/
CURL_EXTERN CURLMcode curl_multi_get_offt(CURLM *multi_handle,
CURLMinfo_offt info,
curl_off_t *pvalue);
/*
* Name: curl_push_callback
*
@@ -474,6 +526,26 @@ CURL_EXTERN CURLMcode curl_multi_waitfds(CURLM *multi,
unsigned int size,
unsigned int *fd_count);
/*
* Notifications dispatched by a multi handle, when enabled.
*/
#define CURLMNOTIFY_INFO_READ 0
#define CURLMNOTIFY_EASY_DONE 1
/*
* Callback to install via CURLMOPT_NOTIFYFUNCTION.
*/
typedef void (*curl_notify_callback)(CURLM *multi,
unsigned int notification,
CURL *easy,
void *user_data);
CURL_EXTERN CURLMcode curl_multi_notify_disable(CURLM *multi,
unsigned int notification);
CURL_EXTERN CURLMcode curl_multi_notify_enable(CURLM *multi,
unsigned int notification);
#ifdef __cplusplus
} /* end of extern "C" */
#endif

View File

@@ -24,7 +24,7 @@
*
***************************************************************************/
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -66,7 +66,7 @@
# define CURL_TYPEOF_CURL_SOCKLEN_T int
#elif defined(__POCC__)
# if defined(_MSC_VER)
# ifdef _MSC_VER
# define CURL_TYPEOF_CURL_OFF_T __int64
# define CURL_FORMAT_CURL_OFF_T "I64d"
# define CURL_FORMAT_CURL_OFF_TU "I64u"
@@ -82,7 +82,7 @@
# define CURL_TYPEOF_CURL_SOCKLEN_T int
#elif defined(__LCC__)
# if defined(__MCST__) /* MCST eLbrus Compiler Collection */
# ifdef __MCST__ /* MCST eLbrus Compiler Collection */
# define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "lu"
@@ -118,7 +118,7 @@
# define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int
#elif defined(__TANDEM)
# if !defined(__LP64)
# ifndef __LP64
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
@@ -135,7 +135,7 @@
# endif
#elif defined(UNDER_CE)
# if defined(__MINGW32CE__)
# ifdef __MINGW32CE__
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
@@ -162,7 +162,7 @@
# define CURL_PULL_SYS_TYPES_H 1
#elif defined(__VMS)
# if defined(__VAX)
# ifdef __VAX
# define CURL_TYPEOF_CURL_OFF_T long
# define CURL_FORMAT_CURL_OFF_T "ld"
# define CURL_FORMAT_CURL_OFF_TU "lu"
@@ -188,7 +188,7 @@
# define CURL_PULL_SYS_SOCKET_H 1
#elif defined(__MVS__)
# if defined(_LONG_LONG)
# ifdef _LONG_LONG
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
@@ -207,7 +207,7 @@
#elif defined(__370__)
# if defined(__IBMC__) || defined(__IBMCPP__)
# if defined(_LONG_LONG)
# ifdef _LONG_LONG
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
@@ -266,7 +266,7 @@
# define CURL_PULL_SYS_SOCKET_H 1
#elif defined(__xlc__) /* IBM xlc compiler */
# if !defined(_LP64)
# ifndef _LP64
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
@@ -284,7 +284,7 @@
# define CURL_PULL_SYS_SOCKET_H 1
#elif defined(__hpux) /* HP aCC compiler */
# if !defined(_LP64)
# ifndef _LP64
# define CURL_TYPEOF_CURL_OFF_T long long
# define CURL_FORMAT_CURL_OFF_T "lld"
# define CURL_FORMAT_CURL_OFF_TU "llu"
@@ -336,8 +336,11 @@
# define CURL_FORMAT_CURL_OFF_TU "llu"
# define CURL_SUFFIX_CURL_OFF_T LL
# define CURL_SUFFIX_CURL_OFF_TU ULL
# define CURL_POPCOUNT64(x) __builtin_popcountll(x)
# define CURL_CTZ64(x) __builtin_ctzll(x)
# if (__GNUC__ >= 4) || \
((__GNUC__ == 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 4))
# define CURL_POPCOUNT64(x) __builtin_popcountll(x)
# define CURL_CTZ64(x) __builtin_ctzll(x)
# endif
# elif defined(__LP64__) || \
defined(__x86_64__) || defined(__ppc64__) || defined(__sparc64__) || \
defined(__e2k__) || \
@@ -348,8 +351,11 @@
# define CURL_FORMAT_CURL_OFF_TU "lu"
# define CURL_SUFFIX_CURL_OFF_T L
# define CURL_SUFFIX_CURL_OFF_TU UL
# define CURL_POPCOUNT64(x) __builtin_popcountl(x)
# define CURL_CTZ64(x) __builtin_ctzl(x)
# if (__GNUC__ >= 4) || \
((__GNUC__ == 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 4))
# define CURL_POPCOUNT64(x) __builtin_popcountl(x)
# define CURL_CTZ64(x) __builtin_ctzl(x)
# endif
# endif
# define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
# define CURL_PULL_SYS_TYPES_H 1

View File

@@ -29,9 +29,9 @@
/* To add a new kind of warning, add an
* if(curlcheck_sometype_option(_curl_opt))
* if(!curlcheck_sometype(value))
* _curl_easy_setopt_err_sometype();
* Wcurl_easy_setopt_err_sometype();
* block and define curlcheck_sometype_option, curlcheck_sometype and
* _curl_easy_setopt_err_sometype below
* Wcurl_easy_setopt_err_sometype below
*
* NOTE: We use two nested 'if' statements here instead of the && operator, in
* order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x
@@ -47,113 +47,113 @@
CURL_IGNORE_DEPRECATION( \
if(curlcheck_long_option(option)) \
if(!curlcheck_long(value)) \
_curl_easy_setopt_err_long(); \
Wcurl_easy_setopt_err_long(); \
if(curlcheck_off_t_option(option)) \
if(!curlcheck_off_t(value)) \
_curl_easy_setopt_err_curl_off_t(); \
Wcurl_easy_setopt_err_curl_off_t(); \
if(curlcheck_string_option(option)) \
if(!curlcheck_string(value)) \
_curl_easy_setopt_err_string(); \
Wcurl_easy_setopt_err_string(); \
if((option) == CURLOPT_PRIVATE) { } \
if(curlcheck_write_cb_option(option)) \
if(!curlcheck_write_cb(value)) \
_curl_easy_setopt_err_write_callback(); \
Wcurl_easy_setopt_err_write_callback(); \
if(curlcheck_curl_option(option)) \
if(!curlcheck_curl(value)) \
_curl_easy_setopt_err_curl(); \
Wcurl_easy_setopt_err_curl(); \
if((option) == CURLOPT_RESOLVER_START_FUNCTION) \
if(!curlcheck_resolver_start_callback(value)) \
_curl_easy_setopt_err_resolver_start_callback(); \
Wcurl_easy_setopt_err_resolver_start_callback(); \
if((option) == CURLOPT_READFUNCTION) \
if(!curlcheck_read_cb(value)) \
_curl_easy_setopt_err_read_cb(); \
Wcurl_easy_setopt_err_read_cb(); \
if((option) == CURLOPT_IOCTLFUNCTION) \
if(!curlcheck_ioctl_cb(value)) \
_curl_easy_setopt_err_ioctl_cb(); \
Wcurl_easy_setopt_err_ioctl_cb(); \
if((option) == CURLOPT_SOCKOPTFUNCTION) \
if(!curlcheck_sockopt_cb(value)) \
_curl_easy_setopt_err_sockopt_cb(); \
Wcurl_easy_setopt_err_sockopt_cb(); \
if((option) == CURLOPT_OPENSOCKETFUNCTION) \
if(!curlcheck_opensocket_cb(value)) \
_curl_easy_setopt_err_opensocket_cb(); \
Wcurl_easy_setopt_err_opensocket_cb(); \
if((option) == CURLOPT_PROGRESSFUNCTION) \
if(!curlcheck_progress_cb(value)) \
_curl_easy_setopt_err_progress_cb(); \
Wcurl_easy_setopt_err_progress_cb(); \
if((option) == CURLOPT_XFERINFOFUNCTION) \
if(!curlcheck_xferinfo_cb(value)) \
_curl_easy_setopt_err_xferinfo_cb(); \
Wcurl_easy_setopt_err_xferinfo_cb(); \
if((option) == CURLOPT_DEBUGFUNCTION) \
if(!curlcheck_debug_cb(value)) \
_curl_easy_setopt_err_debug_cb(); \
Wcurl_easy_setopt_err_debug_cb(); \
if((option) == CURLOPT_SSL_CTX_FUNCTION) \
if(!curlcheck_ssl_ctx_cb(value)) \
_curl_easy_setopt_err_ssl_ctx_cb(); \
Wcurl_easy_setopt_err_ssl_ctx_cb(); \
if(curlcheck_conv_cb_option(option)) \
if(!curlcheck_conv_cb(value)) \
_curl_easy_setopt_err_conv_cb(); \
Wcurl_easy_setopt_err_conv_cb(); \
if((option) == CURLOPT_SEEKFUNCTION) \
if(!curlcheck_seek_cb(value)) \
_curl_easy_setopt_err_seek_cb(); \
Wcurl_easy_setopt_err_seek_cb(); \
if((option) == CURLOPT_CHUNK_BGN_FUNCTION) \
if(!curlcheck_chunk_bgn_cb(value)) \
_curl_easy_setopt_err_chunk_bgn_cb(); \
Wcurl_easy_setopt_err_chunk_bgn_cb(); \
if((option) == CURLOPT_CHUNK_END_FUNCTION) \
if(!curlcheck_chunk_end_cb(value)) \
_curl_easy_setopt_err_chunk_end_cb(); \
Wcurl_easy_setopt_err_chunk_end_cb(); \
if((option) == CURLOPT_CLOSESOCKETFUNCTION) \
if(!curlcheck_close_socket_cb(value)) \
_curl_easy_setopt_err_close_socket_cb(); \
Wcurl_easy_setopt_err_close_socket_cb(); \
if((option) == CURLOPT_FNMATCH_FUNCTION) \
if(!curlcheck_fnmatch_cb(value)) \
_curl_easy_setopt_err_fnmatch_cb(); \
Wcurl_easy_setopt_err_fnmatch_cb(); \
if((option) == CURLOPT_HSTSREADFUNCTION) \
if(!curlcheck_hstsread_cb(value)) \
_curl_easy_setopt_err_hstsread_cb(); \
Wcurl_easy_setopt_err_hstsread_cb(); \
if((option) == CURLOPT_HSTSWRITEFUNCTION) \
if(!curlcheck_hstswrite_cb(value)) \
_curl_easy_setopt_err_hstswrite_cb(); \
Wcurl_easy_setopt_err_hstswrite_cb(); \
if((option) == CURLOPT_SSH_HOSTKEYFUNCTION) \
if(!curlcheck_ssh_hostkey_cb(value)) \
_curl_easy_setopt_err_ssh_hostkey_cb(); \
Wcurl_easy_setopt_err_ssh_hostkey_cb(); \
if((option) == CURLOPT_SSH_KEYFUNCTION) \
if(!curlcheck_ssh_key_cb(value)) \
_curl_easy_setopt_err_ssh_key_cb(); \
Wcurl_easy_setopt_err_ssh_key_cb(); \
if((option) == CURLOPT_INTERLEAVEFUNCTION) \
if(!curlcheck_interleave_cb(value)) \
_curl_easy_setopt_err_interleave_cb(); \
Wcurl_easy_setopt_err_interleave_cb(); \
if((option) == CURLOPT_PREREQFUNCTION) \
if(!curlcheck_prereq_cb(value)) \
_curl_easy_setopt_err_prereq_cb(); \
Wcurl_easy_setopt_err_prereq_cb(); \
if((option) == CURLOPT_TRAILERFUNCTION) \
if(!curlcheck_trailer_cb(value)) \
_curl_easy_setopt_err_trailer_cb(); \
Wcurl_easy_setopt_err_trailer_cb(); \
if(curlcheck_cb_data_option(option)) \
if(!curlcheck_cb_data(value)) \
_curl_easy_setopt_err_cb_data(); \
Wcurl_easy_setopt_err_cb_data(); \
if((option) == CURLOPT_ERRORBUFFER) \
if(!curlcheck_error_buffer(value)) \
_curl_easy_setopt_err_error_buffer(); \
Wcurl_easy_setopt_err_error_buffer(); \
if((option) == CURLOPT_CURLU) \
if(!curlcheck_ptr((value), CURLU)) \
_curl_easy_setopt_err_curlu(); \
Wcurl_easy_setopt_err_curlu(); \
if((option) == CURLOPT_STDERR) \
if(!curlcheck_FILE(value)) \
_curl_easy_setopt_err_FILE(); \
Wcurl_easy_setopt_err_FILE(); \
if(curlcheck_postfields_option(option)) \
if(!curlcheck_postfields(value)) \
_curl_easy_setopt_err_postfields(); \
Wcurl_easy_setopt_err_postfields(); \
if((option) == CURLOPT_HTTPPOST) \
if(!curlcheck_arr((value), struct curl_httppost)) \
_curl_easy_setopt_err_curl_httpost(); \
Wcurl_easy_setopt_err_curl_httpost(); \
if((option) == CURLOPT_MIMEPOST) \
if(!curlcheck_ptr((value), curl_mime)) \
_curl_easy_setopt_err_curl_mimepost(); \
Wcurl_easy_setopt_err_curl_mimepost(); \
if(curlcheck_slist_option(option)) \
if(!curlcheck_arr((value), struct curl_slist)) \
_curl_easy_setopt_err_curl_slist(); \
Wcurl_easy_setopt_err_curl_slist(); \
if((option) == CURLOPT_SHARE) \
if(!curlcheck_ptr((value), CURLSH)) \
_curl_easy_setopt_err_CURLSH(); \
Wcurl_easy_setopt_err_CURLSH(); \
) \
} \
curl_easy_setopt(handle, option, value); \
@@ -166,40 +166,106 @@
CURL_IGNORE_DEPRECATION( \
if(curlcheck_string_info(info)) \
if(!curlcheck_arr((arg), char *)) \
_curl_easy_getinfo_err_string(); \
Wcurl_easy_getinfo_err_string(); \
if(curlcheck_long_info(info)) \
if(!curlcheck_arr((arg), long)) \
_curl_easy_getinfo_err_long(); \
Wcurl_easy_getinfo_err_long(); \
if(curlcheck_double_info(info)) \
if(!curlcheck_arr((arg), double)) \
_curl_easy_getinfo_err_double(); \
Wcurl_easy_getinfo_err_double(); \
if(curlcheck_slist_info(info)) \
if(!curlcheck_arr((arg), struct curl_slist *)) \
_curl_easy_getinfo_err_curl_slist(); \
Wcurl_easy_getinfo_err_curl_slist(); \
if(curlcheck_tlssessioninfo_info(info)) \
if(!curlcheck_arr((arg), struct curl_tlssessioninfo *)) \
_curl_easy_getinfo_err_curl_tlssessioninfo(); \
Wcurl_easy_getinfo_err_curl_tlssessioninfo(); \
if(curlcheck_certinfo_info(info)) \
if(!curlcheck_arr((arg), struct curl_certinfo *)) \
_curl_easy_getinfo_err_curl_certinfo(); \
Wcurl_easy_getinfo_err_curl_certinfo(); \
if(curlcheck_socket_info(info)) \
if(!curlcheck_arr((arg), curl_socket_t)) \
_curl_easy_getinfo_err_curl_socket(); \
Wcurl_easy_getinfo_err_curl_socket(); \
if(curlcheck_off_t_info(info)) \
if(!curlcheck_arr((arg), curl_off_t)) \
_curl_easy_getinfo_err_curl_off_t(); \
Wcurl_easy_getinfo_err_curl_off_t(); \
) \
} \
curl_easy_getinfo(handle, info, arg); \
})
#define curl_multi_setopt(handle, option, value) \
__extension__({ \
if(__builtin_constant_p(option)) { \
if(curlcheck_long_option(option)) \
if(!curlcheck_long(value)) \
Wcurl_multi_setopt_err_long(); \
if(curlcheck_off_t_option(option)) \
if(!curlcheck_off_t(value)) \
Wcurl_multi_setopt_err_curl_off_t(); \
if(curlcheck_multicb_data_option(option)) \
if(!curlcheck_cb_data(value)) \
Wcurl_multi_setopt_err_cb_data(); \
if(curlcheck_charpp_option(option)) \
if(!curlcheck_ptrptr(value, char)) \
Wcurl_multi_setopt_err_charpp(); \
if((option) == CURLMOPT_NOTIFYFUNCTION) \
if(!curlcheck_multinotify_cb(value)) \
Wcurl_multi_setopt_err_notifycb(); \
if((option) == CURLMOPT_PUSHFUNCTION) \
if(!curlcheck_multipush_cb(value)) \
Wcurl_multi_setopt_err_pushcb(); \
if((option) == CURLMOPT_SOCKETFUNCTION) \
if(!curlcheck_multisocket_cb(value)) \
Wcurl_multi_setopt_err_socketcb(); \
if((option) == CURLMOPT_TIMERFUNCTION) \
if(!curlcheck_multitimer_cb(value)) \
Wcurl_multi_setopt_err_timercb(); \
} \
curl_multi_setopt(handle, option, value); \
})
/* evaluates to true if the option takes a data argument to pass to a
callback */
#define curlcheck_multicb_data_option(option) \
((option) == CURLMOPT_NOTIFYDATA || \
(option) == CURLMOPT_PUSHDATA || \
(option) == CURLMOPT_SOCKETDATA || \
(option) == CURLMOPT_TIMERDATA || \
0)
/* evaluates to true if the option takes a char ** argument */
#define curlcheck_charpp_option(option) \
((option) == CURLMOPT_PIPELINING_SERVER_BL || \
(option) == CURLMOPT_PIPELINING_SITE_BL || \
0)
/* evaluates to true if expr is of type curl_multi_timer_callback */
#define curlcheck_multitimer_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_multi_timer_callback))
/* evaluates to true if expr is of type curl_socket_callback */
#define curlcheck_multisocket_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_socket_callback))
/* evaluates to true if expr is of type curl_push_callback */
#define curlcheck_multipush_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_push_callback))
/* evaluates to true if expr is of type curl_push_callback */
#define curlcheck_multinotify_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_notify_callback))
/*
* For now, just make sure that the functions are called with three arguments
*/
#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
/* the actual warnings, triggered by calling the _curl_easy_setopt_err*
/* the actual warnings, triggered by calling the Wcurl_easy_setopt_err*
* functions */
/* To define a new warning, use _CURL_WARNING(identifier, "message") */
@@ -208,117 +274,134 @@
__attribute__((__unused__)) __attribute__((__noinline__)) \
id(void) { __asm__(""); }
CURLWARNING(_curl_easy_setopt_err_long,
CURLWARNING(Wcurl_multi_setopt_err_long,
"curl_multi_setopt expects a long argument")
CURLWARNING(Wcurl_multi_setopt_err_curl_off_t,
"curl_multi_setopt expects a curl_off_t argument")
CURLWARNING(Wcurl_multi_setopt_err_cb_data,
"curl_multi_setopt expects a 'void *' argument")
CURLWARNING(Wcurl_multi_setopt_err_charpp,
"curl_multi_setopt expects a 'char **' argument")
CURLWARNING(Wcurl_multi_setopt_err_pushcb,
"curl_multi_setopt expects a curl_push_callback argument")
CURLWARNING(Wcurl_multi_setopt_err_notifycb,
"curl_multi_setopt expects a curl_notify_callback argument")
CURLWARNING(Wcurl_multi_setopt_err_socketcb,
"curl_multi_setopt expects a curl_socket_callback argument")
CURLWARNING(Wcurl_multi_setopt_err_timercb,
"curl_multi_setopt expects a curl_multi_timer_callback argument")
CURLWARNING(Wcurl_easy_setopt_err_long,
"curl_easy_setopt expects a long argument")
CURLWARNING(_curl_easy_setopt_err_curl_off_t,
CURLWARNING(Wcurl_easy_setopt_err_curl_off_t,
"curl_easy_setopt expects a curl_off_t argument")
CURLWARNING(_curl_easy_setopt_err_string,
CURLWARNING(Wcurl_easy_setopt_err_string,
"curl_easy_setopt expects a "
"string ('char *' or char[]) argument")
CURLWARNING(_curl_easy_setopt_err_write_callback,
CURLWARNING(Wcurl_easy_setopt_err_write_callback,
"curl_easy_setopt expects a curl_write_callback argument")
CURLWARNING(_curl_easy_setopt_err_resolver_start_callback,
CURLWARNING(Wcurl_easy_setopt_err_resolver_start_callback,
"curl_easy_setopt expects a "
"curl_resolver_start_callback argument")
CURLWARNING(_curl_easy_setopt_err_read_cb,
CURLWARNING(Wcurl_easy_setopt_err_read_cb,
"curl_easy_setopt expects a curl_read_callback argument")
CURLWARNING(_curl_easy_setopt_err_ioctl_cb,
CURLWARNING(Wcurl_easy_setopt_err_ioctl_cb,
"curl_easy_setopt expects a curl_ioctl_callback argument")
CURLWARNING(_curl_easy_setopt_err_sockopt_cb,
CURLWARNING(Wcurl_easy_setopt_err_sockopt_cb,
"curl_easy_setopt expects a curl_sockopt_callback argument")
CURLWARNING(_curl_easy_setopt_err_opensocket_cb,
CURLWARNING(Wcurl_easy_setopt_err_opensocket_cb,
"curl_easy_setopt expects a "
"curl_opensocket_callback argument")
CURLWARNING(_curl_easy_setopt_err_progress_cb,
CURLWARNING(Wcurl_easy_setopt_err_progress_cb,
"curl_easy_setopt expects a curl_progress_callback argument")
CURLWARNING(_curl_easy_setopt_err_xferinfo_cb,
CURLWARNING(Wcurl_easy_setopt_err_xferinfo_cb,
"curl_easy_setopt expects a curl_xferinfo_callback argument")
CURLWARNING(_curl_easy_setopt_err_debug_cb,
CURLWARNING(Wcurl_easy_setopt_err_debug_cb,
"curl_easy_setopt expects a curl_debug_callback argument")
CURLWARNING(_curl_easy_setopt_err_ssl_ctx_cb,
CURLWARNING(Wcurl_easy_setopt_err_ssl_ctx_cb,
"curl_easy_setopt expects a curl_ssl_ctx_callback argument")
CURLWARNING(_curl_easy_setopt_err_conv_cb,
CURLWARNING(Wcurl_easy_setopt_err_conv_cb,
"curl_easy_setopt expects a curl_conv_callback argument")
CURLWARNING(_curl_easy_setopt_err_seek_cb,
CURLWARNING(Wcurl_easy_setopt_err_seek_cb,
"curl_easy_setopt expects a curl_seek_callback argument")
CURLWARNING(_curl_easy_setopt_err_cb_data,
CURLWARNING(Wcurl_easy_setopt_err_cb_data,
"curl_easy_setopt expects a "
"private data pointer as argument")
CURLWARNING(_curl_easy_setopt_err_chunk_bgn_cb,
CURLWARNING(Wcurl_easy_setopt_err_chunk_bgn_cb,
"curl_easy_setopt expects a curl_chunk_bgn_callback argument")
CURLWARNING(_curl_easy_setopt_err_chunk_end_cb,
CURLWARNING(Wcurl_easy_setopt_err_chunk_end_cb,
"curl_easy_setopt expects a curl_chunk_end_callback argument")
CURLWARNING(_curl_easy_setopt_err_close_socket_cb,
CURLWARNING(Wcurl_easy_setopt_err_close_socket_cb,
"curl_easy_setopt expects a curl_closesocket_callback argument")
CURLWARNING(_curl_easy_setopt_err_fnmatch_cb,
CURLWARNING(Wcurl_easy_setopt_err_fnmatch_cb,
"curl_easy_setopt expects a curl_fnmatch_callback argument")
CURLWARNING(_curl_easy_setopt_err_hstsread_cb,
CURLWARNING(Wcurl_easy_setopt_err_hstsread_cb,
"curl_easy_setopt expects a curl_hstsread_callback argument")
CURLWARNING(_curl_easy_setopt_err_hstswrite_cb,
CURLWARNING(Wcurl_easy_setopt_err_hstswrite_cb,
"curl_easy_setopt expects a curl_hstswrite_callback argument")
CURLWARNING(_curl_easy_setopt_err_ssh_key_cb,
CURLWARNING(Wcurl_easy_setopt_err_ssh_key_cb,
"curl_easy_setopt expects a curl_sshkeycallback argument")
CURLWARNING(_curl_easy_setopt_err_ssh_hostkey_cb,
CURLWARNING(Wcurl_easy_setopt_err_ssh_hostkey_cb,
"curl_easy_setopt expects a curl_sshhostkeycallback argument")
CURLWARNING(_curl_easy_setopt_err_interleave_cb,
CURLWARNING(Wcurl_easy_setopt_err_interleave_cb,
"curl_easy_setopt expects a curl_interleave_callback argument")
CURLWARNING(_curl_easy_setopt_err_prereq_cb,
CURLWARNING(Wcurl_easy_setopt_err_prereq_cb,
"curl_easy_setopt expects a curl_prereq_callback argument")
CURLWARNING(_curl_easy_setopt_err_trailer_cb,
CURLWARNING(Wcurl_easy_setopt_err_trailer_cb,
"curl_easy_setopt expects a curl_trailerfunc_ok argument")
CURLWARNING(_curl_easy_setopt_err_error_buffer,
CURLWARNING(Wcurl_easy_setopt_err_error_buffer,
"curl_easy_setopt expects a "
"char buffer of CURL_ERROR_SIZE as argument")
CURLWARNING(_curl_easy_setopt_err_curlu,
CURLWARNING(Wcurl_easy_setopt_err_curlu,
"curl_easy_setopt expects a 'CURLU *' argument")
CURLWARNING(_curl_easy_setopt_err_curl,
CURLWARNING(Wcurl_easy_setopt_err_curl,
"curl_easy_setopt expects a 'CURL *' argument")
CURLWARNING(_curl_easy_setopt_err_FILE,
CURLWARNING(Wcurl_easy_setopt_err_FILE,
"curl_easy_setopt expects a 'FILE *' argument")
CURLWARNING(_curl_easy_setopt_err_postfields,
CURLWARNING(Wcurl_easy_setopt_err_postfields,
"curl_easy_setopt expects a 'void *' or 'char *' argument")
CURLWARNING(_curl_easy_setopt_err_curl_httpost,
CURLWARNING(Wcurl_easy_setopt_err_curl_httpost,
"curl_easy_setopt expects a 'struct curl_httppost *' "
"argument")
CURLWARNING(_curl_easy_setopt_err_curl_mimepost,
CURLWARNING(Wcurl_easy_setopt_err_curl_mimepost,
"curl_easy_setopt expects a 'curl_mime *' "
"argument")
CURLWARNING(_curl_easy_setopt_err_curl_slist,
CURLWARNING(Wcurl_easy_setopt_err_curl_slist,
"curl_easy_setopt expects a 'struct curl_slist *' argument")
CURLWARNING(_curl_easy_setopt_err_CURLSH,
CURLWARNING(Wcurl_easy_setopt_err_CURLSH,
"curl_easy_setopt expects a CURLSH* argument")
CURLWARNING(_curl_easy_getinfo_err_string,
CURLWARNING(Wcurl_easy_getinfo_err_string,
"curl_easy_getinfo expects a pointer to 'char *'")
CURLWARNING(_curl_easy_getinfo_err_long,
CURLWARNING(Wcurl_easy_getinfo_err_long,
"curl_easy_getinfo expects a pointer to long")
CURLWARNING(_curl_easy_getinfo_err_double,
CURLWARNING(Wcurl_easy_getinfo_err_double,
"curl_easy_getinfo expects a pointer to double")
CURLWARNING(_curl_easy_getinfo_err_curl_slist,
CURLWARNING(Wcurl_easy_getinfo_err_curl_slist,
"curl_easy_getinfo expects a pointer to 'struct curl_slist *'")
CURLWARNING(_curl_easy_getinfo_err_curl_tlssessioninfo,
CURLWARNING(Wcurl_easy_getinfo_err_curl_tlssessioninfo,
"curl_easy_getinfo expects a pointer to "
"'struct curl_tlssessioninfo *'")
CURLWARNING(_curl_easy_getinfo_err_curl_certinfo,
CURLWARNING(Wcurl_easy_getinfo_err_curl_certinfo,
"curl_easy_getinfo expects a pointer to "
"'struct curl_certinfo *'")
CURLWARNING(_curl_easy_getinfo_err_curl_socket,
CURLWARNING(Wcurl_easy_getinfo_err_curl_socket,
"curl_easy_getinfo expects a pointer to curl_socket_t")
CURLWARNING(_curl_easy_getinfo_err_curl_off_t,
CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t,
"curl_easy_getinfo expects a pointer to curl_off_t")
/* groups of curl_easy_setops options that take the same type of argument */
/* evaluates to true if option takes a long argument */
#define curlcheck_long_option(option) \
#define curlcheck_long_option(option) \
(0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)
#define curlcheck_off_t_option(option) \
(((option) > CURLOPTTYPE_OFF_T) && ((option) < CURLOPTTYPE_BLOB))
/* option takes a CURL * argument */
#define curlcheck_curl_option(option) \
((option) == CURLOPT_STREAM_DEPENDS || \
(option) == CURLOPT_STREAM_DEPENDS_E || \
#define curlcheck_curl_option(option) \
((option) == CURLOPT_STREAM_DEPENDS || \
(option) == CURLOPT_STREAM_DEPENDS_E || \
0)
/* evaluates to true if option takes a char* argument */
@@ -534,6 +617,14 @@ CURLWARNING(_curl_easy_getinfo_err_curl_off_t,
__builtin_types_compatible_p(__typeof__(expr), type *) || \
__builtin_types_compatible_p(__typeof__(expr), const type *))
/* evaluates to true if expr is type**, const type** or NULL */
#define curlcheck_ptrptr(expr, type) \
(curlcheck_NULL(expr) || \
__builtin_types_compatible_p(__typeof__(expr), type **) || \
__builtin_types_compatible_p(__typeof__(expr), type *[]) || \
__builtin_types_compatible_p(__typeof__(expr), const type *[]) || \
__builtin_types_compatible_p(__typeof__(expr), const type **))
/* evaluates to true if expr is one of type[], type*, NULL or const type* */
#define curlcheck_arr(expr, type) \
(curlcheck_ptr((expr), type) || \
@@ -546,7 +637,7 @@ CURLWARNING(_curl_easy_getinfo_err_curl_off_t,
curlcheck_arr((expr), unsigned char))
/* evaluates to true if expr is a CURL * */
#define curlcheck_curl(expr) \
#define curlcheck_curl(expr) \
(curlcheck_NULL(expr) || \
__builtin_types_compatible_p(__typeof__(expr), CURL *))
@@ -593,7 +684,7 @@ CURLWARNING(_curl_easy_getinfo_err_curl_off_t,
(curlcheck_ptr((expr), void) || \
curlcheck_ptr((expr), FILE))
#else /* be less strict */
#define curlcheck_cb_data(expr) \
#define curlcheck_cb_data(expr) \
curlcheck_any_ptr(expr)
#endif
@@ -624,60 +715,60 @@ CURLWARNING(_curl_easy_getinfo_err_curl_off_t,
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), __typeof__(fread) *) || \
curlcheck_cb_compatible((expr), curl_read_callback) || \
curlcheck_cb_compatible((expr), _curl_read_callback1) || \
curlcheck_cb_compatible((expr), _curl_read_callback2) || \
curlcheck_cb_compatible((expr), _curl_read_callback3) || \
curlcheck_cb_compatible((expr), _curl_read_callback4) || \
curlcheck_cb_compatible((expr), _curl_read_callback5) || \
curlcheck_cb_compatible((expr), _curl_read_callback6))
typedef size_t (*_curl_read_callback1)(char *, size_t, size_t, void *);
typedef size_t (*_curl_read_callback2)(char *, size_t, size_t, const void *);
typedef size_t (*_curl_read_callback3)(char *, size_t, size_t, FILE *);
typedef size_t (*_curl_read_callback4)(void *, size_t, size_t, void *);
typedef size_t (*_curl_read_callback5)(void *, size_t, size_t, const void *);
typedef size_t (*_curl_read_callback6)(void *, size_t, size_t, FILE *);
curlcheck_cb_compatible((expr), Wcurl_read_callback1) || \
curlcheck_cb_compatible((expr), Wcurl_read_callback2) || \
curlcheck_cb_compatible((expr), Wcurl_read_callback3) || \
curlcheck_cb_compatible((expr), Wcurl_read_callback4) || \
curlcheck_cb_compatible((expr), Wcurl_read_callback5) || \
curlcheck_cb_compatible((expr), Wcurl_read_callback6))
typedef size_t (*Wcurl_read_callback1)(char *, size_t, size_t, void *);
typedef size_t (*Wcurl_read_callback2)(char *, size_t, size_t, const void *);
typedef size_t (*Wcurl_read_callback3)(char *, size_t, size_t, FILE *);
typedef size_t (*Wcurl_read_callback4)(void *, size_t, size_t, void *);
typedef size_t (*Wcurl_read_callback5)(void *, size_t, size_t, const void *);
typedef size_t (*Wcurl_read_callback6)(void *, size_t, size_t, FILE *);
/* evaluates to true if expr is of type curl_write_callback or "similar" */
#define curlcheck_write_cb(expr) \
(curlcheck_read_cb(expr) || \
curlcheck_cb_compatible((expr), __typeof__(fwrite) *) || \
curlcheck_cb_compatible((expr), curl_write_callback) || \
curlcheck_cb_compatible((expr), _curl_write_callback1) || \
curlcheck_cb_compatible((expr), _curl_write_callback2) || \
curlcheck_cb_compatible((expr), _curl_write_callback3) || \
curlcheck_cb_compatible((expr), _curl_write_callback4) || \
curlcheck_cb_compatible((expr), _curl_write_callback5) || \
curlcheck_cb_compatible((expr), _curl_write_callback6))
typedef size_t (*_curl_write_callback1)(const char *, size_t, size_t, void *);
typedef size_t (*_curl_write_callback2)(const char *, size_t, size_t,
curlcheck_cb_compatible((expr), Wcurl_write_callback1) || \
curlcheck_cb_compatible((expr), Wcurl_write_callback2) || \
curlcheck_cb_compatible((expr), Wcurl_write_callback3) || \
curlcheck_cb_compatible((expr), Wcurl_write_callback4) || \
curlcheck_cb_compatible((expr), Wcurl_write_callback5) || \
curlcheck_cb_compatible((expr), Wcurl_write_callback6))
typedef size_t (*Wcurl_write_callback1)(const char *, size_t, size_t, void *);
typedef size_t (*Wcurl_write_callback2)(const char *, size_t, size_t,
const void *);
typedef size_t (*_curl_write_callback3)(const char *, size_t, size_t, FILE *);
typedef size_t (*_curl_write_callback4)(const void *, size_t, size_t, void *);
typedef size_t (*_curl_write_callback5)(const void *, size_t, size_t,
typedef size_t (*Wcurl_write_callback3)(const char *, size_t, size_t, FILE *);
typedef size_t (*Wcurl_write_callback4)(const void *, size_t, size_t, void *);
typedef size_t (*Wcurl_write_callback5)(const void *, size_t, size_t,
const void *);
typedef size_t (*_curl_write_callback6)(const void *, size_t, size_t, FILE *);
typedef size_t (*Wcurl_write_callback6)(const void *, size_t, size_t, FILE *);
/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
#define curlcheck_ioctl_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_ioctl_callback) || \
curlcheck_cb_compatible((expr), _curl_ioctl_callback1) || \
curlcheck_cb_compatible((expr), _curl_ioctl_callback2) || \
curlcheck_cb_compatible((expr), _curl_ioctl_callback3) || \
curlcheck_cb_compatible((expr), _curl_ioctl_callback4))
typedef curlioerr (*_curl_ioctl_callback1)(CURL *, int, void *);
typedef curlioerr (*_curl_ioctl_callback2)(CURL *, int, const void *);
typedef curlioerr (*_curl_ioctl_callback3)(CURL *, curliocmd, void *);
typedef curlioerr (*_curl_ioctl_callback4)(CURL *, curliocmd, const void *);
curlcheck_cb_compatible((expr), Wcurl_ioctl_callback1) || \
curlcheck_cb_compatible((expr), Wcurl_ioctl_callback2) || \
curlcheck_cb_compatible((expr), Wcurl_ioctl_callback3) || \
curlcheck_cb_compatible((expr), Wcurl_ioctl_callback4))
typedef curlioerr (*Wcurl_ioctl_callback1)(CURL *, int, void *);
typedef curlioerr (*Wcurl_ioctl_callback2)(CURL *, int, const void *);
typedef curlioerr (*Wcurl_ioctl_callback3)(CURL *, curliocmd, void *);
typedef curlioerr (*Wcurl_ioctl_callback4)(CURL *, curliocmd, const void *);
/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */
#define curlcheck_sockopt_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_sockopt_callback) || \
curlcheck_cb_compatible((expr), _curl_sockopt_callback1) || \
curlcheck_cb_compatible((expr), _curl_sockopt_callback2))
typedef int (*_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
typedef int (*_curl_sockopt_callback2)(const void *, curl_socket_t,
curlcheck_cb_compatible((expr), Wcurl_sockopt_callback1) || \
curlcheck_cb_compatible((expr), Wcurl_sockopt_callback2))
typedef int (*Wcurl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
typedef int (*Wcurl_sockopt_callback2)(const void *, curl_socket_t,
curlsocktype);
/* evaluates to true if expr is of type curl_opensocket_callback or
@@ -685,28 +776,28 @@ typedef int (*_curl_sockopt_callback2)(const void *, curl_socket_t,
#define curlcheck_opensocket_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_opensocket_callback) || \
curlcheck_cb_compatible((expr), _curl_opensocket_callback1) || \
curlcheck_cb_compatible((expr), _curl_opensocket_callback2) || \
curlcheck_cb_compatible((expr), _curl_opensocket_callback3) || \
curlcheck_cb_compatible((expr), _curl_opensocket_callback4))
typedef curl_socket_t (*_curl_opensocket_callback1)
curlcheck_cb_compatible((expr), Wcurl_opensocket_callback1) || \
curlcheck_cb_compatible((expr), Wcurl_opensocket_callback2) || \
curlcheck_cb_compatible((expr), Wcurl_opensocket_callback3) || \
curlcheck_cb_compatible((expr), Wcurl_opensocket_callback4))
typedef curl_socket_t (*Wcurl_opensocket_callback1)
(void *, curlsocktype, struct curl_sockaddr *);
typedef curl_socket_t (*_curl_opensocket_callback2)
typedef curl_socket_t (*Wcurl_opensocket_callback2)
(void *, curlsocktype, const struct curl_sockaddr *);
typedef curl_socket_t (*_curl_opensocket_callback3)
typedef curl_socket_t (*Wcurl_opensocket_callback3)
(const void *, curlsocktype, struct curl_sockaddr *);
typedef curl_socket_t (*_curl_opensocket_callback4)
typedef curl_socket_t (*Wcurl_opensocket_callback4)
(const void *, curlsocktype, const struct curl_sockaddr *);
/* evaluates to true if expr is of type curl_progress_callback or "similar" */
#define curlcheck_progress_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_progress_callback) || \
curlcheck_cb_compatible((expr), _curl_progress_callback1) || \
curlcheck_cb_compatible((expr), _curl_progress_callback2))
typedef int (*_curl_progress_callback1)(void *,
curlcheck_cb_compatible((expr), Wcurl_progress_callback1) || \
curlcheck_cb_compatible((expr), Wcurl_progress_callback2))
typedef int (*Wcurl_progress_callback1)(void *,
double, double, double, double);
typedef int (*_curl_progress_callback2)(const void *,
typedef int (*Wcurl_progress_callback2)(const void *,
double, double, double, double);
/* evaluates to true if expr is of type curl_xferinfo_callback */
@@ -718,29 +809,29 @@ typedef int (*_curl_progress_callback2)(const void *,
#define curlcheck_debug_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_debug_callback) || \
curlcheck_cb_compatible((expr), _curl_debug_callback1) || \
curlcheck_cb_compatible((expr), _curl_debug_callback2) || \
curlcheck_cb_compatible((expr), _curl_debug_callback3) || \
curlcheck_cb_compatible((expr), _curl_debug_callback4) || \
curlcheck_cb_compatible((expr), _curl_debug_callback5) || \
curlcheck_cb_compatible((expr), _curl_debug_callback6) || \
curlcheck_cb_compatible((expr), _curl_debug_callback7) || \
curlcheck_cb_compatible((expr), _curl_debug_callback8))
typedef int (*_curl_debug_callback1) (CURL *,
curlcheck_cb_compatible((expr), Wcurl_debug_callback1) || \
curlcheck_cb_compatible((expr), Wcurl_debug_callback2) || \
curlcheck_cb_compatible((expr), Wcurl_debug_callback3) || \
curlcheck_cb_compatible((expr), Wcurl_debug_callback4) || \
curlcheck_cb_compatible((expr), Wcurl_debug_callback5) || \
curlcheck_cb_compatible((expr), Wcurl_debug_callback6) || \
curlcheck_cb_compatible((expr), Wcurl_debug_callback7) || \
curlcheck_cb_compatible((expr), Wcurl_debug_callback8))
typedef int (*Wcurl_debug_callback1) (CURL *,
curl_infotype, char *, size_t, void *);
typedef int (*_curl_debug_callback2) (CURL *,
typedef int (*Wcurl_debug_callback2) (CURL *,
curl_infotype, char *, size_t, const void *);
typedef int (*_curl_debug_callback3) (CURL *,
typedef int (*Wcurl_debug_callback3) (CURL *,
curl_infotype, const char *, size_t, void *);
typedef int (*_curl_debug_callback4) (CURL *,
typedef int (*Wcurl_debug_callback4) (CURL *,
curl_infotype, const char *, size_t, const void *);
typedef int (*_curl_debug_callback5) (CURL *,
typedef int (*Wcurl_debug_callback5) (CURL *,
curl_infotype, unsigned char *, size_t, void *);
typedef int (*_curl_debug_callback6) (CURL *,
typedef int (*Wcurl_debug_callback6) (CURL *,
curl_infotype, unsigned char *, size_t, const void *);
typedef int (*_curl_debug_callback7) (CURL *,
typedef int (*Wcurl_debug_callback7) (CURL *,
curl_infotype, const unsigned char *, size_t, void *);
typedef int (*_curl_debug_callback8) (CURL *,
typedef int (*Wcurl_debug_callback8) (CURL *,
curl_infotype, const unsigned char *, size_t, const void *);
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
@@ -748,66 +839,66 @@ typedef int (*_curl_debug_callback8) (CURL *,
#define curlcheck_ssl_ctx_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_ssl_ctx_callback) || \
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback1) || \
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback2) || \
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback3) || \
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback4) || \
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback5) || \
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback6) || \
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback7) || \
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback8))
typedef CURLcode (*_curl_ssl_ctx_callback1)(CURL *, void *, void *);
typedef CURLcode (*_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
typedef CURLcode (*_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
typedef CURLcode (*_curl_ssl_ctx_callback4)(CURL *, const void *,
curlcheck_cb_compatible((expr), Wcurl_ssl_ctx_callback1) || \
curlcheck_cb_compatible((expr), Wcurl_ssl_ctx_callback2) || \
curlcheck_cb_compatible((expr), Wcurl_ssl_ctx_callback3) || \
curlcheck_cb_compatible((expr), Wcurl_ssl_ctx_callback4) || \
curlcheck_cb_compatible((expr), Wcurl_ssl_ctx_callback5) || \
curlcheck_cb_compatible((expr), Wcurl_ssl_ctx_callback6) || \
curlcheck_cb_compatible((expr), Wcurl_ssl_ctx_callback7) || \
curlcheck_cb_compatible((expr), Wcurl_ssl_ctx_callback8))
typedef CURLcode (*Wcurl_ssl_ctx_callback1)(CURL *, void *, void *);
typedef CURLcode (*Wcurl_ssl_ctx_callback2)(CURL *, void *, const void *);
typedef CURLcode (*Wcurl_ssl_ctx_callback3)(CURL *, const void *, void *);
typedef CURLcode (*Wcurl_ssl_ctx_callback4)(CURL *, const void *,
const void *);
#ifdef HEADER_SSL_H
/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
* this will of course break if we are included before OpenSSL headers...
*/
typedef CURLcode (*_curl_ssl_ctx_callback5)(CURL *, SSL_CTX *, void *);
typedef CURLcode (*_curl_ssl_ctx_callback6)(CURL *, SSL_CTX *, const void *);
typedef CURLcode (*_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX *, void *);
typedef CURLcode (*_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX *,
typedef CURLcode (*Wcurl_ssl_ctx_callback5)(CURL *, SSL_CTX *, void *);
typedef CURLcode (*Wcurl_ssl_ctx_callback6)(CURL *, SSL_CTX *, const void *);
typedef CURLcode (*Wcurl_ssl_ctx_callback7)(CURL *, const SSL_CTX *, void *);
typedef CURLcode (*Wcurl_ssl_ctx_callback8)(CURL *, const SSL_CTX *,
const void *);
#else
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;
typedef Wcurl_ssl_ctx_callback1 Wcurl_ssl_ctx_callback5;
typedef Wcurl_ssl_ctx_callback1 Wcurl_ssl_ctx_callback6;
typedef Wcurl_ssl_ctx_callback1 Wcurl_ssl_ctx_callback7;
typedef Wcurl_ssl_ctx_callback1 Wcurl_ssl_ctx_callback8;
#endif
/* evaluates to true if expr is of type curl_conv_callback or "similar" */
#define curlcheck_conv_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_conv_callback) || \
curlcheck_cb_compatible((expr), _curl_conv_callback1) || \
curlcheck_cb_compatible((expr), _curl_conv_callback2) || \
curlcheck_cb_compatible((expr), _curl_conv_callback3) || \
curlcheck_cb_compatible((expr), _curl_conv_callback4))
typedef CURLcode (*_curl_conv_callback1)(char *, size_t length);
typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);
typedef CURLcode (*_curl_conv_callback3)(void *, size_t length);
typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);
curlcheck_cb_compatible((expr), Wcurl_conv_callback1) || \
curlcheck_cb_compatible((expr), Wcurl_conv_callback2) || \
curlcheck_cb_compatible((expr), Wcurl_conv_callback3) || \
curlcheck_cb_compatible((expr), Wcurl_conv_callback4))
typedef CURLcode (*Wcurl_conv_callback1)(char *, size_t length);
typedef CURLcode (*Wcurl_conv_callback2)(const char *, size_t length);
typedef CURLcode (*Wcurl_conv_callback3)(void *, size_t length);
typedef CURLcode (*Wcurl_conv_callback4)(const void *, size_t length);
/* evaluates to true if expr is of type curl_seek_callback or "similar" */
#define curlcheck_seek_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_seek_callback) || \
curlcheck_cb_compatible((expr), _curl_seek_callback1) || \
curlcheck_cb_compatible((expr), _curl_seek_callback2))
typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);
typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);
curlcheck_cb_compatible((expr), Wcurl_seek_callback1) || \
curlcheck_cb_compatible((expr), Wcurl_seek_callback2))
typedef CURLcode (*Wcurl_seek_callback1)(void *, curl_off_t, int);
typedef CURLcode (*Wcurl_seek_callback2)(const void *, curl_off_t, int);
/* evaluates to true if expr is of type curl_chunk_bgn_callback */
#define curlcheck_chunk_bgn_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_chunk_bgn_callback) || \
curlcheck_cb_compatible((expr), _curl_chunk_bgn_callback1) || \
curlcheck_cb_compatible((expr), _curl_chunk_bgn_callback2))
typedef long (*_curl_chunk_bgn_callback1)(struct curl_fileinfo *,
curlcheck_cb_compatible((expr), Wcurl_chunk_bgn_callback1) || \
curlcheck_cb_compatible((expr), Wcurl_chunk_bgn_callback2))
typedef long (*Wcurl_chunk_bgn_callback1)(struct curl_fileinfo *,
void *, int);
typedef long (*_curl_chunk_bgn_callback2)(void *, void *, int);
typedef long (*Wcurl_chunk_bgn_callback2)(void *, void *, int);
/* evaluates to true if expr is of type curl_chunk_end_callback */
#define curlcheck_chunk_end_cb(expr) \
@@ -840,28 +931,28 @@ typedef long (*_curl_chunk_bgn_callback2)(void *, void *, int);
curlcheck_cb_compatible((expr), curl_sshhostkeycallback))
/* evaluates to true if expr is of type curl_sshkeycallback */
#define curlcheck_ssh_key_cb(expr) \
(curlcheck_NULL(expr) || \
#define curlcheck_ssh_key_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_sshkeycallback))
/* evaluates to true if expr is of type curl_interleave_callback */
#define curlcheck_interleave_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), _curl_interleave_callback1) || \
curlcheck_cb_compatible((expr), _curl_interleave_callback2))
typedef size_t (*_curl_interleave_callback1)(void *p, size_t s,
curlcheck_cb_compatible((expr), Wcurl_interleave_callback1) || \
curlcheck_cb_compatible((expr), Wcurl_interleave_callback2))
typedef size_t (*Wcurl_interleave_callback1)(void *p, size_t s,
size_t n, void *u);
typedef size_t (*_curl_interleave_callback2)(char *p, size_t s,
typedef size_t (*Wcurl_interleave_callback2)(char *p, size_t s,
size_t n, void *u);
/* evaluates to true if expr is of type curl_prereq_callback */
#define curlcheck_prereq_cb(expr) \
(curlcheck_NULL(expr) || \
#define curlcheck_prereq_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_prereq_callback))
/* evaluates to true if expr is of type curl_trailer_callback */
#define curlcheck_trailer_cb(expr) \
(curlcheck_NULL(expr) || \
#define curlcheck_trailer_cb(expr) \
(curlcheck_NULL(expr) || \
curlcheck_cb_compatible((expr), curl_trailer_callback))
#endif /* CURLINC_TYPECHECK_GCC_H */

View File

@@ -26,7 +26,7 @@
#include "curl.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -24,7 +24,7 @@
*
***************************************************************************/
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
#endif
@@ -72,13 +72,26 @@ CURL_EXTERN CURLcode curl_ws_send(CURL *curl, const void *buffer,
curl_off_t fragsize,
unsigned int flags);
/*
* NAME curl_ws_start_frame()
*
* DESCRIPTION
*
* Buffers a websocket frame header with the given flags and length.
* Errors when a previous frame is not complete, e.g. not all its
* payload has been added.
*/
CURL_EXTERN CURLcode curl_ws_start_frame(CURL *curl,
unsigned int flags,
curl_off_t frame_len);
/* bits for the CURLOPT_WS_OPTIONS bitmask: */
#define CURLWS_RAW_MODE (1<<0)
#define CURLWS_NOAUTOPONG (1<<1)
#define CURLWS_RAW_MODE (1L<<0)
#define CURLWS_NOAUTOPONG (1L<<1)
CURL_EXTERN const struct curl_ws_frame *curl_ws_meta(CURL *curl);
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

View File

@@ -68,7 +68,7 @@ VERSION_PATCH :: 0
CURL_VERSION_BITS() macro since curl's own configure script greps for it
and needs it to contain the full number.
*/
VERSION_NUM :: 0x080f00
VERSION_NUM :: 0x081100
/*
* This is the date and time when the full source package was created. The
@@ -79,7 +79,7 @@ VERSION_NUM :: 0x080f00
*
* "2007-11-23"
*/
TIMESTAMP :: "2025-07-16"
TIMESTAMP :: "2025-11-05"
/* linked-list structure for the CURLOPT_QUOTE option (and other) */

View File

@@ -332,8 +332,50 @@ Moption :: enum c.int {
/* maximum number of concurrent streams to support on a connection */
MAX_CONCURRENT_STREAMS = OPTTYPE_LONG + 16,
/* network has changed, adjust caches/connection reuse */
NETWORK_CHANGED = OPTTYPE_LONG + 17,
/* This is the notify callback function pointer */
NOTIFYFUNCTION = OPTTYPE_FUNCTIONPOINT + 18,
/* This is the argument passed to the notify callback */
NOTIFYDATA = OPTTYPE_OBJECTPOINT + 19,
}
/* Definition of bits for the CURLMOPT_NETWORK_CHANGED argument: */
/* - CURLMNWC_CLEAR_CONNS tells libcurl to prevent further reuse of existing
connections. Connections that are idle will be closed. Ongoing transfers
will continue with the connection they have. */
MNWC_CLEAR_CONNS :: 1 << 0
/* - CURLMNWC_CLEAR_DNS tells libcurl to prevent further reuse of existing
connections. Connections that are idle will be closed. Ongoing transfers
will continue with the connection they have. */
MNWC_CLEAR_DNS :: 1 << 0
Minfo :: enum c.int {
/* first, never use this */
NONE = 0,
/* The number of easy handles currently managed by the multi handle,
* e.g. have been added but not yet removed. */
XFERS_CURRENT = 1,
/* The number of easy handles running, e.g. not done and not queueing. */
XFERS_RUNNING = 2,
/* The number of easy handles waiting to start, e.g. for a connection
* to become available due to limits on parallelism, max connections
* or other factors. */
INFO_XFERS_PENDING = 3,
/* The number of easy handles finished, waiting for their results to
* be read via `curl_multi_info_read()`. */
XFERS_DONE = 4,
/* The total number of easy handles added to the multi handle, ever. */
XFERS_ADDED = 5,
/* the last unused */
LASTENTRY,
}
@(default_calling_convention="c", link_prefix="curl_")
foreign lib {
@@ -370,6 +412,34 @@ foreign lib {
*/
multi_get_handles :: proc(multi_handle: ^CURLM) -> ^^CURL ---
/*
* Name: curl_multi_get_offt()
*
* Desc: Retrieves a numeric value for the `CURLMINFO_*` enums.
*
* Returns: CULRM_OK or error when value could not be obtained.
*/
multi_get_offt :: proc(multi_handle: ^CURLM, info: Minfo, value: ^off_t) -> Mcode ---
}
/*
* Notifications dispatched by a multi handle, when enabled.
*/
MULTI_NOTIFY :: enum c.uint {
INFO_READ = 0,
EASY_DONE = 1,
}
/*
* Callback to install via CURLMOPT_NOTIFYFUNCTION.
*/
curl_notify_function :: #type proc "c" (multi_handle: ^CURLM, notification: MULTI_NOTIFY, easy: ^CURL, user_data: rawptr)
@(default_calling_convention="c", link_prefix="curl_")
foreign lib {
multi_notify_disable :: proc(multi: ^CURLM, notification: MULTI_NOTIFY) -> Mcode ---
multi_notify_enable :: proc(multi: ^CURLM, notification: MULTI_NOTIFY) -> Mcode ---
}
/*

View File

@@ -59,11 +59,24 @@ foreign lib {
* Sends data over the websocket connection. Use after successful
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
*/
ws_send :: proc(curl: CURL, buffer: rawptr,
ws_send :: proc(curl: ^CURL, buffer: rawptr,
buflen: c.size_t, sent: ^c.size_t,
fragsize: off_t,
flags: ws_flags) -> code ---
/*
* NAME curl_ws_start_frame()
*
* DESCRIPTION
*
* Buffers a websocket frame header with the given flags and length.
* Errors when a previous frame is not complete, e.g. not all its
* payload has been added.
*/
ws_start_frame :: proc(curl: ^CURL,
flags: c.uint,
frame_len: off_t) -> code ---
ws_meta :: proc(curl: ^CURL) -> ^ws_frame ---
}