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_MESSAGE_API_H
19 #define PHP_HTTP_MESSAGE_API_H
26 ->__toString(); ->__sleep(); ->serialize();
27 ->fromString(); __wakeup($message); ->unserialize();
29 ->setHeader(); ->addHeader()...
32 #include "phpstr/phpstr.h"
33 #include "php_http_headers_api.h"
41 typedef struct _http_message http_message
;
43 struct _http_message
{
46 http_message_type type
;
68 /* required minimum length of an HTTP message "HTTP/1.1 200\r\n" */
69 #define HTTP_MSG_MIN_SIZE 15
71 #define http_message_new() _http_message_init_ex(NULL, 0)
72 #define http_message_init(m) _http_message_init_ex((m), 0)
73 #define http_message_init_ex(m, t) _http_message_init_ex((m), (t))
74 PHP_HTTP_API http_message
*_http_message_init_ex(http_message
*m
, http_message_type t
);
76 #define http_message_parse(m, l) http_message_parse_ex(NULL, (m), (l), 1)
77 #define http_message_parse_ex(h, m, l, d) _http_message_parse_ex((h), (m), (l), (d) TSRMLS_CC)
78 PHP_HTTP_API http_message
*_http_message_parse_ex(http_message
*msg
, char *message
, size_t length
, zend_bool duplicate TSRMLS_DC
);
80 #define http_message_parse_headers_callback _http_message_parse_headers_callback
81 PHP_HTTP_API
void _http_message_parse_headers_callback(void *message
, char *http_line
, size_t line_length
, HashTable
**headers TSRMLS_DC
);
83 #define http_message_tostring(m, s, l) _http_message_tostring((m), (s), (l))
84 PHP_HTTP_API
void _http_message_tostring(http_message
*msg
, char **string
, size_t *length
);
85 #define http_message_dtor(m) _http_message_dtor((m))
86 PHP_HTTP_API
void _http_message_dtor(http_message
*message
);
88 #define http_message_free(m) _http_message_free((m))
89 PHP_HTTP_API
void _http_message_free(http_message
*message
);
98 * vim600: noet sw=4 ts=4 fdm=marker
99 * vim<600: noet sw=4 ts=4