X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_api.h;h=8ca390d12a2d21ac668da5764b680138dae98a9e;hb=d9a5eb7f270247c44f4ff78c1f5d03d520e8fec0;hp=61ae827784c3101d1341983f7f093bf82b178773;hpb=f8f0fd4dc265150a309824448b08249151d2ec45;p=m6w6%2Fext-http diff --git a/php_http_api.h b/php_http_api.h index 61ae827..8ca390d 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 */ @@ -46,6 +46,9 @@ typedef enum { } http_send_mode; /* }}} */ +/* CR LF */ +#define HTTP_CRLF "\r\n" + /* max URI length */ #define HTTP_URI_MAXLEN 2048 @@ -150,7 +153,10 @@ 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 */ #ifdef HTTP_HAVE_CURL