mirror of
https://github.com/curl/curl.git
synced 2026-07-23 13:17:18 +03:00
tidy-up: miscellaneous
- vms/curlmsg_vms.h: delete unused/commented code. - vtls/schannel_verify: sort includes. - typecheck-gcc.h: fix indent and alignment. - lib/config-win32.h: drop idle `#undef`. - spacecheck: check for stray empty lines before after curly braces. - make literals more readable: 1048576 -> 1024 * 1024 - scope variables. - use ISO date in a comment. - drop redundant parentheses. - drop empty comments. - unfold lines. - duplicate/stray spaces in comments. - fix indent, whitespace, minor typos. Closes #20690
This commit is contained in:
parent
ac46392f44
commit
af78b199b2
89 changed files with 424 additions and 448 deletions
|
|
@ -59,7 +59,7 @@
|
|||
#define CURL_IGNORE_DEPRECATION(statements) statements
|
||||
#endif
|
||||
|
||||
#include "curlver.h" /* libcurl version defines */
|
||||
#include "curlver.h" /* libcurl version defines */
|
||||
#include "system.h" /* determine things runtime */
|
||||
|
||||
#include <stdio.h>
|
||||
|
|
@ -1358,7 +1358,7 @@ 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. */
|
||||
* is set but does not match one of these, 'private' will be used. */
|
||||
CURLOPTDEPRECATED(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63,
|
||||
8.17.0, "removed"),
|
||||
|
||||
|
|
@ -2203,7 +2203,7 @@ typedef enum {
|
|||
CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, CURLOPTTYPE_STRINGPOINT, 311),
|
||||
|
||||
/* Function that will be called immediately before the initial request
|
||||
is made on a connection (after any protocol negotiation step). */
|
||||
is made on a connection (after any protocol negotiation step). */
|
||||
CURLOPT(CURLOPT_PREREQFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 312),
|
||||
|
||||
/* Data passed to the CURLOPT_PREREQFUNCTION callback */
|
||||
|
|
@ -2283,7 +2283,6 @@ typedef enum {
|
|||
#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
|
||||
#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
|
||||
|
||||
/* */
|
||||
#define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT
|
||||
|
||||
/* Added in 8.2.0 */
|
||||
|
|
@ -3310,7 +3309,7 @@ CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *handle,
|
|||
#endif
|
||||
|
||||
/* unfortunately, the easy.h and multi.h include files need options and info
|
||||
stuff before they can be included! */
|
||||
stuff before they can be included! */
|
||||
#include "easy.h" /* nothing in curl is fun without the easy stuff */
|
||||
#include "multi.h"
|
||||
#include "urlapi.h"
|
||||
|
|
@ -3330,7 +3329,7 @@ CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *handle,
|
|||
/* This preprocessor magic that replaces a call with the exact same call is
|
||||
only done to make sure application authors pass exactly three arguments
|
||||
to these functions. Use recursive macros to allow using these symbols via
|
||||
the C++ global namespace '::' or reuse them as method names. */
|
||||
the C++ global namespace '::' or reusing them as method names. */
|
||||
#define curl_easy_setopt(handle, opt, param) \
|
||||
curl_easy_setopt(handle, opt, param)
|
||||
#define curl_easy_getinfo(handle, info, arg) \
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ extern "C" {
|
|||
struct curl_header {
|
||||
char *name; /* this might not use the same case */
|
||||
char *value;
|
||||
size_t amount; /* number of headers using this name */
|
||||
size_t amount; /* number of headers using this name */
|
||||
size_t index; /* ... of this instance, 0 or higher */
|
||||
unsigned int origin; /* see bits below */
|
||||
void *anchor; /* handle privately used by libcurl */
|
||||
|
|
|
|||
|
|
@ -367,20 +367,20 @@
|
|||
#define CURL_PULL_SYS_POLL_H
|
||||
#endif
|
||||
|
||||
/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */
|
||||
/* sys/types.h is required here to properly make type definitions below. */
|
||||
/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file
|
||||
sys/types.h is required here to properly make type definitions below. */
|
||||
#ifdef CURL_PULL_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */
|
||||
/* sys/socket.h is required here to properly make type definitions below. */
|
||||
/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file
|
||||
sys/socket.h is required here to properly make type definitions below. */
|
||||
#ifdef CURL_PULL_SYS_SOCKET_H
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
/* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file */
|
||||
/* sys/poll.h is required here to properly make type definitions below. */
|
||||
/* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file
|
||||
sys/poll.h is required here to properly make type definitions below. */
|
||||
#ifdef CURL_PULL_SYS_POLL_H
|
||||
# include <sys/poll.h>
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -43,186 +43,186 @@
|
|||
|
||||
#define curl_easy_setopt(handle, option, value) \
|
||||
__extension__({ \
|
||||
if(__builtin_constant_p(option)) { \
|
||||
CURL_IGNORE_DEPRECATION( \
|
||||
if(curlcheck_long_option(option)) \
|
||||
if(!curlcheck_long(value)) \
|
||||
Wcurl_easy_setopt_err_long(); \
|
||||
if(curlcheck_off_t_option(option)) \
|
||||
if(!curlcheck_off_t(value)) \
|
||||
Wcurl_easy_setopt_err_curl_off_t(); \
|
||||
if(curlcheck_string_option(option)) \
|
||||
if(!curlcheck_string(value)) \
|
||||
Wcurl_easy_setopt_err_string(); \
|
||||
if((option) == CURLOPT_PRIVATE) { } \
|
||||
if(curlcheck_write_cb_option(option)) \
|
||||
if(!curlcheck_write_cb(value)) \
|
||||
Wcurl_easy_setopt_err_write_callback(); \
|
||||
if(curlcheck_curl_option(option)) \
|
||||
if(!curlcheck_curl(value)) \
|
||||
Wcurl_easy_setopt_err_curl(); \
|
||||
if((option) == CURLOPT_RESOLVER_START_FUNCTION) \
|
||||
if(!curlcheck_resolver_start_callback(value)) \
|
||||
Wcurl_easy_setopt_err_resolver_start_callback(); \
|
||||
if((option) == CURLOPT_READFUNCTION) \
|
||||
if(!curlcheck_read_cb(value)) \
|
||||
Wcurl_easy_setopt_err_read_cb(); \
|
||||
if((option) == CURLOPT_IOCTLFUNCTION) \
|
||||
if(!curlcheck_ioctl_cb(value)) \
|
||||
Wcurl_easy_setopt_err_ioctl_cb(); \
|
||||
if((option) == CURLOPT_SOCKOPTFUNCTION) \
|
||||
if(!curlcheck_sockopt_cb(value)) \
|
||||
Wcurl_easy_setopt_err_sockopt_cb(); \
|
||||
if((option) == CURLOPT_OPENSOCKETFUNCTION) \
|
||||
if(!curlcheck_opensocket_cb(value)) \
|
||||
Wcurl_easy_setopt_err_opensocket_cb(); \
|
||||
if((option) == CURLOPT_PROGRESSFUNCTION) \
|
||||
if(!curlcheck_progress_cb(value)) \
|
||||
Wcurl_easy_setopt_err_progress_cb(); \
|
||||
if((option) == CURLOPT_XFERINFOFUNCTION) \
|
||||
if(!curlcheck_xferinfo_cb(value)) \
|
||||
Wcurl_easy_setopt_err_xferinfo_cb(); \
|
||||
if((option) == CURLOPT_DEBUGFUNCTION) \
|
||||
if(!curlcheck_debug_cb(value)) \
|
||||
Wcurl_easy_setopt_err_debug_cb(); \
|
||||
if((option) == CURLOPT_SSL_CTX_FUNCTION) \
|
||||
if(!curlcheck_ssl_ctx_cb(value)) \
|
||||
Wcurl_easy_setopt_err_ssl_ctx_cb(); \
|
||||
if(curlcheck_conv_cb_option(option)) \
|
||||
if(!curlcheck_conv_cb(value)) \
|
||||
Wcurl_easy_setopt_err_conv_cb(); \
|
||||
if((option) == CURLOPT_SEEKFUNCTION) \
|
||||
if(!curlcheck_seek_cb(value)) \
|
||||
Wcurl_easy_setopt_err_seek_cb(); \
|
||||
if((option) == CURLOPT_CHUNK_BGN_FUNCTION) \
|
||||
if(!curlcheck_chunk_bgn_cb(value)) \
|
||||
Wcurl_easy_setopt_err_chunk_bgn_cb(); \
|
||||
if((option) == CURLOPT_CHUNK_END_FUNCTION) \
|
||||
if(!curlcheck_chunk_end_cb(value)) \
|
||||
Wcurl_easy_setopt_err_chunk_end_cb(); \
|
||||
if((option) == CURLOPT_CLOSESOCKETFUNCTION) \
|
||||
if(!curlcheck_close_socket_cb(value)) \
|
||||
Wcurl_easy_setopt_err_close_socket_cb(); \
|
||||
if((option) == CURLOPT_FNMATCH_FUNCTION) \
|
||||
if(!curlcheck_fnmatch_cb(value)) \
|
||||
Wcurl_easy_setopt_err_fnmatch_cb(); \
|
||||
if((option) == CURLOPT_HSTSREADFUNCTION) \
|
||||
if(!curlcheck_hstsread_cb(value)) \
|
||||
Wcurl_easy_setopt_err_hstsread_cb(); \
|
||||
if((option) == CURLOPT_HSTSWRITEFUNCTION) \
|
||||
if(!curlcheck_hstswrite_cb(value)) \
|
||||
Wcurl_easy_setopt_err_hstswrite_cb(); \
|
||||
if((option) == CURLOPT_SSH_HOSTKEYFUNCTION) \
|
||||
if(!curlcheck_ssh_hostkey_cb(value)) \
|
||||
Wcurl_easy_setopt_err_ssh_hostkey_cb(); \
|
||||
if((option) == CURLOPT_SSH_KEYFUNCTION) \
|
||||
if(!curlcheck_ssh_key_cb(value)) \
|
||||
Wcurl_easy_setopt_err_ssh_key_cb(); \
|
||||
if((option) == CURLOPT_INTERLEAVEFUNCTION) \
|
||||
if(!curlcheck_interleave_cb(value)) \
|
||||
Wcurl_easy_setopt_err_interleave_cb(); \
|
||||
if((option) == CURLOPT_PREREQFUNCTION) \
|
||||
if(!curlcheck_prereq_cb(value)) \
|
||||
Wcurl_easy_setopt_err_prereq_cb(); \
|
||||
if((option) == CURLOPT_TRAILERFUNCTION) \
|
||||
if(!curlcheck_trailer_cb(value)) \
|
||||
Wcurl_easy_setopt_err_trailer_cb(); \
|
||||
if(curlcheck_cb_data_option(option)) \
|
||||
if(!curlcheck_cb_data(value)) \
|
||||
Wcurl_easy_setopt_err_cb_data(); \
|
||||
if((option) == CURLOPT_ERRORBUFFER) \
|
||||
if(!curlcheck_error_buffer(value)) \
|
||||
Wcurl_easy_setopt_err_error_buffer(); \
|
||||
if((option) == CURLOPT_CURLU) \
|
||||
if(!curlcheck_ptr((value), CURLU)) \
|
||||
Wcurl_easy_setopt_err_curlu(); \
|
||||
if((option) == CURLOPT_STDERR) \
|
||||
if(!curlcheck_FILE(value)) \
|
||||
Wcurl_easy_setopt_err_FILE(); \
|
||||
if(curlcheck_postfields_option(option)) \
|
||||
if(!curlcheck_postfields(value)) \
|
||||
Wcurl_easy_setopt_err_postfields(); \
|
||||
if((option) == CURLOPT_HTTPPOST) \
|
||||
if(!curlcheck_arr((value), struct curl_httppost)) \
|
||||
Wcurl_easy_setopt_err_curl_httpost(); \
|
||||
if((option) == CURLOPT_MIMEPOST) \
|
||||
if(!curlcheck_ptr((value), curl_mime)) \
|
||||
Wcurl_easy_setopt_err_curl_mimepost(); \
|
||||
if(curlcheck_slist_option(option)) \
|
||||
if(!curlcheck_arr((value), struct curl_slist)) \
|
||||
Wcurl_easy_setopt_err_curl_slist(); \
|
||||
if((option) == CURLOPT_SHARE) \
|
||||
if(!curlcheck_ptr((value), CURLSH)) \
|
||||
Wcurl_easy_setopt_err_CURLSH(); \
|
||||
) \
|
||||
} \
|
||||
(curl_easy_setopt)(handle, option, value); \
|
||||
})
|
||||
if(__builtin_constant_p(option)) { \
|
||||
CURL_IGNORE_DEPRECATION( \
|
||||
if(curlcheck_long_option(option)) \
|
||||
if(!curlcheck_long(value)) \
|
||||
Wcurl_easy_setopt_err_long(); \
|
||||
if(curlcheck_off_t_option(option)) \
|
||||
if(!curlcheck_off_t(value)) \
|
||||
Wcurl_easy_setopt_err_curl_off_t(); \
|
||||
if(curlcheck_string_option(option)) \
|
||||
if(!curlcheck_string(value)) \
|
||||
Wcurl_easy_setopt_err_string(); \
|
||||
if((option) == CURLOPT_PRIVATE) { } \
|
||||
if(curlcheck_write_cb_option(option)) \
|
||||
if(!curlcheck_write_cb(value)) \
|
||||
Wcurl_easy_setopt_err_write_callback(); \
|
||||
if(curlcheck_curl_option(option)) \
|
||||
if(!curlcheck_curl(value)) \
|
||||
Wcurl_easy_setopt_err_curl(); \
|
||||
if((option) == CURLOPT_RESOLVER_START_FUNCTION) \
|
||||
if(!curlcheck_resolver_start_callback(value)) \
|
||||
Wcurl_easy_setopt_err_resolver_start_callback(); \
|
||||
if((option) == CURLOPT_READFUNCTION) \
|
||||
if(!curlcheck_read_cb(value)) \
|
||||
Wcurl_easy_setopt_err_read_cb(); \
|
||||
if((option) == CURLOPT_IOCTLFUNCTION) \
|
||||
if(!curlcheck_ioctl_cb(value)) \
|
||||
Wcurl_easy_setopt_err_ioctl_cb(); \
|
||||
if((option) == CURLOPT_SOCKOPTFUNCTION) \
|
||||
if(!curlcheck_sockopt_cb(value)) \
|
||||
Wcurl_easy_setopt_err_sockopt_cb(); \
|
||||
if((option) == CURLOPT_OPENSOCKETFUNCTION) \
|
||||
if(!curlcheck_opensocket_cb(value)) \
|
||||
Wcurl_easy_setopt_err_opensocket_cb(); \
|
||||
if((option) == CURLOPT_PROGRESSFUNCTION) \
|
||||
if(!curlcheck_progress_cb(value)) \
|
||||
Wcurl_easy_setopt_err_progress_cb(); \
|
||||
if((option) == CURLOPT_XFERINFOFUNCTION) \
|
||||
if(!curlcheck_xferinfo_cb(value)) \
|
||||
Wcurl_easy_setopt_err_xferinfo_cb(); \
|
||||
if((option) == CURLOPT_DEBUGFUNCTION) \
|
||||
if(!curlcheck_debug_cb(value)) \
|
||||
Wcurl_easy_setopt_err_debug_cb(); \
|
||||
if((option) == CURLOPT_SSL_CTX_FUNCTION) \
|
||||
if(!curlcheck_ssl_ctx_cb(value)) \
|
||||
Wcurl_easy_setopt_err_ssl_ctx_cb(); \
|
||||
if(curlcheck_conv_cb_option(option)) \
|
||||
if(!curlcheck_conv_cb(value)) \
|
||||
Wcurl_easy_setopt_err_conv_cb(); \
|
||||
if((option) == CURLOPT_SEEKFUNCTION) \
|
||||
if(!curlcheck_seek_cb(value)) \
|
||||
Wcurl_easy_setopt_err_seek_cb(); \
|
||||
if((option) == CURLOPT_CHUNK_BGN_FUNCTION) \
|
||||
if(!curlcheck_chunk_bgn_cb(value)) \
|
||||
Wcurl_easy_setopt_err_chunk_bgn_cb(); \
|
||||
if((option) == CURLOPT_CHUNK_END_FUNCTION) \
|
||||
if(!curlcheck_chunk_end_cb(value)) \
|
||||
Wcurl_easy_setopt_err_chunk_end_cb(); \
|
||||
if((option) == CURLOPT_CLOSESOCKETFUNCTION) \
|
||||
if(!curlcheck_close_socket_cb(value)) \
|
||||
Wcurl_easy_setopt_err_close_socket_cb(); \
|
||||
if((option) == CURLOPT_FNMATCH_FUNCTION) \
|
||||
if(!curlcheck_fnmatch_cb(value)) \
|
||||
Wcurl_easy_setopt_err_fnmatch_cb(); \
|
||||
if((option) == CURLOPT_HSTSREADFUNCTION) \
|
||||
if(!curlcheck_hstsread_cb(value)) \
|
||||
Wcurl_easy_setopt_err_hstsread_cb(); \
|
||||
if((option) == CURLOPT_HSTSWRITEFUNCTION) \
|
||||
if(!curlcheck_hstswrite_cb(value)) \
|
||||
Wcurl_easy_setopt_err_hstswrite_cb(); \
|
||||
if((option) == CURLOPT_SSH_HOSTKEYFUNCTION) \
|
||||
if(!curlcheck_ssh_hostkey_cb(value)) \
|
||||
Wcurl_easy_setopt_err_ssh_hostkey_cb(); \
|
||||
if((option) == CURLOPT_SSH_KEYFUNCTION) \
|
||||
if(!curlcheck_ssh_key_cb(value)) \
|
||||
Wcurl_easy_setopt_err_ssh_key_cb(); \
|
||||
if((option) == CURLOPT_INTERLEAVEFUNCTION) \
|
||||
if(!curlcheck_interleave_cb(value)) \
|
||||
Wcurl_easy_setopt_err_interleave_cb(); \
|
||||
if((option) == CURLOPT_PREREQFUNCTION) \
|
||||
if(!curlcheck_prereq_cb(value)) \
|
||||
Wcurl_easy_setopt_err_prereq_cb(); \
|
||||
if((option) == CURLOPT_TRAILERFUNCTION) \
|
||||
if(!curlcheck_trailer_cb(value)) \
|
||||
Wcurl_easy_setopt_err_trailer_cb(); \
|
||||
if(curlcheck_cb_data_option(option)) \
|
||||
if(!curlcheck_cb_data(value)) \
|
||||
Wcurl_easy_setopt_err_cb_data(); \
|
||||
if((option) == CURLOPT_ERRORBUFFER) \
|
||||
if(!curlcheck_error_buffer(value)) \
|
||||
Wcurl_easy_setopt_err_error_buffer(); \
|
||||
if((option) == CURLOPT_CURLU) \
|
||||
if(!curlcheck_ptr((value), CURLU)) \
|
||||
Wcurl_easy_setopt_err_curlu(); \
|
||||
if((option) == CURLOPT_STDERR) \
|
||||
if(!curlcheck_FILE(value)) \
|
||||
Wcurl_easy_setopt_err_FILE(); \
|
||||
if(curlcheck_postfields_option(option)) \
|
||||
if(!curlcheck_postfields(value)) \
|
||||
Wcurl_easy_setopt_err_postfields(); \
|
||||
if((option) == CURLOPT_HTTPPOST) \
|
||||
if(!curlcheck_arr((value), struct curl_httppost)) \
|
||||
Wcurl_easy_setopt_err_curl_httpost(); \
|
||||
if((option) == CURLOPT_MIMEPOST) \
|
||||
if(!curlcheck_ptr((value), curl_mime)) \
|
||||
Wcurl_easy_setopt_err_curl_mimepost(); \
|
||||
if(curlcheck_slist_option(option)) \
|
||||
if(!curlcheck_arr((value), struct curl_slist)) \
|
||||
Wcurl_easy_setopt_err_curl_slist(); \
|
||||
if((option) == CURLOPT_SHARE) \
|
||||
if(!curlcheck_ptr((value), CURLSH)) \
|
||||
Wcurl_easy_setopt_err_CURLSH(); \
|
||||
) \
|
||||
} \
|
||||
(curl_easy_setopt)(handle, option, value); \
|
||||
})
|
||||
|
||||
/* wraps curl_easy_getinfo() with type checking */
|
||||
#define curl_easy_getinfo(handle, info, arg) \
|
||||
__extension__({ \
|
||||
if(__builtin_constant_p(info)) { \
|
||||
CURL_IGNORE_DEPRECATION( \
|
||||
if(curlcheck_string_info(info)) \
|
||||
if(!curlcheck_arr((arg), char *)) \
|
||||
Wcurl_easy_getinfo_err_string(); \
|
||||
if(curlcheck_long_info(info)) \
|
||||
if(!curlcheck_arr((arg), long)) \
|
||||
Wcurl_easy_getinfo_err_long(); \
|
||||
if(curlcheck_double_info(info)) \
|
||||
if(!curlcheck_arr((arg), double)) \
|
||||
Wcurl_easy_getinfo_err_double(); \
|
||||
if(curlcheck_slist_info(info)) \
|
||||
if(!curlcheck_arr((arg), struct curl_slist *)) \
|
||||
Wcurl_easy_getinfo_err_curl_slist(); \
|
||||
if(curlcheck_tlssessioninfo_info(info)) \
|
||||
if(!curlcheck_arr((arg), struct curl_tlssessioninfo *)) \
|
||||
Wcurl_easy_getinfo_err_curl_tlssessioninfo(); \
|
||||
if(curlcheck_certinfo_info(info)) \
|
||||
if(!curlcheck_arr((arg), struct curl_certinfo *)) \
|
||||
Wcurl_easy_getinfo_err_curl_certinfo(); \
|
||||
if(curlcheck_socket_info(info)) \
|
||||
if(!curlcheck_arr((arg), curl_socket_t)) \
|
||||
Wcurl_easy_getinfo_err_curl_socket(); \
|
||||
if(curlcheck_off_t_info(info)) \
|
||||
if(!curlcheck_arr((arg), curl_off_t)) \
|
||||
Wcurl_easy_getinfo_err_curl_off_t(); \
|
||||
) \
|
||||
} \
|
||||
(curl_easy_getinfo)(handle, info, arg); \
|
||||
})
|
||||
if(__builtin_constant_p(info)) { \
|
||||
CURL_IGNORE_DEPRECATION( \
|
||||
if(curlcheck_string_info(info)) \
|
||||
if(!curlcheck_arr((arg), char *)) \
|
||||
Wcurl_easy_getinfo_err_string(); \
|
||||
if(curlcheck_long_info(info)) \
|
||||
if(!curlcheck_arr((arg), long)) \
|
||||
Wcurl_easy_getinfo_err_long(); \
|
||||
if(curlcheck_double_info(info)) \
|
||||
if(!curlcheck_arr((arg), double)) \
|
||||
Wcurl_easy_getinfo_err_double(); \
|
||||
if(curlcheck_slist_info(info)) \
|
||||
if(!curlcheck_arr((arg), struct curl_slist *)) \
|
||||
Wcurl_easy_getinfo_err_curl_slist(); \
|
||||
if(curlcheck_tlssessioninfo_info(info)) \
|
||||
if(!curlcheck_arr((arg), struct curl_tlssessioninfo *)) \
|
||||
Wcurl_easy_getinfo_err_curl_tlssessioninfo(); \
|
||||
if(curlcheck_certinfo_info(info)) \
|
||||
if(!curlcheck_arr((arg), struct curl_certinfo *)) \
|
||||
Wcurl_easy_getinfo_err_curl_certinfo(); \
|
||||
if(curlcheck_socket_info(info)) \
|
||||
if(!curlcheck_arr((arg), curl_socket_t)) \
|
||||
Wcurl_easy_getinfo_err_curl_socket(); \
|
||||
if(curlcheck_off_t_info(info)) \
|
||||
if(!curlcheck_arr((arg), 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); \
|
||||
})
|
||||
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 */
|
||||
|
|
@ -512,82 +512,84 @@ CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t,
|
|||
(option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)
|
||||
|
||||
/* evaluates to true if option takes a data argument to pass to a callback */
|
||||
#define curlcheck_cb_data_option(option) \
|
||||
((option) == CURLOPT_CHUNK_DATA || \
|
||||
(option) == CURLOPT_CLOSESOCKETDATA || \
|
||||
(option) == CURLOPT_DEBUGDATA || \
|
||||
(option) == CURLOPT_FNMATCH_DATA || \
|
||||
(option) == CURLOPT_HEADERDATA || \
|
||||
(option) == CURLOPT_HSTSREADDATA || \
|
||||
(option) == CURLOPT_HSTSWRITEDATA || \
|
||||
(option) == CURLOPT_INTERLEAVEDATA || \
|
||||
(option) == CURLOPT_IOCTLDATA || \
|
||||
(option) == CURLOPT_OPENSOCKETDATA || \
|
||||
(option) == CURLOPT_PREREQDATA || \
|
||||
(option) == CURLOPT_XFERINFODATA || \
|
||||
(option) == CURLOPT_READDATA || \
|
||||
(option) == CURLOPT_SEEKDATA || \
|
||||
(option) == CURLOPT_SOCKOPTDATA || \
|
||||
(option) == CURLOPT_SSH_KEYDATA || \
|
||||
(option) == CURLOPT_SSL_CTX_DATA || \
|
||||
(option) == CURLOPT_WRITEDATA || \
|
||||
(option) == CURLOPT_RESOLVER_START_DATA || \
|
||||
(option) == CURLOPT_TRAILERDATA || \
|
||||
(option) == CURLOPT_SSH_HOSTKEYDATA || \
|
||||
#define curlcheck_cb_data_option(option) \
|
||||
((option) == CURLOPT_CHUNK_DATA || \
|
||||
(option) == CURLOPT_CLOSESOCKETDATA || \
|
||||
(option) == CURLOPT_DEBUGDATA || \
|
||||
(option) == CURLOPT_FNMATCH_DATA || \
|
||||
(option) == CURLOPT_HEADERDATA || \
|
||||
(option) == CURLOPT_HSTSREADDATA || \
|
||||
(option) == CURLOPT_HSTSWRITEDATA || \
|
||||
(option) == CURLOPT_INTERLEAVEDATA || \
|
||||
(option) == CURLOPT_IOCTLDATA || \
|
||||
(option) == CURLOPT_OPENSOCKETDATA || \
|
||||
(option) == CURLOPT_PREREQDATA || \
|
||||
(option) == CURLOPT_XFERINFODATA || \
|
||||
(option) == CURLOPT_READDATA || \
|
||||
(option) == CURLOPT_SEEKDATA || \
|
||||
(option) == CURLOPT_SOCKOPTDATA || \
|
||||
(option) == CURLOPT_SSH_KEYDATA || \
|
||||
(option) == CURLOPT_SSL_CTX_DATA || \
|
||||
(option) == CURLOPT_WRITEDATA || \
|
||||
(option) == CURLOPT_RESOLVER_START_DATA || \
|
||||
(option) == CURLOPT_TRAILERDATA || \
|
||||
(option) == CURLOPT_SSH_HOSTKEYDATA || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a POST data argument (void* or char*) */
|
||||
#define curlcheck_postfields_option(option) \
|
||||
((option) == CURLOPT_POSTFIELDS || \
|
||||
(option) == CURLOPT_COPYPOSTFIELDS || \
|
||||
#define curlcheck_postfields_option(option) \
|
||||
((option) == CURLOPT_POSTFIELDS || \
|
||||
(option) == CURLOPT_COPYPOSTFIELDS || \
|
||||
0)
|
||||
|
||||
/* evaluates to true if option takes a struct curl_slist * argument */
|
||||
#define curlcheck_slist_option(option) \
|
||||
((option) == CURLOPT_HTTP200ALIASES || \
|
||||
(option) == CURLOPT_HTTPHEADER || \
|
||||
(option) == CURLOPT_MAIL_RCPT || \
|
||||
(option) == CURLOPT_POSTQUOTE || \
|
||||
(option) == CURLOPT_PREQUOTE || \
|
||||
(option) == CURLOPT_PROXYHEADER || \
|
||||
(option) == CURLOPT_QUOTE || \
|
||||
(option) == CURLOPT_RESOLVE || \
|
||||
(option) == CURLOPT_TELNETOPTIONS || \
|
||||
(option) == CURLOPT_CONNECT_TO || \
|
||||
#define curlcheck_slist_option(option) \
|
||||
((option) == CURLOPT_HTTP200ALIASES || \
|
||||
(option) == CURLOPT_HTTPHEADER || \
|
||||
(option) == CURLOPT_MAIL_RCPT || \
|
||||
(option) == CURLOPT_POSTQUOTE || \
|
||||
(option) == CURLOPT_PREQUOTE || \
|
||||
(option) == CURLOPT_PROXYHEADER || \
|
||||
(option) == CURLOPT_QUOTE || \
|
||||
(option) == CURLOPT_RESOLVE || \
|
||||
(option) == CURLOPT_TELNETOPTIONS || \
|
||||
(option) == CURLOPT_CONNECT_TO || \
|
||||
0)
|
||||
|
||||
/* groups of curl_easy_getinfo infos that take the same type of argument */
|
||||
|
||||
/* evaluates to true if info expects a pointer to char * argument */
|
||||
#define curlcheck_string_info(info) \
|
||||
(CURLINFO_STRING < (info) && (info) < CURLINFO_LONG && \
|
||||
#define curlcheck_string_info(info) \
|
||||
(CURLINFO_STRING < (info) && (info) < CURLINFO_LONG && \
|
||||
(info) != CURLINFO_PRIVATE)
|
||||
|
||||
/* evaluates to true if info expects a pointer to long argument */
|
||||
#define curlcheck_long_info(info) \
|
||||
#define curlcheck_long_info(info) \
|
||||
(CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)
|
||||
|
||||
/* evaluates to true if info expects a pointer to double argument */
|
||||
#define curlcheck_double_info(info) \
|
||||
#define curlcheck_double_info(info) \
|
||||
(CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
|
||||
|
||||
/* true if info expects a pointer to struct curl_slist * argument */
|
||||
#define curlcheck_slist_info(info) \
|
||||
(((info) == CURLINFO_SSL_ENGINES) || ((info) == CURLINFO_COOKIELIST))
|
||||
(((info) == CURLINFO_SSL_ENGINES) || \
|
||||
((info) == CURLINFO_COOKIELIST))
|
||||
|
||||
/* true if info expects a pointer to struct curl_tlssessioninfo * argument */
|
||||
#define curlcheck_tlssessioninfo_info(info) \
|
||||
(((info) == CURLINFO_TLS_SSL_PTR) || ((info) == CURLINFO_TLS_SESSION))
|
||||
#define curlcheck_tlssessioninfo_info(info) \
|
||||
(((info) == CURLINFO_TLS_SSL_PTR) || \
|
||||
((info) == CURLINFO_TLS_SESSION))
|
||||
|
||||
/* true if info expects a pointer to struct curl_certinfo * argument */
|
||||
#define curlcheck_certinfo_info(info) ((info) == CURLINFO_CERTINFO)
|
||||
|
||||
/* true if info expects a pointer to struct curl_socket_t argument */
|
||||
#define curlcheck_socket_info(info) \
|
||||
#define curlcheck_socket_info(info) \
|
||||
(CURLINFO_SOCKET < (info) && (info) < CURLINFO_OFF_T)
|
||||
|
||||
/* true if info expects a pointer to curl_off_t argument */
|
||||
#define curlcheck_off_t_info(info) \
|
||||
#define curlcheck_off_t_info(info) \
|
||||
(CURLINFO_OFF_T < (info))
|
||||
|
||||
/*
|
||||
|
|
@ -604,7 +606,7 @@ CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t,
|
|||
*/
|
||||
|
||||
/* XXX: should evaluate to true if expr is a pointer */
|
||||
#define curlcheck_any_ptr(expr) \
|
||||
#define curlcheck_any_ptr(expr) \
|
||||
(sizeof(expr) == sizeof(void *))
|
||||
|
||||
/* evaluates to true if expr is NULL */
|
||||
|
|
@ -668,7 +670,7 @@ CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t,
|
|||
)
|
||||
|
||||
/* evaluates to true if expr is of type curl_off_t */
|
||||
#define curlcheck_off_t(expr) \
|
||||
#define curlcheck_off_t(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), curl_off_t))
|
||||
|
||||
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
|
||||
|
|
@ -706,8 +708,8 @@ CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t,
|
|||
__builtin_types_compatible_p(__typeof__(func) *, type))
|
||||
|
||||
/* evaluates to true if expr is of type curl_resolver_start_callback */
|
||||
#define curlcheck_resolver_start_callback(expr) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
#define curlcheck_resolver_start_callback(expr) \
|
||||
(curlcheck_NULL(expr) || \
|
||||
curlcheck_cb_compatible((expr), curl_resolver_start_callback))
|
||||
|
||||
/* evaluates to true if expr is of type curl_read_callback or "similar" */
|
||||
|
|
@ -741,11 +743,11 @@ typedef size_t (*Wcurl_read_callback6)(void *, size_t, size_t, FILE *);
|
|||
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 *);
|
||||
const void *);
|
||||
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 *);
|
||||
const void *);
|
||||
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" */
|
||||
|
|
@ -769,7 +771,7 @@ typedef curlioerr (*Wcurl_ioctl_callback4)(CURL *, curliocmd, const void *);
|
|||
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);
|
||||
curlsocktype);
|
||||
|
||||
/* evaluates to true if expr is of type curl_opensocket_callback or
|
||||
"similar" */
|
||||
|
|
@ -817,21 +819,21 @@ typedef int (*Wcurl_progress_callback2)(const void *,
|
|||
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 *,
|
||||
typedef int (*Wcurl_debug_callback1)(CURL *,
|
||||
curl_infotype, char *, size_t, void *);
|
||||
typedef int (*Wcurl_debug_callback2) (CURL *,
|
||||
typedef int (*Wcurl_debug_callback2)(CURL *,
|
||||
curl_infotype, char *, size_t, const void *);
|
||||
typedef int (*Wcurl_debug_callback3) (CURL *,
|
||||
typedef int (*Wcurl_debug_callback3)(CURL *,
|
||||
curl_infotype, const char *, size_t, void *);
|
||||
typedef int (*Wcurl_debug_callback4) (CURL *,
|
||||
typedef int (*Wcurl_debug_callback4)(CURL *,
|
||||
curl_infotype, const char *, size_t, const void *);
|
||||
typedef int (*Wcurl_debug_callback5) (CURL *,
|
||||
typedef int (*Wcurl_debug_callback5)(CURL *,
|
||||
curl_infotype, unsigned char *, size_t, void *);
|
||||
typedef int (*Wcurl_debug_callback6) (CURL *,
|
||||
typedef int (*Wcurl_debug_callback6)(CURL *,
|
||||
curl_infotype, unsigned char *, size_t, const void *);
|
||||
typedef int (*Wcurl_debug_callback7) (CURL *,
|
||||
typedef int (*Wcurl_debug_callback7)(CURL *,
|
||||
curl_infotype, const unsigned char *, size_t, void *);
|
||||
typedef int (*Wcurl_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" */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue