Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 458 lines (375 sloc) 11.914 kb
5dbb3a7 Wez Furlong Added files for PHP streams
wez authored
1 /*
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
2 +----------------------------------------------------------------------+
ccfc46b - Happy new year and PHP 5 for rest of the files too..
foobar authored
3 | PHP Version 5 |
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
4 +----------------------------------------------------------------------+
4e19825 Felipe Pena - Year++
felipensp authored
5 | Copyright (c) 1997-2012 The PHP Group |
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
6 +----------------------------------------------------------------------+
5bd9322 bump year and license version
foobar authored
7 | This source file is subject to version 3.01 of the PHP license, |
c5724cb Zeev Suraski License update
zsuraski authored
8 | that is bundled with this package in the file LICENSE, and is |
f68c7ff updating license information in the headers.
James Cox authored
9 | available through the world-wide-web at the following url: |
5bd9322 bump year and license version
foobar authored
10 | http://www.php.net/license/3_01.txt |
c5724cb Zeev Suraski License update
zsuraski authored
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
14 +----------------------------------------------------------------------+
15 | Authors: Andi Gutmans <andi@zend.com> |
16 | Zeev Suraski <zeev@zend.com> |
17 +----------------------------------------------------------------------+
18 */
19
20 /* $Id$ */
21
16017f6 Change header protection macros to conform to standard.
Sascha Schumann authored
22 #ifndef PHP_H
23 #define PHP_H
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
24
6ec7163 add dmalloc
Sascha Schumann authored
25 #ifdef HAVE_DMALLOC
26 #include <dmalloc.h>
27 #endif
28
0cee5ed Kalle Sommer Nielsen Bump PHP_API_VERSION
KalleZ authored
29 #define PHP_API_VERSION 20100412
68d2592 Rename HAVE_PHP_STREAM to PHP_HAVE_STREAMS, because
Sascha Schumann authored
30 #define PHP_HAVE_STREAMS
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
31 #define YYDEBUG 0
32
33 #include "php_version.h"
34 #include "zend.h"
bcb426a Merge in qsort changes
Sterling Hughes authored
35 #include "zend_qsort.h"
315999d Prefix some symbols with php_
Sascha Schumann authored
36 #include "php_compat.h"
f9f8296 moved bcmath
Stig Bakken authored
37
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
38 #include "zend_API.h"
39
d180634 Add PHP_BROKEN_SPRINTF check here.
Sascha Schumann authored
40 #undef sprintf
41 #define sprintf php_sprintf
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
42
a9fcfb1 turn on force redirect for windows
Shane Caraveo authored
43 /* PHP's DEBUG value must match Zend's ZEND_DEBUG value */
44 #undef PHP_DEBUG
45 #define PHP_DEBUG ZEND_DEBUG
46
80bdd19 Zeev Suraski Fine tune Andi's patch
zsuraski authored
47 #ifdef PHP_WIN32
240fa24 Improved PHP binary size and startup speed with GCC4 visibility control ...
Dmitry Stogov authored
48 # include "tsrm_win32.h"
49 # include "win95nt.h"
7942eaf Zeev Suraski * Plenty of thread safety and Win32 work.
zsuraski authored
50 # ifdef PHP_EXPORTS
240fa24 Improved PHP binary size and startup speed with GCC4 visibility control ...
Dmitry Stogov authored
51 # define PHPAPI __declspec(dllexport)
7942eaf Zeev Suraski * Plenty of thread safety and Win32 work.
zsuraski authored
52 # else
240fa24 Improved PHP binary size and startup speed with GCC4 visibility control ...
Dmitry Stogov authored
53 # define PHPAPI __declspec(dllimport)
7942eaf Zeev Suraski * Plenty of thread safety and Win32 work.
zsuraski authored
54 # endif
240fa24 Improved PHP binary size and startup speed with GCC4 visibility control ...
Dmitry Stogov authored
55 # define PHP_DIR_SEPARATOR '\\'
56 # define PHP_EOL "\r\n"
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
57 #else
240fa24 Improved PHP binary size and startup speed with GCC4 visibility control ...
Dmitry Stogov authored
58 # if defined(__GNUC__) && __GNUC__ >= 4
59 # define PHPAPI __attribute__ ((visibility("default")))
60 # else
61 # define PHPAPI
62 # endif
63
995a668 Rasmus Lerdorf Merge fix for bug 61193
rlerdorf authored
64 # define THREAD_LS
65 # define PHP_DIR_SEPARATOR '/'
66 # define PHP_EOL "\n"
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
67 #endif
68
575e368 NetWare related changes
Venkat Raghavan S authored
69 #ifdef NETWARE
2909e5c centralize #include "build-defs.h" and drop (sometimes inconsistent) oth...
Sascha Schumann authored
70 /* For php_get_uname() function */
71 #define PHP_UNAME "NetWare"
72 #define PHP_OS PHP_UNAME
575e368 NetWare related changes
Venkat Raghavan S authored
73 #endif
74
cbc1cd8 Include/enable assert.h/assert() when it is available
Yasuo Ohgaki authored
75 #if HAVE_ASSERT_H
76 #if PHP_DEBUG
77 #undef NDEBUG
78 #else
12bc954 don't redefine NDEBUG if it is already defined. yeesh.
jim winstead authored
79 #ifndef NDEBUG
cbc1cd8 Include/enable assert.h/assert() when it is available
Yasuo Ohgaki authored
80 #define NDEBUG
81 #endif
12bc954 don't redefine NDEBUG if it is already defined. yeesh.
jim winstead authored
82 #endif
cbc1cd8 Include/enable assert.h/assert() when it is available
Yasuo Ohgaki authored
83 #include <assert.h>
84 #else /* HAVE_ASSERT_H */
85 #define assert(expr) ((void) (0))
86 #endif /* HAVE_ASSERT_H */
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
87
6d0ab61 Zeev Suraski SAPIfication, Episode VI: Return of the SAPI
zsuraski authored
88 #define APACHE 0
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
89
90 #if HAVE_UNIX_H
91 #include <unix.h>
92 #endif
93
94 #if HAVE_ALLOCA_H
95 #include <alloca.h>
96 #endif
97
2909e5c centralize #include "build-defs.h" and drop (sometimes inconsistent) oth...
Sascha Schumann authored
98 #if HAVE_BUILD_DEFS_H
14058c8 - Fix another generated header include
foobar authored
99 #include <build-defs.h>
2909e5c centralize #include "build-defs.h" and drop (sometimes inconsistent) oth...
Sascha Schumann authored
100 #endif
101
365edad Add PHP_STRLCPY macro. This macro should be used in new code instead of
Sascha Schumann authored
102 /*
103 * This is a fast version of strlcpy which should be used, if you
2eb8688 Refine PHP_STRLCPY comment
Sascha Schumann authored
104 * know the size of the destination buffer and if you know
365edad Add PHP_STRLCPY macro. This macro should be used in new code instead of
Sascha Schumann authored
105 * the length of the source string.
106 *
2eb8688 Refine PHP_STRLCPY comment
Sascha Schumann authored
107 * size is the allocated number of bytes of dst
108 * src_size is the number of bytes excluding the NUL of src
365edad Add PHP_STRLCPY macro. This macro should be used in new code instead of
Sascha Schumann authored
109 */
110
111 #define PHP_STRLCPY(dst, src, size, src_size) \
112 { \
113 size_t php_str_len; \
114 \
115 if (src_size >= size) \
116 php_str_len = size - 1; \
117 else \
118 php_str_len = src_size; \
119 memcpy(dst, src, php_str_len); \
120 dst[php_str_len] = '\0'; \
121 }
122
1740e6e Clean up the strlcat/strlcpy checks.
Stig Bakken authored
123 #ifndef HAVE_STRLCPY
e6ea5ca Fix use of EXTERN_C macros
Ard Biesheuvel authored
124 BEGIN_EXTERN_C()
39e2822 place nice with other libraries.
Sterling Hughes authored
125 PHPAPI size_t php_strlcpy(char *dst, const char *src, size_t siz);
e6ea5ca Fix use of EXTERN_C macros
Ard Biesheuvel authored
126 END_EXTERN_C()
9979003 undefine macros before defining them
Sascha Schumann authored
127 #undef strlcpy
39e2822 place nice with other libraries.
Sterling Hughes authored
128 #define strlcpy php_strlcpy
61a3c14 andigutmans Add strlcpy/strlcat to the build process
andigutmans authored
129 #endif
130
1740e6e Clean up the strlcat/strlcpy checks.
Stig Bakken authored
131 #ifndef HAVE_STRLCAT
e6ea5ca Fix use of EXTERN_C macros
Ard Biesheuvel authored
132 BEGIN_EXTERN_C()
39e2822 place nice with other libraries.
Sterling Hughes authored
133 PHPAPI size_t php_strlcat(char *dst, const char *src, size_t siz);
e6ea5ca Fix use of EXTERN_C macros
Ard Biesheuvel authored
134 END_EXTERN_C()
9979003 undefine macros before defining them
Sascha Schumann authored
135 #undef strlcat
39e2822 place nice with other libraries.
Sterling Hughes authored
136 #define strlcat php_strlcat
61a3c14 andigutmans Add strlcpy/strlcat to the build process
andigutmans authored
137 #endif
138
85210ed Zeev Suraski Get Win32 to compile again
zsuraski authored
139 #ifndef HAVE_STRTOK_R
e6ea5ca Fix use of EXTERN_C macros
Ard Biesheuvel authored
140 BEGIN_EXTERN_C()
85210ed Zeev Suraski Get Win32 to compile again
zsuraski authored
141 char *strtok_r(char *s, const char *delim, char **last);
e6ea5ca Fix use of EXTERN_C macros
Ard Biesheuvel authored
142 END_EXTERN_C()
85210ed Zeev Suraski Get Win32 to compile again
zsuraski authored
143 #endif
144
5b2ecc5 Typedef socklen_t, if it is not available
Sascha Schumann authored
145 #ifndef HAVE_SOCKLEN_T
a7ffa09 pierrejoye - add PHP_INSTALL_HEADERS to all parts (core&exts) exposing headers, gen...
pierrejoye authored
146 # if PHP_WIN32
147 typedef int socklen_t;
148 # else
5b2ecc5 Typedef socklen_t, if it is not available
Sascha Schumann authored
149 typedef unsigned int socklen_t;
a7ffa09 pierrejoye - add PHP_INSTALL_HEADERS to all parts (core&exts) exposing headers, gen...
pierrejoye authored
150 # endif
5b2ecc5 Typedef socklen_t, if it is not available
Sascha Schumann authored
151 #endif
152
1159c84 Zeev Suraski - TSRMLS_FETCH work
zsuraski authored
153 #define CREATE_MUTEX(a, b)
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
154 #define SET_MUTEX(a)
155 #define FREE_MUTEX(a)
156
157 /*
158 * Then the ODBC support can use both iodbc and Solid,
159 * uncomment this.
160 * #define HAVE_ODBC (HAVE_IODBC|HAVE_SOLID)
161 */
162
163 #include <stdlib.h>
164 #include <ctype.h>
165 #if HAVE_UNISTD_H
166 #include <unistd.h>
167 #endif
168 #if HAVE_STDARG_H
169 #include <stdarg.h>
5dbb3a7 Wez Furlong Added files for PHP streams
wez authored
170 #else
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
171 # if HAVE_SYS_VARARGS_H
172 # include <sys/varargs.h>
5dbb3a7 Wez Furlong Added files for PHP streams
wez authored
173 # endif
174 #endif
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
175
49a15f0 MFH Better fix for va_copy since some architectures like to do a deep co...
Scott MacVicar authored
176 #ifndef va_copy
177 # ifdef __va_copy
178 # define va_copy(ap1, ap2) __va_copy((ap1), (ap2))
179 # else
180 # define va_copy(ap1, ap2) memcpy((&ap1), (&ap2), sizeof(va_list))
181 # endif
182 #endif
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
183
184 #include "zend_hash.h"
185 #include "zend_alloc.h"
186 #include "zend_stack.h"
187
188 #if STDC_HEADERS
189 # include <string.h>
190 #else
191 # ifndef HAVE_MEMCPY
192 # define memcpy(d, s, n) bcopy((s), (d), (n))
a8f0c5a Rasmus Lerdorf decouple this check just in case we hit a weird system that has one
rlerdorf authored
193 # endif
194 # ifndef HAVE_MEMMOVE
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
195 # define memmove(d, s, n) bcopy ((s), (d), (n))
196 # endif
197 #endif
198
199 #ifndef HAVE_STRERROR
8e0ae5d Cleaning up some mess
Sascha Schumann authored
200 char *strerror(int);
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
201 #endif
202
203 #if HAVE_PWD_H
80bdd19 Zeev Suraski Fine tune Andi's patch
zsuraski authored
204 # ifdef PHP_WIN32
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
205 #include "win32/param.h"
206 # else
207 #include <pwd.h>
208 #include <sys/param.h>
209 # endif
210 #endif
211
212 #if HAVE_LIMITS_H
213 #include <limits.h>
214 #endif
215
216 #ifndef LONG_MAX
217 #define LONG_MAX 2147483647L
218 #endif
219
220 #ifndef LONG_MIN
221 #define LONG_MIN (- LONG_MAX - 1)
222 #endif
223
6d98fc3 Fixed: removed possible integer over-/underflows
Stefan Esser authored
224 #ifndef INT_MAX
225 #define INT_MAX 2147483647
226 #endif
227
228 #ifndef INT_MIN
229 #define INT_MIN (- INT_MAX - 1)
230 #endif
231
258d958 Use ZEND_GCC_VERSION and ZEND_ATTRIBUTE_MALLOC
Sascha Schumann authored
232 #define PHP_GCC_VERSION ZEND_GCC_VERSION
233 #define PHP_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_MALLOC
341b7b5 add format attribute where appropiate
Sascha Schumann authored
234 #define PHP_ATTRIBUTE_FORMAT ZEND_ATTRIBUTE_FORMAT
5ef7cc4 Let GCC check format arguments
Sascha Schumann authored
235
816bcd3 Frank M. Kromann Fix win32 build.
fmk authored
236 BEGIN_EXTERN_C()
caeaaf4 Fix build on systems which lack snprintf or vsnprintf.
Sascha Schumann authored
237 #include "snprintf.h"
816bcd3 Frank M. Kromann Fix win32 build.
fmk authored
238 END_EXTERN_C()
3e70f37 make (v)spprintf available
Marcus Boerger authored
239 #include "spprintf.h"
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
240
241 #define EXEC_INPUT_BUF 4096
242
cc205c6 Correct PHP's mime type.
Andrei Zmievski authored
243 #define PHP_MIME_TYPE "application/x-httpd-php"
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
244
245 /* macros */
cb2a2ea Zeev Suraski *** empty log message ***
zsuraski authored
246 #define STR_PRINT(str) ((str)?(str):"")
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
247
248 #ifndef MAXPATHLEN
204f4ad andigutmans - Smarter detection of MAXPATHLEN
andigutmans authored
249 # ifdef PATH_MAX
250 # define MAXPATHLEN PATH_MAX
cd82349 Fixed bug #31347 (is_dir and is_file (incorrectly) return true for any
Ilia Alshanetsky authored
251 # elif defined(MAX_PATH)
252 # define MAXPATHLEN MAX_PATH
204f4ad andigutmans - Smarter detection of MAXPATHLEN
andigutmans authored
253 # else
254 # define MAXPATHLEN 256 /* Should be safe for any weird systems that do not define it */
255 # endif
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
256 #endif
257
75ec1fe Rasmus Lerdorf Add php_ignore_value() macro to suppress unused return value warnings
rlerdorf authored
258 #if defined(__GNUC__) && __GNUC__ >= 4
259 # define php_ignore_value(x) (({ __typeof__ (x) __x = (x); (void) __x; }))
260 #else
261 # define php_ignore_value(x) ((void) (x))
262 #endif
b10b24d Wez Furlong Always initialize wrappers, regardless of PG(allow_url_fopen).
wez authored
263
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
264 /* global variables */
80bdd19 Zeev Suraski Fine tune Andi's patch
zsuraski authored
265 #if !defined(PHP_WIN32)
494d665 make sleep() return it's return value when possible
Andrey Hristov authored
266 #define PHP_SLEEP_NON_VOID
1b18be1 NetWare related changes/modifications
Anantha Kesari H Y authored
267 #define php_sleep sleep
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
268 extern char **environ;
3e2f152 A new file added and some old files modified for NetWare.
Anantha Kesari H Y authored
269 #endif /* !defined(PHP_WIN32) */
7942eaf Zeev Suraski * Plenty of thread safety and Win32 work.
zsuraski authored
270
e2eaf63 Add support for systems where p{read|write} take a off64_t without
Sascha Schumann authored
271 #ifdef PHP_PWRITE_64
272 ssize_t pwrite(int, void *, size_t, off64_t);
273 #endif
274
275 #ifdef PHP_PREAD_64
276 ssize_t pread(int, void *, size_t, off64_t);
277 #endif
278
e6ea5ca Fix use of EXTERN_C macros
Ard Biesheuvel authored
279 BEGIN_EXTERN_C()
8e0ae5d Cleaning up some mess
Sascha Schumann authored
280 void phperror(char *error);
b349df6 some more eliminate-fetches-or-escalate-them-at-least
Sascha Schumann authored
281 PHPAPI int php_write(void *buf, uint size TSRMLS_DC);
341b7b5 add format attribute where appropiate
Sascha Schumann authored
282 PHPAPI int php_printf(const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1,
283 2);
0960722 - Added a new PHPAPI function to return module_initialized:
Derick Rethans authored
284 PHPAPI int php_get_module_initialized(void);
b349df6 some more eliminate-fetches-or-escalate-them-at-least
Sascha Schumann authored
285 PHPAPI void php_log_err(char *log_message TSRMLS_DC);
341b7b5 add format attribute where appropiate
Sascha Schumann authored
286 int Debug(char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1, 2);
8e0ae5d Cleaning up some mess
Sascha Schumann authored
287 int cfgparse(void);
e6ea5ca Fix use of EXTERN_C macros
Ard Biesheuvel authored
288 END_EXTERN_C()
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
289
39aa59b Zeev Suraski More error handling work (still completely disabled)
zsuraski authored
290 #define php_error zend_error
e9a6f0f Etienne Kneuss MFH: User error handlers no longer catch supressed errors
colder authored
291 #define error_handling_t zend_error_handling_t
3fc4a32 Infrastructure to catch warnings and throw tehm as errors autmatically
Marcus Boerger authored
292
e6ea5ca Fix use of EXTERN_C macros
Ard Biesheuvel authored
293 BEGIN_EXTERN_C()
3f7a4b7 - MFH error handling, now with save, replace, restore
Marcus Boerger authored
294 static inline ZEND_ATTRIBUTE_DEPRECATED void php_set_error_handling(error_handling_t error_handling, zend_class_entry *exception_class TSRMLS_DC)
295 {
296 zend_replace_error_handling(error_handling, exception_class, NULL TSRMLS_CC);
297 }
4c3563d - MFH: Sorry for the compiler warning
Marcus Boerger authored
298 static inline ZEND_ATTRIBUTE_DEPRECATED void php_std_error_handling() {}
3fc4a32 Infrastructure to catch warnings and throw tehm as errors autmatically
Marcus Boerger authored
299
341b7b5 add format attribute where appropiate
Sascha Schumann authored
300 PHPAPI void php_verror(const char *docref, const char *params, int type, const char *format, va_list args TSRMLS_DC) PHP_ATTRIBUTE_FORMAT(printf, 4, 0);
301
302 #ifdef ZTS
303 #define PHP_ATTR_FMT_OFFSET 1
304 #else
305 #define PHP_ATTR_FMT_OFFSET 0
306 #endif
1134977 fix for extension = ""
Marcus Boerger authored
307
e50228a -new functions php_error_func<0> to support unified error messages
Marcus Boerger authored
308 /* PHPAPI void php_error(int type, const char *format, ...); */
d0bb8f5 This makes more sense. (Someone might actually use php_error_docref0() :...
foobar authored
309 PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...)
341b7b5 add format attribute where appropiate
Sascha Schumann authored
310 PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 3, PHP_ATTR_FMT_OFFSET + 4);
311 PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...)
312 PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 4, PHP_ATTR_FMT_OFFSET + 5);
313 PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const char *param2, int type, const char *format, ...)
314 PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 5, PHP_ATTR_FMT_OFFSET + 6);
bbf9b6d pierrejoye - #50854, fix build on non windows
pierrejoye authored
315 #ifdef PHP_WIN32
573c33b pierrejoye - [DOC] #45986, bad file descriptor warning when rename is used with inv...
pierrejoye authored
316 PHPAPI void php_win32_docref2_from_error(DWORD error, const char *param1, const char *param2 TSRMLS_DC);
bbf9b6d pierrejoye - #50854, fix build on non windows
pierrejoye authored
317 #endif
e6ea5ca Fix use of EXTERN_C macros
Ard Biesheuvel authored
318 END_EXTERN_C()
88c385e rename php_error_func<n> to php_error_docref and support Wez idea
Marcus Boerger authored
319
d0bb8f5 This makes more sense. (Someone might actually use php_error_docref0() :...
foobar authored
320 #define php_error_docref php_error_docref0
321
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
322 #define zenderror phperror
323 #define zendlex phplex
324
325 #define phpparse zendparse
326 #define phprestart zendrestart
327 #define phpin zendin
328
2154cdd Move memnstr into Zend and make an alias for BC in PHP.
Andrei Zmievski authored
329 #define php_memnstr zend_memnstr
330
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
331 /* functions */
e6ea5ca Fix use of EXTERN_C macros
Ard Biesheuvel authored
332 BEGIN_EXTERN_C()
9a2fc26 - MFH Cleanup exports and allow to overwrite ext registration
Marcus Boerger authored
333 PHPAPI extern int (*php_register_internal_extensions_func)(TSRMLS_D);
334 PHPAPI int php_register_internal_extensions(TSRMLS_D);
335 PHPAPI int php_mergesort(void *base, size_t nmemb, register size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC);
3ff75e5 - don't set php_errormsg on errors that will cause a zend_bailout().
Thies C. Arntzen authored
336 PHPAPI void php_register_pre_request_shutdown(void (*func)(void *), void *userdata);
c06f9e1 COM initialization/deinitialization are done only if necessary
Dmitry Stogov authored
337 PHPAPI void php_com_initialize(TSRMLS_D);
1ac15b2 Kalle Sommer Nielsen Added TSRMLS macros into php_get_current_user()
KalleZ authored
338 PHPAPI char *php_get_current_user(TSRMLS_D);
e6ea5ca Fix use of EXTERN_C macros
Ard Biesheuvel authored
339 END_EXTERN_C()
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
340
a2dd662 Zeev Suraski Move the macro wrappers from the compatibility header to php.h
zsuraski authored
341 /* PHP-named Zend macro wrappers */
342 #define PHP_FN ZEND_FN
58962c7 Missing definition, patch by Steph Fox
Edin Kadribasic authored
343 #define PHP_MN ZEND_MN
a2dd662 Zeev Suraski Move the macro wrappers from the compatibility header to php.h
zsuraski authored
344 #define PHP_NAMED_FUNCTION ZEND_NAMED_FUNCTION
345 #define PHP_FUNCTION ZEND_FUNCTION
8148283 Introduce ZEND_ME() and ZEND_METHOD() macros. Use these for declaring
Andrei Zmievski authored
346 #define PHP_METHOD ZEND_METHOD
a2dd662 Zeev Suraski Move the macro wrappers from the compatibility header to php.h
zsuraski authored
347
1e19ee8 Hannes Magnusson - Fixed incorrect function names on FreeBSD where inet_pton() was named
bjori authored
348 #define PHP_RAW_NAMED_FE ZEND_RAW_NAMED_FE
a2dd662 Zeev Suraski Move the macro wrappers from the compatibility header to php.h
zsuraski authored
349 #define PHP_NAMED_FE ZEND_NAMED_FE
350 #define PHP_FE ZEND_FE
941b065 - MFH: Function deprecation flag
Marcus Boerger authored
351 #define PHP_DEP_FE ZEND_DEP_FE
a2dd662 Zeev Suraski Move the macro wrappers from the compatibility header to php.h
zsuraski authored
352 #define PHP_FALIAS ZEND_FALIAS
941b065 - MFH: Function deprecation flag
Marcus Boerger authored
353 #define PHP_DEP_FALIAS ZEND_DEP_FALIAS
8148283 Introduce ZEND_ME() and ZEND_METHOD() macros. Use these for declaring
Andrei Zmievski authored
354 #define PHP_ME ZEND_ME
854b3eb - Add missing macro
Marcus Boerger authored
355 #define PHP_MALIAS ZEND_MALIAS
47ae4b0 typo fix
Hartmut Holzgraefe authored
356 #define PHP_ABSTRACT_ME ZEND_ABSTRACT_ME
61fc2a9 Add missing macro
Marcus Boerger authored
357 #define PHP_ME_MAPPING ZEND_ME_MAPPING
f1f2a64 Felipe Pena - Added new macro to be used in the end of zend_function_entry declarati...
felipensp authored
358 #define PHP_FE_END ZEND_FE_END
a2dd662 Zeev Suraski Move the macro wrappers from the compatibility header to php.h
zsuraski authored
359
360 #define PHP_MODULE_STARTUP_N ZEND_MODULE_STARTUP_N
361 #define PHP_MODULE_SHUTDOWN_N ZEND_MODULE_SHUTDOWN_N
362 #define PHP_MODULE_ACTIVATE_N ZEND_MODULE_ACTIVATE_N
363 #define PHP_MODULE_DEACTIVATE_N ZEND_MODULE_DEACTIVATE_N
364 #define PHP_MODULE_INFO_N ZEND_MODULE_INFO_N
365
366 #define PHP_MODULE_STARTUP_D ZEND_MODULE_STARTUP_D
367 #define PHP_MODULE_SHUTDOWN_D ZEND_MODULE_SHUTDOWN_D
368 #define PHP_MODULE_ACTIVATE_D ZEND_MODULE_ACTIVATE_D
369 #define PHP_MODULE_DEACTIVATE_D ZEND_MODULE_DEACTIVATE_D
370 #define PHP_MODULE_INFO_D ZEND_MODULE_INFO_D
371
372 /* Compatibility macros */
373 #define PHP_MINIT ZEND_MODULE_STARTUP_N
374 #define PHP_MSHUTDOWN ZEND_MODULE_SHUTDOWN_N
375 #define PHP_RINIT ZEND_MODULE_ACTIVATE_N
376 #define PHP_RSHUTDOWN ZEND_MODULE_DEACTIVATE_N
377 #define PHP_MINFO ZEND_MODULE_INFO_N
60328ea Added automatic module globals management
Dmitry Stogov authored
378 #define PHP_GINIT ZEND_GINIT
379 #define PHP_GSHUTDOWN ZEND_GSHUTDOWN
a2dd662 Zeev Suraski Move the macro wrappers from the compatibility header to php.h
zsuraski authored
380
381 #define PHP_MINIT_FUNCTION ZEND_MODULE_STARTUP_D
382 #define PHP_MSHUTDOWN_FUNCTION ZEND_MODULE_SHUTDOWN_D
383 #define PHP_RINIT_FUNCTION ZEND_MODULE_ACTIVATE_D
384 #define PHP_RSHUTDOWN_FUNCTION ZEND_MODULE_DEACTIVATE_D
385 #define PHP_MINFO_FUNCTION ZEND_MODULE_INFO_D
60328ea Added automatic module globals management
Dmitry Stogov authored
386 #define PHP_GINIT_FUNCTION ZEND_GINIT_FUNCTION
387 #define PHP_GSHUTDOWN_FUNCTION ZEND_GSHUTDOWN_FUNCTION
388
389 #define PHP_MODULE_GLOBALS ZEND_MODULE_GLOBALS
a2dd662 Zeev Suraski Move the macro wrappers from the compatibility header to php.h
zsuraski authored
390
391
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
392 /* Output support */
6f297a3 Zeev Suraski Fix Windows build
zsuraski authored
393 #include "main/php_output.h"
11d24c1 Michael Wallner * implement new output API, fixing some bugs and implementing some featu...
m6w6 authored
394
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
395
696e0a2 Wez Furlong Implement persistent streams. (for pfsockopen).
wez authored
396 #include "php_streams.h"
397 #include "php_memory_streams.h"
398 #include "fopen_wrappers.h"
399
400
341a0d4 andigutmans - Found my bug and managed to move the V_* macros to TSRM
andigutmans authored
401 /* Virtual current working directory support */
4e3b8c6 Fix path
foobar authored
402 #include "tsrm_virtual_cwd.h"
f118d94 andigutmans - This slipped in. Enable VIRTUAL_DIR when we're in ZTS. Eventually it
andigutmans authored
403
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
404 #include "zend_constants.h"
405
0bede91 Rasmus Lerdorf First part of the connection_status work. No user-callable functions
rlerdorf authored
406 /* connection status states */
407 #define PHP_CONNECTION_NORMAL 0
408 #define PHP_CONNECTION_ABORTED 1
409 #define PHP_CONNECTION_TIMEOUT 2
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
410
35b30a8 Add reentrant versions of ctime, localtime, gmtime, asctime.
Sascha Schumann authored
411 #include "php_reentrancy.h"
3e58450 Zeev Suraski * A lot of work on php_ini stuff
zsuraski authored
412
413 /* Finding offsets of elements within structures.
414 * Taken from the Apache code, which in turn, was taken from X code...
415 */
416
15b1e4b Fix XtOffsetOf compile problems if someone has already defined it.
Sterling Hughes authored
417 #ifndef XtOffset
b8d26da MFH Fix for RISC OS
Alex Waugh authored
418 #if defined(CRAY) || (defined(__arm) && !(defined(LINUX) || defined(__riscos__)))
3e58450 Zeev Suraski * A lot of work on php_ini stuff
zsuraski authored
419 #ifdef __STDC__
1159c84 Zeev Suraski - TSRMLS_FETCH work
zsuraski authored
420 #define XtOffset(p_type, field) _Offsetof(p_type, field)
3e58450 Zeev Suraski * A lot of work on php_ini stuff
zsuraski authored
421 #else
422 #ifdef CRAY2
1159c84 Zeev Suraski - TSRMLS_FETCH work
zsuraski authored
423 #define XtOffset(p_type, field) \
3e58450 Zeev Suraski * A lot of work on php_ini stuff
zsuraski authored
424 (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
425
426 #else /* !CRAY2 */
427
1159c84 Zeev Suraski - TSRMLS_FETCH work
zsuraski authored
428 #define XtOffset(p_type, field) ((unsigned int)&(((p_type)NULL)->field))
3e58450 Zeev Suraski * A lot of work on php_ini stuff
zsuraski authored
429
5dbb3a7 Wez Furlong Added files for PHP streams
wez authored
430 #endif /* !CRAY2 */
3e58450 Zeev Suraski * A lot of work on php_ini stuff
zsuraski authored
431 #endif /* __STDC__ */
432 #else /* ! (CRAY || __arm) */
433
1159c84 Zeev Suraski - TSRMLS_FETCH work
zsuraski authored
434 #define XtOffset(p_type, field) \
3e58450 Zeev Suraski * A lot of work on php_ini stuff
zsuraski authored
435 ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
436
437 #endif /* !CRAY */
15b1e4b Fix XtOffsetOf compile problems if someone has already defined it.
Sterling Hughes authored
438 #endif /* ! XtOffset */
3e58450 Zeev Suraski * A lot of work on php_ini stuff
zsuraski authored
439
15b1e4b Fix XtOffsetOf compile problems if someone has already defined it.
Sterling Hughes authored
440 #ifndef XtOffsetOf
3e58450 Zeev Suraski * A lot of work on php_ini stuff
zsuraski authored
441 #ifdef offsetof
1159c84 Zeev Suraski - TSRMLS_FETCH work
zsuraski authored
442 #define XtOffsetOf(s_type, field) offsetof(s_type, field)
3e58450 Zeev Suraski * A lot of work on php_ini stuff
zsuraski authored
443 #else
1159c84 Zeev Suraski - TSRMLS_FETCH work
zsuraski authored
444 #define XtOffsetOf(s_type, field) XtOffset(s_type*, field)
3e58450 Zeev Suraski * A lot of work on php_ini stuff
zsuraski authored
445 #endif
15b1e4b Fix XtOffsetOf compile problems if someone has already defined it.
Sterling Hughes authored
446 #endif /* !XtOffsetOf */
8c3535e -added memory streams
Marcus Boerger authored
447
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
448 #endif
449
450 /*
451 * Local variables:
452 * tab-width: 4
453 * c-basic-offset: 4
454 * End:
78747bd - Don't wrap lines... this is annoying while coding.
Derick Rethans authored
455 * vim600: sw=4 ts=4 fdm=marker
456 * vim<600: sw=4 ts=4
aceaabc Zeev Suraski PHP 4.0
zsuraski authored
457 */
Something went wrong with that request. Please try again.