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 +----------------------------------------------------------------------+
23 ->__toString(); ->__sleep(); ->serialize();
24 ->fromString(); __wakeup($message); ->unserialize();
26 ->setHeader(); ->addHeader()...
29 #include "phpstr/phpstr.h"
37 typedef struct _http_message http_message
;
39 struct _http_message
{
42 http_message_type type
;
69 /* required minimum length of an HTTP message "HTTP/1.1 200\r\n" */
70 #define HTTP_MSG_MIN_SIZE 15
72 #define HTTP_MSG_RAW(msg) ( (msg)->dup ? msg->raw.dup : msg->raw.ptr )
74 #define http_message_init() _http_message_init_ex(NULL, 0)
75 #define http_message_init_ex(m, t) _http_message_init_ex((m), (t))
76 #define http_message_free(m) _http_message_free((m))
77 #define http_message_dtor(m) _http_message_dtor((m))
79 PHP_HTTP_API
void _http_message_dtor(http_message
*message
);
80 PHP_HTTP_API
void _http_message_free(http_message
*message
);
82 #define http_message_parse(m, l) http_message_parse_ex((m), (l), 1)
83 #define http_message_parse_ex(m, l, d) _http_message_parse_ex((m), (l), (d) TSRMLS_CC)
84 PHP_HTTP_API http_message
*_http_message_parse_ex(const char *message
, size_t length
, zend_bool duplicate TSRMLS_DC
);
86 #define http_message_tostring(m, s, l) _http_message_tostring((m), (s), (l))
87 PHP_HTTP_API
void _http_message_tostring(http_message
*msg
, char **string
, size_t *length
);