#include "zend_list.h"
#include "zend_globals.h"
#include "zend_API.h"
-#include "zend_variables.h"
-#include "zend_operators.h"
#define YYERROR_VERBOSE
#define YYSTYPE znode
#include "zend.h"
-#include "zend_operators.h"
-#include "zend_variables.h"
#include "zend_extensions.h"
#include "modules.h"
#include "zend_constants.h"
/* true multithread-shared globals */
ZEND_API zend_class_entry zend_standard_class_def;
ZEND_API int (*zend_printf)(const char *format, ...);
-ZEND_API int (*zend_write)(const char *str, uint str_length);
+ZEND_API zend_write_func_t zend_write;
ZEND_API void (*zend_error)(int type, const char *format, ...);
ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path);
ZEND_API void (*zend_block_interruptions)(void);
ZEND_API int zend_print_zval(zval *expr, int indent)
+{
+ return zend_print_zval_ex(zend_write, expr, indent);
+}
+
+
+ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent)
{
zval expr_copy;
int use_copy;
}
return 0;
}
- ZEND_WRITE(expr->value.str.val,expr->value.str.len);
+ write_func(expr->value.str.val,expr->value.str.len);
if (use_copy) {
zval_dtor(expr);
}
}
-ZEND_API void zend_print_zval_r(zval *expr, int indent)
+ZEND_API void zend_print_zval_r(zval *expr, int indent)
+{
+ zend_print_zval_r_ex(zend_write, expr, indent);
+}
+
+
+ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent)
{
switch(expr->type) {
case IS_ARRAY:
/* Set up utility functions and values */
zend_error = utility_functions->error_function;
zend_printf = utility_functions->printf_function;
- zend_write = utility_functions->write_function;
+ zend_write = (zend_write_func_t) utility_functions->write_function;
zend_fopen = utility_functions->fopen_function;
if (!zend_fopen) {
zend_fopen = zend_fopen_wrapper;
} zend_utility_values;
+typedef int (*zend_write_func_t)(const char *str, uint str_length);
+
+
#undef MIN
#undef MAX
#define MAX(a,b) (((a)>(b))?(a):(b))
ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_copy);
ZEND_API int zend_print_zval(zval *expr, int indent);
+ZEND_API int zend_print_zval_ex(zend_write_func_t write_func, zval *expr, int indent);
ZEND_API void zend_print_zval_r(zval *expr, int indent);
+ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int indent);
ZEND_API extern char *empty_string;
#define ZEND_PUTS(str) zend_write((str), strlen((str)))
#define ZEND_PUTC(c) zend_write(&(c), 1), (c)
+
BEGIN_EXTERN_C()
extern ZEND_API int (*zend_printf)(const char *format, ...);
-extern ZEND_API int (*zend_write)(const char *str, uint str_length);
+extern ZEND_API zend_write_func_t zend_write;
extern ZEND_API void (*zend_error)(int type, const char *format, ...);
extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path);
extern ZEND_API void (*zend_block_interruptions)(void);
#include "zend.h"
-#include "zend_variables.h"
#include "zend_execute.h"
#include "zend_API.h"
#include "modules.h"
#include "zend_constants.h"
-#include "zend_operators.h"
#ifdef HAVE_STDARG_H
# include <stdarg.h>
#include "modules.h"
#include "zend_list.h"
#include "zend_fast_cache.h"
+#include "zend_operators.h"
+#include "zend_variables.h"
#define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
#include "zend.h"
#include "zend_API.h"
#include "zend_builtin_functions.h"
-#include "zend_operators.h"
-#include "zend_variables.h"
#include "zend_constants.h"
#undef ZEND_TEST_EXCEPTIONS
#include "zend_compile.h"
#include "zend_llist.h"
#include "zend_API.h"
-#include "zend_variables.h"
-#include "zend_operators.h"
#include "zend_fast_cache.h"
#include "zend_execute.h"
#include "zend_API.h"
#include "zend_ptr_stack.h"
-#include "zend_variables.h"
-#include "zend_operators.h"
#include "zend_constants.h"
#include "zend_extensions.h"
#include "zend_fast_cache.h"
#include "zend_execute.h"
#include "zend_API.h"
#include "zend_ptr_stack.h"
-#include "zend_variables.h"
-#include "zend_operators.h"
#include "zend_constants.h"
#include "zend_extensions.h"
#include "zend_execute_locks.h"
#include "zend.h"
#include "zend_alloc.h"
#include "zend_compile.h"
-#include "zend_variables.h"
-#include "zend_operators.h"
#include "zend_extensions.h"
#include "zend_API.h"
#include "zend_API.h"
#include "zend_globals.h"
#include "zend_constants.h"
-#include "zend_variables.h"
#include "zend_list.h"
ZEND_API char *empty_string = ""; /* in order to save emalloc() and efree() time for