## globals

globals - interface for all global variables of the library

all the global variables and thread handling for those variables is handled by this module. The bottom of this file is automatically generated by build_glob.py based on the description file global.data

Author(s): Gary Pennington <Gary.Pennington@uk.sun.com>, Daniel Veillard

## Synopsis

    typedef struct _xmlGlobalState xmlGlobalState;
    typedef xmlGlobalState * xmlGlobalStatePtr;
    void	xmlCleanupGlobals		(void);
    xmlDeregisterNodeFunc	xmlDeregisterNodeDefault	(xmlDeregisterNodeFunc func);
    typedef void xmlDeregisterNodeFunc		(xmlNodePtr node);
    void	xmlInitGlobals			(void);
    void	xmlInitializeGlobalState	(xmlGlobalStatePtr gs);
    xmlOutputBufferCreateFilenameFunc	xmlOutputBufferCreateFilenameDefault	(xmlOutputBufferCreateFilenameFunc func);
    typedef xmlOutputBufferPtr xmlOutputBufferCreateFilenameFunc	(const char * URI,
    							 xmlCharEncodingHandlerPtr encoder,
    							 int compression);
    xmlParserInputBufferCreateFilenameFunc	xmlParserInputBufferCreateFilenameDefault	(xmlParserInputBufferCreateFilenameFunc func);
    typedef xmlParserInputBufferPtr xmlParserInputBufferCreateFilenameFunc	(const char * URI,
    							 xmlCharEncoding enc);
    xmlRegisterNodeFunc	xmlRegisterNodeDefault	(xmlRegisterNodeFunc func);
    typedef void xmlRegisterNodeFunc		(xmlNodePtr node);
    xmlBufferAllocationScheme	xmlThrDefBufferAllocScheme	(xmlBufferAllocationScheme v);
    int	xmlThrDefDefaultBufferSize	(int v);
    xmlDeregisterNodeFunc	xmlThrDefDeregisterNodeDefault	(xmlDeregisterNodeFunc func);
    int	xmlThrDefDoValidityCheckingDefaultValue	(int v);
    int	xmlThrDefGetWarningsDefaultValue	(int v);
    int	xmlThrDefIndentTreeOutput	(int v);
    int	xmlThrDefKeepBlanksDefaultValue	(int v);
    int	xmlThrDefLineNumbersDefaultValue	(int v);
    int	xmlThrDefLoadExtDtdDefaultValue	(int v);
    xmlOutputBufferCreateFilenameFunc	xmlThrDefOutputBufferCreateFilenameDefault	(xmlOutputBufferCreateFilenameFunc func);
    int	xmlThrDefParserDebugEntities	(int v);
    xmlParserInputBufferCreateFilenameFunc	xmlThrDefParserInputBufferCreateFilenameDefault	(xmlParserInputBufferCreateFilenameFunc func);
    int	xmlThrDefPedanticParserDefaultValue	(int v);
    xmlRegisterNodeFunc	xmlThrDefRegisterNodeDefault	(xmlRegisterNodeFunc func);
    int	xmlThrDefSaveNoEmptyTags	(int v);
    void	xmlThrDefSetGenericErrorFunc	(void * ctx,
    					 xmlGenericErrorFunc handler);
    void	xmlThrDefSetStructuredErrorFunc	(void * ctx,
    					 xmlStructuredErrorFunc handler);
    int	xmlThrDefSubstituteEntitiesDefaultValue	(int v);
    const char *	xmlThrDefTreeIndentString	(const char * v);

## Description

## Details

