summaryrefslogtreecommitdiff
path: root/globals.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2004-06-08 10:16:42 +0000
committerDaniel Veillard <veillard@src.gnome.org>2004-06-08 10:16:42 +0000
commit1b243b4fc9638312287fb5b4dd3ea209bf42bf6a (patch)
tree8df04a2b86c2b69af23899a5707042b1fd2c2db4 /globals.c
parentabf598b548d02ee32c7bf67baf3813f4d36e1257 (diff)
downloadlibxml2-1b243b4fc9638312287fb5b4dd3ea209bf42bf6a.tar.gz
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
Diffstat (limited to 'globals.c')
-rw-r--r--globals.c46
1 files changed, 9 insertions, 37 deletions
diff --git a/globals.c b/globals.c
index 6297aa29..79b4a14e 100644
--- a/globals.c
+++ b/globals.c
@@ -650,23 +650,6 @@ xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func)
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 @@ xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilena
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 @@ xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc fun
xmlMutexLock(xmlThrDefMutex);
old = xmlOutputBufferCreateFilenameValueThrDef;
-
+#ifdef LIBXML_OUTPUT_ENABLED
+ if (old == NULL) {
+ old = __xmlOutputBufferCreateFilename;
+ }
+#endif
xmlOutputBufferCreateFilenameValueThrDef = func;
xmlMutexUnlock(xmlThrDefMutex);
@@ -1071,4 +1044,3 @@ __xmlOutputBufferCreateFilenameValue(void) {
else
return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue);
}
-