- proper request pool cleanup
[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 "phpstr/phpstr.h"
31
32 typedef struct {
33 zend_object zo;
34 CURL *ch;
35 http_request_pool *pool;
36 phpstr response;
37 } http_request_object;
38
39 extern zend_class_entry *http_request_object_ce;
40 extern zend_function_entry http_request_object_fe[];
41
42 #define http_request_object_init() _http_request_object_init(INIT_FUNC_ARGS_PASSTHRU)
43 extern void _http_request_object_init(INIT_FUNC_ARGS);
44 #define http_request_object_new _http_request_object_new
45 extern zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC);
46 #define http_request_object_free _http_request_object_free
47 extern void _http_request_object_free(zend_object *object TSRMLS_DC);
48
49 #define http_request_object_requesthandler(req, this, body) _http_request_object_requesthandler((req), (this), (body) TSRMLS_CC)
50 extern STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ptr, http_request_body *body TSRMLS_DC);
51 #define http_request_object_responsehandler(req, this, info) _http_request_object_responsehandler((req), (this), (info) TSRMLS_CC)
52 extern STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this_ptr, HashTable *info TSRMLS_DC);
53
54 PHP_METHOD(HttpRequest, __construct);
55 PHP_METHOD(HttpRequest, __destruct);
56 PHP_METHOD(HttpRequest, setOptions);
57 PHP_METHOD(HttpRequest, getOptions);
58 PHP_METHOD(HttpRequest, unsetOptions);
59 PHP_METHOD(HttpRequest, setSslOptions);
60 PHP_METHOD(HttpRequest, getSslOptions);
61 PHP_METHOD(HttpRequest, unsetSslOptions);
62 PHP_METHOD(HttpRequest, addHeaders);
63 PHP_METHOD(HttpRequest, getHeaders);
64 PHP_METHOD(HttpRequest, unsetHeaders);
65 PHP_METHOD(HttpRequest, addCookies);
66 PHP_METHOD(HttpRequest, getCookies);
67 PHP_METHOD(HttpRequest, unsetCookies);
68 PHP_METHOD(HttpRequest, setMethod);
69 PHP_METHOD(HttpRequest, getMethod);
70 PHP_METHOD(HttpRequest, setURL);
71 PHP_METHOD(HttpRequest, getURL);
72 PHP_METHOD(HttpRequest, setContentType);
73 PHP_METHOD(HttpRequest, getContentType);
74 PHP_METHOD(HttpRequest, setQueryData);
75 PHP_METHOD(HttpRequest, getQueryData);
76 PHP_METHOD(HttpRequest, addQueryData);
77 PHP_METHOD(HttpRequest, unsetQueryData);
78 PHP_METHOD(HttpRequest, setPostFields);
79 PHP_METHOD(HttpRequest, getPostFields);
80 PHP_METHOD(HttpRequest, addPostFields);
81 PHP_METHOD(HttpRequest, unsetPostFields);
82 PHP_METHOD(HttpRequest, addPostFile);
83 PHP_METHOD(HttpRequest, setPostFiles);
84 PHP_METHOD(HttpRequest, getPostFiles);
85 PHP_METHOD(HttpRequest, unsetPostFiles);
86 PHP_METHOD(HttpRequest, setPutFile);
87 PHP_METHOD(HttpRequest, getPutFile);
88 PHP_METHOD(HttpRequest, unsetPutFile);
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
98 #endif
99 #endif
100 #endif
101
102 /*
103 * Local variables:
104 * tab-width: 4
105 * c-basic-offset: 4
106 * End:
107 * vim600: noet sw=4 ts=4 fdm=marker
108 * vim<600: noet sw=4 ts=4
109 */
110