X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_api.h;h=21cceab18dea1c155aafb0bb40ecf68ab9389d92;hp=2bcd108bee089381e942216e7d19eec45a159b71;hb=d226b8581f49234f6769a123173b268aa9b2bb60;hpb=a268ede6ed45dc674906efd6fc8710012841e75e diff --git a/php_http_api.h b/php_http_api.h index 2bcd108..21cceab 100644 --- a/php_http_api.h +++ b/php_http_api.h @@ -100,8 +100,9 @@ PHP_HTTP_API STATUS _http_cache_last_modified(const time_t last_modified, const #define http_cache_etag(e, el, cc, ccl) _http_cache_etag((e), (el), (cc), (ccl) TSRMLS_CC) PHP_HTTP_API STATUS _http_cache_etag(const char *etag, const size_t etag_len, const char *cache_control, const size_t cc_len TSRMLS_DC); -#define http_absolute_uri(url, proto) _http_absolute_uri((url), (proto) TSRMLS_CC) -PHP_HTTP_API char *_http_absolute_uri(const char *url, const char *proto TSRMLS_DC); +#define http_absolute_uri(url) http_absolute_uri_ex((url), strlen(url), NULL, 0, NULL, 0, 0) +#define http_absolute_uri_ex(url, url_len, proto, proto_len, host, host_len, port) _http_absolute_uri_ex((url), (url_len), (proto), (proto_len), (host), (host_len), (port) TSRMLS_CC) +PHP_HTTP_API char *_http_absolute_uri_ex(const char *url, size_t url_len, const char *proto, size_t proto_len, const char *host, size_t host_len, unsigned port TSRMLS_DC); #define http_negotiate_language(supported, def) _http_negotiate_q("HTTP_ACCEPT_LANGUAGE", (supported), (def) TSRMLS_CC) #define http_negotiate_charset(supported, def) _http_negotiate_q("HTTP_ACCEPT_CHARSET", (supported), (def) TSRMLS_CC) @@ -130,15 +131,18 @@ PHP_HTTP_API STATUS _http_chunked_decode(const char *encoded, const size_t encod #define http_urlencode_hash_ex(h, o, p, pl, q, ql) _http_urlencode_hash_ex((h), (o), (p), (pl), (q), (ql) TSRMLS_CC) PHP_HTTP_API STATUS _http_urlencode_hash_ex(HashTable *hash, int override_argsep, char *pre_encoded_data, size_t pre_encoded_len, char **encoded_data, size_t *encoded_len TSRMLS_DC); -#define http_split_response(r, h, b) _http_split_response_ex(Z_STRVAL_P(r), Z_STRLEN_P(r), Z_ARRVAL_P(h), &Z_STRVAL_P(b), &Z_STRLEN_P(b) TSRMLS_CC) +#define http_split_response(r, h, b) _http_split_response((r), (h), (b) TSRMLS_CC) +PHP_HTTP_API STATUS _http_split_response(zval *response, zval *headers, zval *body TSRMLS_DC); #define http_split_response_ex(r, rl, h, b, bl) _http_split_response_ex((r), (rl), (h), (b), (bl) TSRMLS_CC) PHP_HTTP_API STATUS _http_split_response_ex(char *response, size_t repsonse_len, HashTable *headers, char **body, size_t *body_len TSRMLS_DC); -#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, HashTable *headers TSRMLS_DC); +#define http_parse_headers(h, l, a) _http_parse_headers_ex((h), (l), Z_ARRVAL_P(a), 1 TSRMLS_CC) +#define http_parse_headers_ex(h, l, ht, p) _http_parse_headers_ex((h), (l), (ht), (p) TSRMLS_CC) +PHP_HTTP_API STATUS _http_parse_headers_ex(char *header, int header_len, HashTable *headers, zend_bool prettify 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); +#define http_get_request_headers(h) _http_get_request_headers_ex(Z_ARRVAL_P(h), 1 TSRMLS_CC) +#define http_get_request_headers_ex(h, p) _http_get_request_headers_ex((h), (s) TSRMLS_CC) +PHP_HTTP_API void _http_get_request_headers_ex(HashTable *headers, zend_bool prettify TSRMLS_DC); #define http_auth_credentials(u, p) _http_auth_credentials((u), (p) TSRMLS_CC) PHP_HTTP_API STATUS _http_auth_credentials(char **user, char **pass TSRMLS_DC);