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:06:09 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#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
|
|
|
|
2022-08-26 01:22:33 +02:00
|
|
|
#include "private/error.h"
|
2022-11-24 20:52:57 +01:00
|
|
|
#include "private/globals.h"
|
2022-08-26 01:22:33 +02:00
|
|
|
#include "private/threads.h"
|
|
|
|
#include "private/tree.h"
|
|
|
|
|
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
|
|
|
|
*/
|
2022-11-24 20:54:18 +01:00
|
|
|
static xmlMutex xmlThrDefMutex;
|
2003-05-15 22:11:36 +00:00
|
|
|
|
2003-12-20 02:10:28 +00:00
|
|
|
/**
|
|
|
|
* xmlInitGlobals:
|
|
|
|
*
|
2022-11-24 20:52:57 +01:00
|
|
|
* DEPRECATED: Alias for xmlInitParser.
|
|
|
|
*/
|
|
|
|
void xmlInitGlobals(void) {
|
|
|
|
xmlInitParser();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* xmlInitGlobalsInternal:
|
2022-03-06 13:55:48 +01:00
|
|
|
*
|
2003-12-20 02:10:28 +00:00
|
|
|
* Additional initialisation for multi-threading
|
|
|
|
*/
|
2022-11-24 20:52:57 +01:00
|
|
|
void xmlInitGlobalsInternal(void) {
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlInitMutex(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
}
|
|
|
|
|
2001-10-12 17:29:10 +00:00
|
|
|
/************************************************************************
|
2012-09-11 13:26:36 +08:00
|
|
|
* *
|
2001-10-12 17:29:10 +00:00
|
|
|
* All the user accessible global variables of the library *
|
2012-09-11 13:26:36 +08:00
|
|
|
* *
|
2001-10-12 17:29:10 +00:00
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
*/
|
2017-11-09 13:42:33 +01:00
|
|
|
xmlFreeFunc xmlFree = 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
|
|
|
|
*/
|
2017-11-09 13:42:33 +01:00
|
|
|
xmlMallocFunc xmlMalloc = 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
|
2019-09-30 17:04:54 +02:00
|
|
|
* data (i.e. blocks not containing pointers), useful when using a
|
2003-04-19 00:07:51 +00:00
|
|
|
* garbage collecting allocator.
|
|
|
|
*
|
|
|
|
* Returns a pointer to the newly allocated block or NULL in case of error
|
|
|
|
*/
|
2017-11-09 13:42:33 +01:00
|
|
|
xmlMallocFunc xmlMallocAtomic = 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
|
|
|
|
*/
|
2017-11-09 13:42:33 +01:00
|
|
|
xmlReallocFunc xmlRealloc = realloc;
|
|
|
|
/**
|
|
|
|
* xmlPosixStrdup
|
|
|
|
* @cur: the input char *
|
|
|
|
*
|
|
|
|
* a strdup implementation with a type signature matching POSIX
|
|
|
|
*
|
|
|
|
* Returns a new xmlChar * or NULL
|
|
|
|
*/
|
|
|
|
static char *
|
|
|
|
xmlPosixStrdup(const char *cur) {
|
|
|
|
return((char*) xmlCharStrdup(cur));
|
|
|
|
}
|
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
|
|
|
|
*/
|
2017-11-09 13:42:33 +01:00
|
|
|
xmlStrdupFunc xmlMemStrdup = xmlPosixStrdup;
|
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 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
|
2009-08-24 17:34:25 +02:00
|
|
|
#undef xmlStructuredErrorContext
|
2001-10-13 09:15:48 +00:00
|
|
|
#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:
|
|
|
|
*
|
2022-08-23 20:57:49 +02:00
|
|
|
* DEPRECATED: Don't use.
|
|
|
|
*
|
2002-01-22 18:15:52 +00:00
|
|
|
* 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:
|
|
|
|
*
|
2022-08-23 20:57:49 +02:00
|
|
|
* DEPRECATED: Don't use.
|
|
|
|
*
|
2002-01-22 18:15:52 +00:00
|
|
|
* 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:
|
|
|
|
*
|
2022-08-24 02:18:50 +02:00
|
|
|
* DEPRECATED: Don't use
|
|
|
|
*
|
2020-03-08 17:19:42 +01:00
|
|
|
* Global setting, asking the parser to print out debugging information.
|
2002-01-22 18:15:52 +00:00
|
|
|
* 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:
|
|
|
|
*
|
2022-08-24 02:18:50 +02:00
|
|
|
* DEPRECATED: Use the modern options API with XML_PARSE_DTDVALID.
|
|
|
|
*
|
2002-01-22 18:15:52 +00:00
|
|
|
* 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:
|
|
|
|
*
|
2022-08-24 02:18:50 +02:00
|
|
|
* DEPRECATED: Don't use
|
|
|
|
*
|
|
|
|
* Global setting, indicate that the DTD validation should provide warnings.
|
2002-01-22 18:15:52 +00:00
|
|
|
* 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:
|
|
|
|
*
|
2022-08-24 02:18:50 +02:00
|
|
|
* DEPRECATED: Use the modern options API with XML_PARSE_DTDLOAD.
|
|
|
|
*
|
2002-01-22 18:15:52 +00:00
|
|
|
* 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:
|
|
|
|
*
|
2022-08-23 20:57:49 +02:00
|
|
|
* DEPRECATED: Use the modern options API with XML_PARSE_PEDANTIC.
|
|
|
|
*
|
2002-01-22 18:15:52 +00:00
|
|
|
* 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:
|
|
|
|
*
|
2022-08-23 20:57:49 +02:00
|
|
|
* DEPRECATED: The modern options API always enables line numbers.
|
|
|
|
*
|
2002-01-22 18:15:52 +00:00
|
|
|
* Global setting, indicate that the parser should store the line number
|
2012-09-11 13:26:36 +08:00
|
|
|
* in the content field of elements in the DOM tree.
|
2002-01-22 18:15:52 +00:00
|
|
|
* Disabled by default since this may not be safe for old classes of
|
2019-09-30 17:04:54 +02:00
|
|
|
* application.
|
2002-01-22 18:15:52 +00:00
|
|
|
*/
|
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:
|
|
|
|
*
|
2022-08-24 02:18:50 +02:00
|
|
|
* DEPRECATED: Use the modern options API with XML_PARSE_NOBLANKS.
|
|
|
|
*
|
2002-01-22 18:15:52 +00:00
|
|
|
* 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:
|
|
|
|
*
|
2022-08-24 02:18:50 +02:00
|
|
|
* DEPRECATED: Use the modern options API with XML_PARSE_NOENT.
|
|
|
|
*
|
2002-01-22 18:15:52 +00:00
|
|
|
* 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
|
|
|
|
2022-08-24 02:18:50 +02:00
|
|
|
/**
|
|
|
|
* xmlRegisterNodeDefaultValue:
|
|
|
|
*
|
|
|
|
* DEPRECATED: Don't use
|
|
|
|
*/
|
2003-01-01 20:59:38 +00:00
|
|
|
xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL;
|
2003-05-15 22:11:36 +00:00
|
|
|
static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef = NULL;
|
2022-08-24 02:18:50 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* xmlDeregisterNodeDefaultValue:
|
|
|
|
*
|
|
|
|
* DEPRECATED: Don't use
|
|
|
|
*/
|
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
|
|
|
|
2022-08-24 02:18:50 +02:00
|
|
|
/**
|
|
|
|
* xmlParserInputBufferCreateFilenameValue:
|
|
|
|
*
|
|
|
|
* DEPRECATED: Don't use
|
|
|
|
*/
|
2004-06-02 16:18:40 +00:00
|
|
|
xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue = NULL;
|
|
|
|
static xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValueThrDef = NULL;
|
|
|
|
|
2022-08-24 02:18:50 +02:00
|
|
|
/**
|
|
|
|
* xmlOutputBufferCreateFilenameValue:
|
|
|
|
*
|
|
|
|
* DEPRECATED: Don't use
|
|
|
|
*/
|
2004-06-02 16:18:40 +00:00
|
|
|
xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue = NULL;
|
|
|
|
static xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValueThrDef = NULL;
|
|
|
|
|
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;
|
2009-08-24 17:34:25 +02:00
|
|
|
/**
|
|
|
|
* xmlStructuredErrorContext:
|
|
|
|
*
|
|
|
|
* Global setting passed to structured error callbacks
|
|
|
|
*/
|
|
|
|
void *xmlStructuredErrorContext = NULL;
|
|
|
|
static void *xmlStructuredErrorContextThrDef = 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
|
2019-09-30 17:04:54 +02:00
|
|
|
* as <empty/> but <empty></empty>. those two forms are indistinguishable
|
2002-01-22 18:15:52 +00:00
|
|
|
* 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:
|
|
|
|
*
|
2022-08-23 20:57:49 +02:00
|
|
|
* DEPRECATED: This handler is unused and will be removed from future
|
|
|
|
* versions.
|
|
|
|
*
|
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,
|
2022-11-24 16:38:47 +01:00
|
|
|
1,
|
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:
|
|
|
|
*
|
2022-08-23 20:57:49 +02:00
|
|
|
* DEPRECATED: Don't use
|
|
|
|
*
|
2002-01-22 18:15:52 +00:00
|
|
|
* 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
|
|
|
};
|
|
|
|
|
2022-08-22 14:11:15 +02:00
|
|
|
#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_SAX1_ENABLED)
|
2002-01-22 18:15:52 +00:00
|
|
|
/**
|
|
|
|
* htmlDefaultSAXHandler:
|
|
|
|
*
|
2022-08-23 20:57:49 +02:00
|
|
|
* DEPRECATED: This handler is unused and will be removed from future
|
|
|
|
* versions.
|
|
|
|
*
|
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,
|
2022-11-24 16:38:47 +01:00
|
|
|
NULL,
|
2003-08-20 22:54:39 +00:00
|
|
|
xmlSAX2CDataBlock,
|
|
|
|
NULL,
|
2022-11-24 16:38:47 +01:00
|
|
|
1,
|
2001-10-12 17:29:10 +00:00
|
|
|
};
|
|
|
|
#endif /* LIBXML_HTML_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
|
2022-09-01 01:18:30 +02:00
|
|
|
fprintf(stderr, "Initializing globals at %p for thread %d\n",
|
|
|
|
(void *) gs, xmlGetThreadId());
|
2001-10-17 15:58:35 +00:00
|
|
|
#endif
|
|
|
|
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2002-11-22 05:07:29 +00:00
|
|
|
|
2012-07-03 14:13:59 +09:00
|
|
|
#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_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;
|
2012-09-11 13:26:36 +08:00
|
|
|
gs->xmlDoValidityCheckingDefaultValue =
|
2003-05-15 22:11:36 +00:00
|
|
|
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;
|
2012-09-11 13:26:36 +08:00
|
|
|
gs->xmlSubstituteEntitiesDefaultValue =
|
2003-05-15 22:11:36 +00:00
|
|
|
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;
|
2009-08-24 17:34:25 +02:00
|
|
|
gs->xmlStructuredErrorContext = xmlStructuredErrorContextThrDef;
|
2003-05-15 22:11:36 +00:00
|
|
|
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
|
|
|
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
}
|
|
|
|
|
2022-03-02 02:14:39 +01:00
|
|
|
/**
|
|
|
|
* xmlCleanupGlobals:
|
|
|
|
*
|
2022-11-24 20:52:57 +01:00
|
|
|
* DEPRECATED: This function is a no-op. Call xmlCleanupParser
|
2022-03-06 13:55:48 +01:00
|
|
|
* to free global state but see the warnings there. xmlCleanupParser
|
|
|
|
* should be only called once at program exit. In most cases, you don't
|
|
|
|
* have call cleanup functions at all.
|
2022-11-24 20:52:57 +01:00
|
|
|
*/
|
|
|
|
void xmlCleanupGlobals(void) {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* xmlCleanupGlobalsInternal:
|
2022-03-06 13:55:48 +01:00
|
|
|
*
|
2022-03-02 02:14:39 +01:00
|
|
|
* Additional cleanup for multi-threading
|
|
|
|
*/
|
2022-11-24 20:52:57 +01:00
|
|
|
void xmlCleanupGlobalsInternal(void) {
|
2022-03-02 02:14:39 +01:00
|
|
|
xmlResetError(&xmlLastError);
|
|
|
|
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlCleanupMutex(&xmlThrDefMutex);
|
2022-03-02 02:14:39 +01:00
|
|
|
__xmlGlobalInitMutexDestroy();
|
|
|
|
}
|
|
|
|
|
2003-05-15 22:11:36 +00:00
|
|
|
void
|
|
|
|
xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
xmlGenericErrorContextThrDef = ctx;
|
|
|
|
if (handler != NULL)
|
|
|
|
xmlGenericErrorThrDef = handler;
|
|
|
|
else
|
|
|
|
xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-01-01 20:59:38 +00:00
|
|
|
}
|
|
|
|
|
2003-10-10 14:10:40 +00:00
|
|
|
void
|
|
|
|
xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler) {
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2009-08-24 17:34:25 +02:00
|
|
|
xmlStructuredErrorContextThrDef = ctx;
|
2003-10-10 14:10:40 +00:00
|
|
|
xmlStructuredErrorThrDef = handler;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-10-10 14:10:40 +00:00
|
|
|
}
|
|
|
|
|
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;
|
2012-09-11 13:26:36 +08:00
|
|
|
|
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;
|
2012-09-11 13:26:36 +08:00
|
|
|
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
old = xmlRegisterNodeDefaultValueThrDef;
|
2012-09-11 13:26:36 +08:00
|
|
|
|
2003-05-15 22:11:36 +00:00
|
|
|
__xmlRegisterCallbacks = 1;
|
|
|
|
xmlRegisterNodeDefaultValueThrDef = func;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
|
|
|
|
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;
|
2012-09-11 13:26:36 +08:00
|
|
|
|
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;
|
|
|
|
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
old = xmlDeregisterNodeDefaultValueThrDef;
|
2012-09-11 13:26:36 +08:00
|
|
|
|
2003-05-15 22:11:36 +00:00
|
|
|
__xmlRegisterCallbacks = 1;
|
|
|
|
xmlDeregisterNodeDefaultValueThrDef = func;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
|
|
|
|
return(old);
|
|
|
|
}
|
|
|
|
|
2004-06-02 16:18:40 +00:00
|
|
|
xmlParserInputBufferCreateFilenameFunc
|
|
|
|
xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func)
|
|
|
|
{
|
|
|
|
xmlParserInputBufferCreateFilenameFunc old;
|
2012-09-11 13:26:36 +08:00
|
|
|
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2004-06-02 16:18:40 +00:00
|
|
|
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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2004-06-02 16:18:40 +00:00
|
|
|
|
|
|
|
return(old);
|
|
|
|
}
|
|
|
|
|
|
|
|
xmlOutputBufferCreateFilenameFunc
|
|
|
|
xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func)
|
|
|
|
{
|
|
|
|
xmlOutputBufferCreateFilenameFunc old;
|
2012-09-11 13:26:36 +08:00
|
|
|
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2004-06-02 16:18:40 +00:00
|
|
|
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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2004-06-02 16:18:40 +00:00
|
|
|
|
|
|
|
return(old);
|
|
|
|
}
|
2003-01-01 20:59:38 +00:00
|
|
|
|
2022-08-22 14:11:15 +02:00
|
|
|
#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_SAX1_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
|
2012-09-11 13:26:36 +08:00
|
|
|
return (&xmlGetGlobalState()->xmlMalloc);
|
2004-06-10 13:00:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
ret = xmlBufferAllocSchemeThrDef;
|
|
|
|
xmlBufferAllocSchemeThrDef = v;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
ret = xmlDefaultBufferSizeThrDef;
|
|
|
|
xmlDefaultBufferSizeThrDef = v;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
ret = xmlDoValidityCheckingDefaultValueThrDef;
|
|
|
|
xmlDoValidityCheckingDefaultValueThrDef = v;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2009-08-24 17:34:25 +02:00
|
|
|
#undef xmlStructuredErrorContext
|
|
|
|
void * *
|
|
|
|
__xmlStructuredErrorContext(void) {
|
|
|
|
if (IS_MAIN_THREAD)
|
|
|
|
return (&xmlStructuredErrorContext);
|
|
|
|
else
|
|
|
|
return (&xmlGetGlobalState()->xmlStructuredErrorContext);
|
|
|
|
}
|
|
|
|
|
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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
ret = xmlGetWarningsDefaultValueThrDef;
|
|
|
|
xmlGetWarningsDefaultValueThrDef = v;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
ret = xmlIndentTreeOutputThrDef;
|
|
|
|
xmlIndentTreeOutputThrDef = v;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
return ret;
|
|
|
|
}
|
2001-10-12 17:29:10 +00:00
|
|
|
|
2009-08-24 17:34:25 +02:00
|
|
|
#undef xmlTreeIndentString
|
2002-05-24 07:18:40 +00:00
|
|
|
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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
ret = xmlTreeIndentStringThrDef;
|
|
|
|
xmlTreeIndentStringThrDef = v;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
ret = xmlKeepBlanksDefaultValueThrDef;
|
|
|
|
xmlKeepBlanksDefaultValueThrDef = v;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
ret = xmlLineNumbersDefaultValueThrDef;
|
|
|
|
xmlLineNumbersDefaultValueThrDef = v;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
ret = xmlLoadExtDtdDefaultValueThrDef;
|
|
|
|
xmlLoadExtDtdDefaultValueThrDef = v;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
ret = xmlParserDebugEntitiesThrDef;
|
|
|
|
xmlParserDebugEntitiesThrDef = v;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
ret = xmlPedanticParserDefaultValueThrDef;
|
|
|
|
xmlPedanticParserDefaultValueThrDef = v;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
ret = xmlSaveNoEmptyTagsThrDef;
|
|
|
|
xmlSaveNoEmptyTagsThrDef = v;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
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;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexLock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
ret = xmlSubstituteEntitiesDefaultValueThrDef;
|
|
|
|
xmlSubstituteEntitiesDefaultValueThrDef = v;
|
2022-11-24 20:54:18 +01:00
|
|
|
xmlMutexUnlock(&xmlThrDefMutex);
|
2003-05-15 22:11:36 +00:00
|
|
|
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
|
|
|
|