mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-07 06:43:02 +03:00
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
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
Tue Jun 8 12:14:16 CEST 2004 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* globals.c xmlIO.c include/libxml/globals.h include/libxml/xmlIO.h:
|
||||||
|
applied patch from Rob Richards for the per thread I/O mappings
|
||||||
|
|
||||||
Tue Jun 8 09:58:31 HKT 2004 William Brack <wbrack@mmm.com.hk>
|
Tue Jun 8 09:58:31 HKT 2004 William Brack <wbrack@mmm.com.hk>
|
||||||
|
|
||||||
* xinclude.c: some further enhancement to take care of
|
* xinclude.c: some further enhancement to take care of
|
||||||
|
46
globals.c
46
globals.c
@@ -650,23 +650,6 @@ xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func)
|
|||||||
return(old);
|
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
|
xmlParserInputBufferCreateFilenameFunc
|
||||||
xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func)
|
xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func)
|
||||||
{
|
{
|
||||||
@@ -674,30 +657,16 @@ xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilena
|
|||||||
|
|
||||||
xmlMutexLock(xmlThrDefMutex);
|
xmlMutexLock(xmlThrDefMutex);
|
||||||
old = xmlParserInputBufferCreateFilenameValueThrDef;
|
old = xmlParserInputBufferCreateFilenameValueThrDef;
|
||||||
|
if (old == NULL) {
|
||||||
|
old = __xmlParserInputBufferCreateFilename;
|
||||||
|
}
|
||||||
|
|
||||||
xmlParserInputBufferCreateFilenameValueThrDef = func;
|
xmlParserInputBufferCreateFilenameValueThrDef = func;
|
||||||
xmlMutexUnlock(xmlThrDefMutex);
|
xmlMutexUnlock(xmlThrDefMutex);
|
||||||
|
|
||||||
return(old);
|
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
|
xmlOutputBufferCreateFilenameFunc
|
||||||
xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func)
|
xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func)
|
||||||
{
|
{
|
||||||
@@ -705,7 +674,11 @@ xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc fun
|
|||||||
|
|
||||||
xmlMutexLock(xmlThrDefMutex);
|
xmlMutexLock(xmlThrDefMutex);
|
||||||
old = xmlOutputBufferCreateFilenameValueThrDef;
|
old = xmlOutputBufferCreateFilenameValueThrDef;
|
||||||
|
#ifdef LIBXML_OUTPUT_ENABLED
|
||||||
|
if (old == NULL) {
|
||||||
|
old = __xmlOutputBufferCreateFilename;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
xmlOutputBufferCreateFilenameValueThrDef = func;
|
xmlOutputBufferCreateFilenameValueThrDef = func;
|
||||||
xmlMutexUnlock(xmlThrDefMutex);
|
xmlMutexUnlock(xmlThrDefMutex);
|
||||||
|
|
||||||
@@ -1071,4 +1044,3 @@ __xmlOutputBufferCreateFilenameValue(void) {
|
|||||||
else
|
else
|
||||||
return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue);
|
return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -69,9 +69,6 @@ XMLPUBFUN void XMLCALL xmlCleanupGlobals(void);
|
|||||||
typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node);
|
typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node);
|
||||||
typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
|
typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
|
||||||
|
|
||||||
typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI, xmlCharEncoding enc);
|
|
||||||
typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI, xmlCharEncodingHandlerPtr encoder, int compression);
|
|
||||||
|
|
||||||
typedef struct _xmlGlobalState xmlGlobalState;
|
typedef struct _xmlGlobalState xmlGlobalState;
|
||||||
typedef xmlGlobalState *xmlGlobalStatePtr;
|
typedef xmlGlobalState *xmlGlobalStatePtr;
|
||||||
struct _xmlGlobalState
|
struct _xmlGlobalState
|
||||||
@@ -139,11 +136,10 @@ XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlThrDefRegisterNodeDefault(xmlRegisterNo
|
|||||||
XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func);
|
XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func);
|
||||||
XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func);
|
XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func);
|
||||||
|
|
||||||
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL xmlParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func);
|
XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL
|
||||||
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func);
|
xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
|
||||||
|
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL
|
||||||
XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL xmlOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
|
xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func);
|
||||||
XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
|
|
||||||
|
|
||||||
/** DOC_DISABLE */
|
/** DOC_DISABLE */
|
||||||
/*
|
/*
|
||||||
|
@@ -62,6 +62,9 @@ typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len);
|
|||||||
*/
|
*/
|
||||||
typedef int (*xmlInputCloseCallback) (void * context);
|
typedef int (*xmlInputCloseCallback) (void * context);
|
||||||
|
|
||||||
|
typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI, xmlCharEncoding enc);
|
||||||
|
typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI, xmlCharEncodingHandlerPtr encoder, int compression);
|
||||||
|
|
||||||
#ifdef LIBXML_OUTPUT_ENABLED
|
#ifdef LIBXML_OUTPUT_ENABLED
|
||||||
/*
|
/*
|
||||||
* Those are the functions and datatypes for the library output
|
* Those are the functions and datatypes for the library output
|
||||||
@@ -206,6 +209,16 @@ XMLPUBFUN int XMLCALL
|
|||||||
xmlInputOpenCallback openFunc,
|
xmlInputOpenCallback openFunc,
|
||||||
xmlInputReadCallback readFunc,
|
xmlInputReadCallback readFunc,
|
||||||
xmlInputCloseCallback closeFunc);
|
xmlInputCloseCallback closeFunc);
|
||||||
|
|
||||||
|
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL
|
||||||
|
xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func);
|
||||||
|
XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL
|
||||||
|
xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func);
|
||||||
|
|
||||||
|
xmlParserInputBufferPtr
|
||||||
|
__xmlParserInputBufferCreateFilename(const char *URI,
|
||||||
|
xmlCharEncoding enc);
|
||||||
|
|
||||||
#ifdef LIBXML_OUTPUT_ENABLED
|
#ifdef LIBXML_OUTPUT_ENABLED
|
||||||
/*
|
/*
|
||||||
* Interfaces for output
|
* Interfaces for output
|
||||||
@@ -258,6 +271,11 @@ XMLPUBFUN int XMLCALL
|
|||||||
xmlOutputOpenCallback openFunc,
|
xmlOutputOpenCallback openFunc,
|
||||||
xmlOutputWriteCallback writeFunc,
|
xmlOutputWriteCallback writeFunc,
|
||||||
xmlOutputCloseCallback closeFunc);
|
xmlOutputCloseCallback closeFunc);
|
||||||
|
|
||||||
|
xmlOutputBufferPtr
|
||||||
|
__xmlOutputBufferCreateFilename(const char *URI,
|
||||||
|
xmlCharEncodingHandlerPtr encoder,
|
||||||
|
int compression);
|
||||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||||
|
|
||||||
/* This function only exists if HTTP support built into the library */
|
/* This function only exists if HTTP support built into the library */
|
||||||
|
45
xmlIO.c
45
xmlIO.c
@@ -2125,7 +2125,7 @@ xmlOutputBufferClose(xmlOutputBufferPtr out)
|
|||||||
}
|
}
|
||||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||||
|
|
||||||
static xmlParserInputBufferPtr
|
xmlParserInputBufferPtr
|
||||||
__xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
|
__xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
|
||||||
xmlParserInputBufferPtr ret;
|
xmlParserInputBufferPtr ret;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -2205,7 +2205,7 @@ xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LIBXML_OUTPUT_ENABLED
|
#ifdef LIBXML_OUTPUT_ENABLED
|
||||||
static xmlOutputBufferPtr
|
xmlOutputBufferPtr
|
||||||
__xmlOutputBufferCreateFilename(const char *URI,
|
__xmlOutputBufferCreateFilename(const char *URI,
|
||||||
xmlCharEncodingHandlerPtr encoder,
|
xmlCharEncodingHandlerPtr encoder,
|
||||||
int compression ATTRIBUTE_UNUSED) {
|
int compression ATTRIBUTE_UNUSED) {
|
||||||
@@ -2598,6 +2598,47 @@ xmlOutputBufferCreateIO(xmlOutputWriteCallback iowrite,
|
|||||||
}
|
}
|
||||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xmlParserInputBufferCreateFilenameDefault:
|
||||||
|
* @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;
|
||||||
|
if (old == NULL) {
|
||||||
|
old = __xmlParserInputBufferCreateFilename;
|
||||||
|
}
|
||||||
|
|
||||||
|
xmlParserInputBufferCreateFilenameValue = func;
|
||||||
|
return(old);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xmlOutputBufferCreateFilenameDefault:
|
||||||
|
* @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;
|
||||||
|
#ifdef LIBXML_OUTPUT_ENABLED
|
||||||
|
if (old == NULL) {
|
||||||
|
old = __xmlOutputBufferCreateFilename;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
xmlOutputBufferCreateFilenameValue = func;
|
||||||
|
return(old);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xmlParserInputBufferPush:
|
* xmlParserInputBufferPush:
|
||||||
* @in: a buffered parser input
|
* @in: a buffered parser input
|
||||||
|
Reference in New Issue
Block a user