X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_api.h;h=56cf5416a0ac9c80a208e6d2f7096439d4c8066b;hp=d3ef217c8007edd82b37d862639a5ddb5c3acab1;hb=b587077029cfd30b2daf4f4d519f69c37fae1841;hpb=9949be4659856993b6f3668c87cdcf158f6c2ddf diff --git a/php_http_api.h b/php_http_api.h index d3ef217..56cf541 100644 --- a/php_http_api.h +++ b/php_http_api.h @@ -48,8 +48,11 @@ typedef enum { /* buffer size */ #define HTTP_BUF_SIZE 2097152 +/* server vars shorthand */ +#define HTTP_SERVER_VARS Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]) + /* {{{ HAVE_CURL */ -#if defined(HAVE_CURL) && HAVE_CURL +#ifdef HTTP_HAVE_CURL /* CURL buffer size */ #define HTTP_CURLBUF_BODYSIZE 16384 @@ -83,7 +86,8 @@ typedef enum { #define http_date(t) _http_date((t) TSRMLS_CC) PHP_HTTP_API char *_http_date(time_t t TSRMLS_DC); -PHP_HTTP_API time_t http_parse_date(const char *date); +#define http_parse_date(d) _http_parse_date((d)) +PHP_HTTP_API time_t _http_parse_date(const char *date); #define http_send_status(s) _http_send_status((s) TSRMLS_CC) PHP_HTTP_API inline STATUS _http_send_status(const int status TSRMLS_DC); @@ -107,7 +111,7 @@ PHP_HTTP_API int _http_modified_match(const char *entry, const time_t t TSRMLS_D PHP_HTTP_API int _http_etag_match(const char *entry, const char *etag TSRMLS_DC); #define http_send_last_modified(t) _http_send_last_modified((t) TSRMLS_CC) -PHP_HTTP_API STATUS _http_send_last_modified(const int t TSRMLS_DC); +PHP_HTTP_API STATUS _http_send_last_modified(const time_t t TSRMLS_DC); #define http_send_etag(e, l) _http_send_etag((e), (l) TSRMLS_CC) PHP_HTTP_API STATUS _http_send_etag(const char *etag, const int etag_len TSRMLS_DC); @@ -145,19 +149,19 @@ PHP_HTTP_API STATUS _http_chunked_decode(const char *encoded, const size_t encod PHP_HTTP_API void _http_split_response(const zval *zresponse, zval *zheaders, zval *zbody TSRMLS_DC); /* {{{ HAVE_CURL */ -#if defined(HAVE_CURL) && HAVE_CURL +#ifdef HTTP_HAVE_CURL -#define http_get(u, o, d, l) _http_get((u), (o), (d), (l) TSRMLS_CC) -PHP_HTTP_API STATUS _http_get(const char *URL, HashTable *options, char **data, size_t *data_len TSRMLS_DC); +#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_head(u, o, d, l) _http_head((u), (o), (d), (l) TSRMLS_CC) -PHP_HTTP_API STATUS _http_head(const char *URL, HashTable *options, 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_post_data(u, pd, pl, o, d, l) _http_post_data((u), (pd), (pl), (o), (d), (l) TSRMLS_CC) -PHP_HTTP_API STATUS _http_post_data(const char *URL, char *postdata, size_t postdata_len, HashTable *options, 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_array(u, p, o, d, l) _http_post_array((u), (p), (o), (d), (l) TSRMLS_CC) -PHP_HTTP_API STATUS _http_post_array(const char *URL, HashTable *postarray, HashTable *options, 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); #endif /* }}} HAVE_CURL */ @@ -180,3 +184,4 @@ PHP_HTTP_API void _http_auth_header(const char *type, const char *realm TSRMLS_D * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ +