* hoppala
[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
88 #endif /* ZEND_ENGINE_2 */
89
90
91 PHP_FUNCTION(http_date);
92 PHP_FUNCTION(http_absolute_uri);
93 PHP_FUNCTION(http_negotiate_language);
94 PHP_FUNCTION(http_negotiate_charset);
95 PHP_FUNCTION(http_redirect);
96 PHP_FUNCTION(http_send_status);
97 PHP_FUNCTION(http_send_last_modified);
98 PHP_FUNCTION(http_match_modified);
99 PHP_FUNCTION(http_match_etag);
100 PHP_FUNCTION(http_cache_last_modified);
101 PHP_FUNCTION(http_cache_etag);
102 PHP_FUNCTION(http_content_type);
103 PHP_FUNCTION(http_content_disposition);
104 PHP_FUNCTION(http_send_data);
105 PHP_FUNCTION(http_send_file);
106 PHP_FUNCTION(http_send_stream);
107 PHP_FUNCTION(http_chunked_decode);
108 PHP_FUNCTION(http_split_response);
109 PHP_FUNCTION(http_parse_headers);
110 PHP_FUNCTION(http_get_request_headers);
111 #ifdef HTTP_HAVE_CURL
112 PHP_FUNCTION(http_get);
113 PHP_FUNCTION(http_head);
114 PHP_FUNCTION(http_post_data);
115 PHP_FUNCTION(http_post_array);
116 #endif
117 PHP_FUNCTION(http_auth_basic);
118 PHP_FUNCTION(http_auth_basic_cb);
119
120 PHP_FUNCTION(ob_httpetaghandler);
121
122 PHP_MINIT_FUNCTION(http);
123 PHP_MSHUTDOWN_FUNCTION(http);
124 PHP_RINIT_FUNCTION(http);
125 PHP_RSHUTDOWN_FUNCTION(http);
126 PHP_MINFO_FUNCTION(http);
127
128 ZEND_BEGIN_MODULE_GLOBALS(http)
129 zend_bool etag_started;
130 PHP_MD5_CTX etag_md5;
131 php_stream_statbuf ssb;
132 char *ctype;
133 char *etag;
134 time_t lmod;
135 char *allowed_methods;
136 #ifdef HTTP_HAVE_CURL
137 struct {
138 struct {
139 char *data;
140 size_t used;
141 size_t free;
142 } body;
143 struct {
144 char *data;
145 size_t used;
146 size_t free;
147 } hdrs;
148 } curlbuf;
149 #endif
150 ZEND_END_MODULE_GLOBALS(http)
151
152 #endif /* PHP_HTTP_H */
153
154 /*
155 * Local variables:
156 * tab-width: 4
157 * c-basic-offset: 4
158 * End:
159 * vim600: noet sw=4 ts=4 fdm=marker
160 * vim<600: noet sw=4 ts=4
161 */
162