X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_request_int.h;h=e7449640f30efe3ea2eec981201b73b2fc2c0cf7;hb=fe0761a31f82ea9807f9dcdc4bce3e9de9c766b4;hp=5eecf9f3178fd8ffe52e04c030e5bf6c82a5a1db;hpb=9676c81efbb8f180fa189d71a7ecb50dde4f5646;p=m6w6%2Fext-http diff --git a/php_http_request_int.h b/php_http_request_int.h index 5eecf9f..e744964 100644 --- a/php_http_request_int.h +++ b/php_http_request_int.h @@ -50,67 +50,7 @@ # define curl_easy_strerror(dummy) "unknown error" #endif -#define HTTP_CURL_INFO(I) \ - { \ - char *N = #I; \ - HTTP_CURL_INFO_EX(I, N+lenof("CURLINFO_")); \ - } -#define HTTP_CURL_INFO_EX(I, X) \ - switch (I & ~CURLINFO_MASK) \ - { \ - case CURLINFO_STRING: \ - { \ - char *c; \ - if (CURLE_OK == curl_easy_getinfo(request->ch, I, &c)) { \ - char *key = estrndup(X, strlen(X)); \ - add_assoc_string(&array, pretty_key(key, strlen(X), 0, 0), c ? c : "", 1); \ - efree(key); \ - } \ - } \ - break; \ -\ - case CURLINFO_DOUBLE: \ - { \ - double d; \ - if (CURLE_OK == curl_easy_getinfo(request->ch, I, &d)) { \ - char *key = estrndup(X, strlen(X)); \ - add_assoc_double(&array, pretty_key(key, strlen(X), 0, 0), d); \ - efree(key); \ - } \ - } \ - break; \ -\ - case CURLINFO_LONG: \ - { \ - long l; \ - if (CURLE_OK == curl_easy_getinfo(request->ch, I, &l)) { \ - char *key = estrndup(X, strlen(X)); \ - add_assoc_long(&array, pretty_key(key, strlen(X), 0, 0), l); \ - efree(key); \ - } \ - } \ - break; \ -\ - case CURLINFO_SLIST: \ - { \ - struct curl_slist *l, *p; \ - if (CURLE_OK == curl_easy_getinfo(request->ch, I, &l)) { \ - zval *subarray; \ - char *key = estrndup(X, strlen(X)); \ - MAKE_STD_ZVAL(subarray); \ - array_init(subarray); \ - for (p = l; p; p = p->next) { \ - add_next_index_string(subarray, p->data, 1); \ - } \ - add_assoc_zval(&array, pretty_key(key, strlen(X), 0, 0), subarray); \ - curl_slist_free_all(l); \ - efree(key); \ - } \ - } \ - } - -#define HTTP_CURL_OPT(OPTION, p) HTTP_CURL_OPT_EX(request->ch, OPTION, (p)) -#define HTTP_CURL_OPT_EX(ch, OPTION, p) curl_easy_setopt((ch), OPTION, (p)) +#define HTTP_CURL_OPT(OPTION, p) curl_easy_setopt((request->ch), OPTION, (p)) #define HTTP_CURL_OPT_STRING(OPTION, ldiff, obdc) \ { \