Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improved memory usage by movig constants to read only memory. (Dmitry…

…, Pierre)
  • Loading branch information...
commit 6c810b0d4c1b12c675f69f5cfb32f26b6179d460 1 parent f6d9901
Dmitry Stogov authored
Showing with 431 additions and 430 deletions.
  1. +1 −0  NEWS
  2. +1 −1  Zend/zend.h
  3. +28 −28 Zend/zend_API.c
  4. +27 −27 Zend/zend_API.h
  5. +3 −3 Zend/zend_builtin_functions.c
  6. +1 −1  Zend/zend_compile.c
  7. +3 −3 Zend/zend_compile.h
  8. +2 −2 Zend/zend_exceptions.c
  9. +3 −3 Zend/zend_execute.c
  10. +3 −3 Zend/zend_execute.h
  11. +3 −3 Zend/zend_execute_API.c
  12. +11 −11 Zend/zend_hash.c
  13. +20 −20 Zend/zend_hash.h
  14. +4 −4 Zend/zend_ini.c
  15. +2 −2 Zend/zend_ini.h
  16. +5 −5 Zend/zend_interfaces.c
  17. +15 −15 Zend/zend_modules.h
  18. +2 −2 Zend/zend_opcode.c
  19. +1 −1  ext/bcmath/bcmath.c
  20. +1 −1  ext/bz2/bz2.c
  21. +1 −1  ext/calendar/calendar.c
  22. +1 −1  ext/com_dotnet/com_extension.c
  23. +1 −1  ext/com_dotnet/com_persist.c
  24. +1 −1  ext/ctype/ctype.c
  25. +1 −1  ext/curl/interface.c
  26. +4 −4 ext/date/php_date.c
  27. +1 −1  ext/dba/dba.c
  28. +1 −1  ext/dbase/dbase.c
  29. +1 −1  ext/dom/attr.c
  30. +1 −1  ext/dom/cdatasection.c
  31. +1 −1  ext/dom/characterdata.c
  32. +1 −1  ext/dom/comment.c
  33. +1 −1  ext/dom/document.c
  34. +1 −1  ext/dom/documentfragment.c
  35. +1 −1  ext/dom/documenttype.c
  36. +30 −30 ext/dom/dom_fe.h
  37. +1 −1  ext/dom/domconfiguration.c
  38. +1 −1  ext/dom/domerror.c
  39. +1 −1  ext/dom/domerrorhandler.c
  40. +1 −1  ext/dom/domexception.c
  41. +1 −1  ext/dom/domimplementation.c
  42. +1 −1  ext/dom/domimplementationlist.c
  43. +1 −1  ext/dom/domimplementationsource.c
  44. +1 −1  ext/dom/domlocator.c
  45. +1 −1  ext/dom/domstringlist.c
  46. +1 −1  ext/dom/element.c
  47. +1 −1  ext/dom/entity.c
  48. +1 −1  ext/dom/entityreference.c
  49. +1 −1  ext/dom/namednodemap.c
  50. +1 −1  ext/dom/namelist.c
  51. +1 −1  ext/dom/node.c
  52. +1 −1  ext/dom/nodelist.c
  53. +1 −1  ext/dom/notation.c
  54. +2 −2 ext/dom/php_dom.c
  55. +1 −1  ext/dom/processinginstruction.c
  56. +1 −1  ext/dom/string_extend.c
  57. +1 −1  ext/dom/text.c
  58. +1 −1  ext/dom/typeinfo.c
  59. +1 −1  ext/dom/userdatahandler.c
  60. +1 −1  ext/dom/xpath.c
  61. +1 −1  ext/exif/exif.c
  62. +1 −1  ext/fbsql/php_fbsql.c
  63. +1 −1  ext/fdf/fdf.c
  64. +1 −1  ext/filter/filter.c
  65. +1 −1  ext/ftp/php_ftp.c
  66. +1 −1  ext/gd/gd.c
  67. +1 −1  ext/gettext/gettext.c
  68. +1 −1  ext/gmp/gmp.c
  69. +1 −1  ext/hash/hash.c
  70. +1 −1  ext/iconv/iconv.c
  71. +2 −2 ext/imap/php_imap.c
  72. +1 −1  ext/interbase/interbase.c
  73. +1 −1  ext/json/json.c
  74. +1 −1  ext/ldap/ldap.c
  75. +1 −1  ext/libxml/libxml.c
  76. +1 −1  ext/mbstring/mbstring.c
  77. +1 −1  ext/mcrypt/mcrypt.c
  78. +1 −1  ext/mhash/mhash.c
  79. +1 −1  ext/mime_magic/mime_magic.c
  80. +19 −19 ext/ming/ming.c
  81. +1 −1  ext/msql/php_msql.c
  82. +1 −1  ext/mssql/php_mssql.c
  83. +1 −1  ext/mysql/php_mysql.c
  84. +1 −1  ext/mysqli/mysqli.c
  85. +1 −1  ext/mysqli/mysqli_driver.c
  86. +1 −1  ext/mysqli/mysqli_exception.c
  87. +4 −4 ext/mysqli/mysqli_fe.c
  88. +1 −1  ext/mysqli/mysqli_warning.c
  89. +7 −7 ext/mysqli/php_mysqli.h
  90. +1 −1  ext/ncurses/ncurses_fe.c
  91. +1 −1  ext/ncurses/php_ncurses.h
  92. +3 −3 ext/oci8/oci8.c
  93. +1 −1  ext/odbc/birdstep.c
  94. +1 −1  ext/odbc/php_odbc.c
  95. +1 −1  ext/openssl/openssl.c
  96. +1 −1  ext/pcntl/pcntl.c
  97. +1 −1  ext/pcre/php_pcre.c
  98. +2 −2 ext/pdo/pdo.c
  99. +4 −4 ext/pdo/pdo_dbh.c
  100. +2 −2 ext/pdo/pdo_stmt.c
  101. +1 −1  ext/pdo/php_pdo_driver.h
  102. +3 −3 ext/pdo/php_pdo_int.h
  103. +2 −2 ext/pdo_dblib/pdo_dblib.c
  104. +1 −1  ext/pdo_firebird/pdo_firebird.c
  105. +2 −2 ext/pdo_mysql/pdo_mysql.c
  106. +2 −2 ext/pdo_oci/pdo_oci.c
  107. +2 −2 ext/pdo_odbc/pdo_odbc.c
  108. +2 −2 ext/pdo_pgsql/pdo_pgsql.c
  109. +2 −2 ext/pdo_pgsql/pgsql_driver.c
  110. +2 −2 ext/pdo_sqlite/pdo_sqlite.c
  111. +2 −2 ext/pdo_sqlite/sqlite_driver.c
  112. +1 −1  ext/pgsql/pgsql.c
  113. +1 −1  ext/posix/posix.c
  114. +1 −1  ext/pspell/pspell.c
  115. +1 −1  ext/readline/readline.c
  116. +1 −1  ext/recode/recode.c
  117. +17 −17 ext/reflection/php_reflection.c
  118. +1 −1  ext/session/session.c
  119. +1 −1  ext/shmop/shmop.c
  120. +3 −3 ext/simplexml/simplexml.c
  121. +1 −1  ext/skeleton/skeleton.c
  122. +1 −1  ext/snmp/snmp.c
  123. +1 −1  ext/snmp/winsnmp.c
  124. +7 −7 ext/soap/soap.c
  125. +1 −1  ext/sockets/sockets.c
  126. +3 −3 ext/spl/php_spl.c
  127. +3 −3 ext/spl/spl_array.c
  128. +5 −5 ext/spl/spl_directory.c
  129. +4 −4 ext/spl/spl_functions.c
  130. +4 −4 ext/spl/spl_functions.h
  131. +18 −18 ext/spl/spl_iterators.c
  132. +3 −3 ext/spl/spl_observer.c
  133. +1 −1  ext/spl/spl_sxe.c
  134. +2 −2 ext/sqlite/pdo_sqlite2.c
  135. +6 −6 ext/sqlite/sqlite.c
  136. +2 −2 ext/standard/basic_functions.c
  137. +1 −1  ext/standard/dir.c
  138. +1 −1  ext/standard/dl.c
  139. +1 −1  ext/standard/info.c
  140. +1 −1  ext/standard/user_filters.c
  141. +1 −1  ext/sybase/php_sybase_db.c
  142. +1 −1  ext/sybase_ct/php_sybase_ct.c
  143. +1 −1  ext/sysvmsg/sysvmsg.c
  144. +1 −1  ext/sysvsem/sysvsem.c
  145. +1 −1  ext/sysvshm/sysvshm.c
  146. +3 −3 ext/tidy/tidy.c
  147. +1 −1  ext/tokenizer/tokenizer.c
  148. +1 −1  ext/wddx/wddx.c
  149. +2 −2 ext/xml/xml.c
  150. +2 −2 ext/xmlreader/php_xmlreader.c
  151. +1 −1  ext/xmlrpc/xmlrpc-epi-php.c
  152. +2 −2 ext/xmlwriter/php_xmlwriter.c
  153. +2 −2 ext/xsl/php_xsl.c
  154. +1 −1  ext/xsl/xsl_fe.h
  155. +1 −1  ext/xsl/xsltprocessor.c
  156. +2 −2 ext/zip/php_zip.c
  157. +1 −1  ext/zlib/zlib.c
  158. +1 −1  sapi/aolserver/aolserver.c
  159. +1 −1  sapi/apache/php_apache.c
  160. +1 −1  sapi/apache2filter/php_functions.c
  161. +1 −1  sapi/apache2handler/php_functions.c
  162. +2 −2 sapi/apache_hooks/php_apache.c
  163. +1 −1  sapi/continuity/capi.c
  164. +1 −1  sapi/milter/php_milter.c
  165. +1 −1  sapi/nsapi/nsapi.c
