summaryrefslogtreecommitdiff
path: root/Zend/zend_API.h
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2003-08-05 10:24:40 +0000
committerZeev Suraski <zeev@php.net>2003-08-05 10:24:40 +0000
commit92b4013e8d6fb3a92f958e9c01abf824bbdb4aaa (patch)
tree85e2d271c92ef8bd6dcc50944327933e3391d781 /Zend/zend_API.h
parent97c2522128815964b450aed41ef095d6d9ccc8aa (diff)
downloadphp-git-92b4013e8d6fb3a92f958e9c01abf824bbdb4aaa.tar.gz
Try to put an end to the endless number of call_user_function variants.
zend_call_function() now takes a structure that should contain all of the necessary information. If further information is necessary in the future, then we'll be able to add it without having to introduce a new function. As for caching - the 2nd, optional argument is a struct that can hold all of the information that's necessary to invoke the function, including its handler, scope and object it operates on (if any). Note that you may only use a cache if the arguments you provide to zend_call_function() are identical to the ones of the last call, except for the argument and return value information. The recently introduced fast_call_user_function() was removed I fixed most of the places that used fast_call_user_function() to use caching but there are still some that need to be fixed (XML and reflection)
Diffstat (limited to 'Zend/zend_API.h')
-rw-r--r--Zend/zend_API.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 5a3abe20c4..41fd8ab32b 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -265,9 +265,33 @@ ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *valu
#define add_property_stringl(__arg, __key, __str, __length, __duplicate) add_property_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value TSRMLS_CC)
+
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);
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);
-ZEND_API int fast_call_user_function(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, zend_function **function_pointer TSRMLS_DC);
+
+typedef struct _zend_fcall_info {
+ size_t size;
+ HashTable *function_table;
+ zval *function_name;
+ HashTable *symbol_table;
+ zval **retval_ptr_ptr;
+ zend_uint param_count;
+ zval ***params;
+ zval **object_pp;
+ zend_bool no_separation;
+} zend_fcall_info;
+
+typedef struct _zend_fcall_info_cache {
+ zend_bool initialized;
+ zend_function *function_handler;
+ zend_class_entry *calling_scope;
+ zval **object_pp;
+} zend_fcall_info_cache;
+
+ZEND_API extern zend_fcall_info_cache empty_fcall_info_cache;
+
+ZEND_API int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TSRMLS_DC);
+
ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
zend_bool is_ref, int num_symbol_tables, ...);