config.w32: fix missing icule.lib and iculx.lib
[m6w6/ext-http] / src / php_http_api.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-2014, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 #ifndef PHP_HTTP_API_H
14 #define PHP_HTTP_API_H
15
16 #ifdef __COVERITY_GCC_VERSION_AT_LEAST
17 # define _Float128 float
18 # define _Float64 float
19 # define _Float32 float
20 # define _Float64x float
21 # define _Float32x float
22 #endif
23
24 #ifdef HAVE_CONFIG_H
25 #include "config.h"
26 #endif
27
28 #ifndef PHP_WIN32
29 #include "php_config.h"
30 #endif
31 #include "php.h"
32 #include "SAPI.h"
33
34 #include "ext/raphf/php_raphf_api.h"
35 #include "ext/propro/php_propro_api.h"
36 #include "ext/standard/php_string.h"
37 #include "ext/spl/spl_iterators.h"
38 #include "ext/date/php_date.h"
39
40 #include "zend_interfaces.h"
41 #include "zend_exceptions.h"
42
43
44 #if PHP_WIN32
45 # define PHP_HTTP_API __declspec(dllexport)
46 #elif __GNUC__ >= 4
47 # define PHP_HTTP_API extern __attribute__ ((visibility("default")))
48 #else
49 # define PHP_HTTP_API extern
50 #endif
51
52 #if (HAVE_ICONV || PHP_HTTP_HAVE_EXT_ICONV) && (PHP_HTTP_SHARED_DEPS || !COMPILE_DL_ICONV)
53 # define PHP_HTTP_HAVE_ICONV 1
54 #endif
55
56 #if (HAVE_HASH_EXT || PHP_HTTP_HAVE_EXT_HASH) && (PHP_HTTP_SHARED_DEPS || !COMPILE_DL_HASH)
57 # define PHP_HTTP_HAVE_HASH 1
58 #endif
59
60 #include <stddef.h>
61
62 #if PHP_WIN32
63 # define CURL_STATICLIB
64 # include <winsock2.h>
65 #else
66 # if HAVE_NETDB_H
67 # include <netdb.h>
68 # endif
69 # if HAVE_UNISTD_H
70 # include <unistd.h>
71 # endif
72 #endif
73
74 #if HAVE_WCHAR_H && HAVE_WCTYPE_H && HAVE_ISWALNUM && (HAVE_MBRTOWC || HAVE_MBTOWC)
75 # define PHP_HTTP_HAVE_WCHAR 1
76 #endif
77
78 #include <ctype.h>
79 #define PHP_HTTP_IS_CTYPE(type, c) is##type((int) (unsigned char) (c))
80 #define PHP_HTTP_TO_CTYPE(type, c) to##type((int) (unsigned char) (c))
81
82 #include "php_http.h"
83
84 #include "php_http_buffer.h"
85 #include "php_http_misc.h"
86 #include "php_http_options.h"
87
88 #include "php_http.h"
89 #include "php_http_cookie.h"
90 #include "php_http_encoding.h"
91 #include "php_http_encoding_zlib.h"
92 #include "php_http_encoding_brotli.h"
93 #include "php_http_info.h"
94 #include "php_http_message.h"
95 #include "php_http_env.h"
96 #include "php_http_env_request.h"
97 #include "php_http_env_response.h"
98 #include "php_http_etag.h"
99 #include "php_http_exception.h"
100 #include "php_http_filter.h"
101 #include "php_http_header_parser.h"
102 #include "php_http_header.h"
103 #include "php_http_message_body.h"
104 #include "php_http_message_parser.h"
105 #include "php_http_negotiate.h"
106 #include "php_http_object.h"
107 #include "php_http_params.h"
108 #include "php_http_querystring.h"
109 #include "php_http_client.h"
110 #include "php_http_curl.h"
111 #include "php_http_client_request.h"
112 #include "php_http_client_response.h"
113 #include "php_http_client_curl.h"
114 #include "php_http_client_curl_event.h"
115 #include "php_http_client_curl_user.h"
116 #include "php_http_url.h"
117 #include "php_http_version.h"
118
119 ZEND_BEGIN_MODULE_GLOBALS(php_http)
120 struct php_http_env_globals env;
121 #if PHP_HTTP_HAVE_CLIENT
122 struct {
123 # if PHP_HTTP_HAVE_LIBCURL
124 struct php_http_client_curl_globals curl;
125 # endif
126 } client;
127 #endif
128 ZEND_END_MODULE_GLOBALS(php_http)
129
130 ZEND_EXTERN_MODULE_GLOBALS(php_http);
131
132 #if ZTS
133 # include "TSRM/TSRM.h"
134 # define PHP_HTTP_G ((zend_php_http_globals *) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(php_http_globals_id)])
135 # undef TSRMLS_FETCH_FROM_CTX
136 # define TSRMLS_FETCH_FROM_CTX(ctx) ERROR
137 #else
138 # define PHP_HTTP_G (&php_http_globals)
139 #endif
140
141 #if PHP_DEBUG
142 # define _DPF_STR 0
143 # define _DPF_IN 1
144 # define _DPF_OUT 2
145 extern void _dpf(int type, const char *data, size_t length);
146 #else
147 # define _dpf(t,s,l);
148 #endif
149
150 #endif /* PHP_HTTP_API_H */
151
152
153 /*
154 * Local variables:
155 * tab-width: 4
156 * c-basic-offset: 4
157 * End:
158 * vim600: noet sw=4 ts=4 fdm=marker
159 * vim<600: noet sw=4 ts=4
160 */