- Commiting Sterling's new multi_convert* functions

This commit is contained in:
Andi Gutmans 2000-09-05 17:55:57 +00:00
parent d57e56ab4c
commit 715774bed7
2 changed files with 48 additions and 1 deletions

View File

@ -488,7 +488,51 @@ ZEND_API void convert_to_object(zval *op)
}
}
ZEND_API void multi_convert_to_long_ex(int argc, ...)
{
zval **arg;
va_list ap;
va_start(ap, argc);
while (argc--) {
arg = va_arg(ap, zval **);
convert_to_long_ex(arg);
}
va_end(ap);
}
ZEND_API void multi_convert_to_double_ex(int argc, ...)
{
zval **arg;
va_list ap;
va_start(ap, argc);
while (argc--) {
arg = va_arg(ap, zval **);
convert_to_double_ex(arg);
}
va_end(ap);
}
ZEND_API void multi_convert_to_string_ex(int argc, ...)
{
zval **arg;
va_list ap;
va_start(ap, argc);
while (argc--) {
arg = va_arg(ap, zval **);
convert_to_string_ex(arg);
}
va_end(ap);
}
ZEND_API int add_function(zval *result, zval *op1, zval *op2)
{
zval op1_copy, op2_copy;

View File

@ -132,6 +132,9 @@ ZEND_API void convert_to_null(zval *op);
ZEND_API void convert_to_boolean(zval *op);
ZEND_API void convert_to_array(zval *op);
ZEND_API void convert_to_object(zval *op);
ZEND_API void multi_convert_to_long_ex(int argc, ...);
ZEND_API void multi_convert_to_double_ex(int argc, ...);
ZEND_API void multi_convert_to_string_ex(int argc, ...);
ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2);
ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2);
#define convert_to_string(op) _convert_to_string((op) ZEND_FILE_LINE_CC)