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();
56 * Additional cleanup for multi-threading
58 void xmlCleanupGlobals(void)
60 if (xmlThrDefMutex
!= NULL
) {
61 xmlFreeMutex(xmlThrDefMutex
);
62 xmlThrDefMutex
= NULL
;
64 __xmlGlobalInitMutexDestroy();
67 /************************************************************************
69 * All the user accessible global variables of the library *
71 ************************************************************************/
74 * Memory allocation routines
78 #undef xmlMallocAtomic
82 #if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY)
83 xmlFreeFunc xmlFree
= (xmlFreeFunc
) xmlMemFree
;
84 xmlMallocFunc xmlMalloc
= (xmlMallocFunc
) xmlMemMalloc
;
85 xmlMallocFunc xmlMallocAtomic
= (xmlMallocFunc
) xmlMemMalloc
;
86 xmlReallocFunc xmlRealloc
= (xmlReallocFunc
) xmlMemRealloc
;
87 xmlStrdupFunc xmlMemStrdup
= (xmlStrdupFunc
) xmlMemoryStrdup
;
90 #define MAX_LIBXML_MALLOC (1024*1024*512)
92 static void* size_checked_malloc(size_t size
) {
93 if (size
> MAX_LIBXML_MALLOC
) {
94 *(volatile char*)0 = '\0';
100 static void* size_checked_realloc(void* ptr
, size_t size
) {
101 if (size
> MAX_LIBXML_MALLOC
) {
102 *(volatile char*)0 = '\0';
105 return realloc(ptr
, size
);
110 * @mem: an already allocated block of memory
112 * The variable holding the libxml free() implementation
114 xmlFreeFunc xmlFree
= (xmlFreeFunc
) free
;
117 * @size: the size requested in bytes
119 * The variable holding the libxml malloc() implementation
121 * Returns a pointer to the newly allocated block or NULL in case of error
123 xmlMallocFunc xmlMalloc
= (xmlMallocFunc
) size_checked_malloc
;
126 * @size: the size requested in bytes
128 * The variable holding the libxml malloc() implementation for atomic
129 * data (i.e. blocks not containings pointers), useful when using a
130 * garbage collecting allocator.
132 * Returns a pointer to the newly allocated block or NULL in case of error
134 xmlMallocFunc xmlMallocAtomic
= (xmlMallocFunc
) size_checked_malloc
;
137 * @mem: an already allocated block of memory
138 * @size: the new size requested in bytes
140 * The variable holding the libxml realloc() implementation
142 * Returns a pointer to the newly reallocated block or NULL in case of error
144 xmlReallocFunc xmlRealloc
= (xmlReallocFunc
) size_checked_realloc
;
147 * @str: a zero terminated string
149 * The variable holding the libxml strdup() implementation
151 * Returns the copy of the string or NULL in case of error
153 xmlStrdupFunc xmlMemStrdup
= (xmlStrdupFunc
) xmlStrdup
;
154 #endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */
156 #include <libxml/threads.h>
157 #include <libxml/globals.h>
158 #include <libxml/SAX.h>
160 #undef docbDefaultSAXHandler
161 #undef htmlDefaultSAXHandler
162 #undef oldXMLWDcompatibility
163 #undef xmlBufferAllocScheme
164 #undef xmlDefaultBufferSize
165 #undef xmlDefaultSAXHandler
166 #undef xmlDefaultSAXLocator
167 #undef xmlDoValidityCheckingDefaultValue
168 #undef xmlGenericError
169 #undef xmlStructuredError
170 #undef xmlGenericErrorContext
171 #undef xmlStructuredErrorContext
172 #undef xmlGetWarningsDefaultValue
173 #undef xmlIndentTreeOutput
174 #undef xmlTreeIndentString
175 #undef xmlKeepBlanksDefaultValue
176 #undef xmlLineNumbersDefaultValue
177 #undef xmlLoadExtDtdDefaultValue
178 #undef xmlParserDebugEntities
179 #undef xmlParserVersion
180 #undef xmlPedanticParserDefaultValue
181 #undef xmlSaveNoEmptyTags
182 #undef xmlSubstituteEntitiesDefaultValue
183 #undef xmlRegisterNodeDefaultValue
184 #undef xmlDeregisterNodeDefaultValue
187 #undef xmlParserInputBufferCreateFilenameValue
188 #undef xmlOutputBufferCreateFilenameValue
192 * Constant string describing the internal version of the library
194 const char *xmlParserVersion
= LIBXML_VERSION_STRING LIBXML_VERSION_EXTRA
;
197 * xmlBufferAllocScheme:
199 * Global setting, default allocation policy for buffers, default is
200 * XML_BUFFER_ALLOC_EXACT
202 xmlBufferAllocationScheme xmlBufferAllocScheme
= XML_BUFFER_ALLOC_EXACT
;
203 static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef
= XML_BUFFER_ALLOC_EXACT
;
205 * xmlDefaultBufferSize:
207 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
209 int xmlDefaultBufferSize
= BASE_BUFFER_SIZE
;
210 static int xmlDefaultBufferSizeThrDef
= BASE_BUFFER_SIZE
;
217 * oldXMLWDcompatibility:
219 * Global setting, DEPRECATED.
221 int oldXMLWDcompatibility
= 0; /* DEPRECATED */
223 * xmlParserDebugEntities:
225 * Global setting, asking the parser to print out debugging informations.
226 * while handling entities.
227 * Disabled by default
229 int xmlParserDebugEntities
= 0;
230 static int xmlParserDebugEntitiesThrDef
= 0;
232 * xmlDoValidityCheckingDefaultValue:
234 * Global setting, indicate that the parser should work in validating mode.
235 * Disabled by default.
237 int xmlDoValidityCheckingDefaultValue
= 0;
238 static int xmlDoValidityCheckingDefaultValueThrDef
= 0;
240 * xmlGetWarningsDefaultValue:
242 * Global setting, indicate that the parser should provide warnings.
243 * Activated by default.
245 int xmlGetWarningsDefaultValue
= 1;
246 static int xmlGetWarningsDefaultValueThrDef
= 1;
248 * xmlLoadExtDtdDefaultValue:
250 * Global setting, indicate that the parser should load DTD while not
252 * Disabled by default.
254 int xmlLoadExtDtdDefaultValue
= 0;
255 static int xmlLoadExtDtdDefaultValueThrDef
= 0;
257 * xmlPedanticParserDefaultValue:
259 * Global setting, indicate that the parser be pedantic
260 * Disabled by default.
262 int xmlPedanticParserDefaultValue
= 0;
263 static int xmlPedanticParserDefaultValueThrDef
= 0;
265 * xmlLineNumbersDefaultValue:
267 * Global setting, indicate that the parser should store the line number
268 * in the content field of elements in the DOM tree.
269 * Disabled by default since this may not be safe for old classes of
272 int xmlLineNumbersDefaultValue
= 0;
273 static int xmlLineNumbersDefaultValueThrDef
= 0;
275 * xmlKeepBlanksDefaultValue:
277 * Global setting, indicate that the parser should keep all blanks
278 * nodes found in the content
279 * Activated by default, this is actually needed to have the parser
280 * conformant to the XML Recommendation, however the option is kept
281 * for some applications since this was libxml1 default behaviour.
283 int xmlKeepBlanksDefaultValue
= 1;
284 static int xmlKeepBlanksDefaultValueThrDef
= 1;
286 * xmlSubstituteEntitiesDefaultValue:
288 * Global setting, indicate that the parser should not generate entity
289 * references but replace them with the actual content of the entity
290 * Disabled by default, this should be activated when using XPath since
291 * the XPath data model requires entities replacement and the XPath
292 * engine does not handle entities references transparently.
294 int xmlSubstituteEntitiesDefaultValue
= 0;
295 static int xmlSubstituteEntitiesDefaultValueThrDef
= 0;
297 xmlRegisterNodeFunc xmlRegisterNodeDefaultValue
= NULL
;
298 static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef
= NULL
;
299 xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue
= NULL
;
300 static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef
= NULL
;
302 xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue
= NULL
;
303 static xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValueThrDef
= NULL
;
305 xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue
= NULL
;
306 static xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValueThrDef
= NULL
;
312 /* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
313 /* Must initialize xmlGenericError in xmlInitParser */
314 void XMLCDECL
xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED
,
320 * Global setting: function used for generic error callbacks
322 xmlGenericErrorFunc xmlGenericError
= xmlGenericErrorDefaultFunc
;
323 static xmlGenericErrorFunc xmlGenericErrorThrDef
= xmlGenericErrorDefaultFunc
;
325 * xmlStructuredError:
327 * Global setting: function used for structured error callbacks
329 xmlStructuredErrorFunc xmlStructuredError
= NULL
;
330 static xmlStructuredErrorFunc xmlStructuredErrorThrDef
= NULL
;
332 * xmlGenericErrorContext:
334 * Global setting passed to generic error callbacks
336 void *xmlGenericErrorContext
= NULL
;
337 static void *xmlGenericErrorContextThrDef
= NULL
;
339 * xmlStructuredErrorContext:
341 * Global setting passed to structured error callbacks
343 void *xmlStructuredErrorContext
= NULL
;
344 static void *xmlStructuredErrorContextThrDef
= NULL
;
345 xmlError xmlLastError
;
351 * xmlIndentTreeOutput:
353 * Global setting, asking the serializer to indent the output tree by default
356 int xmlIndentTreeOutput
= 1;
357 static int xmlIndentTreeOutputThrDef
= 1;
360 * xmlTreeIndentString:
362 * The string used to do one-level indent. By default is equal to " " (two spaces)
364 const char *xmlTreeIndentString
= " ";
365 static const char *xmlTreeIndentStringThrDef
= " ";
368 * xmlSaveNoEmptyTags:
370 * Global setting, asking the serializer to not output empty tags
371 * as <empty/> but <empty></empty>. those two forms are undistinguishable
373 * Disabled by default
375 int xmlSaveNoEmptyTags
= 0;
376 static int xmlSaveNoEmptyTagsThrDef
= 0;
378 #ifdef LIBXML_SAX1_ENABLED
380 * xmlDefaultSAXHandler:
382 * Default SAX version1 handler for XML, builds the DOM tree
384 xmlSAXHandlerV1 xmlDefaultSAXHandler
= {
385 xmlSAX2InternalSubset
,
387 xmlSAX2HasInternalSubset
,
388 xmlSAX2HasExternalSubset
,
389 xmlSAX2ResolveEntity
,
393 xmlSAX2AttributeDecl
,
395 xmlSAX2UnparsedEntityDecl
,
396 xmlSAX2SetDocumentLocator
,
397 xmlSAX2StartDocument
,
404 xmlSAX2ProcessingInstruction
,
409 xmlSAX2GetParameterEntity
,
411 xmlSAX2ExternalSubset
,
414 #endif /* LIBXML_SAX1_ENABLED */
417 * xmlDefaultSAXLocator:
419 * The default SAX Locator
420 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
422 xmlSAXLocator xmlDefaultSAXLocator
= {
425 xmlSAX2GetLineNumber
,
426 xmlSAX2GetColumnNumber
429 #ifdef LIBXML_HTML_ENABLED
431 * htmlDefaultSAXHandler:
433 * Default old SAX v1 handler for HTML, builds the DOM tree
435 xmlSAXHandlerV1 htmlDefaultSAXHandler
= {
436 xmlSAX2InternalSubset
,
447 xmlSAX2SetDocumentLocator
,
448 xmlSAX2StartDocument
,
454 xmlSAX2IgnorableWhitespace
,
455 xmlSAX2ProcessingInstruction
,
460 xmlSAX2GetParameterEntity
,
465 #endif /* LIBXML_HTML_ENABLED */
467 #ifdef LIBXML_DOCB_ENABLED
469 * docbDefaultSAXHandler:
471 * Default old SAX v1 handler for SGML DocBook, builds the DOM tree
473 xmlSAXHandlerV1 docbDefaultSAXHandler
= {
474 xmlSAX2InternalSubset
,
476 xmlSAX2HasInternalSubset
,
477 xmlSAX2HasExternalSubset
,
478 xmlSAX2ResolveEntity
,
485 xmlSAX2SetDocumentLocator
,
486 xmlSAX2StartDocument
,
492 xmlSAX2IgnorableWhitespace
,
498 xmlSAX2GetParameterEntity
,
503 #endif /* LIBXML_DOCB_ENABLED */
506 * xmlInitializeGlobalState:
507 * @gs: a pointer to a newly allocated global state
509 * xmlInitializeGlobalState() initialize a global state with all the
510 * default values of the library.
513 xmlInitializeGlobalState(xmlGlobalStatePtr gs
)
516 fprintf(stderr
, "Initializing globals at %lu for thread %d\n",
517 (unsigned long) gs
, xmlGetThreadId());
521 * Perform initialization as required by libxml
523 if (xmlThrDefMutex
== NULL
)
526 xmlMutexLock(xmlThrDefMutex
);
528 #if defined(LIBXML_DOCB_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
529 initdocbDefaultSAXHandler(&gs
->docbDefaultSAXHandler
);
531 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED)
532 inithtmlDefaultSAXHandler(&gs
->htmlDefaultSAXHandler
);
535 gs
->oldXMLWDcompatibility
= 0;
536 gs
->xmlBufferAllocScheme
= xmlBufferAllocSchemeThrDef
;
537 gs
->xmlDefaultBufferSize
= xmlDefaultBufferSizeThrDef
;
538 #if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_LEGACY_ENABLED)
539 initxmlDefaultSAXHandler(&gs
->xmlDefaultSAXHandler
, 1);
540 #endif /* LIBXML_SAX1_ENABLED */
541 gs
->xmlDefaultSAXLocator
.getPublicId
= xmlSAX2GetPublicId
;
542 gs
->xmlDefaultSAXLocator
.getSystemId
= xmlSAX2GetSystemId
;
543 gs
->xmlDefaultSAXLocator
.getLineNumber
= xmlSAX2GetLineNumber
;
544 gs
->xmlDefaultSAXLocator
.getColumnNumber
= xmlSAX2GetColumnNumber
;
545 gs
->xmlDoValidityCheckingDefaultValue
=
546 xmlDoValidityCheckingDefaultValueThrDef
;
547 #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
548 gs
->xmlFree
= (xmlFreeFunc
) xmlMemFree
;
549 gs
->xmlMalloc
= (xmlMallocFunc
) xmlMemMalloc
;
550 gs
->xmlMallocAtomic
= (xmlMallocFunc
) xmlMemMalloc
;
551 gs
->xmlRealloc
= (xmlReallocFunc
) xmlMemRealloc
;
552 gs
->xmlMemStrdup
= (xmlStrdupFunc
) xmlMemoryStrdup
;
554 gs
->xmlFree
= (xmlFreeFunc
) free
;
555 gs
->xmlMalloc
= (xmlMallocFunc
) malloc
;
556 gs
->xmlMallocAtomic
= (xmlMallocFunc
) malloc
;
557 gs
->xmlRealloc
= (xmlReallocFunc
) realloc
;
558 gs
->xmlMemStrdup
= (xmlStrdupFunc
) xmlStrdup
;
560 gs
->xmlGetWarningsDefaultValue
= xmlGetWarningsDefaultValueThrDef
;
561 gs
->xmlIndentTreeOutput
= xmlIndentTreeOutputThrDef
;
562 gs
->xmlTreeIndentString
= xmlTreeIndentStringThrDef
;
563 gs
->xmlKeepBlanksDefaultValue
= xmlKeepBlanksDefaultValueThrDef
;
564 gs
->xmlLineNumbersDefaultValue
= xmlLineNumbersDefaultValueThrDef
;
565 gs
->xmlLoadExtDtdDefaultValue
= xmlLoadExtDtdDefaultValueThrDef
;
566 gs
->xmlParserDebugEntities
= xmlParserDebugEntitiesThrDef
;
567 gs
->xmlParserVersion
= LIBXML_VERSION_STRING
;
568 gs
->xmlPedanticParserDefaultValue
= xmlPedanticParserDefaultValueThrDef
;
569 gs
->xmlSaveNoEmptyTags
= xmlSaveNoEmptyTagsThrDef
;
570 gs
->xmlSubstituteEntitiesDefaultValue
=
571 xmlSubstituteEntitiesDefaultValueThrDef
;
573 gs
->xmlGenericError
= xmlGenericErrorThrDef
;
574 gs
->xmlStructuredError
= xmlStructuredErrorThrDef
;
575 gs
->xmlGenericErrorContext
= xmlGenericErrorContextThrDef
;
576 gs
->xmlStructuredErrorContext
= xmlStructuredErrorContextThrDef
;
577 gs
->xmlRegisterNodeDefaultValue
= xmlRegisterNodeDefaultValueThrDef
;
578 gs
->xmlDeregisterNodeDefaultValue
= xmlDeregisterNodeDefaultValueThrDef
;
580 gs
->xmlParserInputBufferCreateFilenameValue
= xmlParserInputBufferCreateFilenameValueThrDef
;
581 gs
->xmlOutputBufferCreateFilenameValue
= xmlOutputBufferCreateFilenameValueThrDef
;
582 memset(&gs
->xmlLastError
, 0, sizeof(xmlError
));
584 xmlMutexUnlock(xmlThrDefMutex
);
588 * DOC_DISABLE : we ignore missing doc for the xmlThrDef functions,
589 * those are really internal work
592 xmlThrDefSetGenericErrorFunc(void *ctx
, xmlGenericErrorFunc handler
) {
593 xmlMutexLock(xmlThrDefMutex
);
594 xmlGenericErrorContextThrDef
= ctx
;
596 xmlGenericErrorThrDef
= handler
;
598 xmlGenericErrorThrDef
= xmlGenericErrorDefaultFunc
;
599 xmlMutexUnlock(xmlThrDefMutex
);
603 xmlThrDefSetStructuredErrorFunc(void *ctx
, xmlStructuredErrorFunc handler
) {
604 xmlMutexLock(xmlThrDefMutex
);
605 xmlStructuredErrorContextThrDef
= ctx
;
606 xmlStructuredErrorThrDef
= handler
;
607 xmlMutexUnlock(xmlThrDefMutex
);
611 * xmlRegisterNodeDefault:
612 * @func: function pointer to the new RegisterNodeFunc
614 * Registers a callback for node creation
616 * Returns the old value of the registration function
619 xmlRegisterNodeDefault(xmlRegisterNodeFunc func
)
621 xmlRegisterNodeFunc old
= xmlRegisterNodeDefaultValue
;
623 __xmlRegisterCallbacks
= 1;
624 xmlRegisterNodeDefaultValue
= func
;
629 xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func
)
631 xmlRegisterNodeFunc old
;
633 xmlMutexLock(xmlThrDefMutex
);
634 old
= xmlRegisterNodeDefaultValueThrDef
;
636 __xmlRegisterCallbacks
= 1;
637 xmlRegisterNodeDefaultValueThrDef
= func
;
638 xmlMutexUnlock(xmlThrDefMutex
);
644 * xmlDeregisterNodeDefault:
645 * @func: function pointer to the new DeregisterNodeFunc
647 * Registers a callback for node destruction
649 * Returns the previous value of the deregistration function
651 xmlDeregisterNodeFunc
652 xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func
)
654 xmlDeregisterNodeFunc old
= xmlDeregisterNodeDefaultValue
;
656 __xmlRegisterCallbacks
= 1;
657 xmlDeregisterNodeDefaultValue
= func
;
661 xmlDeregisterNodeFunc
662 xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func
)
664 xmlDeregisterNodeFunc old
;
666 xmlMutexLock(xmlThrDefMutex
);
667 old
= xmlDeregisterNodeDefaultValueThrDef
;
669 __xmlRegisterCallbacks
= 1;
670 xmlDeregisterNodeDefaultValueThrDef
= func
;
671 xmlMutexUnlock(xmlThrDefMutex
);
676 xmlParserInputBufferCreateFilenameFunc
677 xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func
)
679 xmlParserInputBufferCreateFilenameFunc old
;
681 xmlMutexLock(xmlThrDefMutex
);
682 old
= xmlParserInputBufferCreateFilenameValueThrDef
;
684 old
= __xmlParserInputBufferCreateFilename
;
687 xmlParserInputBufferCreateFilenameValueThrDef
= func
;
688 xmlMutexUnlock(xmlThrDefMutex
);
693 xmlOutputBufferCreateFilenameFunc
694 xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func
)
696 xmlOutputBufferCreateFilenameFunc old
;
698 xmlMutexLock(xmlThrDefMutex
);
699 old
= xmlOutputBufferCreateFilenameValueThrDef
;
700 #ifdef LIBXML_OUTPUT_ENABLED
702 old
= __xmlOutputBufferCreateFilename
;
705 xmlOutputBufferCreateFilenameValueThrDef
= func
;
706 xmlMutexUnlock(xmlThrDefMutex
);
711 #ifdef LIBXML_DOCB_ENABLED
712 #undef docbDefaultSAXHandler
714 __docbDefaultSAXHandler(void) {
716 return (&docbDefaultSAXHandler
);
718 return (&xmlGetGlobalState()->docbDefaultSAXHandler
);
722 #ifdef LIBXML_HTML_ENABLED
723 #undef htmlDefaultSAXHandler
725 __htmlDefaultSAXHandler(void) {
727 return (&htmlDefaultSAXHandler
);
729 return (&xmlGetGlobalState()->htmlDefaultSAXHandler
);
735 __xmlLastError(void) {
737 return (&xmlLastError
);
739 return (&xmlGetGlobalState()->xmlLastError
);
743 * The following memory routines were apparently lost at some point,
744 * and were re-inserted at this point on June 10, 2004. Hope it's
745 * the right place for them :-)
747 #if defined(LIBXML_THREAD_ALLOC_ENABLED) && defined(LIBXML_THREAD_ENABLED)
754 return (&xmlGetGlobalState()->xmlMalloc
);
757 #undef xmlMallocAtomic
759 __xmlMallocAtomic(void){
761 return (&xmlMallocAtomic
);
763 return (&xmlGetGlobalState()->xmlMallocAtomic
);
770 return (&xmlRealloc
);
772 return (&xmlGetGlobalState()->xmlRealloc
);
781 return (&xmlGetGlobalState()->xmlFree
);
785 __xmlMemStrdup(void){
787 return (&xmlMemStrdup
);
789 return (&xmlGetGlobalState()->xmlMemStrdup
);
795 * Everything starting from the line below is
796 * Automatically generated by build_glob.py.
797 * Do not modify the previous line.
801 #undef oldXMLWDcompatibility
803 __oldXMLWDcompatibility(void) {
805 return (&oldXMLWDcompatibility
);
807 return (&xmlGetGlobalState()->oldXMLWDcompatibility
);
810 #undef xmlBufferAllocScheme
811 xmlBufferAllocationScheme
*
812 __xmlBufferAllocScheme(void) {
814 return (&xmlBufferAllocScheme
);
816 return (&xmlGetGlobalState()->xmlBufferAllocScheme
);
818 xmlBufferAllocationScheme
xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v
) {
819 xmlBufferAllocationScheme ret
;
820 xmlMutexLock(xmlThrDefMutex
);
821 ret
= xmlBufferAllocSchemeThrDef
;
822 xmlBufferAllocSchemeThrDef
= v
;
823 xmlMutexUnlock(xmlThrDefMutex
);
827 #undef xmlDefaultBufferSize
829 __xmlDefaultBufferSize(void) {
831 return (&xmlDefaultBufferSize
);
833 return (&xmlGetGlobalState()->xmlDefaultBufferSize
);
835 int xmlThrDefDefaultBufferSize(int v
) {
837 xmlMutexLock(xmlThrDefMutex
);
838 ret
= xmlDefaultBufferSizeThrDef
;
839 xmlDefaultBufferSizeThrDef
= v
;
840 xmlMutexUnlock(xmlThrDefMutex
);
844 #ifdef LIBXML_SAX1_ENABLED
845 #undef xmlDefaultSAXHandler
847 __xmlDefaultSAXHandler(void) {
849 return (&xmlDefaultSAXHandler
);
851 return (&xmlGetGlobalState()->xmlDefaultSAXHandler
);
853 #endif /* LIBXML_SAX1_ENABLED */
855 #undef xmlDefaultSAXLocator
857 __xmlDefaultSAXLocator(void) {
859 return (&xmlDefaultSAXLocator
);
861 return (&xmlGetGlobalState()->xmlDefaultSAXLocator
);
864 #undef xmlDoValidityCheckingDefaultValue
866 __xmlDoValidityCheckingDefaultValue(void) {
868 return (&xmlDoValidityCheckingDefaultValue
);
870 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue
);
872 int xmlThrDefDoValidityCheckingDefaultValue(int v
) {
874 xmlMutexLock(xmlThrDefMutex
);
875 ret
= xmlDoValidityCheckingDefaultValueThrDef
;
876 xmlDoValidityCheckingDefaultValueThrDef
= v
;
877 xmlMutexUnlock(xmlThrDefMutex
);
881 #undef xmlGenericError
882 xmlGenericErrorFunc
*
883 __xmlGenericError(void) {
885 return (&xmlGenericError
);
887 return (&xmlGetGlobalState()->xmlGenericError
);
890 #undef xmlStructuredError
891 xmlStructuredErrorFunc
*
892 __xmlStructuredError(void) {
894 return (&xmlStructuredError
);
896 return (&xmlGetGlobalState()->xmlStructuredError
);
899 #undef xmlGenericErrorContext
901 __xmlGenericErrorContext(void) {
903 return (&xmlGenericErrorContext
);
905 return (&xmlGetGlobalState()->xmlGenericErrorContext
);
908 #undef xmlStructuredErrorContext
910 __xmlStructuredErrorContext(void) {
912 return (&xmlStructuredErrorContext
);
914 return (&xmlGetGlobalState()->xmlStructuredErrorContext
);
917 #undef xmlGetWarningsDefaultValue
919 __xmlGetWarningsDefaultValue(void) {
921 return (&xmlGetWarningsDefaultValue
);
923 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue
);
925 int xmlThrDefGetWarningsDefaultValue(int v
) {
927 xmlMutexLock(xmlThrDefMutex
);
928 ret
= xmlGetWarningsDefaultValueThrDef
;
929 xmlGetWarningsDefaultValueThrDef
= v
;
930 xmlMutexUnlock(xmlThrDefMutex
);
934 #undef xmlIndentTreeOutput
936 __xmlIndentTreeOutput(void) {
938 return (&xmlIndentTreeOutput
);
940 return (&xmlGetGlobalState()->xmlIndentTreeOutput
);
942 int xmlThrDefIndentTreeOutput(int v
) {
944 xmlMutexLock(xmlThrDefMutex
);
945 ret
= xmlIndentTreeOutputThrDef
;
946 xmlIndentTreeOutputThrDef
= v
;
947 xmlMutexUnlock(xmlThrDefMutex
);
951 #undef xmlTreeIndentString
953 __xmlTreeIndentString(void) {
955 return (&xmlTreeIndentString
);
957 return (&xmlGetGlobalState()->xmlTreeIndentString
);
959 const char * xmlThrDefTreeIndentString(const char * v
) {
961 xmlMutexLock(xmlThrDefMutex
);
962 ret
= xmlTreeIndentStringThrDef
;
963 xmlTreeIndentStringThrDef
= v
;
964 xmlMutexUnlock(xmlThrDefMutex
);
968 #undef xmlKeepBlanksDefaultValue
970 __xmlKeepBlanksDefaultValue(void) {
972 return (&xmlKeepBlanksDefaultValue
);
974 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue
);
976 int xmlThrDefKeepBlanksDefaultValue(int v
) {
978 xmlMutexLock(xmlThrDefMutex
);
979 ret
= xmlKeepBlanksDefaultValueThrDef
;
980 xmlKeepBlanksDefaultValueThrDef
= v
;
981 xmlMutexUnlock(xmlThrDefMutex
);
985 #undef xmlLineNumbersDefaultValue
987 __xmlLineNumbersDefaultValue(void) {
989 return (&xmlLineNumbersDefaultValue
);
991 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue
);
993 int xmlThrDefLineNumbersDefaultValue(int v
) {
995 xmlMutexLock(xmlThrDefMutex
);
996 ret
= xmlLineNumbersDefaultValueThrDef
;
997 xmlLineNumbersDefaultValueThrDef
= v
;
998 xmlMutexUnlock(xmlThrDefMutex
);
1002 #undef xmlLoadExtDtdDefaultValue
1004 __xmlLoadExtDtdDefaultValue(void) {
1006 return (&xmlLoadExtDtdDefaultValue
);
1008 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue
);
1010 int xmlThrDefLoadExtDtdDefaultValue(int v
) {
1012 xmlMutexLock(xmlThrDefMutex
);
1013 ret
= xmlLoadExtDtdDefaultValueThrDef
;
1014 xmlLoadExtDtdDefaultValueThrDef
= v
;
1015 xmlMutexUnlock(xmlThrDefMutex
);
1019 #undef xmlParserDebugEntities
1021 __xmlParserDebugEntities(void) {
1023 return (&xmlParserDebugEntities
);
1025 return (&xmlGetGlobalState()->xmlParserDebugEntities
);
1027 int xmlThrDefParserDebugEntities(int v
) {
1029 xmlMutexLock(xmlThrDefMutex
);
1030 ret
= xmlParserDebugEntitiesThrDef
;
1031 xmlParserDebugEntitiesThrDef
= v
;
1032 xmlMutexUnlock(xmlThrDefMutex
);
1036 #undef xmlParserVersion
1038 __xmlParserVersion(void) {
1040 return (&xmlParserVersion
);
1042 return (&xmlGetGlobalState()->xmlParserVersion
);
1045 #undef xmlPedanticParserDefaultValue
1047 __xmlPedanticParserDefaultValue(void) {
1049 return (&xmlPedanticParserDefaultValue
);
1051 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue
);
1053 int xmlThrDefPedanticParserDefaultValue(int v
) {
1055 xmlMutexLock(xmlThrDefMutex
);
1056 ret
= xmlPedanticParserDefaultValueThrDef
;
1057 xmlPedanticParserDefaultValueThrDef
= v
;
1058 xmlMutexUnlock(xmlThrDefMutex
);
1062 #undef xmlSaveNoEmptyTags
1064 __xmlSaveNoEmptyTags(void) {
1066 return (&xmlSaveNoEmptyTags
);
1068 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags
);
1070 int xmlThrDefSaveNoEmptyTags(int v
) {
1072 xmlMutexLock(xmlThrDefMutex
);
1073 ret
= xmlSaveNoEmptyTagsThrDef
;
1074 xmlSaveNoEmptyTagsThrDef
= v
;
1075 xmlMutexUnlock(xmlThrDefMutex
);
1079 #undef xmlSubstituteEntitiesDefaultValue
1081 __xmlSubstituteEntitiesDefaultValue(void) {
1083 return (&xmlSubstituteEntitiesDefaultValue
);
1085 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue
);
1087 int xmlThrDefSubstituteEntitiesDefaultValue(int v
) {
1089 xmlMutexLock(xmlThrDefMutex
);
1090 ret
= xmlSubstituteEntitiesDefaultValueThrDef
;
1091 xmlSubstituteEntitiesDefaultValueThrDef
= v
;
1092 xmlMutexUnlock(xmlThrDefMutex
);
1096 #undef xmlRegisterNodeDefaultValue
1097 xmlRegisterNodeFunc
*
1098 __xmlRegisterNodeDefaultValue(void) {
1100 return (&xmlRegisterNodeDefaultValue
);
1102 return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue
);
1105 #undef xmlDeregisterNodeDefaultValue
1106 xmlDeregisterNodeFunc
*
1107 __xmlDeregisterNodeDefaultValue(void) {
1109 return (&xmlDeregisterNodeDefaultValue
);
1111 return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue
);
1114 #undef xmlParserInputBufferCreateFilenameValue
1115 xmlParserInputBufferCreateFilenameFunc
*
1116 __xmlParserInputBufferCreateFilenameValue(void) {
1118 return (&xmlParserInputBufferCreateFilenameValue
);
1120 return (&xmlGetGlobalState()->xmlParserInputBufferCreateFilenameValue
);
1123 #undef xmlOutputBufferCreateFilenameValue
1124 xmlOutputBufferCreateFilenameFunc
*
1125 __xmlOutputBufferCreateFilenameValue(void) {
1127 return (&xmlOutputBufferCreateFilenameValue
);
1129 return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue
);
1132 #define bottom_globals
1133 #include "elfgcchack.h"