- http_support() claimed there's no SSL support ifndef ZTS
[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 HTTP_PEXT_VERSION "0.16.1dev"
22
23 /* make compile on Win32 */
24 #ifdef HTTP_HAVE_CURL
25 # ifdef PHP_WIN32
26 # include <winsock2.h>
27 # endif
28 # include <curl/curl.h>
29 #endif
30
31 #include "phpstr/phpstr.h"
32
33 extern zend_module_entry http_module_entry;
34 #define phpext_http_ptr &http_module_entry
35
36 extern int http_module_number;
37
38 ZEND_BEGIN_MODULE_GLOBALS(http)
39
40 #ifdef ZEND_ENGINE_2
41 zend_bool only_exceptions;
42 #endif
43 struct _http_globals_etag {
44 long mode;
45 void *ctx;
46 zend_bool started;
47 } etag;
48
49 struct _http_globals_log {
50 char *cache;
51 char *redirect;
52 char *allowed_methods;
53 char *composite;
54 } log;
55
56 struct _http_globals_send {
57 double throttle_delay;
58 size_t buffer_size;
59 char *content_type;
60 char *unquoted_etag;
61 time_t last_modified;
62 int gzip_encoding;
63 } send;
64
65 struct _http_globals_request {
66 struct _http_globals_request_methods {
67 char *allowed;
68 HashTable custom;
69 } methods;
70
71 #ifdef HTTP_HAVE_CURL
72 struct _http_globals_request_copies {
73 zend_llist strings;
74 zend_llist slists;
75 zend_llist contexts;
76 zend_llist convs;
77 } copies;
78 # ifndef HAVE_CURL_EASY_STRERROR
79 char error[CURL_ERROR_SIZE + 1];
80 # endif
81 #endif /* HTTP_HAVE_CURL */
82 } request;
83
84 ZEND_END_MODULE_GLOBALS(http)
85
86 #ifdef ZTS
87 # include "TSRM.h"
88 # define HTTP_G(v) TSRMG(http_globals_id, zend_http_globals *, v)
89 # define HTTP_GLOBALS ((zend_http_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(http_globals_id)])
90 #else
91 # define HTTP_G(v) (http_globals.v)
92 # define HTTP_GLOBALS (&http_globals)
93 #endif
94 #define getGlobals(G) zend_http_globals *G = HTTP_GLOBALS;
95
96 PHP_FUNCTION(http_test);
97 PHP_FUNCTION(http_date);
98 PHP_FUNCTION(http_build_uri);
99 PHP_FUNCTION(http_negotiate_language);
100 PHP_FUNCTION(http_negotiate_charset);
101 PHP_FUNCTION(http_redirect);
102 PHP_FUNCTION(http_throttle);
103 PHP_FUNCTION(http_send_status);
104 PHP_FUNCTION(http_send_last_modified);
105 PHP_FUNCTION(http_send_content_type);
106 PHP_FUNCTION(http_send_content_disposition);
107 PHP_FUNCTION(http_match_modified);
108 PHP_FUNCTION(http_match_etag);
109 PHP_FUNCTION(http_cache_last_modified);
110 PHP_FUNCTION(http_cache_etag);
111 PHP_FUNCTION(http_send_data);
112 PHP_FUNCTION(http_send_file);
113 PHP_FUNCTION(http_send_stream);
114 PHP_FUNCTION(http_chunked_decode);
115 PHP_FUNCTION(http_parse_message);
116 PHP_FUNCTION(http_parse_headers);
117 PHP_FUNCTION(http_get_request_headers);
118 PHP_FUNCTION(http_get_request_body);
119 PHP_FUNCTION(http_match_request_header);
120 #ifdef HTTP_HAVE_CURL
121 PHP_FUNCTION(http_get);
122 PHP_FUNCTION(http_head);
123 PHP_FUNCTION(http_post_data);
124 PHP_FUNCTION(http_post_fields);
125 PHP_FUNCTION(http_put_file);
126 PHP_FUNCTION(http_put_stream);
127 #endif /* HTTP_HAVE_CURL */
128 PHP_FUNCTION(http_request_method_register);
129 PHP_FUNCTION(http_request_method_unregister);
130 PHP_FUNCTION(http_request_method_exists);
131 PHP_FUNCTION(http_request_method_name);
132 #ifndef ZEND_ENGINE_2
133 PHP_FUNCTION(http_build_query);
134 #endif /* ZEND_ENGINE_2 */
135 PHP_FUNCTION(ob_etaghandler);
136 #ifdef HTTP_HAVE_ZLIB
137 PHP_FUNCTION(http_gzencode);
138 PHP_FUNCTION(http_gzdecode);
139 PHP_FUNCTION(http_deflate);
140 PHP_FUNCTION(http_inflate);
141 PHP_FUNCTION(http_compress);
142 PHP_FUNCTION(http_uncompress);
143 #endif
144 PHP_FUNCTION(http_support);
145
146 PHP_MINIT_FUNCTION(http);
147 PHP_MSHUTDOWN_FUNCTION(http);
148 PHP_RINIT_FUNCTION(http);
149 PHP_RSHUTDOWN_FUNCTION(http);
150 PHP_MINFO_FUNCTION(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