1573b4602SAndi Gutmans/*
2573b4602SAndi Gutmans   +----------------------------------------------------------------------+
3573b4602SAndi Gutmans   | Zend Engine                                                          |
4573b4602SAndi Gutmans   +----------------------------------------------------------------------+
5a6519d05SXinchen Hui   | Copyright (c) 1998-2018 Zend Technologies Ltd. (http://www.zend.com) |
6573b4602SAndi Gutmans   +----------------------------------------------------------------------+
7d863d52aSSebastian Bergmann   | This source file is subject to version 2.00 of the Zend license,     |
8b7a7b1a6SStanislav Malyshev   | that is bundled with this package in the file LICENSE, and is        |
9f68c7ff2SJames Cox   | available through the world-wide-web at the following url:           |
10d863d52aSSebastian Bergmann   | http://www.zend.com/license/2_00.txt.                                |
11b5b11177SZeev Suraski   | If you did not receive a copy of the Zend license and are unable to  |
12b5b11177SZeev Suraski   | obtain it through the world-wide-web, please send a note to          |
13b5b11177SZeev Suraski   | license@zend.com so we can mail you a copy immediately.              |
14573b4602SAndi Gutmans   +----------------------------------------------------------------------+
159afce019SZeev Suraski   | Authors: Andi Gutmans <andi@php.net>                                 |
169afce019SZeev Suraski   |          Zeev Suraski <zeev@php.net>                                 |
17573b4602SAndi Gutmans   +----------------------------------------------------------------------+
18573b4602SAndi Gutmans*/
19573b4602SAndi Gutmans
20b982307dSSascha Schumann#ifndef ZEND_H
21b982307dSSascha Schumann#define ZEND_H
22573b4602SAndi Gutmans
23b5ce6df0SChristoph M. Becker#define ZEND_VERSION "3.3.26-dev"
24573b4602SAndi Gutmans
2590d916c4SAndrea Faulds#define ZEND_ENGINE_3
268a0c756cSAndi Gutmans
2761d37e05SDmitry Stogov#include "zend_types.h"
2843b02e16SNikita Popov#include "zend_errors.h"
2943b02e16SNikita Popov#include "zend_alloc.h"
3061d37e05SDmitry Stogov#include "zend_llist.h"
3161d37e05SDmitry Stogov#include "zend_string.h"
3295b4aa52SXinchen Hui#include "zend_hash.h"
3361d37e05SDmitry Stogov#include "zend_ast.h"
3461d37e05SDmitry Stogov#include "zend_gc.h"
3561d37e05SDmitry Stogov#include "zend_variables.h"
3661d37e05SDmitry Stogov#include "zend_iterators.h"
3761d37e05SDmitry Stogov#include "zend_stream.h"
381b29e0caSNikita Popov#include "zend_smart_str_public.h"
395fc9aa9aSNikita Popov#include "zend_smart_string_public.h"
40c8706331SDmitry Stogov#include "zend_signal.h"
41b87bac78SZeev Suraski
424042f543SDmitry Stogov#define HANDLE_BLOCK_INTERRUPTIONS()		ZEND_SIGNAL_BLOCK_INTERRUPTIONS()
434042f543SDmitry Stogov#define HANDLE_UNBLOCK_INTERRUPTIONS()		ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS()
446bb0ac97SMatt Wilmas
45e112f6a0SAnatol Belski#define INTERNAL_FUNCTION_PARAMETERS zend_execute_data *execute_data, zval *return_value
46e112f6a0SAnatol Belski#define INTERNAL_FUNCTION_PARAM_PASSTHRU execute_data, return_value
47ea85451bSDmitry Stogov
48ea85451bSDmitry Stogov#define USED_RET() \
49bd9a2346SDmitry Stogov	(!EX(prev_execute_data) || \
50bd9a2346SDmitry Stogov	 !ZEND_USER_CODE(EX(prev_execute_data)->func->common.type) || \
515faedf5bSNikita Popov	 (EX(prev_execute_data)->opline->result_type != IS_UNUSED))
52573b4602SAndi Gutmans
5376081df1SAnatol Belski#ifdef ZEND_ENABLE_STATIC_TSRMLS_CACHE
5476081df1SAnatol Belski#define ZEND_TSRMG TSRMG_STATIC
55af3ca745SAnatol Belski#define ZEND_TSRMLS_CACHE_EXTERN() TSRMLS_CACHE_EXTERN()
56af3ca745SAnatol Belski#define ZEND_TSRMLS_CACHE_DEFINE() TSRMLS_CACHE_DEFINE()
57af3ca745SAnatol Belski#define ZEND_TSRMLS_CACHE_UPDATE() TSRMLS_CACHE_UPDATE()
588aeffdd7SAnatol Belski#define ZEND_TSRMLS_CACHE TSRMLS_CACHE
5976081df1SAnatol Belski#else
6076081df1SAnatol Belski#define ZEND_TSRMG TSRMG
61af3ca745SAnatol Belski#define ZEND_TSRMLS_CACHE_EXTERN()
62af3ca745SAnatol Belski#define ZEND_TSRMLS_CACHE_DEFINE()
63af3ca745SAnatol Belski#define ZEND_TSRMLS_CACHE_UPDATE()
648aeffdd7SAnatol Belski#define ZEND_TSRMLS_CACHE
6576081df1SAnatol Belski#endif
6676081df1SAnatol Belski
671ac15293SNikita PopovZEND_TSRMLS_CACHE_EXTERN()
6876081df1SAnatol Belski
6961d37e05SDmitry Stogov#ifdef HAVE_NORETURN
7030dcb2d6SDmitry Stogov# ifdef ZEND_NORETURN_ALIAS
7116160386SDmitry StogovZEND_COLD void zend_error_noreturn(int type, const char *format, ...) ZEND_NORETURN ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
7257496c38SDmitry Stogov# else
7316160386SDmitry StogovZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
7461d37e05SDmitry Stogov# endif
75cec2347cSDmitry Stogov#else
7661d37e05SDmitry Stogov# define zend_error_noreturn zend_error
77cec2347cSDmitry Stogov#endif
78cec2347cSDmitry Stogov
795b98a092SStanislav Malyshevstruct _zend_serialize_data;
805b98a092SStanislav Malyshevstruct _zend_unserialize_data;
815b98a092SStanislav Malyshev
825b98a092SStanislav Malyshevtypedef struct _zend_serialize_data zend_serialize_data;
835b98a092SStanislav Malyshevtypedef struct _zend_unserialize_data zend_unserialize_data;
845b98a092SStanislav Malyshev
8561d37e05SDmitry Stogovtypedef struct _zend_trait_method_reference {
86b7a7b1a6SStanislav Malyshev	zend_string *method_name;
87f4cfaf36SDmitry Stogov	zend_string *class_name;
8861d37e05SDmitry Stogov} zend_trait_method_reference;
89cd6415f1SStefan Marr
9061d37e05SDmitry Stogovtypedef struct _zend_trait_precedence {
9185ee47edSDmitry Stogov	zend_trait_method_reference trait_method;
9285ee47edSDmitry Stogov	uint32_t num_excludes;
9385ee47edSDmitry Stogov	zend_string *exclude_class_names[1];
9461d37e05SDmitry Stogov} zend_trait_precedence;
95cd6415f1SStefan Marr
9661d37e05SDmitry Stogovtypedef struct _zend_trait_alias {
9785ee47edSDmitry Stogov	zend_trait_method_reference trait_method;
98b7a7b1a6SStanislav Malyshev
99cd6415f1SStefan Marr	/**
100cd6415f1SStefan Marr	* name for method to be added
101cd6415f1SStefan Marr	*/
102f4cfaf36SDmitry Stogov	zend_string *alias;
103b7a7b1a6SStanislav Malyshev
104cd6415f1SStefan Marr	/**
105cd6415f1SStefan Marr	* modifiers to be set on trait method
106cd6415f1SStefan Marr	*/
1076f9f0bf2SAnatol Belski	uint32_t modifiers;
10861d37e05SDmitry Stogov} zend_trait_alias;
109cd6415f1SStefan Marr
110573b4602SAndi Gutmansstruct _zend_class_entry {
111573b4602SAndi Gutmans	char type;
112f4cfaf36SDmitry Stogov	zend_string *name;
113637a4042SMarcus Boerger	struct _zend_class_entry *parent;
114fb6976e4SAndi Gutmans	int refcount;
1156f9f0bf2SAnatol Belski	uint32_t ce_flags;
116573b4602SAndi Gutmans
117ee552b62SDmitry Stogov	int default_properties_count;
118ee552b62SDmitry Stogov	int default_static_members_count;
119f4cfaf36SDmitry Stogov	zval *default_properties_table;
120f4cfaf36SDmitry Stogov	zval *default_static_members_table;
121f4cfaf36SDmitry Stogov	zval *static_members_table;
122ee552b62SDmitry Stogov	HashTable function_table;
123ee552b62SDmitry Stogov	HashTable properties_info;
1244cb97fa3SAndi Gutmans	HashTable constants_table;
125573b4602SAndi Gutmans
126b87194e0SAndi Gutmans	union _zend_function *constructor;
12773b159e0SAndi Gutmans	union _zend_function *destructor;
12829ea3da2SAndi Gutmans	union _zend_function *clone;
129d8651c82SStanislav Malyshev	union _zend_function *__get;
130d8651c82SStanislav Malyshev	union _zend_function *__set;
131345e0255SDmitry Stogov	union _zend_function *__unset;
132345e0255SDmitry Stogov	union _zend_function *__isset;
133d8651c82SStanislav Malyshev	union _zend_function *__call;
134b20ed0d2SDmitry Stogov	union _zend_function *__callstatic;
135637a4042SMarcus Boerger	union _zend_function *__tostring;
1361e752ce9SSara Golemon	union _zend_function *__debugInfo;
137757da1eeSMarcus Boerger	union _zend_function *serialize_func;
138757da1eeSMarcus Boerger	union _zend_function *unserialize_func;
139b87194e0SAndi Gutmans
140583616deSChristoph M. Becker	/* allocated only if class implements Iterator or IteratorAggregate interface */
1417d4e18b0SDmitry Stogov	zend_class_iterator_funcs *iterator_funcs_ptr;
14225aa8b71SMarcus Boerger
143573b4602SAndi Gutmans	/* handlers */
1445e8977bdSDmitry Stogov	union {
1455e8977bdSDmitry Stogov		zend_object* (*create_object)(zend_class_entry *class_type);
1465e8977bdSDmitry Stogov		int (*interface_gets_implemented)(zend_class_entry *iface, zend_class_entry *class_type); /* a class implements this interface */
1475e8977bdSDmitry Stogov	};
148bdeb220fSAnatol Belski	zend_object_iterator *(*get_iterator)(zend_class_entry *ce, zval *object, int by_ref);
149bdeb220fSAnatol Belski	union _zend_function *(*get_static_method)(zend_class_entry *ce, zend_string* method);
150d8651c82SStanislav Malyshev
1515b98a092SStanislav Malyshev	/* serializer callbacks */
152bdeb220fSAnatol Belski	int (*serialize)(zval *object, unsigned char **buffer, size_t *buf_len, zend_serialize_data *data);
153bdeb220fSAnatol Belski	int (*unserialize)(zval *object, zend_class_entry *ce, const unsigned char *buf, size_t buf_len, zend_unserialize_data *data);
1545b98a092SStanislav Malyshev
1556f9f0bf2SAnatol Belski	uint32_t num_interfaces;
156ee552b62SDmitry Stogov	uint32_t num_traits;
157ee552b62SDmitry Stogov	zend_class_entry **interfaces;
158b7a7b1a6SStanislav Malyshev
159cd6415f1SStefan Marr	zend_class_entry **traits;
160cd6415f1SStefan Marr	zend_trait_alias **trait_aliases;
161cd6415f1SStefan Marr	zend_trait_precedence **trait_precedences;
16226dd8492SZeev Suraski
163f2df6a4aSDmitry Stogov	union {
164f2df6a4aSDmitry Stogov		struct {
165f4cfaf36SDmitry Stogov			zend_string *filename;
1666f9f0bf2SAnatol Belski			uint32_t line_start;
1676f9f0bf2SAnatol Belski			uint32_t line_end;
168f4cfaf36SDmitry Stogov			zend_string *doc_comment;
169f2df6a4aSDmitry Stogov		} user;
170f2df6a4aSDmitry Stogov		struct {
171f2df6a4aSDmitry Stogov			const struct _zend_function_entry *builtin_functions;
172f2df6a4aSDmitry Stogov			struct _zend_module_entry *module;
173f2df6a4aSDmitry Stogov		} internal;
174f2df6a4aSDmitry Stogov	} info;
175573b4602SAndi Gutmans};
176573b4602SAndi Gutmans
1771250c43aSZeev Suraskitypedef struct _zend_utility_functions {
178b204b3abSAnatol Belski	void (*error_function)(int type, const char *error_filename, const uint32_t error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
179c3e3c98eSAnatol Belski	size_t (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
180c3e3c98eSAnatol Belski	size_t (*write_function)(const char *str, size_t str_length);
1812fa8d67aSDmitry Stogov	FILE *(*fopen_function)(const char *filename, zend_string **opened_path);
182bdeb220fSAnatol Belski	void (*message_handler)(zend_long message, const void *data);
18388d7ca44SDmitry Stogov	zval *(*get_configuration_directive)(zend_string *name);
184bdeb220fSAnatol Belski	void (*ticks_function)(int ticks);
185bdeb220fSAnatol Belski	void (*on_timeout)(int seconds);
186bdeb220fSAnatol Belski	int (*stream_open_function)(const char *filename, zend_file_handle *handle);
1875fc9aa9aSNikita Popov	void (*printf_to_smart_string_function)(smart_string *buf, const char *format, va_list ap);
1885fc9aa9aSNikita Popov	void (*printf_to_smart_str_function)(smart_str *buf, const char *format, va_list ap);
189bdeb220fSAnatol Belski	char *(*getenv_function)(char *name, size_t name_len);
19049d9b301SAnatol Belski	zend_string *(*resolve_path_function)(const char *filename, size_t filename_len);
191573b4602SAndi Gutmans} zend_utility_functions;
192573b4602SAndi Gutmans
1931250c43aSZeev Suraskitypedef struct _zend_utility_values {
1949baad804SZeev Suraski	char *import_use_extension;
195b204b3abSAnatol Belski	uint32_t import_use_extension_length;
196cfad3c66SSebastian Bergmann	zend_bool html_errors;
197573b4602SAndi Gutmans} zend_utility_values;
198573b4602SAndi Gutmans
199944d2c65SAnatol Belskitypedef int (*zend_write_func_t)(const char *str, size_t str_length);
2005dba4774SZeev Suraski
201ef4fe54fSZeev Suraski#define zend_bailout()		_zend_bailout(__FILE__, __LINE__)
202931ebe08SZeev Suraski
203931ebe08SZeev Suraski#define zend_try												\
204931ebe08SZeev Suraski	{															\
20510afe5d9SRasmus Lerdorf		JMP_BUF *__orig_bailout = EG(bailout);					\
20610afe5d9SRasmus Lerdorf		JMP_BUF __bailout;										\
207931ebe08SZeev Suraski																\
208806bc4e1SDmitry Stogov		EG(bailout) = &__bailout;								\
20910afe5d9SRasmus Lerdorf		if (SETJMP(__bailout)==0) {
210931ebe08SZeev Suraski#define zend_catch												\
21114f6b914SDmitry Stogov		} else {												\
212806bc4e1SDmitry Stogov			EG(bailout) = __orig_bailout;
213931ebe08SZeev Suraski#define zend_end_try()											\
21414f6b914SDmitry Stogov		}														\
215806bc4e1SDmitry Stogov		EG(bailout) = __orig_bailout;							\
216931ebe08SZeev Suraski	}
217b4892511SJani Taskinen#define zend_first_try		EG(bailout)=NULL;	zend_try
218931ebe08SZeev Suraski
2193a3f95a3SHartmut HolzgraefeBEGIN_EXTERN_C()
220bdeb220fSAnatol Belskiint zend_startup(zend_utility_functions *utility_functions, char **extensions);
221bdeb220fSAnatol Belskivoid zend_shutdown(void);
222bdeb220fSAnatol Belskivoid zend_register_standard_ini_entries(void);
223b4903aefSDmitry Stogovint zend_post_startup(void);
22461d37e05SDmitry Stogovvoid zend_set_utility_values(zend_utility_values *utility_values);
22561d37e05SDmitry Stogov
226ec31924cSRemi ColletZEND_API ZEND_COLD void _zend_bailout(const char *filename, uint32_t lineno);
22761d37e05SDmitry Stogov
2285fc9aa9aSNikita PopovZEND_API size_t zend_vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap);
229c7742e28SNikita PopovZEND_API size_t zend_spprintf(char **message, size_t max_len, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4);
2305fc9aa9aSNikita PopovZEND_API zend_string *zend_vstrpprintf(size_t max_len, const char *format, va_list ap);
231c7742e28SNikita PopovZEND_API zend_string *zend_strpprintf(size_t max_len, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
232c7742e28SNikita Popov
23326f8fc83SNikita Popov/* Same as zend_spprintf and zend_strpprintf, without checking of format validity.
23426f8fc83SNikita Popov * For use with custom printf specifiers such as %H. */
23526f8fc83SNikita PopovZEND_API size_t zend_spprintf_unchecked(char **message, size_t max_len, const char *format, ...);
23626f8fc83SNikita PopovZEND_API zend_string *zend_strpprintf_unchecked(size_t max_len, const char *format, ...);
23726f8fc83SNikita Popov
238931ebe08SZeev SuraskiZEND_API char *get_zend_version(void);
239bdeb220fSAnatol BelskiZEND_API int zend_make_printable_zval(zval *expr, zval *expr_copy);
240bdeb220fSAnatol BelskiZEND_API size_t zend_print_zval(zval *expr, int indent);
241bdeb220fSAnatol BelskiZEND_API void zend_print_zval_r(zval *expr, int indent);
2421b29e0caSNikita PopovZEND_API zend_string *zend_print_zval_r_to_str(zval *expr, int indent);
243bdeb220fSAnatol BelskiZEND_API void zend_print_flat_zval_r(zval *expr);
2447eb045d3SDmitry Stogov
2457eb045d3SDmitry Stogov#define zend_print_variable(var) \
2467eb045d3SDmitry Stogov	zend_print_zval((var), 0)
2477eb045d3SDmitry Stogov
24871af54e5SDmitry StogovZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
249931ebe08SZeev Suraski
250bdeb220fSAnatol BelskiZEND_API void zend_activate(void);
251bdeb220fSAnatol BelskiZEND_API void zend_deactivate(void);
252bdeb220fSAnatol BelskiZEND_API void zend_call_destructors(void);
253bdeb220fSAnatol BelskiZEND_API void zend_activate_modules(void);
254bdeb220fSAnatol BelskiZEND_API void zend_deactivate_modules(void);
255bdeb220fSAnatol BelskiZEND_API void zend_post_deactivate_modules(void);
2560b7a9ceaSZeev Suraski
2570e08845eSZeev SuraskiZEND_API void free_estring(char **str_p);
2581727c6a2SHartmut HolzgraefeEND_EXTERN_C()
259c17c7a2bSZeev Suraski
260573b4602SAndi Gutmans/* output support */
261573b4602SAndi Gutmans#define ZEND_WRITE(str, str_len)		zend_write((str), (str_len))
262d3d02fbcSDmitry Stogov#define ZEND_WRITE_EX(str, str_len)		write_func((str), (str_len))
263573b4602SAndi Gutmans#define ZEND_PUTS(str)					zend_write((str), strlen((str)))
264d3d02fbcSDmitry Stogov#define ZEND_PUTS_EX(str)				write_func((str), strlen((str)))
2652e6d8305SArunSK#define ZEND_PUTC(c)					zend_write(&(c), 1)
266573b4602SAndi Gutmans
2671aa2c5c0SZeev SuraskiBEGIN_EXTERN_C()
268c3e3c98eSAnatol Belskiextern ZEND_API size_t (*zend_printf)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
2695dba4774SZeev Suraskiextern ZEND_API zend_write_func_t zend_write;
2702fa8d67aSDmitry Stogovextern ZEND_API FILE *(*zend_fopen)(const char *filename, zend_string **opened_path);
271bdeb220fSAnatol Belskiextern ZEND_API void (*zend_ticks_function)(int ticks);
272d0460d8fSDmitry Stogovextern ZEND_API void (*zend_interrupt_function)(zend_execute_data *execute_data);
273b204b3abSAnatol Belskiextern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint32_t error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
274bdeb220fSAnatol Belskiextern ZEND_API void (*zend_on_timeout)(int seconds);
275bdeb220fSAnatol Belskiextern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle);
2765fc9aa9aSNikita Popovextern void (*zend_printf_to_smart_string)(smart_string *buf, const char *format, va_list ap);
2775fc9aa9aSNikita Popovextern void (*zend_printf_to_smart_str)(smart_str *buf, const char *format, va_list ap);
278bdeb220fSAnatol Belskiextern ZEND_API char *(*zend_getenv)(char *name, size_t name_len);
27949d9b301SAnatol Belskiextern ZEND_API zend_string *(*zend_resolve_path)(const char *filename, size_t filename_len);
280b4903aefSDmitry Stogovextern ZEND_API int (*zend_post_startup_cb)(void);
28167f69743SZeev Suraski
28271af54e5SDmitry StogovZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
28316160386SDmitry StogovZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
28416160386SDmitry StogovZEND_API ZEND_COLD void zend_type_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2);
28516160386SDmitry StogovZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
28612ee17d5SDavey ShafikZEND_API ZEND_COLD void zend_internal_argument_count_error(zend_bool throw_exception, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
28767f69743SZeev Suraski
288e549ebdbSDmitry StogovZEND_COLD void zenderror(const char *error);
289573b4602SAndi Gutmans
2900ee65254SAndi Gutmans/* The following #define is used for code duality in PHP for Engine 1 & 2 */
2919760fdcbSAndi Gutmans#define ZEND_STANDARD_CLASS_DEF_PTR zend_standard_class_def
29292dd5e61SStanislav Malyshevextern ZEND_API zend_class_entry *zend_standard_class_def;
293e801a99aSZeev Suraskiextern ZEND_API zend_utility_values zend_uv;
294213d0e2fSAndi Gutmans
295f81b7df6SRemi Collet/* If DTrace is available and enabled */
296f81b7df6SRemi Colletextern ZEND_API zend_bool zend_dtrace_enabled;
2979baad804SZeev SuraskiEND_EXTERN_C()
298573b4602SAndi Gutmans
299573b4602SAndi Gutmans#define ZEND_UV(name) (zend_uv.name)
300573b4602SAndi Gutmans
301fc173b6aSSam RubyBEGIN_EXTERN_C()
302bdeb220fSAnatol BelskiZEND_API void zend_message_dispatcher(zend_long message, const void *data);
303fc173b6aSSam Ruby
30488d7ca44SDmitry StogovZEND_API zval *zend_get_configuration_directive(zend_string *name);
3051727c6a2SHartmut HolzgraefeEND_EXTERN_C()
30656251a72SZeev Suraski
307573b4602SAndi Gutmans/* Messages for applications of Zend */
308968d2c5bSZeev Suraski#define ZMSG_FAILED_INCLUDE_FOPEN		1L
309968d2c5bSZeev Suraski#define ZMSG_FAILED_REQUIRE_FOPEN		2L
310968d2c5bSZeev Suraski#define ZMSG_FAILED_HIGHLIGHT_FOPEN		3L
311968d2c5bSZeev Suraski#define ZMSG_MEMORY_LEAK_DETECTED		4L
312968d2c5bSZeev Suraski#define ZMSG_MEMORY_LEAK_REPEATED		5L
313968d2c5bSZeev Suraski#define ZMSG_LOG_SCRIPT_NAME			6L
31449c4866aSZeev Suraski#define ZMSG_MEMORY_LEAKS_GRAND_TOTAL	7L
315573b4602SAndi Gutmans
316fd0d44f0SFelipe Penatypedef enum {
317fd0d44f0SFelipe Pena	EH_NORMAL = 0,
318fd0d44f0SFelipe Pena	EH_THROW
319fd0d44f0SFelipe Pena} zend_error_handling_t;
320fd0d44f0SFelipe Pena
3213f7a4b7eSMarcus Boergertypedef struct {
3223f7a4b7eSMarcus Boerger	zend_error_handling_t  handling;
3233f7a4b7eSMarcus Boerger	zend_class_entry       *exception;
324f4cfaf36SDmitry Stogov	zval                   user_handler;
3253f7a4b7eSMarcus Boerger} zend_error_handling;
3263f7a4b7eSMarcus Boerger
327bdeb220fSAnatol BelskiZEND_API void zend_save_error_handling(zend_error_handling *current);
328bdeb220fSAnatol BelskiZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling, zend_class_entry *exception_class, zend_error_handling *current);
329bdeb220fSAnatol BelskiZEND_API void zend_restore_error_handling(zend_error_handling *saved);
3303f7a4b7eSMarcus Boerger
331b4dba12dSStanislav Malyshev#define DEBUG_BACKTRACE_PROVIDE_OBJECT (1<<0)
332b4dba12dSStanislav Malyshev#define DEBUG_BACKTRACE_IGNORE_ARGS    (1<<1)
333b4dba12dSStanislav Malyshev
33461d37e05SDmitry Stogov#include "zend_object_handlers.h"
33561d37e05SDmitry Stogov#include "zend_operators.h"
33661d37e05SDmitry Stogov
337b982307dSSascha Schumann#endif /* ZEND_H */
338009025e0SStig S. Bakken
339009025e0SStig S. Bakken/*
340009025e0SStig S. Bakken * Local variables:
341009025e0SStig S. Bakken * tab-width: 4
342009025e0SStig S. Bakken * c-basic-offset: 4
343333406bdSfoobar * indent-tabs-mode: t
344009025e0SStig S. Bakken * End:
345bc5811f3SAnatol Belski * vim600: sw=4 ts=4 fdm=marker
346bc5811f3SAnatol Belski * vim<600: sw=4 ts=4
347009025e0SStig S. Bakken */
348