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_OBJECT_H
19 #define PHP_HTTP_MESSAGE_OBJECT_H
22 #include "php_http_message_api.h"
26 http_message
*message
;
27 zend_object_value parent
;
28 } http_message_object
;
30 extern zend_class_entry
*http_message_object_ce
;
31 extern zend_function_entry http_message_object_fe
[];
33 #define http_message_object_init() _http_message_object_init(INIT_FUNC_ARGS_PASSTHRU)
34 extern void _http_message_object_init(INIT_FUNC_ARGS
);
35 #define http_message_object_new _http_message_object_new
36 extern zend_object_value
_http_message_object_new(zend_class_entry
*ce TSRMLS_DC
);
37 #define http_message_object_new_ex(ce, msg) _http_message_object_new_ex(ce, msg TSRMLS_CC)
38 #define http_message_object_from_msg(msg) _http_message_object_new_ex(http_message_object_ce, msg TSRMLS_CC)
39 extern zend_object_value
_http_message_object_new_ex(zend_class_entry
*ce
, http_message
*msg TSRMLS_DC
);
40 #define http_message_object_clone(zobj) _http_message_object_clone(zobj TSRMLS_CC)
41 extern zend_object_value
_http_message_object_clone(zval
*object TSRMLS_DC
);
42 #define http_message_object_free _http_message_object_free
43 extern void _http_message_object_free(zend_object
*object TSRMLS_DC
);
45 #define HTTP_MSG_PROPHASH_TYPE 276192743LU
46 #define HTTP_MSG_PROPHASH_HTTP_VERSION 1138628683LU
47 #define HTTP_MSG_PROPHASH_BODY 254474387LU
48 #define HTTP_MSG_PROPHASH_HEADERS 3199929089LU
49 #define HTTP_MSG_PROPHASH_PARENT_MESSAGE 2105714836LU
50 #define HTTP_MSG_PROPHASH_REQUEST_METHOD 1669022159LU
51 #define HTTP_MSG_PROPHASH_REQUEST_URI 3208695486LU
52 #define HTTP_MSG_PROPHASH_RESPONSE_STATUS 3857097400LU
53 #define HTTP_MSG_PROPHASH_RESPONSE_CODE 1305615119LU
55 #define HTTP_MSG_CHECK_OBJ(obj, dofail) \
56 if (!(obj)->message) { \
57 http_error(E_WARNING, HTTP_E_MSG, "HttpMessage is empty"); \
60 #define HTTP_MSG_CHECK_STD() HTTP_MSG_CHECK_OBJ(obj, RETURN_FALSE)
62 #define HTTP_MSG_INIT_OBJ(obj) \
63 if (!(obj)->message) { \
64 (obj)->message = http_message_new(); \
66 #define HTTP_MSG_INIT_STD() HTTP_MSG_INIT_OBJ(obj)
68 PHP_METHOD(HttpMessage
, __construct
);
69 PHP_METHOD(HttpMessage
, getBody
);
70 PHP_METHOD(HttpMessage
, getHeaders
);
71 PHP_METHOD(HttpMessage
, setHeaders
);
72 PHP_METHOD(HttpMessage
, addHeaders
);
73 PHP_METHOD(HttpMessage
, getType
);
74 PHP_METHOD(HttpMessage
, setType
);
75 PHP_METHOD(HttpMessage
, getResponseCode
);
76 PHP_METHOD(HttpMessage
, setResponseCode
);
77 PHP_METHOD(HttpMessage
, getRequestMethod
);
78 PHP_METHOD(HttpMessage
, setRequestMethod
);
79 PHP_METHOD(HttpMessage
, getRequestUri
);
80 PHP_METHOD(HttpMessage
, setRequestUri
);
81 PHP_METHOD(HttpMessage
, getHttpVersion
);
82 PHP_METHOD(HttpMessage
, setHttpVersion
);
83 PHP_METHOD(HttpMessage
, getParentMessage
);
84 PHP_METHOD(HttpMessage
, send
);
85 PHP_METHOD(HttpMessage
, toString
);
87 PHP_METHOD(HttpMessage
, fromString
);
97 * vim600: noet sw=4 ts=4 fdm=marker
98 * vim<600: noet sw=4 ts=4