2001-10-12 21:29:10 +04:00
/*
* globals . c : definition and handling of the set of global variables
* of the library
*
* The bottom of this file is automatically generated by build_glob . py
* based on the description file global . data
*
* See Copyright for the status of this software .
*
* Gary Pennington < Gary . Pennington @ uk . sun . com >
* daniel @ veillard . com
*/
2002-03-18 22:37:11 +03:00
# define IN_LIBXML
2001-10-12 21:29:10 +04:00
# include "libxml.h"
2001-10-13 16:18:28 +04:00
# ifdef HAVE_STDLIB_H
2001-10-13 16:06:09 +04:00
# include <stdlib.h>
2001-10-13 16:18:28 +04:00
# endif
2001-10-13 16:06:09 +04:00
# include <string.h>
2001-10-17 19:58:35 +04:00
# include <libxml/globals.h>
2001-10-13 16:18:28 +04:00
# include <libxml/xmlmemory.h>
2003-05-16 02:11:36 +04:00
# include <libxml/threads.h>
2001-10-13 16:18:28 +04:00
2001-10-17 19:58:35 +04:00
/* #define DEBUG_GLOBALS */
2001-10-12 21:29:10 +04:00
/*
* Helpful Macro
*/
2001-10-17 19:58:35 +04:00
# ifdef LIBXML_THREAD_ENABLED
# define IS_MAIN_THREAD (xmlIsMainThread())
2001-10-12 21:29:10 +04:00
# else
# define IS_MAIN_THREAD 1
# endif
2003-05-16 02:11:36 +04:00
/*
* Mutex to protect " ForNewThreads " variables
*/
static xmlMutexPtr xmlThrDefMutex = NULL ;
2003-12-20 05:10:28 +03:00
/**
* xmlInitGlobals :
*
* Additional initialisation for multi - threading
*/
2003-05-16 02:11:36 +04:00
void xmlInitGlobals ( )
{
xmlThrDefMutex = xmlNewMutex ( ) ;
}
2003-12-20 05:10:28 +03:00
/**
* xmlCleanupGlobals :
*
* Additional cleanup for multi - threading
*/
2003-05-16 02:11:36 +04:00
void xmlCleanupGlobals ( )
{
2003-07-16 00:04:34 +04:00
if ( xmlThrDefMutex ! = NULL ) {
2003-07-08 18:03:36 +04:00
xmlFreeMutex ( xmlThrDefMutex ) ;
2003-07-16 00:04:34 +04:00
xmlThrDefMutex = NULL ;
}
2003-05-16 02:11:36 +04:00
}
2001-10-12 21:29:10 +04:00
/************************************************************************
* *
* All the user accessible global variables of the library *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Memory allocation routines
*/
2004-06-10 17:00:15 +04:00
# undef xmlFree
# undef xmlMalloc
# undef xmlMallocAtomic
# undef xmlMemStrdup
# undef xmlRealloc
2002-11-08 18:10:00 +03:00
# if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY)
2003-09-25 18:29:29 +04:00
# ifndef __DEBUG_MEMORY_ALLOC__
2001-10-13 13:15:48 +04:00
extern void xmlMemFree ( void * ptr ) ;
extern void * xmlMemMalloc ( size_t size ) ;
extern void * xmlMemRealloc ( void * ptr , size_t size ) ;
extern char * xmlMemoryStrdup ( const char * str ) ;
2003-08-14 19:44:40 +04:00
# endif
2001-10-13 13:15:48 +04:00
2001-10-12 21:29:10 +04:00
xmlFreeFunc xmlFree = ( xmlFreeFunc ) xmlMemFree ;
xmlMallocFunc xmlMalloc = ( xmlMallocFunc ) xmlMemMalloc ;
2003-04-19 04:07:51 +04:00
xmlMallocFunc xmlMallocAtomic = ( xmlMallocFunc ) xmlMemMalloc ;
2001-10-12 21:29:10 +04:00
xmlReallocFunc xmlRealloc = ( xmlReallocFunc ) xmlMemRealloc ;
xmlStrdupFunc xmlMemStrdup = ( xmlStrdupFunc ) xmlMemoryStrdup ;
# else
2002-01-22 21:15:52 +03:00
/**
* xmlFree :
* @ mem : an already allocated block of memory
*
* The variable holding the libxml free ( ) implementation
*/
2001-10-12 21:29:10 +04:00
xmlFreeFunc xmlFree = ( xmlFreeFunc ) free ;
2002-01-22 21:15:52 +03:00
/**
* xmlMalloc :
* @ size : the size requested in bytes
*
* The variable holding the libxml malloc ( ) implementation
*
* Returns a pointer to the newly allocated block or NULL in case of error
*/
2001-10-12 21:29:10 +04:00
xmlMallocFunc xmlMalloc = ( xmlMallocFunc ) malloc ;
2003-04-19 04:07:51 +04:00
/**
* xmlMallocAtomic :
* @ size : the size requested in bytes
*
* The variable holding the libxml malloc ( ) implementation for atomic
* data ( i . e . blocks not containings pointers ) , useful when using a
* garbage collecting allocator .
*
* Returns a pointer to the newly allocated block or NULL in case of error
*/
xmlMallocFunc xmlMallocAtomic = ( xmlMallocFunc ) malloc ;
2002-01-22 21:15:52 +03:00
/**
* xmlRealloc :
* @ mem : an already allocated block of memory
* @ size : the new size requested in bytes
*
* The variable holding the libxml realloc ( ) implementation
*
* Returns a pointer to the newly reallocated block or NULL in case of error
*/
2001-10-12 21:29:10 +04:00
xmlReallocFunc xmlRealloc = ( xmlReallocFunc ) realloc ;
2002-01-22 21:15:52 +03:00
/**
* xmlMemStrdup :
* @ str : a zero terminated string
*
* The variable holding the libxml strdup ( ) implementation
*
* Returns the copy of the string or NULL in case of error
*/
2001-12-09 17:00:54 +03:00
xmlStrdupFunc xmlMemStrdup = ( xmlStrdupFunc ) xmlStrdup ;
2003-10-03 02:28:19 +04:00
# endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */
2001-10-12 21:29:10 +04:00
2001-10-13 13:15:48 +04:00
# include <libxml/threads.h>
# include <libxml/globals.h>
# include <libxml/SAX.h>
# undef docbDefaultSAXHandler
# undef htmlDefaultSAXHandler
# undef oldXMLWDcompatibility
# undef xmlBufferAllocScheme
# undef xmlDefaultBufferSize
# undef xmlDefaultSAXHandler
# undef xmlDefaultSAXLocator
# undef xmlDoValidityCheckingDefaultValue
# undef xmlGenericError
2003-10-10 18:10:40 +04:00
# undef xmlStructuredError
2001-10-13 13:15:48 +04:00
# undef xmlGenericErrorContext
# undef xmlGetWarningsDefaultValue
# undef xmlIndentTreeOutput
2002-05-24 11:18:40 +04:00
# undef xmlTreeIndentString
2001-10-13 13:15:48 +04:00
# undef xmlKeepBlanksDefaultValue
# undef xmlLineNumbersDefaultValue
# undef xmlLoadExtDtdDefaultValue
# undef xmlParserDebugEntities
# undef xmlParserVersion
# undef xmlPedanticParserDefaultValue
# undef xmlSaveNoEmptyTags
# undef xmlSubstituteEntitiesDefaultValue
2003-01-07 03:19:07 +03:00
# undef xmlRegisterNodeDefaultValue
# undef xmlDeregisterNodeDefaultValue
2003-10-03 02:28:19 +04:00
# undef xmlLastError
2001-10-13 13:15:48 +04:00
2004-06-02 20:18:40 +04:00
# undef xmlParserInputBufferCreateFilenameValue
# undef xmlOutputBufferCreateFilenameValue
2002-01-22 21:15:52 +03:00
/**
* xmlParserVersion :
*
* Constant string describing the internal version of the library
*/
2004-08-19 01:08:46 +04:00
const char * xmlParserVersion = LIBXML_VERSION_STRING LIBXML_VERSION_EXTRA ;
2001-10-17 19:58:35 +04:00
2002-01-22 21:15:52 +03:00
/**
* xmlBufferAllocScheme :
*
* Global setting , default allocation policy for buffers , default is
* XML_BUFFER_ALLOC_EXACT
2001-10-12 21:29:10 +04:00
*/
xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT ;
2003-05-16 02:11:36 +04:00
static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef = XML_BUFFER_ALLOC_EXACT ;
2002-01-22 21:15:52 +03:00
/**
* xmlDefaultBufferSize :
*
* Global setting , default buffer size . Default value is BASE_BUFFER_SIZE
*/
2001-10-12 21:29:10 +04:00
int xmlDefaultBufferSize = BASE_BUFFER_SIZE ;
2003-05-16 02:11:36 +04:00
static int xmlDefaultBufferSizeThrDef = BASE_BUFFER_SIZE ;
2001-10-12 21:29:10 +04:00
/*
* Parser defaults
*/
2001-10-13 13:15:48 +04:00
2002-01-22 21:15:52 +03:00
/**
* oldXMLWDcompatibility :
*
* Global setting , DEPRECATED .
*/
2001-10-12 21:29:10 +04:00
int oldXMLWDcompatibility = 0 ; /* DEPRECATED */
2002-01-22 21:15:52 +03:00
/**
* xmlParserDebugEntities :
*
* Global setting , asking the parser to print out debugging informations .
* while handling entities .
* Disabled by default
*/
2001-10-12 21:29:10 +04:00
int xmlParserDebugEntities = 0 ;
2003-05-16 02:11:36 +04:00
static int xmlParserDebugEntitiesThrDef = 0 ;
2002-01-22 21:15:52 +03:00
/**
* xmlDoValidityCheckingDefaultValue :
*
* Global setting , indicate that the parser should work in validating mode .
* Disabled by default .
*/
2001-10-12 21:29:10 +04:00
int xmlDoValidityCheckingDefaultValue = 0 ;
2003-05-16 02:11:36 +04:00
static int xmlDoValidityCheckingDefaultValueThrDef = 0 ;
2002-01-22 21:15:52 +03:00
/**
* xmlGetWarningsDefaultValue :
*
* Global setting , indicate that the parser should provide warnings .
* Activated by default .
*/
2001-10-12 21:29:10 +04:00
int xmlGetWarningsDefaultValue = 1 ;
2003-05-16 02:11:36 +04:00
static int xmlGetWarningsDefaultValueThrDef = 1 ;
2002-01-22 21:15:52 +03:00
/**
* xmlLoadExtDtdDefaultValue :
*
* Global setting , indicate that the parser should load DTD while not
* validating .
* Disabled by default .
*/
2001-10-12 21:29:10 +04:00
int xmlLoadExtDtdDefaultValue = 0 ;
2003-05-16 02:11:36 +04:00
static int xmlLoadExtDtdDefaultValueThrDef = 0 ;
2002-01-22 21:15:52 +03:00
/**
* xmlPedanticParserDefaultValue :
*
* Global setting , indicate that the parser be pedantic
* Disabled by default .
*/
2001-10-12 21:29:10 +04:00
int xmlPedanticParserDefaultValue = 0 ;
2003-05-16 02:11:36 +04:00
static int xmlPedanticParserDefaultValueThrDef = 0 ;
2002-01-22 21:15:52 +03:00
/**
* xmlLineNumbersDefaultValue :
*
* Global setting , indicate that the parser should store the line number
* in the content field of elements in the DOM tree .
* Disabled by default since this may not be safe for old classes of
* applicaton .
*/
2001-10-12 21:29:10 +04:00
int xmlLineNumbersDefaultValue = 0 ;
2003-05-16 02:11:36 +04:00
static int xmlLineNumbersDefaultValueThrDef = 0 ;
2002-01-22 21:15:52 +03:00
/**
* xmlKeepBlanksDefaultValue :
*
* Global setting , indicate that the parser should keep all blanks
* nodes found in the content
* Activated by default , this is actually needed to have the parser
* conformant to the XML Recommendation , however the option is kept
* for some applications since this was libxml1 default behaviour .
*/
2001-10-12 21:29:10 +04:00
int xmlKeepBlanksDefaultValue = 1 ;
2003-05-16 02:11:36 +04:00
static int xmlKeepBlanksDefaultValueThrDef = 1 ;
2002-01-22 21:15:52 +03:00
/**
* xmlSubstituteEntitiesDefaultValue :
*
* Global setting , indicate that the parser should not generate entity
* references but replace them with the actual content of the entity
* Disabled by default , this should be activated when using XPath since
* the XPath data model requires entities replacement and the XPath
* engine does not handle entities references transparently .
*/
2001-10-12 21:29:10 +04:00
int xmlSubstituteEntitiesDefaultValue = 0 ;
2003-05-16 02:11:36 +04:00
static int xmlSubstituteEntitiesDefaultValueThrDef = 0 ;
2001-10-12 21:29:10 +04:00
2003-01-01 23:59:38 +03:00
xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL ;
2003-05-16 02:11:36 +04:00
static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef = NULL ;
2003-01-01 23:59:38 +03:00
xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue = NULL ;
2003-05-16 02:11:36 +04:00
static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef = NULL ;
2003-01-01 23:59:38 +03:00
2004-06-02 20:18:40 +04:00
xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue = NULL ;
static xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValueThrDef = NULL ;
xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue = NULL ;
static xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValueThrDef = NULL ;
2001-10-12 21:29:10 +04:00
/*
* Error handling
*/
/* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
/* Must initialize xmlGenericError in xmlInitParser */
2001-10-29 14:48:19 +03:00
void xmlGenericErrorDefaultFunc ( void * ctx ATTRIBUTE_UNUSED ,
const char * msg ,
. . . ) ;
2002-01-22 21:15:52 +03:00
/**
* xmlGenericError :
*
* Global setting : function used for generic error callbacks
*/
2001-10-29 14:48:19 +03:00
xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc ;
2003-05-16 02:11:36 +04:00
static xmlGenericErrorFunc xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc ;
2003-10-10 18:10:40 +04:00
/**
* xmlStructuredError :
*
* Global setting : function used for structured error callbacks
*/
xmlStructuredErrorFunc xmlStructuredError = NULL ;
static xmlStructuredErrorFunc xmlStructuredErrorThrDef = NULL ;
2002-01-22 21:15:52 +03:00
/**
* xmlGenericErrorContext :
*
* Global setting passed to generic error callbacks
*/
2001-10-12 21:29:10 +04:00
void * xmlGenericErrorContext = NULL ;
2003-05-16 02:11:36 +04:00
static void * xmlGenericErrorContextThrDef = NULL ;
2003-10-03 02:28:19 +04:00
xmlError xmlLastError ;
2001-10-12 21:29:10 +04:00
/*
* output defaults
*/
2002-01-22 21:15:52 +03:00
/**
* xmlIndentTreeOutput :
*
* Global setting , asking the serializer to indent the output tree by default
2002-05-24 11:18:40 +04:00
* Enabled by default
*/
int xmlIndentTreeOutput = 1 ;
2003-05-16 02:11:36 +04:00
static int xmlIndentTreeOutputThrDef = 1 ;
2002-05-24 11:18:40 +04:00
/**
* xmlTreeIndentString :
*
* The string used to do one - level indent . By default is equal to " " ( two spaces )
2002-01-22 21:15:52 +03:00
*/
2002-05-24 11:18:40 +04:00
const char * xmlTreeIndentString = " " ;
2003-05-16 02:11:36 +04:00
static const char * xmlTreeIndentStringThrDef = " " ;
2002-05-24 11:18:40 +04:00
2002-01-22 21:15:52 +03:00
/**
* xmlSaveNoEmptyTags :
*
* Global setting , asking the serializer to not output empty tags
* as < empty / > but < empty > < / empty > . those two forms are undistinguishable
* once parsed .
* Disabled by default
*/
2001-10-12 21:29:10 +04:00
int xmlSaveNoEmptyTags = 0 ;
2003-05-16 02:11:36 +04:00
int xmlSaveNoEmptyTagsThrDef = 0 ;
2001-10-12 21:29:10 +04:00
2003-09-30 04:43:48 +04:00
# ifdef LIBXML_SAX1_ENABLED
2002-01-22 21:15:52 +03:00
/**
* xmlDefaultSAXHandler :
*
2003-09-25 18:29:29 +04:00
* Default SAX version1 handler for XML , builds the DOM tree
2001-10-12 21:29:10 +04:00
*/
2003-09-25 18:29:29 +04:00
xmlSAXHandlerV1 xmlDefaultSAXHandler = {
2003-08-21 02:54:39 +04:00
xmlSAX2InternalSubset ,
xmlSAX2IsStandalone ,
xmlSAX2HasInternalSubset ,
xmlSAX2HasExternalSubset ,
xmlSAX2ResolveEntity ,
xmlSAX2GetEntity ,
xmlSAX2EntityDecl ,
xmlSAX2NotationDecl ,
xmlSAX2AttributeDecl ,
xmlSAX2ElementDecl ,
xmlSAX2UnparsedEntityDecl ,
xmlSAX2SetDocumentLocator ,
xmlSAX2StartDocument ,
xmlSAX2EndDocument ,
xmlSAX2StartElement ,
xmlSAX2EndElement ,
xmlSAX2Reference ,
xmlSAX2Characters ,
xmlSAX2Characters ,
xmlSAX2ProcessingInstruction ,
xmlSAX2Comment ,
2001-10-12 21:29:10 +04:00
xmlParserWarning ,
xmlParserError ,
xmlParserError ,
2003-08-21 02:54:39 +04:00
xmlSAX2GetParameterEntity ,
xmlSAX2CDataBlock ,
xmlSAX2ExternalSubset ,
0 ,
2001-10-12 21:29:10 +04:00
} ;
2003-09-30 04:43:48 +04:00
# endif /* LIBXML_SAX1_ENABLED */
2001-10-12 21:29:10 +04:00
2002-01-22 21:15:52 +03:00
/**
* xmlDefaultSAXLocator :
*
* The default SAX Locator
* { getPublicId , getSystemId , getLineNumber , getColumnNumber }
2001-10-12 21:29:10 +04:00
*/
xmlSAXLocator xmlDefaultSAXLocator = {
2003-08-21 02:54:39 +04:00
xmlSAX2GetPublicId ,
xmlSAX2GetSystemId ,
xmlSAX2GetLineNumber ,
xmlSAX2GetColumnNumber
2001-10-12 21:29:10 +04:00
} ;
# ifdef LIBXML_HTML_ENABLED
2002-01-22 21:15:52 +03:00
/**
* htmlDefaultSAXHandler :
*
2003-09-25 18:29:29 +04:00
* Default old SAX v1 handler for HTML , builds the DOM tree
2001-10-12 21:29:10 +04:00
*/
2003-09-25 18:29:29 +04:00
xmlSAXHandlerV1 htmlDefaultSAXHandler = {
2003-08-21 02:54:39 +04:00
xmlSAX2InternalSubset ,
2001-10-12 21:29:10 +04:00
NULL ,
NULL ,
NULL ,
NULL ,
2003-08-21 02:54:39 +04:00
xmlSAX2GetEntity ,
2001-10-12 21:29:10 +04:00
NULL ,
NULL ,
NULL ,
NULL ,
NULL ,
2003-08-21 02:54:39 +04:00
xmlSAX2SetDocumentLocator ,
xmlSAX2StartDocument ,
xmlSAX2EndDocument ,
xmlSAX2StartElement ,
xmlSAX2EndElement ,
2001-10-12 21:29:10 +04:00
NULL ,
2003-08-21 02:54:39 +04:00
xmlSAX2Characters ,
xmlSAX2IgnorableWhitespace ,
2004-10-22 18:34:23 +04:00
xmlSAX2ProcessingInstruction ,
2003-08-21 02:54:39 +04:00
xmlSAX2Comment ,
2001-10-12 21:29:10 +04:00
xmlParserWarning ,
xmlParserError ,
xmlParserError ,
2003-08-21 02:54:39 +04:00
xmlSAX2GetParameterEntity ,
xmlSAX2CDataBlock ,
NULL ,
0 ,
2001-10-12 21:29:10 +04:00
} ;
# endif /* LIBXML_HTML_ENABLED */
# ifdef LIBXML_DOCB_ENABLED
2002-01-22 21:15:52 +03:00
/**
* docbDefaultSAXHandler :
*
2003-09-25 18:29:29 +04:00
* Default old SAX v1 handler for SGML DocBook , builds the DOM tree
2001-10-12 21:29:10 +04:00
*/
2003-09-25 18:29:29 +04:00
xmlSAXHandlerV1 docbDefaultSAXHandler = {
2003-08-21 02:54:39 +04:00
xmlSAX2InternalSubset ,
xmlSAX2IsStandalone ,
xmlSAX2HasInternalSubset ,
xmlSAX2HasExternalSubset ,
xmlSAX2ResolveEntity ,
xmlSAX2GetEntity ,
xmlSAX2EntityDecl ,
2001-10-12 21:29:10 +04:00
NULL ,
NULL ,
NULL ,
NULL ,
2003-08-21 02:54:39 +04:00
xmlSAX2SetDocumentLocator ,
xmlSAX2StartDocument ,
xmlSAX2EndDocument ,
xmlSAX2StartElement ,
xmlSAX2EndElement ,
xmlSAX2Reference ,
xmlSAX2Characters ,
xmlSAX2IgnorableWhitespace ,
2001-10-12 21:29:10 +04:00
NULL ,
2003-08-21 02:54:39 +04:00
xmlSAX2Comment ,
2001-10-12 21:29:10 +04:00
xmlParserWarning ,
xmlParserError ,
xmlParserError ,
2003-08-21 02:54:39 +04:00
xmlSAX2GetParameterEntity ,
NULL ,
NULL ,
0 ,
2001-10-12 21:29:10 +04:00
} ;
# endif /* LIBXML_DOCB_ENABLED */
/**
* xmlInitializeGlobalState :
* @ gs : a pointer to a newly allocated global state
*
* xmlInitializeGlobalState ( ) initialize a global state with all the
* default values of the library .
*/
void
xmlInitializeGlobalState ( xmlGlobalStatePtr gs )
{
2001-10-17 19:58:35 +04:00
# ifdef DEBUG_GLOBALS
fprintf ( stderr , " Initializing globals at %lu for thread %d \n " ,
( unsigned long ) gs , xmlGetThreadId ( ) ) ;
# endif
2001-10-12 21:29:10 +04:00
/*
2001-12-31 19:16:02 +03:00
* Perform initialization as required by libxml
2001-10-12 21:29:10 +04:00
*/
2003-08-28 12:03:23 +04:00
if ( xmlThrDefMutex = = NULL )
xmlInitGlobals ( ) ;
2003-05-16 02:11:36 +04:00
xmlMutexLock ( xmlThrDefMutex ) ;
2002-11-22 08:07:29 +03:00
2001-11-04 23:19:12 +03:00
# ifdef LIBXML_DOCB_ENABLED
2003-09-25 18:29:29 +04:00
initdocbDefaultSAXHandler ( & gs - > docbDefaultSAXHandler ) ;
2001-11-04 23:19:12 +03:00
# endif
# ifdef LIBXML_HTML_ENABLED
2003-09-25 18:29:29 +04:00
inithtmlDefaultSAXHandler ( & gs - > htmlDefaultSAXHandler ) ;
2001-11-04 23:19:12 +03:00
# endif
2001-10-17 19:58:35 +04:00
2001-10-12 21:29:10 +04:00
gs - > oldXMLWDcompatibility = 0 ;
2003-05-16 02:11:36 +04:00
gs - > xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef ;
gs - > xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef ;
2003-09-30 04:43:48 +04:00
# ifdef LIBXML_SAX1_ENABLED
2003-09-25 18:29:29 +04:00
initxmlDefaultSAXHandler ( & gs - > xmlDefaultSAXHandler , 1 ) ;
2003-09-30 04:43:48 +04:00
# endif /* LIBXML_SAX1_ENABLED */
2003-09-28 22:58:27 +04:00
gs - > xmlDefaultSAXLocator . getPublicId = xmlSAX2GetPublicId ;
gs - > xmlDefaultSAXLocator . getSystemId = xmlSAX2GetSystemId ;
gs - > xmlDefaultSAXLocator . getLineNumber = xmlSAX2GetLineNumber ;
gs - > xmlDefaultSAXLocator . getColumnNumber = xmlSAX2GetColumnNumber ;
2003-05-16 02:11:36 +04:00
gs - > xmlDoValidityCheckingDefaultValue =
xmlDoValidityCheckingDefaultValueThrDef ;
2001-10-12 21:29:10 +04:00
# if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
gs - > xmlFree = ( xmlFreeFunc ) xmlMemFree ;
gs - > xmlMalloc = ( xmlMallocFunc ) xmlMemMalloc ;
2003-04-19 04:07:51 +04:00
gs - > xmlMallocAtomic = ( xmlMallocFunc ) xmlMemMalloc ;
2001-10-12 21:29:10 +04:00
gs - > xmlRealloc = ( xmlReallocFunc ) xmlMemRealloc ;
gs - > xmlMemStrdup = ( xmlStrdupFunc ) xmlMemoryStrdup ;
# else
gs - > xmlFree = ( xmlFreeFunc ) free ;
gs - > xmlMalloc = ( xmlMallocFunc ) malloc ;
2003-04-19 04:07:51 +04:00
gs - > xmlMallocAtomic = ( xmlMallocFunc ) malloc ;
2001-10-12 21:29:10 +04:00
gs - > xmlRealloc = ( xmlReallocFunc ) realloc ;
2002-01-18 19:23:55 +03:00
gs - > xmlMemStrdup = ( xmlStrdupFunc ) xmlStrdup ;
2001-10-12 21:29:10 +04:00
# endif
2003-05-16 02:11:36 +04:00
gs - > xmlGetWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef ;
gs - > xmlIndentTreeOutput = xmlIndentTreeOutputThrDef ;
gs - > xmlTreeIndentString = xmlTreeIndentStringThrDef ;
gs - > xmlKeepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef ;
gs - > xmlLineNumbersDefaultValue = xmlLineNumbersDefaultValueThrDef ;
gs - > xmlLoadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef ;
gs - > xmlParserDebugEntities = xmlParserDebugEntitiesThrDef ;
2001-10-12 21:29:10 +04:00
gs - > xmlParserVersion = LIBXML_VERSION_STRING ;
2003-05-16 02:11:36 +04:00
gs - > xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef ;
gs - > xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef ;
gs - > xmlSubstituteEntitiesDefaultValue =
xmlSubstituteEntitiesDefaultValueThrDef ;
gs - > xmlGenericError = xmlGenericErrorThrDef ;
2003-10-10 18:10:40 +04:00
gs - > xmlStructuredError = xmlStructuredErrorThrDef ;
2003-05-16 02:11:36 +04:00
gs - > xmlGenericErrorContext = xmlGenericErrorContextThrDef ;
gs - > xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef ;
gs - > xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef ;
2004-06-02 20:18:40 +04:00
gs - > xmlParserInputBufferCreateFilenameValue = xmlParserInputBufferCreateFilenameValueThrDef ;
gs - > xmlOutputBufferCreateFilenameValue = xmlOutputBufferCreateFilenameValueThrDef ;
2003-10-03 02:28:19 +04:00
memset ( & gs - > xmlLastError , 0 , sizeof ( xmlError ) ) ;
2003-01-01 23:59:38 +03:00
2003-05-16 02:11:36 +04:00
xmlMutexUnlock ( xmlThrDefMutex ) ;
}
2003-12-05 17:57:46 +03:00
/**
* DOC_DISABLE : we ignore missing doc for the xmlThrDef functions ,
* those are really internal work
*/
2003-05-16 02:11:36 +04:00
void
xmlThrDefSetGenericErrorFunc ( void * ctx , xmlGenericErrorFunc handler ) {
xmlMutexLock ( xmlThrDefMutex ) ;
xmlGenericErrorContextThrDef = ctx ;
if ( handler ! = NULL )
xmlGenericErrorThrDef = handler ;
else
xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
2003-01-01 23:59:38 +03:00
}
2003-10-10 18:10:40 +04:00
void
xmlThrDefSetStructuredErrorFunc ( void * ctx , xmlStructuredErrorFunc handler ) {
xmlMutexLock ( xmlThrDefMutex ) ;
xmlGenericErrorContextThrDef = ctx ;
xmlStructuredErrorThrDef = handler ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
}
2003-01-01 23:59:38 +03:00
/**
2003-01-06 16:11:20 +03:00
* xmlRegisterNodeDefault :
2003-01-01 23:59:38 +03:00
* @ func : function pointer to the new RegisterNodeFunc
*
2003-02-10 17:28:44 +03:00
* Registers a callback for node creation
*
* Returns the old value of the registration function
2003-01-01 23:59:38 +03:00
*/
xmlRegisterNodeFunc
xmlRegisterNodeDefault ( xmlRegisterNodeFunc func )
{
xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue ;
2003-04-22 01:36:41 +04:00
__xmlRegisterCallbacks = 1 ;
2003-01-01 23:59:38 +03:00
xmlRegisterNodeDefaultValue = func ;
return ( old ) ;
2001-10-12 21:29:10 +04:00
}
2003-05-16 02:11:36 +04:00
xmlRegisterNodeFunc
xmlThrDefRegisterNodeDefault ( xmlRegisterNodeFunc func )
{
xmlRegisterNodeFunc old ;
xmlMutexLock ( xmlThrDefMutex ) ;
old = xmlRegisterNodeDefaultValueThrDef ;
__xmlRegisterCallbacks = 1 ;
xmlRegisterNodeDefaultValueThrDef = func ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ( old ) ;
}
2003-01-01 23:59:38 +03:00
/**
2003-01-06 16:11:20 +03:00
* xmlDeregisterNodeDefault :
2003-01-01 23:59:38 +03:00
* @ func : function pointer to the new DeregisterNodeFunc
*
2003-02-10 17:28:44 +03:00
* Registers a callback for node destruction
*
2003-01-06 16:11:20 +03:00
* Returns the previous value of the deregistration function
2003-01-01 23:59:38 +03:00
*/
xmlDeregisterNodeFunc
xmlDeregisterNodeDefault ( xmlDeregisterNodeFunc func )
{
xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue ;
2003-04-22 01:36:41 +04:00
__xmlRegisterCallbacks = 1 ;
2003-01-01 23:59:38 +03:00
xmlDeregisterNodeDefaultValue = func ;
return ( old ) ;
}
2003-05-16 02:11:36 +04:00
xmlDeregisterNodeFunc
xmlThrDefDeregisterNodeDefault ( xmlDeregisterNodeFunc func )
{
xmlDeregisterNodeFunc old ;
xmlMutexLock ( xmlThrDefMutex ) ;
old = xmlDeregisterNodeDefaultValueThrDef ;
__xmlRegisterCallbacks = 1 ;
xmlDeregisterNodeDefaultValueThrDef = func ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ( old ) ;
}
2004-06-02 20:18:40 +04:00
xmlParserInputBufferCreateFilenameFunc
xmlThrDefParserInputBufferCreateFilenameDefault ( xmlParserInputBufferCreateFilenameFunc func )
{
xmlParserInputBufferCreateFilenameFunc old ;
xmlMutexLock ( xmlThrDefMutex ) ;
old = xmlParserInputBufferCreateFilenameValueThrDef ;
2004-06-08 14:16:42 +04:00
if ( old = = NULL ) {
old = __xmlParserInputBufferCreateFilename ;
}
2004-06-02 20:18:40 +04:00
xmlParserInputBufferCreateFilenameValueThrDef = func ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ( old ) ;
}
xmlOutputBufferCreateFilenameFunc
xmlThrDefOutputBufferCreateFilenameDefault ( xmlOutputBufferCreateFilenameFunc func )
{
xmlOutputBufferCreateFilenameFunc old ;
xmlMutexLock ( xmlThrDefMutex ) ;
old = xmlOutputBufferCreateFilenameValueThrDef ;
2004-06-08 14:16:42 +04:00
# ifdef LIBXML_OUTPUT_ENABLED
if ( old = = NULL ) {
old = __xmlOutputBufferCreateFilename ;
}
# endif
2004-06-02 20:18:40 +04:00
xmlOutputBufferCreateFilenameValueThrDef = func ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ( old ) ;
}
2003-01-01 23:59:38 +03:00
2001-11-04 23:19:12 +03:00
# ifdef LIBXML_DOCB_ENABLED
2001-10-12 21:29:10 +04:00
# undef docbDefaultSAXHandler
2003-09-25 18:29:29 +04:00
xmlSAXHandlerV1 *
2001-10-12 21:29:10 +04:00
__docbDefaultSAXHandler ( void ) {
if ( IS_MAIN_THREAD )
return ( & docbDefaultSAXHandler ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > docbDefaultSAXHandler ) ;
2001-10-12 21:29:10 +04:00
}
2001-11-04 23:19:12 +03:00
# endif
2001-10-12 21:29:10 +04:00
2001-11-04 23:19:12 +03:00
# ifdef LIBXML_HTML_ENABLED
2001-10-12 21:29:10 +04:00
# undef htmlDefaultSAXHandler
2003-09-25 18:29:29 +04:00
xmlSAXHandlerV1 *
2001-10-12 21:29:10 +04:00
__htmlDefaultSAXHandler ( void ) {
if ( IS_MAIN_THREAD )
return ( & htmlDefaultSAXHandler ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > htmlDefaultSAXHandler ) ;
2001-10-12 21:29:10 +04:00
}
2001-11-04 23:19:12 +03:00
# endif
2003-10-03 02:28:19 +04:00
# undef xmlLastError
xmlError *
__xmlLastError ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlLastError ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlLastError ) ;
}
2004-06-10 17:00:15 +04:00
/*
* The following memory routines were apparently lost at some point ,
* and were re - inserted at this point on June 10 , 2004. Hope it ' s
* the right place for them : - )
*/
# if defined(LIBXML_THREAD_ALLOC_ENABLED) && defined(LIBXML_THREAD_ENABLED)
# undef xmlMalloc
xmlMallocFunc *
__xmlMalloc ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlMalloc ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlMalloc ) ;
}
# undef xmlMallocAtomic
xmlMallocFunc *
__xmlMallocAtomic ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlMallocAtomic ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlMallocAtomic ) ;
}
# undef xmlRealloc
xmlReallocFunc *
__xmlRealloc ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlRealloc ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlRealloc ) ;
}
# undef xmlFree
xmlFreeFunc *
__xmlFree ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlFree ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlFree ) ;
}
xmlStrdupFunc *
__xmlMemStrdup ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlMemStrdup ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlMemStrdup ) ;
}
# endif
2001-11-04 23:19:12 +03:00
/*
* Everything starting from the line below is
* Automatically generated by build_glob . py .
* Do not modify the previous line .
*/
2001-10-12 21:29:10 +04:00
# undef oldXMLWDcompatibility
int *
__oldXMLWDcompatibility ( void ) {
if ( IS_MAIN_THREAD )
return ( & oldXMLWDcompatibility ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > oldXMLWDcompatibility ) ;
2001-10-12 21:29:10 +04:00
}
# undef xmlBufferAllocScheme
xmlBufferAllocationScheme *
__xmlBufferAllocScheme ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlBufferAllocScheme ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlBufferAllocScheme ) ;
2001-10-12 21:29:10 +04:00
}
2003-05-16 02:11:36 +04:00
xmlBufferAllocationScheme xmlThrDefBufferAllocScheme ( xmlBufferAllocationScheme v ) {
xmlBufferAllocationScheme ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlBufferAllocSchemeThrDef ;
xmlBufferAllocSchemeThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 21:29:10 +04:00
# undef xmlDefaultBufferSize
int *
__xmlDefaultBufferSize ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlDefaultBufferSize ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlDefaultBufferSize ) ;
2001-10-12 21:29:10 +04:00
}
2003-05-16 02:11:36 +04:00
int xmlThrDefDefaultBufferSize ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlDefaultBufferSizeThrDef ;
xmlDefaultBufferSizeThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 21:29:10 +04:00
2003-09-30 04:43:48 +04:00
# ifdef LIBXML_SAX1_ENABLED
2001-10-12 21:29:10 +04:00
# undef xmlDefaultSAXHandler
2003-09-25 18:29:29 +04:00
xmlSAXHandlerV1 *
2001-10-12 21:29:10 +04:00
__xmlDefaultSAXHandler ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlDefaultSAXHandler ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlDefaultSAXHandler ) ;
2001-10-12 21:29:10 +04:00
}
2003-09-30 04:43:48 +04:00
# endif /* LIBXML_SAX1_ENABLED */
2001-10-12 21:29:10 +04:00
# undef xmlDefaultSAXLocator
xmlSAXLocator *
__xmlDefaultSAXLocator ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlDefaultSAXLocator ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlDefaultSAXLocator ) ;
2001-10-12 21:29:10 +04:00
}
# undef xmlDoValidityCheckingDefaultValue
int *
__xmlDoValidityCheckingDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlDoValidityCheckingDefaultValue ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlDoValidityCheckingDefaultValue ) ;
2001-10-12 21:29:10 +04:00
}
2003-05-16 02:11:36 +04:00
int xmlThrDefDoValidityCheckingDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlDoValidityCheckingDefaultValueThrDef ;
xmlDoValidityCheckingDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 21:29:10 +04:00
# undef xmlGenericError
xmlGenericErrorFunc *
__xmlGenericError ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlGenericError ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlGenericError ) ;
2001-10-12 21:29:10 +04:00
}
2003-10-10 18:10:40 +04:00
# undef xmlStructuredError
xmlStructuredErrorFunc *
__xmlStructuredError ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlStructuredError ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlStructuredError ) ;
}
2001-10-12 21:29:10 +04:00
# undef xmlGenericErrorContext
void * *
__xmlGenericErrorContext ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlGenericErrorContext ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlGenericErrorContext ) ;
2001-10-12 21:29:10 +04:00
}
# undef xmlGetWarningsDefaultValue
int *
__xmlGetWarningsDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlGetWarningsDefaultValue ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlGetWarningsDefaultValue ) ;
2001-10-12 21:29:10 +04:00
}
2003-05-16 02:11:36 +04:00
int xmlThrDefGetWarningsDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlGetWarningsDefaultValueThrDef ;
xmlGetWarningsDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 21:29:10 +04:00
# undef xmlIndentTreeOutput
int *
__xmlIndentTreeOutput ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlIndentTreeOutput ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlIndentTreeOutput ) ;
2001-10-12 21:29:10 +04:00
}
2003-05-16 02:11:36 +04:00
int xmlThrDefIndentTreeOutput ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlIndentTreeOutputThrDef ;
xmlIndentTreeOutputThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 21:29:10 +04:00
2002-05-24 11:18:40 +04:00
# undef xmlTreeIndentString
const char * *
__xmlTreeIndentString ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlTreeIndentString ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlTreeIndentString ) ;
}
2003-05-16 02:11:36 +04:00
const char * xmlThrDefTreeIndentString ( const char * v ) {
const char * ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlTreeIndentStringThrDef ;
xmlTreeIndentStringThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2002-05-24 11:18:40 +04:00
2001-10-12 21:29:10 +04:00
# undef xmlKeepBlanksDefaultValue
int *
__xmlKeepBlanksDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlKeepBlanksDefaultValue ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlKeepBlanksDefaultValue ) ;
2001-10-12 21:29:10 +04:00
}
2003-05-16 02:11:36 +04:00
int xmlThrDefKeepBlanksDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlKeepBlanksDefaultValueThrDef ;
xmlKeepBlanksDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 21:29:10 +04:00
# undef xmlLineNumbersDefaultValue
int *
__xmlLineNumbersDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlLineNumbersDefaultValue ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlLineNumbersDefaultValue ) ;
2001-10-12 21:29:10 +04:00
}
2003-05-16 02:11:36 +04:00
int xmlThrDefLineNumbersDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlLineNumbersDefaultValueThrDef ;
xmlLineNumbersDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 21:29:10 +04:00
# undef xmlLoadExtDtdDefaultValue
int *
__xmlLoadExtDtdDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlLoadExtDtdDefaultValue ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlLoadExtDtdDefaultValue ) ;
2001-10-12 21:29:10 +04:00
}
2003-05-16 02:11:36 +04:00
int xmlThrDefLoadExtDtdDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlLoadExtDtdDefaultValueThrDef ;
xmlLoadExtDtdDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 21:29:10 +04:00
# undef xmlParserDebugEntities
int *
__xmlParserDebugEntities ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlParserDebugEntities ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlParserDebugEntities ) ;
2001-10-12 21:29:10 +04:00
}
2003-05-16 02:11:36 +04:00
int xmlThrDefParserDebugEntities ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlParserDebugEntitiesThrDef ;
xmlParserDebugEntitiesThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 21:29:10 +04:00
# undef xmlParserVersion
const char * *
__xmlParserVersion ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlParserVersion ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlParserVersion ) ;
2001-10-12 21:29:10 +04:00
}
# undef xmlPedanticParserDefaultValue
int *
__xmlPedanticParserDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlPedanticParserDefaultValue ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlPedanticParserDefaultValue ) ;
2001-10-12 21:29:10 +04:00
}
2003-05-16 02:11:36 +04:00
int xmlThrDefPedanticParserDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlPedanticParserDefaultValueThrDef ;
xmlPedanticParserDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 21:29:10 +04:00
# undef xmlSaveNoEmptyTags
int *
__xmlSaveNoEmptyTags ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlSaveNoEmptyTags ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlSaveNoEmptyTags ) ;
2001-10-12 21:29:10 +04:00
}
2003-05-16 02:11:36 +04:00
int xmlThrDefSaveNoEmptyTags ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlSaveNoEmptyTagsThrDef ;
xmlSaveNoEmptyTagsThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 21:29:10 +04:00
# undef xmlSubstituteEntitiesDefaultValue
int *
__xmlSubstituteEntitiesDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlSubstituteEntitiesDefaultValue ) ;
else
2001-10-13 13:15:48 +04:00
return ( & xmlGetGlobalState ( ) - > xmlSubstituteEntitiesDefaultValue ) ;
2001-10-12 21:29:10 +04:00
}
2003-05-16 02:11:36 +04:00
int xmlThrDefSubstituteEntitiesDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlSubstituteEntitiesDefaultValueThrDef ;
xmlSubstituteEntitiesDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2003-01-01 23:59:38 +03:00
# undef xmlRegisterNodeDefaultValue
xmlRegisterNodeFunc *
__xmlRegisterNodeDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlRegisterNodeDefaultValue ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlRegisterNodeDefaultValue ) ;
}
# undef xmlDeregisterNodeDefaultValue
xmlDeregisterNodeFunc *
__xmlDeregisterNodeDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlDeregisterNodeDefaultValue ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlDeregisterNodeDefaultValue ) ;
}
2004-06-02 20:18:40 +04:00
# undef xmlParserInputBufferCreateFilenameValue
xmlParserInputBufferCreateFilenameFunc *
__xmlParserInputBufferCreateFilenameValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlParserInputBufferCreateFilenameValue ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlParserInputBufferCreateFilenameValue ) ;
}
# undef xmlOutputBufferCreateFilenameValue
xmlOutputBufferCreateFilenameFunc *
__xmlOutputBufferCreateFilenameValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlOutputBufferCreateFilenameValue ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlOutputBufferCreateFilenameValue ) ;
2004-06-03 06:11:24 +04:00
}