2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.0 of the PHP license, that |
6 | is bundled with this package in the file LICENSE, and is available |
7 | through the world-wide-web at http://www.php.net/license/3_0.txt. |
8 | If you did not receive a copy of the PHP license and are unable to |
9 | obtain it through the world-wide-web, please send a note to |
10 | license@php.net so we can mail you a copy immediately. |
11 +----------------------------------------------------------------------+
12 | Copyright (c) 2004-2005 Michael Wallner <mike@php.net> |
13 +----------------------------------------------------------------------+
18 #ifndef PHP_HTTP_API_H
19 #define PHP_HTTP_API_H
21 #include "php_http_std_defs.h"
23 #define pretty_key(key, key_len, uctitle, xhyphen) _http_pretty_key(key, key_len, uctitle, xhyphen)
24 extern char *_http_pretty_key(char *key
, size_t key_len
, zend_bool uctitle
, zend_bool xhyphen
);
26 #define http_error(type, code, string) _http_error_ex(type, code, "%s", string)
27 #define http_error_ex _http_error_ex
28 extern void _http_error_ex(long type
, long code
, const char *format
, ...);
30 #define HTTP_GSC(var, name, ret) HTTP_GSP(var, name, return ret)
31 #define HTTP_GSP(var, name, ret) \
32 if (!(var = _http_get_server_var_ex(name, strlen(name)+1, 1 TSRMLS_CC))) { \
35 #define http_got_server_var(v) (NULL != _http_get_server_var_ex((v), sizeof(v), 1 TSRMLS_CC))
36 #define http_get_server_var(v) http_get_server_var_ex((v), sizeof(v))
37 #define http_get_server_var_ex(v, s) _http_get_server_var_ex((v), (s), 0 TSRMLS_CC)
38 PHP_HTTP_API zval
*_http_get_server_var_ex(const char *key
, size_t key_size
, zend_bool check TSRMLS_DC
);
40 #define http_ob_etaghandler(o, l, ho, hl, m) _http_ob_etaghandler((o), (l), (ho), (hl), (m) TSRMLS_CC)
41 PHP_HTTP_API
void _http_ob_etaghandler(char *output
, uint output_len
, char **handled_output
, uint
*handled_output_len
, int mode TSRMLS_DC
);
43 #define http_start_ob_handler(f, h, s, e) _http_start_ob_handler((f), (h), (s), (e) TSRMLS_CC)
44 PHP_HTTP_API STATUS
_http_start_ob_handler(php_output_handler_func_t handler_func
, char *handler_name
, uint chunk_size
, zend_bool erase TSRMLS_DC
);
46 #define http_chunked_decode(e, el, d, dl) _http_chunked_decode((e), (el), (d), (dl) TSRMLS_CC)
47 PHP_HTTP_API STATUS
_http_chunked_decode(const char *encoded
, size_t encoded_len
, char **decoded
, size_t *decoded_len TSRMLS_DC
);
49 #define http_split_response(r, h, b) _http_split_response((r), (h), (b) TSRMLS_CC)
50 PHP_HTTP_API STATUS
_http_split_response(zval
*response
, zval
*headers
, zval
*body TSRMLS_DC
);
51 #define http_split_response_ex(r, rl, h, b, bl) _http_split_response_ex((r), (rl), (h), (b), (bl) TSRMLS_CC)
52 PHP_HTTP_API STATUS
_http_split_response_ex(char *response
, size_t repsonse_len
, HashTable
*headers
, char **body
, size_t *body_len TSRMLS_DC
);
61 * vim600: noet sw=4 ts=4 fdm=marker
62 * vim<600: noet sw=4 ts=4