View
1  NEWS
@@ -1,6 +1,7 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 20??, PHP 5.3.0
+- Improved memory usage by movig constants to read only memory. (Dmitry,Pierre)
- Improved ext/soap to support element names in context of XMLShema's <any>.
(Dmitry)
- Improved ext/openssl (Dmitry)
View
2  Zend/zend.h
@@ -330,7 +330,7 @@ struct _zend_class_entry {
HashTable default_static_members;
HashTable *static_members;
HashTable constants_table;
- struct _zend_function_entry *builtin_functions;
+ const struct _zend_function_entry *builtin_functions;
union _zend_function *constructor;
union _zend_function *destructor;
View
56 Zend/zend_API.c
@@ -965,14 +965,14 @@ ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC TSRMLS_DC)
}
-ZEND_API int add_assoc_function(zval *arg, char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS))
+ZEND_API int add_assoc_function(zval *arg, const char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS))
{
zend_error(E_WARNING, "add_assoc_function() is no longer supported");
return FAILURE;
}
-ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n)
+ZEND_API int add_assoc_long_ex(zval *arg, const char *key, uint key_len, long n)
{
zval *tmp;
@@ -982,7 +982,7 @@ ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n)
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
-ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len)
+ZEND_API int add_assoc_null_ex(zval *arg, const char *key, uint key_len)
{
zval *tmp;
@@ -992,7 +992,7 @@ ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len)
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
-ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b)
+ZEND_API int add_assoc_bool_ex(zval *arg, const char *key, uint key_len, int b)
{
zval *tmp;
@@ -1002,7 +1002,7 @@ ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b)
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
-ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r)
+ZEND_API int add_assoc_resource_ex(zval *arg, const char *key, uint key_len, int r)
{
zval *tmp;
@@ -1013,7 +1013,7 @@ ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r)
}
-ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d)
+ZEND_API int add_assoc_double_ex(zval *arg, const char *key, uint key_len, double d)
{
zval *tmp;
@@ -1024,7 +1024,7 @@ ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d)
}
-ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate)
+ZEND_API int add_assoc_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate)
{
zval *tmp;
@@ -1035,7 +1035,7 @@ ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str,
}
-ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate)
+ZEND_API int add_assoc_stringl_ex(zval *arg, const char *key, uint key_len, char *str, uint length, int duplicate)
{
zval *tmp;
@@ -1045,7 +1045,7 @@ ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str,
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
-ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value)
+ZEND_API int add_assoc_zval_ex(zval *arg, const char *key, uint key_len, zval *value)
{
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &value, sizeof(zval *), NULL);
}
@@ -1105,7 +1105,7 @@ ZEND_API int add_index_double(zval *arg, ulong index, double d)
}
-ZEND_API int add_index_string(zval *arg, ulong index, char *str, int duplicate)
+ZEND_API int add_index_string(zval *arg, ulong index, const char *str, int duplicate)
{
zval *tmp;
@@ -1116,7 +1116,7 @@ ZEND_API int add_index_string(zval *arg, ulong index, char *str, int duplicate)
}
-ZEND_API int add_index_stringl(zval *arg, ulong index, char *str, uint length, int duplicate)
+ZEND_API int add_index_stringl(zval *arg, ulong index, const char *str, uint length, int duplicate)
{
zval *tmp;
@@ -1188,7 +1188,7 @@ ZEND_API int add_next_index_double(zval *arg, double d)
}
-ZEND_API int add_next_index_string(zval *arg, char *str, int duplicate)
+ZEND_API int add_next_index_string(zval *arg, const char *str, int duplicate)
{
zval *tmp;
@@ -1199,7 +1199,7 @@ ZEND_API int add_next_index_string(zval *arg, char *str, int duplicate)
}
-ZEND_API int add_next_index_stringl(zval *arg, char *str, uint length, int duplicate)
+ZEND_API int add_next_index_stringl(zval *arg, const char *str, uint length, int duplicate)
{
zval *tmp;
@@ -1216,7 +1216,7 @@ ZEND_API int add_next_index_zval(zval *arg, zval *value)
}
-ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, void **dest, int duplicate)
+ZEND_API int add_get_assoc_string_ex(zval *arg, const char *key, uint key_len, const char *str, void **dest, int duplicate)
{
zval *tmp;
@@ -1227,7 +1227,7 @@ ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *s
}
-ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, void **dest, int duplicate)
+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)
{
zval *tmp;
@@ -1260,7 +1260,7 @@ ZEND_API int add_get_index_double(zval *arg, ulong index, double d, void **dest)
}
-ZEND_API int add_get_index_string(zval *arg, ulong index, char *str, void **dest, int duplicate)
+ZEND_API int add_get_index_string(zval *arg, ulong index, const char *str, void **dest, int duplicate)
{
zval *tmp;
@@ -1271,7 +1271,7 @@ ZEND_API int add_get_index_string(zval *arg, ulong index, char *str, void **dest
}
-ZEND_API int add_get_index_stringl(zval *arg, ulong index, char *str, uint length, void **dest, int duplicate)
+ZEND_API int add_get_index_stringl(zval *arg, ulong index, const char *str, uint length, void **dest, int duplicate)
{
zval *tmp;
@@ -1427,7 +1427,7 @@ ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC)
/* Check module dependencies */
if (module->deps) {
- zend_module_dep *dep = module->deps;
+ const zend_module_dep *dep = module->deps;
while (dep->name) {
if (dep->type == MODULE_DEP_REQUIRED) {
@@ -1485,7 +1485,7 @@ static void zend_sort_modules(void *base, size_t count, size_t siz, compare_func
try_again:
m = (zend_module_entry*)(*b1)->pData;
if (!m->module_started && m->deps) {
- zend_module_dep *dep = m->deps;
+ const zend_module_dep *dep = m->deps;
while (dep->name) {
if (dep->type == MODULE_DEP_REQUIRED || dep->type == MODULE_DEP_OPTIONAL) {
b2 = b1 + 1;
@@ -1530,7 +1530,7 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TS
/* Check module dependencies */
if (module->deps) {
- zend_module_dep *dep = module->deps;
+ const zend_module_dep *dep = module->deps;
while (dep->name) {
if (dep->type == MODULE_DEP_CONFLICTS) {
@@ -1627,9 +1627,9 @@ ZEND_API void zend_check_magic_method_implementation(zend_class_entry *ce, zend_
}
/* registers all functions in *library_functions in the function hash */
-ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC)
+ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC)
{
- zend_function_entry *ptr = functions;
+ const zend_function_entry *ptr = functions;
zend_function function, *reg_function;
zend_internal_function *internal_function = (zend_internal_function *)&function;
int count=0, unload=0;
@@ -1660,11 +1660,11 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
while (ptr->fname) {
internal_function->handler = ptr->handler;
- internal_function->function_name = ptr->fname;
+ internal_function->function_name = (char*)ptr->fname;
internal_function->scope = scope;
internal_function->prototype = NULL;
if (ptr->arg_info) {
- internal_function->arg_info = ptr->arg_info+1;
+ internal_function->arg_info = (zend_arg_info*)ptr->arg_info+1;
internal_function->num_args = ptr->num_args;
/* Currently you cannot denote that the function can accept less arguments than num_args */
if (ptr->arg_info[0].required_num_args == -1) {
@@ -1857,9 +1857,9 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
/* count=-1 means erase all functions, otherwise,
* erase the first count functions
*/
-ZEND_API void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC)
+ZEND_API void zend_unregister_functions(const zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC)
{
- zend_function_entry *ptr = functions;
+ const zend_function_entry *ptr = functions;
int i=0;
HashTable *target_function_table = function_table;
@@ -2112,7 +2112,7 @@ static zend_object_value display_disabled_class(zend_class_entry *class_type TSR
return retval;
}
-static zend_function_entry disabled_class_new[] = {
+static const zend_function_entry disabled_class_new[] = {
{ NULL, NULL, NULL }
};
@@ -2486,7 +2486,7 @@ ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *f
}
-ZEND_API char *zend_get_module_version(char *module_name)
+ZEND_API const char *zend_get_module_version(const char *module_name)
{
char *lname;
int name_len = strlen(module_name);
View
54 Zend/zend_API.h
@@ -33,9 +33,9 @@
BEGIN_EXTERN_C()
typedef struct _zend_function_entry {
- char *fname;
+ const char *fname;
void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
- struct _zend_arg_info *arg_info;
+ const struct _zend_arg_info *arg_info;
zend_uint num_args;
zend_uint flags;
} zend_function_entry;
@@ -68,7 +68,7 @@ typedef struct _zend_function_entry {
#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 },
#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 },
#define ZEND_BEGIN_ARG_INFO_EX(name, pass_rest_by_reference, return_reference, required_num_args) \
- zend_arg_info name[] = { \
+ const zend_arg_info name[] = { \
{ NULL, 0, NULL, 0, 0, 0, pass_rest_by_reference, return_reference, required_num_args },
#define ZEND_BEGIN_ARG_INFO(name, pass_rest_by_reference) \
ZEND_BEGIN_ARG_INFO_EX(name, pass_rest_by_reference, ZEND_RETURN_VALUE, -1)
@@ -194,8 +194,8 @@ ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC,
/* End of parameter parsing API -- andrei */
-ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC);
-ZEND_API void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC);
+ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC);
+ZEND_API void zend_unregister_functions(const zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC);
ZEND_API int zend_startup_module(zend_module_entry *module_entry);
ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module_entry TSRMLS_DC);
ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TSRMLS_DC);
@@ -222,7 +222,7 @@ ZEND_API void zend_wrong_param_count(TSRMLS_D);
ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, char **callable_name, int *callable_name_len, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zval ***zobj_ptr_ptr TSRMLS_DC);
ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, char **callable_name);
ZEND_API zend_bool zend_make_callable(zval *callable, char **callable_name TSRMLS_DC);
-ZEND_API char *zend_get_module_version(char *module_name);
+ZEND_API const char *zend_get_module_version(const char *module_name);
ZEND_API int zend_get_module_started(char *module_name);
ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC);
ZEND_API int zend_declare_property_ex(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type, char *doc_comment, int doc_comment_len TSRMLS_DC);
@@ -291,16 +291,16 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *ce, HashTa
ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destroy_ht TSRMLS_DC);
/* no longer supported */
-ZEND_API int add_assoc_function(zval *arg, char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
+ZEND_API int add_assoc_function(zval *arg, const char *key, void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
-ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n);
-ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len);
-ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b);
-ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r);
-ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d);
-ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate);
-ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate);
-ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value);
+ZEND_API int add_assoc_long_ex(zval *arg, const char *key, uint key_len, long n);
+ZEND_API int add_assoc_null_ex(zval *arg, const char *key, uint key_len);
+ZEND_API int add_assoc_bool_ex(zval *arg, const char *key, uint key_len, int b);
+ZEND_API int add_assoc_resource_ex(zval *arg, const char *key, uint key_len, int r);
+ZEND_API int add_assoc_double_ex(zval *arg, const char *key, uint key_len, double d);
+ZEND_API int add_assoc_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate);
+ZEND_API int add_assoc_stringl_ex(zval *arg, const char *key, uint key_len, char *str, uint length, int duplicate);
+ZEND_API int add_assoc_zval_ex(zval *arg, const char *key, uint key_len, zval *value);
#define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key)+1, __n)
#define add_assoc_null(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1)
@@ -322,8 +322,8 @@ ZEND_API int add_index_null(zval *arg, ulong idx);
ZEND_API int add_index_bool(zval *arg, ulong idx, int b);
ZEND_API int add_index_resource(zval *arg, ulong idx, int r);
ZEND_API int add_index_double(zval *arg, ulong idx, double d);
-ZEND_API int add_index_string(zval *arg, ulong idx, char *str, int duplicate);
-ZEND_API int add_index_stringl(zval *arg, ulong idx, char *str, uint length, int duplicate);
+ZEND_API int add_index_string(zval *arg, ulong idx, const char *str, int duplicate);
+ZEND_API int add_index_stringl(zval *arg, ulong idx, const char *str, uint length, int duplicate);
ZEND_API int add_index_zval(zval *arg, ulong index, zval *value);
ZEND_API int add_next_index_long(zval *arg, long n);
@@ -331,20 +331,20 @@ ZEND_API int add_next_index_null(zval *arg);
ZEND_API int add_next_index_bool(zval *arg, int b);
ZEND_API int add_next_index_resource(zval *arg, int r);
ZEND_API int add_next_index_double(zval *arg, double d);
-ZEND_API int add_next_index_string(zval *arg, char *str, int duplicate);
-ZEND_API int add_next_index_stringl(zval *arg, char *str, uint length, int duplicate);
+ZEND_API int add_next_index_string(zval *arg, const char *str, int duplicate);
+ZEND_API int add_next_index_stringl(zval *arg, const char *str, uint length, int duplicate);
ZEND_API int add_next_index_zval(zval *arg, zval *value);
-ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, void **dest, int duplicate);
-ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, void **dest, int duplicate);
+ZEND_API int add_get_assoc_string_ex(zval *arg, const char *key, uint key_len, const char *str, void **dest, int duplicate);
+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);
#define add_get_assoc_string(__arg, __key, __str, __dest, __duplicate) add_get_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __dest, __duplicate)
#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)
ZEND_API int add_get_index_long(zval *arg, ulong idx, long l, void **dest);
ZEND_API int add_get_index_double(zval *arg, ulong idx, double d, void **dest);
-ZEND_API int add_get_index_string(zval *arg, ulong idx, char *str, void **dest, int duplicate);
-ZEND_API int add_get_index_stringl(zval *arg, ulong idx, char *str, uint length, void **dest, int duplicate);
+ZEND_API int add_get_index_string(zval *arg, ulong idx, const char *str, void **dest, int duplicate);
+ZEND_API int add_get_index_stringl(zval *arg, ulong idx, const char *str, uint length, void **dest, int duplicate);
ZEND_API int add_property_long_ex(zval *arg, char *key, uint key_len, long l TSRMLS_DC);
ZEND_API int add_property_null_ex(zval *arg, char *key, uint key_len TSRMLS_DC);
@@ -462,16 +462,16 @@ END_EXTERN_C()
}
#define ZVAL_STRING(z, s, duplicate) { \
- char *__s=(s); \
+ const char *__s=(s); \
(z)->value.str.len = strlen(__s); \
- (z)->value.str.val = (duplicate?estrndup(__s, (z)->value.str.len):__s); \
+ (z)->value.str.val = (duplicate?estrndup(__s, (z)->value.str.len):(char*)__s); \
(z)->type = IS_STRING; \
}
#define ZVAL_STRINGL(z, s, l, duplicate) { \
- char *__s=(s); int __l=l; \
+ const char *__s=(s); int __l=l;\
(z)->value.str.len = __l; \
- (z)->value.str.val = (duplicate?estrndup(__s, __l):__s); \
+ (z)->value.str.val = (duplicate?estrndup(__s, __l):(char*)__s); \
(z)->type = IS_STRING; \
}
View
6 Zend/zend_builtin_functions.c
@@ -88,7 +88,7 @@ static ZEND_FUNCTION(zend_thread_id);
#include "zend_arg_defs.c"
-static zend_function_entry builtin_functions[] = {
+static const zend_function_entry builtin_functions[] = {
ZEND_FE(zend_version, NULL)
ZEND_FE(func_num_args, NULL)
ZEND_FE(func_get_arg, NULL)
@@ -1609,7 +1609,7 @@ ZEND_FUNCTION(get_defined_constants)
zend_constant *val;
int module_number;
zval **modules;
- char **module_names;
+ const char **module_names;
zend_module_entry *module;
int i = 1;
@@ -2136,7 +2136,7 @@ ZEND_FUNCTION(get_extension_funcs)
{
zval **extension_name;
zend_module_entry *module;
- zend_function_entry *func;
+ const zend_function_entry *func;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &extension_name)) {
ZEND_WRONG_PARAM_COUNT();
View
2  Zend/zend_compile.c
@@ -4219,7 +4219,7 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify
}
-int zend_get_class_fetch_type(char *class_name, uint class_name_len)
+int zend_get_class_fetch_type(const char *class_name, uint class_name_len)
{
if ((class_name_len == sizeof("self")-1) &&
!memcmp(class_name, "self", sizeof("self"))) {
View
6 Zend/zend_compile.h
@@ -158,9 +158,9 @@ typedef struct _zend_property_info {
typedef struct _zend_arg_info {
- char *name;
+ const char *name;
zend_uint name_len;
- char *class_name;
+ const char *class_name;
zend_uint class_name_len;
zend_bool array_type_hint;
zend_bool allow_null;
@@ -547,7 +547,7 @@ void zend_do_mark_last_catch(znode *first_catch, znode *last_additional_catch TS
ZEND_API zend_bool zend_is_compiling(TSRMLS_D);
ZEND_API char *zend_make_compiled_string_description(char *name TSRMLS_DC);
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers TSRMLS_DC);
-int zend_get_class_fetch_type(char *class_name, uint class_name_len);
+int zend_get_class_fetch_type(const char *class_name, uint class_name_len);
typedef zend_bool (*zend_auto_global_callback)(char *name, uint name_len TSRMLS_DC);
typedef struct _zend_auto_global {
View
4 Zend/zend_exceptions.c
@@ -534,7 +534,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_exception___construct, 0, 0, 0)
ZEND_ARG_INFO(0, code)
ZEND_END_ARG_INFO()
-static zend_function_entry default_exception_functions[] = {
+const static zend_function_entry default_exception_functions[] = {
ZEND_ME(exception, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
ZEND_ME(exception, __construct, arginfo_exception___construct, ZEND_ACC_PUBLIC)
ZEND_ME(exception, getMessage, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
@@ -556,7 +556,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_error_exception___construct, 0, 0, 0)
ZEND_ARG_INFO(0, lineno)
ZEND_END_ARG_INFO()
-static zend_function_entry error_exception_functions[] = {
+static const zend_function_entry error_exception_functions[] = {
ZEND_ME(error_exception, __construct, arginfo_error_exception___construct, ZEND_ACC_PUBLIC)
ZEND_ME(error_exception, getSeverity, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
{NULL, NULL, NULL}
View
6 Zend/zend_execute.c
@@ -445,7 +445,7 @@ static inline void make_real_object(zval **object_ptr TSRMLS_DC)
}
}
-static inline char * zend_verify_arg_class_kind(zend_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce TSRMLS_DC)
+static inline char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, const char **class_name, zend_class_entry **pce TSRMLS_DC)
{
*pce = zend_fetch_class(cur_arg_info->class_name, cur_arg_info->class_name_len, (ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD) TSRMLS_CC);
@@ -457,7 +457,7 @@ static inline char * zend_verify_arg_class_kind(zend_arg_info *cur_arg_info, cha
}
}
-static inline int zend_verify_arg_error(zend_function *zf, zend_uint arg_num, zend_arg_info *cur_arg_info, char *need_msg, char *need_kind, char *given_msg, char *given_kind TSRMLS_DC)
+static inline int zend_verify_arg_error(zend_function *zf, zend_uint arg_num, const zend_arg_info *cur_arg_info, const char *need_msg, const char *need_kind, char *given_msg, char *given_kind TSRMLS_DC)
{
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
char *fname = zf->common.function_name;
@@ -494,7 +494,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
cur_arg_info = &zf->common.arg_info[arg_num-1];
if (cur_arg_info->class_name) {
- char *class_name;
+ const char *class_name;
if (!arg) {
need_msg = zend_verify_arg_class_kind(cur_arg_info, &class_name, &ce TSRMLS_CC);
View
6 Zend/zend_execute.h
@@ -70,8 +70,8 @@ static inline void safe_free_zval_ptr_rel(zval *p ZEND_FILE_LINE_DC ZEND_FILE_LI
FREE_ZVAL_REL(p);
}
}
-ZEND_API int zend_lookup_class(char *name, int name_length, zend_class_entry ***ce TSRMLS_DC);
-ZEND_API int zend_lookup_class_ex(char *name, int name_length, int use_autoload, zend_class_entry ***ce TSRMLS_DC);
+ZEND_API int zend_lookup_class(const char *name, int name_length, zend_class_entry ***ce TSRMLS_DC);
+ZEND_API int zend_lookup_class_ex(const char *name, int name_length, int use_autoload, zend_class_entry ***ce TSRMLS_DC);
ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC);
ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC);
@@ -182,7 +182,7 @@ ZEND_API zend_bool zend_is_executing(TSRMLS_D);
ZEND_API void zend_set_timeout(long seconds);
ZEND_API void zend_unset_timeout(TSRMLS_D);
ZEND_API void zend_timeout(int dummy);
-ZEND_API zend_class_entry *zend_fetch_class(char *class_name, uint class_name_len, int fetch_type TSRMLS_DC);
+ZEND_API zend_class_entry *zend_fetch_class(const char *class_name, uint class_name_len, int fetch_type TSRMLS_DC);
void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC);
#ifdef ZEND_WIN32
View
6 Zend/zend_execute_API.c
@@ -1025,7 +1025,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
}
-ZEND_API int zend_lookup_class_ex(char *name, int name_length, int use_autoload, zend_class_entry ***ce TSRMLS_DC)
+ZEND_API int zend_lookup_class_ex(const char *name, int name_length, int use_autoload, zend_class_entry ***ce TSRMLS_DC)
{
zval **args[1];
zval autoload_function;
@@ -1123,7 +1123,7 @@ ZEND_API int zend_lookup_class_ex(char *name, int name_length, int use_autoload,
return retval;
}
-ZEND_API int zend_lookup_class(char *name, int name_length, zend_class_entry ***ce TSRMLS_DC)
+ZEND_API int zend_lookup_class(const char *name, int name_length, zend_class_entry ***ce TSRMLS_DC)
{
return zend_lookup_class_ex(name, name_length, 1, ce TSRMLS_CC);
}
@@ -1471,7 +1471,7 @@ void zend_unset_timeout(TSRMLS_D)
}
-zend_class_entry *zend_fetch_class(char *class_name, uint class_name_len, int fetch_type TSRMLS_DC)
+zend_class_entry *zend_fetch_class(const char *class_name, uint class_name_len, int fetch_type TSRMLS_DC)
{
zend_class_entry **pce;
int use_autoload = (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) == 0;
View
22 Zend/zend_hash.c
@@ -94,7 +94,7 @@ static void _zend_is_inconsistent(HashTable *ht, char *file, int line)
static int zend_hash_do_resize(HashTable *ht);
-ZEND_API ulong zend_hash_func(char *arKey, uint nKeyLength)
+ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength)
{
return zend_inline_hash_func(arKey, nKeyLength);
}
@@ -197,7 +197,7 @@ ZEND_API void zend_hash_set_apply_protection(HashTable *ht, zend_bool bApplyProt
-ZEND_API int _zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
+ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
{
ulong h;
uint nIndex;
@@ -267,7 +267,7 @@ ZEND_API int _zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLengt
return SUCCESS;
}
-ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
+ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC)
{
uint nIndex;
Bucket *p;
@@ -336,7 +336,7 @@ ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, char *arKey, uint nKe
}
-ZEND_API int zend_hash_add_empty_element(HashTable *ht, char *arKey, uint nKeyLength)
+ZEND_API int zend_hash_add_empty_element(HashTable *ht, const char *arKey, uint nKeyLength)
{
void *dummy = (void *) 1;
@@ -452,7 +452,7 @@ ZEND_API int zend_hash_rehash(HashTable *ht)
return SUCCESS;
}
-ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag)
+ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, int flag)
{
uint nIndex;
Bucket *p;
@@ -856,7 +856,7 @@ ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor
}
-ZEND_API ulong zend_get_hash_value(char *arKey, uint nKeyLength)
+ZEND_API ulong zend_get_hash_value(const char *arKey, uint nKeyLength)
{
return zend_inline_hash_func(arKey, nKeyLength);
}
@@ -866,7 +866,7 @@ ZEND_API ulong zend_get_hash_value(char *arKey, uint nKeyLength)
* data is returned in pData. The reason is that there's no reason
* someone using the hash table might not want to have NULL data
*/
-ZEND_API int zend_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData)
+ZEND_API int zend_hash_find(HashTable *ht, const char *arKey, uint nKeyLength, void **pData)
{
ulong h;
uint nIndex;
@@ -891,7 +891,7 @@ ZEND_API int zend_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **
}
-ZEND_API int zend_hash_quick_find(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData)
+ZEND_API int zend_hash_quick_find(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, void **pData)
{
uint nIndex;
Bucket *p;
@@ -918,7 +918,7 @@ ZEND_API int zend_hash_quick_find(HashTable *ht, char *arKey, uint nKeyLength, u
}
-ZEND_API int zend_hash_exists(HashTable *ht, char *arKey, uint nKeyLength)
+ZEND_API int zend_hash_exists(HashTable *ht, const char *arKey, uint nKeyLength)
{
ulong h;
uint nIndex;
@@ -942,7 +942,7 @@ ZEND_API int zend_hash_exists(HashTable *ht, char *arKey, uint nKeyLength)
}
-ZEND_API int zend_hash_quick_exists(HashTable *ht, char *arKey, uint nKeyLength, ulong h)
+ZEND_API int zend_hash_quick_exists(HashTable *ht, const char *arKey, uint nKeyLength, ulong h)
{
uint nIndex;
Bucket *p;
@@ -1170,7 +1170,7 @@ ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosi
/* This function changes key of currevt element without changing elements'
* order. If element with target key already exists, it will be deleted first.
*/
-ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, char *str_index, uint str_length, ulong num_index, HashPosition *pos)
+ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const char *str_index, uint str_length, ulong num_index, HashPosition *pos)
{
Bucket *p;
View
40 Zend/zend_hash.h
@@ -36,7 +36,7 @@
#define HASH_DEL_KEY 0
#define HASH_DEL_INDEX 1
-typedef ulong (*hash_func_t)(char *arKey, uint nKeyLength);
+typedef ulong (*hash_func_t)(const char *arKey, uint nKeyLength);
typedef int (*compare_func_t)(const void *, const void * TSRMLS_DC);
typedef void (*sort_func_t)(void *, size_t, register size_t, compare_func_t TSRMLS_DC);
typedef void (*dtor_func_t)(void *pDest);
@@ -98,13 +98,13 @@ ZEND_API void zend_hash_clean(HashTable *ht);
#define zend_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) _zend_hash_init_ex((ht), (nSize), (pHashFunction), (pDestructor), (persistent), (bApplyProtection) ZEND_FILE_LINE_CC)
/* additions/updates/changes */
-ZEND_API int _zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
+ZEND_API int _zend_hash_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
#define zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest) \
_zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
#define zend_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest) \
_zend_hash_add_or_update(ht, arKey, nKeyLength, pData, nDataSize, pDest, HASH_ADD ZEND_FILE_LINE_CC)
-ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
+ZEND_API int _zend_hash_quick_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC);
#define zend_hash_quick_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \
_zend_hash_quick_add_or_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest, HASH_UPDATE ZEND_FILE_LINE_CC)
#define zend_hash_quick_add(ht, arKey, nKeyLength, h, pData, nDataSize, pDest) \
@@ -116,7 +116,7 @@ ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void
#define zend_hash_next_index_insert(ht, pData, nDataSize, pDest) \
_zend_hash_index_update_or_next_insert(ht, 0, pData, nDataSize, pDest, HASH_NEXT_INSERT ZEND_FILE_LINE_CC)
-ZEND_API int zend_hash_add_empty_element(HashTable *ht, char *arKey, uint nKeyLength);
+ZEND_API int zend_hash_add_empty_element(HashTable *ht, const char *arKey, uint nKeyLength);
#define ZEND_HASH_APPLY_KEEP 0
@@ -144,22 +144,22 @@ ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSR
/* Deletes */
-ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLength, ulong h, int flag);
+ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, int flag);
#define zend_hash_del(ht, arKey, nKeyLength) \
zend_hash_del_key_or_index(ht, arKey, nKeyLength, 0, HASH_DEL_KEY)
#define zend_hash_index_del(ht, h) \
zend_hash_del_key_or_index(ht, NULL, 0, h, HASH_DEL_INDEX)
-ZEND_API ulong zend_get_hash_value(char *arKey, uint nKeyLength);
+ZEND_API ulong zend_get_hash_value(const char *arKey, uint nKeyLength);
/* Data retreival */
-ZEND_API int zend_hash_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData);
-ZEND_API int zend_hash_quick_find(HashTable *ht, char *arKey, uint nKeyLength, ulong h, void **pData);
+ZEND_API int zend_hash_find(HashTable *ht, const char *arKey, uint nKeyLength, void **pData);
+ZEND_API int zend_hash_quick_find(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, void **pData);
ZEND_API int zend_hash_index_find(HashTable *ht, ulong h, void **pData);
/* Misc */
-ZEND_API int zend_hash_exists(HashTable *ht, char *arKey, uint nKeyLength);
-ZEND_API int zend_hash_quick_exists(HashTable *ht, char *arKey, uint nKeyLength, ulong h);
+ZEND_API int zend_hash_exists(HashTable *ht, const char *arKey, uint nKeyLength);
+ZEND_API int zend_hash_quick_exists(HashTable *ht, const char *arKey, uint nKeyLength, ulong h);
ZEND_API int zend_hash_index_exists(HashTable *ht, ulong h);
ZEND_API ulong zend_hash_next_free_element(HashTable *ht);
@@ -174,7 +174,7 @@ ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos)
ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosition *pos);
ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos);
ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos);
-ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, char *str_index, uint str_length, ulong num_index, HashPosition *pos);
+ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const char *str_index, uint str_length, ulong num_index, HashPosition *pos);
typedef struct _HashPointer {
HashPosition pos;
@@ -251,7 +251,7 @@ ZEND_API int zend_hash_rehash(HashTable *ht);
* -- Ralf S. Engelschall <rse@engelschall.com>
*/
-static inline ulong zend_inline_hash_func(char *arKey, uint nKeyLength)
+static inline ulong zend_inline_hash_func(const char *arKey, uint nKeyLength)
{
register ulong hash = 5381;
@@ -281,7 +281,7 @@ EMPTY_SWITCH_DEFAULT_CASE()
}
-ZEND_API ulong zend_hash_func(char *arKey, uint nKeyLength);
+ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength);
#if ZEND_DEBUG
/* debug */
@@ -299,13 +299,13 @@ END_EXTERN_C()
#define HANDLE_NUMERIC(key, length, func) { \
- register char *tmp=key; \
+ register const char *tmp=key; \
\
if (*tmp=='-') { \
tmp++; \
} \
if ((*tmp>='0' && *tmp<='9')) do { /* possibly a numeric index */ \
- char *end=key+length-1; \
+ const char *end=key+length-1; \
long idx; \
\
if (*tmp++=='0' && length>2) { /* don't accept numbers with leading zeros */ \
@@ -334,34 +334,34 @@ END_EXTERN_C()
}
-static inline int zend_symtable_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest) \
+static inline int zend_symtable_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest) \
{
HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_update(ht, idx, pData, nDataSize, pDest));
return zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest);
}
-static inline int zend_symtable_del(HashTable *ht, char *arKey, uint nKeyLength)
+static inline int zend_symtable_del(HashTable *ht, const char *arKey, uint nKeyLength)
{
HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_del(ht, idx))
return zend_hash_del(ht, arKey, nKeyLength);
}
-static inline int zend_symtable_find(HashTable *ht, char *arKey, uint nKeyLength, void **pData)
+static inline int zend_symtable_find(HashTable *ht, const char *arKey, uint nKeyLength, void **pData)
{
HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_find(ht, idx, pData));
return zend_hash_find(ht, arKey, nKeyLength, pData);
}
-static inline int zend_symtable_exists(HashTable *ht, char *arKey, uint nKeyLength)
+static inline int zend_symtable_exists(HashTable *ht, const char *arKey, uint nKeyLength)
{
HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_index_exists(ht, idx));
return zend_hash_exists(ht, arKey, nKeyLength);
}
-static inline int zend_symtable_update_current_key(HashTable *ht, char *arKey, uint nKeyLength)
+static inline int zend_symtable_update_current_key(HashTable *ht, const char *arKey, uint nKeyLength)
{
HANDLE_NUMERIC(arKey, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, NULL, 0, idx));
return zend_hash_update_current_key(ht, HASH_KEY_IS_STRING, arKey, nKeyLength, 0);
View
8 Zend/zend_ini.c
@@ -164,9 +164,9 @@ ZEND_API void zend_ini_sort_entries(TSRMLS_D) /* {{{ */
/*
* Registration / unregistration
*/
-ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number TSRMLS_DC) /* {{{ */
+ZEND_API int zend_register_ini_entries(const zend_ini_entry *ini_entry, int module_number TSRMLS_DC) /* {{{ */
{
- zend_ini_entry *p = ini_entry;
+ const zend_ini_entry *p = ini_entry;
zend_ini_entry *hashed_ini_entry;
zval default_value;
HashTable *directives = registered_zend_ini_directives;
@@ -187,12 +187,12 @@ ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_num
#endif
while (p->name) {
- p->module_number = module_number;
config_directive_success = 0;
- if (zend_hash_add(directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry) == FAILURE) {
+ if (zend_hash_add(directives, p->name, p->name_length, (void*)p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry) == FAILURE) {
zend_unregister_ini_entries(module_number TSRMLS_CC);
return FAILURE;
}
+ hashed_ini_entry->module_number = module_number;
if ((zend_get_configuration_directive(p->name, p->name_length, &default_value)) == SUCCESS) {
if (!hashed_ini_entry->on_modify
|| hashed_ini_entry->on_modify(hashed_ini_entry, Z_STRVAL(default_value), Z_STRLEN(default_value), hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC) == SUCCESS) {
View
4 Zend/zend_ini.h
@@ -92,7 +92,7 @@ ZEND_API int zend_copy_ini_directives(TSRMLS_D);
ZEND_API void zend_ini_sort_entries(TSRMLS_D);
-ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number TSRMLS_DC);
+ZEND_API int zend_register_ini_entries(const zend_ini_entry *ini_entry, int module_number TSRMLS_DC);
ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC);
ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC);
ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage);
@@ -111,7 +111,7 @@ ZEND_API ZEND_INI_DISP(zend_ini_color_displayer_cb);
ZEND_API ZEND_INI_DISP(display_link_numbers);
END_EXTERN_C()
-#define ZEND_INI_BEGIN() static zend_ini_entry ini_entries[] = {
+#define ZEND_INI_BEGIN() static const zend_ini_entry ini_entries[] = {
#define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, NULL } };
#define ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, displayer) \
View
10 Zend/zend_interfaces.c
@@ -477,12 +477,12 @@ static int zend_implement_serializable(zend_class_entry *interface, zend_class_e
/* }}}*/
/* {{{ function tables */
-zend_function_entry zend_funcs_aggregate[] = {
+const zend_function_entry zend_funcs_aggregate[] = {
ZEND_ABSTRACT_ME(iterator, getIterator, NULL)
{NULL, NULL, NULL}
};
-zend_function_entry zend_funcs_iterator[] = {
+const zend_function_entry zend_funcs_iterator[] = {
ZEND_ABSTRACT_ME(iterator, current, NULL)
ZEND_ABSTRACT_ME(iterator, next, NULL)
ZEND_ABSTRACT_ME(iterator, key, NULL)
@@ -491,7 +491,7 @@ zend_function_entry zend_funcs_iterator[] = {
{NULL, NULL, NULL}
};
-zend_function_entry *zend_funcs_traversable = NULL;
+const zend_function_entry *zend_funcs_traversable = NULL;
static
ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset, 0, 0, 1)
@@ -509,7 +509,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_value, 0, 0, 2)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
-zend_function_entry zend_funcs_arrayaccess[] = {
+const zend_function_entry zend_funcs_arrayaccess[] = {
ZEND_ABSTRACT_ME(arrayaccess, offsetExists, arginfo_arrayaccess_offset)
ZEND_ABSTRACT_ME(arrayaccess, offsetGet, arginfo_arrayaccess_offset_get)
ZEND_ABSTRACT_ME(arrayaccess, offsetSet, arginfo_arrayaccess_offset_value)
@@ -522,7 +522,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_serializable_serialize, 0)
ZEND_ARG_INFO(0, serialized)
ZEND_END_ARG_INFO()
-zend_function_entry zend_funcs_serializable[] = {
+const zend_function_entry zend_funcs_serializable[] = {
ZEND_ABSTRACT_ME(serializable, serialize, NULL)
ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT|ZEND_ACC_CTOR)
{NULL, NULL, NULL}
View
30 Zend/zend_modules.h
@@ -32,12 +32,12 @@
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC
#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC
-extern struct _zend_arg_info first_arg_force_ref[2];
-extern struct _zend_arg_info second_arg_force_ref[3];
-extern struct _zend_arg_info third_arg_force_ref[4];
-extern struct _zend_arg_info fourth_arg_force_ref[5];
-extern struct _zend_arg_info fifth_arg_force_ref[6];
-extern struct _zend_arg_info all_args_by_ref[1];
+extern const struct _zend_arg_info first_arg_force_ref[2];
+extern const struct _zend_arg_info second_arg_force_ref[3];
+extern const struct _zend_arg_info third_arg_force_ref[4];
+extern const struct _zend_arg_info fourth_arg_force_ref[5];
+extern const struct _zend_arg_info fifth_arg_force_ref[6];
+extern const struct _zend_arg_info all_args_by_ref[1];
#define ZEND_MODULE_API_NO 20060613
#ifdef ZTS
@@ -79,16 +79,16 @@ struct _zend_module_entry {
unsigned int zend_api;
unsigned char zend_debug;
unsigned char zts;
- struct _zend_ini_entry *ini_entry;
- struct _zend_module_dep *deps;
- char *name;
- struct _zend_function_entry *functions;
+ const struct _zend_ini_entry *ini_entry;
+ const struct _zend_module_dep *deps;
+ const char *name;
+ const struct _zend_function_entry *functions;
int (*module_startup_func)(INIT_FUNC_ARGS);
int (*module_shutdown_func)(SHUTDOWN_FUNC_ARGS);
int (*request_startup_func)(INIT_FUNC_ARGS);
int (*request_shutdown_func)(SHUTDOWN_FUNC_ARGS);
void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS);
- char *version;
+ const char *version;
size_t globals_size;
#ifdef ZTS
ts_rsrc_id* globals_id_ptr;
@@ -117,10 +117,10 @@ struct _zend_module_entry {
#define ZEND_MOD_OPTIONAL(name) ZEND_MOD_OPTIONAL_EX(name, NULL, NULL)
struct _zend_module_dep {
- char *name; /* module name */
- char *rel; /* version relationship: NULL (exists), lt|le|eq|ge|gt (to given version) */
- char *version; /* version */
- unsigned char type; /* dependency type */
+ const char *name; /* module name */
+ const char *rel; /* version relationship: NULL (exists), lt|le|eq|ge|gt (to given version) */
+ const char *version; /* version */
+ unsigned char type; /* dependency type */
};
extern ZEND_API HashTable module_registry;
View
4 Zend/zend_opcode.c
@@ -274,9 +274,9 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)
}
if (op_array->arg_info) {
for (i=0; i<op_array->num_args; i++) {
- efree(op_array->arg_info[i].name);
+ efree((char*)op_array->arg_info[i].name);
if (op_array->arg_info[i].class_name) {
- efree(op_array->arg_info[i].class_name);
+ efree((char*)op_array->arg_info[i].class_name);
}
}
efree(op_array->arg_info);
View
2  ext/bcmath/bcmath.c
@@ -105,7 +105,7 @@ ZEND_END_ARG_INFO()
/* }}} */
-zend_function_entry bcmath_functions[] = {
+const zend_function_entry bcmath_functions[] = {
PHP_FE(bcadd, arginfo_bcadd)
PHP_FE(bcsub, arginfo_bcsub)
PHP_FE(bcmul, arginfo_bcmul)
View
2  ext/bz2/bz2.c
@@ -94,7 +94,7 @@ ZEND_END_ARG_INFO()
/* }}} */
-static zend_function_entry bz2_functions[] = {
+static const zend_function_entry bz2_functions[] = {
PHP_FE(bzopen, arginfo_bzopen)
PHP_FE(bzread, arginfo_bzread)
PHP_FALIAS(bzwrite, fwrite, NULL)
View
2  ext/calendar/calendar.c
@@ -147,7 +147,7 @@ ZEND_END_ARG_INFO()
/* }}} */
-zend_function_entry calendar_functions[] = {
+const zend_function_entry calendar_functions[] = {
PHP_FE(jdtogregorian, arginfo_jdtogregorian)
PHP_FE(gregoriantojd, arginfo_gregoriantojd)
PHP_FE(jdtojulian, arginfo_jdtojulian)
View
2  ext/com_dotnet/com_extension.c
@@ -39,7 +39,7 @@ zend_class_entry
*php_com_exception_class_entry,
*php_com_saproxy_class_entry;
-zend_function_entry com_dotnet_functions[] = {
+const zend_function_entry com_dotnet_functions[] = {
PHP_FE(variant_set, NULL)
PHP_FE(variant_add, NULL)
PHP_FE(variant_cat, NULL)
View
2  ext/com_dotnet/com_persist.c
@@ -681,7 +681,7 @@ CPH_METHOD(__construct)
-static zend_function_entry com_persist_helper_methods[] = {
+static const zend_function_entry com_persist_helper_methods[] = {
CPH_ME(__construct, NULL)
CPH_ME(GetCurFileName, NULL)
CPH_ME(SaveToFile, NULL)
View
2  ext/ctype/ctype.c
@@ -105,7 +105,7 @@ ZEND_END_ARG_INFO()
/* {{{ ctype_functions[]
* Every user visible function must have an entry in ctype_functions[].
*/
-static zend_function_entry ctype_functions[] = {
+static const zend_function_entry ctype_functions[] = {
PHP_FE(ctype_alnum, arginfo_ctype_alnum)
PHP_FE(ctype_alpha, arginfo_ctype_alpha)
PHP_FE(ctype_cntrl, arginfo_ctype_cntrl)
View
2  ext/curl/interface.c
@@ -291,7 +291,7 @@ ZEND_END_ARG_INFO()
/* {{{ curl_functions[]
*/
-zend_function_entry curl_functions[] = {
+const zend_function_entry curl_functions[] = {
PHP_FE(curl_init, arginfo_curl_init)
PHP_FE(curl_copy_handle, arginfo_curl_copy_handle)
PHP_FE(curl_version, arginfo_curl_version)
View
8 ext/date/php_date.c
@@ -148,7 +148,7 @@ ZEND_END_ARG_INFO()
/* }}} */
/* {{{ Function table */
-zend_function_entry date_functions[] = {
+const zend_function_entry date_functions[] = {
PHP_FE(strtotime, arginfo_strtotime)
PHP_FE(date, arginfo_date)
PHP_FE(idate, arginfo_idate)
@@ -198,7 +198,7 @@ zend_function_entry date_functions[] = {
{NULL, NULL, NULL}
};
-zend_function_entry date_funcs_date[] = {
+const zend_function_entry date_funcs_date[] = {
PHP_ME(DateTime, __construct, NULL, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(format, date_format, NULL, 0)
PHP_ME_MAPPING(modify, date_modify, NULL, 0)
@@ -211,7 +211,7 @@ zend_function_entry date_funcs_date[] = {
{NULL, NULL, NULL}
};
-zend_function_entry date_funcs_timezone[] = {
+const zend_function_entry date_funcs_timezone[] = {
PHP_ME(DateTimeZone, __construct, NULL, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(getName, timezone_name_get, NULL, 0)
PHP_ME_MAPPING(getOffset, timezone_offset_get, NULL, 0)
@@ -302,7 +302,7 @@ static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC);
static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC);
/* This is need to ensure that session extension request shutdown occurs 1st, because it uses the date extension */
-static zend_module_dep date_deps[] = {
+static const zend_module_dep date_deps[] = {
ZEND_MOD_OPTIONAL("session")
{NULL, NULL, NULL}
};
View
2  ext/dba/dba.c
@@ -144,7 +144,7 @@ ZEND_END_ARG_INFO()
/* {{{ dba_functions[]
*/
-zend_function_entry dba_functions[] = {
+const zend_function_entry dba_functions[] = {
PHP_FE(dba_open, arginfo_dba_open)
PHP_FE(dba_popen, arginfo_dba_popen)
PHP_FE(dba_close, arginfo_dba_close)
View
2  ext/dbase/dbase.c
@@ -826,7 +826,7 @@ ZEND_END_ARG_INFO()
/* {{{ dbase_functions[]
*/
-zend_function_entry dbase_functions[] = {
+const zend_function_entry dbase_functions[] = {
PHP_FE(dbase_open, arginfo_dbase_open)
PHP_FE(dbase_create, arginfo_dbase_create)
PHP_FE(dbase_close, arginfo_dbase_close)
View
2  ext/dom/attr.c
@@ -37,7 +37,7 @@
* Since:
*/
-zend_function_entry php_dom_attr_class_functions[] = {
+const zend_function_entry php_dom_attr_class_functions[] = {
PHP_FALIAS(isId, dom_attr_is_id, NULL)
PHP_ME(domattr, __construct, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
View
2  ext/dom/cdatasection.c
@@ -35,7 +35,7 @@
* Since:
*/
-zend_function_entry php_dom_cdatasection_class_functions[] = {
+const zend_function_entry php_dom_cdatasection_class_functions[] = {
PHP_ME(domcdatasection, __construct, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
View
2  ext/dom/characterdata.c
@@ -35,7 +35,7 @@
* Since:
*/
-zend_function_entry php_dom_characterdata_class_functions[] = {
+const zend_function_entry php_dom_characterdata_class_functions[] = {
PHP_FALIAS(substringData, dom_characterdata_substring_data, NULL)
PHP_FALIAS(appendData, dom_characterdata_append_data, NULL)
PHP_FALIAS(insertData, dom_characterdata_insert_data, NULL)
View
2  ext/dom/comment.c
@@ -35,7 +35,7 @@
* Since:
*/
-zend_function_entry php_dom_comment_class_functions[] = {
+const zend_function_entry php_dom_comment_class_functions[] = {
PHP_ME(domcomment, __construct, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
View
2  ext/dom/document.c
@@ -48,7 +48,7 @@ struct _idsIterator {
* Since:
*/
-zend_function_entry php_dom_document_class_functions[] = {
+const zend_function_entry php_dom_document_class_functions[] = {
PHP_FALIAS(createElement, dom_document_create_element, NULL)
PHP_FALIAS(createDocumentFragment, dom_document_create_document_fragment, NULL)
PHP_FALIAS(createTextNode, dom_document_create_text_node, NULL)
View
2  ext/dom/documentfragment.c
@@ -35,7 +35,7 @@
* Since:
*/
-zend_function_entry php_dom_documentfragment_class_functions[] = {
+const zend_function_entry php_dom_documentfragment_class_functions[] = {
PHP_ME(domdocumentfragment, __construct, NULL, ZEND_ACC_PUBLIC)
PHP_ME(domdocumentfragment, appendXML, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
View
2  ext/dom/documenttype.c
@@ -34,7 +34,7 @@
* Since:
*/
-zend_function_entry php_dom_documenttype_class_functions[] = {
+const zend_function_entry php_dom_documenttype_class_functions[] = {
{NULL, NULL, NULL}
};
View
60 ext/dom/dom_fe.h
@@ -21,36 +21,36 @@
#ifndef DOM_FE_H
#define DOM_FE_H
-extern zend_function_entry php_dom_domexception_class_functions[];
-extern zend_function_entry php_dom_domstringlist_class_functions[];
-extern zend_function_entry php_dom_namelist_class_functions[];
-extern zend_function_entry php_dom_domimplementationlist_class_functions[];
-extern zend_function_entry php_dom_domimplementationsource_class_functions[];
-extern zend_function_entry php_dom_domimplementation_class_functions[];
-extern zend_function_entry php_dom_documentfragment_class_functions[];
-extern zend_function_entry php_dom_document_class_functions[];
-extern zend_function_entry php_dom_node_class_functions[];
-extern zend_function_entry php_dom_nodelist_class_functions[];
-extern zend_function_entry php_dom_namednodemap_class_functions[];
-extern zend_function_entry php_dom_characterdata_class_functions[];
-extern zend_function_entry php_dom_attr_class_functions[];
-extern zend_function_entry php_dom_element_class_functions[];
-extern zend_function_entry php_dom_text_class_functions[];
-extern zend_function_entry php_dom_comment_class_functions[];
-extern zend_function_entry php_dom_typeinfo_class_functions[];
-extern zend_function_entry php_dom_userdatahandler_class_functions[];
-extern zend_function_entry php_dom_domerror_class_functions[];
-extern zend_function_entry php_dom_domerrorhandler_class_functions[];
-extern zend_function_entry php_dom_domlocator_class_functions[];
-extern zend_function_entry php_dom_domconfiguration_class_functions[];
-extern zend_function_entry php_dom_cdatasection_class_functions[];
-extern zend_function_entry php_dom_documenttype_class_functions[];
-extern zend_function_entry php_dom_notation_class_functions[];
-extern zend_function_entry php_dom_entity_class_functions[];
-extern zend_function_entry php_dom_entityreference_class_functions[];
-extern zend_function_entry php_dom_processinginstruction_class_functions[];
-extern zend_function_entry php_dom_string_extend_class_functions[];
-extern zend_function_entry php_dom_xpath_class_functions[];
+extern const zend_function_entry php_dom_domexception_class_functions[];
+extern const zend_function_entry php_dom_domstringlist_class_functions[];
+extern const zend_function_entry php_dom_namelist_class_functions[];
+extern const zend_function_entry php_dom_domimplementationlist_class_functions[];
+extern const zend_function_entry php_dom_domimplementationsource_class_functions[];
+extern const zend_function_entry php_dom_domimplementation_class_functions[];
+extern const zend_function_entry php_dom_documentfragment_class_functions[];
+extern const zend_function_entry php_dom_document_class_functions[];
+extern const zend_function_entry php_dom_node_class_functions[];
+extern const zend_function_entry php_dom_nodelist_class_functions[];
+extern const zend_function_entry php_dom_namednodemap_class_functions[];
+extern const zend_function_entry php_dom_characterdata_class_functions[];
+extern const zend_function_entry php_dom_attr_class_functions[];
+extern const zend_function_entry php_dom_element_class_functions[];
+extern const zend_function_entry php_dom_text_class_functions[];
+extern const zend_function_entry php_dom_comment_class_functions[];
+extern const zend_function_entry php_dom_typeinfo_class_functions[];
+extern const zend_function_entry php_dom_userdatahandler_class_functions[];
+extern const zend_function_entry php_dom_domerror_class_functions[];
+extern const zend_function_entry php_dom_domerrorhandler_class_functions[];
+extern const zend_function_entry php_dom_domlocator_class_functions[];
+extern const zend_function_entry php_dom_domconfiguration_class_functions[];
+extern const zend_function_entry php_dom_cdatasection_class_functions[];
+extern const zend_function_entry php_dom_documenttype_class_functions[];
+extern const zend_function_entry php_dom_notation_class_functions[];
+extern const zend_function_entry php_dom_entity_class_functions[];
+extern const zend_function_entry php_dom_entityreference_class_functions[];
+extern const zend_function_entry php_dom_processinginstruction_class_functions[];
+extern const zend_function_entry php_dom_string_extend_class_functions[];
+extern const zend_function_entry php_dom_xpath_class_functions[];
/* domexception errors */
typedef enum {
View
2  ext/dom/domconfiguration.c
@@ -35,7 +35,7 @@
* Since: DOM Level 3
*/
-zend_function_entry php_dom_domconfiguration_class_functions[] = {
+const zend_function_entry php_dom_domconfiguration_class_functions[] = {
PHP_FALIAS(setParameter, dom_domconfiguration_set_parameter, NULL)
PHP_FALIAS(getParameter, dom_domconfiguration_get_parameter, NULL)
PHP_FALIAS(canSetParameter, dom_domconfiguration_can_set_parameter, NULL)
View
2  ext/dom/domerror.c
@@ -35,7 +35,7 @@
* Since: DOM Level 3
*/
-zend_function_entry php_dom_domerror_class_functions[] = {
+const zend_function_entry php_dom_domerror_class_functions[] = {
{NULL, NULL, NULL}
};
View
2  ext/dom/domerrorhandler.c
@@ -35,7 +35,7 @@
* Since: DOM Level 3
*/
-zend_function_entry php_dom_domerrorhandler_class_functions[] = {
+const zend_function_entry php_dom_domerrorhandler_class_functions[] = {
PHP_FALIAS(handleError, dom_domerrorhandler_handle_error, NULL)
{NULL, NULL, NULL}
};
View
2  ext/dom/domexception.c
@@ -37,7 +37,7 @@
extern zend_class_entry *dom_domexception_class_entry;
-zend_function_entry php_dom_domexception_class_functions[] = {
+const zend_function_entry php_dom_domexception_class_functions[] = {
{NULL, NULL, NULL}
};
View
2  ext/dom/domimplementation.c
@@ -34,7 +34,7 @@
* Since:
*/
-zend_function_entry php_dom_domimplementation_class_functions[] = {
+const zend_function_entry php_dom_domimplementation_class_functions[] = {
PHP_ME(domimplementation, getFeature, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC)
PHP_ME(domimplementation, hasFeature, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC)
PHP_ME(domimplementation, createDocumentType, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC)
View
2  ext/dom/domimplementationlist.c
@@ -35,7 +35,7 @@
* Since: DOM Level 3
*/
-zend_function_entry php_dom_domimplementationlist_class_functions[] = {
+const zend_function_entry php_dom_domimplementationlist_class_functions[] = {
PHP_FALIAS(item, dom_domimplementationlist_item, NULL)
{NULL, NULL, NULL}
};
View
2  ext/dom/domimplementationsource.c
@@ -35,7 +35,7 @@
* Since: DOM Level 3
*/
-zend_function_entry php_dom_domimplementationsource_class_functions[] = {
+const zend_function_entry php_dom_domimplementationsource_class_functions[] = {
PHP_FALIAS(getDomimplementation, dom_domimplementationsource_get_domimplementation, NULL)
PHP_FALIAS(getDomimplementations, dom_domimplementationsource_get_domimplementations, NULL)
{NULL, NULL, NULL}
View
2  ext/dom/domlocator.c
@@ -35,7 +35,7 @@
* Since: DOM Level 3
*/
-zend_function_entry php_dom_domlocator_class_functions[] = {
+const zend_function_entry php_dom_domlocator_class_functions[] = {
{NULL, NULL, NULL}
};
View
2  ext/dom/domstringlist.c
@@ -35,7 +35,7 @@
* Since: DOM Level 3
*/
-zend_function_entry php_dom_domstringlist_class_functions[] = {
+const zend_function_entry php_dom_domstringlist_class_functions[] = {
PHP_FALIAS(item, dom_domstringlist_item, NULL)
{NULL, NULL, NULL}
};
View
2  ext/dom/element.c
@@ -35,7 +35,7 @@
* Since:
*/
-zend_function_entry php_dom_element_class_functions[] = {
+const zend_function_entry php_dom_element_class_functions[] = {
PHP_FALIAS(getAttribute, dom_element_get_attribute, NULL)
PHP_FALIAS(setAttribute, dom_element_set_attribute, NULL)
PHP_FALIAS(removeAttribute, dom_element_remove_attribute, NULL)
View
2  ext/dom/entity.c
@@ -35,7 +35,7 @@
* Since:
*/
-zend_function_entry php_dom_entity_class_functions[] = {
+const zend_function_entry php_dom_entity_class_functions[] = {
{NULL, NULL, NULL}
};
View
2  ext/dom/entityreference.c
@@ -35,7 +35,7 @@
* Since:
*/
-zend_function_entry php_dom_entityreference_class_functions[] = {
+const zend_function_entry php_dom_entityreference_class_functions[] = {
PHP_ME(domentityreference, __construct, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
View
2  ext/dom/namednodemap.c
@@ -35,7 +35,7 @@
* Since:
*/
-zend_function_entry php_dom_namednodemap_class_functions[] = {
+const zend_function_entry php_dom_namednodemap_class_functions[] = {
PHP_FALIAS(getNamedItem, dom_namednodemap_get_named_item, NULL)
PHP_FALIAS(setNamedItem, dom_namednodemap_set_named_item, NULL)
PHP_FALIAS(removeNamedItem, dom_namednodemap_remove_named_item, NULL)
View
2  ext/dom/namelist.c
@@ -35,7 +35,7 @@
* Since: DOM Level 3
*/
-zend_function_entry php_dom_namelist_class_functions[] = {
+const zend_function_entry php_dom_namelist_class_functions[] = {
PHP_FALIAS(getName, dom_namelist_get_name, NULL)
PHP_FALIAS(getNamespaceURI, dom_namelist_get_namespace_uri, NULL)
{NULL, NULL, NULL}
View
2  ext/dom/node.c
@@ -34,7 +34,7 @@
* Since:
*/
-zend_function_entry php_dom_node_class_functions[] = {
+const zend_function_entry php_dom_node_class_functions[] = {
PHP_FALIAS(insertBefore, dom_node_insert_before, NULL)
PHP_FALIAS(replaceChild, dom_node_replace_child, NULL)
PHP_FALIAS(removeChild, dom_node_remove_child, NULL)
View
2  ext/dom/nodelist.c
@@ -35,7 +35,7 @@
* Since:
*/
-zend_function_entry php_dom_nodelist_class_functions[] = {
+const zend_function_entry php_dom_nodelist_class_functions[] = {
PHP_FALIAS(item, dom_nodelist_item, NULL)
{NULL, NULL, NULL}
};
View
2  ext/dom/notation.c
@@ -35,7 +35,7 @@
* Since:
*/
-zend_function_entry php_dom_notation_class_functions[] = {
+const zend_function_entry php_dom_notation_class_functions[] = {
{NULL, NULL, NULL}
};
View
4 ext/dom/php_dom.c
@@ -512,7 +512,7 @@ zend_object_value dom_objects_ze1_clone_obj(zval *zobject TSRMLS_DC)
return zobject->value.obj;
}
-static zend_function_entry dom_functions[] = {
+static const zend_function_entry dom_functions[] = {
PHP_FE(dom_import_simplexml, NULL)
{NULL, NULL, NULL}
};
@@ -525,7 +525,7 @@ static zend_object_handlers* dom_get_obj_handlers(TSRMLS_D) {
}
}
-static zend_module_dep dom_deps[] = {
+static const zend_module_dep dom_deps[] = {
ZEND_MOD_REQUIRED("libxml")
ZEND_MOD_CONFLICTS("domxml")
{NULL, NULL, NULL}
View
2  ext/dom/processinginstruction.c
@@ -35,7 +35,7 @@
* Since:
*/
-zend_function_entry php_dom_processinginstruction_class_functions[] = {
+const zend_function_entry php_dom_processinginstruction_class_functions[] = {
PHP_ME(domprocessinginstruction, __construct, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
View
2  ext/dom/string_extend.c
@@ -35,7 +35,7 @@
* Since:
*/
-zend_function_entry php_dom_string_extend_class_functions[] = {
+const zend_function_entry php_dom_string_extend_class_functions[] = {
PHP_FALIAS(findOffset16, dom_string_extend_find_offset16, NULL)
PHP_FALIAS(findOffset32, dom_string_extend_find_offset32, NULL)
{NULL, NULL, NULL}
View
2  ext/dom/text.c
@@ -35,7 +35,7 @@
* Since:
*/
-zend_function_entry php_dom_text_class_functions[] = {
+const zend_function_entry php_dom_text_class_functions[] = {
PHP_FALIAS(splitText, dom_text_split_text, NULL)
PHP_FALIAS(isWhitespaceInElementContent, dom_text_is_whitespace_in_element_content, NULL)
PHP_FALIAS(isElementContentWhitespace, dom_text_is_whitespace_in_element_content, NULL)
View
2  ext/dom/typeinfo.c
@@ -35,7 +35,7 @@
* Since: DOM Level 3
*/
-zend_function_entry php_dom_typeinfo_class_functions[] = {
+const zend_function_entry php_dom_typeinfo_class_functions[] = {
{NULL, NULL, NULL}
};
View
2  ext/dom/userdatahandler.c
@@ -35,7 +35,7 @@
* Since: DOM Level 3
*/
-zend_function_entry php_dom_userdatahandler_class_functions[] = {
+const zend_function_entry php_dom_userdatahandler_class_functions[] = {
PHP_FALIAS(handle, dom_userdatahandler_handle, NULL)
{NULL, NULL, NULL}
};
View
2  ext/dom/xpath.c
@@ -36,7 +36,7 @@
#if defined(LIBXML_XPATH_ENABLED)
-zend_function_entry php_dom_xpath_class_functions[] = {
+const zend_function_entry php_dom_xpath_class_functions[] = {
PHP_ME(domxpath, __construct, NULL, ZEND_ACC_PUBLIC)
PHP_FALIAS(registerNamespace, dom_xpath_register_ns, NULL)
PHP_FALIAS(query, dom_xpath_query, NULL)
View
2  ext/exif/exif.c
@@ -132,7 +132,7 @@ ZEND_END_ARG_INFO()
/* {{{ exif_functions[]
*/
-zend_function_entry exif_functions[] = {
+const zend_function_entry exif_functions[] = {
PHP_FE(exif_read_data, arginfo_exif_read_data)
PHP_FALIAS(read_exif_data, exif_read_data, arginfo_exif_read_data)
PHP_FE(exif_tagname, arginfo_exif_tagname)
View
2  ext/fbsql/php_fbsql.c
@@ -543,7 +543,7 @@ ZEND_END_ARG_INFO()
/* {{{ fbsql_functions[]
*/
-zend_function_entry fbsql_functions[] = {
+const zend_function_entry fbsql_functions[] = {
PHP_FE(fbsql_connect, arginfo_fbsql_connect)
PHP_FE(fbsql_pconnect, arginfo_fbsql_pconnect)
PHP_FE(fbsql_close, arginfo_fbsql_close)
View
2  ext/fdf/fdf.c
@@ -276,7 +276,7 @@ ZEND_END_ARG_INFO()
/* {{{ fdf_functions[]
*/
-zend_function_entry fdf_functions[] = {
+const zend_function_entry fdf_functions[] = {
PHP_FE(fdf_add_template, arginfo_fdf_add_template)
PHP_FE(fdf_close, arginfo_fdf_close)
PHP_FE(fdf_create, arginfo_fdf_create)
View
2  ext/filter/filter.c
@@ -79,7 +79,7 @@ static unsigned int php_sapi_filter(int arg, char *var, char **val, unsigned int
/* {{{ filter_functions[]
*/
-zend_function_entry filter_functions[] = {
+const zend_function_entry filter_functions[] = {
PHP_FE(filter_input, NULL)
PHP_FE(filter_var, NULL)
PHP_FE(filter_input_array, NULL)
View
2  ext/ftp/php_ftp.c
@@ -274,7 +274,7 @@ ZEND_END_ARG_INFO()
/* }}} */
-zend_function_entry php_ftp_functions[] = {
+const zend_function_entry php_ftp_functions[] = {
PHP_FE(ftp_connect, arginfo_ftp_connect)
#if HAVE_OPENSSL_EXT
PHP_FE(ftp_ssl_connect, arginfo_ftp_ssl_connect)
View
2  ext/gd/gd.c
@@ -989,7 +989,7 @@ ZEND_END_ARG_INFO()
/* {{{ gd_functions[]
*/
-zend_function_entry gd_functions[] = {
+const zend_function_entry gd_functions[] = {
PHP_FE(gd_info, arginfo_gd_info)
PHP_FE(imagearc, arginfo_imagearc)
PHP_FE(imageellipse, arginfo_imageellipse)
View
2  ext/gettext/gettext.c
@@ -101,7 +101,7 @@ ZEND_END_ARG_INFO()
/* {{{ php_gettext_functions[]
*/
-zend_function_entry php_gettext_functions[] = {
+const zend_function_entry php_gettext_functions[] = {
PHP_NAMED_FE(textdomain, zif_textdomain, arginfo_textdomain)
PHP_NAMED_FE(gettext, zif_gettext, arginfo_gettext)
/* Alias for gettext() */
View
2  ext/gmp/gmp.c
@@ -272,7 +272,7 @@ static ZEND_GINIT_FUNCTION(gmp);
/* {{{ gmp_functions[]
*/
-zend_function_entry gmp_functions[] = {
+const zend_function_entry gmp_functions[] = {
ZEND_FE(gmp_init, arginfo_gmp_init)
ZEND_FE(gmp_intval, arginfo_gmp_intval)
ZEND_FE(gmp_strval, arginfo_gmp_strval)
View
2  ext/hash/hash.c
@@ -699,7 +699,7 @@ ZEND_END_ARG_INFO()
/* {{{ hash_functions[]
*/
-zend_function_entry hash_functions[] = {
+const zend_function_entry hash_functions[] = {
PHP_FE(hash, arginfo_hash)
PHP_FE(hash_file, arginfo_hash_file)
View
2  ext/iconv/iconv.c
@@ -141,7 +141,7 @@ ZEND_END_ARG_INFO()
/* {{{ iconv_functions[]
*/
-zend_function_entry iconv_functions[] = {
+const zend_function_entry iconv_functions[] = {
PHP_RAW_NAMED_FE(iconv,php_if_iconv, arginfo_iconv)
PHP_FE(ob_iconv_handler, arginfo_ob_iconv_handler)
PHP_FE(iconv_get_encoding, arginfo_iconv_get_encoding)
View
4 ext/imap/php_imap.c
@@ -92,7 +92,7 @@ static PHP_GINIT_FUNCTION(imap);