### Structure xmlGlobalState

    struct _xmlGlobalState {
        const char *	xmlParserVersion
        xmlSAXLocator	xmlDefaultSAXLocator
        xmlSAXHandlerV1	xmlDefaultSAXHandler
        xmlSAXHandlerV1	docbDefaultSAXHandler	: unused
        xmlSAXHandlerV1	htmlDefaultSAXHandler
        xmlFreeFunc	xmlFree
        xmlMallocFunc	xmlMalloc
        xmlStrdupFunc	xmlMemStrdup
        xmlReallocFunc	xmlRealloc
        xmlGenericErrorFunc	xmlGenericError
        xmlStructuredErrorFunc	xmlStructuredError
        void *	xmlGenericErrorContext
        int	oldXMLWDcompatibility
        xmlBufferAllocationScheme	xmlBufferAllocScheme
        int	xmlDefaultBufferSize
        int	xmlSubstituteEntitiesDefaultValue
        int	xmlDoValidityCheckingDefaultValue
        int	xmlGetWarningsDefaultValue
        int	xmlKeepBlanksDefaultValue
        int	xmlLineNumbersDefaultValue
        int	xmlLoadExtDtdDefaultValue
        int	xmlParserDebugEntities
        int	xmlPedanticParserDefaultValue
        int	xmlSaveNoEmptyTags
        int	xmlIndentTreeOutput
        const char *	xmlTreeIndentString
        xmlRegisterNodeFunc	xmlRegisterNodeDefaultValue
        xmlDeregisterNodeFunc	xmlDeregisterNodeDefaultValue
        xmlMallocFunc	xmlMallocAtomic
        xmlError	xmlLastError
        xmlParserInputBufferCreateFilenameFunc	xmlParserInputBufferCreateFilenameValue
        xmlOutputBufferCreateFilenameFunc	xmlOutputBufferCreateFilenameValue
        void *	xmlStructuredErrorContext
    } xmlGlobalState;

### Typedef xmlGlobalStatePtr

    xmlGlobalState * xmlGlobalStatePtr;

### Function type xmlDeregisterNodeFunc

    void	xmlDeregisterNodeFunc		(xmlNodePtr node)

Signature for the deregistration callback of a discarded node

`node`: | the current node

### Function type xmlOutputBufferCreateFilenameFunc

    xmlOutputBufferPtr	xmlOutputBufferCreateFilenameFunc	(const char * URI,
    							 xmlCharEncodingHandlerPtr encoder,
    							 int compression)

Signature for the function doing the lookup for a suitable output method corresponding to an URI.

`URI`: | the URI to write to
`encoder`: |
`compression`: |
`Returns`: | the new xmlOutputBufferPtr in case of success or NULL if no method was found.

### Function type xmlParserInputBufferCreateFilenameFunc

    xmlParserInputBufferPtr	xmlParserInputBufferCreateFilenameFunc	(const char * URI,
    							 xmlCharEncoding enc)

Signature for the function doing the lookup for a suitable input method corresponding to an URI.

`URI`: | the URI to read from
`enc`: | the requested source encoding
`Returns`: | the new xmlParserInputBufferPtr in case of success or NULL if no method was found.

### Function type xmlRegisterNodeFunc

    void	xmlRegisterNodeFunc		(xmlNodePtr node)

Signature for the registration callback of a created node

`node`: | the current node

### Variable htmlDefaultSAXHandler

    xmlSAXHandlerV1 htmlDefaultSAXHandler;

DEPRECATED: This handler is unused and will be removed from future versions. Default old SAX v1 handler for HTML, builds the DOM tree

### Variable oldXMLWDcompatibility

    int oldXMLWDcompatibility;

Global setting, DEPRECATED.

### Variable xmlBufferAllocScheme

    xmlBufferAllocationScheme xmlBufferAllocScheme;

DEPRECATED: Don't use. Global setting, default allocation policy for buffers, default is XML_BUFFER_ALLOC_EXACT

### Variable xmlDefaultBufferSize

    int xmlDefaultBufferSize;

DEPRECATED: Don't use. Global setting, default buffer size. Default value is BASE_BUFFER_SIZE

### Variable xmlDefaultSAXHandler

    xmlSAXHandlerV1 xmlDefaultSAXHandler;

DEPRECATED: This handler is unused and will be removed from future versions. Default SAX version1 handler for XML, builds the DOM tree

### Variable xmlDefaultSAXLocator

    xmlSAXLocator xmlDefaultSAXLocator;

DEPRECATED: Don't use The default SAX Locator { getPublicId, getSystemId, getLineNumber, getColumnNumber}

### Variable xmlDeregisterNodeDefaultValue

    xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;

DEPRECATED: Don't use

### Variable xmlDoValidityCheckingDefaultValue

    int xmlDoValidityCheckingDefaultValue;

DEPRECATED: Use the modern options API with XML_PARSE_DTDVALID. Global setting, indicate that the parser should work in validating mode. Disabled by default.

### Variable xmlFree

    xmlFreeFunc xmlFree;

@mem: an already allocated block of memory The variable holding the libxml free() implementation

### Variable xmlGenericError

    xmlGenericErrorFunc xmlGenericError;

Global setting: function used for generic error callbacks

