capacitor-freerasp 2.2.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +57 -0
- package/CapacitorFreerasp.podspec +1 -1
- package/README.md +8 -8
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/aheaditec/freerasp/FreeraspPlugin.kt +39 -18
- package/android/src/main/java/com/aheaditec/freerasp/ScreenProtector.kt +24 -2
- package/android/src/main/java/com/aheaditec/freerasp/ThreatHandler.kt +36 -18
- package/android/src/main/java/com/aheaditec/freerasp/events/BaseRaspEvent.kt +7 -0
- package/android/src/main/java/com/aheaditec/freerasp/events/RaspExecutionStateEvent.kt +22 -0
- package/android/src/main/java/com/aheaditec/freerasp/events/ThreatEvent.kt +69 -0
- package/android/src/main/java/com/aheaditec/freerasp/models/CapSuspiciousAppInfo.kt +1 -0
- package/android/src/main/java/com/aheaditec/freerasp/utils/Extensions.kt +1 -0
- package/android/src/main/java/com/aheaditec/freerasp/utils/RandomGenerator.kt +24 -0
- package/android/src/main/java/com/aheaditec/freerasp/utils/Utils.kt +3 -5
- package/dist/esm/api/listeners/raspExecutionState.d.ts +2 -0
- package/dist/esm/api/listeners/raspExecutionState.js +23 -0
- package/dist/esm/api/listeners/raspExecutionState.js.map +1 -0
- package/dist/esm/api/listeners/threat.d.ts +2 -0
- package/dist/esm/api/listeners/threat.js +84 -0
- package/dist/esm/api/listeners/threat.js.map +1 -0
- package/dist/esm/api/methods/capacitor.d.ts +4 -0
- package/dist/esm/api/methods/capacitor.js +11 -0
- package/dist/esm/api/methods/capacitor.js.map +1 -0
- package/dist/esm/api/methods/native.d.ts +6 -0
- package/dist/esm/api/methods/native.js +32 -0
- package/dist/esm/api/methods/native.js.map +1 -0
- package/dist/esm/api/nativeModules.d.ts +2 -0
- package/dist/esm/api/nativeModules.js +3 -0
- package/dist/esm/api/nativeModules.js.map +1 -0
- package/dist/esm/channels/raspExecutionState.d.ts +3 -0
- package/dist/esm/channels/raspExecutionState.js +27 -0
- package/dist/esm/channels/raspExecutionState.js.map +1 -0
- package/dist/esm/channels/threat.d.ts +3 -0
- package/dist/esm/channels/threat.js +34 -0
- package/dist/esm/channels/threat.js.map +1 -0
- package/dist/esm/index.d.ts +7 -12
- package/dist/esm/index.js +7 -158
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/models/raspExecutionState.d.ts +6 -0
- package/dist/esm/models/raspExecutionState.js +10 -0
- package/dist/esm/models/raspExecutionState.js.map +1 -0
- package/dist/esm/models/threat.d.ts +26 -0
- package/dist/esm/{definitions.js → models/threat.js} +7 -3
- package/dist/esm/models/threat.js.map +1 -0
- package/dist/esm/{definitions.d.ts → types/types.d.ts} +37 -44
- package/dist/esm/types/types.js +2 -0
- package/dist/esm/types/types.js.map +1 -0
- package/dist/esm/utils/malware.d.ts +3 -0
- package/dist/esm/utils/malware.js +22 -0
- package/dist/esm/utils/malware.js.map +1 -0
- package/dist/esm/utils/utils.d.ts +3 -0
- package/dist/esm/utils/utils.js +12 -0
- package/dist/esm/utils/utils.js.map +1 -0
- package/dist/plugin.cjs.js +153 -78
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +153 -78
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/FreeraspPlugin.m +2 -0
- package/ios/Plugin/FreeraspPlugin.swift +50 -75
- package/ios/Plugin/Info.plist +1 -1
- package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeResources +100 -298
- package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeSignature +0 -0
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +7 -2
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +380 -281
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +5 -6
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +4 -4
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/header.h +1 -1
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +11 -4
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +62 -22
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +2 -2
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +76 -164
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/typecheck-gcc.h +947 -0
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +5 -4
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/websockets.h +17 -3
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.abi.json +233 -528
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.private.swiftinterface +7 -3
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +7 -3
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +14 -4
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +380 -281
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +5 -6
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +4 -4
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/header.h +1 -1
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +11 -4
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +62 -22
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +2 -2
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +76 -164
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/typecheck-gcc.h +947 -0
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +5 -4
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/websockets.h +17 -3
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.abi.json +233 -528
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +7 -3
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -3
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.abi.json +233 -528
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +7 -3
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +7 -3
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/Plugin/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +56 -45
- package/ios/Plugin/models/RaspExecutionStates.swift +15 -0
- package/ios/Plugin/models/SecurityThreat.swift +40 -0
- package/ios/Plugin/utils/EventIdentifiers.swift +17 -0
- package/ios/Plugin/utils/RandomGenerator.swift +23 -0
- package/ios/Plugin/utils/Utils.swift +32 -0
- package/package.json +15 -10
- package/android/src/main/java/com/aheaditec/freerasp/Threat.kt +0 -58
- package/dist/esm/definitions.js.map +0 -1
- package/dist/esm/utils.d.ts +0 -2
- package/dist/esm/utils.js +0 -8
- package/dist/esm/utils.js.map +0 -1
- package/ios/Plugin/TalsecRuntime.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
|
@@ -0,0 +1,947 @@
|
|
|
1
|
+
#ifndef CURLINC_TYPECHECK_GCC_H
|
|
2
|
+
#define CURLINC_TYPECHECK_GCC_H
|
|
3
|
+
/***************************************************************************
|
|
4
|
+
* _ _ ____ _
|
|
5
|
+
* Project ___| | | | _ \| |
|
|
6
|
+
* / __| | | | |_) | |
|
|
7
|
+
* | (__| |_| | _ <| |___
|
|
8
|
+
* \___|\___/|_| \_\_____|
|
|
9
|
+
*
|
|
10
|
+
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
|
11
|
+
*
|
|
12
|
+
* This software is licensed as described in the file COPYING, which
|
|
13
|
+
* you should have received as part of this distribution. The terms
|
|
14
|
+
* are also available at https://curl.se/docs/copyright.html.
|
|
15
|
+
*
|
|
16
|
+
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
17
|
+
* copies of the Software, and permit persons to whom the Software is
|
|
18
|
+
* furnished to do so, under the terms of the COPYING file.
|
|
19
|
+
*
|
|
20
|
+
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
21
|
+
* KIND, either express or implied.
|
|
22
|
+
*
|
|
23
|
+
* SPDX-License-Identifier: curl
|
|
24
|
+
*
|
|
25
|
+
***************************************************************************/
|
|
26
|
+
|
|
27
|
+
/* wraps curl_easy_setopt() with typechecking */
|
|
28
|
+
|
|
29
|
+
/* To add a new kind of warning, add an
|
|
30
|
+
* if(curlcheck_sometype_option(_curl_opt))
|
|
31
|
+
* if(!curlcheck_sometype(value))
|
|
32
|
+
* _curl_easy_setopt_err_sometype();
|
|
33
|
+
* block and define curlcheck_sometype_option, curlcheck_sometype and
|
|
34
|
+
* _curl_easy_setopt_err_sometype below
|
|
35
|
+
*
|
|
36
|
+
* NOTE: We use two nested 'if' statements here instead of the && operator, in
|
|
37
|
+
* order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x
|
|
38
|
+
* when compiling with -Wlogical-op.
|
|
39
|
+
*
|
|
40
|
+
* To add an option that uses the same type as an existing option, you will
|
|
41
|
+
* just need to extend the appropriate _curl_*_option macro
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
#define curl_easy_setopt(handle, option, value) \
|
|
45
|
+
__extension__({ \
|
|
46
|
+
if(__builtin_constant_p(option)) { \
|
|
47
|
+
CURL_IGNORE_DEPRECATION( \
|
|
48
|
+
if(curlcheck_long_option(option)) \
|
|
49
|
+
if(!curlcheck_long(value)) \
|
|
50
|
+
_curl_easy_setopt_err_long(); \
|
|
51
|
+
if(curlcheck_off_t_option(option)) \
|
|
52
|
+
if(!curlcheck_off_t(value)) \
|
|
53
|
+
_curl_easy_setopt_err_curl_off_t(); \
|
|
54
|
+
if(curlcheck_string_option(option)) \
|
|
55
|
+
if(!curlcheck_string(value)) \
|
|
56
|
+
_curl_easy_setopt_err_string(); \
|
|
57
|
+
if((option) == CURLOPT_PRIVATE) { } \
|
|
58
|
+
if(curlcheck_write_cb_option(option)) \
|
|
59
|
+
if(!curlcheck_write_cb(value)) \
|
|
60
|
+
_curl_easy_setopt_err_write_callback(); \
|
|
61
|
+
if(curlcheck_curl_option(option)) \
|
|
62
|
+
if(!curlcheck_curl(value)) \
|
|
63
|
+
_curl_easy_setopt_err_curl(); \
|
|
64
|
+
if((option) == CURLOPT_RESOLVER_START_FUNCTION) \
|
|
65
|
+
if(!curlcheck_resolver_start_callback(value)) \
|
|
66
|
+
_curl_easy_setopt_err_resolver_start_callback(); \
|
|
67
|
+
if((option) == CURLOPT_READFUNCTION) \
|
|
68
|
+
if(!curlcheck_read_cb(value)) \
|
|
69
|
+
_curl_easy_setopt_err_read_cb(); \
|
|
70
|
+
if((option) == CURLOPT_IOCTLFUNCTION) \
|
|
71
|
+
if(!curlcheck_ioctl_cb(value)) \
|
|
72
|
+
_curl_easy_setopt_err_ioctl_cb(); \
|
|
73
|
+
if((option) == CURLOPT_SOCKOPTFUNCTION) \
|
|
74
|
+
if(!curlcheck_sockopt_cb(value)) \
|
|
75
|
+
_curl_easy_setopt_err_sockopt_cb(); \
|
|
76
|
+
if((option) == CURLOPT_OPENSOCKETFUNCTION) \
|
|
77
|
+
if(!curlcheck_opensocket_cb(value)) \
|
|
78
|
+
_curl_easy_setopt_err_opensocket_cb(); \
|
|
79
|
+
if((option) == CURLOPT_PROGRESSFUNCTION) \
|
|
80
|
+
if(!curlcheck_progress_cb(value)) \
|
|
81
|
+
_curl_easy_setopt_err_progress_cb(); \
|
|
82
|
+
if((option) == CURLOPT_XFERINFOFUNCTION) \
|
|
83
|
+
if(!curlcheck_xferinfo_cb(value)) \
|
|
84
|
+
_curl_easy_setopt_err_xferinfo_cb(); \
|
|
85
|
+
if((option) == CURLOPT_DEBUGFUNCTION) \
|
|
86
|
+
if(!curlcheck_debug_cb(value)) \
|
|
87
|
+
_curl_easy_setopt_err_debug_cb(); \
|
|
88
|
+
if((option) == CURLOPT_SSL_CTX_FUNCTION) \
|
|
89
|
+
if(!curlcheck_ssl_ctx_cb(value)) \
|
|
90
|
+
_curl_easy_setopt_err_ssl_ctx_cb(); \
|
|
91
|
+
if(curlcheck_conv_cb_option(option)) \
|
|
92
|
+
if(!curlcheck_conv_cb(value)) \
|
|
93
|
+
_curl_easy_setopt_err_conv_cb(); \
|
|
94
|
+
if((option) == CURLOPT_SEEKFUNCTION) \
|
|
95
|
+
if(!curlcheck_seek_cb(value)) \
|
|
96
|
+
_curl_easy_setopt_err_seek_cb(); \
|
|
97
|
+
if((option) == CURLOPT_CHUNK_BGN_FUNCTION) \
|
|
98
|
+
if(!curlcheck_chunk_bgn_cb(value)) \
|
|
99
|
+
_curl_easy_setopt_err_chunk_bgn_cb(); \
|
|
100
|
+
if((option) == CURLOPT_CHUNK_END_FUNCTION) \
|
|
101
|
+
if(!curlcheck_chunk_end_cb(value)) \
|
|
102
|
+
_curl_easy_setopt_err_chunk_end_cb(); \
|
|
103
|
+
if((option) == CURLOPT_CLOSESOCKETFUNCTION) \
|
|
104
|
+
if(!curlcheck_close_socket_cb(value)) \
|
|
105
|
+
_curl_easy_setopt_err_close_socket_cb(); \
|
|
106
|
+
if((option) == CURLOPT_FNMATCH_FUNCTION) \
|
|
107
|
+
if(!curlcheck_fnmatch_cb(value)) \
|
|
108
|
+
_curl_easy_setopt_err_fnmatch_cb(); \
|
|
109
|
+
if((option) == CURLOPT_HSTSREADFUNCTION) \
|
|
110
|
+
if(!curlcheck_hstsread_cb(value)) \
|
|
111
|
+
_curl_easy_setopt_err_hstsread_cb(); \
|
|
112
|
+
if((option) == CURLOPT_HSTSWRITEFUNCTION) \
|
|
113
|
+
if(!curlcheck_hstswrite_cb(value)) \
|
|
114
|
+
_curl_easy_setopt_err_hstswrite_cb(); \
|
|
115
|
+
if((option) == CURLOPT_SSH_HOSTKEYFUNCTION) \
|
|
116
|
+
if(!curlcheck_ssh_hostkey_cb(value)) \
|
|
117
|
+
_curl_easy_setopt_err_ssh_hostkey_cb(); \
|
|
118
|
+
if((option) == CURLOPT_SSH_KEYFUNCTION) \
|
|
119
|
+
if(!curlcheck_ssh_key_cb(value)) \
|
|
120
|
+
_curl_easy_setopt_err_ssh_key_cb(); \
|
|
121
|
+
if((option) == CURLOPT_INTERLEAVEFUNCTION) \
|
|
122
|
+
if(!curlcheck_interleave_cb(value)) \
|
|
123
|
+
_curl_easy_setopt_err_interleave_cb(); \
|
|
124
|
+
if((option) == CURLOPT_PREREQFUNCTION) \
|
|
125
|
+
if(!curlcheck_prereq_cb(value)) \
|
|
126
|
+
_curl_easy_setopt_err_prereq_cb(); \
|
|
127
|
+
if((option) == CURLOPT_TRAILERFUNCTION) \
|
|
128
|
+
if(!curlcheck_trailer_cb(value)) \
|
|
129
|
+
_curl_easy_setopt_err_trailer_cb(); \
|
|
130
|
+
if(curlcheck_cb_data_option(option)) \
|
|
131
|
+
if(!curlcheck_cb_data(value)) \
|
|
132
|
+
_curl_easy_setopt_err_cb_data(); \
|
|
133
|
+
if((option) == CURLOPT_ERRORBUFFER) \
|
|
134
|
+
if(!curlcheck_error_buffer(value)) \
|
|
135
|
+
_curl_easy_setopt_err_error_buffer(); \
|
|
136
|
+
if((option) == CURLOPT_CURLU) \
|
|
137
|
+
if(!curlcheck_ptr((value), CURLU)) \
|
|
138
|
+
_curl_easy_setopt_err_curlu(); \
|
|
139
|
+
if((option) == CURLOPT_STDERR) \
|
|
140
|
+
if(!curlcheck_FILE(value)) \
|
|
141
|
+
_curl_easy_setopt_err_FILE(); \
|
|
142
|
+
if(curlcheck_postfields_option(option)) \
|
|
143
|
+
if(!curlcheck_postfields(value)) \
|
|
144
|
+
_curl_easy_setopt_err_postfields(); \
|
|
145
|
+
if((option) == CURLOPT_HTTPPOST) \
|
|
146
|
+
if(!curlcheck_arr((value), struct curl_httppost)) \
|
|
147
|
+
_curl_easy_setopt_err_curl_httpost(); \
|
|
148
|
+
if((option) == CURLOPT_MIMEPOST) \
|
|
149
|
+
if(!curlcheck_ptr((value), curl_mime)) \
|
|
150
|
+
_curl_easy_setopt_err_curl_mimepost(); \
|
|
151
|
+
if(curlcheck_slist_option(option)) \
|
|
152
|
+
if(!curlcheck_arr((value), struct curl_slist)) \
|
|
153
|
+
_curl_easy_setopt_err_curl_slist(); \
|
|
154
|
+
if((option) == CURLOPT_SHARE) \
|
|
155
|
+
if(!curlcheck_ptr((value), CURLSH)) \
|
|
156
|
+
_curl_easy_setopt_err_CURLSH(); \
|
|
157
|
+
) \
|
|
158
|
+
} \
|
|
159
|
+
curl_easy_setopt(handle, option, value); \
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
/* wraps curl_easy_getinfo() with typechecking */
|
|
163
|
+
#define curl_easy_getinfo(handle, info, arg) \
|
|
164
|
+
__extension__({ \
|
|
165
|
+
if(__builtin_constant_p(info)) { \
|
|
166
|
+
CURL_IGNORE_DEPRECATION( \
|
|
167
|
+
if(curlcheck_string_info(info)) \
|
|
168
|
+
if(!curlcheck_arr((arg), char *)) \
|
|
169
|
+
_curl_easy_getinfo_err_string(); \
|
|
170
|
+
if(curlcheck_long_info(info)) \
|
|
171
|
+
if(!curlcheck_arr((arg), long)) \
|
|
172
|
+
_curl_easy_getinfo_err_long(); \
|
|
173
|
+
if(curlcheck_double_info(info)) \
|
|
174
|
+
if(!curlcheck_arr((arg), double)) \
|
|
175
|
+
_curl_easy_getinfo_err_double(); \
|
|
176
|
+
if(curlcheck_slist_info(info)) \
|
|
177
|
+
if(!curlcheck_arr((arg), struct curl_slist *)) \
|
|
178
|
+
_curl_easy_getinfo_err_curl_slist(); \
|
|
179
|
+
if(curlcheck_tlssessioninfo_info(info)) \
|
|
180
|
+
if(!curlcheck_arr((arg), struct curl_tlssessioninfo *)) \
|
|
181
|
+
_curl_easy_getinfo_err_curl_tlssessioninfo(); \
|
|
182
|
+
if(curlcheck_certinfo_info(info)) \
|
|
183
|
+
if(!curlcheck_arr((arg), struct curl_certinfo *)) \
|
|
184
|
+
_curl_easy_getinfo_err_curl_certinfo(); \
|
|
185
|
+
if(curlcheck_socket_info(info)) \
|
|
186
|
+
if(!curlcheck_arr((arg), curl_socket_t)) \
|
|
187
|
+
_curl_easy_getinfo_err_curl_socket(); \
|
|
188
|
+
if(curlcheck_off_t_info(info)) \
|
|
189
|
+
if(!curlcheck_arr((arg), curl_off_t)) \
|
|
190
|
+
_curl_easy_getinfo_err_curl_off_t(); \
|
|
191
|
+
) \
|
|
192
|
+
} \
|
|
193
|
+
curl_easy_getinfo(handle, info, arg); \
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
#define curl_multi_setopt(handle, option, value) \
|
|
197
|
+
__extension__({ \
|
|
198
|
+
if(__builtin_constant_p(option)) { \
|
|
199
|
+
if(curlcheck_long_option(option)) \
|
|
200
|
+
if(!curlcheck_long(value)) \
|
|
201
|
+
_curl_multi_setopt_err_long(); \
|
|
202
|
+
if(curlcheck_off_t_option(option)) \
|
|
203
|
+
if(!curlcheck_off_t(value)) \
|
|
204
|
+
_curl_multi_setopt_err_curl_off_t(); \
|
|
205
|
+
if(curlcheck_multicb_data_option(option)) \
|
|
206
|
+
if(!curlcheck_cb_data(value)) \
|
|
207
|
+
_curl_multi_setopt_err_cb_data(); \
|
|
208
|
+
if(curlcheck_charpp_option(option)) \
|
|
209
|
+
if(!curlcheck_ptrptr(value, char)) \
|
|
210
|
+
_curl_multi_setopt_err_charpp(); \
|
|
211
|
+
if((option) == CURLMOPT_PUSHFUNCTION) \
|
|
212
|
+
if(!curlcheck_multipush_cb(value)) \
|
|
213
|
+
_curl_multi_setopt_err_pushcb(); \
|
|
214
|
+
if((option) == CURLMOPT_SOCKETFUNCTION) \
|
|
215
|
+
if(!curlcheck_multisocket_cb(value)) \
|
|
216
|
+
_curl_multi_setopt_err_socketcb(); \
|
|
217
|
+
if((option) == CURLMOPT_TIMERFUNCTION) \
|
|
218
|
+
if(!curlcheck_multitimer_cb(value)) \
|
|
219
|
+
_curl_multi_setopt_err_timercb(); \
|
|
220
|
+
} \
|
|
221
|
+
curl_multi_setopt(handle, option, value); \
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
/* evaluates to true if the option takes a data argument to pass to a
|
|
225
|
+
callback */
|
|
226
|
+
#define curlcheck_multicb_data_option(option) \
|
|
227
|
+
((option) == CURLMOPT_PUSHDATA || \
|
|
228
|
+
(option) == CURLMOPT_SOCKETDATA || \
|
|
229
|
+
(option) == CURLMOPT_TIMERDATA || \
|
|
230
|
+
0)
|
|
231
|
+
|
|
232
|
+
/* evaluates to true if the option takes a char ** argument */
|
|
233
|
+
#define curlcheck_charpp_option(option) \
|
|
234
|
+
((option) == CURLMOPT_PIPELINING_SERVER_BL || \
|
|
235
|
+
(option) == CURLMOPT_PIPELINING_SITE_BL || \
|
|
236
|
+
0)
|
|
237
|
+
|
|
238
|
+
/* evaluates to true if expr is of type curl_multi_timer_callback */
|
|
239
|
+
#define curlcheck_multitimer_cb(expr) \
|
|
240
|
+
(curlcheck_NULL(expr) || \
|
|
241
|
+
curlcheck_cb_compatible((expr), curl_multi_timer_callback))
|
|
242
|
+
|
|
243
|
+
/* evaluates to true if expr is of type curl_socket_callback */
|
|
244
|
+
#define curlcheck_multisocket_cb(expr) \
|
|
245
|
+
(curlcheck_NULL(expr) || \
|
|
246
|
+
curlcheck_cb_compatible((expr), curl_socket_callback))
|
|
247
|
+
|
|
248
|
+
/* evaluates to true if expr is of type curl_push_callback */
|
|
249
|
+
#define curlcheck_multipush_cb(expr) \
|
|
250
|
+
(curlcheck_NULL(expr) || \
|
|
251
|
+
curlcheck_cb_compatible((expr), curl_push_callback))
|
|
252
|
+
|
|
253
|
+
/*
|
|
254
|
+
* For now, just make sure that the functions are called with three arguments
|
|
255
|
+
*/
|
|
256
|
+
#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
/* the actual warnings, triggered by calling the _curl_easy_setopt_err*
|
|
260
|
+
* functions */
|
|
261
|
+
|
|
262
|
+
/* To define a new warning, use _CURL_WARNING(identifier, "message") */
|
|
263
|
+
#define CURLWARNING(id, message) \
|
|
264
|
+
static void __attribute__((__warning__(message))) \
|
|
265
|
+
__attribute__((__unused__)) __attribute__((__noinline__)) \
|
|
266
|
+
id(void) { __asm__(""); }
|
|
267
|
+
|
|
268
|
+
CURLWARNING(_curl_multi_setopt_err_long,
|
|
269
|
+
"curl_multi_setopt expects a long argument")
|
|
270
|
+
CURLWARNING(_curl_multi_setopt_err_curl_off_t,
|
|
271
|
+
"curl_multi_setopt expects a curl_off_t argument")
|
|
272
|
+
CURLWARNING(_curl_multi_setopt_err_cb_data,
|
|
273
|
+
"curl_multi_setopt expects a 'void *' argument")
|
|
274
|
+
CURLWARNING(_curl_multi_setopt_err_charpp,
|
|
275
|
+
"curl_multi_setopt expects a 'char **' argument")
|
|
276
|
+
CURLWARNING(_curl_multi_setopt_err_pushcb,
|
|
277
|
+
"curl_multi_setopt expects a curl_push_callback argument")
|
|
278
|
+
CURLWARNING(_curl_multi_setopt_err_socketcb,
|
|
279
|
+
"curl_multi_setopt expects a curl_socket_callback argument")
|
|
280
|
+
CURLWARNING(_curl_multi_setopt_err_timercb,
|
|
281
|
+
"curl_multi_setopt expects a curl_multi_timer_callback argument")
|
|
282
|
+
|
|
283
|
+
CURLWARNING(_curl_easy_setopt_err_long,
|
|
284
|
+
"curl_easy_setopt expects a long argument")
|
|
285
|
+
CURLWARNING(_curl_easy_setopt_err_curl_off_t,
|
|
286
|
+
"curl_easy_setopt expects a curl_off_t argument")
|
|
287
|
+
CURLWARNING(_curl_easy_setopt_err_string,
|
|
288
|
+
"curl_easy_setopt expects a "
|
|
289
|
+
"string ('char *' or char[]) argument")
|
|
290
|
+
CURLWARNING(_curl_easy_setopt_err_write_callback,
|
|
291
|
+
"curl_easy_setopt expects a curl_write_callback argument")
|
|
292
|
+
CURLWARNING(_curl_easy_setopt_err_resolver_start_callback,
|
|
293
|
+
"curl_easy_setopt expects a "
|
|
294
|
+
"curl_resolver_start_callback argument")
|
|
295
|
+
CURLWARNING(_curl_easy_setopt_err_read_cb,
|
|
296
|
+
"curl_easy_setopt expects a curl_read_callback argument")
|
|
297
|
+
CURLWARNING(_curl_easy_setopt_err_ioctl_cb,
|
|
298
|
+
"curl_easy_setopt expects a curl_ioctl_callback argument")
|
|
299
|
+
CURLWARNING(_curl_easy_setopt_err_sockopt_cb,
|
|
300
|
+
"curl_easy_setopt expects a curl_sockopt_callback argument")
|
|
301
|
+
CURLWARNING(_curl_easy_setopt_err_opensocket_cb,
|
|
302
|
+
"curl_easy_setopt expects a "
|
|
303
|
+
"curl_opensocket_callback argument")
|
|
304
|
+
CURLWARNING(_curl_easy_setopt_err_progress_cb,
|
|
305
|
+
"curl_easy_setopt expects a curl_progress_callback argument")
|
|
306
|
+
CURLWARNING(_curl_easy_setopt_err_xferinfo_cb,
|
|
307
|
+
"curl_easy_setopt expects a curl_xferinfo_callback argument")
|
|
308
|
+
CURLWARNING(_curl_easy_setopt_err_debug_cb,
|
|
309
|
+
"curl_easy_setopt expects a curl_debug_callback argument")
|
|
310
|
+
CURLWARNING(_curl_easy_setopt_err_ssl_ctx_cb,
|
|
311
|
+
"curl_easy_setopt expects a curl_ssl_ctx_callback argument")
|
|
312
|
+
CURLWARNING(_curl_easy_setopt_err_conv_cb,
|
|
313
|
+
"curl_easy_setopt expects a curl_conv_callback argument")
|
|
314
|
+
CURLWARNING(_curl_easy_setopt_err_seek_cb,
|
|
315
|
+
"curl_easy_setopt expects a curl_seek_callback argument")
|
|
316
|
+
CURLWARNING(_curl_easy_setopt_err_cb_data,
|
|
317
|
+
"curl_easy_setopt expects a "
|
|
318
|
+
"private data pointer as argument")
|
|
319
|
+
CURLWARNING(_curl_easy_setopt_err_chunk_bgn_cb,
|
|
320
|
+
"curl_easy_setopt expects a curl_chunk_bgn_callback argument")
|
|
321
|
+
CURLWARNING(_curl_easy_setopt_err_chunk_end_cb,
|
|
322
|
+
"curl_easy_setopt expects a curl_chunk_end_callback argument")
|
|
323
|
+
CURLWARNING(_curl_easy_setopt_err_close_socket_cb,
|
|
324
|
+
"curl_easy_setopt expects a curl_closesocket_callback argument")
|
|
325
|
+
CURLWARNING(_curl_easy_setopt_err_fnmatch_cb,
|
|
326
|
+
"curl_easy_setopt expects a curl_fnmatch_callback argument")
|
|
327
|
+
CURLWARNING(_curl_easy_setopt_err_hstsread_cb,
|
|
328
|
+
"curl_easy_setopt expects a curl_hstsread_callback argument")
|
|
329
|
+
CURLWARNING(_curl_easy_setopt_err_hstswrite_cb,
|
|
330
|
+
"curl_easy_setopt expects a curl_hstswrite_callback argument")
|
|
331
|
+
CURLWARNING(_curl_easy_setopt_err_ssh_key_cb,
|
|
332
|
+
"curl_easy_setopt expects a curl_sshkeycallback argument")
|
|
333
|
+
CURLWARNING(_curl_easy_setopt_err_ssh_hostkey_cb,
|
|
334
|
+
"curl_easy_setopt expects a curl_sshhostkeycallback argument")
|
|
335
|
+
CURLWARNING(_curl_easy_setopt_err_interleave_cb,
|
|
336
|
+
"curl_easy_setopt expects a curl_interleave_callback argument")
|
|
337
|
+
CURLWARNING(_curl_easy_setopt_err_prereq_cb,
|
|
338
|
+
"curl_easy_setopt expects a curl_prereq_callback argument")
|
|
339
|
+
CURLWARNING(_curl_easy_setopt_err_trailer_cb,
|
|
340
|
+
"curl_easy_setopt expects a curl_trailerfunc_ok argument")
|
|
341
|
+
CURLWARNING(_curl_easy_setopt_err_error_buffer,
|
|
342
|
+
"curl_easy_setopt expects a "
|
|
343
|
+
"char buffer of CURL_ERROR_SIZE as argument")
|
|
344
|
+
CURLWARNING(_curl_easy_setopt_err_curlu,
|
|
345
|
+
"curl_easy_setopt expects a 'CURLU *' argument")
|
|
346
|
+
CURLWARNING(_curl_easy_setopt_err_curl,
|
|
347
|
+
"curl_easy_setopt expects a 'CURL *' argument")
|
|
348
|
+
CURLWARNING(_curl_easy_setopt_err_FILE,
|
|
349
|
+
"curl_easy_setopt expects a 'FILE *' argument")
|
|
350
|
+
CURLWARNING(_curl_easy_setopt_err_postfields,
|
|
351
|
+
"curl_easy_setopt expects a 'void *' or 'char *' argument")
|
|
352
|
+
CURLWARNING(_curl_easy_setopt_err_curl_httpost,
|
|
353
|
+
"curl_easy_setopt expects a 'struct curl_httppost *' "
|
|
354
|
+
"argument")
|
|
355
|
+
CURLWARNING(_curl_easy_setopt_err_curl_mimepost,
|
|
356
|
+
"curl_easy_setopt expects a 'curl_mime *' "
|
|
357
|
+
"argument")
|
|
358
|
+
CURLWARNING(_curl_easy_setopt_err_curl_slist,
|
|
359
|
+
"curl_easy_setopt expects a 'struct curl_slist *' argument")
|
|
360
|
+
CURLWARNING(_curl_easy_setopt_err_CURLSH,
|
|
361
|
+
"curl_easy_setopt expects a CURLSH* argument")
|
|
362
|
+
CURLWARNING(_curl_easy_getinfo_err_string,
|
|
363
|
+
"curl_easy_getinfo expects a pointer to 'char *'")
|
|
364
|
+
CURLWARNING(_curl_easy_getinfo_err_long,
|
|
365
|
+
"curl_easy_getinfo expects a pointer to long")
|
|
366
|
+
CURLWARNING(_curl_easy_getinfo_err_double,
|
|
367
|
+
"curl_easy_getinfo expects a pointer to double")
|
|
368
|
+
CURLWARNING(_curl_easy_getinfo_err_curl_slist,
|
|
369
|
+
"curl_easy_getinfo expects a pointer to 'struct curl_slist *'")
|
|
370
|
+
CURLWARNING(_curl_easy_getinfo_err_curl_tlssessioninfo,
|
|
371
|
+
"curl_easy_getinfo expects a pointer to "
|
|
372
|
+
"'struct curl_tlssessioninfo *'")
|
|
373
|
+
CURLWARNING(_curl_easy_getinfo_err_curl_certinfo,
|
|
374
|
+
"curl_easy_getinfo expects a pointer to "
|
|
375
|
+
"'struct curl_certinfo *'")
|
|
376
|
+
CURLWARNING(_curl_easy_getinfo_err_curl_socket,
|
|
377
|
+
"curl_easy_getinfo expects a pointer to curl_socket_t")
|
|
378
|
+
CURLWARNING(_curl_easy_getinfo_err_curl_off_t,
|
|
379
|
+
"curl_easy_getinfo expects a pointer to curl_off_t")
|
|
380
|
+
|
|
381
|
+
/* groups of curl_easy_setops options that take the same type of argument */
|
|
382
|
+
|
|
383
|
+
/* evaluates to true if option takes a long argument */
|
|
384
|
+
#define curlcheck_long_option(option) \
|
|
385
|
+
(0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)
|
|
386
|
+
|
|
387
|
+
#define curlcheck_off_t_option(option) \
|
|
388
|
+
(((option) > CURLOPTTYPE_OFF_T) && ((option) < CURLOPTTYPE_BLOB))
|
|
389
|
+
|
|
390
|
+
/* option takes a CURL * argument */
|
|
391
|
+
#define curlcheck_curl_option(option) \
|
|
392
|
+
((option) == CURLOPT_STREAM_DEPENDS || \
|
|
393
|
+
(option) == CURLOPT_STREAM_DEPENDS_E || \
|
|
394
|
+
0)
|
|
395
|
+
|
|
396
|
+
/* evaluates to true if option takes a char* argument */
|
|
397
|
+
#define curlcheck_string_option(option) \
|
|
398
|
+
((option) == CURLOPT_ABSTRACT_UNIX_SOCKET || \
|
|
399
|
+
(option) == CURLOPT_ACCEPT_ENCODING || \
|
|
400
|
+
(option) == CURLOPT_ALTSVC || \
|
|
401
|
+
(option) == CURLOPT_CAINFO || \
|
|
402
|
+
(option) == CURLOPT_CAPATH || \
|
|
403
|
+
(option) == CURLOPT_COOKIE || \
|
|
404
|
+
(option) == CURLOPT_COOKIEFILE || \
|
|
405
|
+
(option) == CURLOPT_COOKIEJAR || \
|
|
406
|
+
(option) == CURLOPT_COOKIELIST || \
|
|
407
|
+
(option) == CURLOPT_CRLFILE || \
|
|
408
|
+
(option) == CURLOPT_CUSTOMREQUEST || \
|
|
409
|
+
(option) == CURLOPT_DEFAULT_PROTOCOL || \
|
|
410
|
+
(option) == CURLOPT_DNS_INTERFACE || \
|
|
411
|
+
(option) == CURLOPT_DNS_LOCAL_IP4 || \
|
|
412
|
+
(option) == CURLOPT_DNS_LOCAL_IP6 || \
|
|
413
|
+
(option) == CURLOPT_DNS_SERVERS || \
|
|
414
|
+
(option) == CURLOPT_DOH_URL || \
|
|
415
|
+
(option) == CURLOPT_ECH || \
|
|
416
|
+
(option) == CURLOPT_EGDSOCKET || \
|
|
417
|
+
(option) == CURLOPT_FTP_ACCOUNT || \
|
|
418
|
+
(option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
|
|
419
|
+
(option) == CURLOPT_FTPPORT || \
|
|
420
|
+
(option) == CURLOPT_HAPROXY_CLIENT_IP || \
|
|
421
|
+
(option) == CURLOPT_HSTS || \
|
|
422
|
+
(option) == CURLOPT_INTERFACE || \
|
|
423
|
+
(option) == CURLOPT_ISSUERCERT || \
|
|
424
|
+
(option) == CURLOPT_KEYPASSWD || \
|
|
425
|
+
(option) == CURLOPT_KRBLEVEL || \
|
|
426
|
+
(option) == CURLOPT_LOGIN_OPTIONS || \
|
|
427
|
+
(option) == CURLOPT_MAIL_AUTH || \
|
|
428
|
+
(option) == CURLOPT_MAIL_FROM || \
|
|
429
|
+
(option) == CURLOPT_NETRC_FILE || \
|
|
430
|
+
(option) == CURLOPT_NOPROXY || \
|
|
431
|
+
(option) == CURLOPT_PASSWORD || \
|
|
432
|
+
(option) == CURLOPT_PINNEDPUBLICKEY || \
|
|
433
|
+
(option) == CURLOPT_PRE_PROXY || \
|
|
434
|
+
(option) == CURLOPT_PROTOCOLS_STR || \
|
|
435
|
+
(option) == CURLOPT_PROXY || \
|
|
436
|
+
(option) == CURLOPT_PROXY_CAINFO || \
|
|
437
|
+
(option) == CURLOPT_PROXY_CAPATH || \
|
|
438
|
+
(option) == CURLOPT_PROXY_CRLFILE || \
|
|
439
|
+
(option) == CURLOPT_PROXY_ISSUERCERT || \
|
|
440
|
+
(option) == CURLOPT_PROXY_KEYPASSWD || \
|
|
441
|
+
(option) == CURLOPT_PROXY_PINNEDPUBLICKEY || \
|
|
442
|
+
(option) == CURLOPT_PROXY_SERVICE_NAME || \
|
|
443
|
+
(option) == CURLOPT_PROXY_SSL_CIPHER_LIST || \
|
|
444
|
+
(option) == CURLOPT_PROXY_SSLCERT || \
|
|
445
|
+
(option) == CURLOPT_PROXY_SSLCERTTYPE || \
|
|
446
|
+
(option) == CURLOPT_PROXY_SSLKEY || \
|
|
447
|
+
(option) == CURLOPT_PROXY_SSLKEYTYPE || \
|
|
448
|
+
(option) == CURLOPT_PROXY_TLS13_CIPHERS || \
|
|
449
|
+
(option) == CURLOPT_PROXY_TLSAUTH_PASSWORD || \
|
|
450
|
+
(option) == CURLOPT_PROXY_TLSAUTH_TYPE || \
|
|
451
|
+
(option) == CURLOPT_PROXY_TLSAUTH_USERNAME || \
|
|
452
|
+
(option) == CURLOPT_PROXYPASSWORD || \
|
|
453
|
+
(option) == CURLOPT_PROXYUSERNAME || \
|
|
454
|
+
(option) == CURLOPT_PROXYUSERPWD || \
|
|
455
|
+
(option) == CURLOPT_RANDOM_FILE || \
|
|
456
|
+
(option) == CURLOPT_RANGE || \
|
|
457
|
+
(option) == CURLOPT_REDIR_PROTOCOLS_STR || \
|
|
458
|
+
(option) == CURLOPT_REFERER || \
|
|
459
|
+
(option) == CURLOPT_REQUEST_TARGET || \
|
|
460
|
+
(option) == CURLOPT_RTSP_SESSION_ID || \
|
|
461
|
+
(option) == CURLOPT_RTSP_STREAM_URI || \
|
|
462
|
+
(option) == CURLOPT_RTSP_TRANSPORT || \
|
|
463
|
+
(option) == CURLOPT_SASL_AUTHZID || \
|
|
464
|
+
(option) == CURLOPT_SERVICE_NAME || \
|
|
465
|
+
(option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
|
|
466
|
+
(option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
|
|
467
|
+
(option) == CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 || \
|
|
468
|
+
(option) == CURLOPT_SSH_KNOWNHOSTS || \
|
|
469
|
+
(option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
|
|
470
|
+
(option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
|
|
471
|
+
(option) == CURLOPT_SSLCERT || \
|
|
472
|
+
(option) == CURLOPT_SSLCERTTYPE || \
|
|
473
|
+
(option) == CURLOPT_SSLENGINE || \
|
|
474
|
+
(option) == CURLOPT_SSLKEY || \
|
|
475
|
+
(option) == CURLOPT_SSLKEYTYPE || \
|
|
476
|
+
(option) == CURLOPT_SSL_CIPHER_LIST || \
|
|
477
|
+
(option) == CURLOPT_SSL_EC_CURVES || \
|
|
478
|
+
(option) == CURLOPT_SSL_SIGNATURE_ALGORITHMS || \
|
|
479
|
+
(option) == CURLOPT_TLS13_CIPHERS || \
|
|
480
|
+
(option) == CURLOPT_TLSAUTH_PASSWORD || \
|
|
481
|
+
(option) == CURLOPT_TLSAUTH_TYPE || \
|
|
482
|
+
(option) == CURLOPT_TLSAUTH_USERNAME || \
|
|
483
|
+
(option) == CURLOPT_UNIX_SOCKET_PATH || \
|
|
484
|
+
(option) == CURLOPT_URL || \
|
|
485
|
+
(option) == CURLOPT_USERAGENT || \
|
|
486
|
+
(option) == CURLOPT_USERNAME || \
|
|
487
|
+
(option) == CURLOPT_AWS_SIGV4 || \
|
|
488
|
+
(option) == CURLOPT_USERPWD || \
|
|
489
|
+
(option) == CURLOPT_XOAUTH2_BEARER || \
|
|
490
|
+
0)
|
|
491
|
+
|
|
492
|
+
/* evaluates to true if option takes a curl_write_callback argument */
|
|
493
|
+
#define curlcheck_write_cb_option(option) \
|
|
494
|
+
((option) == CURLOPT_HEADERFUNCTION || \
|
|
495
|
+
(option) == CURLOPT_WRITEFUNCTION)
|
|
496
|
+
|
|
497
|
+
/* evaluates to true if option takes a curl_conv_callback argument */
|
|
498
|
+
#define curlcheck_conv_cb_option(option) \
|
|
499
|
+
((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
|
|
500
|
+
(option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
|
|
501
|
+
(option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)
|
|
502
|
+
|
|
503
|
+
/* evaluates to true if option takes a data argument to pass to a callback */
|
|
504
|
+
#define curlcheck_cb_data_option(option) \
|
|
505
|
+
((option) == CURLOPT_CHUNK_DATA || \
|
|
506
|
+
(option) == CURLOPT_CLOSESOCKETDATA || \
|
|
507
|
+
(option) == CURLOPT_DEBUGDATA || \
|
|
508
|
+
(option) == CURLOPT_FNMATCH_DATA || \
|
|
509
|
+
(option) == CURLOPT_HEADERDATA || \
|
|
510
|
+
(option) == CURLOPT_HSTSREADDATA || \
|
|
511
|
+
(option) == CURLOPT_HSTSWRITEDATA || \
|
|
512
|
+
(option) == CURLOPT_INTERLEAVEDATA || \
|
|
513
|
+
(option) == CURLOPT_IOCTLDATA || \
|
|
514
|
+
(option) == CURLOPT_OPENSOCKETDATA || \
|
|
515
|
+
(option) == CURLOPT_PREREQDATA || \
|
|
516
|
+
(option) == CURLOPT_XFERINFODATA || \
|
|
517
|
+
(option) == CURLOPT_READDATA || \
|
|
518
|
+
(option) == CURLOPT_SEEKDATA || \
|
|
519
|
+
(option) == CURLOPT_SOCKOPTDATA || \
|
|
520
|
+
(option) == CURLOPT_SSH_KEYDATA || \
|
|
521
|
+
(option) == CURLOPT_SSL_CTX_DATA || \
|
|
522
|
+
(option) == CURLOPT_WRITEDATA || \
|
|
523
|
+
(option) == CURLOPT_RESOLVER_START_DATA || \
|
|
524
|
+
(option) == CURLOPT_TRAILERDATA || \
|
|
525
|
+
(option) == CURLOPT_SSH_HOSTKEYDATA || \
|
|
526
|
+
0)
|
|
527
|
+
|
|
528
|
+
/* evaluates to true if option takes a POST data argument (void* or char*) */
|
|
529
|
+
#define curlcheck_postfields_option(option) \
|
|
530
|
+
((option) == CURLOPT_POSTFIELDS || \
|
|
531
|
+
(option) == CURLOPT_COPYPOSTFIELDS || \
|
|
532
|
+
0)
|
|
533
|
+
|
|
534
|
+
/* evaluates to true if option takes a struct curl_slist * argument */
|
|
535
|
+
#define curlcheck_slist_option(option) \
|
|
536
|
+
((option) == CURLOPT_HTTP200ALIASES || \
|
|
537
|
+
(option) == CURLOPT_HTTPHEADER || \
|
|
538
|
+
(option) == CURLOPT_MAIL_RCPT || \
|
|
539
|
+
(option) == CURLOPT_POSTQUOTE || \
|
|
540
|
+
(option) == CURLOPT_PREQUOTE || \
|
|
541
|
+
(option) == CURLOPT_PROXYHEADER || \
|
|
542
|
+
(option) == CURLOPT_QUOTE || \
|
|
543
|
+
(option) == CURLOPT_RESOLVE || \
|
|
544
|
+
(option) == CURLOPT_TELNETOPTIONS || \
|
|
545
|
+
(option) == CURLOPT_CONNECT_TO || \
|
|
546
|
+
0)
|
|
547
|
+
|
|
548
|
+
/* groups of curl_easy_getinfo infos that take the same type of argument */
|
|
549
|
+
|
|
550
|
+
/* evaluates to true if info expects a pointer to char * argument */
|
|
551
|
+
#define curlcheck_string_info(info) \
|
|
552
|
+
(CURLINFO_STRING < (info) && (info) < CURLINFO_LONG && \
|
|
553
|
+
(info) != CURLINFO_PRIVATE)
|
|
554
|
+
|
|
555
|
+
/* evaluates to true if info expects a pointer to long argument */
|
|
556
|
+
#define curlcheck_long_info(info) \
|
|
557
|
+
(CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)
|
|
558
|
+
|
|
559
|
+
/* evaluates to true if info expects a pointer to double argument */
|
|
560
|
+
#define curlcheck_double_info(info) \
|
|
561
|
+
(CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
|
|
562
|
+
|
|
563
|
+
/* true if info expects a pointer to struct curl_slist * argument */
|
|
564
|
+
#define curlcheck_slist_info(info) \
|
|
565
|
+
(((info) == CURLINFO_SSL_ENGINES) || ((info) == CURLINFO_COOKIELIST))
|
|
566
|
+
|
|
567
|
+
/* true if info expects a pointer to struct curl_tlssessioninfo * argument */
|
|
568
|
+
#define curlcheck_tlssessioninfo_info(info) \
|
|
569
|
+
(((info) == CURLINFO_TLS_SSL_PTR) || ((info) == CURLINFO_TLS_SESSION))
|
|
570
|
+
|
|
571
|
+
/* true if info expects a pointer to struct curl_certinfo * argument */
|
|
572
|
+
#define curlcheck_certinfo_info(info) ((info) == CURLINFO_CERTINFO)
|
|
573
|
+
|
|
574
|
+
/* true if info expects a pointer to struct curl_socket_t argument */
|
|
575
|
+
#define curlcheck_socket_info(info) \
|
|
576
|
+
(CURLINFO_SOCKET < (info) && (info) < CURLINFO_OFF_T)
|
|
577
|
+
|
|
578
|
+
/* true if info expects a pointer to curl_off_t argument */
|
|
579
|
+
#define curlcheck_off_t_info(info) \
|
|
580
|
+
(CURLINFO_OFF_T < (info))
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
/* typecheck helpers -- check whether given expression has requested type */
|
|
584
|
+
|
|
585
|
+
/* For pointers, you can use the curlcheck_ptr/curlcheck_arr macros,
|
|
586
|
+
* otherwise define a new macro. Search for __builtin_types_compatible_p
|
|
587
|
+
* in the GCC manual.
|
|
588
|
+
* NOTE: these macros MUST NOT EVALUATE their arguments! The argument is
|
|
589
|
+
* the actual expression passed to the curl_easy_setopt macro. This
|
|
590
|
+
* means that you can only apply the sizeof and __typeof__ operators, no
|
|
591
|
+
* == or whatsoever.
|
|
592
|
+
*/
|
|
593
|
+
|
|
594
|
+
/* XXX: should evaluate to true if expr is a pointer */
|
|
595
|
+
#define curlcheck_any_ptr(expr) \
|
|
596
|
+
(sizeof(expr) == sizeof(void *))
|
|
597
|
+
|
|
598
|
+
/* evaluates to true if expr is NULL */
|
|
599
|
+
/* XXX: must not evaluate expr, so this check is not accurate */
|
|
600
|
+
#define curlcheck_NULL(expr) \
|
|
601
|
+
(__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))
|
|
602
|
+
|
|
603
|
+
/* evaluates to true if expr is type*, const type* or NULL */
|
|
604
|
+
#define curlcheck_ptr(expr, type) \
|
|
605
|
+
(curlcheck_NULL(expr) || \
|
|
606
|
+
__builtin_types_compatible_p(__typeof__(expr), type *) || \
|
|
607
|
+
__builtin_types_compatible_p(__typeof__(expr), const type *))
|
|
608
|
+
|
|
609
|
+
/* evaluates to true if expr is type**, const type** or NULL */
|
|
610
|
+
#define curlcheck_ptrptr(expr, type) \
|
|
611
|
+
(curlcheck_NULL(expr) || \
|
|
612
|
+
__builtin_types_compatible_p(__typeof__(expr), type **) || \
|
|
613
|
+
__builtin_types_compatible_p(__typeof__(expr), type *[]) || \
|
|
614
|
+
__builtin_types_compatible_p(__typeof__(expr), const type *[]) || \
|
|
615
|
+
__builtin_types_compatible_p(__typeof__(expr), const type **))
|
|
616
|
+
|
|
617
|
+
/* evaluates to true if expr is one of type[], type*, NULL or const type* */
|
|
618
|
+
#define curlcheck_arr(expr, type) \
|
|
619
|
+
(curlcheck_ptr((expr), type) || \
|
|
620
|
+
__builtin_types_compatible_p(__typeof__(expr), type []))
|
|
621
|
+
|
|
622
|
+
/* evaluates to true if expr is a string */
|
|
623
|
+
#define curlcheck_string(expr) \
|
|
624
|
+
(curlcheck_arr((expr), char) || \
|
|
625
|
+
curlcheck_arr((expr), signed char) || \
|
|
626
|
+
curlcheck_arr((expr), unsigned char))
|
|
627
|
+
|
|
628
|
+
/* evaluates to true if expr is a CURL * */
|
|
629
|
+
#define curlcheck_curl(expr) \
|
|
630
|
+
(curlcheck_NULL(expr) || \
|
|
631
|
+
__builtin_types_compatible_p(__typeof__(expr), CURL *))
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
/* evaluates to true if expr is a long (no matter the signedness)
|
|
635
|
+
* XXX: for now, int is also accepted (and therefore short and char, which
|
|
636
|
+
* are promoted to int when passed to a variadic function) */
|
|
637
|
+
#define curlcheck_long(expr) \
|
|
638
|
+
( \
|
|
639
|
+
((sizeof(long) != sizeof(int)) && \
|
|
640
|
+
(__builtin_types_compatible_p(__typeof__(expr), long) || \
|
|
641
|
+
__builtin_types_compatible_p(__typeof__(expr), signed long) || \
|
|
642
|
+
__builtin_types_compatible_p(__typeof__(expr), unsigned long))) \
|
|
643
|
+
|| \
|
|
644
|
+
((sizeof(long) == sizeof(int)) && \
|
|
645
|
+
(__builtin_types_compatible_p(__typeof__(expr), long) || \
|
|
646
|
+
__builtin_types_compatible_p(__typeof__(expr), signed long) || \
|
|
647
|
+
__builtin_types_compatible_p(__typeof__(expr), unsigned long) || \
|
|
648
|
+
__builtin_types_compatible_p(__typeof__(expr), int) || \
|
|
649
|
+
__builtin_types_compatible_p(__typeof__(expr), signed int) || \
|
|
650
|
+
__builtin_types_compatible_p(__typeof__(expr), unsigned int) || \
|
|
651
|
+
__builtin_types_compatible_p(__typeof__(expr), short) || \
|
|
652
|
+
__builtin_types_compatible_p(__typeof__(expr), signed short) || \
|
|
653
|
+
__builtin_types_compatible_p(__typeof__(expr), unsigned short) || \
|
|
654
|
+
__builtin_types_compatible_p(__typeof__(expr), char) || \
|
|
655
|
+
__builtin_types_compatible_p(__typeof__(expr), signed char) || \
|
|
656
|
+
__builtin_types_compatible_p(__typeof__(expr), unsigned char))) \
|
|
657
|
+
)
|
|
658
|
+
|
|
659
|
+
/* evaluates to true if expr is of type curl_off_t */
|
|
660
|
+
#define curlcheck_off_t(expr) \
|
|
661
|
+
(__builtin_types_compatible_p(__typeof__(expr), curl_off_t))
|
|
662
|
+
|
|
663
|
+
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
|
|
664
|
+
/* XXX: also check size of an char[] array? */
|
|
665
|
+
#define curlcheck_error_buffer(expr) \
|
|
666
|
+
(curlcheck_NULL(expr) || \
|
|
667
|
+
__builtin_types_compatible_p(__typeof__(expr), char *) || \
|
|
668
|
+
__builtin_types_compatible_p(__typeof__(expr), char[]))
|
|
669
|
+
|
|
670
|
+
/* evaluates to true if expr is of type (const) void* or (const) FILE* */
|
|
671
|
+
#if 0
|
|
672
|
+
#define curlcheck_cb_data(expr) \
|
|
673
|
+
(curlcheck_ptr((expr), void) || \
|
|
674
|
+
curlcheck_ptr((expr), FILE))
|
|
675
|
+
#else /* be less strict */
|
|
676
|
+
#define curlcheck_cb_data(expr) \
|
|
677
|
+
curlcheck_any_ptr(expr)
|
|
678
|
+
#endif
|
|
679
|
+
|
|
680
|
+
/* evaluates to true if expr is of type FILE* */
|
|
681
|
+
#define curlcheck_FILE(expr) \
|
|
682
|
+
(curlcheck_NULL(expr) || \
|
|
683
|
+
(__builtin_types_compatible_p(__typeof__(expr), FILE *)))
|
|
684
|
+
|
|
685
|
+
/* evaluates to true if expr can be passed as POST data (void* or char*) */
|
|
686
|
+
#define curlcheck_postfields(expr) \
|
|
687
|
+
(curlcheck_ptr((expr), void) || \
|
|
688
|
+
curlcheck_arr((expr), char) || \
|
|
689
|
+
curlcheck_arr((expr), unsigned char))
|
|
690
|
+
|
|
691
|
+
/* helper: __builtin_types_compatible_p distinguishes between functions and
|
|
692
|
+
* function pointers, hide it */
|
|
693
|
+
#define curlcheck_cb_compatible(func, type) \
|
|
694
|
+
(__builtin_types_compatible_p(__typeof__(func), type) || \
|
|
695
|
+
__builtin_types_compatible_p(__typeof__(func) *, type))
|
|
696
|
+
|
|
697
|
+
/* evaluates to true if expr is of type curl_resolver_start_callback */
|
|
698
|
+
#define curlcheck_resolver_start_callback(expr) \
|
|
699
|
+
(curlcheck_NULL(expr) || \
|
|
700
|
+
curlcheck_cb_compatible((expr), curl_resolver_start_callback))
|
|
701
|
+
|
|
702
|
+
/* evaluates to true if expr is of type curl_read_callback or "similar" */
|
|
703
|
+
#define curlcheck_read_cb(expr) \
|
|
704
|
+
(curlcheck_NULL(expr) || \
|
|
705
|
+
curlcheck_cb_compatible((expr), __typeof__(fread) *) || \
|
|
706
|
+
curlcheck_cb_compatible((expr), curl_read_callback) || \
|
|
707
|
+
curlcheck_cb_compatible((expr), _curl_read_callback1) || \
|
|
708
|
+
curlcheck_cb_compatible((expr), _curl_read_callback2) || \
|
|
709
|
+
curlcheck_cb_compatible((expr), _curl_read_callback3) || \
|
|
710
|
+
curlcheck_cb_compatible((expr), _curl_read_callback4) || \
|
|
711
|
+
curlcheck_cb_compatible((expr), _curl_read_callback5) || \
|
|
712
|
+
curlcheck_cb_compatible((expr), _curl_read_callback6))
|
|
713
|
+
typedef size_t (*_curl_read_callback1)(char *, size_t, size_t, void *);
|
|
714
|
+
typedef size_t (*_curl_read_callback2)(char *, size_t, size_t, const void *);
|
|
715
|
+
typedef size_t (*_curl_read_callback3)(char *, size_t, size_t, FILE *);
|
|
716
|
+
typedef size_t (*_curl_read_callback4)(void *, size_t, size_t, void *);
|
|
717
|
+
typedef size_t (*_curl_read_callback5)(void *, size_t, size_t, const void *);
|
|
718
|
+
typedef size_t (*_curl_read_callback6)(void *, size_t, size_t, FILE *);
|
|
719
|
+
|
|
720
|
+
/* evaluates to true if expr is of type curl_write_callback or "similar" */
|
|
721
|
+
#define curlcheck_write_cb(expr) \
|
|
722
|
+
(curlcheck_read_cb(expr) || \
|
|
723
|
+
curlcheck_cb_compatible((expr), __typeof__(fwrite) *) || \
|
|
724
|
+
curlcheck_cb_compatible((expr), curl_write_callback) || \
|
|
725
|
+
curlcheck_cb_compatible((expr), _curl_write_callback1) || \
|
|
726
|
+
curlcheck_cb_compatible((expr), _curl_write_callback2) || \
|
|
727
|
+
curlcheck_cb_compatible((expr), _curl_write_callback3) || \
|
|
728
|
+
curlcheck_cb_compatible((expr), _curl_write_callback4) || \
|
|
729
|
+
curlcheck_cb_compatible((expr), _curl_write_callback5) || \
|
|
730
|
+
curlcheck_cb_compatible((expr), _curl_write_callback6))
|
|
731
|
+
typedef size_t (*_curl_write_callback1)(const char *, size_t, size_t, void *);
|
|
732
|
+
typedef size_t (*_curl_write_callback2)(const char *, size_t, size_t,
|
|
733
|
+
const void *);
|
|
734
|
+
typedef size_t (*_curl_write_callback3)(const char *, size_t, size_t, FILE *);
|
|
735
|
+
typedef size_t (*_curl_write_callback4)(const void *, size_t, size_t, void *);
|
|
736
|
+
typedef size_t (*_curl_write_callback5)(const void *, size_t, size_t,
|
|
737
|
+
const void *);
|
|
738
|
+
typedef size_t (*_curl_write_callback6)(const void *, size_t, size_t, FILE *);
|
|
739
|
+
|
|
740
|
+
/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
|
|
741
|
+
#define curlcheck_ioctl_cb(expr) \
|
|
742
|
+
(curlcheck_NULL(expr) || \
|
|
743
|
+
curlcheck_cb_compatible((expr), curl_ioctl_callback) || \
|
|
744
|
+
curlcheck_cb_compatible((expr), _curl_ioctl_callback1) || \
|
|
745
|
+
curlcheck_cb_compatible((expr), _curl_ioctl_callback2) || \
|
|
746
|
+
curlcheck_cb_compatible((expr), _curl_ioctl_callback3) || \
|
|
747
|
+
curlcheck_cb_compatible((expr), _curl_ioctl_callback4))
|
|
748
|
+
typedef curlioerr (*_curl_ioctl_callback1)(CURL *, int, void *);
|
|
749
|
+
typedef curlioerr (*_curl_ioctl_callback2)(CURL *, int, const void *);
|
|
750
|
+
typedef curlioerr (*_curl_ioctl_callback3)(CURL *, curliocmd, void *);
|
|
751
|
+
typedef curlioerr (*_curl_ioctl_callback4)(CURL *, curliocmd, const void *);
|
|
752
|
+
|
|
753
|
+
/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */
|
|
754
|
+
#define curlcheck_sockopt_cb(expr) \
|
|
755
|
+
(curlcheck_NULL(expr) || \
|
|
756
|
+
curlcheck_cb_compatible((expr), curl_sockopt_callback) || \
|
|
757
|
+
curlcheck_cb_compatible((expr), _curl_sockopt_callback1) || \
|
|
758
|
+
curlcheck_cb_compatible((expr), _curl_sockopt_callback2))
|
|
759
|
+
typedef int (*_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
|
|
760
|
+
typedef int (*_curl_sockopt_callback2)(const void *, curl_socket_t,
|
|
761
|
+
curlsocktype);
|
|
762
|
+
|
|
763
|
+
/* evaluates to true if expr is of type curl_opensocket_callback or
|
|
764
|
+
"similar" */
|
|
765
|
+
#define curlcheck_opensocket_cb(expr) \
|
|
766
|
+
(curlcheck_NULL(expr) || \
|
|
767
|
+
curlcheck_cb_compatible((expr), curl_opensocket_callback) || \
|
|
768
|
+
curlcheck_cb_compatible((expr), _curl_opensocket_callback1) || \
|
|
769
|
+
curlcheck_cb_compatible((expr), _curl_opensocket_callback2) || \
|
|
770
|
+
curlcheck_cb_compatible((expr), _curl_opensocket_callback3) || \
|
|
771
|
+
curlcheck_cb_compatible((expr), _curl_opensocket_callback4))
|
|
772
|
+
typedef curl_socket_t (*_curl_opensocket_callback1)
|
|
773
|
+
(void *, curlsocktype, struct curl_sockaddr *);
|
|
774
|
+
typedef curl_socket_t (*_curl_opensocket_callback2)
|
|
775
|
+
(void *, curlsocktype, const struct curl_sockaddr *);
|
|
776
|
+
typedef curl_socket_t (*_curl_opensocket_callback3)
|
|
777
|
+
(const void *, curlsocktype, struct curl_sockaddr *);
|
|
778
|
+
typedef curl_socket_t (*_curl_opensocket_callback4)
|
|
779
|
+
(const void *, curlsocktype, const struct curl_sockaddr *);
|
|
780
|
+
|
|
781
|
+
/* evaluates to true if expr is of type curl_progress_callback or "similar" */
|
|
782
|
+
#define curlcheck_progress_cb(expr) \
|
|
783
|
+
(curlcheck_NULL(expr) || \
|
|
784
|
+
curlcheck_cb_compatible((expr), curl_progress_callback) || \
|
|
785
|
+
curlcheck_cb_compatible((expr), _curl_progress_callback1) || \
|
|
786
|
+
curlcheck_cb_compatible((expr), _curl_progress_callback2))
|
|
787
|
+
typedef int (*_curl_progress_callback1)(void *,
|
|
788
|
+
double, double, double, double);
|
|
789
|
+
typedef int (*_curl_progress_callback2)(const void *,
|
|
790
|
+
double, double, double, double);
|
|
791
|
+
|
|
792
|
+
/* evaluates to true if expr is of type curl_xferinfo_callback */
|
|
793
|
+
#define curlcheck_xferinfo_cb(expr) \
|
|
794
|
+
(curlcheck_NULL(expr) || \
|
|
795
|
+
curlcheck_cb_compatible((expr), curl_xferinfo_callback))
|
|
796
|
+
|
|
797
|
+
/* evaluates to true if expr is of type curl_debug_callback or "similar" */
|
|
798
|
+
#define curlcheck_debug_cb(expr) \
|
|
799
|
+
(curlcheck_NULL(expr) || \
|
|
800
|
+
curlcheck_cb_compatible((expr), curl_debug_callback) || \
|
|
801
|
+
curlcheck_cb_compatible((expr), _curl_debug_callback1) || \
|
|
802
|
+
curlcheck_cb_compatible((expr), _curl_debug_callback2) || \
|
|
803
|
+
curlcheck_cb_compatible((expr), _curl_debug_callback3) || \
|
|
804
|
+
curlcheck_cb_compatible((expr), _curl_debug_callback4) || \
|
|
805
|
+
curlcheck_cb_compatible((expr), _curl_debug_callback5) || \
|
|
806
|
+
curlcheck_cb_compatible((expr), _curl_debug_callback6) || \
|
|
807
|
+
curlcheck_cb_compatible((expr), _curl_debug_callback7) || \
|
|
808
|
+
curlcheck_cb_compatible((expr), _curl_debug_callback8))
|
|
809
|
+
typedef int (*_curl_debug_callback1) (CURL *,
|
|
810
|
+
curl_infotype, char *, size_t, void *);
|
|
811
|
+
typedef int (*_curl_debug_callback2) (CURL *,
|
|
812
|
+
curl_infotype, char *, size_t, const void *);
|
|
813
|
+
typedef int (*_curl_debug_callback3) (CURL *,
|
|
814
|
+
curl_infotype, const char *, size_t, void *);
|
|
815
|
+
typedef int (*_curl_debug_callback4) (CURL *,
|
|
816
|
+
curl_infotype, const char *, size_t, const void *);
|
|
817
|
+
typedef int (*_curl_debug_callback5) (CURL *,
|
|
818
|
+
curl_infotype, unsigned char *, size_t, void *);
|
|
819
|
+
typedef int (*_curl_debug_callback6) (CURL *,
|
|
820
|
+
curl_infotype, unsigned char *, size_t, const void *);
|
|
821
|
+
typedef int (*_curl_debug_callback7) (CURL *,
|
|
822
|
+
curl_infotype, const unsigned char *, size_t, void *);
|
|
823
|
+
typedef int (*_curl_debug_callback8) (CURL *,
|
|
824
|
+
curl_infotype, const unsigned char *, size_t, const void *);
|
|
825
|
+
|
|
826
|
+
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
|
|
827
|
+
/* this is getting even messier... */
|
|
828
|
+
#define curlcheck_ssl_ctx_cb(expr) \
|
|
829
|
+
(curlcheck_NULL(expr) || \
|
|
830
|
+
curlcheck_cb_compatible((expr), curl_ssl_ctx_callback) || \
|
|
831
|
+
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback1) || \
|
|
832
|
+
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback2) || \
|
|
833
|
+
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback3) || \
|
|
834
|
+
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback4) || \
|
|
835
|
+
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback5) || \
|
|
836
|
+
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback6) || \
|
|
837
|
+
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback7) || \
|
|
838
|
+
curlcheck_cb_compatible((expr), _curl_ssl_ctx_callback8))
|
|
839
|
+
typedef CURLcode (*_curl_ssl_ctx_callback1)(CURL *, void *, void *);
|
|
840
|
+
typedef CURLcode (*_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
|
|
841
|
+
typedef CURLcode (*_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
|
|
842
|
+
typedef CURLcode (*_curl_ssl_ctx_callback4)(CURL *, const void *,
|
|
843
|
+
const void *);
|
|
844
|
+
#ifdef HEADER_SSL_H
|
|
845
|
+
/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
|
|
846
|
+
* this will of course break if we are included before OpenSSL headers...
|
|
847
|
+
*/
|
|
848
|
+
typedef CURLcode (*_curl_ssl_ctx_callback5)(CURL *, SSL_CTX *, void *);
|
|
849
|
+
typedef CURLcode (*_curl_ssl_ctx_callback6)(CURL *, SSL_CTX *, const void *);
|
|
850
|
+
typedef CURLcode (*_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX *, void *);
|
|
851
|
+
typedef CURLcode (*_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX *,
|
|
852
|
+
const void *);
|
|
853
|
+
#else
|
|
854
|
+
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
|
|
855
|
+
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;
|
|
856
|
+
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;
|
|
857
|
+
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;
|
|
858
|
+
#endif
|
|
859
|
+
|
|
860
|
+
/* evaluates to true if expr is of type curl_conv_callback or "similar" */
|
|
861
|
+
#define curlcheck_conv_cb(expr) \
|
|
862
|
+
(curlcheck_NULL(expr) || \
|
|
863
|
+
curlcheck_cb_compatible((expr), curl_conv_callback) || \
|
|
864
|
+
curlcheck_cb_compatible((expr), _curl_conv_callback1) || \
|
|
865
|
+
curlcheck_cb_compatible((expr), _curl_conv_callback2) || \
|
|
866
|
+
curlcheck_cb_compatible((expr), _curl_conv_callback3) || \
|
|
867
|
+
curlcheck_cb_compatible((expr), _curl_conv_callback4))
|
|
868
|
+
typedef CURLcode (*_curl_conv_callback1)(char *, size_t length);
|
|
869
|
+
typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);
|
|
870
|
+
typedef CURLcode (*_curl_conv_callback3)(void *, size_t length);
|
|
871
|
+
typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);
|
|
872
|
+
|
|
873
|
+
/* evaluates to true if expr is of type curl_seek_callback or "similar" */
|
|
874
|
+
#define curlcheck_seek_cb(expr) \
|
|
875
|
+
(curlcheck_NULL(expr) || \
|
|
876
|
+
curlcheck_cb_compatible((expr), curl_seek_callback) || \
|
|
877
|
+
curlcheck_cb_compatible((expr), _curl_seek_callback1) || \
|
|
878
|
+
curlcheck_cb_compatible((expr), _curl_seek_callback2))
|
|
879
|
+
typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);
|
|
880
|
+
typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);
|
|
881
|
+
|
|
882
|
+
/* evaluates to true if expr is of type curl_chunk_bgn_callback */
|
|
883
|
+
#define curlcheck_chunk_bgn_cb(expr) \
|
|
884
|
+
(curlcheck_NULL(expr) || \
|
|
885
|
+
curlcheck_cb_compatible((expr), curl_chunk_bgn_callback) || \
|
|
886
|
+
curlcheck_cb_compatible((expr), _curl_chunk_bgn_callback1) || \
|
|
887
|
+
curlcheck_cb_compatible((expr), _curl_chunk_bgn_callback2))
|
|
888
|
+
typedef long (*_curl_chunk_bgn_callback1)(struct curl_fileinfo *,
|
|
889
|
+
void *, int);
|
|
890
|
+
typedef long (*_curl_chunk_bgn_callback2)(void *, void *, int);
|
|
891
|
+
|
|
892
|
+
/* evaluates to true if expr is of type curl_chunk_end_callback */
|
|
893
|
+
#define curlcheck_chunk_end_cb(expr) \
|
|
894
|
+
(curlcheck_NULL(expr) || \
|
|
895
|
+
curlcheck_cb_compatible((expr), curl_chunk_end_callback))
|
|
896
|
+
|
|
897
|
+
/* evaluates to true if expr is of type curl_closesocket_callback */
|
|
898
|
+
#define curlcheck_close_socket_cb(expr) \
|
|
899
|
+
(curlcheck_NULL(expr) || \
|
|
900
|
+
curlcheck_cb_compatible((expr), curl_closesocket_callback))
|
|
901
|
+
|
|
902
|
+
/* evaluates to true if expr is of type curl_fnmatch_callback */
|
|
903
|
+
#define curlcheck_fnmatch_cb(expr) \
|
|
904
|
+
(curlcheck_NULL(expr) || \
|
|
905
|
+
curlcheck_cb_compatible((expr), curl_fnmatch_callback))
|
|
906
|
+
|
|
907
|
+
/* evaluates to true if expr is of type curl_hstsread_callback */
|
|
908
|
+
#define curlcheck_hstsread_cb(expr) \
|
|
909
|
+
(curlcheck_NULL(expr) || \
|
|
910
|
+
curlcheck_cb_compatible((expr), curl_hstsread_callback))
|
|
911
|
+
|
|
912
|
+
/* evaluates to true if expr is of type curl_hstswrite_callback */
|
|
913
|
+
#define curlcheck_hstswrite_cb(expr) \
|
|
914
|
+
(curlcheck_NULL(expr) || \
|
|
915
|
+
curlcheck_cb_compatible((expr), curl_hstswrite_callback))
|
|
916
|
+
|
|
917
|
+
/* evaluates to true if expr is of type curl_sshhostkeycallback */
|
|
918
|
+
#define curlcheck_ssh_hostkey_cb(expr) \
|
|
919
|
+
(curlcheck_NULL(expr) || \
|
|
920
|
+
curlcheck_cb_compatible((expr), curl_sshhostkeycallback))
|
|
921
|
+
|
|
922
|
+
/* evaluates to true if expr is of type curl_sshkeycallback */
|
|
923
|
+
#define curlcheck_ssh_key_cb(expr) \
|
|
924
|
+
(curlcheck_NULL(expr) || \
|
|
925
|
+
curlcheck_cb_compatible((expr), curl_sshkeycallback))
|
|
926
|
+
|
|
927
|
+
/* evaluates to true if expr is of type curl_interleave_callback */
|
|
928
|
+
#define curlcheck_interleave_cb(expr) \
|
|
929
|
+
(curlcheck_NULL(expr) || \
|
|
930
|
+
curlcheck_cb_compatible((expr), _curl_interleave_callback1) || \
|
|
931
|
+
curlcheck_cb_compatible((expr), _curl_interleave_callback2))
|
|
932
|
+
typedef size_t (*_curl_interleave_callback1)(void *p, size_t s,
|
|
933
|
+
size_t n, void *u);
|
|
934
|
+
typedef size_t (*_curl_interleave_callback2)(char *p, size_t s,
|
|
935
|
+
size_t n, void *u);
|
|
936
|
+
|
|
937
|
+
/* evaluates to true if expr is of type curl_prereq_callback */
|
|
938
|
+
#define curlcheck_prereq_cb(expr) \
|
|
939
|
+
(curlcheck_NULL(expr) || \
|
|
940
|
+
curlcheck_cb_compatible((expr), curl_prereq_callback))
|
|
941
|
+
|
|
942
|
+
/* evaluates to true if expr is of type curl_trailer_callback */
|
|
943
|
+
#define curlcheck_trailer_cb(expr) \
|
|
944
|
+
(curlcheck_NULL(expr) || \
|
|
945
|
+
curlcheck_cb_compatible((expr), curl_trailer_callback))
|
|
946
|
+
|
|
947
|
+
#endif /* CURLINC_TYPECHECK_GCC_H */
|