- don't copy the refcount of the passed in value -- fixes remaining mem-leaks of...
[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.12.0dev"
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 #include "ext/standard/md5.h"
31 #include "ext/standard/sha1.h"
32 #include "phpstr/phpstr.h"
33
34 extern zend_module_entry http_module_entry;
35 #define phpext_http_ptr &http_module_entry
36
37 extern int http_module_number;
38
39 ZEND_BEGIN_MODULE_GLOBALS(http)
40
41 #ifdef ZEND_ENGINE_2
42 zend_bool only_exceptions;
43 #endif
44 struct _http_globals_etag {
45 long mode;
46 void *ctx;
47 zend_bool started;
48 } etag;
49
50 struct _http_globals_log {
51 char *auth;
52 char *cache;
53 char *redirect;
54 char *allowed_methods;
55 char *composite;
56 } log;
57
58 struct _http_globals_send {
59 double throttle_delay;
60 size_t buffer_size;
61 char *content_type;
62 char *unquoted_etag;
63 time_t last_modified;
64 } send;
65
66 struct _http_globals_request {
67 struct _http_globals_request_methods {
68 char *allowed;
69 HashTable custom;
70 } methods;
71
72 #ifdef HTTP_HAVE_CURL
73 struct _http_globals_request_copies {
74 zend_llist strings;
75 zend_llist slists;
76 zend_llist contexts;
77 zend_llist convs;
78 } copies;
79 # if LIBCURL_VERSION_NUM < 0x070c00
80 char error[CURL_ERROR_SIZE + 1];
81 # endif
82 #endif /* HTTP_HAVE_CURL */
83 } request;
84
85 ZEND_END_MODULE_GLOBALS(http)
86
87 #ifdef ZTS
88 # include "TSRM.h"
89 # define HTTP_G(v) TSRMG(http_globals_id, zend_http_globals *, v)
90 # define HTTP_GLOBALS ((zend_http_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(http_globals_id)])
91 #else
92 # define HTTP_G(v) (http_globals.v)
93 # define HTTP_GLOBALS (&http_globals)
94 #endif
95 #define getGlobals(G) zend_http_globals *G = HTTP_GLOBALS;
96
97 PHP_FUNCTION(http_test);
98 PHP_FUNCTION(http_date);
99 PHP_FUNCTION(http_absolute_uri);
100 PHP_FUNCTION(http_negotiate_language);
101 PHP_FUNCTION(http_negotiate_charset);
102 PHP_FUNCTION(http_redirect);
103 PHP_FUNCTION(http_throttle);
104 PHP_FUNCTION(http_send_status);
105 PHP_FUNCTION(http_send_last_modified);
106 PHP_FUNCTION(http_send_content_type);
107 PHP_FUNCTION(http_send_content_disposition);
108 PHP_FUNCTION(http_match_modified);
109 PHP_FUNCTION(http_match_etag);
110 PHP_FUNCTION(http_cache_last_modified);
111 PHP_FUNCTION(http_cache_etag);
112 PHP_FUNCTION(http_send_data);
113 PHP_FUNCTION(http_send_file);
114 PHP_FUNCTION(http_send_stream);
115 PHP_FUNCTION(http_chunked_decode);
116 PHP_FUNCTION(http_parse_message);
117 PHP_FUNCTION(http_parse_headers);
118 PHP_FUNCTION(http_get_request_headers);
119 PHP_FUNCTION(http_get_request_body);
120 PHP_FUNCTION(http_match_request_header);
121 #ifdef HTTP_HAVE_CURL
122 PHP_FUNCTION(http_get);
123 PHP_FUNCTION(http_head);
124 PHP_FUNCTION(http_post_data);
125 PHP_FUNCTION(http_post_fields);
126 PHP_FUNCTION(http_put_file);
127 PHP_FUNCTION(http_put_stream);
128 /*PHP_FUNCTION(http_request)*/
129 PHP_FUNCTION(http_request_method_register);
130 PHP_FUNCTION(http_request_method_unregister);
131 PHP_FUNCTION(http_request_method_exists);
132 PHP_FUNCTION(http_request_method_name);
133 #endif /* HTTP_HAVE_CURL */
134 PHP_FUNCTION(http_auth_basic);
135 PHP_FUNCTION(http_auth_basic_cb);
136 #ifndef ZEND_ENGINE_2
137 PHP_FUNCTION(http_build_query);
138 #endif /* ZEND_ENGINE_2 */
139 PHP_FUNCTION(ob_etaghandler);
140
141 PHP_MINIT_FUNCTION(http);
142 PHP_MSHUTDOWN_FUNCTION(http);
143 PHP_RINIT_FUNCTION(http);
144 PHP_RSHUTDOWN_FUNCTION(http);
145 PHP_MINFO_FUNCTION(http);
146
147 #endif /* PHP_HTTP_H */
148
149 /*
150 * Local variables:
151 * tab-width: 4
152 * c-basic-offset: 4
153 * End:
154 * vim600: noet sw=4 ts=4 fdm=marker
155 * vim<600: noet sw=4 ts=4
156 */
157