]> granicus.if.org Git - php/commitdiff
add function to allow extensions to use new error handling if set by user
authorRob Richards <rrichards@php.net>
Sun, 20 Feb 2005 21:49:45 +0000 (21:49 +0000)
committerRob Richards <rrichards@php.net>
Sun, 20 Feb 2005 21:49:45 +0000 (21:49 +0000)
ext/libxml/libxml.c
ext/libxml/php_libxml.h

index 0099759fb338344d139919bf661bbc1e5a210818..1e2d1c3c527bc8266e356b115b1681b3c2a002de 100644 (file)
@@ -388,6 +388,15 @@ static void php_libxml_ctx_error_level(int level, void *ctx, const char *msg TSR
        }
 }
 
+void php_libxml_issue_error(int level, const char *msg TSRMLS_DC)
+{
+       if (LIBXML(error_list)) {
+               _php_list_set_error_structure(NULL, msg);
+       } else {
+               php_error_docref(NULL TSRMLS_CC, level, "%s", msg);
+       }
+}
+
 static void php_libxml_internal_error_handler(int error_type, void *ctx, const char **msg, va_list ap)
 {
        char *buf;
index 8c719402c98d9d61f05c1fefb717c664064f473f..429b6498d771efad72e29877b5c1a611e51c9897 100644 (file)
@@ -88,6 +88,7 @@ void php_libxml_ctx_warning(void *ctx, const char *msg, ...);
 void php_libxml_ctx_error(void *ctx, const char *msg, ...);
 PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s);
 PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC);
+PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg TSRMLS_DC);
 
 #endif /* HAVE_LIBXML */