2 * globals.c: definition and handling of the set of global variables
5 * The bottom of this file is automatically generated by build_glob.py
6 * based on the description file global.data
8 * See Copyright for the status of this software.
10 * Gary Pennington <Gary.Pennington@uk.sun.com>
22 #include <libxml/globals.h>
23 #include <libxml/xmlmemory.h>
24 #include <libxml/threads.h>
26 /* #define DEBUG_GLOBALS */
31 #ifdef LIBXML_THREAD_ENABLED
32 #define IS_MAIN_THREAD (xmlIsMainThread())
34 #define IS_MAIN_THREAD 1
38 * Mutex to protect "ForNewThreads" variables
40 static xmlMutexPtr xmlThrDefMutex
= NULL
;
45 * Additional initialisation for multi-threading
47 void xmlInitGlobals(void)
49 if (xmlThrDefMutex
== NULL
)
50 xmlThrDefMutex
= xmlNewMutex();
53 /************************************************************************
55 * All the user accessible global variables of the library *
57 ************************************************************************/
60 * Memory allocation routines
64 #undef xmlMallocAtomic
68 #if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY)
69 xmlFreeFunc xmlFree
= (xmlFreeFunc
) xmlMemFree
;
70 xmlMallocFunc xmlMalloc
= (xmlMallocFunc
) xmlMemMalloc
;
71 xmlMallocFunc xmlMallocAtomic
= (xmlMallocFunc
) xmlMemMalloc
;
72 xmlReallocFunc xmlRealloc
= (xmlReallocFunc
) xmlMemRealloc
;
73 xmlStrdupFunc xmlMemStrdup
= (xmlStrdupFunc
) xmlMemoryStrdup
;
77 * @mem: an already allocated block of memory
79 * The variable holding the libxml free() implementation
81 xmlFreeFunc xmlFree
= free
;
84 * @size: the size requested in bytes
86 * The variable holding the libxml malloc() implementation
88 * Returns a pointer to the newly allocated block or NULL in case of error
90 xmlMallocFunc xmlMalloc
= malloc
;
93 * @size: the size requested in bytes
95 * The variable holding the libxml malloc() implementation for atomic
96 * data (i.e. blocks not containing pointers), useful when using a
97 * garbage collecting allocator.
99 * Returns a pointer to the newly allocated block or NULL in case of error
101 xmlMallocFunc xmlMallocAtomic
= malloc
;
104 * @mem: an already allocated block of memory
105 * @size: the new size requested in bytes
107 * The variable holding the libxml realloc() implementation
109 * Returns a pointer to the newly reallocated block or NULL in case of error
111 xmlReallocFunc xmlRealloc
= realloc
;
114 * @cur: the input char *
116 * a strdup implementation with a type signature matching POSIX
118 * Returns a new xmlChar * or NULL
121 xmlPosixStrdup(const char *cur
) {
122 return((char*) xmlCharStrdup(cur
));
126 * @str: a zero terminated string
128 * The variable holding the libxml strdup() implementation
130 * Returns the copy of the string or NULL in case of error
132 xmlStrdupFunc xmlMemStrdup
= xmlPosixStrdup
;
133 #endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */
135 #include <libxml/threads.h>
136 #include <libxml/globals.h>
137 #include <libxml/SAX.h>
139 #undef docbDefaultSAXHandler
140 #undef htmlDefaultSAXHandler
141 #undef oldXMLWDcompatibility
142 #undef xmlBufferAllocScheme
143 #undef xmlDefaultBufferSize
144 #undef xmlDefaultSAXHandler
145 #undef xmlDefaultSAXLocator
146 #undef xmlDoValidityCheckingDefaultValue
147 #undef xmlGenericError
148 #undef xmlStructuredError
149 #undef xmlGenericErrorContext
150 #undef xmlStructuredErrorContext
151 #undef xmlGetWarningsDefaultValue
152 #undef xmlIndentTreeOutput
153 #undef xmlTreeIndentString
154 #undef xmlKeepBlanksDefaultValue
155 #undef xmlLineNumbersDefaultValue
156 #undef xmlLoadExtDtdDefaultValue
157 #undef xmlParserDebugEntities
158 #undef xmlParserVersion
159 #undef xmlPedanticParserDefaultValue
160 #undef xmlSaveNoEmptyTags
161 #undef xmlSubstituteEntitiesDefaultValue
162 #undef xmlRegisterNodeDefaultValue
163 #undef xmlDeregisterNodeDefaultValue
166 #undef xmlParserInputBufferCreateFilenameValue
167 #undef xmlOutputBufferCreateFilenameValue
171 * Constant string describing the internal version of the library
173 const char *xmlParserVersion
= LIBXML_VERSION_STRING LIBXML_VERSION_EXTRA
;
176 * xmlBufferAllocScheme:
178 * Global setting, default allocation policy for buffers, default is
179 * XML_BUFFER_ALLOC_EXACT
181 xmlBufferAllocationScheme xmlBufferAllocScheme
= XML_BUFFER_ALLOC_EXACT
;
182 static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef
= XML_BUFFER_ALLOC_EXACT
;
184 * xmlDefaultBufferSize:
186 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
188 int xmlDefaultBufferSize
= BASE_BUFFER_SIZE
;
189 static int xmlDefaultBufferSizeThrDef
= BASE_BUFFER_SIZE
;
196 * oldXMLWDcompatibility:
198 * Global setting, DEPRECATED.
200 int oldXMLWDcompatibility
= 0; /* DEPRECATED */
202 * xmlParserDebugEntities:
204 * Global setting, asking the parser to print out debugging information.
205 * while handling entities.
206 * Disabled by default
208 int xmlParserDebugEntities
= 0;
209 static int xmlParserDebugEntitiesThrDef
= 0;
211 * xmlDoValidityCheckingDefaultValue:
213 * Global setting, indicate that the parser should work in validating mode.
214 * Disabled by default.
216 int xmlDoValidityCheckingDefaultValue
= 0;
217 static int xmlDoValidityCheckingDefaultValueThrDef
= 0;
219 * xmlGetWarningsDefaultValue:
221 * Global setting, indicate that the parser should provide warnings.
222 * Activated by default.
224 int xmlGetWarningsDefaultValue
= 1;
225 static int xmlGetWarningsDefaultValueThrDef
= 1;
227 * xmlLoadExtDtdDefaultValue:
229 * Global setting, indicate that the parser should load DTD while not
231 * Disabled by default.
233 int xmlLoadExtDtdDefaultValue
= 0;
234 static int xmlLoadExtDtdDefaultValueThrDef
= 0;
236 * xmlPedanticParserDefaultValue:
238 * Global setting, indicate that the parser be pedantic
239 * Disabled by default.
241 int xmlPedanticParserDefaultValue
= 0;
242 static int xmlPedanticParserDefaultValueThrDef
= 0;
244 * xmlLineNumbersDefaultValue:
246 * Global setting, indicate that the parser should store the line number
247 * in the content field of elements in the DOM tree.
248 * Disabled by default since this may not be safe for old classes of
251 int xmlLineNumbersDefaultValue
= 0;
252 static int xmlLineNumbersDefaultValueThrDef
= 0;
254 * xmlKeepBlanksDefaultValue:
256 * Global setting, indicate that the parser should keep all blanks
257 * nodes found in the content
258 * Activated by default, this is actually needed to have the parser
259 * conformant to the XML Recommendation, however the option is kept
260 * for some applications since this was libxml1 default behaviour.
262 int xmlKeepBlanksDefaultValue
= 1;
263 static int xmlKeepBlanksDefaultValueThrDef
= 1;
265 * xmlSubstituteEntitiesDefaultValue:
267 * Global setting, indicate that the parser should not generate entity
268 * references but replace them with the actual content of the entity
269 * Disabled by default, this should be activated when using XPath since
270 * the XPath data model requires entities replacement and the XPath
271 * engine does not handle entities references transparently.
273 int xmlSubstituteEntitiesDefaultValue
= 0;
274 static int xmlSubstituteEntitiesDefaultValueThrDef
= 0;
276 xmlRegisterNodeFunc xmlRegisterNodeDefaultValue
= NULL
;
277 static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef
= NULL
;
278 xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue
= NULL
;
279 static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef
= NULL
;
281 xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue
= NULL
;
282 static xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValueThrDef
= NULL
;
284 xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue
= NULL
;
285 static xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValueThrDef
= NULL
;
291 /* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
292 /* Must initialize xmlGenericError in xmlInitParser */
293 void XMLCDECL
xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED
,
299 * Global setting: function used for generic error callbacks
301 xmlGenericErrorFunc xmlGenericError
= xmlGenericErrorDefaultFunc
;
302 static xmlGenericErrorFunc xmlGenericErrorThrDef
= xmlGenericErrorDefaultFunc
;
304 * xmlStructuredError:
306 * Global setting: function used for structured error callbacks
308 xmlStructuredErrorFunc xmlStructuredError
= NULL
;
309 static xmlStructuredErrorFunc xmlStructuredErrorThrDef
= NULL
;
311 * xmlGenericErrorContext:
313 * Global setting passed to generic error callbacks
315 void *xmlGenericErrorContext
= NULL
;
316 static void *xmlGenericErrorContextThrDef
= NULL
;
318 * xmlStructuredErrorContext:
320 * Global setting passed to structured error callbacks
322 void *xmlStructuredErrorContext
= NULL
;
323 static void *xmlStructuredErrorContextThrDef
= NULL
;
324 xmlError xmlLastError
;
330 * xmlIndentTreeOutput:
332 * Global setting, asking the serializer to indent the output tree by default
335 int xmlIndentTreeOutput
= 1;
336 static int xmlIndentTreeOutputThrDef
= 1;
339 * xmlTreeIndentString:
341 * The string used to do one-level indent. By default is equal to " " (two spaces)
343 const char *xmlTreeIndentString
= " ";
344 static const char *xmlTreeIndentStringThrDef
= " ";
347 * xmlSaveNoEmptyTags:
349 * Global setting, asking the serializer to not output empty tags
350 * as <empty/> but <empty></empty>. those two forms are indistinguishable
352 * Disabled by default
354 int xmlSaveNoEmptyTags
= 0;
355 static int xmlSaveNoEmptyTagsThrDef
= 0;
357 #ifdef LIBXML_SAX1_ENABLED
359 * xmlDefaultSAXHandler:
361 * Default SAX version1 handler for XML, builds the DOM tree
363 xmlSAXHandlerV1 xmlDefaultSAXHandler
= {
364 xmlSAX2InternalSubset
,
366 xmlSAX2HasInternalSubset
,
367 xmlSAX2HasExternalSubset
,
368 xmlSAX2ResolveEntity
,
372 xmlSAX2AttributeDecl
,
374 xmlSAX2UnparsedEntityDecl
,
375 xmlSAX2SetDocumentLocator
,
376 xmlSAX2StartDocument
,
383 xmlSAX2ProcessingInstruction
,
388 xmlSAX2GetParameterEntity
,
390 xmlSAX2ExternalSubset
,
393 #endif /* LIBXML_SAX1_ENABLED */
396 * xmlDefaultSAXLocator:
398 * The default SAX Locator
399 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
401 xmlSAXLocator xmlDefaultSAXLocator
= {
404 xmlSAX2GetLineNumber
,
405 xmlSAX2GetColumnNumber
408 #ifdef LIBXML_HTML_ENABLED
410 * htmlDefaultSAXHandler:
412 * Default old SAX v1 handler for HTML, builds the DOM tree
414 xmlSAXHandlerV1 htmlDefaultSAXHandler
= {
415 xmlSAX2InternalSubset
,
426 xmlSAX2SetDocumentLocator
,
427 xmlSAX2StartDocument
,
433 xmlSAX2IgnorableWhitespace
,
434 xmlSAX2ProcessingInstruction
,
439 xmlSAX2GetParameterEntity
,
444 #endif /* LIBXML_HTML_ENABLED */
446 #ifdef LIBXML_DOCB_ENABLED
448 * docbDefaultSAXHandler:
450 * Default old SAX v1 handler for SGML DocBook, builds the DOM tree
452 xmlSAXHandlerV1 docbDefaultSAXHandler
= {
453 xmlSAX2InternalSubset
,
455 xmlSAX2HasInternalSubset
,
456 xmlSAX2HasExternalSubset
,
457 xmlSAX2ResolveEntity
,
464 xmlSAX2SetDocumentLocator
,
465 xmlSAX2StartDocument
,
471 xmlSAX2IgnorableWhitespace
,
477 xmlSAX2GetParameterEntity
,
482 #endif /* LIBXML_DOCB_ENABLED */
485 * xmlInitializeGlobalState:
486 * @gs: a pointer to a newly allocated global state
488 * xmlInitializeGlobalState() initialize a global state with all the
489 * default values of the library.
492 xmlInitializeGlobalState(xmlGlobalStatePtr gs
)
495 fprintf(stderr
, "Initializing globals at %lu for thread %d\n",
496 (unsigned long) gs
, xmlGetThreadId());
500 * Perform initialization as required by libxml
502 if (xmlThrDefMutex
== NULL
)
505 xmlMutexLock(xmlThrDefMutex
);
507 #if defined(LIBXML_DOCB_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
508 initdocbDefaultSAXHandler(&gs
->docbDefaultSAXHandler
);
510 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
511 inithtmlDefaultSAXHandler(&gs
->htmlDefaultSAXHandler
);
514 gs
->oldXMLWDcompatibility
= 0;
515 gs
->xmlBufferAllocScheme
= xmlBufferAllocSchemeThrDef
;
516 gs
->xmlDefaultBufferSize
= xmlDefaultBufferSizeThrDef
;
517 #if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_LEGACY_ENABLED)
518 initxmlDefaultSAXHandler(&gs
->xmlDefaultSAXHandler
, 1);
519 #endif /* LIBXML_SAX1_ENABLED */
520 gs
->xmlDefaultSAXLocator
.getPublicId
= xmlSAX2GetPublicId
;
521 gs
->xmlDefaultSAXLocator
.getSystemId
= xmlSAX2GetSystemId
;
522 gs
->xmlDefaultSAXLocator
.getLineNumber
= xmlSAX2GetLineNumber
;
523 gs
->xmlDefaultSAXLocator
.getColumnNumber
= xmlSAX2GetColumnNumber
;
524 gs
->xmlDoValidityCheckingDefaultValue
=
525 xmlDoValidityCheckingDefaultValueThrDef
;
526 #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
527 gs
->xmlFree
= (xmlFreeFunc
) xmlMemFree
;
528 gs
->xmlMalloc
= (xmlMallocFunc
) xmlMemMalloc
;
529 gs
->xmlMallocAtomic
= (xmlMallocFunc
) xmlMemMalloc
;
530 gs
->xmlRealloc
= (xmlReallocFunc
) xmlMemRealloc
;
531 gs
->xmlMemStrdup
= (xmlStrdupFunc
) xmlMemoryStrdup
;
533 gs
->xmlFree
= (xmlFreeFunc
) free
;
534 gs
->xmlMalloc
= (xmlMallocFunc
) malloc
;
535 gs
->xmlMallocAtomic
= (xmlMallocFunc
) malloc
;
536 gs
->xmlRealloc
= (xmlReallocFunc
) realloc
;
537 gs
->xmlMemStrdup
= (xmlStrdupFunc
) xmlStrdup
;
539 gs
->xmlGetWarningsDefaultValue
= xmlGetWarningsDefaultValueThrDef
;
540 gs
->xmlIndentTreeOutput
= xmlIndentTreeOutputThrDef
;
541 gs
->xmlTreeIndentString
= xmlTreeIndentStringThrDef
;
542 gs
->xmlKeepBlanksDefaultValue
= xmlKeepBlanksDefaultValueThrDef
;
543 gs
->xmlLineNumbersDefaultValue
= xmlLineNumbersDefaultValueThrDef
;
544 gs
->xmlLoadExtDtdDefaultValue
= xmlLoadExtDtdDefaultValueThrDef
;
545 gs
->xmlParserDebugEntities
= xmlParserDebugEntitiesThrDef
;
546 gs
->xmlParserVersion
= LIBXML_VERSION_STRING
;
547 gs
->xmlPedanticParserDefaultValue
= xmlPedanticParserDefaultValueThrDef
;
548 gs
->xmlSaveNoEmptyTags
= xmlSaveNoEmptyTagsThrDef
;
549 gs
->xmlSubstituteEntitiesDefaultValue
=
550 xmlSubstituteEntitiesDefaultValueThrDef
;
552 gs
->xmlGenericError
= xmlGenericErrorThrDef
;
553 gs
->xmlStructuredError
= xmlStructuredErrorThrDef
;
554 gs
->xmlGenericErrorContext
= xmlGenericErrorContextThrDef
;
555 gs
->xmlStructuredErrorContext
= xmlStructuredErrorContextThrDef
;
556 gs
->xmlRegisterNodeDefaultValue
= xmlRegisterNodeDefaultValueThrDef
;
557 gs
->xmlDeregisterNodeDefaultValue
= xmlDeregisterNodeDefaultValueThrDef
;
559 gs
->xmlParserInputBufferCreateFilenameValue
= xmlParserInputBufferCreateFilenameValueThrDef
;
560 gs
->xmlOutputBufferCreateFilenameValue
= xmlOutputBufferCreateFilenameValueThrDef
;
561 memset(&gs
->xmlLastError
, 0, sizeof(xmlError
));
563 xmlMutexUnlock(xmlThrDefMutex
);
569 * Additional cleanup for multi-threading
571 void xmlCleanupGlobals(void)
573 xmlResetError(&xmlLastError
);
575 if (xmlThrDefMutex
!= NULL
) {
576 xmlFreeMutex(xmlThrDefMutex
);
577 xmlThrDefMutex
= NULL
;
579 __xmlGlobalInitMutexDestroy();
583 * DOC_DISABLE : we ignore missing doc for the xmlThrDef functions,
584 * those are really internal work
587 xmlThrDefSetGenericErrorFunc(void *ctx
, xmlGenericErrorFunc handler
) {
588 xmlMutexLock(xmlThrDefMutex
);
589 xmlGenericErrorContextThrDef
= ctx
;
591 xmlGenericErrorThrDef
= handler
;
593 xmlGenericErrorThrDef
= xmlGenericErrorDefaultFunc
;
594 xmlMutexUnlock(xmlThrDefMutex
);
598 xmlThrDefSetStructuredErrorFunc(void *ctx
, xmlStructuredErrorFunc handler
) {
599 xmlMutexLock(xmlThrDefMutex
);
600 xmlStructuredErrorContextThrDef
= ctx
;
601 xmlStructuredErrorThrDef
= handler
;
602 xmlMutexUnlock(xmlThrDefMutex
);
606 * xmlRegisterNodeDefault:
607 * @func: function pointer to the new RegisterNodeFunc
609 * Registers a callback for node creation
611 * Returns the old value of the registration function
614 xmlRegisterNodeDefault(xmlRegisterNodeFunc func
)
616 xmlRegisterNodeFunc old
= xmlRegisterNodeDefaultValue
;
618 __xmlRegisterCallbacks
= 1;
619 xmlRegisterNodeDefaultValue
= func
;
624 xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func
)
626 xmlRegisterNodeFunc old
;
628 xmlMutexLock(xmlThrDefMutex
);
629 old
= xmlRegisterNodeDefaultValueThrDef
;
631 __xmlRegisterCallbacks
= 1;
632 xmlRegisterNodeDefaultValueThrDef
= func
;
633 xmlMutexUnlock(xmlThrDefMutex
);
639 * xmlDeregisterNodeDefault:
640 * @func: function pointer to the new DeregisterNodeFunc
642 * Registers a callback for node destruction
644 * Returns the previous value of the deregistration function
646 xmlDeregisterNodeFunc
647 xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func
)
649 xmlDeregisterNodeFunc old
= xmlDeregisterNodeDefaultValue
;
651 __xmlRegisterCallbacks
= 1;
652 xmlDeregisterNodeDefaultValue
= func
;
656 xmlDeregisterNodeFunc
657 xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func
)
659 xmlDeregisterNodeFunc old
;
661 xmlMutexLock(xmlThrDefMutex
);
662 old
= xmlDeregisterNodeDefaultValueThrDef
;
664 __xmlRegisterCallbacks
= 1;
665 xmlDeregisterNodeDefaultValueThrDef
= func
;
666 xmlMutexUnlock(xmlThrDefMutex
);
671 xmlParserInputBufferCreateFilenameFunc
672 xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func
)
674 xmlParserInputBufferCreateFilenameFunc old
;
676 xmlMutexLock(xmlThrDefMutex
);
677 old
= xmlParserInputBufferCreateFilenameValueThrDef
;
679 old
= __xmlParserInputBufferCreateFilename
;
682 xmlParserInputBufferCreateFilenameValueThrDef
= func
;
683 xmlMutexUnlock(xmlThrDefMutex
);
688 xmlOutputBufferCreateFilenameFunc
689 xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func
)
691 xmlOutputBufferCreateFilenameFunc old
;
693 xmlMutexLock(xmlThrDefMutex
);
694 old
= xmlOutputBufferCreateFilenameValueThrDef
;
695 #ifdef LIBXML_OUTPUT_ENABLED
697 old
= __xmlOutputBufferCreateFilename
;
700 xmlOutputBufferCreateFilenameValueThrDef
= func
;
701 xmlMutexUnlock(xmlThrDefMutex
);
706 #ifdef LIBXML_DOCB_ENABLED
707 #undef docbDefaultSAXHandler
709 __docbDefaultSAXHandler(void) {
711 return (&docbDefaultSAXHandler
);
713 return (&xmlGetGlobalState()->docbDefaultSAXHandler
);
717 #ifdef LIBXML_HTML_ENABLED
718 #undef htmlDefaultSAXHandler
720 __htmlDefaultSAXHandler(void) {
722 return (&htmlDefaultSAXHandler
);
724 return (&xmlGetGlobalState()->htmlDefaultSAXHandler
);
730 __xmlLastError(void) {
732 return (&xmlLastError
);
734 return (&xmlGetGlobalState()->xmlLastError
);
738 * The following memory routines were apparently lost at some point,
739 * and were re-inserted at this point on June 10, 2004. Hope it's
740 * the right place for them :-)
742 #if defined(LIBXML_THREAD_ALLOC_ENABLED) && defined(LIBXML_THREAD_ENABLED)
749 return (&xmlGetGlobalState()->xmlMalloc
);
752 #undef xmlMallocAtomic
754 __xmlMallocAtomic(void){
756 return (&xmlMallocAtomic
);
758 return (&xmlGetGlobalState()->xmlMallocAtomic
);
765 return (&xmlRealloc
);
767 return (&xmlGetGlobalState()->xmlRealloc
);
776 return (&xmlGetGlobalState()->xmlFree
);
780 __xmlMemStrdup(void){
782 return (&xmlMemStrdup
);
784 return (&xmlGetGlobalState()->xmlMemStrdup
);
790 * Everything starting from the line below is
791 * Automatically generated by build_glob.py.
792 * Do not modify the previous line.
796 #undef oldXMLWDcompatibility
798 __oldXMLWDcompatibility(void) {
800 return (&oldXMLWDcompatibility
);
802 return (&xmlGetGlobalState()->oldXMLWDcompatibility
);
805 #undef xmlBufferAllocScheme
806 xmlBufferAllocationScheme
*
807 __xmlBufferAllocScheme(void) {
809 return (&xmlBufferAllocScheme
);
811 return (&xmlGetGlobalState()->xmlBufferAllocScheme
);
813 xmlBufferAllocationScheme
xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v
) {
814 xmlBufferAllocationScheme ret
;
815 xmlMutexLock(xmlThrDefMutex
);
816 ret
= xmlBufferAllocSchemeThrDef
;
817 xmlBufferAllocSchemeThrDef
= v
;
818 xmlMutexUnlock(xmlThrDefMutex
);
822 #undef xmlDefaultBufferSize
824 __xmlDefaultBufferSize(void) {
826 return (&xmlDefaultBufferSize
);
828 return (&xmlGetGlobalState()->xmlDefaultBufferSize
);
830 int xmlThrDefDefaultBufferSize(int v
) {
832 xmlMutexLock(xmlThrDefMutex
);
833 ret
= xmlDefaultBufferSizeThrDef
;
834 xmlDefaultBufferSizeThrDef
= v
;
835 xmlMutexUnlock(xmlThrDefMutex
);
839 #ifdef LIBXML_SAX1_ENABLED
840 #undef xmlDefaultSAXHandler
842 __xmlDefaultSAXHandler(void) {
844 return (&xmlDefaultSAXHandler
);
846 return (&xmlGetGlobalState()->xmlDefaultSAXHandler
);
848 #endif /* LIBXML_SAX1_ENABLED */
850 #undef xmlDefaultSAXLocator
852 __xmlDefaultSAXLocator(void) {
854 return (&xmlDefaultSAXLocator
);
856 return (&xmlGetGlobalState()->xmlDefaultSAXLocator
);
859 #undef xmlDoValidityCheckingDefaultValue
861 __xmlDoValidityCheckingDefaultValue(void) {
863 return (&xmlDoValidityCheckingDefaultValue
);
865 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue
);
867 int xmlThrDefDoValidityCheckingDefaultValue(int v
) {
869 xmlMutexLock(xmlThrDefMutex
);
870 ret
= xmlDoValidityCheckingDefaultValueThrDef
;
871 xmlDoValidityCheckingDefaultValueThrDef
= v
;
872 xmlMutexUnlock(xmlThrDefMutex
);
876 #undef xmlGenericError
877 xmlGenericErrorFunc
*
878 __xmlGenericError(void) {
880 return (&xmlGenericError
);
882 return (&xmlGetGlobalState()->xmlGenericError
);
885 #undef xmlStructuredError
886 xmlStructuredErrorFunc
*
887 __xmlStructuredError(void) {
889 return (&xmlStructuredError
);
891 return (&xmlGetGlobalState()->xmlStructuredError
);
894 #undef xmlGenericErrorContext
896 __xmlGenericErrorContext(void) {
898 return (&xmlGenericErrorContext
);
900 return (&xmlGetGlobalState()->xmlGenericErrorContext
);
903 #undef xmlStructuredErrorContext
905 __xmlStructuredErrorContext(void) {
907 return (&xmlStructuredErrorContext
);
909 return (&xmlGetGlobalState()->xmlStructuredErrorContext
);
912 #undef xmlGetWarningsDefaultValue
914 __xmlGetWarningsDefaultValue(void) {
916 return (&xmlGetWarningsDefaultValue
);
918 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue
);
920 int xmlThrDefGetWarningsDefaultValue(int v
) {
922 xmlMutexLock(xmlThrDefMutex
);
923 ret
= xmlGetWarningsDefaultValueThrDef
;
924 xmlGetWarningsDefaultValueThrDef
= v
;
925 xmlMutexUnlock(xmlThrDefMutex
);
929 #undef xmlIndentTreeOutput
931 __xmlIndentTreeOutput(void) {
933 return (&xmlIndentTreeOutput
);
935 return (&xmlGetGlobalState()->xmlIndentTreeOutput
);
937 int xmlThrDefIndentTreeOutput(int v
) {
939 xmlMutexLock(xmlThrDefMutex
);
940 ret
= xmlIndentTreeOutputThrDef
;
941 xmlIndentTreeOutputThrDef
= v
;
942 xmlMutexUnlock(xmlThrDefMutex
);
946 #undef xmlTreeIndentString
948 __xmlTreeIndentString(void) {
950 return (&xmlTreeIndentString
);
952 return (&xmlGetGlobalState()->xmlTreeIndentString
);
954 const char * xmlThrDefTreeIndentString(const char * v
) {
956 xmlMutexLock(xmlThrDefMutex
);
957 ret
= xmlTreeIndentStringThrDef
;
958 xmlTreeIndentStringThrDef
= v
;
959 xmlMutexUnlock(xmlThrDefMutex
);
963 #undef xmlKeepBlanksDefaultValue
965 __xmlKeepBlanksDefaultValue(void) {
967 return (&xmlKeepBlanksDefaultValue
);
969 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue
);
971 int xmlThrDefKeepBlanksDefaultValue(int v
) {
973 xmlMutexLock(xmlThrDefMutex
);
974 ret
= xmlKeepBlanksDefaultValueThrDef
;
975 xmlKeepBlanksDefaultValueThrDef
= v
;
976 xmlMutexUnlock(xmlThrDefMutex
);
980 #undef xmlLineNumbersDefaultValue
982 __xmlLineNumbersDefaultValue(void) {
984 return (&xmlLineNumbersDefaultValue
);
986 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue
);
988 int xmlThrDefLineNumbersDefaultValue(int v
) {
990 xmlMutexLock(xmlThrDefMutex
);
991 ret
= xmlLineNumbersDefaultValueThrDef
;
992 xmlLineNumbersDefaultValueThrDef
= v
;
993 xmlMutexUnlock(xmlThrDefMutex
);
997 #undef xmlLoadExtDtdDefaultValue
999 __xmlLoadExtDtdDefaultValue(void) {
1001 return (&xmlLoadExtDtdDefaultValue
);
1003 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue
);
1005 int xmlThrDefLoadExtDtdDefaultValue(int v
) {
1007 xmlMutexLock(xmlThrDefMutex
);
1008 ret
= xmlLoadExtDtdDefaultValueThrDef
;
1009 xmlLoadExtDtdDefaultValueThrDef
= v
;
1010 xmlMutexUnlock(xmlThrDefMutex
);
1014 #undef xmlParserDebugEntities
1016 __xmlParserDebugEntities(void) {
1018 return (&xmlParserDebugEntities
);
1020 return (&xmlGetGlobalState()->xmlParserDebugEntities
);
1022 int xmlThrDefParserDebugEntities(int v
) {
1024 xmlMutexLock(xmlThrDefMutex
);
1025 ret
= xmlParserDebugEntitiesThrDef
;
1026 xmlParserDebugEntitiesThrDef
= v
;
1027 xmlMutexUnlock(xmlThrDefMutex
);
1031 #undef xmlParserVersion
1033 __xmlParserVersion(void) {
1035 return (&xmlParserVersion
);
1037 return (&xmlGetGlobalState()->xmlParserVersion
);
1040 #undef xmlPedanticParserDefaultValue
1042 __xmlPedanticParserDefaultValue(void) {
1044 return (&xmlPedanticParserDefaultValue
);
1046 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue
);
1048 int xmlThrDefPedanticParserDefaultValue(int v
) {
1050 xmlMutexLock(xmlThrDefMutex
);
1051 ret
= xmlPedanticParserDefaultValueThrDef
;
1052 xmlPedanticParserDefaultValueThrDef
= v
;
1053 xmlMutexUnlock(xmlThrDefMutex
);
1057 #undef xmlSaveNoEmptyTags
1059 __xmlSaveNoEmptyTags(void) {
1061 return (&xmlSaveNoEmptyTags
);
1063 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags
);
1065 int xmlThrDefSaveNoEmptyTags(int v
) {
1067 xmlMutexLock(xmlThrDefMutex
);
1068 ret
= xmlSaveNoEmptyTagsThrDef
;
1069 xmlSaveNoEmptyTagsThrDef
= v
;
1070 xmlMutexUnlock(xmlThrDefMutex
);
1074 #undef xmlSubstituteEntitiesDefaultValue
1076 __xmlSubstituteEntitiesDefaultValue(void) {
1078 return (&xmlSubstituteEntitiesDefaultValue
);
1080 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue
);
1082 int xmlThrDefSubstituteEntitiesDefaultValue(int v
) {
1084 xmlMutexLock(xmlThrDefMutex
);
1085 ret
= xmlSubstituteEntitiesDefaultValueThrDef
;
1086 xmlSubstituteEntitiesDefaultValueThrDef
= v
;
1087 xmlMutexUnlock(xmlThrDefMutex
);
1091 #undef xmlRegisterNodeDefaultValue
1092 xmlRegisterNodeFunc
* XMLCALL
1093 __xmlRegisterNodeDefaultValue(void) {
1095 return (&xmlRegisterNodeDefaultValue
);
1097 return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue
);
1100 #undef xmlDeregisterNodeDefaultValue
1101 xmlDeregisterNodeFunc
* XMLCALL
1102 __xmlDeregisterNodeDefaultValue(void) {
1104 return (&xmlDeregisterNodeDefaultValue
);
1106 return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue
);
1109 #undef xmlParserInputBufferCreateFilenameValue
1110 xmlParserInputBufferCreateFilenameFunc
* XMLCALL
1111 __xmlParserInputBufferCreateFilenameValue(void) {
1113 return (&xmlParserInputBufferCreateFilenameValue
);
1115 return (&xmlGetGlobalState()->xmlParserInputBufferCreateFilenameValue
);
1118 #undef xmlOutputBufferCreateFilenameValue
1119 xmlOutputBufferCreateFilenameFunc
* XMLCALL
1120 __xmlOutputBufferCreateFilenameValue(void) {
1122 return (&xmlOutputBufferCreateFilenameValue
);
1124 return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue
);
1127 #define bottom_globals
1128 #include "elfgcchack.h"