1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

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
This commit is contained in:
Daniel Veillard
2000-10-25 19:56:55 +00:00
parent 29a11cc696
commit d6d7f7bf96
25 changed files with 1715 additions and 901 deletions

View File

@ -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) {