diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index 4590003d..481e9310 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -1907,6 +1907,7 @@ error handling the API used to report errors Daniel Veillard + @@ -2691,7 +2692,6 @@ - @@ -4315,6 +4315,8 @@ Returns the attributes required for the specified element. + + @@ -7412,11 +7414,6 @@ crash if you try to modify the tree)'/> - - DEPRECATED: Use xmlSetGenericErrorFunc. Set or reset (if NULL) the default handler for generic errors to the builtin error function. - - - Callback on internal subset declaration. diff --git a/error.c b/error.c index fc5c6dec..563f4720 100644 --- a/error.c +++ b/error.c @@ -234,24 +234,6 @@ xmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) { va_end(args); } -/** - * initGenericErrorDefaultFunc: - * @handler: the handler - * - * DEPRECATED: Use xmlSetGenericErrorFunc. - * - * Set or reset (if NULL) the default handler for generic errors - * to the builtin error function. - */ -void -initGenericErrorDefaultFunc(xmlGenericErrorFunc * handler) -{ - if (handler == NULL) - xmlGenericError = xmlGenericErrorDefaultFunc; - else - xmlGenericError = (*handler); -} - /** * xmlSetGenericErrorFunc: * @ctx: the new error handling context diff --git a/include/libxml/xmlerror.h b/include/libxml/xmlerror.h index d847bfde..cb4f45bf 100644 --- a/include/libxml/xmlerror.h +++ b/include/libxml/xmlerror.h @@ -16,6 +16,11 @@ extern "C" { #endif +/* + * Backward compatibility + */ +#define initGenericErrorDefaultFunc(h) xmlSetGenericErrorFunc(NULL, h) + /** * xmlErrorLevel: * @@ -904,9 +909,6 @@ XML_DEPRECATED XMLPUBFUN void xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler); -XML_DEPRECATED -XMLPUBFUN void - initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler); XMLPUBFUN void xmlSetStructuredErrorFunc (void *ctx, diff --git a/testapi.c b/testapi.c index 930d413e..7b678da1 100644 --- a/testapi.c +++ b/testapi.c @@ -29885,40 +29885,6 @@ test_xmlautomata(void) { return(test_ret); } -#define gen_nb_xmlGenericErrorFunc_ptr 1 -#define gen_xmlGenericErrorFunc_ptr(no, nr) NULL -#define des_xmlGenericErrorFunc_ptr(no, val, nr) - -static int -test_initGenericErrorDefaultFunc(void) { - int test_ret = 0; - - int mem_base; - xmlGenericErrorFunc * handler; /* the handler */ - int n_handler; - - for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) { - mem_base = xmlMemBlocks(); - handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0); - - initGenericErrorDefaultFunc(handler); - call_tests++; - des_xmlGenericErrorFunc_ptr(n_handler, handler, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in initGenericErrorDefaultFunc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_handler); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - #define gen_nb_const_xmlError_ptr 1 #define gen_const_xmlError_ptr(no, nr) NULL #define des_const_xmlError_ptr(no, val, nr) @@ -30214,8 +30180,7 @@ static int test_xmlerror(void) { int test_ret = 0; - if (quiet == 0) printf("Testing xmlerror : 7 of 18 functions ...\n"); - test_ret += test_initGenericErrorDefaultFunc(); + if (quiet == 0) printf("Testing xmlerror : 6 of 17 functions ...\n"); test_ret += test_xmlCopyError(); test_ret += test_xmlCtxtGetLastError(); test_ret += test_xmlCtxtResetLastError();