diff options
author | Andi Gutmans <andi@php.net> | 1999-04-14 19:53:33 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 1999-04-14 19:53:33 +0000 |
commit | 39f9487ee1ee4132e12eaafa0ed2a63e12612420 (patch) | |
tree | d84b46e0f75a29af0ac21443563ccf9b048e9a5c /Zend/zend_API.c | |
parent | 76ceb9ad44106df47b7d6faa81160926574509aa (diff) | |
download | php-git-39f9487ee1ee4132e12eaafa0ed2a63e12612420.tar.gz |
-Tiny patches
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index caf097b01b..67cfd78546 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -103,6 +103,51 @@ int getParametersArray(int ht, int param_count, zval **argument_array) } + + +/* Zend-optimized Extended functions */ +/* this function doesn't check for too many parameters */ +int getParametersEx(int param_count,...) +{ + void **p = EG(argument_stack).top_element-1; + int arg_count = (ulong) *p; + va_list ptr; + zval ***param; + ELS_FETCH(); + + if (param_count>arg_count) { + return FAILURE; + } + + va_start(ptr, param_count); + while (param_count>0) { + param = va_arg(ptr, zval ***); + *param = (zval **) p-(param_count--); + } + va_end(ptr); + + return SUCCESS; +} + + +int getParametersArrayEx(int param_count, zval ***argument_array) +{ + void **p = EG(argument_stack).top_element-1; + int arg_count = (ulong) *p; + ELS_FETCH(); + + if (param_count>arg_count) { + return FAILURE; + } + + while (param_count>0) { + *(argument_array++) = (zval **) p-(param_count--); + } + + return SUCCESS; +} + + int getThis(zval **this) { /* NEEDS TO BE IMPLEMENTED FOR ZEND */ |