/*
* 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
*/
#define IN_LIBXML
#include "libxml.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <string.h>
#include <libxml/xmlmemory.h>
/* #define DEBUG_GLOBALS */
/*
* Helpful Macro
*/
#ifdef LIBXML_THREAD_ENABLED
#else
#endif
/*
* Mutex to protect "ForNewThreads" variables
*/
/**
* xmlInitGlobals:
*
* Additional initialisation for multi-threading
*/
void xmlInitGlobals(void)
{
}
/**
* xmlCleanupGlobals:
*
* Additional cleanup for multi-threading
*/
void xmlCleanupGlobals(void)
{
if (xmlThrDefMutex != NULL) {
}
}
/************************************************************************
* *
* All the user accessible global variables of the library *
* *
************************************************************************/
/*
* Memory allocation routines
*/
#if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY)
#else
/**
* xmlFree:
* @mem: an already allocated block of memory
*
* The variable holding the libxml free() implementation
*/
/**
* 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
*/
/**
* 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
*/
/**
* 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
*/
/**
* 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
*/
#endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */
/**
* xmlParserVersion:
*
* Constant string describing the internal version of the library
*/
/**
* xmlBufferAllocScheme:
*
* Global setting, default allocation policy for buffers, default is
* XML_BUFFER_ALLOC_EXACT
*/
/**
* xmlDefaultBufferSize:
*
* Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
*/
/*
* Parser defaults
*/
/**
* oldXMLWDcompatibility:
*
* Global setting, DEPRECATED.
*/
/**
* xmlParserDebugEntities:
*
* Global setting, asking the parser to print out debugging informations.
* while handling entities.
* Disabled by default
*/
int xmlParserDebugEntities = 0;
static int xmlParserDebugEntitiesThrDef = 0;
/**
* xmlDoValidityCheckingDefaultValue:
*
* Global setting, indicate that the parser should work in validating mode.
* Disabled by default.
*/
int xmlDoValidityCheckingDefaultValue = 0;
static int xmlDoValidityCheckingDefaultValueThrDef = 0;
/**
* xmlGetWarningsDefaultValue:
*
* Global setting, indicate that the parser should provide warnings.
* Activated by default.
*/
/**
* xmlLoadExtDtdDefaultValue:
*
* Global setting, indicate that the parser should load DTD while not
* validating.
* Disabled by default.
*/
int xmlLoadExtDtdDefaultValue = 0;
static int xmlLoadExtDtdDefaultValueThrDef = 0;
/**
* xmlPedanticParserDefaultValue:
*
* Global setting, indicate that the parser be pedantic
* Disabled by default.
*/
int xmlPedanticParserDefaultValue = 0;
static int xmlPedanticParserDefaultValueThrDef = 0;
/**
* 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.
*/
int xmlLineNumbersDefaultValue = 0;
static int xmlLineNumbersDefaultValueThrDef = 0;
/**
* 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.
*/
/**
* 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.
*/
int xmlSubstituteEntitiesDefaultValue = 0;
static int xmlSubstituteEntitiesDefaultValueThrDef = 0;
/*
* Error handling
*/
/* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
/* Must initialize xmlGenericError in xmlInitParser */
const char *msg,
...);
/**
* xmlGenericError:
*
* Global setting: function used for generic error callbacks
*/
/**
* xmlStructuredError:
*
* Global setting: function used for structured error callbacks
*/
/**
* xmlGenericErrorContext:
*
* Global setting passed to generic error callbacks
*/
/*
* output defaults
*/
/**
* xmlIndentTreeOutput:
*
* Global setting, asking the serializer to indent the output tree by default
* Enabled by default
*/
/**
* xmlTreeIndentString:
*
* The string used to do one-level indent. By default is equal to " " (two spaces)
*/
/**
* 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
*/
int xmlSaveNoEmptyTags = 0;
static int xmlSaveNoEmptyTagsThrDef = 0;
#ifdef LIBXML_SAX1_ENABLED
/**
* xmlDefaultSAXHandler:
*
* Default SAX version1 handler for XML, builds the DOM tree
*/
0,
};
#endif /* LIBXML_SAX1_ENABLED */
/**
* xmlDefaultSAXLocator:
*
* The default SAX Locator
* { getPublicId, getSystemId, getLineNumber, getColumnNumber}
*/
};
#ifdef LIBXML_HTML_ENABLED
/**
* htmlDefaultSAXHandler:
*
* Default old SAX v1 handler for HTML, builds the DOM tree
*/
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
0,
};
#endif /* LIBXML_HTML_ENABLED */
#ifdef LIBXML_DOCB_ENABLED
/**
* docbDefaultSAXHandler:
*
* Default old SAX v1 handler for SGML DocBook, builds the DOM tree
*/
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
0,
};
#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
{
#ifdef DEBUG_GLOBALS
(unsigned long) gs, xmlGetThreadId());
#endif
/*
* Perform initialization as required by libxml
*/
if (xmlThrDefMutex == NULL)
#endif
#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED)
#endif
gs->oldXMLWDcompatibility = 0;
#if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_LEGACY_ENABLED)
#endif /* LIBXML_SAX1_ENABLED */
#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
#else
#endif
}
/**
* DOC_DISABLE : we ignore missing doc for the xmlThrDef functions,
* those are really internal work
*/
void
else
}
void
}
/**
* xmlRegisterNodeDefault:
* @func: function pointer to the new RegisterNodeFunc
*
* Registers a callback for node creation
*
* Returns the old value of the registration function
*/
{
return(old);
}
{
return(old);
}
/**
* xmlDeregisterNodeDefault:
* @func: function pointer to the new DeregisterNodeFunc
*
* Registers a callback for node destruction
*
* Returns the previous value of the deregistration function
*/
{
return(old);
}
{
return(old);
}
{
}
return(old);
}
{
#ifdef LIBXML_OUTPUT_ENABLED
}
#endif
return(old);
}
#ifdef LIBXML_DOCB_ENABLED
__docbDefaultSAXHandler(void) {
if (IS_MAIN_THREAD)
return (&docbDefaultSAXHandler);
else
return (&xmlGetGlobalState()->docbDefaultSAXHandler);
}
#endif
#ifdef LIBXML_HTML_ENABLED
__htmlDefaultSAXHandler(void) {
if (IS_MAIN_THREAD)
return (&htmlDefaultSAXHandler);
else
return (&xmlGetGlobalState()->htmlDefaultSAXHandler);
}
#endif
xmlError *
__xmlLastError(void) {
if (IS_MAIN_THREAD)
return (&xmlLastError);
else
return (&xmlGetGlobalState()->xmlLastError);
}
/*
* 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)
__xmlMalloc(void){
if (IS_MAIN_THREAD)
return (&xmlMalloc);
else
return (&xmlGetGlobalState()->xmlMalloc);
}
__xmlMallocAtomic(void){
if (IS_MAIN_THREAD)
return (&xmlMallocAtomic);
else
return (&xmlGetGlobalState()->xmlMallocAtomic);
}
__xmlRealloc(void){
if (IS_MAIN_THREAD)
return (&xmlRealloc);
else
return (&xmlGetGlobalState()->xmlRealloc);
}
__xmlFree(void){
if (IS_MAIN_THREAD)
return (&xmlFree);
else
return (&xmlGetGlobalState()->xmlFree);
}
__xmlMemStrdup(void){
if (IS_MAIN_THREAD)
return (&xmlMemStrdup);
else
return (&xmlGetGlobalState()->xmlMemStrdup);
}
#endif
/*
* Everything starting from the line below is
* Automatically generated by build_glob.py.
* Do not modify the previous line.
*/
int *
__oldXMLWDcompatibility(void) {
if (IS_MAIN_THREAD)
return (&oldXMLWDcompatibility);
else
return (&xmlGetGlobalState()->oldXMLWDcompatibility);
}
__xmlBufferAllocScheme(void) {
if (IS_MAIN_THREAD)
return (&xmlBufferAllocScheme);
else
return (&xmlGetGlobalState()->xmlBufferAllocScheme);
}
return ret;
}
int *
__xmlDefaultBufferSize(void) {
if (IS_MAIN_THREAD)
return (&xmlDefaultBufferSize);
else
return (&xmlGetGlobalState()->xmlDefaultBufferSize);
}
int xmlThrDefDefaultBufferSize(int v) {
int ret;
return ret;
}
#ifdef LIBXML_SAX1_ENABLED
__xmlDefaultSAXHandler(void) {
if (IS_MAIN_THREAD)
return (&xmlDefaultSAXHandler);
else
return (&xmlGetGlobalState()->xmlDefaultSAXHandler);
}
#endif /* LIBXML_SAX1_ENABLED */
__xmlDefaultSAXLocator(void) {
if (IS_MAIN_THREAD)
return (&xmlDefaultSAXLocator);
else
return (&xmlGetGlobalState()->xmlDefaultSAXLocator);
}
int *
if (IS_MAIN_THREAD)
return (&xmlDoValidityCheckingDefaultValue);
else
return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue);
}
int xmlThrDefDoValidityCheckingDefaultValue(int v) {
int ret;
return ret;
}
__xmlGenericError(void) {
if (IS_MAIN_THREAD)
return (&xmlGenericError);
else
return (&xmlGetGlobalState()->xmlGenericError);
}
__xmlStructuredError(void) {
if (IS_MAIN_THREAD)
return (&xmlStructuredError);
else
return (&xmlGetGlobalState()->xmlStructuredError);
}
void * *
__xmlGenericErrorContext(void) {
if (IS_MAIN_THREAD)
return (&xmlGenericErrorContext);
else
return (&xmlGetGlobalState()->xmlGenericErrorContext);
}
int *
__xmlGetWarningsDefaultValue(void) {
if (IS_MAIN_THREAD)
return (&xmlGetWarningsDefaultValue);
else
return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue);
}
int xmlThrDefGetWarningsDefaultValue(int v) {
int ret;
return ret;
}
int *
__xmlIndentTreeOutput(void) {
if (IS_MAIN_THREAD)
return (&xmlIndentTreeOutput);
else
return (&xmlGetGlobalState()->xmlIndentTreeOutput);
}
int xmlThrDefIndentTreeOutput(int v) {
int ret;
return ret;
}
const char * *
__xmlTreeIndentString(void) {
if (IS_MAIN_THREAD)
return (&xmlTreeIndentString);
else
return (&xmlGetGlobalState()->xmlTreeIndentString);
}
const char * xmlThrDefTreeIndentString(const char * v) {
const char * ret;
return ret;
}
int *
__xmlKeepBlanksDefaultValue(void) {
if (IS_MAIN_THREAD)
return (&xmlKeepBlanksDefaultValue);
else
return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue);
}
int xmlThrDefKeepBlanksDefaultValue(int v) {
int ret;
return ret;
}
int *
__xmlLineNumbersDefaultValue(void) {
if (IS_MAIN_THREAD)
return (&xmlLineNumbersDefaultValue);
else
return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue);
}
int xmlThrDefLineNumbersDefaultValue(int v) {
int ret;
return ret;
}
int *
__xmlLoadExtDtdDefaultValue(void) {
if (IS_MAIN_THREAD)
return (&xmlLoadExtDtdDefaultValue);
else
return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue);
}
int xmlThrDefLoadExtDtdDefaultValue(int v) {
int ret;
return ret;
}
int *
__xmlParserDebugEntities(void) {
if (IS_MAIN_THREAD)
return (&xmlParserDebugEntities);
else
return (&xmlGetGlobalState()->xmlParserDebugEntities);
}
int xmlThrDefParserDebugEntities(int v) {
int ret;
return ret;
}
const char * *
__xmlParserVersion(void) {
if (IS_MAIN_THREAD)
return (&xmlParserVersion);
else
return (&xmlGetGlobalState()->xmlParserVersion);
}
int *
__xmlPedanticParserDefaultValue(void) {
if (IS_MAIN_THREAD)
return (&xmlPedanticParserDefaultValue);
else
return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue);
}
int xmlThrDefPedanticParserDefaultValue(int v) {
int ret;
return ret;
}
int *
__xmlSaveNoEmptyTags(void) {
if (IS_MAIN_THREAD)
return (&xmlSaveNoEmptyTags);
else
return (&xmlGetGlobalState()->xmlSaveNoEmptyTags);
}
int xmlThrDefSaveNoEmptyTags(int v) {
int ret;
return ret;
}
int *
if (IS_MAIN_THREAD)
return (&xmlSubstituteEntitiesDefaultValue);
else
return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue);
}
int xmlThrDefSubstituteEntitiesDefaultValue(int v) {
int ret;
return ret;
}
__xmlRegisterNodeDefaultValue(void) {
if (IS_MAIN_THREAD)
return (&xmlRegisterNodeDefaultValue);
else
return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue);
}
__xmlDeregisterNodeDefaultValue(void) {
if (IS_MAIN_THREAD)
return (&xmlDeregisterNodeDefaultValue);
else
return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue);
}
if (IS_MAIN_THREAD)
return (&xmlParserInputBufferCreateFilenameValue);
else
return (&xmlGetGlobalState()->xmlParserInputBufferCreateFilenameValue);
}
if (IS_MAIN_THREAD)
return (&xmlOutputBufferCreateFilenameValue);
else
return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue);
}
#define bottom_globals
#include "elfgcchack.h"