X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_request_api.h;h=5b4b752b311f9f2d6a1a7ba071b4b3f63b31f6ef;hp=731cbf0e7059841fa20ff288227325db6d3da4f4;hb=c7b95b4b19bbde93d3f142c5653ad5b68229cfcd;hpb=32e91737086db53bb1fd9ed9f79d693c43ec459f diff --git a/php_http_request_api.h b/php_http_request_api.h index 731cbf0..5b4b752 100644 --- a/php_http_request_api.h +++ b/php_http_request_api.h @@ -23,7 +23,7 @@ extern PHP_MINIT_FUNCTION(http_request); extern PHP_MSHUTDOWN_FUNCTION(http_request); -typedef struct { +typedef struct _http_request_t { CURL *ch; char *url; http_request_method meth; @@ -50,6 +50,13 @@ typedef struct { } http_request; +#define http_curl_init(r) http_curl_init_ex(NULL, (r)) +#define http_curl_init_ex(c, r) _http_curl_init_ex((c), (r)) +PHP_HTTP_API CURL *_http_curl_init_ex(CURL *ch, http_request *request); + +#define http_curl_free(c) _http_curl_free(c) +PHP_HTTP_API void _http_curl_free(CURL **ch); + #define http_request_new() _http_request_init_ex(NULL, NULL, 0, NULL ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) #define http_request_init(r) _http_request_init_ex((r), NULL, 0, NULL ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC) #define http_request_init_ex(r, c, m, u) _http_request_init_ex((r), (c), (m), (u) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC TSRMLS_CC)