aboutsummaryrefslogtreecommitdiffstats
path: root/globals.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2003-10-02 22:28:19 +0000
committerDaniel Veillard <veillard@src.gnome.org>2003-10-02 22:28:19 +0000
commit2b8c4a151bb6bf91c10541b0593218bca5b3d5ce (patch)
treeba95f7861f9d565c747ee7bc752ca711fc35cd8a /globals.c
parente7acf431b8fd60e98cb00d52ba071f1be8cbfbd1 (diff)
downloadandroid_external_libxml2-2b8c4a151bb6bf91c10541b0593218bca5b3d5ce.tar.gz
android_external_libxml2-2b8c4a151bb6bf91c10541b0593218bca5b3d5ce.tar.bz2
android_external_libxml2-2b8c4a151bb6bf91c10541b0593218bca5b3d5ce.zip
changed 'make tests' to use a concise output, scrolling to see where thing
* Makefile.am: changed 'make tests' to use a concise output, scrolling to see where thing broke wasn't pleasant * configure.in: some beta4 preparation, but not ready yet * error.c globals.c include/libxml/globals.h include/libxml/xmlerror.h: new error handling code, last error informations are stored in the parsing context or a global variable, new APIs to handle the xmlErrorPtr type. * parser.c parserInternals.c valid.c : started migrating to the new error handling code, it's a royal pain. * include/libxml/parser.h include/libxml/parserInternals.h: moved the definition of xmlNewParserCtxt() * parser.c: small potential buffer access problem in push code provided by Justin Fletcher * result/*.sax result/VC/PENesting* result/namespaces/* result/valid/*.err: some error messages were sligthly changed. Daniel
Diffstat (limited to 'globals.c')
-rw-r--r--globals.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/globals.c b/globals.c
index 140bc899..fd61cf41 100644
--- a/globals.c
+++ b/globals.c
@@ -121,7 +121,7 @@ xmlReallocFunc xmlRealloc = (xmlReallocFunc) realloc;
* Returns the copy of the string or NULL in case of error
*/
xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
-#endif
+#endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */
#include <libxml/threads.h>
#include <libxml/globals.h>
@@ -150,6 +150,7 @@ xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
#undef xmlSubstituteEntitiesDefaultValue
#undef xmlRegisterNodeDefaultValue
#undef xmlDeregisterNodeDefaultValue
+#undef xmlLastError
#undef xmlFree
#undef xmlMalloc
@@ -293,6 +294,7 @@ static xmlGenericErrorFunc xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc;
*/
void *xmlGenericErrorContext = NULL;
static void *xmlGenericErrorContextThrDef = NULL;
+xmlError xmlLastError;
/*
* output defaults
@@ -524,6 +526,7 @@ xmlInitializeGlobalState(xmlGlobalStatePtr gs)
gs->xmlGenericErrorContext = xmlGenericErrorContextThrDef;
gs->xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef;
gs->xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef;
+ memset(&gs->xmlLastError, 0, sizeof(xmlError));
xmlMutexUnlock(xmlThrDefMutex);
}
@@ -628,6 +631,15 @@ __htmlDefaultSAXHandler(void) {
}
#endif
+#undef xmlLastError
+xmlError *
+__xmlLastError(void) {
+ if (IS_MAIN_THREAD)
+ return (&xmlLastError);
+ else
+ return (&xmlGetGlobalState()->xmlLastError);
+}
+
/*
* Everything starting from the line below is
* Automatically generated by build_glob.py.