00001 #ifndef __CURL_TYPECHECK_GCC_H
00002 #define __CURL_TYPECHECK_GCC_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #define curl_easy_setopt(handle, option, value) \
00042 __extension__ ({ \
00043 __typeof__(option) _curl_opt = option; \
00044 if(__builtin_constant_p(_curl_opt)) { \
00045 if(_curl_is_long_option(_curl_opt)) \
00046 if(!_curl_is_long(value)) \
00047 _curl_easy_setopt_err_long(); \
00048 if(_curl_is_off_t_option(_curl_opt)) \
00049 if(!_curl_is_off_t(value)) \
00050 _curl_easy_setopt_err_curl_off_t(); \
00051 if(_curl_is_string_option(_curl_opt)) \
00052 if(!_curl_is_string(value)) \
00053 _curl_easy_setopt_err_string(); \
00054 if(_curl_is_write_cb_option(_curl_opt)) \
00055 if(!_curl_is_write_cb(value)) \
00056 _curl_easy_setopt_err_write_callback(); \
00057 if((_curl_opt) == CURLOPT_READFUNCTION) \
00058 if(!_curl_is_read_cb(value)) \
00059 _curl_easy_setopt_err_read_cb(); \
00060 if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
00061 if(!_curl_is_ioctl_cb(value)) \
00062 _curl_easy_setopt_err_ioctl_cb(); \
00063 if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
00064 if(!_curl_is_sockopt_cb(value)) \
00065 _curl_easy_setopt_err_sockopt_cb(); \
00066 if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
00067 if(!_curl_is_opensocket_cb(value)) \
00068 _curl_easy_setopt_err_opensocket_cb(); \
00069 if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
00070 if(!_curl_is_progress_cb(value)) \
00071 _curl_easy_setopt_err_progress_cb(); \
00072 if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
00073 if(!_curl_is_debug_cb(value)) \
00074 _curl_easy_setopt_err_debug_cb(); \
00075 if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
00076 if(!_curl_is_ssl_ctx_cb(value)) \
00077 _curl_easy_setopt_err_ssl_ctx_cb(); \
00078 if(_curl_is_conv_cb_option(_curl_opt)) \
00079 if(!_curl_is_conv_cb(value)) \
00080 _curl_easy_setopt_err_conv_cb(); \
00081 if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
00082 if(!_curl_is_seek_cb(value)) \
00083 _curl_easy_setopt_err_seek_cb(); \
00084 if(_curl_is_cb_data_option(_curl_opt)) \
00085 if(!_curl_is_cb_data(value)) \
00086 _curl_easy_setopt_err_cb_data(); \
00087 if((_curl_opt) == CURLOPT_ERRORBUFFER) \
00088 if(!_curl_is_error_buffer(value)) \
00089 _curl_easy_setopt_err_error_buffer(); \
00090 if((_curl_opt) == CURLOPT_STDERR) \
00091 if(!_curl_is_FILE(value)) \
00092 _curl_easy_setopt_err_FILE(); \
00093 if(_curl_is_postfields_option(_curl_opt)) \
00094 if(!_curl_is_postfields(value)) \
00095 _curl_easy_setopt_err_postfields(); \
00096 if((_curl_opt) == CURLOPT_HTTPPOST) \
00097 if(!_curl_is_arr((value), struct curl_httppost)) \
00098 _curl_easy_setopt_err_curl_httpost(); \
00099 if(_curl_is_slist_option(_curl_opt)) \
00100 if(!_curl_is_arr((value), struct curl_slist)) \
00101 _curl_easy_setopt_err_curl_slist(); \
00102 if((_curl_opt) == CURLOPT_SHARE) \
00103 if(!_curl_is_ptr((value), CURLSH)) \
00104 _curl_easy_setopt_err_CURLSH(); \
00105 } \
00106 curl_easy_setopt(handle, _curl_opt, value); \
00107 })
00108
00109
00110
00111 #define curl_easy_getinfo(handle, info, arg) \
00112 __extension__ ({ \
00113 __typeof__(info) _curl_info = info; \
00114 if(__builtin_constant_p(_curl_info)) { \
00115 if(_curl_is_string_info(_curl_info)) \
00116 if(!_curl_is_arr((arg), char *)) \
00117 _curl_easy_getinfo_err_string(); \
00118 if(_curl_is_long_info(_curl_info)) \
00119 if(!_curl_is_arr((arg), long)) \
00120 _curl_easy_getinfo_err_long(); \
00121 if(_curl_is_double_info(_curl_info)) \
00122 if(!_curl_is_arr((arg), double)) \
00123 _curl_easy_getinfo_err_double(); \
00124 if(_curl_is_slist_info(_curl_info)) \
00125 if(!_curl_is_arr((arg), struct curl_slist *)) \
00126 _curl_easy_getinfo_err_curl_slist(); \
00127 } \
00128 curl_easy_getinfo(handle, _curl_info, arg); \
00129 })
00130
00131
00132
00133
00134
00135 #define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
00136 #define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
00137
00138
00139
00140
00141
00142
00143 #define _CURL_WARNING(id, message) \
00144 static void __attribute__((__warning__(message))) \
00145 __attribute__((__unused__)) __attribute__((__noinline__)) \
00146 id(void) { __asm__(""); }
00147
00148 _CURL_WARNING(_curl_easy_setopt_err_long,
00149 "curl_easy_setopt expects a long argument for this option")
00150 _CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
00151 "curl_easy_setopt expects a curl_off_t argument for this option")
00152 _CURL_WARNING(_curl_easy_setopt_err_string,
00153 "curl_easy_setopt expects a "
00154 "string ('char *' or char[]) argument for this option"
00155 )
00156 _CURL_WARNING(_curl_easy_setopt_err_write_callback,
00157 "curl_easy_setopt expects a curl_write_callback argument for this option")
00158 _CURL_WARNING(_curl_easy_setopt_err_read_cb,
00159 "curl_easy_setopt expects a curl_read_callback argument for this option")
00160 _CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
00161 "curl_easy_setopt expects a curl_ioctl_callback argument for this option")
00162 _CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
00163 "curl_easy_setopt expects a curl_sockopt_callback argument for this option")
00164 _CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
00165 "curl_easy_setopt expects a "
00166 "curl_opensocket_callback argument for this option"
00167 )
00168 _CURL_WARNING(_curl_easy_setopt_err_progress_cb,
00169 "curl_easy_setopt expects a curl_progress_callback argument for this option")
00170 _CURL_WARNING(_curl_easy_setopt_err_debug_cb,
00171 "curl_easy_setopt expects a curl_debug_callback argument for this option")
00172 _CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,
00173 "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
00174 _CURL_WARNING(_curl_easy_setopt_err_conv_cb,
00175 "curl_easy_setopt expects a curl_conv_callback argument for this option")
00176 _CURL_WARNING(_curl_easy_setopt_err_seek_cb,
00177 "curl_easy_setopt expects a curl_seek_callback argument for this option")
00178 _CURL_WARNING(_curl_easy_setopt_err_cb_data,
00179 "curl_easy_setopt expects a "
00180 "private data pointer as argument for this option")
00181 _CURL_WARNING(_curl_easy_setopt_err_error_buffer,
00182 "curl_easy_setopt expects a "
00183 "char buffer of CURL_ERROR_SIZE as argument for this option")
00184 _CURL_WARNING(_curl_easy_setopt_err_FILE,
00185 "curl_easy_setopt expects a 'FILE *' argument for this option")
00186 _CURL_WARNING(_curl_easy_setopt_err_postfields,
00187 "curl_easy_setopt expects a 'void *' or 'char *' argument for this option")
00188 _CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
00189 "curl_easy_setopt expects a 'struct curl_httppost *' "
00190 "argument for this option")
00191 _CURL_WARNING(_curl_easy_setopt_err_curl_slist,
00192 "curl_easy_setopt expects a 'struct curl_slist *' argument for this option")
00193 _CURL_WARNING(_curl_easy_setopt_err_CURLSH,
00194 "curl_easy_setopt expects a CURLSH* argument for this option")
00195
00196 _CURL_WARNING(_curl_easy_getinfo_err_string,
00197 "curl_easy_getinfo expects a pointer to 'char *' for this info")
00198 _CURL_WARNING(_curl_easy_getinfo_err_long,
00199 "curl_easy_getinfo expects a pointer to long for this info")
00200 _CURL_WARNING(_curl_easy_getinfo_err_double,
00201 "curl_easy_getinfo expects a pointer to double for this info")
00202 _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
00203 "curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this info")
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214 #define _curl_is_long_option(option) \
00215 (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)
00216
00217 #define _curl_is_off_t_option(option) \
00218 ((option) > CURLOPTTYPE_OFF_T)
00219
00220
00221 #define _curl_is_string_option(option) \
00222 ((option) == CURLOPT_ACCEPT_ENCODING || \
00223 (option) == CURLOPT_CAINFO || \
00224 (option) == CURLOPT_CAPATH || \
00225 (option) == CURLOPT_COOKIE || \
00226 (option) == CURLOPT_COOKIEFILE || \
00227 (option) == CURLOPT_COOKIEJAR || \
00228 (option) == CURLOPT_COOKIELIST || \
00229 (option) == CURLOPT_CRLFILE || \
00230 (option) == CURLOPT_CUSTOMREQUEST || \
00231 (option) == CURLOPT_DEFAULT_PROTOCOL || \
00232 (option) == CURLOPT_DNS_INTERFACE || \
00233 (option) == CURLOPT_DNS_LOCAL_IP4 || \
00234 (option) == CURLOPT_DNS_LOCAL_IP6 || \
00235 (option) == CURLOPT_DNS_SERVERS || \
00236 (option) == CURLOPT_EGDSOCKET || \
00237 (option) == CURLOPT_FTPPORT || \
00238 (option) == CURLOPT_FTP_ACCOUNT || \
00239 (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
00240 (option) == CURLOPT_INTERFACE || \
00241 (option) == CURLOPT_ISSUERCERT || \
00242 (option) == CURLOPT_KEYPASSWD || \
00243 (option) == CURLOPT_KRBLEVEL || \
00244 (option) == CURLOPT_LOGIN_OPTIONS || \
00245 (option) == CURLOPT_MAIL_AUTH || \
00246 (option) == CURLOPT_MAIL_FROM || \
00247 (option) == CURLOPT_NETRC_FILE || \
00248 (option) == CURLOPT_NOPROXY || \
00249 (option) == CURLOPT_PASSWORD || \
00250 (option) == CURLOPT_PINNEDPUBLICKEY || \
00251 (option) == CURLOPT_PROXY || \
00252 (option) == CURLOPT_PROXYPASSWORD || \
00253 (option) == CURLOPT_PROXYUSERNAME || \
00254 (option) == CURLOPT_PROXYUSERPWD || \
00255 (option) == CURLOPT_PROXY_SERVICE_NAME || \
00256 (option) == CURLOPT_RANDOM_FILE || \
00257 (option) == CURLOPT_RANGE || \
00258 (option) == CURLOPT_REFERER || \
00259 (option) == CURLOPT_RTSP_SESSION_ID || \
00260 (option) == CURLOPT_RTSP_STREAM_URI || \
00261 (option) == CURLOPT_RTSP_TRANSPORT || \
00262 (option) == CURLOPT_SERVICE_NAME || \
00263 (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \
00264 (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
00265 (option) == CURLOPT_SSH_KNOWNHOSTS || \
00266 (option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
00267 (option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
00268 (option) == CURLOPT_SSLCERT || \
00269 (option) == CURLOPT_SSLCERTTYPE || \
00270 (option) == CURLOPT_SSLENGINE || \
00271 (option) == CURLOPT_SSLKEY || \
00272 (option) == CURLOPT_SSLKEYTYPE || \
00273 (option) == CURLOPT_SSL_CIPHER_LIST || \
00274 (option) == CURLOPT_TLSAUTH_PASSWORD || \
00275 (option) == CURLOPT_TLSAUTH_TYPE || \
00276 (option) == CURLOPT_TLSAUTH_USERNAME || \
00277 (option) == CURLOPT_UNIX_SOCKET_PATH || \
00278 (option) == CURLOPT_URL || \
00279 (option) == CURLOPT_USERAGENT || \
00280 (option) == CURLOPT_USERNAME || \
00281 (option) == CURLOPT_USERPWD || \
00282 (option) == CURLOPT_XOAUTH2_BEARER || \
00283 0)
00284
00285
00286 #define _curl_is_write_cb_option(option) \
00287 ((option) == CURLOPT_HEADERFUNCTION || \
00288 (option) == CURLOPT_WRITEFUNCTION)
00289
00290
00291 #define _curl_is_conv_cb_option(option) \
00292 ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
00293 (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
00294 (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)
00295
00296
00297 #define _curl_is_cb_data_option(option) \
00298 ((option) == CURLOPT_CHUNK_DATA || \
00299 (option) == CURLOPT_CLOSESOCKETDATA || \
00300 (option) == CURLOPT_DEBUGDATA || \
00301 (option) == CURLOPT_FNMATCH_DATA || \
00302 (option) == CURLOPT_HEADERDATA || \
00303 (option) == CURLOPT_INTERLEAVEDATA || \
00304 (option) == CURLOPT_IOCTLDATA || \
00305 (option) == CURLOPT_OPENSOCKETDATA || \
00306 (option) == CURLOPT_PRIVATE || \
00307 (option) == CURLOPT_PROGRESSDATA || \
00308 (option) == CURLOPT_READDATA || \
00309 (option) == CURLOPT_SEEKDATA || \
00310 (option) == CURLOPT_SOCKOPTDATA || \
00311 (option) == CURLOPT_SSH_KEYDATA || \
00312 (option) == CURLOPT_SSL_CTX_DATA || \
00313 (option) == CURLOPT_WRITEDATA || \
00314 0)
00315
00316
00317 #define _curl_is_postfields_option(option) \
00318 ((option) == CURLOPT_POSTFIELDS || \
00319 (option) == CURLOPT_COPYPOSTFIELDS || \
00320 0)
00321
00322
00323 #define _curl_is_slist_option(option) \
00324 ((option) == CURLOPT_HTTP200ALIASES || \
00325 (option) == CURLOPT_HTTPHEADER || \
00326 (option) == CURLOPT_MAIL_RCPT || \
00327 (option) == CURLOPT_POSTQUOTE || \
00328 (option) == CURLOPT_PREQUOTE || \
00329 (option) == CURLOPT_PROXYHEADER || \
00330 (option) == CURLOPT_QUOTE || \
00331 (option) == CURLOPT_RESOLVE || \
00332 (option) == CURLOPT_TELNETOPTIONS || \
00333 0)
00334
00335
00336
00337
00338 #define _curl_is_string_info(info) \
00339 (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG)
00340
00341
00342 #define _curl_is_long_info(info) \
00343 (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)
00344
00345
00346 #define _curl_is_double_info(info) \
00347 (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
00348
00349
00350 #define _curl_is_slist_info(info) \
00351 (CURLINFO_SLIST < (info))
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366 #define _curl_is_any_ptr(expr) \
00367 (sizeof(expr) == sizeof(void *))
00368
00369
00370
00371 #define _curl_is_NULL(expr) \
00372 (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))
00373
00374
00375 #define _curl_is_ptr(expr, type) \
00376 (_curl_is_NULL(expr) || \
00377 __builtin_types_compatible_p(__typeof__(expr), type *) || \
00378 __builtin_types_compatible_p(__typeof__(expr), const type *))
00379
00380
00381 #define _curl_is_arr(expr, type) \
00382 (_curl_is_ptr((expr), type) || \
00383 __builtin_types_compatible_p(__typeof__(expr), type []))
00384
00385
00386 #define _curl_is_string(expr) \
00387 (_curl_is_arr((expr), char) || \
00388 _curl_is_arr((expr), signed char) || \
00389 _curl_is_arr((expr), unsigned char))
00390
00391
00392
00393
00394 #define _curl_is_long(expr) \
00395 (__builtin_types_compatible_p(__typeof__(expr), long) || \
00396 __builtin_types_compatible_p(__typeof__(expr), signed long) || \
00397 __builtin_types_compatible_p(__typeof__(expr), unsigned long) || \
00398 __builtin_types_compatible_p(__typeof__(expr), int) || \
00399 __builtin_types_compatible_p(__typeof__(expr), signed int) || \
00400 __builtin_types_compatible_p(__typeof__(expr), unsigned int) || \
00401 __builtin_types_compatible_p(__typeof__(expr), short) || \
00402 __builtin_types_compatible_p(__typeof__(expr), signed short) || \
00403 __builtin_types_compatible_p(__typeof__(expr), unsigned short) || \
00404 __builtin_types_compatible_p(__typeof__(expr), char) || \
00405 __builtin_types_compatible_p(__typeof__(expr), signed char) || \
00406 __builtin_types_compatible_p(__typeof__(expr), unsigned char))
00407
00408
00409 #define _curl_is_off_t(expr) \
00410 (__builtin_types_compatible_p(__typeof__(expr), curl_off_t))
00411
00412
00413
00414 #define _curl_is_error_buffer(expr) \
00415 (_curl_is_NULL(expr) || \
00416 __builtin_types_compatible_p(__typeof__(expr), char *) || \
00417 __builtin_types_compatible_p(__typeof__(expr), char[]))
00418
00419
00420 #if 0
00421 #define _curl_is_cb_data(expr) \
00422 (_curl_is_ptr((expr), void) || \
00423 _curl_is_ptr((expr), FILE))
00424 #else
00425 #define _curl_is_cb_data(expr) \
00426 _curl_is_any_ptr(expr)
00427 #endif
00428
00429
00430 #define _curl_is_FILE(expr) \
00431 (__builtin_types_compatible_p(__typeof__(expr), FILE *))
00432
00433
00434 #define _curl_is_postfields(expr) \
00435 (_curl_is_ptr((expr), void) || \
00436 _curl_is_arr((expr), char))
00437
00438
00439
00440
00441
00442
00443
00444 #define _curl_callback_compatible(func, type) \
00445 (__builtin_types_compatible_p(__typeof__(func), type) || \
00446 __builtin_types_compatible_p(__typeof__(func), type*))
00447
00448
00449 #define _curl_is_read_cb(expr) \
00450 (_curl_is_NULL(expr) || \
00451 __builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) || \
00452 __builtin_types_compatible_p(__typeof__(expr), curl_read_callback) || \
00453 _curl_callback_compatible((expr), _curl_read_callback1) || \
00454 _curl_callback_compatible((expr), _curl_read_callback2) || \
00455 _curl_callback_compatible((expr), _curl_read_callback3) || \
00456 _curl_callback_compatible((expr), _curl_read_callback4) || \
00457 _curl_callback_compatible((expr), _curl_read_callback5) || \
00458 _curl_callback_compatible((expr), _curl_read_callback6))
00459 typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void *);
00460 typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void *);
00461 typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE *);
00462 typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void *);
00463 typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void *);
00464 typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE *);
00465
00466
00467 #define _curl_is_write_cb(expr) \
00468 (_curl_is_read_cb(expr) || \
00469 __builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) || \
00470 __builtin_types_compatible_p(__typeof__(expr), curl_write_callback) || \
00471 _curl_callback_compatible((expr), _curl_write_callback1) || \
00472 _curl_callback_compatible((expr), _curl_write_callback2) || \
00473 _curl_callback_compatible((expr), _curl_write_callback3) || \
00474 _curl_callback_compatible((expr), _curl_write_callback4) || \
00475 _curl_callback_compatible((expr), _curl_write_callback5) || \
00476 _curl_callback_compatible((expr), _curl_write_callback6))
00477 typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void *);
00478 typedef size_t (_curl_write_callback2)(const char *, size_t, size_t,
00479 const void *);
00480 typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE *);
00481 typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void *);
00482 typedef size_t (_curl_write_callback5)(const void *, size_t, size_t,
00483 const void *);
00484 typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE *);
00485
00486
00487 #define _curl_is_ioctl_cb(expr) \
00488 (_curl_is_NULL(expr) || \
00489 __builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) || \
00490 _curl_callback_compatible((expr), _curl_ioctl_callback1) || \
00491 _curl_callback_compatible((expr), _curl_ioctl_callback2) || \
00492 _curl_callback_compatible((expr), _curl_ioctl_callback3) || \
00493 _curl_callback_compatible((expr), _curl_ioctl_callback4))
00494 typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void *);
00495 typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void *);
00496 typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void *);
00497 typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void *);
00498
00499
00500 #define _curl_is_sockopt_cb(expr) \
00501 (_curl_is_NULL(expr) || \
00502 __builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) || \
00503 _curl_callback_compatible((expr), _curl_sockopt_callback1) || \
00504 _curl_callback_compatible((expr), _curl_sockopt_callback2))
00505 typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
00506 typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
00507 curlsocktype);
00508
00509
00510
00511 #define _curl_is_opensocket_cb(expr) \
00512 (_curl_is_NULL(expr) || \
00513 __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\
00514 _curl_callback_compatible((expr), _curl_opensocket_callback1) || \
00515 _curl_callback_compatible((expr), _curl_opensocket_callback2) || \
00516 _curl_callback_compatible((expr), _curl_opensocket_callback3) || \
00517 _curl_callback_compatible((expr), _curl_opensocket_callback4))
00518 typedef curl_socket_t (_curl_opensocket_callback1)
00519 (void *, curlsocktype, struct curl_sockaddr *);
00520 typedef curl_socket_t (_curl_opensocket_callback2)
00521 (void *, curlsocktype, const struct curl_sockaddr *);
00522 typedef curl_socket_t (_curl_opensocket_callback3)
00523 (const void *, curlsocktype, struct curl_sockaddr *);
00524 typedef curl_socket_t (_curl_opensocket_callback4)
00525 (const void *, curlsocktype, const struct curl_sockaddr *);
00526
00527
00528 #define _curl_is_progress_cb(expr) \
00529 (_curl_is_NULL(expr) || \
00530 __builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) || \
00531 _curl_callback_compatible((expr), _curl_progress_callback1) || \
00532 _curl_callback_compatible((expr), _curl_progress_callback2))
00533 typedef int (_curl_progress_callback1)(void *,
00534 double, double, double, double);
00535 typedef int (_curl_progress_callback2)(const void *,
00536 double, double, double, double);
00537
00538
00539 #define _curl_is_debug_cb(expr) \
00540 (_curl_is_NULL(expr) || \
00541 __builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) || \
00542 _curl_callback_compatible((expr), _curl_debug_callback1) || \
00543 _curl_callback_compatible((expr), _curl_debug_callback2) || \
00544 _curl_callback_compatible((expr), _curl_debug_callback3) || \
00545 _curl_callback_compatible((expr), _curl_debug_callback4) || \
00546 _curl_callback_compatible((expr), _curl_debug_callback5) || \
00547 _curl_callback_compatible((expr), _curl_debug_callback6) || \
00548 _curl_callback_compatible((expr), _curl_debug_callback7) || \
00549 _curl_callback_compatible((expr), _curl_debug_callback8))
00550 typedef int (_curl_debug_callback1) (CURL *,
00551 curl_infotype, char *, size_t, void *);
00552 typedef int (_curl_debug_callback2) (CURL *,
00553 curl_infotype, char *, size_t, const void *);
00554 typedef int (_curl_debug_callback3) (CURL *,
00555 curl_infotype, const char *, size_t, void *);
00556 typedef int (_curl_debug_callback4) (CURL *,
00557 curl_infotype, const char *, size_t, const void *);
00558 typedef int (_curl_debug_callback5) (CURL *,
00559 curl_infotype, unsigned char *, size_t, void *);
00560 typedef int (_curl_debug_callback6) (CURL *,
00561 curl_infotype, unsigned char *, size_t, const void *);
00562 typedef int (_curl_debug_callback7) (CURL *,
00563 curl_infotype, const unsigned char *, size_t, void *);
00564 typedef int (_curl_debug_callback8) (CURL *,
00565 curl_infotype, const unsigned char *, size_t, const void *);
00566
00567
00568
00569 #define _curl_is_ssl_ctx_cb(expr) \
00570 (_curl_is_NULL(expr) || \
00571 __builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) || \
00572 _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \
00573 _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \
00574 _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \
00575 _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \
00576 _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \
00577 _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \
00578 _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \
00579 _curl_callback_compatible((expr), _curl_ssl_ctx_callback8))
00580 typedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *);
00581 typedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
00582 typedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
00583 typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);
00584 #ifdef HEADER_SSL_H
00585
00586
00587
00588 typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
00589 typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
00590 typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
00591 typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,
00592 const void *);
00593 #else
00594 typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
00595 typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;
00596 typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;
00597 typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;
00598 #endif
00599
00600
00601 #define _curl_is_conv_cb(expr) \
00602 (_curl_is_NULL(expr) || \
00603 __builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) || \
00604 _curl_callback_compatible((expr), _curl_conv_callback1) || \
00605 _curl_callback_compatible((expr), _curl_conv_callback2) || \
00606 _curl_callback_compatible((expr), _curl_conv_callback3) || \
00607 _curl_callback_compatible((expr), _curl_conv_callback4))
00608 typedef CURLcode (*_curl_conv_callback1)(char *, size_t length);
00609 typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);
00610 typedef CURLcode (*_curl_conv_callback3)(void *, size_t length);
00611 typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);
00612
00613
00614 #define _curl_is_seek_cb(expr) \
00615 (_curl_is_NULL(expr) || \
00616 __builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) || \
00617 _curl_callback_compatible((expr), _curl_seek_callback1) || \
00618 _curl_callback_compatible((expr), _curl_seek_callback2))
00619 typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);
00620 typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);
00621
00622
00623 #endif