X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_curl_api.h;h=df6f2672a42a6538728579dd8a4c9114c4d23874;hp=3b55c28f6de7d4619007641dca109eac99a97a61;hb=cf9967800843ea01e77b374b4d78fad4bc18a3f6;hpb=2811a2111f519ee55e05c4084903a34dc0c3b818 diff --git a/php_http_curl_api.h b/php_http_curl_api.h index 3b55c28..df6f267 100644 --- a/php_http_curl_api.h +++ b/php_http_curl_api.h @@ -18,27 +18,34 @@ #ifndef PHP_HTTP_CURL_API_H #define PHP_HTTP_CURL_API_H +#include "php_http_std_defs.h" +#include "phpstr/phpstr.h" + +#ifdef PHP_WIN32 +# include +#endif + #include -#define http_get(u, o, i, d, l) _http_get_ex(NULL, (u), (o), (i), (d), (l) TSRMLS_CC) -#define http_get_ex(c, u, o, i, d, l) _http_get_ex((c), (u), (o), (i), (d), (l) TSRMLS_CC) -PHP_HTTP_API STATUS _http_get_ex(CURL *ch, const char *URL, HashTable *options, HashTable *info, char **data, size_t *data_len TSRMLS_DC); +#define http_get(u, o, i, r) _http_get_ex(NULL, (u), (o), (i), (r) TSRMLS_CC) +#define http_get_ex(c, u, o, i, r) _http_get_ex((c), (u), (o), (i), (r) TSRMLS_CC) +PHP_HTTP_API STATUS _http_get_ex(CURL *ch, const char *URL, HashTable *options, HashTable *info, phpstr *response TSRMLS_DC); -#define http_head(u, o, i, d, l) _http_head_ex(NULL, (u), (o), (i), (d), (l) TSRMLS_CC) -#define http_head_ex(c, u, o, i, d, l) _http_head_ex((c), (u), (o), (i), (d), (l) TSRMLS_CC) -PHP_HTTP_API STATUS _http_head_ex(CURL *ch, const char *URL, HashTable *options, HashTable *info, char **data, size_t *data_len TSRMLS_DC); +#define http_head(u, o, i, r) _http_head_ex(NULL, (u), (o), (i), (r) TSRMLS_CC) +#define http_head_ex(c, u, o, i, r) _http_head_ex((c), (u), (o), (i), (r) TSRMLS_CC) +PHP_HTTP_API STATUS _http_head_ex(CURL *ch, const char *URL, HashTable *options, HashTable *info, phpstr *response TSRMLS_DC); -#define http_post_data(u, pd, pl, o, i, d, l) _http_post_data_ex(NULL, (u), (pd), (pl), (o), (i), (d), (l) TSRMLS_CC) -#define http_post_data_ex(c, u, pd, pl, o, i, d, l) _http_post_data_ex((c), (u), (pd), (pl), (o), (i), (d), (l) TSRMLS_CC) -PHP_HTTP_API STATUS _http_post_data_ex(CURL *ch, const char *URL, char *postdata, size_t postdata_len, HashTable *options, HashTable *info, char **data, size_t *data_len TSRMLS_DC); +#define http_post_data(u, pd, pl, o, i, r) _http_post_data_ex(NULL, (u), (pd), (pl), (o), (i), (r) TSRMLS_CC) +#define http_post_data_ex(c, u, pd, pl, o, i, r) _http_post_data_ex((c), (u), (pd), (pl), (o), (i), (r) TSRMLS_CC) +PHP_HTTP_API STATUS _http_post_data_ex(CURL *ch, const char *URL, char *postdata, size_t postdata_len, HashTable *options, HashTable *info, phpstr *response TSRMLS_DC); -#define http_post_array(u, p, o, i, d, l) _http_post_array_ex(NULL, (u), (p), (o), (i), (d), (l) TSRMLS_CC) -#define http_post_array_ex(c, u, p, o, i, d, l) _http_post_array_ex((c), (u), (p), (o), (i), (d), (l) TSRMLS_CC) -PHP_HTTP_API STATUS _http_post_array_ex(CURL *ch, const char *URL, HashTable *postarray, HashTable *options, HashTable *info, char **data, size_t *data_len TSRMLS_DC); +#define http_post_array(u, p, o, i, r) _http_post_array_ex(NULL, (u), (p), (o), (i), (r) TSRMLS_CC) +#define http_post_array_ex(c, u, p, o, i, r) _http_post_array_ex((c), (u), (p), (o), (i), (r) TSRMLS_CC) +PHP_HTTP_API STATUS _http_post_array_ex(CURL *ch, const char *URL, HashTable *postarray, HashTable *options, HashTable *info, phpstr *response TSRMLS_DC); -#define http_post_curldata(u, h, o, i, d, l) _http_post_curldata_ex(NULL, (u), (h), (o), (i), (d), (l) TSRMLS_CC) -#define http_post_curldata_ex(c, u, h, o, i, d, l) _http_post_curldata_ex((c), (u), (h), (o), (i), (d), (l) TSRMLS_CC) -PHP_HTTP_API STATUS _http_post_curldata_ex(CURL *ch, const char *URL, struct curl_httppost *curldata, HashTable *options, HashTable *info, char **data, size_t *data_len TSRMLS_DC); +#define http_post_curldata(u, h, o, i, r) _http_post_curldata_ex(NULL, (u), (h), (o), (i), (r) TSRMLS_CC) +#define http_post_curldata_ex(c, u, h, o, i, r) _http_post_curldata_ex((c), (u), (h), (o), (i), (r) TSRMLS_CC) +PHP_HTTP_API STATUS _http_post_curldata_ex(CURL *ch, const char *URL, struct curl_httppost *curldata, HashTable *options, HashTable *info, phpstr *response TSRMLS_DC); #endif @@ -49,4 +56,5 @@ PHP_HTTP_API STATUS _http_post_curldata_ex(CURL *ch, const char *URL, struct cur * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 - */ \ No newline at end of file + */ +