From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Wed Oct 25 2000 - 15:27:21 EDT
On Tue, Oct 24, 2000 at 04:01:12PM -0400, Harry Blundell wrote:
> Daniel,
>
> A while back, there was a posting to the list from a guy wanting to
> prevent libxml from sending errors to stderr. No one answered his
> question, and now we're faced with the same issue.
Okay I think this was really needed. there was a number of places
where the library needed some reporting due to an error while being
outside the context of parsing or validating (where such callbacks
are already defined).
I patched a virgin 2.2.6 to redirrect all "out of context" error
messages to a reconfigurable routine. The changes are:
- in xmlerror.h : I 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.
- in all the c files, all wild accesses to stderr or stdout within
the library have been replaced to the handler.
The result is a Jumbo Patch of 450KBytes, I saved it at
ftp://xmlsoft.org/test/messages226.diff
to avoid filling up everybody mailboxes :-\
Daniel
-- Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes | libxml Gnome XML toolkit Tel : +33 476 615 257 | 655, avenue de l'Europe | http://xmlsoft.org/ Fax : +33 476 615 207 | 38330 Montbonnot FRANCE | Rpmfind search site http://www.w3.org/People/all#veillard%40w3.org | http://rpmfind.net/ ---- Message from the list xml@rpmfind.net Archived at : http://xmlsoft.org/messages/ to unsubscribe: echo "unsubscribe xml" | mail majordomo@rpmfind.net
This archive was generated by hypermail 2b29 : Wed Oct 25 2000 - 19:43:32 EDT