- print doesn't like commas
[m6w6/ext-http] / php_http_request_object.h
1 /*
2 +----------------------------------------------------------------------+
3 | PECL :: http |
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 +----------------------------------------------------------------------+
14 */
15
16 /* $Id$ */
17
18 #ifndef PHP_HTTP_REQUEST_OBJECT_H
19 #define PHP_HTTP_REQUEST_OBJECT_H
20 #ifdef HTTP_HAVE_CURL
21 #ifdef ZEND_ENGINE_2
22
23 #ifdef PHP_WIN32
24 # include <winsock2.h>
25 #endif
26
27 #include <curl/curl.h>
28
29 #include "php_http_request_api.h"
30 #include "php_http_request_pool_api.h"
31 #include "phpstr/phpstr.h"
32
33 typedef struct {
34 zend_object zo;
35 CURL *ch;
36 http_request_pool *pool;
37 phpstr response;
38 phpstr request;
39 phpstr history;
40 } http_request_object;
41
42 extern zend_class_entry *http_request_object_ce;
43 extern zend_function_entry http_request_object_fe[];
44
45 #define http_request_object_init() _http_request_object_init(INIT_FUNC_ARGS_PASSTHRU)
46 extern void _http_request_object_init(INIT_FUNC_ARGS);
47 #define http_request_object_new _http_request_object_new
48 extern zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC);
49 #define http_request_object_free _http_request_object_free
50 extern void _http_request_object_free(zend_object *object TSRMLS_DC);
51
52 #define http_request_object_requesthandler(req, this, body) _http_request_object_requesthandler((req), (this), (body) TSRMLS_CC)
53 extern STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ptr, http_request_body *body TSRMLS_DC);
54 #define http_request_object_responsehandler(req, this) _http_request_object_responsehandler((req), (this) TSRMLS_CC)
55 extern STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this_ptr TSRMLS_DC);
56
57 PHP_METHOD(HttpRequest, __construct);
58 PHP_METHOD(HttpRequest, __destruct);
59 PHP_METHOD(HttpRequest, setOptions);
60 PHP_METHOD(HttpRequest, getOptions);
61 PHP_METHOD(HttpRequest, setSslOptions);
62 PHP_METHOD(HttpRequest, getSslOptions);
63 PHP_METHOD(HttpRequest, addHeaders);
64 PHP_METHOD(HttpRequest, getHeaders);
65 PHP_METHOD(HttpRequest, setHeaders);
66 PHP_METHOD(HttpRequest, addCookies);
67 PHP_METHOD(HttpRequest, getCookies);
68 PHP_METHOD(HttpRequest, setCookies);
69 PHP_METHOD(HttpRequest, setMethod);
70 PHP_METHOD(HttpRequest, getMethod);
71 PHP_METHOD(HttpRequest, setUrl);
72 PHP_METHOD(HttpRequest, getUrl);
73 PHP_METHOD(HttpRequest, setContentType);
74 PHP_METHOD(HttpRequest, getContentType);
75 PHP_METHOD(HttpRequest, setQueryData);
76 PHP_METHOD(HttpRequest, getQueryData);
77 PHP_METHOD(HttpRequest, addQueryData);
78 PHP_METHOD(HttpRequest, setPostFields);
79 PHP_METHOD(HttpRequest, getPostFields);
80 PHP_METHOD(HttpRequest, addPostFields);
81 PHP_METHOD(HttpRequest, getRawPostData);
82 PHP_METHOD(HttpRequest, setRawPostData);
83 PHP_METHOD(HttpRequest, addRawPostData);
84 PHP_METHOD(HttpRequest, addPostFile);
85 PHP_METHOD(HttpRequest, setPostFiles);
86 PHP_METHOD(HttpRequest, getPostFiles);
87 PHP_METHOD(HttpRequest, setPutFile);
88 PHP_METHOD(HttpRequest, getPutFile);
89 PHP_METHOD(HttpRequest, send);
90 PHP_METHOD(HttpRequest, getResponseData);
91 PHP_METHOD(HttpRequest, getResponseHeader);
92 PHP_METHOD(HttpRequest, getResponseCookie);
93 PHP_METHOD(HttpRequest, getResponseCode);
94 PHP_METHOD(HttpRequest, getResponseBody);
95 PHP_METHOD(HttpRequest, getResponseInfo);
96 PHP_METHOD(HttpRequest, getResponseMessage);
97 PHP_METHOD(HttpRequest, getRequestMessage);
98 PHP_METHOD(HttpRequest, getHistory);
99
100 PHP_METHOD(HttpRequest, get);
101 PHP_METHOD(HttpRequest, head);
102 PHP_METHOD(HttpRequest, postData);
103 PHP_METHOD(HttpRequest, postFields);
104 PHP_METHOD(HttpRequest, putFile);
105 PHP_METHOD(HttpRequest, putStream);
106
107 PHP_METHOD(HttpRequest, methodRegister);
108 PHP_METHOD(HttpRequest, methodUnregister);
109 PHP_METHOD(HttpRequest, methodName);
110 PHP_METHOD(HttpRequest, methodExists);
111
112 #endif
113 #endif
114 #endif
115
116 /*
117 * Local variables:
118 * tab-width: 4
119 * c-basic-offset: 4
120 * End:
121 * vim600: noet sw=4 ts=4 fdm=marker
122 * vim<600: noet sw=4 ts=4
123 */
124