- update for release 0.17.0
[m6w6/ext-http] / php_http.h
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: http |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2004-2005, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 /* $Id$ */
14
15 #ifndef PHP_EXT_HTTP_H
16 #define PHP_EXT_HTTP_H
17
18 #define HTTP_PEXT_VERSION "0.17.0"
19
20 /* make compile on Win32 */
21 #ifdef HTTP_HAVE_CURL
22 # ifdef PHP_WIN32
23 # include <winsock2.h>
24 # endif
25 # include <curl/curl.h>
26 #endif
27
28 #include "phpstr/phpstr.h"
29
30 extern zend_module_entry http_module_entry;
31 #define phpext_http_ptr &http_module_entry
32
33 extern int http_module_number;
34
35 ZEND_BEGIN_MODULE_GLOBALS(http)
36
37 #ifdef ZEND_ENGINE_2
38 zend_bool only_exceptions;
39 #endif
40 struct _http_globals_etag {
41 long mode;
42 void *ctx;
43 zend_bool started;
44 } etag;
45
46 struct _http_globals_log {
47 char *cache;
48 char *redirect;
49 char *allowed_methods;
50 char *composite;
51 } log;
52
53 struct _http_globals_send {
54 double throttle_delay;
55 size_t buffer_size;
56 char *content_type;
57 char *unquoted_etag;
58 time_t last_modified;
59 int gzip_encoding;
60 } send;
61
62 struct _http_globals_request {
63 struct _http_globals_request_methods {
64 char *allowed;
65 HashTable custom;
66 } methods;
67
68 #ifdef HTTP_HAVE_CURL
69 struct _http_globals_request_copies {
70 zend_llist strings;
71 zend_llist slists;
72 zend_llist contexts;
73 zend_llist convs;
74 } copies;
75 # ifndef HAVE_CURL_EASY_STRERROR
76 char error[CURL_ERROR_SIZE + 1];
77 # endif
78 #endif /* HTTP_HAVE_CURL */
79 } request;
80
81 ZEND_END_MODULE_GLOBALS(http)
82
83 #ifdef ZTS
84 # include "TSRM.h"
85 # define HTTP_G(v) TSRMG(http_globals_id, zend_http_globals *, v)
86 # define HTTP_GLOBALS ((zend_http_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(http_globals_id)])
87 #else
88 # define HTTP_G(v) (http_globals.v)
89 # define HTTP_GLOBALS (&http_globals)
90 #endif
91 #define getGlobals(G) zend_http_globals *G = HTTP_GLOBALS;
92
93 PHP_FUNCTION(http_test);
94 PHP_FUNCTION(http_date);
95 PHP_FUNCTION(http_build_uri);
96 PHP_FUNCTION(http_negotiate_language);
97 PHP_FUNCTION(http_negotiate_charset);
98 PHP_FUNCTION(http_redirect);
99 PHP_FUNCTION(http_throttle);
100 PHP_FUNCTION(http_send_status);
101 PHP_FUNCTION(http_send_last_modified);
102 PHP_FUNCTION(http_send_content_type);
103 PHP_FUNCTION(http_send_content_disposition);
104 PHP_FUNCTION(http_match_modified);
105 PHP_FUNCTION(http_match_etag);
106 PHP_FUNCTION(http_cache_last_modified);
107 PHP_FUNCTION(http_cache_etag);
108 PHP_FUNCTION(http_send_data);
109 PHP_FUNCTION(http_send_file);
110 PHP_FUNCTION(http_send_stream);
111 PHP_FUNCTION(http_chunked_decode);
112 PHP_FUNCTION(http_parse_message);
113 PHP_FUNCTION(http_parse_headers);
114 PHP_FUNCTION(http_get_request_headers);
115 PHP_FUNCTION(http_get_request_body);
116 PHP_FUNCTION(http_match_request_header);
117 #ifdef HTTP_HAVE_CURL
118 PHP_FUNCTION(http_get);
119 PHP_FUNCTION(http_head);
120 PHP_FUNCTION(http_post_data);
121 PHP_FUNCTION(http_post_fields);
122 PHP_FUNCTION(http_put_file);
123 PHP_FUNCTION(http_put_stream);
124 #endif /* HTTP_HAVE_CURL */
125 PHP_FUNCTION(http_request_method_register);
126 PHP_FUNCTION(http_request_method_unregister);
127 PHP_FUNCTION(http_request_method_exists);
128 PHP_FUNCTION(http_request_method_name);
129 #ifndef ZEND_ENGINE_2
130 PHP_FUNCTION(http_build_query);
131 #endif /* ZEND_ENGINE_2 */
132 PHP_FUNCTION(ob_etaghandler);
133 #ifdef HTTP_HAVE_ZLIB
134 PHP_FUNCTION(http_gzencode);
135 PHP_FUNCTION(http_gzdecode);
136 PHP_FUNCTION(http_deflate);
137 PHP_FUNCTION(http_inflate);
138 PHP_FUNCTION(http_compress);
139 PHP_FUNCTION(http_uncompress);
140 #endif
141 PHP_FUNCTION(http_support);
142
143 PHP_MINIT_FUNCTION(http);
144 PHP_MSHUTDOWN_FUNCTION(http);
145 PHP_RINIT_FUNCTION(http);
146 PHP_RSHUTDOWN_FUNCTION(http);
147 PHP_MINFO_FUNCTION(http);
148
149 #endif /* PHP_HTTP_H */
150
151 /*
152 * Local variables:
153 * tab-width: 4
154 * c-basic-offset: 4
155 * End:
156 * vim600: noet sw=4 ts=4 fdm=marker
157 * vim<600: noet sw=4 ts=4
158 */
159