* rename http_parse_header to http_parse_headers
[m6w6/ext-http] / php_http_api.h
index 34a01597587f25aad7ec29de69c2de536ce28833..101857e004b5ab5b2e409780508c7032aba85b71 100644 (file)
 #define PHP_HTTP_API
 #endif
 
+#ifndef ZEND_ENGINE_2
+#include "php_http_build_query.h"
+#endif
+
 /* make functions that return SUCCESS|FAILURE more obvious */
 typedef int STATUS;
 
@@ -42,6 +46,9 @@ typedef enum {
 } http_send_mode;
 /* }}} */
 
+/* CR LF */
+#define HTTP_CRLF "\r\n"
+
 /* max URI length */
 #define HTTP_URI_MAXLEN 2048
 
@@ -52,7 +59,7 @@ typedef enum {
 #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
@@ -146,10 +153,13 @@ PHP_HTTP_API STATUS _http_send_file(const zval *zfile TSRMLS_DC);
 PHP_HTTP_API STATUS _http_chunked_decode(const char *encoded, const size_t encoded_len, char **decoded, size_t *decoded_len TSRMLS_DC);
 
 #define http_split_response(r, h, b) _http_split_response((r), (h), (b) TSRMLS_CC)
-PHP_HTTP_API void _http_split_response(const zval *zresponse, zval *zheaders, zval *zbody TSRMLS_DC);
+PHP_HTTP_API STATUS _http_split_response(const zval *zresponse, zval *zheaders, zval *zbody 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);
 
 /* {{{ HAVE_CURL */
-#if defined(HAVE_CURL) && 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);