applied patch from Rob Richards for the per thread I/O mappings Daniel
* globals.c xmlIO.c include/libxml/globals.h include/libxml/xmlIO.h:
applied patch from Rob Richards for the per thread I/O mappings
Daniel
diff --git a/globals.c b/globals.c
index 6297aa2..79b4a14 100644
--- a/globals.c
+++ b/globals.c
@@ -650,23 +650,6 @@
return(old);
}
-/**
- * xmlParserInputBufferCreateFilename:
- * @func: function pointer to the new ParserInputBufferCreateFilenameFunc
- *
- * Registers a callback for URI input file handling
- *
- * Returns the old value of the registration function
- */
-xmlParserInputBufferCreateFilenameFunc
-xmlParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func)
-{
- xmlParserInputBufferCreateFilenameFunc old = xmlParserInputBufferCreateFilenameValue;
-
- xmlParserInputBufferCreateFilenameValue = func;
- return(old);
-}
-
xmlParserInputBufferCreateFilenameFunc
xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func)
{
@@ -674,30 +657,16 @@
xmlMutexLock(xmlThrDefMutex);
old = xmlParserInputBufferCreateFilenameValueThrDef;
-
+ if (old == NULL) {
+ old = __xmlParserInputBufferCreateFilename;
+ }
+
xmlParserInputBufferCreateFilenameValueThrDef = func;
xmlMutexUnlock(xmlThrDefMutex);
return(old);
}
-/**
- * xmlOutputBufferCreateFilename:
- * @func: function pointer to the new OutputBufferCreateFilenameFunc
- *
- * Registers a callback for URI output file handling
- *
- * Returns the old value of the registration function
- */
-xmlOutputBufferCreateFilenameFunc
-xmlOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func)
-{
- xmlOutputBufferCreateFilenameFunc old = xmlOutputBufferCreateFilenameValue;
-
- xmlOutputBufferCreateFilenameValue = func;
- return(old);
-}
-
xmlOutputBufferCreateFilenameFunc
xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func)
{
@@ -705,7 +674,11 @@
xmlMutexLock(xmlThrDefMutex);
old = xmlOutputBufferCreateFilenameValueThrDef;
-
+#ifdef LIBXML_OUTPUT_ENABLED
+ if (old == NULL) {
+ old = __xmlOutputBufferCreateFilename;
+ }
+#endif
xmlOutputBufferCreateFilenameValueThrDef = func;
xmlMutexUnlock(xmlThrDefMutex);
@@ -1071,4 +1044,3 @@
else
return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue);
}
-