ZEND_API void zend_activate_auto_globals(TSRMLS_D) /* {{{ */
{
- zend_hash_apply(CG(auto_globals), (apply_func_t) zend_auto_global_init TSRMLS_CC);
+ zend_hash_apply(CG(auto_globals), zend_auto_global_init TSRMLS_CC);
}
/* }}} */
}
-static int clean_module_constant(const zend_constant *c, int *module_number TSRMLS_DC)
+static int clean_module_constant(zval *el, void *arg TSRMLS_DC)
{
- if (c->module_number == *module_number) {
+ zend_constant *c = (zend_constant *)Z_PTR_P(el);
+ int module_number = *(int *)arg;
+
+ if (c->module_number == module_number) {
return 1;
} else {
return 0;
void clean_module_constants(int module_number TSRMLS_DC)
{
- zend_hash_apply_with_argument(EG(zend_constants), (apply_func_arg_t) clean_module_constant, (void *) &module_number TSRMLS_CC);
+ zend_hash_apply_with_argument(EG(zend_constants), clean_module_constant, (void *) &module_number TSRMLS_CC);
}
/*
* hash_apply functions
*/
-static int zend_remove_ini_entries(zval *el, int *module_number TSRMLS_DC) /* {{{ */
+static int zend_remove_ini_entries(zval *el, void *arg TSRMLS_DC) /* {{{ */
{
zend_ini_entry *ini_entry = (zend_ini_entry *)Z_PTR_P(el);
- if (ini_entry->module_number == *module_number) {
+ int module_number = *(int *)arg;
+ if (ini_entry->module_number == module_number) {
return 1;
} else {
return 0;
zend_hash_graceful_reverse_destroy(ht);
}
-static int clean_module_resource(zval *zv, int *resource_id TSRMLS_DC)
+static int clean_module_resource(zval *zv, void *arg TSRMLS_DC)
{
- if (Z_RES_TYPE_P(zv) == *resource_id) {
+ int resource_id = *(int *)arg;
+ if (Z_RES_TYPE_P(zv) == resource_id) {
return 1;
} else {
return 0;
}
-static int zend_clean_module_rsrc_dtors_cb(zval *zv, int *module_number TSRMLS_DC)
+static int zend_clean_module_rsrc_dtors_cb(zval *zv, void *arg TSRMLS_DC)
{
- zend_rsrc_list_dtors_entry *ld = Z_PTR_P(zv);
- if (ld->module_number == *module_number) {
+ zend_rsrc_list_dtors_entry *ld = (zend_rsrc_list_dtors_entry *)Z_PTR_P(zv);
+ int module_number = *(int *)arg;
+ if (ld->module_number == module_number) {
zend_hash_apply_with_argument(&EG(persistent_list), clean_module_resource, (void *) &(ld->resource_id) TSRMLS_CC);
return 1;
} else {
}
} else if (Z_TYPE_P(entry) == IS_ARRAY) {
array_init(&tmp);
- zend_hash_apply_with_arguments(Z_ARRVAL_P(entry) TSRMLS_CC, (apply_func_args_t) add_config_entry_cb, 1, tmp);
+ zend_hash_apply_with_arguments(Z_ARRVAL_P(entry) TSRMLS_CC, add_config_entry_cb, 1, tmp);
zend_hash_update(Z_ARRVAL_P(retval), hash_key->key, &tmp);
}
return 0;
if (retval) {
if (Z_TYPE_P(retval) == IS_ARRAY) {
array_init(return_value);
- zend_hash_apply_with_arguments(Z_ARRVAL_P(retval) TSRMLS_CC, (apply_func_args_t) add_config_entry_cb, 1, return_value);
+ zend_hash_apply_with_arguments(Z_ARRVAL_P(retval) TSRMLS_CC, add_config_entry_cb, 1, return_value);
return;
} else {
RETURN_STRING(Z_STRVAL_P(retval));
{
if (BG(user_shutdown_function_names)) {
zend_try {
- zend_hash_apply(BG(user_shutdown_function_names), (apply_func_t) user_shutdown_function_call TSRMLS_CC);
+ zend_hash_apply(BG(user_shutdown_function_names), user_shutdown_function_call TSRMLS_CC);
}
zend_end_try();
php_free_shutdown_functions(TSRMLS_C);
}
array_init(return_value);
- zend_hash_apply_with_arguments(EG(ini_directives) TSRMLS_CC, (apply_func_args_t) php_ini_get_option, 2, return_value, extnumber, details);
+ zend_hash_apply_with_arguments(EG(ini_directives) TSRMLS_CC, php_ini_get_option, 2, return_value, extnumber, details);
}
/* }}} */
HashTable *hash = php_ini_get_configuration_hash();
array_init(return_value);
- zend_hash_apply_with_arguments(hash TSRMLS_CC, (apply_func_args_t) add_config_entry_cb, 1, return_value);
+ zend_hash_apply_with_arguments(hash TSRMLS_CC, add_config_entry_cb, 1, return_value);
}
/* }}} */
#endif
if ((agent = zend_hash_str_find(bdata->htab, lookup_browser_name, agent_name_len)) == NULL) {
ZVAL_UNDEF(&found_browser_entry);
- zend_hash_apply_with_arguments(bdata->htab TSRMLS_CC, (apply_func_args_t) browser_reg_compare, 3, lookup_browser_name, agent_name_len, &found_browser_entry);
+ zend_hash_apply_with_arguments(bdata->htab TSRMLS_CC, browser_reg_compare, 3, lookup_browser_name, agent_name_len, &found_browser_entry);
if (Z_TYPE(found_browser_entry) != IS_UNDEF) {
agent = &found_browser_entry;
{
HashTable *myht;
zend_string *class_name;
- int (*php_element_dump_func)(zval* TSRMLS_DC, int, va_list, zend_hash_key*);
+ apply_func_args_t php_element_dump_func;
int is_temp;
int is_ref = 0;
php_element_dump_func = php_object_property_dump;
head_done:
if (myht) {
- zend_hash_apply_with_arguments(myht TSRMLS_CC, (apply_func_args_t) php_element_dump_func, 1, level);
+ zend_hash_apply_with_arguments(myht TSRMLS_CC, php_element_dump_func, 1, level);
--myht->u.v.nApplyCount;
if (is_temp) {
zend_hash_destroy(myht);
{
HashTable *myht = NULL;
zend_string *class_name;
- int (*zval_element_dump_func)(zval* TSRMLS_DC, int, va_list, zend_hash_key*);
+ apply_func_args_t zval_element_dump_func;
int is_temp = 0;
int is_ref = 0;
zval_element_dump_func = zval_object_property_dump;
head_done:
if (myht) {
- zend_hash_apply_with_arguments(myht TSRMLS_CC, (apply_func_args_t) zval_element_dump_func, 1, level, (Z_TYPE_P(struc) == IS_ARRAY ? 0 : 1));
+ zend_hash_apply_with_arguments(myht TSRMLS_CC, zval_element_dump_func, 1, level, (Z_TYPE_P(struc) == IS_ARRAY ? 0 : 1));
if (is_temp) {
zend_hash_destroy(myht);
efree(myht);
buffer_append_spaces(buf, level - 1);
}
smart_str_appendl(buf, "array (\n", 8);
- zend_hash_apply_with_arguments(myht TSRMLS_CC, (apply_func_args_t) php_array_element_export, 2, level, buf);
+ zend_hash_apply_with_arguments(myht TSRMLS_CC, php_array_element_export, 2, level, buf);
if (level > 1) {
buffer_append_spaces(buf, level - 1);
STR_RELEASE(class_name);
if (myht) {
- zend_hash_apply_with_arguments(myht TSRMLS_CC, (apply_func_args_t) php_object_element_export, 1, level, buf);
+ zend_hash_apply_with_arguments(myht TSRMLS_CC, php_object_element_export, 1, level, buf);
}
if (level > 1) {
buffer_append_spaces(buf, level - 1);
PHP_RSHUTDOWN_FUNCTION(streams)
{
- zend_hash_apply(&EG(persistent_list), (apply_func_t)forget_persistent_resource_id_numbers TSRMLS_CC);
+ zend_hash_apply(&EG(persistent_list), forget_persistent_resource_id_numbers TSRMLS_CC);
return SUCCESS;
}
if (stream->is_persistent && (close_options & PHP_STREAM_FREE_PERSISTENT)) {
/* we don't work with *stream but need its value for comparison */
- zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) _php_stream_free_persistent, stream TSRMLS_CC);
+ zend_hash_apply_with_argument(&EG(persistent_list), _php_stream_free_persistent, stream TSRMLS_CC);
}
#if ZEND_DEBUG
if ((close_options & PHP_STREAM_FREE_RSRC_DTOR) && (stream->__exposed == 0) && (EG(error_reporting) & E_WARNING)) {