diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2003-10-10 14:10:40 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2003-10-10 14:10:40 +0000 |
commit | 659e71ec2476d24bfca0d6432a69ef9a49a62be4 (patch) | |
tree | 25c3a793c2d31b4d6c355cb439af0c8362698619 /include | |
parent | d96cce1abe2cd10f10074e07c56520fbbba9f3ef (diff) | |
download | libxml2-659e71ec2476d24bfca0d6432a69ef9a49a62be4.tar.gz |
Setting up the framework for structured error reporting, touches a lot of
* HTMLparser.c c14n.c catalog.c error.c globals.c parser.c
parserInternals.c relaxng.c valid.c xinclude.c xmlIO.c xmlregexp.c
xmlschemas.c xpath.c xpointer.c include/libxml/globals.h
include/libxml/parser.h include/libxml/valid.h
include/libxml/xmlerror.h: Setting up the framework for structured
error reporting, touches a lot of modules, but little code now
the error handling trail has been cleaned up.
Daniel
Diffstat (limited to 'include')
-rw-r--r-- | include/libxml/globals.h | 12 | ||||
-rw-r--r-- | include/libxml/parser.h | 1 | ||||
-rw-r--r-- | include/libxml/valid.h | 3 | ||||
-rw-r--r-- | include/libxml/xmlerror.h | 6 |
4 files changed, 21 insertions, 1 deletions
diff --git a/include/libxml/globals.h b/include/libxml/globals.h index f380db1b..733632c7 100644 --- a/include/libxml/globals.h +++ b/include/libxml/globals.h @@ -42,6 +42,7 @@ XMLPUBFUN void XMLCALL xmlCleanupGlobals(void); #undef xmlDoValidityCheckingDefaultValue #undef xmlFree #undef xmlGenericError +#undef xmlStructuredError #undef xmlGenericErrorContext #undef xmlGetWarningsDefaultValue #undef xmlIndentTreeOutput @@ -82,6 +83,7 @@ struct _xmlGlobalState xmlReallocFunc xmlRealloc; xmlGenericErrorFunc xmlGenericError; + xmlStructuredErrorFunc xmlStructuredError; void *xmlGenericErrorContext; int oldXMLWDcompatibility; @@ -121,6 +123,8 @@ XMLPUBFUN void XMLCALL xmlInitializeGlobalState(xmlGlobalStatePtr gs); XMLPUBFUN void XMLCALL xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler); +XMLPUBFUN void XMLCALL xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler); + XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlRegisterNodeDefault(xmlRegisterNodeFunc func); XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func); XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func); @@ -279,6 +283,14 @@ XMLPUBFUN xmlGenericErrorFunc * XMLCALL __xmlGenericError(void); XMLPUBVAR xmlGenericErrorFunc xmlGenericError; #endif +XMLPUBFUN xmlStructuredErrorFunc * XMLCALL __xmlStructuredError(void); +#ifdef LIBXML_THREAD_ENABLED +#define xmlStructuredError \ +(*(__xmlStructuredError())) +#else +XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError; +#endif + XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void); #ifdef LIBXML_THREAD_ENABLED #define xmlGenericErrorContext \ diff --git a/include/libxml/parser.h b/include/libxml/parser.h index 70ee4b7e..9da48cbd 100644 --- a/include/libxml/parser.h +++ b/include/libxml/parser.h @@ -716,6 +716,7 @@ struct _xmlSAXHandler { void *_private; startElementNsSAX2Func startElementNs; endElementNsSAX2Func endElementNs; + xmlStructuredErrorFunc serror; }; /* diff --git a/include/libxml/valid.h b/include/libxml/valid.h index cb7ff2cc..07b4f8f0 100644 --- a/include/libxml/valid.h +++ b/include/libxml/valid.h @@ -11,6 +11,7 @@ #define __XML_VALID_H__ #include <libxml/xmlversion.h> +#include <libxml/xmlerror.h> #include <libxml/tree.h> #include <libxml/list.h> #include <libxml/xmlautomata.h> @@ -86,6 +87,8 @@ struct _xmlValidCtxt { void *am; void *state; #endif + + xmlStructuredErrorFunc serror; /* structured error reporting capability */ }; /* diff --git a/include/libxml/xmlerror.h b/include/libxml/xmlerror.h index 8f034036..8510a807 100644 --- a/include/libxml/xmlerror.h +++ b/include/libxml/xmlerror.h @@ -580,6 +580,9 @@ XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler); +XMLPUBFUN void XMLCALL + xmlSetStructuredErrorFunc (void *ctx, + xmlStructuredErrorFunc handler); /* * Default message routines used by SAX and Valid context for error * and warning reporting. @@ -627,7 +630,8 @@ XMLPUBFUN int XMLCALL * Internal callback reporting routine */ XMLPUBFUN void XMLCALL - __xmlRaiseError (xmlGenericErrorFunc channel, + __xmlRaiseError (xmlStructuredErrorFunc schannel, + xmlGenericErrorFunc channel, void *data, void *ctx, void *node, |