static void (*zend_message_dispatcher_p)(long message, void *data);
static int (*zend_get_ini_entry_p)(char *name, uint name_length, zval *contents);
-#if ZEND_NEW_ERROR_HANDLING
static void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
-#else
-ZEND_API void (*zend_error_cb)(int type, const char *format, ...);
-#endif
#ifdef ZTS
ZEND_API int compiler_globals_id;
}
-
-#if ZEND_NEW_ERROR_HANDLING
-
#define ZEND_ERROR_BUFFER_SIZE 1024
ZEND_API void zend_error(int type, const char *format, ...)
va_start(args, format);
+
/* if we don't have a user defined error handler */
if (!EG(user_error_handler)) {
zend_error_cb(type, error_filename, error_lineno, format, args);
INIT_PZVAL(&error_type);
error_message.value.str.val = (char *) emalloc(ZEND_ERROR_BUFFER_SIZE);
- /* error_message.value.str.len = vsnprintf(error_message->value.str.val, error_message->value.str.len-1, format, args); */
+#ifdef HAVE_VSNPRINTF
+ error_message.value.str.len = vsnprintf(error_message.value.str.val, ZEND_ERROR_BUFFER_SIZE, format, args);
+#else
+ /* This is risky... */
error_message.value.str.len = vsprintf(error_message.value.str.val, format, args);
+#endif
error_message.type = IS_STRING;
error_type.value.lval = type;
va_end(args);
}
-#endif
-
#define ZEND_VERSION "1.00"
-#define ZEND_NEW_ERROR_HANDLING 0
-
#ifdef __cplusplus
#define BEGIN_EXTERN_C() extern "C" {
#define END_EXTERN_C() }
typedef struct _zend_utility_functions {
-#if ZEND_NEW_ERROR_HANDLING
void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
-#else
- void (*error_function)(int type, const char *format, ...);
-#endif
int (*printf_function)(const char *format, ...);
int (*write_function)(const char *str, uint str_length);
FILE *(*fopen_function)(const char *filename, char **opened_path);
extern ZEND_API void (*zend_ticks_function)(int ticks);
-#if ZEND_NEW_ERROR_HANDLING
ZEND_API void zend_error(int type, const char *format, ...);
-#else
-#define zend_error zend_error_cb
-ZEND_API void (*zend_error_cb)(int type, const char *format, ...);
-#endif
void zenderror(char *error);