diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2000-10-25 19:56:55 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2000-10-25 19:56:55 +0000 |
commit | d6d7f7bf96a87688cc4bf756cf98367018e3ef88 (patch) | |
tree | 6ee8539e005ae8e6f255493e4b55e5f3f965b6f2 /testXPath.c | |
parent | 29a11cc696655f9ac841a5ca28b272e4150aafa1 (diff) | |
download | android_external_libxml2-d6d7f7bf96a87688cc4bf756cf98367018e3ef88.tar.gz android_external_libxml2-d6d7f7bf96a87688cc4bf756cf98367018e3ef88.tar.bz2 android_external_libxml2-d6d7f7bf96a87688cc4bf756cf98367018e3ef88.zip |
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
Diffstat (limited to 'testXPath.c')
-rw-r--r-- | testXPath.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/testXPath.c b/testXPath.c index c226cf0f..487987f2 100644 --- a/testXPath.c +++ b/testXPath.c @@ -41,6 +41,7 @@ #include <libxml/debugXML.h> #include <libxml/xmlmemory.h> #include <libxml/parserInternals.h> +#include <libxml/xmlerror.h> #if defined(LIBXML_XPTR_ENABLED) #include <libxml/xpointer.h> 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) { |