### Variable xmlGenericErrorContext

    void * xmlGenericErrorContext;

Global setting passed to generic error callbacks

### Variable xmlGetWarningsDefaultValue

    int xmlGetWarningsDefaultValue;

DEPRECATED: Don't use Global setting, indicate that the DTD validation should provide warnings. Activated by default.

### Variable xmlIndentTreeOutput

    int xmlIndentTreeOutput;

Global setting, asking the serializer to indent the output tree by default Enabled by default

### Variable xmlKeepBlanksDefaultValue

    int xmlKeepBlanksDefaultValue;

DEPRECATED: Use the modern options API with XML_PARSE_NOBLANKS. 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.

### Variable xmlLastError

    xmlError xmlLastError;

### Variable xmlLineNumbersDefaultValue

    int xmlLineNumbersDefaultValue;

DEPRECATED: The modern options API always enables line numbers. 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 application.

### Variable xmlLoadExtDtdDefaultValue

    int xmlLoadExtDtdDefaultValue;

DEPRECATED: Use the modern options API with XML_PARSE_DTDLOAD. Global setting, indicate that the parser should load DTD while not validating. Disabled by default.

### Variable xmlMalloc

    xmlMallocFunc 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

### Variable xmlMallocAtomic

    xmlMallocFunc xmlMallocAtomic;

@size: the size requested in bytes The variable holding the libxml malloc() implementation for atomic data (i.e. blocks not containing pointers), useful when using a garbage collecting allocator. Returns a pointer to the newly allocated block or NULL in case of error

### Variable xmlMemStrdup

    xmlStrdupFunc 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

### Variable xmlOutputBufferCreateFilenameValue

    xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;

DEPRECATED: Don't use

### Variable xmlParserDebugEntities

    int xmlParserDebugEntities;

DEPRECATED: Don't use Global setting, asking the parser to print out debugging information. while handling entities. Disabled by default

### Variable xmlParserInputBufferCreateFilenameValue

    xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;

DEPRECATED: Don't use

### Variable xmlParserVersion

    const char * xmlParserVersion;

Constant string describing the internal version of the library

### Variable xmlPedanticParserDefaultValue

    int xmlPedanticParserDefaultValue;

DEPRECATED: Use the modern options API with XML_PARSE_PEDANTIC. Global setting, indicate that the parser be pedantic Disabled by default.

### Variable xmlRealloc

    xmlReallocFunc 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

### Variable xmlRegisterNodeDefaultValue

    xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;

DEPRECATED: Don't use

### Variable xmlSaveNoEmptyTags

    int xmlSaveNoEmptyTags;

Global setting, asking the serializer to not output empty tags as <empty/> but <empty></empty>. those two forms are indistinguishable once parsed. Disabled by default

### Variable xmlStructuredError

    xmlStructuredErrorFunc xmlStructuredError;

Global setting: function used for structured error callbacks

### Variable xmlStructuredErrorContext

    void * xmlStructuredErrorContext;

Global setting passed to structured error callbacks

### Variable xmlSubstituteEntitiesDefaultValue

    int xmlSubstituteEntitiesDefaultValue;

DEPRECATED: Use the modern options API with XML_PARSE_NOENT. 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.

### Variable xmlTreeIndentString

    const char * xmlTreeIndentString;

The string used to do one-level indent. By default is equal to " " (two spaces)

### xmlCleanupGlobals ()

    void	xmlCleanupGlobals		(void)

DEPRECATED: This function is a no-op. Call xmlCleanupParser 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.

### xmlDeregisterNodeDefault ()

    xmlDeregisterNodeFunc	xmlDeregisterNodeDefault	(xmlDeregisterNodeFunc func)

Registers a callback for node destruction

`func`: | function pointer to the new DeregisterNodeFunc
`Returns`: | the previous value of the deregistration function

### xmlInitGlobals ()

    void	xmlInitGlobals			(void)

DEPRECATED: Alias for xmlInitParser.

### xmlInitializeGlobalState ()

    void	xmlInitializeGlobalState	(xmlGlobalStatePtr gs)

xmlInitializeGlobalState() initialize a global state with all the default values of the library.

`gs`: | a pointer to a newly allocated global state

### xmlOutputBufferCreateFilenameDefault ()

    xmlOutputBufferCreateFilenameFunc	xmlOutputBufferCreateFilenameDefault	(xmlOutputBufferCreateFilenameFunc func)

