* HTTPi_Response mostly done
[m6w6/ext-http] / php_http.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_EXT_HTTP_H
19 #define PHP_EXT_HTTP_H
20
21 #define PHP_EXT_HTTP_VERSION "0.5.0-dev"
22
23 /* make compile on Win32 */
24 #include "php_streams.h"
25 #include "ext/standard/md5.h"
26
27 extern zend_module_entry http_module_entry;
28 #define phpext_http_ptr &http_module_entry
29
30 #ifdef ZTS
31 # include "TSRM.h"
32 # define HTTP_G(v) TSRMG(http_globals_id, zend_http_globals *, v)
33 #else
34 # define HTTP_G(v) (http_globals.v)
35 #endif
36
37 #ifndef ZEND_ENGINE_2
38 # include "php_http_build_query.h"
39 #else
40
41 PHP_METHOD(HTTPi, date);
42 PHP_METHOD(HTTPi, absoluteURI);
43 PHP_METHOD(HTTPi, negotiateLanguage);
44 PHP_METHOD(HTTPi, negotiateCharset);
45 PHP_METHOD(HTTPi, redirect);
46 PHP_METHOD(HTTPi, sendStatus);
47 PHP_METHOD(HTTPi, sendLastModified);
48 PHP_METHOD(HTTPi, matchModified);
49 PHP_METHOD(HTTPi, matchEtag);
50 PHP_METHOD(HTTPi, cacheLastModified);
51 PHP_METHOD(HTTPi, cacheEtag);
52 PHP_METHOD(HTTPi, chunkedDecode);
53 PHP_METHOD(HTTPi, splitResponse);
54 PHP_METHOD(HTTPi, parseHeaders);
55 PHP_METHOD(HTTPi, getRequestHeaders);
56 #ifdef HTTP_HAVE_CURL
57 PHP_METHOD(HTTPi, get);
58 PHP_METHOD(HTTPi, head);
59 PHP_METHOD(HTTPi, postData);
60 PHP_METHOD(HTTPi, postArray);
61 #endif
62 PHP_METHOD(HTTPi, authBasic);
63 PHP_METHOD(HTTPi, authBasicCallback);
64
65
66 PHP_METHOD(HTTPi_Response, __construct);/*
67 PHP_METHOD(HTTPi_Response, __destruct);*/
68 PHP_METHOD(HTTPi_Response, setETag);
69 PHP_METHOD(HTTPi_Response, getETag);
70 PHP_METHOD(HTTPi_Response, setContentDisposition);
71 PHP_METHOD(HTTPi_Response, getContentDisposition);
72 PHP_METHOD(HTTPi_Response, setContentType);
73 PHP_METHOD(HTTPi_Response, getContentType);
74 PHP_METHOD(HTTPi_Response, setCache);
75 PHP_METHOD(HTTPi_Response, getCache);
76 PHP_METHOD(HTTPi_Response, setCacheControl);
77 PHP_METHOD(HTTPi_Response, getCacheControl);
78 PHP_METHOD(HTTPi_Response, setGzip);
79 PHP_METHOD(HTTPi_Response, getGzip);
80 PHP_METHOD(HTTPi_Response, setData);
81 PHP_METHOD(HTTPi_Response, getData);
82 PHP_METHOD(HTTPi_Response, setFile);
83 PHP_METHOD(HTTPi_Response, getFile);
84 PHP_METHOD(HTTPi_Response, setStream);
85 PHP_METHOD(HTTPi_Response, getStream);
86 PHP_METHOD(HTTPi_Response, send);
87 PHP_METHOD(HTTPi_Response, getSize);
88
89 #endif /* ZEND_ENGINE_2 */
90
91
92 PHP_FUNCTION(http_date);
93 PHP_FUNCTION(http_absolute_uri);
94 PHP_FUNCTION(http_negotiate_language);
95 PHP_FUNCTION(http_negotiate_charset);
96 PHP_FUNCTION(http_redirect);
97 PHP_FUNCTION(http_send_status);
98 PHP_FUNCTION(http_send_last_modified);
99 PHP_FUNCTION(http_match_modified);
100 PHP_FUNCTION(http_match_etag);
101 PHP_FUNCTION(http_cache_last_modified);
102 PHP_FUNCTION(http_cache_etag);
103 PHP_FUNCTION(http_content_type);
104 PHP_FUNCTION(http_content_disposition);
105 PHP_FUNCTION(http_send_data);
106 PHP_FUNCTION(http_send_file);
107 PHP_FUNCTION(http_send_stream);
108 PHP_FUNCTION(http_chunked_decode);
109 PHP_FUNCTION(http_split_response);
110 PHP_FUNCTION(http_parse_headers);
111 PHP_FUNCTION(http_get_request_headers);
112 #ifdef HTTP_HAVE_CURL
113 PHP_FUNCTION(http_get);
114 PHP_FUNCTION(http_head);
115 PHP_FUNCTION(http_post_data);
116 PHP_FUNCTION(http_post_array);
117 #endif
118 PHP_FUNCTION(http_auth_basic);
119 PHP_FUNCTION(http_auth_basic_cb);
120
121 PHP_FUNCTION(ob_httpetaghandler);
122
123 PHP_MINIT_FUNCTION(http);
124 PHP_MSHUTDOWN_FUNCTION(http);
125 PHP_RINIT_FUNCTION(http);
126 PHP_RSHUTDOWN_FUNCTION(http);
127 PHP_MINFO_FUNCTION(http);
128
129 ZEND_BEGIN_MODULE_GLOBALS(http)
130 zend_bool etag_started;
131 PHP_MD5_CTX etag_md5;
132 php_stream_statbuf ssb;
133 char *ctype;
134 char *etag;
135 time_t lmod;
136 char *allowed_methods;
137 #ifdef HTTP_HAVE_CURL
138 struct {
139 struct {
140 char *data;
141 size_t used;
142 size_t free;
143 } body;
144 struct {
145 char *data;
146 size_t used;
147 size_t free;
148 } hdrs;
149 } curlbuf;
150 #endif
151 ZEND_END_MODULE_GLOBALS(http)
152
153 #endif /* PHP_HTTP_H */
154
155 /*
156 * Local variables:
157 * tab-width: 4
158 * c-basic-offset: 4
159 * End:
160 * vim600: noet sw=4 ts=4 fdm=marker
161 * vim<600: noet sw=4 ts=4
162 */
163