* 0.6.1
[m6w6/ext-http] / php_http_api.h
index d7973ac8b7bb0d39b4f906a3c7cf72b3c6d3ccc3..21cceab18dea1c155aafb0bb40ecf68ab9389d92 100644 (file)
@@ -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), (h), (b) TSRMLS_CC)
-#define http_split_response_ex(r, l, h, b) _http_split_response_ex((r), (l), (h), (b) TSRMLS_CC)
-PHP_HTTP_API STATUS _http_split_response_ex(char *response, size_t repsonse_len, zval *zheaders, zval *zbody TSRMLS_DC);
+#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, zval *array 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);
@@ -166,4 +170,5 @@ PHP_HTTP_API STATUS php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
  * End:
  * vim600: noet sw=4 ts=4 fdm=marker
  * vim<600: noet sw=4 ts=4
- */
\ No newline at end of file
+ */
+