Registers a callback for URI output file handling

`func`: | function pointer to the new OutputBufferCreateFilenameFunc
`Returns`: | the old value of the registration function

### xmlParserInputBufferCreateFilenameDefault ()

    xmlParserInputBufferCreateFilenameFunc	xmlParserInputBufferCreateFilenameDefault	(xmlParserInputBufferCreateFilenameFunc func)

Registers a callback for URI input file handling

`func`: | function pointer to the new ParserInputBufferCreateFilenameFunc
`Returns`: | the old value of the registration function

### xmlRegisterNodeDefault ()

    xmlRegisterNodeFunc	xmlRegisterNodeDefault	(xmlRegisterNodeFunc func)

Registers a callback for node creation

`func`: | function pointer to the new RegisterNodeFunc
`Returns`: | the old value of the registration function

### xmlThrDefBufferAllocScheme ()

    xmlBufferAllocationScheme	xmlThrDefBufferAllocScheme	(xmlBufferAllocationScheme v)

`v`: |
`Returns`: |

### xmlThrDefDefaultBufferSize ()

    int	xmlThrDefDefaultBufferSize	(int v)

`v`: |
`Returns`: |

### xmlThrDefDeregisterNodeDefault ()

    xmlDeregisterNodeFunc	xmlThrDefDeregisterNodeDefault	(xmlDeregisterNodeFunc func)

`func`: |
`Returns`: |

### xmlThrDefDoValidityCheckingDefaultValue ()

    int	xmlThrDefDoValidityCheckingDefaultValue	(int v)

`v`: |
`Returns`: |

### xmlThrDefGetWarningsDefaultValue ()

    int	xmlThrDefGetWarningsDefaultValue	(int v)

`v`: |
`Returns`: |

### xmlThrDefIndentTreeOutput ()

    int	xmlThrDefIndentTreeOutput	(int v)

`v`: |
`Returns`: |

### xmlThrDefKeepBlanksDefaultValue ()

    int	xmlThrDefKeepBlanksDefaultValue	(int v)

`v`: |
`Returns`: |

### xmlThrDefLineNumbersDefaultValue ()

    int	xmlThrDefLineNumbersDefaultValue	(int v)

`v`: |
`Returns`: |

### xmlThrDefLoadExtDtdDefaultValue ()

    int	xmlThrDefLoadExtDtdDefaultValue	(int v)

`v`: |
`Returns`: |

### xmlThrDefOutputBufferCreateFilenameDefault ()

    xmlOutputBufferCreateFilenameFunc	xmlThrDefOutputBufferCreateFilenameDefault	(xmlOutputBufferCreateFilenameFunc func)

`func`: |
`Returns`: |

### xmlThrDefParserDebugEntities ()

    int	xmlThrDefParserDebugEntities	(int v)

`v`: |
`Returns`: |

### xmlThrDefParserInputBufferCreateFilenameDefault ()

    xmlParserInputBufferCreateFilenameFunc	xmlThrDefParserInputBufferCreateFilenameDefault	(xmlParserInputBufferCreateFilenameFunc func)

`func`: |
`Returns`: |

### xmlThrDefPedanticParserDefaultValue ()

    int	xmlThrDefPedanticParserDefaultValue	(int v)

`v`: |
`Returns`: |

### xmlThrDefRegisterNodeDefault ()

    xmlRegisterNodeFunc	xmlThrDefRegisterNodeDefault	(xmlRegisterNodeFunc func)

`func`: |
`Returns`: |

### xmlThrDefSaveNoEmptyTags ()

    int	xmlThrDefSaveNoEmptyTags	(int v)

`v`: |
`Returns`: |

### xmlThrDefSetGenericErrorFunc ()

    void	xmlThrDefSetGenericErrorFunc	(void * ctx,
    					 xmlGenericErrorFunc handler)

`ctx`: |
`handler`: |

### xmlThrDefSetStructuredErrorFunc ()

    void	xmlThrDefSetStructuredErrorFunc	(void * ctx,
    					 xmlStructuredErrorFunc handler)

`ctx`: |
`handler`: |

### xmlThrDefSubstituteEntitiesDefaultValue ()

    int	xmlThrDefSubstituteEntitiesDefaultValue	(int v)

`v`: |
`Returns`: |

### xmlThrDefTreeIndentString ()

    const char *	xmlThrDefTreeIndentString	(const char * v)

`v`: |
`Returns`: |