Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 1828 lines (1655 sloc) 94.365 kb
573b4602 »
1999-04-07 Zend Library
1 /*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
35e83d2a »
2010-01-05 sed -i "s#1998-2009#1998-2010#g" **/*.c **/*.h **/*.php
5 | Copyright (c) 1998-2010 Zend Technologies Ltd. (http://www.zend.com) |
573b4602 »
1999-04-07 Zend Library
6 +----------------------------------------------------------------------+
d863d52a »
2001-12-11 Update headers.
7 | This source file is subject to version 2.00 of the Zend license, |
2e5d0a3a »
2006-02-21 WS
8 | that is bundled with this package in the file LICENSE, and is |
f68c7ff2 »
2003-06-10 updating license information in the headers.
9 | available through the world-wide-web at the following url: |
d863d52a »
2001-12-11 Update headers.
10 | http://www.zend.com/license/2_00.txt. |
b5b11177 »
1999-07-16 License update
11 | If you did not receive a copy of the Zend license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@zend.com so we can mail you a copy immediately. |
573b4602 »
1999-04-07 Zend Library
14 +----------------------------------------------------------------------+
15 | Authors: Andi Gutmans <andi@zend.com> |
16 | Zeev Suraski <zeev@zend.com> |
58f88057 »
2001-07-09 Adding new parameter parsing API.
17 | Andrei Zmievski <andrei@php.net> |
573b4602 »
1999-04-07 Zend Library
18 +----------------------------------------------------------------------+
19 */
20
333406bd »
2003-02-01 - Added some missing CVS $Id$ tags, headers and footers.
21 /* $Id$ */
b5b11177 »
1999-07-16 License update
22
b982307d »
2000-07-02 Change header protection macros to conform to standard.
23 #ifndef ZEND_API_H
24 #define ZEND_API_H
573b4602 »
1999-04-07 Zend Library
25
7080fa5b »
2001-02-26 - Rename modules.h to zend_modules.h
26 #include "zend_modules.h"
573b4602 »
1999-04-07 Zend Library
27 #include "zend_list.h"
5dba4774 »
2000-03-25 - Some header dependencies cleanup
28 #include "zend_operators.h"
29 #include "zend_variables.h"
df74f1df »
2000-06-13 Add optional support for C0x inline semantics.
30 #include "zend_execute.h"
573b4602 »
1999-04-07 Zend Library
31
0450ab94 »
2002-05-20 MFZE1 (Expose more C++ APIs)
32
33 BEGIN_EXTERN_C()
e9d126a7 »
2000-03-29 - Make sure zend_API.h has Zend'ish versions of the ZEND macros so that
34
f8bbafd6 »
2003-08-03 ntroduce infrastructure for supplying information about arguments,
35 typedef struct _zend_function_entry {
8146078f »
2007-09-27 Improved memory usage by movig constants to read only memory. (Dmitry…
36 const char *fname;
f8bbafd6 »
2003-08-03 ntroduce infrastructure for supplying information about arguments,
37 void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
8146078f »
2007-09-27 Improved memory usage by movig constants to read only memory. (Dmitry…
38 const struct _zend_arg_info *arg_info;
f8bbafd6 »
2003-08-03 ntroduce infrastructure for supplying information about arguments,
39 zend_uint num_args;
40 zend_uint flags;
41 } zend_function_entry;
42
72dfe666 »
2008-07-24 LSB parent/self forwarding
43 typedef struct _zend_fcall_info {
44 size_t size;
45 HashTable *function_table;
46 zval *function_name;
47 HashTable *symbol_table;
48 zval **retval_ptr_ptr;
49 zend_uint param_count;
50 zval ***params;
e5454b35 »
2008-11-27 Fixed bug #46409 (__invoke method called outside of object context wh…
51 zval *object_ptr;
72dfe666 »
2008-07-24 LSB parent/self forwarding
52 zend_bool no_separation;
53 } zend_fcall_info;
54
55 typedef struct _zend_fcall_info_cache {
56 zend_bool initialized;
57 zend_function *function_handler;
58 zend_class_entry *calling_scope;
59 zend_class_entry *called_scope;
e5454b35 »
2008-11-27 Fixed bug #46409 (__invoke method called outside of object context wh…
60 zval *object_ptr;
72dfe666 »
2008-07-24 LSB parent/self forwarding
61 } zend_fcall_info_cache;
62
0497e208 »
2009-05-25 - Fixed macro (thanks Kalle)
63 #define ZEND_NS_NAME(ns, name) ns"\\"name
1e267607 »
2008-05-12 Added API to use namesapces in internal extensions
64
f8bbafd6 »
2003-08-03 ntroduce infrastructure for supplying information about arguments,
65 #define ZEND_FN(name) zif_##name
5575afef »
2006-03-04 - Separate ZEND_METHOD from ZEND_FUNCTION
66 #define ZEND_MN(name) zim_##name
f8bbafd6 »
2003-08-03 ntroduce infrastructure for supplying information about arguments,
67 #define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
68 #define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(ZEND_FN(name))
5575afef »
2006-03-04 - Separate ZEND_METHOD from ZEND_FUNCTION
69 #define ZEND_METHOD(classname, name) ZEND_NAMED_FUNCTION(ZEND_MN(classname##_##name))
f8bbafd6 »
2003-08-03 ntroduce infrastructure for supplying information about arguments,
70
1c2512dd »
2003-08-24 - Add fn_flag ZEND_ACC_ALIAS
71 #define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (zend_uint) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags },
72
460360ae »
2006-12-20 MFB:
73 #define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags) { zend_name, name, arg_info, (zend_uint) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags },
74 #define ZEND_RAW_NAMED_FE(zend_name, name, arg_info) ZEND_RAW_FENTRY(#zend_name, name, arg_info, 0)
75
1c2512dd »
2003-08-24 - Add fn_flag ZEND_ACC_ALIAS
76 #define ZEND_NAMED_FE(zend_name, name, arg_info) ZEND_FENTRY(zend_name, name, arg_info, 0)
77 #define ZEND_FE(name, arg_info) ZEND_FENTRY(name, ZEND_FN(name), arg_info, 0)
8a4c8e8d »
2006-02-24 - Add macros to mark functions/alias functions as deprecated
78 #define ZEND_DEP_FE(name, arg_info) ZEND_FENTRY(name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
cec053f7 »
2003-08-24 Don't identify alias'ed functions
79 #define ZEND_FALIAS(name, alias, arg_info) ZEND_FENTRY(name, ZEND_FN(alias), arg_info, 0)
8a4c8e8d »
2006-02-24 - Add macros to mark functions/alias functions as deprecated
80 #define ZEND_DEP_FALIAS(name, alias, arg_info) ZEND_FENTRY(name, ZEND_FN(alias), arg_info, ZEND_ACC_DEPRECATED)
6c0c9f09 »
2006-05-09 - Methods have flags
81 #define ZEND_NAMED_ME(zend_name, name, arg_info, flags) ZEND_FENTRY(zend_name, name, arg_info, flags)
5575afef »
2006-03-04 - Separate ZEND_METHOD from ZEND_FUNCTION
82 #define ZEND_ME(classname, name, arg_info, flags) ZEND_FENTRY(name, ZEND_MN(classname##_##name), arg_info, flags)
1c2512dd »
2003-08-24 - Add fn_flag ZEND_ACC_ALIAS
83 #define ZEND_ABSTRACT_ME(classname, name, arg_info) ZEND_FENTRY(name, NULL, arg_info, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
33cdc9ed »
2004-04-12 Fix order of macro parameter (synch with other macros)
84 #define ZEND_MALIAS(classname, name, alias, arg_info, flags) \
5575afef »
2006-03-04 - Separate ZEND_METHOD from ZEND_FUNCTION
85 ZEND_FENTRY(name, ZEND_MN(classname##_##alias), arg_info, flags)
6c0c9f09 »
2006-05-09 - Methods have flags
86 #define ZEND_ME_MAPPING(name, func_name, arg_types, flags) ZEND_NAMED_ME(name, ZEND_FN(func_name), arg_types, flags)
f8bbafd6 »
2003-08-03 ntroduce infrastructure for supplying information about arguments,
87
1e267607 »
2008-05-12 Added API to use namesapces in internal extensions
88 #define ZEND_NS_FENTRY(ns, zend_name, name, arg_info, flags) ZEND_RAW_FENTRY(ZEND_NS_NAME(ns, #zend_name), name, arg_info, flags)
89
90 #define ZEND_NS_RAW_FENTRY(ns, zend_name, name, arg_info, flags) ZEND_RAW_FENTRY(ZEND_NS_NAME(ns, zend_name), name, arg_info, flags)
91 #define ZEND_NS_RAW_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_RAW_FENTRY(ns, #zend_name, name, arg_info, 0)
92
b40e882e »
2009-07-28 - Fixed bug #48971 (Missing ZEND_NS_NAMED_FE macro)
93 #define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, #zend_name, name, arg_info, 0)
1e267607 »
2008-05-12 Added API to use namesapces in internal extensions
94 #define ZEND_NS_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, 0)
95 #define ZEND_NS_DEP_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
96 #define ZEND_NS_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, 0)
97 #define ZEND_NS_DEP_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, ZEND_ACC_DEPRECATED)
98
0f1209ab »
2006-02-21 Portable unicode string API:
99 #define ZEND_ARG_INFO(pass_by_ref, name) { {#name}, sizeof(#name)-1, {NULL}, 0, 0, 0, pass_by_ref, 0, 0 },
100 #define ZEND_ARG_PASS_INFO(pass_by_ref) { {NULL}, 0, {NULL}, 0, 0, 0, pass_by_ref, 0, 0 },
101 #define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) { {#name}, sizeof(#name)-1, {#classname}, sizeof(#classname)-1, 0, allow_null, pass_by_ref, 0, 0 },
102 #define ZEND_ARG_ARRAY_INFO(pass_by_ref, name, allow_null) { {#name}, sizeof(#name)-1, {NULL}, 0, 1, allow_null, pass_by_ref, 0, 0 },
7086634a »
2004-02-25 - Improve ARG_INFO() macros to support supplying required_num_args
103 #define ZEND_BEGIN_ARG_INFO_EX(name, pass_rest_by_reference, return_reference, required_num_args) \
43791516 »
2008-11-17 - Added 'static' into ZEND_BEGIN_ARG_INFO_EX macro (again!)
104 static const zend_arg_info name[] = { \
0f1209ab »
2006-02-21 Portable unicode string API:
105 { {NULL}, 0, {NULL}, 0, 0, 0, pass_rest_by_reference, return_reference, required_num_args },
e7e0f7d4 »
2004-02-12 - Check return-by-reference bit when implementing interface prototypes
106 #define ZEND_BEGIN_ARG_INFO(name, pass_rest_by_reference) \
aedbdb08 »
2005-06-16 Allowed return by refrence from internal functions
107 ZEND_BEGIN_ARG_INFO_EX(name, pass_rest_by_reference, ZEND_RETURN_VALUE, -1)
f8bbafd6 »
2003-08-03 ntroduce infrastructure for supplying information about arguments,
108 #define ZEND_END_ARG_INFO() };
342c6e0b »
1999-04-18 Whatnot:
109
8b6f848c »
2001-08-10 - Merge from Engine 1
110 /* Name macros */
111 #define ZEND_MODULE_STARTUP_N(module) zm_startup_##module
112 #define ZEND_MODULE_SHUTDOWN_N(module) zm_shutdown_##module
113 #define ZEND_MODULE_ACTIVATE_N(module) zm_activate_##module
114 #define ZEND_MODULE_DEACTIVATE_N(module) zm_deactivate_##module
6535933f »
2004-03-16 - Replaced the exec_finished hook by the zend_post_deactive hook for
115 #define ZEND_MODULE_POST_ZEND_DEACTIVATE_N(module) zm_post_zend_deactivate_##module
8b6f848c »
2001-08-10 - Merge from Engine 1
116 #define ZEND_MODULE_INFO_N(module) zm_info_##module
2cbde064 »
2006-06-13 Added automatic module globals management.
117 #define ZEND_MODULE_GLOBALS_CTOR_N(module) zm_globals_ctor_##module
118 #define ZEND_MODULE_GLOBALS_DTOR_N(module) zm_globals_dtor_##module
342c6e0b »
1999-04-18 Whatnot:
119
8b6f848c »
2001-08-10 - Merge from Engine 1
120 /* Declaration macros */
121 #define ZEND_MODULE_STARTUP_D(module) int ZEND_MODULE_STARTUP_N(module)(INIT_FUNC_ARGS)
122 #define ZEND_MODULE_SHUTDOWN_D(module) int ZEND_MODULE_SHUTDOWN_N(module)(SHUTDOWN_FUNC_ARGS)
123 #define ZEND_MODULE_ACTIVATE_D(module) int ZEND_MODULE_ACTIVATE_N(module)(INIT_FUNC_ARGS)
124 #define ZEND_MODULE_DEACTIVATE_D(module) int ZEND_MODULE_DEACTIVATE_N(module)(SHUTDOWN_FUNC_ARGS)
6535933f »
2004-03-16 - Replaced the exec_finished hook by the zend_post_deactive hook for
125 #define ZEND_MODULE_POST_ZEND_DEACTIVATE_D(module) int ZEND_MODULE_POST_ZEND_DEACTIVATE_N(module)(void)
8b6f848c »
2001-08-10 - Merge from Engine 1
126 #define ZEND_MODULE_INFO_D(module) void ZEND_MODULE_INFO_N(module)(ZEND_MODULE_INFO_FUNC_ARGS)
2cbde064 »
2006-06-13 Added automatic module globals management.
127 #define ZEND_MODULE_GLOBALS_CTOR_D(module) void ZEND_MODULE_GLOBALS_CTOR_N(module)(zend_##module##_globals *module##_globals TSRMLS_DC)
128 #define ZEND_MODULE_GLOBALS_DTOR_D(module) void ZEND_MODULE_GLOBALS_DTOR_N(module)(zend_##module##_globals *module##_globals TSRMLS_DC)
342c6e0b »
1999-04-18 Whatnot:
129
0b6d923b »
2000-05-02 Add ZEND_GET_MODULE(name). This is a short-cut for the common
130 #define ZEND_GET_MODULE(name) \
cb71ac03 »
2003-05-20 C++ compile fixes
131 BEGIN_EXTERN_C()\
132 ZEND_DLEXPORT zend_module_entry *get_module(void) { return &name##_module_entry; }\
133 END_EXTERN_C()
0d21940d »
2000-04-01 Generalize some common thread-safety stuff
134
135 #define ZEND_BEGIN_MODULE_GLOBALS(module_name) \
136 typedef struct _zend_##module_name##_globals {
137 #define ZEND_END_MODULE_GLOBALS(module_name) \
138 } zend_##module_name##_globals;
139
140 #ifdef ZTS
141
142 #define ZEND_DECLARE_MODULE_GLOBALS(module_name) \
02af513c »
2001-04-19 - Patch from Jason Greene.
143 ts_rsrc_id module_name##_globals_id;
144 #define ZEND_EXTERN_MODULE_GLOBALS(module_name) \
145 extern ts_rsrc_id module_name##_globals_id;
0d21940d »
2000-04-01 Generalize some common thread-safety stuff
146 #define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
2c254ba7 »
2001-07-27 Get rid of ELS_*(), and use TSRMLS_*() instead.
147 ts_allocate_id(&module_name##_globals_id, sizeof(zend_##module_name##_globals), (ts_allocate_ctor) globals_ctor, (ts_allocate_dtor) globals_dtor);
0d21940d »
2000-04-01 Generalize some common thread-safety stuff
148
149 #else
150
151 #define ZEND_DECLARE_MODULE_GLOBALS(module_name) \
02af513c »
2001-04-19 - Patch from Jason Greene.
152 zend_##module_name##_globals module_name##_globals;
153 #define ZEND_EXTERN_MODULE_GLOBALS(module_name) \
154 extern zend_##module_name##_globals module_name##_globals;
0d21940d »
2000-04-01 Generalize some common thread-safety stuff
155 #define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
156 globals_ctor(&module_name##_globals);
157
158 #endif
159
57d22421 »
2006-11-17 Unicode support.
160 #define INIT_CLASS_ENTRY(class_container, class_name, functions) \
161 INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, NULL, NULL, NULL)
741b8161 »
1999-05-28 * Support getThis() for internal functions.
162
57d22421 »
2006-11-17 Unicode support.
163 #define INIT_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions) \
164 INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions, NULL, NULL, NULL, NULL, NULL)
165
166 #define INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
741b8161 »
1999-05-28 * Support getThis() for internal functions.
167 { \
57d22421 »
2006-11-17 Unicode support.
168 int _len = class_name_len; \
8ecf8ede »
2009-03-26 - Removed:
169 class_container.name.u = (UChar *)malloc(UBYTES(_len+1)); \
170 u_charsToUChars(class_name, class_container.name.u, _len+1); \
57d22421 »
2006-11-17 Unicode support.
171 class_container.name_length = _len; \
741b8161 »
1999-05-28 * Support getThis() for internal functions.
172 class_container.builtin_functions = functions; \
2eccd95c »
2001-11-03 - Add some initializations
173 class_container.constructor = NULL; \
73b159e0 »
2001-12-27 - Experimental support for destructors. We need to see if destructors
174 class_container.destructor = NULL; \
29ea3da2 »
2001-12-26 - Pretty much finish _clone() support
175 class_container.clone = NULL; \
4a430a09 »
2005-09-23 - WS fix
176 class_container.serialize = NULL; \
177 class_container.unserialize = NULL; \
178 class_container.create_object = NULL; \
3c62b3b5 »
2003-10-22 Expand Interface C API.
179 class_container.interface_gets_implemented = NULL; \
b1bc911c »
2007-07-21 Add support got zend_class_entry->get_static_method() and matching __…
180 class_container.get_static_method = NULL; \
4a430a09 »
2005-09-23 - WS fix
181 class_container.__call = handle_fcall; \
b1bc911c »
2007-07-21 Add support got zend_class_entry->get_static_method() and matching __…
182 class_container.__callstatic = NULL; \
f94344d7 »
2005-09-27 Changed __toString() behavior to call it in all necessary places
183 class_container.__tostring = NULL; \
4a430a09 »
2005-09-23 - WS fix
184 class_container.__get = handle_propget; \
185 class_container.__set = handle_propset; \
186 class_container.__unset = handle_propunset; \
187 class_container.__isset = handle_propisset; \
188 class_container.serialize_func = NULL; \
189 class_container.unserialize_func = NULL; \
190 class_container.serialize = NULL; \
191 class_container.unserialize = NULL; \
192 class_container.parent = NULL; \
193 class_container.num_interfaces = 0; \
194 class_container.interfaces = NULL; \
195 class_container.get_iterator = NULL; \
196 class_container.iterator_funcs.funcs = NULL; \
197 class_container.module = NULL; \
741b8161 »
1999-05-28 * Support getThis() for internal functions.
198 }
199
345e0255 »
2005-07-07 Fixed bug #33512 (Add missing support for isset()/unset() overloading…
200 #define INIT_OVERLOADED_CLASS_ENTRY(class_container, class_name, functions, handle_fcall, handle_propget, handle_propset) \
57d22421 »
2006-11-17 Unicode support.
201 INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, sizeof(class_name)-1, functions, handle_fcall, handle_propget, handle_propset, NULL, NULL)
345e0255 »
2005-07-07 Fixed bug #33512 (Add missing support for isset()/unset() overloading…
202
1e267607 »
2008-05-12 Added API to use namesapces in internal extensions
203 #define INIT_NS_CLASS_ENTRY(class_container, ns, class_name, functions) \
204 INIT_CLASS_ENTRY(class_container, ZEND_NS_NAME(ns, class_name), functions)
205 #define INIT_OVERLOADED_NS_CLASS_ENTRY_EX(class_container, ns, class_name, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
206 INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, ZEND_NS_NAME(ns, class_name), sizeof(ZEND_NS_NAME(ns, class_name))-1, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset)
207 #define INIT_OVERLOADED_NS_CLASS_ENTRY(class_container, ns, class_name, functions, handle_fcall, handle_propget, handle_propset) \
208 INIT_OVERLOADED_CLASS_ENTRY(class_container, ZEND_NS_NAME(ns, class_name), functions, handle_fcall, handle_propget, handle_propset)
209
feaa2501 »
2005-12-01 Fixed bug #34729 (Crash in ZTS mode under Apache)
210 #ifdef ZTS
2908322c »
2007-04-16 WIN64 support
211 # define CE_STATIC_MEMBERS(ce) (((ce)->type==ZEND_USER_CLASS)?(ce)->static_members:CG(static_members)[(zend_intptr_t)(ce)->static_members])
feaa2501 »
2005-12-01 Fixed bug #34729 (Crash in ZTS mode under Apache)
212 #else
213 # define CE_STATIC_MEMBERS(ce) ((ce)->static_members)
214 #endif
215
e9a9a26e »
2006-07-20 Rewrite array_map() to use params API with fci cache and mark it with U.
216 #define ZEND_FCI_INITIALIZED(fci) ((fci).size != 0)
217
573b4602 »
1999-04-07 Zend Library
218 int zend_next_free_module(void);
219
1727c6a2 »
2004-02-20 more EXTERN_C wrapping of ZEND_API prototypes
220 BEGIN_EXTERN_C()
f77e6a44 »
2000-02-19 Generalize macros
221 ZEND_API int zend_get_parameters(int ht, int param_count, ...);
11e5d2f2 »
2001-07-30 Get rid of more TSRMLS_FETCH's
222 ZEND_API int _zend_get_parameters_array(int ht, int param_count, zval **argument_array TSRMLS_DC);
7913749e »
2008-06-27 deprecate zend_get_parameters_ex
223 ZEND_API int ZEND_ATTRIBUTE_DEPRECATED zend_get_parameters_ex(int param_count, ...);
11e5d2f2 »
2001-07-30 Get rid of more TSRMLS_FETCH's
224 ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_array TSRMLS_DC);
225
e39f3f3f »
2004-09-28 Simplify/Optmize magic method calls (__get/__set/__call/__clone/__des…
226 /* internal function to efficiently copy parameters when executing __call() */
227 ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TSRMLS_DC);
228
11e5d2f2 »
2001-07-30 Get rid of more TSRMLS_FETCH's
229 #define zend_get_parameters_array(ht, param_count, argument_array) \
230 _zend_get_parameters_array(ht, param_count, argument_array TSRMLS_CC)
231 #define zend_get_parameters_array_ex(param_count, argument_array) \
232 _zend_get_parameters_array_ex(param_count, argument_array TSRMLS_CC)
8e08965b »
2008-02-28 Added new macro for check void parameters.
233 #define zend_parse_parameters_none() \
234 zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")
39f9487e »
1999-04-14 -Tiny patches
235
58f88057 »
2001-07-09 Adding new parameter parsing API.
236
237 /* Parameter parsing API -- andrei */
238
239 #define ZEND_PARSE_PARAMS_QUIET 1<<1
8ce8324e »
2001-07-30 More TSRMLS_FETCH annihilation
240 ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...);
3839af35 »
2001-07-30 Let's be consisten and keep TSRMLS_DC declaration after num_args.
241 ZEND_API int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *type_spec, ...);
a5f867f3 »
2008-08-12 - Constness (Added const qualifier to several function parameters)
242 ZEND_API char *zend_zval_type_name(const zval *arg);
58f88057 »
2001-07-09 Adding new parameter parsing API.
243
325f9edb »
2003-02-08 fixed zend_parse_method_param
244 ZEND_API int zend_parse_method_parameters(int num_args TSRMLS_DC, zval *this_ptr, char *type_spec, ...);
8d45fece »
2004-03-02 Fix zend_parse_method_parameters_ex() and make it consistant with
245 ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC, zval *this_ptr, char *type_spec, ...);
c4528f82 »
2003-02-02 extend the parameter parsing API by two functions
246
b5255495 »
2001-07-30 More TSRMLS_FETCH work, and get rid of redundant ParametersPassedByRef
247 /* End of parameter parsing API -- andrei */
39f9487e »
1999-04-14 -Tiny patches
248
8146078f »
2007-09-27 Improved memory usage by movig constants to read only memory. (Dmitry…
249 ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC);
250 ZEND_API void zend_unregister_functions(const zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC);
2ca2dc0b »
2005-06-30 Restored old behavior of zend_statup_module()
251 ZEND_API int zend_startup_module(zend_module_entry *module_entry);
70bd938b »
2005-07-18 Fixed bug in new module statrup mechanism
252 ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module_entry TSRMLS_DC);
253 ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TSRMLS_DC);
2ca2dc0b »
2005-06-30 Restored old behavior of zend_statup_module()
254 ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC);
c0c7a9f0 »
2005-06-17 Improved PHP extension loading mechanism with support for module depe…
255 ZEND_API int zend_startup_modules(TSRMLS_D);
a5f867f3 »
2008-08-12 - Constness (Added const qualifier to several function parameters)
256 ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, const zend_function *fptr, int error_type TSRMLS_DC);
eb0e6946 »
2000-06-09 - Andrei, this is for you!
257
b5770382 »
2001-07-30 Avoid TSRMLS_FETCH()'s (still lots of work left)
258 ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry TSRMLS_DC);
259 ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name TSRMLS_DC);
3c62b3b5 »
2003-10-22 Expand Interface C API.
260 ZEND_API zend_class_entry *zend_register_internal_interface(zend_class_entry *orig_class_entry TSRMLS_DC);
4073a084 »
2003-10-15 Add oo support function zend_class_implements()
261 ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int num_interfaces, ...);
eb0e6946 »
2000-06-09 - Andrei, this is for you!
262
a5f867f3 »
2008-08-12 - Constness (Added const qualifier to several function parameters)
263 ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_class_entry *ce TSRMLS_DC);
1e267607 »
2008-05-12 Added API to use namesapces in internal extensions
264 ZEND_API int zend_u_register_class_alias_ex(zend_uchar utype, zstr name, int name_len, zend_class_entry *ce TSRMLS_DC);
265
266 #define zend_register_class_alias(name, ce) \
267 zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_DC)
268 #define zend_register_ns_class_alias(ns, name, ce) \
269 zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_DC)
270
d76cf1da »
2001-07-31 More TSRMLS_FETCH work
271 ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC);
a700180f »
2003-03-03 commiting zend_disable_class patch for George:
272 ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC);
573b4602 »
1999-04-07 Zend Library
273
4187439c »
2001-07-30 More TSRMLS_FETCH work
274 ZEND_API void zend_wrong_param_count(TSRMLS_D);
c81db6bc »
2005-04-27 Fixed bug #29210 (Function: is_callable - no support for private and …
275
276 #define IS_CALLABLE_CHECK_SYNTAX_ONLY (1<<0)
277 #define IS_CALLABLE_CHECK_NO_ACCESS (1<<1)
53e52606 »
2005-07-28 - Add convenience function zend_is_callable_ex() and base zend_is_cal…
278 #define IS_CALLABLE_CHECK_IS_STATIC (1<<2)
bdf7981e »
2008-07-26 Fixed is_callable/call_user_func mess that had done different things …
279 #define IS_CALLABLE_CHECK_SILENT (1<<3)
c81db6bc »
2005-04-27 Fixed bug #29210 (Function: is_callable - no support for private and …
280
96150967 »
2005-12-16 - Add new const
281 #define IS_CALLABLE_STRICT (IS_CALLABLE_CHECK_IS_STATIC)
282
e5454b35 »
2008-11-27 Fixed bug #46409 (__invoke method called outside of object context wh…
283 ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval *object_ptr, uint check_flags, zval *callable_name, zend_fcall_info_cache *fcc, char **error TSRMLS_DC);
611ecc51 »
2008-08-02 - Added parameter TSRMLS_DC in zend_is_callable()
284 ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, zval *callable_name TSRMLS_DC);
6b622046 »
2005-08-22 zend_is_callable() and zend_make_callable() were changed to return re…
285 ZEND_API zend_bool zend_make_callable(zval *callable, zval *callable_name TSRMLS_DC);
8146078f »
2007-09-27 Improved memory usage by movig constants to read only memory. (Dmitry…
286 ZEND_API const char *zend_get_module_version(const char *module_name);
a5f867f3 »
2008-08-12 - Constness (Added const qualifier to several function parameters)
287 ZEND_API int zend_get_module_started(const char *module_name);
7bbbd503 »
2003-09-03 Fix handling of static properties initialized to arrays
288 ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC);
a5f867f3 »
2008-08-12 - Constness (Added const qualifier to several function parameters)
289 ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, int name_length, zval *property, int access_type, zstr doc_comment, int doc_comment_len TSRMLS_DC);
7bbbd503 »
2003-09-03 Fix handling of static properties initialized to arrays
290 ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC);
d88c2b18 »
2005-02-04 added some missing zend_[declare|update]_property_...() convenience
291 ZEND_API int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC);
7bbbd503 »
2003-09-03 Fix handling of static properties initialized to arrays
292 ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC);
d88c2b18 »
2005-02-04 added some missing zend_[declare|update]_property_...() convenience
293 ZEND_API int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC);
7bbbd503 »
2003-09-03 Fix handling of static properties initialized to arrays
294 ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int name_length, char *value, int access_type TSRMLS_DC);
d88c2b18 »
2005-02-04 added some missing zend_[declare|update]_property_...() convenience
295 ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, char *name, int name_length, char *value, int value_len, int access_type TSRMLS_DC);
13433852 »
2003-07-07 Rework zend_do_declare_property and related code into one code base
296
0f1209ab »
2006-02-21 Portable unicode string API:
297 ZEND_API int zend_u_declare_property(zend_class_entry *ce, zend_uchar type, zstr name, int name_length, zval *property, int access_type TSRMLS_DC);
75c27244 »
2006-10-27 Turn doc comments into zstr strings with corresponding adjustments.
298 ZEND_API int zend_u_declare_property_ex(zend_class_entry *ce, zend_uchar type, zstr name, int name_length, zval *property, int access_type, zstr doc_comment, int doc_comment_len TSRMLS_DC);
b80cb7bd »
2005-08-11 Unicode support
299
a5f867f3 »
2008-08-12 - Constness (Added const qualifier to several function parameters)
300 ZEND_API int zend_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value TSRMLS_DC);
301 ZEND_API int zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length TSRMLS_DC);
302 ZEND_API int zend_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, long value TSRMLS_DC);
303 ZEND_API int zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value TSRMLS_DC);
304 ZEND_API int zend_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value TSRMLS_DC);
305 ZEND_API int zend_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length TSRMLS_DC);
306 ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value TSRMLS_DC);
7b755108 »
2005-09-01 Support for class constants and static members for internal classes
307
1d5c13bd »
2005-01-22 - Fix #31651 (ReflectionClass::getDefaultProperties segfaults with ar…
308 ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC);
baaa4c90 »
2003-08-23 Internal classes can now have default properties.
309 ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC);
182de3e9 »
2008-07-29 add zend_u_read_property() and zend_u_update_property()
310 ZEND_API void zend_u_update_property(zend_class_entry *scope, zval *object, zend_uchar type, zstr name, int name_length, zval *value TSRMLS_DC);
baaa4c90 »
2003-08-23 Internal classes can now have default properties.
311 ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, char *name, int name_length TSRMLS_DC);
d88c2b18 »
2005-02-04 added some missing zend_[declare|update]_property_...() convenience
312 ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC);
baaa4c90 »
2003-08-23 Internal classes can now have default properties.
313 ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC);
d88c2b18 »
2005-02-04 added some missing zend_[declare|update]_property_...() convenience
314 ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC);
a5f867f3 »
2008-08-12 - Constness (Added const qualifier to several function parameters)
315 ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, char *name, int name_length, const char *value TSRMLS_DC);
316 ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, const char *value, int value_length TSRMLS_DC);
317 ZEND_API void zend_update_property_ascii_string(zend_class_entry *scope, zval *object, char *name, int name_length, const char *value TSRMLS_DC);
318 ZEND_API void zend_update_property_ascii_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, const char *value, int value_length TSRMLS_DC);
319 ZEND_API void zend_update_property_rt_string(zend_class_entry *scope, zval *object, char *name, int name_length, const char *value TSRMLS_DC);
320 ZEND_API void zend_update_property_rt_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, const char *value, int value_length TSRMLS_DC);
6b622046 »
2005-08-22 zend_is_callable() and zend_make_callable() were changed to return re…
321 ZEND_API void zend_update_property_unicode(zend_class_entry *scope, zval *object, char *name, int name_length, UChar *value TSRMLS_DC);
322 ZEND_API void zend_update_property_unicodel(zend_class_entry *scope, zval *object, char *name, int name_length, UChar *value, int value_length TSRMLS_DC);
573b4602 »
1999-04-07 Zend Library
323
7b755108 »
2005-09-01 Support for class constants and static members for internal classes
324 ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, int name_length, zval *value TSRMLS_DC);
325 ZEND_API int zend_update_static_property_null(zend_class_entry *scope, char *name, int name_length TSRMLS_DC);
326 ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC);
327 ZEND_API int zend_update_static_property_long(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC);
328 ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *name, int name_length, double value TSRMLS_DC);
a5f867f3 »
2008-08-12 - Constness (Added const qualifier to several function parameters)
329 ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *name, int name_length, const char *value TSRMLS_DC);
330 ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char *name, int name_length, const char *value, int value_length TSRMLS_DC);
331 ZEND_API int zend_update_static_property_ascii_string(zend_class_entry *scope, char *name, int name_length, const char *value TSRMLS_DC);
332 ZEND_API int zend_update_static_property_ascii_stringl(zend_class_entry *scope, char *name, int name_length, const char *value, int value_length TSRMLS_DC);
333 ZEND_API int zend_update_static_property_rt_string(zend_class_entry *scope, char *name, int name_length, const char *value TSRMLS_DC);
334 ZEND_API int zend_update_static_property_rt_stringl(zend_class_entry *scope, char *name, int name_length, const char *value, int value_length TSRMLS_DC);
7b755108 »
2005-09-01 Support for class constants and static members for internal classes
335 ZEND_API int zend_update_static_property_unicode(zend_class_entry *scope, char *name, int name_length, UChar *value TSRMLS_DC);
336 ZEND_API int zend_update_static_property_unicodel(zend_class_entry *scope, char *name, int name_length, UChar *value, int value_length TSRMLS_DC);
337
38805f28 »
2003-08-24 Add property read code and use that in default exception class
338 ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *name, int name_length, zend_bool silent TSRMLS_DC);
182de3e9 »
2008-07-29 add zend_u_read_property() and zend_u_update_property()
339 ZEND_API zval *zend_u_read_property(zend_class_entry *scope, zval *object, zend_uchar type, zstr name, int name_length, zend_bool silent TSRMLS_DC);
38805f28 »
2003-08-24 Add property read code and use that in default exception class
340
7b755108 »
2005-09-01 Support for class constants and static members for internal classes
341 ZEND_API zval *zend_read_static_property(zend_class_entry *scope, char *name, int name_length, zend_bool silent TSRMLS_DC);
342
a5f867f3 »
2008-08-12 - Constness (Added const qualifier to several function parameters)
343 ZEND_API zend_class_entry *zend_get_class_entry(const zval *zobject TSRMLS_DC);
344 ZEND_API int zend_get_object_classname(const zval *object, zstr *class_name, zend_uint *class_name_len TSRMLS_DC);
fe71ae29 »
2005-08-18 - Implement zend_codepoint_to_uchar().
345 ZEND_API zend_uchar zend_get_unified_string_type(int num_args TSRMLS_DC, ...);
34126e4a »
2006-05-25 MFB: fix error messages when converting objects to other types
346 ZEND_API char *zend_get_type_by_const(int type);
6ac6cb10 »
2002-04-22 added get_class_entry callback handler to the
347
741b8161 »
1999-05-28 * Support getThis() for internal functions.
348 #define getThis() (this_ptr)
349
131d9cb2 »
2000-04-01 *** empty log message ***
350 #define WRONG_PARAM_COUNT ZEND_WRONG_PARAM_COUNT()
351 #define WRONG_PARAM_COUNT_WITH_RETVAL(ret) ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret)
a1ad2872 »
1999-12-18 - The tree compiles again
352 #define ARG_COUNT(dummy) (ht)
353 #define ZEND_NUM_ARGS() (ht)
4187439c »
2001-07-30 More TSRMLS_FETCH work
354 #define ZEND_WRONG_PARAM_COUNT() { zend_wrong_param_count(TSRMLS_C); return; }
355 #define ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret) { zend_wrong_param_count(TSRMLS_C); return ret; }
573b4602 »
1999-04-07 Zend Library
356
80bdd19e »
2000-02-11 Fine tune Andi's patch
357 #ifndef ZEND_WIN32
573b4602 »
1999-04-07 Zend Library
358 #define DLEXPORT
359 #endif
360
9c37df90 »
2008-05-27 Add array_init_size() and use it where array size is known at initial…
361 #define array_init(arg) _array_init((arg), 0 ZEND_FILE_LINE_CC)
362 #define array_init_size(arg, size) _array_init((arg), (size) ZEND_FILE_LINE_CC)
fcc03510 »
2001-08-05 TSRMLS_FETCH work
363 #define object_init(arg) _object_init((arg) ZEND_FILE_LINE_CC TSRMLS_CC)
364 #define object_init_ex(arg, ce) _object_init_ex((arg), (ce) ZEND_FILE_LINE_CC TSRMLS_CC)
76a7a5bc »
2001-08-11 - More work on making objects work
365 #define object_and_properties_init(arg, ce, properties) _object_and_properties_init((arg), (ce), (properties) ZEND_FILE_LINE_CC TSRMLS_CC)
9c37df90 »
2008-05-27 Add array_init_size() and use it where array size is known at initial…
366 ZEND_API int _array_init(zval *arg, uint size ZEND_FILE_LINE_DC);
fcc03510 »
2001-08-05 TSRMLS_FETCH work
367 ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC);
368 ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC TSRMLS_DC);
76a7a5bc »
2001-08-11 - More work on making objects work
369 ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *ce, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC);
6847fefa »
1999-10-04 added add_*_resource() and add_*_bool() functions
370
047a574e »
2003-08-29 - Add zend_merge_properties() which is designed to serve *_fetch_obje…
371 ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destroy_ht TSRMLS_DC);
372
6847fefa »
1999-10-04 added add_*_resource() and add_*_bool() functions
373 /* no longer supported */
8146078f »
2007-09-27 Improved memory usage by movig constants to read only memory. (Dmitry…
374 ZEND_API int add_assoc_function(zval *arg, const char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
6847fefa »
1999-10-04 added add_*_resource() and add_*_bool() functions
375
5f5faedf »
2006-04-06 Overload 'duplicate' arg as applied to:
376 #define ZSTR_DUPLICATE (1<<0)
377 #define ZSTR_AUTOFREE (1<<1)
378
8146078f »
2007-09-27 Improved memory usage by movig constants to read only memory. (Dmitry…
379 ZEND_API int add_assoc_zval_ex(zval *arg, const char *key, uint key_len, zval *value);
b0e24970 »
2005-08-19 Unicode support cleanup
380
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
381 #define add_assoc_null_ex(arg, key, key_len) do { \
382 zval *___tmp; \
383 MAKE_STD_ZVAL(___tmp); \
384 ZVAL_NULL(___tmp); \
385 add_assoc_zval_ex(arg, key, key_len, ___tmp); \
386 } while (0)
387 #define add_assoc_long_ex(arg, key, key_len, n) do { \
388 zval *___tmp; \
389 MAKE_STD_ZVAL(___tmp); \
390 ZVAL_LONG(___tmp, n); \
391 add_assoc_zval_ex(arg, key, key_len, ___tmp); \
392 } while (0)
393 #define add_assoc_bool_ex(arg, key, key_len, b) do { \
394 zval *___tmp; \
395 MAKE_STD_ZVAL(___tmp); \
396 ZVAL_BOOL(___tmp, b); \
397 add_assoc_zval_ex(arg, key, key_len, ___tmp); \
398 } while (0)
399 #define add_assoc_resource_ex(arg, key, key_len, r) do { \
400 zval *___tmp; \
401 MAKE_STD_ZVAL(___tmp); \
402 ZVAL_RESOURCE(___tmp, r); \
403 add_assoc_zval_ex(arg, key, key_len, ___tmp); \
404 } while (0)
405 #define add_assoc_double_ex(arg, key, key_len, d) do { \
406 zval *___tmp; \
407 MAKE_STD_ZVAL(___tmp); \
408 ZVAL_DOUBLE(___tmp, d); \
409 add_assoc_zval_ex(arg, key, key_len, ___tmp); \
410 } while (0)
411 #define add_assoc_stringl_ex(arg, key, key_len, str, length, duplicate) do { \
412 zval *___tmp; \
413 MAKE_STD_ZVAL(___tmp); \
414 ZVAL_STRINGL(___tmp, str, length, duplicate); \
415 add_assoc_zval_ex(arg, key, key_len, ___tmp); \
416 } while (0)
417 #define add_assoc_unicode_ex(arg, key, key_len, str, duplicate) do { \
418 zval *___tmp; \
419 MAKE_STD_ZVAL(___tmp); \
420 ZVAL_UNICODE(___tmp, str, duplicate); \
421 add_assoc_zval_ex(arg, key, key_len, ___tmp); \
422 } while (0)
423 #define add_assoc_unicodel_ex(arg, key, key_len, str, length, duplicate) do { \
424 zval *___tmp; \
425 MAKE_STD_ZVAL(___tmp); \
426 ZVAL_UNICODEL(___tmp, str, length, duplicate); \
427 add_assoc_zval_ex(arg, key, key_len, ___tmp); \
428 } while (0)
429 #define add_assoc_zstr_ex(arg, key, key_len, type, str, duplicate) do { \
430 zval *___tmp; \
431 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
432 ZVAL_ZSTR(___tmp, type, str, duplicate); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
433 add_assoc_zval_ex(arg, key, key_len, ___tmp); \
434 } while (0)
435 #define add_assoc_zstrl_ex(arg, key, key_len, type, str, length, duplicate) do { \
436 zval *___tmp; \
437 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
438 ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
439 add_assoc_zval_ex(arg, key, key_len, ___tmp); \
440 } while (0)
b0e24970 »
2005-08-19 Unicode support cleanup
441
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
442 #define add_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
443 int ___u_len = length; \
444 UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
445 ___u_str[___u_len] = 0; \
446 if ((flags) & ZSTR_AUTOFREE) { \
447 efree(str); \
5f5faedf »
2006-04-06 Overload 'duplicate' arg as applied to:
448 } \
8ecf8ede »
2009-03-26 - Removed:
449 add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
450 } while (0)
451 #define add_assoc_rt_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
452 UChar *___u_str; \
453 int ___u_len; \
454 if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
455 add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
456 } \
457 if ((flags) & ZSTR_AUTOFREE) { \
458 efree(str); \
5f5faedf »
2006-04-06 Overload 'duplicate' arg as applied to:
459 } \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
460 } while (0)
461 #define add_assoc_utf8_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
462 UChar *___u_str; \
463 int ___u_len; \
464 if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
465 add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
466 } \
467 if ((flags) & ZSTR_AUTOFREE) { \
468 efree(str); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
469 } \
470 } while (0)
471 #define add_assoc_string_ex(arg, key, key_len, str, flags) add_assoc_stringl_ex(arg, key, key_len, str, strlen(str), flags)
472 #define add_assoc_ascii_string_ex(arg, key, key_len, str, flags) add_assoc_ascii_stringl_ex(arg, key, key_len, str, strlen(str), flags)
473 #define add_assoc_rt_string_ex(arg, key, key_len, str, flags) add_assoc_rt_stringl_ex(arg, key, key_len, str, strlen(str), flags)
474 #define add_assoc_utf8_string_ex(arg, key, key_len, str, flags) add_assoc_utf8_stringl_ex(arg, key, key_len, str, strlen(str), flags)
8f6f97a7 »
2005-08-23 Unicode support
475
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
476 #define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value)
ef95a346 »
2001-01-20 - Patch from Sterling. Add API calls to add zval's as array indeces/
477 #define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key)+1, __n)
0611acb9 »
2001-01-31 - Change unset() functions to null(). unset() is legacy
478 #define add_assoc_null(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1)
ef95a346 »
2001-01-20 - Patch from Sterling. Add API calls to add zval's as array indeces/
479 #define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b)
480 #define add_assoc_resource(__arg, __key, __r) add_assoc_resource_ex(__arg, __key, strlen(__key)+1, __r)
481 #define add_assoc_double(__arg, __key, __d) add_assoc_double_ex(__arg, __key, strlen(__key)+1, __d)
482 #define add_assoc_string(__arg, __key, __str, __duplicate) add_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
483 #define add_assoc_stringl(__arg, __key, __str, __length, __duplicate) add_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
b80cb7bd »
2005-08-11 Unicode support
484 #define add_assoc_unicode(__arg, __key, __str, __duplicate) add_assoc_unicode_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
485 #define add_assoc_unicodel(__arg, __key, __str, __length, __duplicate) add_assoc_unicodel_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
dda05970 »
2006-08-04 Add add_assoc_zstr_ex() and related.
486 #define add_assoc_zstr(__arg, __key, __type, __str, __duplicate) add_assoc_zstr_ex(__arg, __key, strlen(__key)+1, __type, __str, __duplicate)
487 #define add_assoc_zstrl(__arg, __key, __type, __str, __length, __duplicate) add_assoc_zstrl_ex(__arg, __key, strlen(__key)+1, __type, __str, __length, __duplicate)
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
488 #define add_assoc_ascii_string(arg, key, str, flags) add_assoc_ascii_string_ex(arg, key, strlen(key)+1, str, flags)
489 #define add_assoc_ascii_stringl(arg, key, str, length, flags) add_assoc_ascii_stringl_ex(arg, key, strlen(key)+1, str, length, flags)
8f6f97a7 »
2005-08-23 Unicode support
490 #define add_assoc_rt_string(__arg, __key, __str, __duplicate) add_assoc_rt_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
491 #define add_assoc_rt_stringl(__arg, __key, __str, __length, __duplicate) add_assoc_rt_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
11ca9006 »
2006-08-28 Add APIs for UTF-8 strings (common with XML, PCRE, etc)
492 #define add_assoc_utf8_string(__arg, __key, __str, __duplicate) add_assoc_utf8_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
493 #define add_assoc_utf8_stringl(__arg, __key, __str, __length, __duplicate) add_assoc_utf8_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
494
8146078f »
2007-09-27 Improved memory usage by movig constants to read only memory. (Dmitry…
495 ZEND_API int add_ascii_assoc_zval_ex(zval *arg, const char *key, uint key_len, zval *value);
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
496
497 #define add_ascii_assoc_null_ex(arg, key, key_len) do { \
498 zval *___tmp; \
499 MAKE_STD_ZVAL(___tmp); \
500 ZVAL_NULL(___tmp); \
501 add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \
502 } while (0)
503 #define add_ascii_assoc_long_ex(arg, key, key_len, n) do { \
504 zval *___tmp; \
505 MAKE_STD_ZVAL(___tmp); \
506 ZVAL_LONG(___tmp, n); \
507 add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \
508 } while (0)
509 #define add_ascii_assoc_bool_ex(arg, key, key_len, b) do { \
510 zval *___tmp; \
511 MAKE_STD_ZVAL(___tmp); \
512 ZVAL_BOOL(___tmp, b); \
513 add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \
514 } while (0)
515 #define add_ascii_assoc_resource_ex(arg, key, key_len, r) do { \
516 zval *___tmp; \
517 MAKE_STD_ZVAL(___tmp); \
518 ZVAL_RESOURCE(___tmp, r); \
519 add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \
520 } while (0)
521 #define add_ascii_assoc_double_ex(arg, key, key_len, d) do { \
522 zval *___tmp; \
523 MAKE_STD_ZVAL(___tmp); \
524 ZVAL_DOUBLE(___tmp, d); \
525 add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \
526 } while (0)
527 #define add_ascii_assoc_stringl_ex(arg, key, key_len, str, length, duplicate) do { \
528 zval *___tmp; \
529 MAKE_STD_ZVAL(___tmp); \
530 ZVAL_STRINGL(___tmp, str, length, duplicate); \
531 add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \
532 } while (0)
533 #define add_ascii_assoc_unicode_ex(arg, key, key_len, str, duplicate) do { \
534 zval *___tmp; \
535 MAKE_STD_ZVAL(___tmp); \
536 ZVAL_UNICODE(___tmp, str, duplicate); \
537 add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \
538 } while (0)
539 #define add_ascii_assoc_unicodel_ex(arg, key, key_len, str, length, duplicate) do { \
540 zval *___tmp; \
541 MAKE_STD_ZVAL(___tmp); \
542 ZVAL_UNICODEL(___tmp, str, length, duplicate); \
543 add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \
544 } while (0)
545 #define add_ascii_assoc_zstr_ex(arg, key, key_len, type, str, duplicate) do { \
546 zval *___tmp; \
547 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
548 ZVAL_ZSTR(___tmp, type, str, duplicate); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
549 add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \
550 } while (0)
551 #define add_ascii_assoc_zstrl_ex(arg, key, key_len, type, str, length, duplicate) do { \
552 zval *___tmp; \
553 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
554 ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
555 add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \
556 } while (0)
6847fefa »
1999-10-04 added add_*_resource() and add_*_bool() functions
557
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
558 #define add_ascii_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
559 int ___u_len = length; \
560 UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
561 ___u_str[___u_len] = 0; \
562 if ((flags) & ZSTR_AUTOFREE) { \
563 efree(str); \
5f5faedf »
2006-04-06 Overload 'duplicate' arg as applied to:
564 } \
8ecf8ede »
2009-03-26 - Removed:
565 add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
566 } while (0)
567 #define add_ascii_assoc_rt_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
568 UChar *___u_str; \
569 int ___u_len; \
570 if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
571 add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
572 } \
573 if ((flags) & ZSTR_AUTOFREE) { \
574 efree(str); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
575 } \
576 } while (0)
577 #define add_ascii_assoc_utf8_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
578 UChar *___u_str; \
579 int ___u_len; \
580 if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
581 add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
582 } \
583 if ((flags) & ZSTR_AUTOFREE) { \
584 efree(str); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
585 } \
586 } while (0)
587
588 #define add_ascii_assoc_string_ex(arg, key, key_len, str, flags) add_ascii_assoc_stringl_ex(arg, key, key_len, str, strlen(str), flags)
589 #define add_ascii_assoc_ascii_string_ex(arg, key, key_len, str, flags) add_ascii_assoc_ascii_stringl_ex(arg, key, key_len, str, strlen(str), flags)
590 #define add_ascii_assoc_rt_string_ex(arg, key, key_len, str, flags) add_ascii_assoc_rt_stringl_ex(arg, key, key_len, str, strlen(str), flags)
591 #define add_ascii_assoc_utf8_string_ex(arg, key, key_len, str, flags) add_ascii_assoc_utf8_stringl_ex(arg, key, key_len, str, strlen(str), flags)
592
593 #define add_ascii_assoc_zval(__arg, __key, __value) add_ascii_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value)
594 #define add_ascii_assoc_long(__arg, __key, __n) add_ascii_assoc_long_ex(__arg, __key, strlen(__key)+1, __n)
595 #define add_ascii_assoc_null(__arg, __key) add_ascii_assoc_null_ex(__arg, __key, strlen(__key)+1)
596 #define add_ascii_assoc_bool(__arg, __key, __b) add_ascii_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b)
597 #define add_ascii_assoc_resource(__arg, __key, __r) add_ascii_assoc_resource_ex(__arg, __key, strlen(__key)+1, __r)
598 #define add_ascii_assoc_double(__arg, __key, __d) add_ascii_assoc_double_ex(__arg, __key, strlen(__key)+1, __d)
599 #define add_ascii_assoc_string(__arg, __key, __str, __duplicate) add_ascii_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
600 #define add_ascii_assoc_stringl(__arg, __key, __str, __length, __duplicate) add_ascii_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
601 #define add_ascii_assoc_unicode(__arg, __key, __str, __duplicate) add_ascii_assoc_unicode_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
602 #define add_ascii_assoc_unicodel(__arg, __key, __str, __length, __duplicate) add_ascii_assoc_unicodel_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
603 #define add_ascii_assoc_zstr(arg, key, type, str, duplicate) add_ascii_assoc_zstr_ex(arg, key, strlen(key)+1, type, str, duplicate)
604 #define add_ascii_assoc_zstrl(arg, key, type, str, length, duplicate) add_ascii_assoc_zstrl_ex(arg, key, strlen(key)+1, type, str, length, duplicate)
605 #define add_ascii_assoc_ascii_string(arg, key, str, flags) add_ascii_assoc_ascii_string_ex(arg, key, strlen(key)+1, str, flags)
606 #define add_ascii_assoc_ascii_stringl(arg, key, str, length, flags) add_ascii_assoc_ascii_stringl_ex(arg, key, strlen(key)+1, str, length, flags)
607 #define add_ascii_assoc_rt_string(arg, key, str, flags) add_ascii_assoc_rt_stringl_ex(arg, key, strlen(key)+1, str, strlen(str), flags)
608 #define add_ascii_assoc_rt_stringl(arg, key, str, length, flags) add_ascii_assoc_rt_stringl_ex(arg, key, strlen(key)+1, str, length, flags)
609 #define add_ascii_assoc_utf8_string(arg, key, str, flags) add_ascii_assoc_utf8_stringl_ex(arg, key, strlen(key)+1, str, strlen(str), flags)
610 #define add_ascii_assoc_utf8_stringl(arg, key, str, length, flags) add_ascii_assoc_utf8_stringl_ex(arg, key, strlen(key)+1, str, length, flags)
611
8146078f »
2007-09-27 Improved memory usage by movig constants to read only memory. (Dmitry…
612 ZEND_API int add_rt_assoc_zval_ex(zval *arg, const char *key, uint key_len, zval *value);
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
613
614 #define add_rt_assoc_null_ex(arg, key, key_len) do { \
615 zval *___tmp; \
616 MAKE_STD_ZVAL(___tmp); \
617 ZVAL_NULL(___tmp); \
618 add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \
619 } while (0)
620 #define add_rt_assoc_long_ex(arg, key, key_len, n) do { \
621 zval *___tmp; \
622 MAKE_STD_ZVAL(___tmp); \
623 ZVAL_LONG(___tmp, n); \
624 add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \
625 } while (0)
626 #define add_rt_assoc_bool_ex(arg, key, key_len, b) do { \
627 zval *___tmp; \
628 MAKE_STD_ZVAL(___tmp); \
629 ZVAL_BOOL(___tmp, b); \
630 add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \
631 } while (0)
632 #define add_rt_assoc_resource_ex(arg, key, key_len, r) do { \
633 zval *___tmp; \
634 MAKE_STD_ZVAL(___tmp); \
635 ZVAL_RESOURCE(___tmp, r); \
636 add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \
637 } while (0)
638 #define add_rt_assoc_double_ex(arg, key, key_len, d) do { \
639 zval *___tmp; \
640 MAKE_STD_ZVAL(___tmp); \
641 ZVAL_DOUBLE(___tmp, d); \
642 add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \
643 } while (0)
644 #define add_rt_assoc_stringl_ex(arg, key, key_len, str, length, duplicate) do { \
645 zval *___tmp; \
646 MAKE_STD_ZVAL(___tmp); \
647 ZVAL_STRINGL(___tmp, str, length, duplicate); \
648 add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \
649 } while (0)
650 #define add_rt_assoc_unicode_ex(arg, key, key_len, str, duplicate) do { \
651 zval *___tmp; \
652 MAKE_STD_ZVAL(___tmp); \
653 ZVAL_UNICODE(___tmp, str, duplicate); \
654 add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \
655 } while (0)
656 #define add_rt_assoc_unicodel_ex(arg, key, key_len, str, length, duplicate) do { \
657 zval *___tmp; \
658 MAKE_STD_ZVAL(___tmp); \
659 ZVAL_UNICODEL(___tmp, str, length, duplicate); \
660 add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \
661 } while (0)
662 #define add_rt_assoc_zstr_ex(arg, key, key_len, type, str, duplicate) do { \
663 zval *___tmp; \
664 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
665 ZVAL_ZSTR(___tmp, type, str, duplicate); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
666 add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \
667 } while (0)
668 #define add_rt_assoc_zstrl_ex(arg, key, key_len, type, str, length, duplicate) do { \
669 zval *___tmp; \
670 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
671 ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
672 add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \
673 } while (0)
b0e24970 »
2005-08-19 Unicode support cleanup
674
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
675 #define add_rt_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
676 int ___u_len = length; \
677 UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
678 ___u_str[___u_len] = 0; \
679 if ((flags) & ZSTR_AUTOFREE) { \
680 efree(str); \
5f5faedf »
2006-04-06 Overload 'duplicate' arg as applied to:
681 } \
8ecf8ede »
2009-03-26 - Removed:
682 add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
683 } while (0)
684 #define add_rt_assoc_rt_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
685 UChar *___u_str; \
686 int ___u_len; \
687 if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
688 add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
689 } \
690 if ((flags) & ZSTR_AUTOFREE) { \
691 efree(str); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
692 } \
693 } while (0)
694 #define add_rt_assoc_utf8_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
695 UChar *___u_str; \
696 int ___u_len; \
697 if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
698 add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
699 } \
700 if ((flags) & ZSTR_AUTOFREE) { \
701 efree(str); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
702 } \
703 } while (0)
704
705 #define add_rt_assoc_string_ex(arg, key, key_len, str, flags) add_rt_assoc_stringl_ex(arg, key, key_len, str, strlen(str), flags)
706 #define add_rt_assoc_ascii_string_ex(arg, key, key_len, str, flags) add_rt_assoc_ascii_stringl_ex(arg, key, key_len, str, strlen(str), flags)
707 #define add_rt_assoc_rt_string_ex(arg, key, key_len, str, flags) add_rt_assoc_rt_stringl_ex(arg, key, key_len, str, strlen(str), flags)
708 #define add_rt_assoc_utf8_string_ex(arg, key, key_len, str, flags) add_rt_assoc_utf8_stringl_ex(arg, key, key_len, str, strlen(str), flags)
709
710 #define add_rt_assoc_zval(__arg, __key, __value) add_rt_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value)
711 #define add_rt_assoc_long(__arg, __key, __n) add_rt_assoc_long_ex(__arg, __key, strlen(__key)+1, __n)
712 #define add_rt_assoc_null(__arg, __key) add_rt_assoc_null_ex(__arg, __key, strlen(__key)+1)
713 #define add_rt_assoc_bool(__arg, __key, __b) add_rt_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b)
714 #define add_rt_assoc_resource(__arg, __key, __r) add_rt_assoc_resource_ex(__arg, __key, strlen(__key)+1, __r)
715 #define add_rt_assoc_double(__arg, __key, __d) add_rt_assoc_double_ex(__arg, __key, strlen(__key)+1, __d)
716 #define add_rt_assoc_string(__arg, __key, __str, __duplicate) add_rt_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
717 #define add_rt_assoc_stringl(__arg, __key, __str, __length, __duplicate) add_rt_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
718 #define add_rt_assoc_unicode(__arg, __key, __str, __duplicate) add_rt_assoc_unicode_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
719 #define add_rt_assoc_unicodel(__arg, __key, __str, __length, __duplicate) add_rt_assoc_unicodel_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
720 #define add_rt_assoc_zstr(arg, key, type, str, duplicate) add_rt_assoc_zstr_ex(arg, key, strlen(key)+1, type, str, duplicate)
721 #define add_rt_assoc_zstrl(arg, key, type, str, length, duplicate) add_rt_assoc_zstrl_ex(arg, key, strlen(key)+1, type, str, length, duplicate)
722 #define add_rt_assoc_ascii_string(arg, key, str, flags) add_rt_assoc_ascii_string_ex(arg, key, strlen(key)+1, str, flags)
723 #define add_rt_assoc_ascii_stringl(arg, key, str, length, flags) add_rt_assoc_ascii_stringl_ex(arg, key, strlen(key)+1, str, length, flags)
724 #define add_rt_assoc_rt_string(arg, key, str, flags) add_rt_assoc_rt_stringl_ex(arg, key, strlen(key)+1, str, strlen(str), flags)
725 #define add_rt_assoc_rt_stringl(arg, key, str, length, flags) add_rt_assoc_rt_stringl_ex(arg, key, strlen(key)+1, str, length, flags)
726 #define add_rt_assoc_utf8_string(arg, key, str, flags) add_rt_assoc_utf8_stringl_ex(arg, key, strlen(key)+1, str, strlen(str), flags)
727 #define add_rt_assoc_utf8_stringl(arg, key, str, length, flags) add_rt_assoc_utf8_stringl_ex(arg, key, strlen(key)+1, str, length, flags)
b0e24970 »
2005-08-19 Unicode support cleanup
728
8146078f »
2007-09-27 Improved memory usage by movig constants to read only memory. (Dmitry…
729 ZEND_API int add_utf8_assoc_zval_ex(zval *arg, const char *key, uint key_len, zval *value);
d8652457 »
2006-10-07 Hash functions for UTF-8 keys.
730
731 #define add_utf8_assoc_null_ex(arg, key, key_len) do { \
732 zval *___tmp; \
733 MAKE_STD_ZVAL(___tmp); \
734 ZVAL_NULL(___tmp); \
735 add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
736 } while (0)
737 #define add_utf8_assoc_long_ex(arg, key, key_len, n) do { \
738 zval *___tmp; \
739 MAKE_STD_ZVAL(___tmp); \
740 ZVAL_LONG(___tmp, n); \
741 add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
742 } while (0)
743 #define add_utf8_assoc_bool_ex(arg, key, key_len, b) do { \
744 zval *___tmp; \
745 MAKE_STD_ZVAL(___tmp); \
746 ZVAL_BOOL(___tmp, b); \
747 add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
748 } while (0)
749 #define add_utf8_assoc_resource_ex(arg, key, key_len, r) do { \
750 zval *___tmp; \
751 MAKE_STD_ZVAL(___tmp); \
752 ZVAL_RESOURCE(___tmp, r); \
753 add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
754 } while (0)
755 #define add_utf8_assoc_double_ex(arg, key, key_len, d) do { \
756 zval *___tmp; \
757 MAKE_STD_ZVAL(___tmp); \
758 ZVAL_DOUBLE(___tmp, d); \
759 add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
760 } while (0)
761 #define add_utf8_assoc_stringl_ex(arg, key, key_len, str, length, duplicate) do { \
762 zval *___tmp; \
763 MAKE_STD_ZVAL(___tmp); \
764 ZVAL_STRINGL(___tmp, str, length, duplicate); \
765 add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
766 } while (0)
767 #define add_utf8_assoc_unicode_ex(arg, key, key_len, str, duplicate) do { \
768 zval *___tmp; \
769 MAKE_STD_ZVAL(___tmp); \
770 ZVAL_UNICODE(___tmp, str, duplicate); \
771 add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
772 } while (0)
773 #define add_utf8_assoc_unicodel_ex(arg, key, key_len, str, length, duplicate) do { \
774 zval *___tmp; \
775 MAKE_STD_ZVAL(___tmp); \
776 ZVAL_UNICODEL(___tmp, str, length, duplicate); \
777 add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
778 } while (0)
779 #define add_utf8_assoc_zstr_ex(arg, key, key_len, type, str, duplicate) do { \
780 zval *___tmp; \
781 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
782 ZVAL_ZSTR(___tmp, type, str, duplicate); \
d8652457 »
2006-10-07 Hash functions for UTF-8 keys.
783 add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
784 } while (0)
785 #define add_utf8_assoc_zstrl_ex(arg, key, key_len, type, str, length, duplicate) do { \
786 zval *___tmp; \
787 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
788 ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \
d8652457 »
2006-10-07 Hash functions for UTF-8 keys.
789 add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
790 } while (0)
791
792 #define add_utf8_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
793 int ___u_len = length; \
794 UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
795 ___u_str[___u_len] = 0; \
796 if ((flags) & ZSTR_AUTOFREE) { \
797 efree(str); \
d8652457 »
2006-10-07 Hash functions for UTF-8 keys.
798 } \
8ecf8ede »
2009-03-26 - Removed:
799 add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
d8652457 »
2006-10-07 Hash functions for UTF-8 keys.
800 } while (0)
801 #define add_utf8_assoc_rt_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
802 UChar *___u_str; \
803 int ___u_len; \
804 if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
805 add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
806 } \
807 if ((flags) & ZSTR_AUTOFREE) { \
808 efree(str); \
d8652457 »
2006-10-07 Hash functions for UTF-8 keys.
809 } \
810 } while (0)
811 #define add_utf8_assoc_utf8_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
812 UChar *___u_str; \
813 int ___u_len; \
814 if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
815 add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
816 } \
817 if ((flags) & ZSTR_AUTOFREE) { \
818 efree(str); \
d8652457 »
2006-10-07 Hash functions for UTF-8 keys.
819 } \
820 } while (0)
821
822 #define add_utf8_assoc_string_ex(arg, key, key_len, str, flags) add_utf8_assoc_stringl_ex(arg, key, key_len, str, strlen(str), flags)
823 #define add_utf8_assoc_ascii_string_ex(arg, key, key_len, str, flags) add_utf8_assoc_ascii_stringl_ex(arg, key, key_len, str, strlen(str), flags)
824 #define add_utf8_assoc_rt_string_ex(arg, key, key_len, str, flags) add_utf8_assoc_rt_stringl_ex(arg, key, key_len, str, strlen(str), flags)
825 #define add_utf8_assoc_utf8_string_ex(arg, key, key_len, str, flags) add_utf8_assoc_utf8_stringl_ex(arg, key, key_len, str, strlen(str), flags)
826
827 #define add_utf8_assoc_zval(__arg, __key, __value) add_utf8_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value)
828 #define add_utf8_assoc_long(__arg, __key, __n) add_utf8_assoc_long_ex(__arg, __key, strlen(__key)+1, __n)
829 #define add_utf8_assoc_null(__arg, __key) add_utf8_assoc_null_ex(__arg, __key, strlen(__key)+1)
830 #define add_utf8_assoc_bool(__arg, __key, __b) add_utf8_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b)
831 #define add_utf8_assoc_resource(__arg, __key, __r) add_utf8_assoc_resource_ex(__arg, __key, strlen(__key)+1, __r)
832 #define add_utf8_assoc_double(__arg, __key, __d) add_utf8_assoc_double_ex(__arg, __key, strlen(__key)+1, __d)
833 #define add_utf8_assoc_string(__arg, __key, __str, __duplicate) add_utf8_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
834 #define add_utf8_assoc_stringl(__arg, __key, __str, __length, __duplicate) add_utf8_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
835 #define add_utf8_assoc_unicode(__arg, __key, __str, __duplicate) add_utf8_assoc_unicode_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
836 #define add_utf8_assoc_unicodel(__arg, __key, __str, __length, __duplicate) add_utf8_assoc_unicodel_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
837 #define add_utf8_assoc_zstr(arg, key, type, str, duplicate) add_utf8_assoc_zstr_ex(arg, key, strlen(key)+1, type, str, duplicate)
838 #define add_utf8_assoc_zstrl(arg, key, type, str, length, duplicate) add_utf8_assoc_zstrl_ex(arg, key, strlen(key)+1, type, str, length, duplicate)
839 #define add_utf8_assoc_ascii_string(arg, key, str, flags) add_utf8_assoc_ascii_string_ex(arg, key, strlen(key)+1, str, flags)
840 #define add_utf8_assoc_ascii_stringl(arg, key, str, length, flags) add_utf8_assoc_ascii_stringl_ex(arg, key, strlen(key)+1, str, length, flags)
841 #define add_utf8_assoc_rt_string(arg, key, str, flags) add_utf8_assoc_rt_stringl_ex(arg, key, strlen(key)+1, str, strlen(str), flags)
842 #define add_utf8_assoc_rt_stringl(arg, key, str, length, flags) add_utf8_assoc_rt_stringl_ex(arg, key, strlen(key)+1, str, length, flags)
843 #define add_utf8_assoc_utf8_string(arg, key, str, flags) add_utf8_assoc_utf8_stringl_ex(arg, key, strlen(key)+1, str, strlen(str), flags)
844 #define add_utf8_assoc_utf8_stringl(arg, key, str, length, flags) add_utf8_assoc_utf8_stringl_ex(arg, key, strlen(key)+1, str, length, flags)
845
1e1f3efb »
2006-10-17 Fix thread safety.
846 ZEND_API int add_utf8_property_zval_ex(zval *arg, char *key, uint key_len, zval *value TSRMLS_DC);
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
847
848 #define add_utf8_property_null_ex(arg, key, key_len) do { \
849 zval *___tmp; \
850 MAKE_STD_ZVAL(___tmp); \
851 ZVAL_NULL(___tmp); \
1e1f3efb »
2006-10-17 Fix thread safety.
852 add_utf8_property_zval_ex(arg, key, key_len, ___tmp TSRMLS_CC); \
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
853 zval_ptr_dtor(&___tmp); /* write_property will add 1 to refcount */ \
854 } while (0)
855 #define add_utf8_property_long_ex(arg, key, key_len, n) do { \
856 zval *___tmp; \
857 MAKE_STD_ZVAL(___tmp); \
858 ZVAL_LONG(___tmp, n); \
1e1f3efb »
2006-10-17 Fix thread safety.
859 add_utf8_property_zval_ex(arg, key, key_len, ___tmp TSRMLS_CC); \
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
860 zval_ptr_dtor(&___tmp); /* write_property will add 1 to refcount */ \
861 } while (0)
862 #define add_utf8_property_bool_ex(arg, key, key_len, b) do { \
863 zval *___tmp; \
864 MAKE_STD_ZVAL(___tmp); \
865 ZVAL_BOOL(___tmp, b); \
1e1f3efb »
2006-10-17 Fix thread safety.
866 add_utf8_property_zval_ex(arg, key, key_len, ___tmp TSRMLS_CC); \
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
867 zval_ptr_dtor(&___tmp); /* write_property will add 1 to refcount */ \
868 } while (0)
869 #define add_utf8_property_resource_ex(arg, key, key_len, r) do { \
870 zval *___tmp; \
871 MAKE_STD_ZVAL(___tmp); \
872 ZVAL_RESOURCE(___tmp, r); \
1e1f3efb »
2006-10-17 Fix thread safety.
873 add_utf8_property_zval_ex(arg, key, key_len, ___tmp TSRMLS_CC); \
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
874 zval_ptr_dtor(&___tmp); /* write_property will add 1 to refcount */ \
875 } while (0)
876 #define add_utf8_property_double_ex(arg, key, key_len, d) do { \
877 zval *___tmp; \
878 MAKE_STD_ZVAL(___tmp); \
879 ZVAL_DOUBLE(___tmp, d); \
1e1f3efb »
2006-10-17 Fix thread safety.
880 add_utf8_property_zval_ex(arg, key, key_len, ___tmp TSRMLS_CC); \
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
881 zval_ptr_dtor(&___tmp); /* write_property will add 1 to refcount */ \
882 } while (0)
883 #define add_utf8_property_stringl_ex(arg, key, key_len, str, length, duplicate) do { \
884 zval *___tmp; \
885 MAKE_STD_ZVAL(___tmp); \
886 ZVAL_STRINGL(___tmp, str, length, duplicate); \
1e1f3efb »
2006-10-17 Fix thread safety.
887 add_utf8_property_zval_ex(arg, key, key_len, ___tmp TSRMLS_CC); \
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
888 zval_ptr_dtor(&___tmp); /* write_property will add 1 to refcount */ \
889 } while (0)
890 #define add_utf8_property_unicode_ex(arg, key, key_len, str, duplicate) do { \
891 zval *___tmp; \
892 MAKE_STD_ZVAL(___tmp); \
893 ZVAL_UNICODE(___tmp, str, duplicate); \
1e1f3efb »
2006-10-17 Fix thread safety.
894 add_utf8_property_zval_ex(arg, key, key_len, ___tmp TSRMLS_CC); \
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
895 zval_ptr_dtor(&___tmp); /* write_property will add 1 to refcount */ \
896 } while (0)
897 #define add_utf8_property_unicodel_ex(arg, key, key_len, str, length, duplicate) do { \
898 zval *___tmp; \
899 MAKE_STD_ZVAL(___tmp); \
900 ZVAL_UNICODEL(___tmp, str, length, duplicate); \
1e1f3efb »
2006-10-17 Fix thread safety.
901 add_utf8_property_zval_ex(arg, key, key_len, ___tmp TSRMLS_CC); \
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
902 zval_ptr_dtor(&___tmp); /* write_property will add 1 to refcount */ \
903 } while (0)
904 #define add_utf8_property_zstr_ex(arg, key, key_len, type, str, duplicate) do { \
905 zval *___tmp; \
906 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
907 ZVAL_ZSTR(___tmp, type, str, duplicate); \
1e1f3efb »
2006-10-17 Fix thread safety.
908 add_utf8_property_zval_ex(arg, key, key_len, ___tmp TSRMLS_CC); \
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
909 zval_ptr_dtor(&___tmp); /* write_property will add 1 to refcount */ \
910 } while (0)
911 #define add_utf8_property_zstrl_ex(arg, key, key_len, type, str, length, duplicate) do { \
912 zval *___tmp; \
913 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
914 ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \
1e1f3efb »
2006-10-17 Fix thread safety.
915 add_utf8_property_zval_ex(arg, key, key_len, ___tmp TSRMLS_CC); \
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
916 zval_ptr_dtor(&___tmp); /* write_property will add 1 to refcount */ \
917 } while (0)
918
919 #define add_utf8_property_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
920 int ___u_len = length; \
921 UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
922 ___u_str[___u_len] = 0; \
923 if ((flags) & ZSTR_AUTOFREE) { \
924 efree(str); \
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
925 } \
8ecf8ede »
2009-03-26 - Removed:
926 add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
927 } while (0)
928 #define add_utf8_property_rt_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
929 UChar *___u_str; \
930 int ___u_len; \
931 if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
932 add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
933 } \
934 if ((flags) & ZSTR_AUTOFREE) { \
935 efree(str); \
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
936 } \
937 } while (0)
938 #define add_utf8_property_utf8_stringl_ex(arg, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
939 UChar *___u_str; \
940 int ___u_len; \
941 if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
942 add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
943 } \
944 if ((flags) & ZSTR_AUTOFREE) { \
945 efree(str); \
2602e49e »
2006-10-17 Implement add_utf8_property_* API.
946 } \
947 } while (0)
d8652457 »
2006-10-07 Hash functions for UTF-8 keys.
948
0f1209ab »
2006-02-21 Portable unicode string API:
949 ZEND_API int add_u_assoc_zval_ex(zval *arg, zend_uchar type, zstr key, uint key_len, zval *value);
b80cb7bd »
2005-08-11 Unicode support
950
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
951 #define add_u_assoc_null_ex(arg, type, key, key_len) do { \
952 zval *___tmp; \
953 MAKE_STD_ZVAL(___tmp); \
954 ZVAL_NULL(___tmp); \
955 add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \
956 } while (0)
957 #define add_u_assoc_long_ex(arg, type, key, key_len, n) do { \
958 zval *___tmp; \
959 MAKE_STD_ZVAL(___tmp); \
960 ZVAL_LONG(___tmp, n); \
961 add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \
962 } while (0)
963 #define add_u_assoc_bool_ex(arg, type, key, key_len, b) do { \
964 zval *___tmp; \
965 MAKE_STD_ZVAL(___tmp); \
966 ZVAL_BOOL(___tmp, b); \
967 add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \
968 } while (0)
969 #define add_u_assoc_resource_ex(arg, type, key, key_len, r) do { \
970 zval *___tmp; \
971 MAKE_STD_ZVAL(___tmp); \
972 ZVAL_RESOURCE(___tmp, r); \
973 add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \
974 } while (0)
975 #define add_u_assoc_double_ex(arg, type, key, key_len, d) do { \
976 zval *___tmp; \
977 MAKE_STD_ZVAL(___tmp); \
978 ZVAL_DOUBLE(___tmp, d); \
979 add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \
980 } while (0)
981 #define add_u_assoc_stringl_ex(arg, type, key, key_len, str, length, duplicate) do { \
982 zval *___tmp; \
983 MAKE_STD_ZVAL(___tmp); \
984 ZVAL_STRINGL(___tmp, str, length, duplicate); \
985 add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \
986 } while (0)
987 #define add_u_assoc_unicode_ex(arg, type, key, key_len, str, duplicate) do { \
988 zval *___tmp; \
989 MAKE_STD_ZVAL(___tmp); \
990 ZVAL_UNICODE(___tmp, str, duplicate); \
991 add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \
992 } while (0)
993 #define add_u_assoc_unicodel_ex(arg, type, key, key_len, str, length, duplicate) do { \
994 zval *___tmp; \
995 MAKE_STD_ZVAL(___tmp); \
996 ZVAL_UNICODEL(___tmp, str, length, duplicate); \
997 add_u_assoc_zval_ex(arg, type, key, key_len, ___tmp); \
998 } while (0)
999 #define add_u_assoc_zstr_ex(arg, key_type, key, key_len, type, str, duplicate) do { \
1000 zval *___tmp; \
1001 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
1002 ZVAL_ZSTR(___tmp, type, str, duplicate); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1003 add_u_assoc_zval_ex(arg, key_type, key, key_len, ___tmp); \
1004 } while (0)
1005 #define add_u_assoc_zstrl_ex(arg, key_type, key, key_len, type, str, length, duplicate) do { \
1006 zval *___tmp; \
1007 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
1008 ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1009 add_u_assoc_zval_ex(arg, key_type, key, key_len, ___tmp); \
1010 } while (0)
b80cb7bd »
2005-08-11 Unicode support
1011
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1012 #define add_u_assoc_ascii_stringl_ex(arg, type, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
1013 int ___u_len = length; \
1014 UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
1015 ___u_str[___u_len] = 0; \
1016 if ((flags) & ZSTR_AUTOFREE) { \
1017 efree(str); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1018 } \
8ecf8ede »
2009-03-26 - Removed:
1019 add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1020 } while (0)
1021 #define add_u_assoc_rt_stringl_ex(arg, type, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
1022 UChar *___u_str; \
1023 int ___u_len; \
1024 if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
1025 add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \
1026 } \
1027 if ((flags) & ZSTR_AUTOFREE) { \
1028 efree(str); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1029 } \
1030 } while (0)
1031 #define add_u_assoc_utf8_stringl_ex(arg, type, key, key_len, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
1032 UChar *___u_str; \
1033 int ___u_len; \
1034 if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
1035 add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \
1036 } \
1037 if ((flags) & ZSTR_AUTOFREE) { \
1038 efree(str); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1039 } \
1040 } while (0)
1041
1042 #define add_u_assoc_string_ex(arg, key_type, key, key_len, str, flags) add_u_assoc_stringl_ex(arg, key_type, key, key_len, str, strlen(str), flags)
1043 #define add_u_assoc_ascii_string_ex(arg, key_type, key, key_len, str, flags) add_u_assoc_ascii_stringl_ex(arg, key_type, key, key_len, str, strlen(str), flags)
1044 #define add_u_assoc_rt_string_ex(arg, key_type, key, key_len, str, flags) add_u_assoc_rt_stringl_ex(arg, key_type, key, key_len, str, strlen(str), flags)
1045 #define add_u_assoc_utf8_string_ex(arg, key_type, key, key_len, str, flags) add_u_assoc_utf8_stringl_ex(arg, key_type, key, key_len, str, strlen(str), flags)
1046
aa4cd53b »
2007-01-11 - Consistency: macros shall be uppercased (as requested by Andrei)
1047 #define add_u_assoc_zval(__arg, __key_type, __key, __value) add_u_assoc_zval_ex(__arg, __key_type, __key, ZSTR_LEN(__key_type, __key)+1, __value)
1048 #define add_u_assoc_long(__arg, __key_type, __key, __n) add_u_assoc_long_ex(__arg, __key_type, __key, ZSTR_LEN(__key_type, __key)+1, __n)
1049 #define add_u_assoc_null(__arg, __key_type, __key) add_u_assoc_null_ex(__arg, __key_type, __key, ZSTR_LEN(__key_type, __key)+1)
1050 #define add_u_assoc_bool(__arg, __key_type, __key, __b) add_u_assoc_bool_ex(__arg, __key_type, __key, ZSTR_LEN(__key_type, __key)+1, __b)
1051 #define add_u_assoc_resource(__arg, __key_type, __key, __r) add_u_assoc_resource_ex(__arg, __key_type, __key, ZSTR_LEN(__key_type, __key)+1, __r)
1052 #define add_u_assoc_double(__arg, __key_type, __key, __d) add_u_assoc_double_ex(__arg, __key_type, __key, ZSTR_LEN(__key_type, __key)+1, __d)
1053 #define add_u_assoc_string(__arg, __key_type, __key, __str, __duplicate) add_u_assoc_string_ex(__arg, __key_type, __key, ZSTR_LEN(__key_type, __key)+1, __str, __duplicate)
1054 #define add_u_assoc_stringl(__arg, __key_type, __key, __str, __length, __duplicate) add_u_assoc_stringl_ex(__arg, __key_type, __key, ZSTR_LEN(__key_type, __key)+1, __str, __length, __duplicate)
1055 #define add_u_assoc_unicode(__arg, __key_type, __key, __str, __duplicate) add_u_assoc_unicode_ex(__arg, __key_type, __key, ZSTR_LEN(__key_type, __key)+1, __str, __duplicate)
1056 #define add_u_assoc_unicodel(__arg, __key_type, __key, __str, __length, __duplicate) add_u_assoc_unicodel_ex(__arg, __key_type, __key, ZSTR_LEN(__key_type, __key)+1, __str, __length, __duplicate)
1057 #define add_u_assoc_zstr(arg, key_type, key, type, str, duplicate) add_u_assoc_zstr_ex(arg, key_type, key, ZSTR_LEN(__key_type, __key)+1, type, str, duplicate)
1058 #define add_u_assoc_zstrl(arg, key_type, key, type, str, length, duplicate) add_u_assoc_zstrl_ex(arg, key_type, key, ZSTR_LEN(__key_type, __key)+1, type, str, length, duplicate)
1059 #define add_u_assoc_ascii_string(arg, key_type, key, str, flags) add_u_assoc_ascii_string_ex(arg, key_type, key, ZSTR_LEN(__key_type, __key)+1, str, flags)
1060 #define add_u_assoc_ascii_stringl(arg, key_type, key, str, length, flags) add_u_assoc_ascii_stringl_ex(arg, key_type, key, ZSTR_LEN(__key_type, __key)+1, str, length, flags)
1061 #define add_u_assoc_rt_string(arg, key_type, key, str, flags) add_rt_assoc_u_stringl_ex(arg, key_type, key, ZSTR_LEN(__key_type, __key)+1, str, strlen(str), flags)
1062 #define add_u_assoc_rt_stringl(arg, key_type, key, str, length, flags) add_u_assoc_rt_stringl_ex(arg, key_type, key, ZSTR_LEN(__key_type, __key)+1, str, length, flags)
1063 #define add_u_assoc_utf8_string(arg, key_type, key, str, flags) add_u_assoc_utf8_stringl_ex(arg, key_type, key, ZSTR_LEN(__key_type, __key)+1, str, strlen(str), flags)
1064 #define add_u_assoc_utf8_stringl(arg, key_type, key, str, length, flags) add_u_assoc_utf8_stringl_ex(arg, key_type, key, ZSTR_LEN(__key_type, __key)+1, str, length, flags)
0611acb9 »
2001-01-31 - Change unset() functions to null(). unset() is legacy
1065
05bd788e »
2005-10-28 Fixed bug #34879 (str_replace, array_map corrupt negative array indexes)
1066 ZEND_API int add_index_zval(zval *arg, ulong index, zval *value);
6847fefa »
1999-10-04 added add_*_resource() and add_*_bool() functions
1067
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1068 #define add_index_null(arg, idx) do { \
1069 zval *___tmp; \
1070 MAKE_STD_ZVAL(___tmp); \
1071 ZVAL_NULL(___tmp); \
1072 add_index_zval(arg, idx, ___tmp); \
1073 } while (0)
1074 #define add_index_long(arg, idx, n) do { \
1075 zval *___tmp; \
1076 MAKE_STD_ZVAL(___tmp); \
1077 ZVAL_LONG(___tmp, n); \
1078 add_index_zval(arg, idx, ___tmp); \
1079 } while (0)
1080 #define add_index_bool(arg, idx, b) do { \
1081 zval *___tmp; \
1082 MAKE_STD_ZVAL(___tmp); \
1083 ZVAL_BOOL(___tmp, b); \
1084 add_index_zval(arg, idx, ___tmp); \
1085 } while (0)
1086 #define add_index_resource(arg, idx, r) do { \
1087 zval *___tmp; \
1088 MAKE_STD_ZVAL(___tmp); \
1089 ZVAL_RESOURCE(___tmp, r); \
1090 add_index_zval(arg, idx, ___tmp); \
1091 } while (0)
1092 #define add_index_double(arg, idx, d) do { \
1093 zval *___tmp; \
1094 MAKE_STD_ZVAL(___tmp); \
1095 ZVAL_DOUBLE(___tmp, d); \
1096 add_index_zval(arg, idx, ___tmp); \
1097 } while (0)
1098 #define add_index_stringl(arg, idx, str, length, duplicate) do { \
1099 zval *___tmp; \
1100 MAKE_STD_ZVAL(___tmp); \
1101 ZVAL_STRINGL(___tmp, str, length, duplicate); \
1102 add_index_zval(arg, idx, ___tmp); \
1103 } while (0)
1104 #define add_index_unicode(arg, idx, str, duplicate) do { \
1105 zval *___tmp; \
1106 MAKE_STD_ZVAL(___tmp); \
1107 ZVAL_UNICODE(___tmp, str, duplicate); \
1108 add_index_zval(arg, idx, ___tmp); \
1109 } while (0)
1110 #define add_index_unicodel(arg, idx, str, length, duplicate) do { \
1111 zval *___tmp; \
1112 MAKE_STD_ZVAL(___tmp); \
1113 ZVAL_UNICODEL(___tmp, str, length, duplicate); \
1114 add_index_zval(arg, idx, ___tmp); \
1115 } while (0)
1116 #define add_index_zstr(arg, idx, type, str, duplicate) do { \
1117 zval *___tmp; \
1118 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
1119 ZVAL_ZSTR(___tmp, type, str, duplicate); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1120 add_index_zval(arg, idx, ___tmp); \
1121 } while (0)
1122 #define add_index_zstrl(arg, idx, type, str, length, duplicate) do { \
1123 zval *___tmp; \
1124 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
1125 ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1126 add_index_zval(arg, idx, ___tmp); \
1127 } while (0)
b0e24970 »
2005-08-19 Unicode support cleanup
1128
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1129 #define add_index_ascii_stringl(arg, idx, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
1130 int ___u_len = length; \
1131 UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
1132 ___u_str[___u_len] = 0; \
1133 if ((flags) & ZSTR_AUTOFREE) { \
1134 efree(str); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1135 } \
8ecf8ede »
2009-03-26 - Removed:
1136 add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1137 } while (0)
1138 #define add_index_rt_stringl(arg, idx, str, length, flags) do {\
8ecf8ede »
2009-03-26 - Removed:
1139 UChar *___u_str; \
1140 int ___u_len; \
1141 if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
1142 add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \
1143 } \
1144 if ((flags) & ZSTR_AUTOFREE) { \
1145 efree(str); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1146 } \
1147 } while (0)
1148 #define add_index_utf8_stringl(arg, idx, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
1149 UChar *___u_str; \
1150 int ___u_len; \
1151 if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
1152 add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \
1153 } \
1154 if ((flags) & ZSTR_AUTOFREE) { \
1155 efree(str); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1156 } \
1157 } while (0)
ef95a346 »
2001-01-20 - Patch from Sterling. Add API calls to add zval's as array indeces/
1158
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1159 #define add_index_string(arg, idx, str, flags) add_index_stringl(arg, idx, str, strlen(str), flags)
1160 #define add_index_ascii_string(arg, idx, str, flags) add_index_ascii_stringl(arg, idx, str, strlen(str), flags)
1161 #define add_index_rt_string(arg, idx, str, flags) add_index_rt_stringl(arg, idx, str, strlen(str), flags)
1162 #define add_index_utf8_string(arg, idx, str, flags) add_index_utf8_stringl(arg, idx, str, strlen(str), flags)
b0e24970 »
2005-08-19 Unicode support cleanup
1163
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1164 ZEND_API int add_next_index_zval(zval *arg, zval *value);
b0e24970 »
2005-08-19 Unicode support cleanup
1165
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1166 #define add_next_index_null(arg) do { \
1167 zval *___tmp; \
1168 MAKE_STD_ZVAL(___tmp); \
1169 ZVAL_NULL(___tmp); \
1170 add_next_index_zval(arg, ___tmp); \
1171 } while (0)
1172 #define add_next_index_long(arg, n) do { \
1173 zval *___tmp; \
1174 MAKE_STD_ZVAL(___tmp); \
1175 ZVAL_LONG(___tmp, n); \
1176 add_next_index_zval(arg, ___tmp); \
1177 } while (0)
1178 #define add_next_index_bool(arg, b) do { \
1179 zval *___tmp; \
1180 MAKE_STD_ZVAL(___tmp); \
1181 ZVAL_BOOL(___tmp, b); \
1182 add_next_index_zval(arg, ___tmp); \
1183 } while (0)
1184 #define add_next_index_resource(arg, r) do { \
1185 zval *___tmp; \
1186 MAKE_STD_ZVAL(___tmp); \
1187 ZVAL_RESOURCE(___tmp, r); \
1188 add_next_index_zval(arg, ___tmp); \
1189 } while (0)
1190 #define add_next_index_double(arg, d) do { \
1191 zval *___tmp; \
1192 MAKE_STD_ZVAL(___tmp); \
1193 ZVAL_DOUBLE(___tmp, d); \
1194 add_next_index_zval(arg, ___tmp); \
1195 } while (0)
1196 #define add_next_index_stringl(arg, str, length, duplicate) do { \
1197 zval *___tmp; \
1198 MAKE_STD_ZVAL(___tmp); \
1199 ZVAL_STRINGL(___tmp, str, length, duplicate); \
1200 add_next_index_zval(arg, ___tmp); \
1201 } while (0)
1202 #define add_next_index_unicode(arg, str, duplicate) do { \
1203 zval *___tmp; \
1204 MAKE_STD_ZVAL(___tmp); \
1205 ZVAL_UNICODE(___tmp, str, duplicate); \
1206 add_next_index_zval(arg, ___tmp); \
1207 } while (0)
1208 #define add_next_index_unicodel(arg, str, length, duplicate) do { \
1209 zval *___tmp; \
1210 MAKE_STD_ZVAL(___tmp); \
1211 ZVAL_UNICODEL(___tmp, str, length, duplicate); \
1212 add_next_index_zval(arg, ___tmp); \
1213 } while (0)
1214 #define add_next_index_zstr(arg, type, str, duplicate) do { \
1215 zval *___tmp; \
1216 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
1217 ZVAL_ZSTR(___tmp, type, str, duplicate); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1218 add_next_index_zval(arg, ___tmp); \
1219 } while (0)
1220 #define add_next_index_zstrl(arg, type, str, length, duplicate) do { \
1221 zval *___tmp; \
1222 MAKE_STD_ZVAL(___tmp); \
e722dce5 »
2006-12-19 - Marcus was too quick. Let's put type before zstr in the macros.
1223 ZVAL_ZSTRL(___tmp, type, str, length, duplicate); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1224 add_next_index_zval(arg, ___tmp); \
1225 } while (0)
b0e24970 »
2005-08-19 Unicode support cleanup
1226
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1227 #define add_next_index_ascii_stringl(arg, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
1228 int ___u_len = length; \
1229 UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
1230 ___u_str[___u_len] = 0; \
1231 if ((flags) & ZSTR_AUTOFREE) { \
1232 efree((char*)(str)); \
5f5faedf »
2006-04-06 Overload 'duplicate' arg as applied to:
1233 } \
8ecf8ede »
2009-03-26 - Removed:
1234 add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1235 } while (0)
1236 #define add_next_index_rt_stringl(arg, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
1237 UChar *___u_str; \
1238 int ___u_len; \
1239 if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
1240 add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \
1241 } \
1242 if ((flags) & ZSTR_AUTOFREE) { \
1243 efree((char*)(str)); \
5f5faedf »
2006-04-06 Overload 'duplicate' arg as applied to:
1244 } \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1245 } while (0)
1246 #define add_next_index_utf8_stringl(arg, str, length, flags) do { \
8ecf8ede »
2009-03-26 - Removed:
1247 UChar *___u_str; \
1248 int ___u_len; \
1249 if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
1250 add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \
1251 } \
1252 if ((flags) & ZSTR_AUTOFREE) { \
1253 efree((char*)(str)); \
128548a5 »
2006-09-19 Disabled autoconversion of hash keys (from string to unicode) for PHP…
1254 } \
1255 } while (0)
1256
1257 #define add_next_index_string(arg, str, flags) add_next_index_stringl(arg, str, strlen(str), flags)
1258 #define add_next_index_ascii_string(arg, str, flags) add_next_index_ascii_stringl(arg, str, strlen(str), flags)
1259 #define add_next_index_rt_string(arg, str, flags) add_next_index_rt_stringl(arg, str, strlen(str), flags)
1260 #define add_next_index_utf8_string(arg, str, flags) add_next_index_utf8_stringl(arg, str, strlen(str), flags)
1261
1262 /* unset() functions are only suported for legacy modules and null() functions should be used */
1263 #define add_assoc_unset(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1)
1264 #define add_index_unset(__arg, __key) add_index_null(__arg, __key)
1265 #define add_next_index_unset(__arg) add_next_index_null(__arg)
1266 #define add_property_unset(__arg, __key) add_property_null(__arg, __key)
8f6f97a7 »
2005-08-23 Unicode support
1267
8146078f »
2007-09-27 Improved memory usage by movig constants to read only memory. (Dmitry…
1268 ZEND_API int add_get_assoc_string_ex(zval *arg, const char *key, uint key_len, const char *str, void **dest, int duplicate);
1269 ZEND_API int add_get_assoc_stringl_ex(zval *arg, const char *key, uint key_len, const char *str, uint length, void **dest, int duplicate);
ef95a346 »
2001-01-20 - Patch from Sterling. Add API calls to add zval's as array indeces/
1270
1271 #define add_get_assoc_string(__arg, __key, __str, __dest, __duplicate) add_get_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __dest, __duplicate)
1272 #define add_get_assoc_stringl(__arg, __key, __str, __length, __dest, __duplicate) add_get_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __dest, __duplicate)
573b4602 »
1999-04-07 Zend Library
1273
05bd788e »
2005-10-28 Fixed bug #34879 (str_replace, array_map corrupt negative array indexes)
1274 ZEND_API int add_get_index_long(zval *arg, ulong idx, long l, void **dest);
1275 ZEND_API int add_get_index_double(zval *arg, ulong idx, double d, void **dest);
8146078f »
2007-09-27 Improved memory usage by movig constants to read only memory. (Dmitry…
1276 ZEND_API int add_get_index_string(zval *arg, ulong idx, const char *str, void **dest, int duplicate);
1277 ZEND_API int add_get_index_stringl(zval *arg, ulong idx, const char *str, uint length, void **dest, int duplicate);
05bd788e »
2005-10-28 Fixed bug #34879 (str_replace, array_map corrupt negative array indexes)
1278 ZEND_API int add_get_index_unicode(zval *arg, ulong idx, UChar *str, void **dest, int duplicate);
1279 ZEND_API int add_get_index_unicodel(zval *arg, ulong idx, UChar *str, uint length, void **dest, int duplicate);
573b4602 »
1999-04-07 Zend Library
1280
a5f867f3 »
2008-08-12 - Constness (Added const qualifier to several function parameters)
1281 ZEND_API int add_property_long_ex(zval *arg, const char *key, uint key_len, long l TSRMLS_DC);
1282 ZEND_API int add_property_null_ex(zval *arg, const char *key, uint key_len TSRMLS_DC);
1283 ZEND_API int add_property_bool_ex(zval *arg, const char *key, uint key_len, int b TSRMLS_DC);
1284 ZEND_API int add_property_resource_ex(zval *arg, const char *key, uint key_len, long r TSRMLS_DC);
1285 ZEND_API int add_property_double_ex(zval *arg, const char *key, uint key_len, double d TSRMLS_DC);
1286 ZEND_API int add_property_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate TSRMLS_DC);
1287 ZEND_API int add_property_stringl_ex(zval *arg, const char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC);
1288 ZEND_API int add_property_zval_ex(zval *arg, const char *key, uint key_len, zval *value TSRMLS_DC);
1289 ZEND_API int add_property_ascii_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate TSRMLS_DC);
1290 ZEND_API int add_property_ascii_stringl_ex(zval *arg, const char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC);
1291 ZEND_API int add_property_rt_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate TSRMLS_DC);
1292 ZEND_API int add_property_rt_stringl_ex(zval *arg, const char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC);
1293 ZEND_API int add_property_unicode_ex(zval *arg, const char *key, uint key_len, UChar *str, int duplicate TSRMLS_DC);
1294 ZEND_API int add_property_unicodel_ex(zval *arg, const char *key, uint key_len, UChar *str, uint length, int duplicate TSRMLS_DC);
1295 ZEND_API int add_property_utf8_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate TSRMLS_DC);
1296 ZEND_API int add_property_utf8_stringl_ex(zval *arg, const char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC);
7dcebde6 »
2007-01-07 Add add_property_zstr(l)(_ex)()
1297 ZEND_API int add_property_zstr_ex(zval *arg, char *key, uint key_len, zend_uchar type, zstr str, int duplicate TSRMLS_DC);
1298 ZEND_API int add_property_zstrl_ex(zval *arg, char *key, uint key_len, zend_uchar type, zstr str, uint length, int duplicate TSRMLS_DC);
eccc5368 »
2003-01-14 Make add_property_ functions work via write_property handler
1299
1300 #define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key)+1, __n TSRMLS_CC)
1301 #define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key) + 1 TSRMLS_CC)
1302 #define add_property_bool(__arg, __key, __b) add_property_bool_ex(__arg, __key, strlen(__key)+1, __b TSRMLS_CC)
1303 #define add_property_resource(__arg, __key, __r) add_property_resource_ex(__arg, __key, strlen(__key)+1, __r TSRMLS_CC)
2e5d0a3a »
2006-02-21 WS
1304 #define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d TSRMLS_CC)
eccc5368 »
2003-01-14 Make add_property_ functions work via write_property handler
1305 #define add_property_string(__arg, __key, __str, __duplicate) add_property_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
1306 #define add_property_stringl(__arg, __key, __str, __length, __duplicate) add_property_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
dd2e2abc »
2006-08-25 Fix some API definitions.
1307 #define add_property_ascii_string(__arg, __key, __str, __duplicate) add_property_ascii_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
1308 #define add_property_ascii_stringl(__arg, __key, __str, __length, __duplicate) add_property_ascii_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
1309 #define add_property_rt_string(__arg, __key, __str, __duplicate) add_property_rt_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
8f6f97a7 »
2005-08-23 Unicode support
1310 #define add_property_rt_stringl(__arg, __key, __str, __length, __duplicate) add_property_rt_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
11ca9006 »
2006-08-28 Add APIs for UTF-8 strings (common with XML, PCRE, etc)
1311 #define add_property_utf8_string(__arg, __key, __str, __duplicate) add_property_utf8_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
1312 #define add_property_utf8_stringl(__arg, __key, __str, __length, __duplicate) add_property_utf8_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
2e5d0a3a »
2006-02-21 WS
1313 #define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value TSRMLS_CC)
227295a4 »
2006-01-17 Unicode stuff is changed according to decision maden on PDM.
1314 #define add_property_unicode(__arg, __key, __str, __duplicate) add_property_unicode_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
1315 #define add_property_unicodel(__arg, __key, __str, __length, __duplicate) add_property_unicodel_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
7dcebde6 »
2007-01-07 Add add_property_zstr(l)(_ex)()
1316 #define add_property_zstr(__arg, __key, __type, __str, __duplicate) add_property_zstr_ex(__arg, __key, strlen(__key)+1, __type, __str, __duplicate TSRMLS_CC)
1317 #define add_property_zstrl(__arg, __key, __type, __str, __length, __duplicate) add_property_zstrl_ex(__arg, __key, strlen(__key)+1, __type, __str, __length, __duplicate TSRMLS_CC)
92b4013e »
2003-08-05 Try to put an end to the endless number of call_user_function variants.
1318
f8bbafd6 »
2003-08-03 ntroduce infrastructure for supplying information about arguments,
1319 ZEND_API int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, zend_uint param_count, zval *params[] TSRMLS_DC);
1320 ZEND_API int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *function_name, zval **retval_ptr_ptr, zend_uint param_count, zval **params[], int no_separation, HashTable *symbol_table TSRMLS_DC);
92b4013e »
2003-08-05 Try to put an end to the endless number of call_user_function variants.
1321
a99fad3b »
2008-08-12 MFB: move empty_fcall_info* to const table
1322 ZEND_API extern const zend_fcall_info empty_fcall_info;
1323 ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
92b4013e »
2003-08-05 Try to put an end to the endless number of call_user_function variants.
1324
5925a262 »
2006-05-27 - Take care of refcounting in zend_fcall_info_*() functions
1325 /** Build zend_call_info/cache from a zval*
9114bc25 »
2006-05-25 - Ease writing functions that deal with php function 'pointers'
1326 *
1327 * Caller is responsible to provide a return value, otherwise the we will crash.
1328 * fci->retval_ptr_ptr = NULL;
1329 * In order to pass parameters the following members need to be set:
1330 * fci->param_count = 0;
1331 * fci->params = NULL;
97d03722 »
2006-10-11 Extend zend_fcall_info_args functions. (Patch from Mike Wallner)
1332 * The callable_name argument may be NULL.
f7a0a44b »
2008-02-02 - MFB static callable message mess
1333 * Set check_flags to IS_CALLABLE_STRICT for every new usage!
9114bc25 »
2006-05-25 - Ease writing functions that deal with php function 'pointers'
1334 */
f7a0a44b »
2008-02-02 - MFB static callable message mess
1335 ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval *callable_name, char **error TSRMLS_DC);
5925a262 »
2006-05-27 - Take care of refcounting in zend_fcall_info_*() functions
1336
10f0e0a5 »
2007-02-08 - Fix potential issue with 'f'-parameter parsing
1337 /** Clear argumens connected with zend_fcall_info *fci
1338 * If free_mem is not zero then the params array gets free'd as well
1339 */
70777b7d »
2007-02-08 - More ZEND_API's
1340 ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, int free_mem);
10f0e0a5 »
2007-02-08 - Fix potential issue with 'f'-parameter parsing
1341
1342 /** Save current arguments from zend_fcall_info *fci
1343 * params array will be set to NULL
1344 */
70777b7d »
2007-02-08 - More ZEND_API's
1345 ZEND_API void zend_fcall_info_args_save(zend_fcall_info *fci, int *param_count, zval ****params);
10f0e0a5 »
2007-02-08 - Fix potential issue with 'f'-parameter parsing
1346
1347 /** Free arguments connected with zend_fcall_info *fci andset back saved ones.
1348 */
70777b7d »
2007-02-08 - More ZEND_API's
1349 ZEND_API void zend_fcall_info_args_restore(zend_fcall_info *fci, int param_count, zval ***params);
1350
5925a262 »
2006-05-27 - Take care of refcounting in zend_fcall_info_*() functions
1351 /** Set or clear the arguments in the zend_call_info struct taking care of
1352 * refcount. If args is NULL and arguments are set then those are cleared.
1353 */
9114bc25 »
2006-05-25 - Ease writing functions that deal with php function 'pointers'
1354 ZEND_API int zend_fcall_info_args(zend_fcall_info *fci, zval *args TSRMLS_DC);
5925a262 »
2006-05-27 - Take care of refcounting in zend_fcall_info_*() functions
1355
97d03722 »
2006-10-11 Extend zend_fcall_info_args functions. (Patch from Mike Wallner)
1356 /** Set arguments in the zend_fcall_info struct taking care of refcount.
1357 * If argc is 0 the arguments which are set will be cleared, else pass
1358 * a variable amount of zval** arguments.
1359 */
10f0e0a5 »
2007-02-08 - Fix potential issue with 'f'-parameter parsing
1360 ZEND_API int zend_fcall_info_argp(zend_fcall_info *fci TSRMLS_DC, int argc, zval ***argv);
1361
1362 /** Set arguments in the zend_fcall_info struct taking care of refcount.
1363 * If argc is 0 the arguments which are set will be cleared, else pass
1364 * a variable amount of zval** arguments.
1365 */
1366 ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc, va_list *argv);
1367
1368 /** Set arguments in the zend_fcall_info struct taking care of refcount.
1369 * If argc is 0 the arguments which are set will be cleared, else pass
1370 * a variable amount of zval** arguments.
1371 */
97d03722 »
2006-10-11 Extend zend_fcall_info_args functions. (Patch from Mike Wallner)
1372 ZEND_API int zend_fcall_info_argn(zend_fcall_info *fci TSRMLS_DC, int argc, ...);
1373
5925a262 »
2006-05-27 - Take care of refcounting in zend_fcall_info_*() functions
1374 /** Call a function using information created by zend_fcall_info_init()/args().
1375 * If args is given then those replace the arguement info in fci is temporarily.
1376 */
9114bc25 »
2006-05-25 - Ease writing functions that deal with php function 'pointers'
1377 ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval **retval, zval *args TSRMLS_DC);
92b4013e »
2003-08-05 Try to put an end to the endless number of call_user_function variants.
1378
9114bc25 »
2006-05-25 - Ease writing functions that deal with php function 'pointers'
1379 ZEND_API int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TSRMLS_DC);
573b4602 »
1999-04-07 Zend Library
1380
a5f867f3 »
2008-08-12 - Constness (Added const qualifier to several function parameters)
1381 ZEND_API int zend_set_hash_symbol(zval *symbol, const char *name, int name_length, zend_bool is_ref, int num_symbol_tables, ...);
f962a35d »
1999-12-04 Added zend_set_hash_symbol() function.
1382
11bcaedf »
2004-10-04 - Rename delete_global_variable() to zend_delete_global_variable()
1383 ZEND_API int zend_delete_global_variable(char *name, int name_len TSRMLS_DC);
0f1209ab »
2006-02-21 Portable unicode string API:
1384 ZEND_API int zend_u_delete_global_variable(zend_uchar type, zstr name, int name_len TSRMLS_DC);
b80cb7bd »
2005-08-11 Unicode support
1385
1d33a3e9 »
2005-07-04 Fixed bug #31158 (array_splice on $GLOBALS crashes)
1386 ZEND_API void zend_reset_all_cv(HashTable *symbol_table TSRMLS_DC);
1387
1d0f893b »
2008-04-29 Lazy EG(active_symbol_table) initialization
1388 ZEND_API void zend_rebuild_symbol_table(TSRMLS_D);
1389
4f6c95d1 »
2001-08-11 Whitespace
1390 #define add_method(arg, key, method) add_assoc_function((arg), (key), (method))
573b4602 »
1999-04-07 Zend Library
1391
a35c61af »
2002-09-16 MFZE1
1392 ZEND_API ZEND_FUNCTION(display_disabled_function);
a700180f »
2003-03-03 commiting zend_disable_class patch for George:
1393 ZEND_API ZEND_FUNCTION(display_disabled_class);
1727c6a2 »
2004-02-20 more EXTERN_C wrapping of ZEND_API prototypes
1394 END_EXTERN_C()
a35c61af »
2002-09-16 MFZE1
1395
bcddfd47 »
2001-07-10 cleaned up the RETVAL_ RETURN_ and ZVAL_ macros
1396 #if ZEND_DEBUG
1397 #define CHECK_ZVAL_STRING(z) \
b424a326 »
2006-02-20 Preparation for portable string API (use macroses to access zval).
1398 if (Z_STRVAL_P(z)[Z_STRLEN_P(z)] != '\0') { zend_error(E_WARNING, "String is not zero-terminated (%s)", Z_STRVAL_P(z)); }
43ebb868 »
2001-07-16 Fix bug #10287 - avoid crashing under a bogus usage of list()
1399 #define CHECK_ZVAL_STRING_REL(z) \
b424a326 »
2006-02-20 Preparation for portable string API (use macroses to access zval).
1400 if (Z_STRVAL_P(z)[Z_STRLEN_P(z)] != '\0') { zend_error(E_WARNING, "String is not zero-terminated (%s) (source: %s:%d)", Z_STRVAL_P(z) ZEND_FILE_LINE_RELAY_CC); }
b80cb7bd »
2005-08-11 Unicode support
1401 #define CHECK_ZVAL_UNICODE(z) \
b424a326 »
2006-02-20 Preparation for portable string API (use macroses to access zval).
1402 if (Z_USTRVAL_P(z)[Z_USTRLEN_P(z)] != 0 ) { zend_error(E_WARNING, "String is not zero-terminated"); }
b80cb7bd »
2005-08-11 Unicode support
1403 #define CHECK_ZVAL_UNICODE_REL(z) \
b424a326 »
2006-02-20 Preparation for portable string API (use macroses to access zval).
1404 if (Z_USTRVAL_P(z)[Z_USTRLEN_P(z)] != 0) { zend_error(E_WARNING, "String is not zero-terminated (source: %s:%d)", ZEND_FILE_LINE_RELAY_C); }
bcddfd47 »
2001-07-10 cleaned up the RETVAL_ RETURN_ and ZVAL_ macros
1405 #else
1406 #define CHECK_ZVAL_STRING(z)
43ebb868 »
2001-07-16 Fix bug #10287 - avoid crashing under a bogus usage of list()
1407 #define CHECK_ZVAL_STRING_REL(z)
b80cb7bd »
2005-08-11 Unicode support
1408 #define CHECK_ZVAL_UNICODE(z)
1409 #define CHECK_ZVAL_UNICODE_REL(z)
bcddfd47 »
2001-07-10 cleaned up the RETVAL_ RETURN_ and ZVAL_ macros
1410 #endif
1411
b424a326 »
2006-02-20 Preparation for portable string API (use macroses to access zval).
1412 #define ZVAL_RESOURCE(z, l) { \
1413 Z_TYPE_P(z) = IS_RESOURCE; \
1414 Z_LVAL_P(z) = l; \
af22085c »
2000-01-04 added ZVAL_*() macros.
1415 }
bcddfd47 »
2001-07-10 cleaned up the RETVAL_ RETURN_ and ZVAL_ macros
1416
b424a326 »
2006-02-20 Preparation for portable string API (use macroses to access zval).
1417 #define ZVAL_BOOL(z, b) { \
1418 Z_TYPE_P(z) = IS_BOOL; \
1419 Z_LVAL_P(z) = ((b) != 0); \
af22085c »
2000-01-04 added ZVAL_*() macros.
1420 }
bcddfd47 »
2001-07-10 cleaned up the RETVAL_ RETURN_ and ZVAL_ macros
1421
b424a326 »
2006-02-20 Preparation for portable string API (use macroses to access zval).
1422 #define ZVAL_NULL(z) { \
1423 Z_TYPE_P(z) = IS_NULL; \
af22085c »
2000-01-04 added ZVAL_*() macros.
1424 }
bcddfd47 »
2001-07-10 cleaned up the RETVAL_ RETURN_ and ZVAL_ macros
1425
b424a326 »
2006-02-20 Preparation for portable string API (use macroses to access zval).
1426 #define ZVAL_LONG(z, l) { \
1427 Z_TYPE_P(z) = IS_LONG; \
1428 Z_LVAL_P(z) = l; \
af22085c »
2000-01-04 added ZVAL_*() macros.
1429 }
bcddfd47 »
2001-07-10 cleaned up the RETVAL_ RETURN_ and ZVAL_ macros
1430
b424a326 »
2006-02-20 Preparation for portable string API (use macroses to access zval).
1431 #define ZVAL_DOUBLE(z, d) { \
1432 Z_TYPE_P(z) = IS_DOUBLE; \
1433 Z_DVAL_P(z) = d; \
af22085c »
2000-01-04 added ZVAL_*() macros.
1434 }
bcddfd47 »
2001-07-10 cleaned up the RETVAL_ RETURN_ and ZVAL_ macros
1435
4f6c95d1 »
2001-08-11 Whitespace
1436 #define ZVAL_STRING(z, s, duplicate) { \
502bef95 »
2007-11-01 ws + cs
1437 const char *__s=(s); \
b424a326 »
2006-02-20 Preparation for portable string API (use macroses to access zval).
1438 Z_STRLEN_P(z) = strlen(__s); \
502bef95 »
2007-11-01 ws + cs
1439 Z_STRVAL_P(z) = (duplicate?estrndup(__s, Z_STRLEN_P(z)):(char*)__s);\
1440 Z_TYPE_P(z) = IS_STRING; \
af22085c »
2000-01-04 added ZVAL_*() macros.
1441 }
bcddfd47 »
2001-07-10 cleaned up the RETVAL_ RETURN_ and ZVAL_ macros
1442
4f6c95d1 »
2001-08-11 Whitespace
1443 #define ZVAL_STRINGL(z, s, l, duplicate) { \
8146078f »
2007-09-27 Improved memory usage by movig constants to read only memory. (Dmitry…
1444 const char *__s=(s); int __l=l; \
502bef95 »
2007-11-01 ws + cs
1445 Z_STRLEN_P(z) = __l; \
1446 Z_STRVAL_P(z) = (duplicate?estrndup(__s, __l):(char*)__s);\
1447 Z_TYPE_P(z) = IS_STRING; \
af22085c »
2000-01-04 added ZVAL_*() macros.
1448 }
1449
1ef43a02 »
2006-12-07 Guard against ambiguous 'else' clauses.
1450 #define ZVAL_ASCII_STRING(z, s, flags) { \
8ecf8ede »
2009-03-26 - Removed:
1451 char *__s = (char*)(s); \
1452 int __s_len = strlen(__s); \
1453 UChar *u_str = zend_ascii_to_unicode(__s, __s_len+1 ZEND_FILE_LINE_CC); \
1454 u_str[__s_len] = 0; \
1455 if ((flags) & ZSTR_AUTOFREE) { \
1456 efree(__s); \
5f5faedf »
2006-04-06 Overload 'duplicate' arg as applied to:
1457 } \
8ecf8ede »
2009-03-26 - Removed:
1458 ZVAL_UNICODEL(z, u_str, __s_len, 0); \
b0e24970 »
2005-08-19 Unicode support cleanup
1459 }
1460
1ef43a02 »
2006-12-07 Guard against ambiguous 'else' clauses.
1461 #define ZVAL_ASCII_STRINGL(z, s, l, flags) { \
8ecf8ede »
2009-03-26 - Removed:
1462 char *__s = (char*)(s); \
1463 int __s_len = (l); \
1464 UChar *u_str = zend_ascii_to_unicode((__s), (__s_len)+1 ZEND_FILE_LINE_CC); \
1465 u_str[__s_len] = 0; \
1466 if ((flags) & ZSTR_AUTOFREE) { \
1467 efree(__s); \
5f5faedf »
2006-04-06 Overload 'duplicate' arg as applied to:
1468 } \
8ecf8ede »
2009-03-26 - Removed:
1469 ZVAL_UNICODEL(z, u_str, __s_len, 0); \
b0e24970 »
2005-08-19 Unicode support cleanup
1470 }
1471
1ef43a02 »
2006-12-07 Guard against ambiguous 'else' clauses.
1472 #define ZVAL_U_STRING(conv, z, s, flags) { \
8ecf8ede »
2009-03-26 - Removed:
1473 char *__s = (char *)(s); \
1474 int __s_len = strlen(__s); \
1475 UChar *u_str; \
1476 int u_len; \
1477 if (zend_string_to_unicode(conv, &u_str, &u_len, __s, __s_len TSRMLS_CC) == SUCCESS) { \
1478 ZVAL_UNICODEL(z, u_str, u_len, 0); \
1479 } \
1480 if ((flags) & ZSTR_AUTOFREE) { \
1481 efree(__s); \
5f5faedf »
2006-04-06 Overload 'duplicate' arg as applied to:
1482 } \
f4b8f4e9 »
2005-08-23 Unicode support cleanup
1483 }
1484
1ef43a02 »
2006-12-07 Guard against ambiguous 'else' clauses.
1485 #define ZVAL_U_STRINGL(conv, z, s, l, flags) { \
8ecf8ede »
2009-03-26 - Removed:
1486 char *__s = (char *)(s); \
1487 int __s_len = (l); \
1488 UChar *u_str; \
1489 int u_len; \
1490 if (zend_string_to_unicode(conv, &u_str, &u_len, __s, __s_len TSRMLS_CC) == SUCCESS) { \
1491 ZVAL_UNICODEL(z, u_str, u_len, 0); \
1492 } \
1493 if ((flags) & ZSTR_AUTOFREE) { \
1494 efree(__s); \
5f5faedf »
2006-04-06 Overload 'duplicate' arg as applied to:
1495 } \
f4b8f4e9 »
2005-08-23 Unicode support cleanup
1496 }
1497
5f5faedf »
2006-04-06 Overload 'duplicate' arg as applied to:
1498 #define ZVAL_RT_STRING(z, s, flags) \
1499 ZVAL_U_STRING(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), z, s, flags)
f4b8f4e9 »
2005-08-23 Unicode support cleanup
1500
5f5faedf »
2006-04-06 Overload 'duplicate' arg as applied to:
1501 #define ZVAL_RT_STRINGL(z, s, l, flags) \