2 +--------------------------------------------------------------------+
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 +--------------------------------------------------------------------+
15 #ifndef PHP_EXT_HTTP_H
16 #define PHP_EXT_HTTP_H
18 #define HTTP_PEXT_VERSION "0.18.0dev"
20 /* make compile on Win32 */
23 # include <winsock2.h>
25 # include <curl/curl.h>
28 #include "phpstr/phpstr.h"
30 extern zend_module_entry http_module_entry
;
31 #define phpext_http_ptr &http_module_entry
33 extern int http_module_number
;
35 ZEND_BEGIN_MODULE_GLOBALS(http
)
37 struct _http_globals_etag
{
43 struct _http_globals_log
{
46 char *allowed_methods
;
50 struct _http_globals_send
{
51 double throttle_delay
;
59 struct _http_globals_request
{
60 struct _http_globals_request_methods
{
66 struct _http_globals_request_copies
{
72 # ifndef HAVE_CURL_EASY_STRERROR
73 char error
[CURL_ERROR_SIZE
+ 1];
75 #endif /* HTTP_HAVE_CURL */
79 zend_bool only_exceptions
;
82 ZEND_END_MODULE_GLOBALS(http
)
86 # define HTTP_G(v) TSRMG(http_globals_id, zend_http_globals *, v)
87 # define HTTP_GLOBALS ((zend_http_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(http_globals_id)])
89 # define HTTP_G(v) (http_globals.v)
90 # define HTTP_GLOBALS (&http_globals)
92 #define getGlobals(G) zend_http_globals *G = HTTP_GLOBALS;
94 PHP_FUNCTION(http_test
);
95 PHP_FUNCTION(http_date
);
96 PHP_FUNCTION(http_build_uri
);
97 PHP_FUNCTION(http_negotiate_language
);
98 PHP_FUNCTION(http_negotiate_charset
);
99 PHP_FUNCTION(http_redirect
);
100 PHP_FUNCTION(http_throttle
);
101 PHP_FUNCTION(http_send_status
);
102 PHP_FUNCTION(http_send_last_modified
);
103 PHP_FUNCTION(http_send_content_type
);
104 PHP_FUNCTION(http_send_content_disposition
);
105 PHP_FUNCTION(http_match_modified
);
106 PHP_FUNCTION(http_match_etag
);
107 PHP_FUNCTION(http_cache_last_modified
);
108 PHP_FUNCTION(http_cache_etag
);
109 PHP_FUNCTION(http_send_data
);
110 PHP_FUNCTION(http_send_file
);
111 PHP_FUNCTION(http_send_stream
);
112 PHP_FUNCTION(http_chunked_decode
);
113 PHP_FUNCTION(http_parse_message
);
114 PHP_FUNCTION(http_parse_headers
);
115 PHP_FUNCTION(http_get_request_headers
);
116 PHP_FUNCTION(http_get_request_body
);
117 PHP_FUNCTION(http_match_request_header
);
118 #ifdef HTTP_HAVE_CURL
119 PHP_FUNCTION(http_get
);
120 PHP_FUNCTION(http_head
);
121 PHP_FUNCTION(http_post_data
);
122 PHP_FUNCTION(http_post_fields
);
123 PHP_FUNCTION(http_put_file
);
124 PHP_FUNCTION(http_put_stream
);
125 #endif /* HTTP_HAVE_CURL */
126 PHP_FUNCTION(http_request_method_register
);
127 PHP_FUNCTION(http_request_method_unregister
);
128 PHP_FUNCTION(http_request_method_exists
);
129 PHP_FUNCTION(http_request_method_name
);
130 #ifndef ZEND_ENGINE_2
131 PHP_FUNCTION(http_build_query
);
132 #endif /* ZEND_ENGINE_2 */
133 PHP_FUNCTION(ob_etaghandler
);
134 #ifdef HTTP_HAVE_ZLIB
135 PHP_FUNCTION(http_gzencode
);
136 PHP_FUNCTION(http_gzdecode
);
137 PHP_FUNCTION(http_deflate
);
138 PHP_FUNCTION(http_inflate
);
139 PHP_FUNCTION(http_compress
);
140 PHP_FUNCTION(http_uncompress
);
142 PHP_FUNCTION(http_support
);
144 PHP_MINIT_FUNCTION(http
);
145 PHP_MSHUTDOWN_FUNCTION(http
);
146 PHP_RINIT_FUNCTION(http
);
147 PHP_RSHUTDOWN_FUNCTION(http
);
148 PHP_MINFO_FUNCTION(http
);
150 #endif /* PHP_HTTP_H */
157 * vim600: noet sw=4 ts=4 fdm=marker
158 * vim<600: noet sw=4 ts=4