X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=php_http_api.h;h=c776ba82e5a904df3d9f696c2a44e258dbc16701;hb=318bb3459a12dc26362978413cde00cde6616d89;hp=101857e004b5ab5b2e409780508c7032aba85b71;hpb=96d32e2bd4a5d2b0741addf6f59b46d7d8749937;p=m6w6%2Fext-http diff --git a/php_http_api.h b/php_http_api.h index 101857e..c776ba8 100644 --- a/php_http_api.h +++ b/php_http_api.h @@ -19,13 +19,13 @@ #define PHP_HTTP_API_H #ifdef PHP_WIN32 -#define PHP_HTTP_API __declspec(dllexport) +# define PHP_HTTP_API __declspec(dllexport) #else -#define PHP_HTTP_API +# define PHP_HTTP_API #endif #ifndef ZEND_ENGINE_2 -#include "php_http_build_query.h" +# include "php_http_build_query.h" #endif /* make functions that return SUCCESS|FAILURE more obvious */ @@ -60,6 +60,7 @@ typedef enum { /* {{{ HAVE_CURL */ #ifdef HTTP_HAVE_CURL +#include /* CURL buffer size */ #define HTTP_CURLBUF_BODYSIZE 16384 @@ -111,6 +112,9 @@ PHP_HTTP_API inline zval *_http_get_server_var(const char *key TSRMLS_DC); #define http_ob_etaghandler(o, l, ho, hl, m) _http_ob_etaghandler((o), (l), (ho), (hl), (m) TSRMLS_CC) PHP_HTTP_API void _http_ob_etaghandler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC); +#define http_start_ob_handler(f, h, s, e) _http_start_ob_handler((f), (h), (s), (e) TSRMLS_CC) +PHP_HTTP_API STATUS _http_start_ob_handler(php_output_handler_func_t handler_func, char *handler_name, uint chunk_size, zend_bool erase TSRMLS_DC); + #define http_modified_match(entry, modified) _http_modified_match((entry), (modified) TSRMLS_CC) PHP_HTTP_API int _http_modified_match(const char *entry, const time_t t TSRMLS_DC); @@ -158,17 +162,26 @@ PHP_HTTP_API STATUS _http_split_response(const zval *zresponse, zval *zheaders, #define http_parse_headers(h, l, a) _http_parse_headers((h), (l), (a) TSRMLS_CC) PHP_HTTP_API STATUS _http_parse_headers(char *header, int header_len, zval *array TSRMLS_DC); +#define http_get_request_headers(h) _http_get_request_headers((h) TSRMLS_CC) +PHP_HTTP_API void _http_get_request_headers(zval *array TSRMLS_DC); + /* {{{ HAVE_CURL */ #ifdef HTTP_HAVE_CURL #define http_get(u, o, i, d, l) _http_get((u), (o), (i), (d), (l) TSRMLS_CC) PHP_HTTP_API STATUS _http_get(const char *URL, HashTable *options, HashTable *info, char **data, size_t *data_len TSRMLS_DC); +#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_head(u, o, i, d, l) _http_head((u), (o), (i), (d), (l) TSRMLS_CC) PHP_HTTP_API STATUS _http_head(const char *URL, HashTable *options, HashTable *info, char **data, size_t *data_len TSRMLS_DC); +#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_post_data(u, pd, pl, o, i, d, l) _http_post_data((u), (pd), (pl), (o), (i), (d), (l) TSRMLS_CC) PHP_HTTP_API STATUS _http_post_data(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_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_array(u, p, o, i, d, l) _http_post_array((u), (p), (o), (i), (d), (l) TSRMLS_CC) PHP_HTTP_API STATUS _http_post_array(const char *URL, HashTable *postarray, HashTable *options, HashTable *info, char **data, size_t *data_len TSRMLS_DC); @@ -180,7 +193,7 @@ PHP_HTTP_API STATUS _http_post_array(const char *URL, HashTable *postarray, Hash PHP_HTTP_API STATUS _http_auth_credentials(char **user, char **pass TSRMLS_DC); #define http_auth_header(t, r) _http_auth_header((t), (r) TSRMLS_CC) -PHP_HTTP_API void _http_auth_header(const char *type, const char *realm TSRMLS_DC); +PHP_HTTP_API STATUS _http_auth_header(const char *type, const char *realm TSRMLS_DC); /* }}} */