X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_request_api.h;h=16523f6f0c369d07eac5a377d23ef250a919abe1;hb=51c3a4d29b5b0ada721d8f0c9aa55581079bdf91;hp=d2172c5a8277fd170719f8d9abe8f505d941155c;hpb=649aada485583ccac67928e0700cb5f1b963f4e8;p=m6w6%2Fext-http diff --git a/php_http_request_api.h b/php_http_request_api.h index d2172c5..16523f6 100644 --- a/php_http_request_api.h +++ b/php_http_request_api.h @@ -6,7 +6,7 @@ | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ - | Copyright (c) 2004-2005, Michael Wallner | + | Copyright (c) 2004-2006, Michael Wallner | +--------------------------------------------------------------------+ */ @@ -41,7 +41,7 @@ typedef struct { struct curl_slist *headers; } _cache; - char _error[CURL_ERROR_SIZE]; + char _error[CURL_ERROR_SIZE+1]; zval *_progress_callback; #ifdef ZTS @@ -50,6 +50,14 @@ 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) PHP_HTTP_API http_request *_http_request_init_ex(http_request *request, CURL *ch, http_request_method meth, const char *url ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC);