From d6d7f7bf96a87688cc4bf756cf98367018e3ef88 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Wed, 25 Oct 2000 19:56:55 +0000 Subject: patched to redirrect all "out of context" error messages to a reconfigurable routine. The changes are: * xmlerror.h : added the export of an error context type (void *) an error handler type xmlGenericErrorFunc there is an interface xmlSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler); to reset the error handling routine and its argument (by default it's equivalent to respectively fprintf and stderr. * all the c files: all wild accesses to stderr or stdout within the library have been replaced to calls to the handler. Daniel --- testXPath.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'testXPath.c') diff --git a/testXPath.c b/testXPath.c index c226cf0f..487987f2 100644 --- a/testXPath.c +++ b/testXPath.c @@ -41,6 +41,7 @@ #include #include #include +#include #if defined(LIBXML_XPTR_ENABLED) #include static int xptr = 0; @@ -115,7 +116,8 @@ void testXPathFile(const char *filename) { input = fopen(filename, "r"); if (input == NULL) { - fprintf(stderr, "Cannot open %s for reading\n", filename); + xmlGenericError(xmlGenericErrorContext, + "Cannot open %s for reading\n", filename); return; } while (fgets(expr, 4500, input) != NULL) { -- cgit v1.2.3