2001-10-12 17:29:10 +00: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 19:37:11 +00:00
# define IN_LIBXML
2001-10-12 17:29:10 +00:00
# include "libxml.h"
2001-10-13 12:18:28 +00:00
# ifdef HAVE_STDLIB_H
2001-10-13 12:06:09 +00:00
# include <stdlib.h>
2001-10-13 12:18:28 +00:00
# endif
2001-10-13 12:06:09 +00:00
# include <string.h>
2001-10-17 15:58:35 +00:00
# include <libxml/globals.h>
2001-10-13 12:18:28 +00:00
# include <libxml/xmlmemory.h>
2003-05-15 22:11:36 +00:00
# include <libxml/threads.h>
2001-10-13 12:18:28 +00:00
2001-10-17 15:58:35 +00:00
/* #define DEBUG_GLOBALS */
2001-10-12 17:29:10 +00:00
/*
* Helpful Macro
*/
2001-10-17 15:58:35 +00:00
# ifdef LIBXML_THREAD_ENABLED
# define IS_MAIN_THREAD (xmlIsMainThread())
2001-10-12 17:29:10 +00:00
# else
# define IS_MAIN_THREAD 1
# endif
2003-05-15 22:11:36 +00:00
/*
* Mutex to protect " ForNewThreads " variables
*/
static xmlMutexPtr xmlThrDefMutex = NULL ;
2003-12-20 02:10:28 +00:00
/**
* xmlInitGlobals :
*
* Additional initialisation for multi - threading
*/
2005-07-29 22:02:24 +00:00
void xmlInitGlobals ( void )
2003-05-15 22:11:36 +00:00
{
xmlThrDefMutex = xmlNewMutex ( ) ;
}
2003-12-20 02:10:28 +00:00
/**
* xmlCleanupGlobals :
*
* Additional cleanup for multi - threading
*/
2005-07-29 22:02:24 +00:00
void xmlCleanupGlobals ( void )
2003-05-15 22:11:36 +00:00
{
2003-07-15 20:04:34 +00:00
if ( xmlThrDefMutex ! = NULL ) {
2003-07-08 14:03:36 +00:00
xmlFreeMutex ( xmlThrDefMutex ) ;
2003-07-15 20:04:34 +00:00
xmlThrDefMutex = NULL ;
}
2008-03-04 13:19:49 +00:00
__xmlGlobalInitMutexDestroy ( ) ;
2003-05-15 22:11:36 +00:00
}
2001-10-12 17:29:10 +00:00
/************************************************************************
* *
* All the user accessible global variables of the library *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Memory allocation routines
*/
2004-06-10 13:00:15 +00:00
# undef xmlFree
# undef xmlMalloc
# undef xmlMallocAtomic
# undef xmlMemStrdup
# undef xmlRealloc
2002-11-08 15:10:00 +00:00
# if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY)
2001-10-12 17:29:10 +00:00
xmlFreeFunc xmlFree = ( xmlFreeFunc ) xmlMemFree ;
xmlMallocFunc xmlMalloc = ( xmlMallocFunc ) xmlMemMalloc ;
2003-04-19 00:07:51 +00:00
xmlMallocFunc xmlMallocAtomic = ( xmlMallocFunc ) xmlMemMalloc ;
2001-10-12 17:29:10 +00:00
xmlReallocFunc xmlRealloc = ( xmlReallocFunc ) xmlMemRealloc ;
xmlStrdupFunc xmlMemStrdup = ( xmlStrdupFunc ) xmlMemoryStrdup ;
# else
2002-01-22 18:15:52 +00:00
/**
* xmlFree :
* @ mem : an already allocated block of memory
*
* The variable holding the libxml free ( ) implementation
*/
2001-10-12 17:29:10 +00:00
xmlFreeFunc xmlFree = ( xmlFreeFunc ) free ;
2002-01-22 18:15:52 +00: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 17:29:10 +00:00
xmlMallocFunc xmlMalloc = ( xmlMallocFunc ) malloc ;
2003-04-19 00:07:51 +00: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 18:15:52 +00: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 17:29:10 +00:00
xmlReallocFunc xmlRealloc = ( xmlReallocFunc ) realloc ;
2002-01-22 18:15:52 +00: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 14:00:54 +00:00
xmlStrdupFunc xmlMemStrdup = ( xmlStrdupFunc ) xmlStrdup ;
2003-10-02 22:28:19 +00:00
# endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */
2001-10-12 17:29:10 +00:00
2001-10-13 09:15:48 +00: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 14:10:40 +00:00
# undef xmlStructuredError
2001-10-13 09:15:48 +00:00
# undef xmlGenericErrorContext
# undef xmlGetWarningsDefaultValue
# undef xmlIndentTreeOutput
2002-05-24 07:18:40 +00:00
# undef xmlTreeIndentString
2001-10-13 09:15:48 +00:00
# undef xmlKeepBlanksDefaultValue
# undef xmlLineNumbersDefaultValue
# undef xmlLoadExtDtdDefaultValue
# undef xmlParserDebugEntities
# undef xmlParserVersion
# undef xmlPedanticParserDefaultValue
# undef xmlSaveNoEmptyTags
# undef xmlSubstituteEntitiesDefaultValue
2003-01-07 00:19:07 +00:00
# undef xmlRegisterNodeDefaultValue
# undef xmlDeregisterNodeDefaultValue
2003-10-02 22:28:19 +00:00
# undef xmlLastError
2001-10-13 09:15:48 +00:00
2004-06-02 16:18:40 +00:00
# undef xmlParserInputBufferCreateFilenameValue
# undef xmlOutputBufferCreateFilenameValue
2002-01-22 18:15:52 +00:00
/**
* xmlParserVersion :
*
* Constant string describing the internal version of the library
*/
2004-08-18 21:08:46 +00:00
const char * xmlParserVersion = LIBXML_VERSION_STRING LIBXML_VERSION_EXTRA ;
2001-10-17 15:58:35 +00:00
2002-01-22 18:15:52 +00:00
/**
* xmlBufferAllocScheme :
*
* Global setting , default allocation policy for buffers , default is
* XML_BUFFER_ALLOC_EXACT
2001-10-12 17:29:10 +00:00
*/
xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT ;
2003-05-15 22:11:36 +00:00
static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef = XML_BUFFER_ALLOC_EXACT ;
2002-01-22 18:15:52 +00:00
/**
* xmlDefaultBufferSize :
*
* Global setting , default buffer size . Default value is BASE_BUFFER_SIZE
*/
2001-10-12 17:29:10 +00:00
int xmlDefaultBufferSize = BASE_BUFFER_SIZE ;
2003-05-15 22:11:36 +00:00
static int xmlDefaultBufferSizeThrDef = BASE_BUFFER_SIZE ;
2001-10-12 17:29:10 +00:00
/*
* Parser defaults
*/
2001-10-13 09:15:48 +00:00
2002-01-22 18:15:52 +00:00
/**
* oldXMLWDcompatibility :
*
* Global setting , DEPRECATED .
*/
2001-10-12 17:29:10 +00:00
int oldXMLWDcompatibility = 0 ; /* DEPRECATED */
2002-01-22 18:15:52 +00:00
/**
* xmlParserDebugEntities :
*
* Global setting , asking the parser to print out debugging informations .
* while handling entities .
* Disabled by default
*/
2001-10-12 17:29:10 +00:00
int xmlParserDebugEntities = 0 ;
2003-05-15 22:11:36 +00:00
static int xmlParserDebugEntitiesThrDef = 0 ;
2002-01-22 18:15:52 +00:00
/**
* xmlDoValidityCheckingDefaultValue :
*
* Global setting , indicate that the parser should work in validating mode .
* Disabled by default .
*/
2001-10-12 17:29:10 +00:00
int xmlDoValidityCheckingDefaultValue = 0 ;
2003-05-15 22:11:36 +00:00
static int xmlDoValidityCheckingDefaultValueThrDef = 0 ;
2002-01-22 18:15:52 +00:00
/**
* xmlGetWarningsDefaultValue :
*
* Global setting , indicate that the parser should provide warnings .
* Activated by default .
*/
2001-10-12 17:29:10 +00:00
int xmlGetWarningsDefaultValue = 1 ;
2003-05-15 22:11:36 +00:00
static int xmlGetWarningsDefaultValueThrDef = 1 ;
2002-01-22 18:15:52 +00:00
/**
* xmlLoadExtDtdDefaultValue :
*
* Global setting , indicate that the parser should load DTD while not
* validating .
* Disabled by default .
*/
2001-10-12 17:29:10 +00:00
int xmlLoadExtDtdDefaultValue = 0 ;
2003-05-15 22:11:36 +00:00
static int xmlLoadExtDtdDefaultValueThrDef = 0 ;
2002-01-22 18:15:52 +00:00
/**
* xmlPedanticParserDefaultValue :
*
* Global setting , indicate that the parser be pedantic
* Disabled by default .
*/
2001-10-12 17:29:10 +00:00
int xmlPedanticParserDefaultValue = 0 ;
2003-05-15 22:11:36 +00:00
static int xmlPedanticParserDefaultValueThrDef = 0 ;
2002-01-22 18:15:52 +00: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 17:29:10 +00:00
int xmlLineNumbersDefaultValue = 0 ;
2003-05-15 22:11:36 +00:00
static int xmlLineNumbersDefaultValueThrDef = 0 ;
2002-01-22 18:15:52 +00: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 17:29:10 +00:00
int xmlKeepBlanksDefaultValue = 1 ;
2003-05-15 22:11:36 +00:00
static int xmlKeepBlanksDefaultValueThrDef = 1 ;
2002-01-22 18:15:52 +00: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 17:29:10 +00:00
int xmlSubstituteEntitiesDefaultValue = 0 ;
2003-05-15 22:11:36 +00:00
static int xmlSubstituteEntitiesDefaultValueThrDef = 0 ;
2001-10-12 17:29:10 +00:00
2003-01-01 20:59:38 +00:00
xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL ;
2003-05-15 22:11:36 +00:00
static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef = NULL ;
2003-01-01 20:59:38 +00:00
xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue = NULL ;
2003-05-15 22:11:36 +00:00
static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef = NULL ;
2003-01-01 20:59:38 +00:00
2004-06-02 16:18:40 +00:00
xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue = NULL ;
static xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValueThrDef = NULL ;
xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue = NULL ;
static xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValueThrDef = NULL ;
2001-10-12 17:29:10 +00:00
/*
* Error handling
*/
/* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
/* Must initialize xmlGenericError in xmlInitParser */
2005-07-21 13:24:09 +00:00
void XMLCDECL xmlGenericErrorDefaultFunc ( void * ctx ATTRIBUTE_UNUSED ,
2001-10-29 11:48:19 +00:00
const char * msg ,
. . . ) ;
2002-01-22 18:15:52 +00:00
/**
* xmlGenericError :
*
* Global setting : function used for generic error callbacks
*/
2001-10-29 11:48:19 +00:00
xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc ;
2003-05-15 22:11:36 +00:00
static xmlGenericErrorFunc xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc ;
2003-10-10 14:10:40 +00:00
/**
* xmlStructuredError :
*
* Global setting : function used for structured error callbacks
*/
xmlStructuredErrorFunc xmlStructuredError = NULL ;
static xmlStructuredErrorFunc xmlStructuredErrorThrDef = NULL ;
2002-01-22 18:15:52 +00:00
/**
* xmlGenericErrorContext :
*
* Global setting passed to generic error callbacks
*/
2001-10-12 17:29:10 +00:00
void * xmlGenericErrorContext = NULL ;
2003-05-15 22:11:36 +00:00
static void * xmlGenericErrorContextThrDef = NULL ;
2003-10-02 22:28:19 +00:00
xmlError xmlLastError ;
2001-10-12 17:29:10 +00:00
/*
* output defaults
*/
2002-01-22 18:15:52 +00:00
/**
* xmlIndentTreeOutput :
*
* Global setting , asking the serializer to indent the output tree by default
2002-05-24 07:18:40 +00:00
* Enabled by default
*/
int xmlIndentTreeOutput = 1 ;
2003-05-15 22:11:36 +00:00
static int xmlIndentTreeOutputThrDef = 1 ;
2002-05-24 07:18:40 +00:00
/**
* xmlTreeIndentString :
*
* The string used to do one - level indent . By default is equal to " " ( two spaces )
2002-01-22 18:15:52 +00:00
*/
2002-05-24 07:18:40 +00:00
const char * xmlTreeIndentString = " " ;
2003-05-15 22:11:36 +00:00
static const char * xmlTreeIndentStringThrDef = " " ;
2002-05-24 07:18:40 +00:00
2002-01-22 18:15:52 +00: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 17:29:10 +00:00
int xmlSaveNoEmptyTags = 0 ;
2005-07-28 23:49:35 +00:00
static int xmlSaveNoEmptyTagsThrDef = 0 ;
2001-10-12 17:29:10 +00:00
2003-09-30 00:43:48 +00:00
# ifdef LIBXML_SAX1_ENABLED
2002-01-22 18:15:52 +00:00
/**
* xmlDefaultSAXHandler :
*
2003-09-25 14:29:29 +00:00
* Default SAX version1 handler for XML , builds the DOM tree
2001-10-12 17:29:10 +00:00
*/
2003-09-25 14:29:29 +00:00
xmlSAXHandlerV1 xmlDefaultSAXHandler = {
2003-08-20 22:54:39 +00: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 17:29:10 +00:00
xmlParserWarning ,
xmlParserError ,
xmlParserError ,
2003-08-20 22:54:39 +00:00
xmlSAX2GetParameterEntity ,
xmlSAX2CDataBlock ,
xmlSAX2ExternalSubset ,
0 ,
2001-10-12 17:29:10 +00:00
} ;
2003-09-30 00:43:48 +00:00
# endif /* LIBXML_SAX1_ENABLED */
2001-10-12 17:29:10 +00:00
2002-01-22 18:15:52 +00:00
/**
* xmlDefaultSAXLocator :
*
* The default SAX Locator
* { getPublicId , getSystemId , getLineNumber , getColumnNumber }
2001-10-12 17:29:10 +00:00
*/
xmlSAXLocator xmlDefaultSAXLocator = {
2003-08-20 22:54:39 +00:00
xmlSAX2GetPublicId ,
xmlSAX2GetSystemId ,
xmlSAX2GetLineNumber ,
xmlSAX2GetColumnNumber
2001-10-12 17:29:10 +00:00
} ;
# ifdef LIBXML_HTML_ENABLED
2002-01-22 18:15:52 +00:00
/**
* htmlDefaultSAXHandler :
*
2003-09-25 14:29:29 +00:00
* Default old SAX v1 handler for HTML , builds the DOM tree
2001-10-12 17:29:10 +00:00
*/
2003-09-25 14:29:29 +00:00
xmlSAXHandlerV1 htmlDefaultSAXHandler = {
2003-08-20 22:54:39 +00:00
xmlSAX2InternalSubset ,
2001-10-12 17:29:10 +00:00
NULL ,
NULL ,
NULL ,
NULL ,
2003-08-20 22:54:39 +00:00
xmlSAX2GetEntity ,
2001-10-12 17:29:10 +00:00
NULL ,
NULL ,
NULL ,
NULL ,
NULL ,
2003-08-20 22:54:39 +00:00
xmlSAX2SetDocumentLocator ,
xmlSAX2StartDocument ,
xmlSAX2EndDocument ,
xmlSAX2StartElement ,
xmlSAX2EndElement ,
2001-10-12 17:29:10 +00:00
NULL ,
2003-08-20 22:54:39 +00:00
xmlSAX2Characters ,
xmlSAX2IgnorableWhitespace ,
2004-10-22 14:34:23 +00:00
xmlSAX2ProcessingInstruction ,
2003-08-20 22:54:39 +00:00
xmlSAX2Comment ,
2001-10-12 17:29:10 +00:00
xmlParserWarning ,
xmlParserError ,
xmlParserError ,
2003-08-20 22:54:39 +00:00
xmlSAX2GetParameterEntity ,
xmlSAX2CDataBlock ,
NULL ,
0 ,
2001-10-12 17:29:10 +00:00
} ;
# endif /* LIBXML_HTML_ENABLED */
# ifdef LIBXML_DOCB_ENABLED
2002-01-22 18:15:52 +00:00
/**
* docbDefaultSAXHandler :
*
2003-09-25 14:29:29 +00:00
* Default old SAX v1 handler for SGML DocBook , builds the DOM tree
2001-10-12 17:29:10 +00:00
*/
2003-09-25 14:29:29 +00:00
xmlSAXHandlerV1 docbDefaultSAXHandler = {
2003-08-20 22:54:39 +00:00
xmlSAX2InternalSubset ,
xmlSAX2IsStandalone ,
xmlSAX2HasInternalSubset ,
xmlSAX2HasExternalSubset ,
xmlSAX2ResolveEntity ,
xmlSAX2GetEntity ,
xmlSAX2EntityDecl ,
2001-10-12 17:29:10 +00:00
NULL ,
NULL ,
NULL ,
NULL ,
2003-08-20 22:54:39 +00:00
xmlSAX2SetDocumentLocator ,
xmlSAX2StartDocument ,
xmlSAX2EndDocument ,
xmlSAX2StartElement ,
xmlSAX2EndElement ,
xmlSAX2Reference ,
xmlSAX2Characters ,
xmlSAX2IgnorableWhitespace ,
2001-10-12 17:29:10 +00:00
NULL ,
2003-08-20 22:54:39 +00:00
xmlSAX2Comment ,
2001-10-12 17:29:10 +00:00
xmlParserWarning ,
xmlParserError ,
xmlParserError ,
2003-08-20 22:54:39 +00:00
xmlSAX2GetParameterEntity ,
NULL ,
NULL ,
0 ,
2001-10-12 17:29:10 +00: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 15:58:35 +00:00
# ifdef DEBUG_GLOBALS
fprintf ( stderr , " Initializing globals at %lu for thread %d \n " ,
( unsigned long ) gs , xmlGetThreadId ( ) ) ;
# endif
2001-10-12 17:29:10 +00:00
/*
2001-12-31 16:16:02 +00:00
* Perform initialization as required by libxml
2001-10-12 17:29:10 +00:00
*/
2003-08-28 08:03:23 +00:00
if ( xmlThrDefMutex = = NULL )
xmlInitGlobals ( ) ;
2003-05-15 22:11:36 +00:00
xmlMutexLock ( xmlThrDefMutex ) ;
2002-11-22 05:07:29 +00:00
2005-08-23 22:14:02 +00:00
# if defined(LIBXML_DOCB_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
2003-09-25 14:29:29 +00:00
initdocbDefaultSAXHandler ( & gs - > docbDefaultSAXHandler ) ;
2001-11-04 20:19:12 +00:00
# endif
2005-06-08 17:42:42 +00:00
# if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED)
2003-09-25 14:29:29 +00:00
inithtmlDefaultSAXHandler ( & gs - > htmlDefaultSAXHandler ) ;
2001-11-04 20:19:12 +00:00
# endif
2001-10-17 15:58:35 +00:00
2001-10-12 17:29:10 +00:00
gs - > oldXMLWDcompatibility = 0 ;
2003-05-15 22:11:36 +00:00
gs - > xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef ;
gs - > xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef ;
Re-examined the problems of configuring a "minimal" library.
Synchronized the header files with the library code in order
to assure that all the various conditionals (LIBXML_xxxx_ENABLED)
were the same in both. Modified the API database content to more
accurately reflect the conditionals. Enhanced the generation
of that database. Although there was no substantial change to
any of the library code's logic, a large number of files were
modified to achieve the above, and the configuration script
was enhanced to do some automatic enabling of features (e.g.
--with-xinclude forces --with-xpath). Additionally, all the format
errors discovered by apibuild.py were corrected.
* configure.in: enhanced cross-checking of options
* doc/apibuild.py, doc/elfgcchack.xsl, doc/libxml2-refs.xml,
doc/libxml2-api.xml, gentest.py: changed the usage of the
<cond> element in module descriptions
* elfgcchack.h, testapi.c: regenerated with proper conditionals
* HTMLparser.c, SAX.c, globals.c, tree.c, xmlschemas.c, xpath.c,
testSAX.c: cleaned up conditionals
* include/libxml/[SAX.h, SAX2.h, debugXML.h, encoding.h, entities.h,
hash.h, parser.h, parserInternals.h, schemasInternals.h, tree.h,
valid.h, xlink.h, xmlIO.h, xmlautomata.h, xmlreader.h, xpath.h]:
synchronized the conditionals with the corresponding module code
* doc/examples/tree2.c, doc/examples/xpath1.c, doc/examples/xpath2.c:
added additional conditions required for compilation
* doc/*.html, doc/html/*.html: rebuilt the docs
2005-01-02 09:53:13 +00:00
# if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_LEGACY_ENABLED)
2003-09-25 14:29:29 +00:00
initxmlDefaultSAXHandler ( & gs - > xmlDefaultSAXHandler , 1 ) ;
2003-09-30 00:43:48 +00:00
# endif /* LIBXML_SAX1_ENABLED */
2003-09-28 18:58:27 +00:00
gs - > xmlDefaultSAXLocator . getPublicId = xmlSAX2GetPublicId ;
gs - > xmlDefaultSAXLocator . getSystemId = xmlSAX2GetSystemId ;
gs - > xmlDefaultSAXLocator . getLineNumber = xmlSAX2GetLineNumber ;
gs - > xmlDefaultSAXLocator . getColumnNumber = xmlSAX2GetColumnNumber ;
2003-05-15 22:11:36 +00:00
gs - > xmlDoValidityCheckingDefaultValue =
xmlDoValidityCheckingDefaultValueThrDef ;
2001-10-12 17:29:10 +00:00
# if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
gs - > xmlFree = ( xmlFreeFunc ) xmlMemFree ;
gs - > xmlMalloc = ( xmlMallocFunc ) xmlMemMalloc ;
2003-04-19 00:07:51 +00:00
gs - > xmlMallocAtomic = ( xmlMallocFunc ) xmlMemMalloc ;
2001-10-12 17:29:10 +00:00
gs - > xmlRealloc = ( xmlReallocFunc ) xmlMemRealloc ;
gs - > xmlMemStrdup = ( xmlStrdupFunc ) xmlMemoryStrdup ;
# else
gs - > xmlFree = ( xmlFreeFunc ) free ;
gs - > xmlMalloc = ( xmlMallocFunc ) malloc ;
2003-04-19 00:07:51 +00:00
gs - > xmlMallocAtomic = ( xmlMallocFunc ) malloc ;
2001-10-12 17:29:10 +00:00
gs - > xmlRealloc = ( xmlReallocFunc ) realloc ;
2002-01-18 16:23:55 +00:00
gs - > xmlMemStrdup = ( xmlStrdupFunc ) xmlStrdup ;
2001-10-12 17:29:10 +00:00
# endif
2003-05-15 22:11:36 +00: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 17:29:10 +00:00
gs - > xmlParserVersion = LIBXML_VERSION_STRING ;
2003-05-15 22:11:36 +00:00
gs - > xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef ;
gs - > xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef ;
gs - > xmlSubstituteEntitiesDefaultValue =
xmlSubstituteEntitiesDefaultValueThrDef ;
gs - > xmlGenericError = xmlGenericErrorThrDef ;
2003-10-10 14:10:40 +00:00
gs - > xmlStructuredError = xmlStructuredErrorThrDef ;
2003-05-15 22:11:36 +00:00
gs - > xmlGenericErrorContext = xmlGenericErrorContextThrDef ;
gs - > xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef ;
gs - > xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef ;
2004-06-02 16:18:40 +00:00
gs - > xmlParserInputBufferCreateFilenameValue = xmlParserInputBufferCreateFilenameValueThrDef ;
gs - > xmlOutputBufferCreateFilenameValue = xmlOutputBufferCreateFilenameValueThrDef ;
2003-10-02 22:28:19 +00:00
memset ( & gs - > xmlLastError , 0 , sizeof ( xmlError ) ) ;
2003-01-01 20:59:38 +00:00
2003-05-15 22:11:36 +00:00
xmlMutexUnlock ( xmlThrDefMutex ) ;
}
2003-12-05 14:57:46 +00:00
/**
* DOC_DISABLE : we ignore missing doc for the xmlThrDef functions ,
* those are really internal work
*/
2003-05-15 22:11:36 +00:00
void
xmlThrDefSetGenericErrorFunc ( void * ctx , xmlGenericErrorFunc handler ) {
xmlMutexLock ( xmlThrDefMutex ) ;
xmlGenericErrorContextThrDef = ctx ;
if ( handler ! = NULL )
xmlGenericErrorThrDef = handler ;
else
xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
2003-01-01 20:59:38 +00:00
}
2003-10-10 14:10:40 +00:00
void
xmlThrDefSetStructuredErrorFunc ( void * ctx , xmlStructuredErrorFunc handler ) {
xmlMutexLock ( xmlThrDefMutex ) ;
xmlGenericErrorContextThrDef = ctx ;
xmlStructuredErrorThrDef = handler ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
}
2003-01-01 20:59:38 +00:00
/**
2003-01-06 13:11:20 +00:00
* xmlRegisterNodeDefault :
2003-01-01 20:59:38 +00:00
* @ func : function pointer to the new RegisterNodeFunc
*
2003-02-10 14:28:44 +00:00
* Registers a callback for node creation
*
* Returns the old value of the registration function
2003-01-01 20:59:38 +00:00
*/
xmlRegisterNodeFunc
xmlRegisterNodeDefault ( xmlRegisterNodeFunc func )
{
xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue ;
2003-04-21 21:36:41 +00:00
__xmlRegisterCallbacks = 1 ;
2003-01-01 20:59:38 +00:00
xmlRegisterNodeDefaultValue = func ;
return ( old ) ;
2001-10-12 17:29:10 +00:00
}
2003-05-15 22:11:36 +00:00
xmlRegisterNodeFunc
xmlThrDefRegisterNodeDefault ( xmlRegisterNodeFunc func )
{
xmlRegisterNodeFunc old ;
xmlMutexLock ( xmlThrDefMutex ) ;
old = xmlRegisterNodeDefaultValueThrDef ;
__xmlRegisterCallbacks = 1 ;
xmlRegisterNodeDefaultValueThrDef = func ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ( old ) ;
}
2003-01-01 20:59:38 +00:00
/**
2003-01-06 13:11:20 +00:00
* xmlDeregisterNodeDefault :
2003-01-01 20:59:38 +00:00
* @ func : function pointer to the new DeregisterNodeFunc
*
2003-02-10 14:28:44 +00:00
* Registers a callback for node destruction
*
2003-01-06 13:11:20 +00:00
* Returns the previous value of the deregistration function
2003-01-01 20:59:38 +00:00
*/
xmlDeregisterNodeFunc
xmlDeregisterNodeDefault ( xmlDeregisterNodeFunc func )
{
xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue ;
2003-04-21 21:36:41 +00:00
__xmlRegisterCallbacks = 1 ;
2003-01-01 20:59:38 +00:00
xmlDeregisterNodeDefaultValue = func ;
return ( old ) ;
}
2003-05-15 22:11:36 +00:00
xmlDeregisterNodeFunc
xmlThrDefDeregisterNodeDefault ( xmlDeregisterNodeFunc func )
{
xmlDeregisterNodeFunc old ;
xmlMutexLock ( xmlThrDefMutex ) ;
old = xmlDeregisterNodeDefaultValueThrDef ;
__xmlRegisterCallbacks = 1 ;
xmlDeregisterNodeDefaultValueThrDef = func ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ( old ) ;
}
2004-06-02 16:18:40 +00:00
xmlParserInputBufferCreateFilenameFunc
xmlThrDefParserInputBufferCreateFilenameDefault ( xmlParserInputBufferCreateFilenameFunc func )
{
xmlParserInputBufferCreateFilenameFunc old ;
xmlMutexLock ( xmlThrDefMutex ) ;
old = xmlParserInputBufferCreateFilenameValueThrDef ;
2004-06-08 10:16:42 +00:00
if ( old = = NULL ) {
old = __xmlParserInputBufferCreateFilename ;
}
2004-06-02 16:18:40 +00:00
xmlParserInputBufferCreateFilenameValueThrDef = func ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ( old ) ;
}
xmlOutputBufferCreateFilenameFunc
xmlThrDefOutputBufferCreateFilenameDefault ( xmlOutputBufferCreateFilenameFunc func )
{
xmlOutputBufferCreateFilenameFunc old ;
xmlMutexLock ( xmlThrDefMutex ) ;
old = xmlOutputBufferCreateFilenameValueThrDef ;
2004-06-08 10:16:42 +00:00
# ifdef LIBXML_OUTPUT_ENABLED
if ( old = = NULL ) {
old = __xmlOutputBufferCreateFilename ;
}
# endif
2004-06-02 16:18:40 +00:00
xmlOutputBufferCreateFilenameValueThrDef = func ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ( old ) ;
}
2003-01-01 20:59:38 +00:00
2001-11-04 20:19:12 +00:00
# ifdef LIBXML_DOCB_ENABLED
2001-10-12 17:29:10 +00:00
# undef docbDefaultSAXHandler
2003-09-25 14:29:29 +00:00
xmlSAXHandlerV1 *
2001-10-12 17:29:10 +00:00
__docbDefaultSAXHandler ( void ) {
if ( IS_MAIN_THREAD )
return ( & docbDefaultSAXHandler ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > docbDefaultSAXHandler ) ;
2001-10-12 17:29:10 +00:00
}
2001-11-04 20:19:12 +00:00
# endif
2001-10-12 17:29:10 +00:00
2001-11-04 20:19:12 +00:00
# ifdef LIBXML_HTML_ENABLED
2001-10-12 17:29:10 +00:00
# undef htmlDefaultSAXHandler
2003-09-25 14:29:29 +00:00
xmlSAXHandlerV1 *
2001-10-12 17:29:10 +00:00
__htmlDefaultSAXHandler ( void ) {
if ( IS_MAIN_THREAD )
return ( & htmlDefaultSAXHandler ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > htmlDefaultSAXHandler ) ;
2001-10-12 17:29:10 +00:00
}
2001-11-04 20:19:12 +00:00
# endif
2003-10-02 22:28:19 +00:00
# undef xmlLastError
xmlError *
__xmlLastError ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlLastError ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlLastError ) ;
}
2004-06-10 13:00:15 +00: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 20:19:12 +00:00
/*
* Everything starting from the line below is
* Automatically generated by build_glob . py .
* Do not modify the previous line .
*/
2001-10-12 17:29:10 +00:00
# undef oldXMLWDcompatibility
int *
__oldXMLWDcompatibility ( void ) {
if ( IS_MAIN_THREAD )
return ( & oldXMLWDcompatibility ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > oldXMLWDcompatibility ) ;
2001-10-12 17:29:10 +00:00
}
# undef xmlBufferAllocScheme
xmlBufferAllocationScheme *
__xmlBufferAllocScheme ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlBufferAllocScheme ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlBufferAllocScheme ) ;
2001-10-12 17:29:10 +00:00
}
2003-05-15 22:11:36 +00:00
xmlBufferAllocationScheme xmlThrDefBufferAllocScheme ( xmlBufferAllocationScheme v ) {
xmlBufferAllocationScheme ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlBufferAllocSchemeThrDef ;
xmlBufferAllocSchemeThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 17:29:10 +00:00
# undef xmlDefaultBufferSize
int *
__xmlDefaultBufferSize ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlDefaultBufferSize ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlDefaultBufferSize ) ;
2001-10-12 17:29:10 +00:00
}
2003-05-15 22:11:36 +00:00
int xmlThrDefDefaultBufferSize ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlDefaultBufferSizeThrDef ;
xmlDefaultBufferSizeThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 17:29:10 +00:00
2003-09-30 00:43:48 +00:00
# ifdef LIBXML_SAX1_ENABLED
2001-10-12 17:29:10 +00:00
# undef xmlDefaultSAXHandler
2003-09-25 14:29:29 +00:00
xmlSAXHandlerV1 *
2001-10-12 17:29:10 +00:00
__xmlDefaultSAXHandler ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlDefaultSAXHandler ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlDefaultSAXHandler ) ;
2001-10-12 17:29:10 +00:00
}
2003-09-30 00:43:48 +00:00
# endif /* LIBXML_SAX1_ENABLED */
2001-10-12 17:29:10 +00:00
# undef xmlDefaultSAXLocator
xmlSAXLocator *
__xmlDefaultSAXLocator ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlDefaultSAXLocator ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlDefaultSAXLocator ) ;
2001-10-12 17:29:10 +00:00
}
# undef xmlDoValidityCheckingDefaultValue
int *
__xmlDoValidityCheckingDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlDoValidityCheckingDefaultValue ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlDoValidityCheckingDefaultValue ) ;
2001-10-12 17:29:10 +00:00
}
2003-05-15 22:11:36 +00:00
int xmlThrDefDoValidityCheckingDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlDoValidityCheckingDefaultValueThrDef ;
xmlDoValidityCheckingDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 17:29:10 +00:00
# undef xmlGenericError
xmlGenericErrorFunc *
__xmlGenericError ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlGenericError ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlGenericError ) ;
2001-10-12 17:29:10 +00:00
}
2003-10-10 14:10:40 +00:00
# undef xmlStructuredError
xmlStructuredErrorFunc *
__xmlStructuredError ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlStructuredError ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlStructuredError ) ;
}
2001-10-12 17:29:10 +00:00
# undef xmlGenericErrorContext
void * *
__xmlGenericErrorContext ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlGenericErrorContext ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlGenericErrorContext ) ;
2001-10-12 17:29:10 +00:00
}
# undef xmlGetWarningsDefaultValue
int *
__xmlGetWarningsDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlGetWarningsDefaultValue ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlGetWarningsDefaultValue ) ;
2001-10-12 17:29:10 +00:00
}
2003-05-15 22:11:36 +00:00
int xmlThrDefGetWarningsDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlGetWarningsDefaultValueThrDef ;
xmlGetWarningsDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 17:29:10 +00:00
# undef xmlIndentTreeOutput
int *
__xmlIndentTreeOutput ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlIndentTreeOutput ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlIndentTreeOutput ) ;
2001-10-12 17:29:10 +00:00
}
2003-05-15 22:11:36 +00:00
int xmlThrDefIndentTreeOutput ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlIndentTreeOutputThrDef ;
xmlIndentTreeOutputThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 17:29:10 +00:00
2002-05-24 07:18:40 +00:00
# undef xmlTreeIndentString
const char * *
__xmlTreeIndentString ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlTreeIndentString ) ;
else
return ( & xmlGetGlobalState ( ) - > xmlTreeIndentString ) ;
}
2003-05-15 22:11:36 +00:00
const char * xmlThrDefTreeIndentString ( const char * v ) {
const char * ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlTreeIndentStringThrDef ;
xmlTreeIndentStringThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2002-05-24 07:18:40 +00:00
2001-10-12 17:29:10 +00:00
# undef xmlKeepBlanksDefaultValue
int *
__xmlKeepBlanksDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlKeepBlanksDefaultValue ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlKeepBlanksDefaultValue ) ;
2001-10-12 17:29:10 +00:00
}
2003-05-15 22:11:36 +00:00
int xmlThrDefKeepBlanksDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlKeepBlanksDefaultValueThrDef ;
xmlKeepBlanksDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 17:29:10 +00:00
# undef xmlLineNumbersDefaultValue
int *
__xmlLineNumbersDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlLineNumbersDefaultValue ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlLineNumbersDefaultValue ) ;
2001-10-12 17:29:10 +00:00
}
2003-05-15 22:11:36 +00:00
int xmlThrDefLineNumbersDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlLineNumbersDefaultValueThrDef ;
xmlLineNumbersDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 17:29:10 +00:00
# undef xmlLoadExtDtdDefaultValue
int *
__xmlLoadExtDtdDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlLoadExtDtdDefaultValue ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlLoadExtDtdDefaultValue ) ;
2001-10-12 17:29:10 +00:00
}
2003-05-15 22:11:36 +00:00
int xmlThrDefLoadExtDtdDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlLoadExtDtdDefaultValueThrDef ;
xmlLoadExtDtdDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 17:29:10 +00:00
# undef xmlParserDebugEntities
int *
__xmlParserDebugEntities ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlParserDebugEntities ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlParserDebugEntities ) ;
2001-10-12 17:29:10 +00:00
}
2003-05-15 22:11:36 +00:00
int xmlThrDefParserDebugEntities ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlParserDebugEntitiesThrDef ;
xmlParserDebugEntitiesThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 17:29:10 +00:00
# undef xmlParserVersion
const char * *
__xmlParserVersion ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlParserVersion ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlParserVersion ) ;
2001-10-12 17:29:10 +00:00
}
# undef xmlPedanticParserDefaultValue
int *
__xmlPedanticParserDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlPedanticParserDefaultValue ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlPedanticParserDefaultValue ) ;
2001-10-12 17:29:10 +00:00
}
2003-05-15 22:11:36 +00:00
int xmlThrDefPedanticParserDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlPedanticParserDefaultValueThrDef ;
xmlPedanticParserDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 17:29:10 +00:00
# undef xmlSaveNoEmptyTags
int *
__xmlSaveNoEmptyTags ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlSaveNoEmptyTags ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlSaveNoEmptyTags ) ;
2001-10-12 17:29:10 +00:00
}
2003-05-15 22:11:36 +00:00
int xmlThrDefSaveNoEmptyTags ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlSaveNoEmptyTagsThrDef ;
xmlSaveNoEmptyTagsThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2001-10-12 17:29:10 +00:00
# undef xmlSubstituteEntitiesDefaultValue
int *
__xmlSubstituteEntitiesDefaultValue ( void ) {
if ( IS_MAIN_THREAD )
return ( & xmlSubstituteEntitiesDefaultValue ) ;
else
2001-10-13 09:15:48 +00:00
return ( & xmlGetGlobalState ( ) - > xmlSubstituteEntitiesDefaultValue ) ;
2001-10-12 17:29:10 +00:00
}
2003-05-15 22:11:36 +00:00
int xmlThrDefSubstituteEntitiesDefaultValue ( int v ) {
int ret ;
xmlMutexLock ( xmlThrDefMutex ) ;
ret = xmlSubstituteEntitiesDefaultValueThrDef ;
xmlSubstituteEntitiesDefaultValueThrDef = v ;
xmlMutexUnlock ( xmlThrDefMutex ) ;
return ret ;
}
2003-01-01 20:59:38 +00: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 16:18:40 +00: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 02:11:24 +00:00
}
2005-04-01 13:11:58 +00:00
# define bottom_globals
# include "elfgcchack.h"