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
;
91 * @mem: an already allocated block of memory
93 * The variable holding the libxml free() implementation
95 xmlFreeFunc xmlFree
= free
;
98 * @size: the size requested in bytes
100 * The variable holding the libxml malloc() implementation
102 * Returns a pointer to the newly allocated block or NULL in case of error
104 xmlMallocFunc xmlMalloc
= malloc
;
107 * @size: the size requested in bytes
109 * The variable holding the libxml malloc() implementation for atomic
110 * data (i.e. blocks not containing pointers), useful when using a
111 * garbage collecting allocator.
113 * Returns a pointer to the newly allocated block or NULL in case of error
115 xmlMallocFunc xmlMallocAtomic
= malloc
;
118 * @mem: an already allocated block of memory
119 * @size: the new size requested in bytes
121 * The variable holding the libxml realloc() implementation
123 * Returns a pointer to the newly reallocated block or NULL in case of error
125 xmlReallocFunc xmlRealloc
= realloc
;
128 * @cur: the input char *
130 * a strdup implementation with a type signature matching POSIX
132 * Returns a new xmlChar * or NULL
135 xmlPosixStrdup(const char *cur
) {
136 return((char*) xmlCharStrdup(cur
));
140 * @str: a zero terminated string
142 * The variable holding the libxml strdup() implementation
144 * Returns the copy of the string or NULL in case of error
146 xmlStrdupFunc xmlMemStrdup
= xmlPosixStrdup
;
147 #endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */
149 #include <libxml/threads.h>
150 #include <libxml/globals.h>
151 #include <libxml/SAX.h>
153 #undef docbDefaultSAXHandler
154 #undef htmlDefaultSAXHandler
155 #undef oldXMLWDcompatibility
156 #undef xmlBufferAllocScheme
157 #undef xmlDefaultBufferSize
158 #undef xmlDefaultSAXHandler
159 #undef xmlDefaultSAXLocator
160 #undef xmlDoValidityCheckingDefaultValue
161 #undef xmlGenericError
162 #undef xmlStructuredError
163 #undef xmlGenericErrorContext
164 #undef xmlStructuredErrorContext
165 #undef xmlGetWarningsDefaultValue
166 #undef xmlIndentTreeOutput
167 #undef xmlTreeIndentString
168 #undef xmlKeepBlanksDefaultValue
169 #undef xmlLineNumbersDefaultValue
170 #undef xmlLoadExtDtdDefaultValue
171 #undef xmlParserDebugEntities
172 #undef xmlParserVersion
173 #undef xmlPedanticParserDefaultValue
174 #undef xmlSaveNoEmptyTags
175 #undef xmlSubstituteEntitiesDefaultValue
176 #undef xmlRegisterNodeDefaultValue
177 #undef xmlDeregisterNodeDefaultValue
180 #undef xmlParserInputBufferCreateFilenameValue
181 #undef xmlOutputBufferCreateFilenameValue
185 * Constant string describing the internal version of the library
187 const char *xmlParserVersion
= LIBXML_VERSION_STRING LIBXML_VERSION_EXTRA
;
190 * xmlBufferAllocScheme:
192 * Global setting, default allocation policy for buffers, default is
193 * XML_BUFFER_ALLOC_EXACT
195 xmlBufferAllocationScheme xmlBufferAllocScheme
= XML_BUFFER_ALLOC_EXACT
;
196 static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef
= XML_BUFFER_ALLOC_EXACT
;
198 * xmlDefaultBufferSize:
200 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
202 int xmlDefaultBufferSize
= BASE_BUFFER_SIZE
;
203 static int xmlDefaultBufferSizeThrDef
= BASE_BUFFER_SIZE
;
210 * oldXMLWDcompatibility:
212 * Global setting, DEPRECATED.
214 int oldXMLWDcompatibility
= 0; /* DEPRECATED */
216 * xmlParserDebugEntities:
218 * Global setting, asking the parser to print out debugging information.
219 * while handling entities.
220 * Disabled by default
222 int xmlParserDebugEntities
= 0;
223 static int xmlParserDebugEntitiesThrDef
= 0;
225 * xmlDoValidityCheckingDefaultValue:
227 * Global setting, indicate that the parser should work in validating mode.
228 * Disabled by default.
230 int xmlDoValidityCheckingDefaultValue
= 0;
231 static int xmlDoValidityCheckingDefaultValueThrDef
= 0;
233 * xmlGetWarningsDefaultValue:
235 * Global setting, indicate that the parser should provide warnings.
236 * Activated by default.
238 int xmlGetWarningsDefaultValue
= 1;
239 static int xmlGetWarningsDefaultValueThrDef
= 1;
241 * xmlLoadExtDtdDefaultValue:
243 * Global setting, indicate that the parser should load DTD while not
245 * Disabled by default.
247 int xmlLoadExtDtdDefaultValue
= 0;
248 static int xmlLoadExtDtdDefaultValueThrDef
= 0;
250 * xmlPedanticParserDefaultValue:
252 * Global setting, indicate that the parser be pedantic
253 * Disabled by default.
255 int xmlPedanticParserDefaultValue
= 0;
256 static int xmlPedanticParserDefaultValueThrDef
= 0;
258 * xmlLineNumbersDefaultValue:
260 * Global setting, indicate that the parser should store the line number
261 * in the content field of elements in the DOM tree.
262 * Disabled by default since this may not be safe for old classes of
265 int xmlLineNumbersDefaultValue
= 0;
266 static int xmlLineNumbersDefaultValueThrDef
= 0;
268 * xmlKeepBlanksDefaultValue:
270 * Global setting, indicate that the parser should keep all blanks
271 * nodes found in the content
272 * Activated by default, this is actually needed to have the parser
273 * conformant to the XML Recommendation, however the option is kept
274 * for some applications since this was libxml1 default behaviour.
276 int xmlKeepBlanksDefaultValue
= 1;
277 static int xmlKeepBlanksDefaultValueThrDef
= 1;
279 * xmlSubstituteEntitiesDefaultValue:
281 * Global setting, indicate that the parser should not generate entity
282 * references but replace them with the actual content of the entity
283 * Disabled by default, this should be activated when using XPath since
284 * the XPath data model requires entities replacement and the XPath
285 * engine does not handle entities references transparently.
287 int xmlSubstituteEntitiesDefaultValue
= 0;
288 static int xmlSubstituteEntitiesDefaultValueThrDef
= 0;
290 xmlRegisterNodeFunc xmlRegisterNodeDefaultValue
= NULL
;
291 static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef
= NULL
;
292 xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue
= NULL
;
293 static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef
= NULL
;
295 xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue
= NULL
;
296 static xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValueThrDef
= NULL
;
298 xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue
= NULL
;
299 static xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValueThrDef
= NULL
;
305 /* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
306 /* Must initialize xmlGenericError in xmlInitParser */
307 void XMLCDECL
xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED
,
313 * Global setting: function used for generic error callbacks
315 xmlGenericErrorFunc xmlGenericError
= xmlGenericErrorDefaultFunc
;
316 static xmlGenericErrorFunc xmlGenericErrorThrDef
= xmlGenericErrorDefaultFunc
;
318 * xmlStructuredError:
320 * Global setting: function used for structured error callbacks
322 xmlStructuredErrorFunc xmlStructuredError
= NULL
;
323 static xmlStructuredErrorFunc xmlStructuredErrorThrDef
= NULL
;
325 * xmlGenericErrorContext:
327 * Global setting passed to generic error callbacks
329 void *xmlGenericErrorContext
= NULL
;
330 static void *xmlGenericErrorContextThrDef
= NULL
;
332 * xmlStructuredErrorContext:
334 * Global setting passed to structured error callbacks
336 void *xmlStructuredErrorContext
= NULL
;
337 static void *xmlStructuredErrorContextThrDef
= NULL
;
338 xmlError xmlLastError
;
344 * xmlIndentTreeOutput:
346 * Global setting, asking the serializer to indent the output tree by default
349 int xmlIndentTreeOutput
= 1;
350 static int xmlIndentTreeOutputThrDef
= 1;
353 * xmlTreeIndentString:
355 * The string used to do one-level indent. By default is equal to " " (two spaces)
357 const char *xmlTreeIndentString
= " ";
358 static const char *xmlTreeIndentStringThrDef
= " ";
361 * xmlSaveNoEmptyTags:
363 * Global setting, asking the serializer to not output empty tags
364 * as <empty/> but <empty></empty>. those two forms are indistinguishable
366 * Disabled by default
368 int xmlSaveNoEmptyTags
= 0;
369 static int xmlSaveNoEmptyTagsThrDef
= 0;
371 #ifdef LIBXML_SAX1_ENABLED
373 * xmlDefaultSAXHandler:
375 * Default SAX version1 handler for XML, builds the DOM tree
377 xmlSAXHandlerV1 xmlDefaultSAXHandler
= {
378 xmlSAX2InternalSubset
,
380 xmlSAX2HasInternalSubset
,
381 xmlSAX2HasExternalSubset
,
382 xmlSAX2ResolveEntity
,
386 xmlSAX2AttributeDecl
,
388 xmlSAX2UnparsedEntityDecl
,
389 xmlSAX2SetDocumentLocator
,
390 xmlSAX2StartDocument
,
397 xmlSAX2ProcessingInstruction
,
402 xmlSAX2GetParameterEntity
,
404 xmlSAX2ExternalSubset
,
407 #endif /* LIBXML_SAX1_ENABLED */
410 * xmlDefaultSAXLocator:
412 * The default SAX Locator
413 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
415 xmlSAXLocator xmlDefaultSAXLocator
= {
418 xmlSAX2GetLineNumber
,
419 xmlSAX2GetColumnNumber
422 #ifdef LIBXML_HTML_ENABLED
424 * htmlDefaultSAXHandler:
426 * Default old SAX v1 handler for HTML, builds the DOM tree
428 xmlSAXHandlerV1 htmlDefaultSAXHandler
= {
429 xmlSAX2InternalSubset
,
440 xmlSAX2SetDocumentLocator
,
441 xmlSAX2StartDocument
,
447 xmlSAX2IgnorableWhitespace
,
448 xmlSAX2ProcessingInstruction
,
453 xmlSAX2GetParameterEntity
,
458 #endif /* LIBXML_HTML_ENABLED */
460 #ifdef LIBXML_DOCB_ENABLED
462 * docbDefaultSAXHandler:
464 * Default old SAX v1 handler for SGML DocBook, builds the DOM tree
466 xmlSAXHandlerV1 docbDefaultSAXHandler
= {
467 xmlSAX2InternalSubset
,
469 xmlSAX2HasInternalSubset
,
470 xmlSAX2HasExternalSubset
,
471 xmlSAX2ResolveEntity
,
478 xmlSAX2SetDocumentLocator
,
479 xmlSAX2StartDocument
,
485 xmlSAX2IgnorableWhitespace
,
491 xmlSAX2GetParameterEntity
,
496 #endif /* LIBXML_DOCB_ENABLED */
499 * xmlInitializeGlobalState:
500 * @gs: a pointer to a newly allocated global state
502 * xmlInitializeGlobalState() initialize a global state with all the
503 * default values of the library.
506 xmlInitializeGlobalState(xmlGlobalStatePtr gs
)
509 fprintf(stderr
, "Initializing globals at %lu for thread %d\n",
510 (unsigned long) gs
, xmlGetThreadId());
514 * Perform initialization as required by libxml
516 if (xmlThrDefMutex
== NULL
)
519 xmlMutexLock(xmlThrDefMutex
);
521 #if defined(LIBXML_DOCB_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
522 initdocbDefaultSAXHandler(&gs
->docbDefaultSAXHandler
);
524 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
525 inithtmlDefaultSAXHandler(&gs
->htmlDefaultSAXHandler
);
528 gs
->oldXMLWDcompatibility
= 0;
529 gs
->xmlBufferAllocScheme
= xmlBufferAllocSchemeThrDef
;
530 gs
->xmlDefaultBufferSize
= xmlDefaultBufferSizeThrDef
;
531 #if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_LEGACY_ENABLED)
532 initxmlDefaultSAXHandler(&gs
->xmlDefaultSAXHandler
, 1);
533 #endif /* LIBXML_SAX1_ENABLED */
534 gs
->xmlDefaultSAXLocator
.getPublicId
= xmlSAX2GetPublicId
;
535 gs
->xmlDefaultSAXLocator
.getSystemId
= xmlSAX2GetSystemId
;
536 gs
->xmlDefaultSAXLocator
.getLineNumber
= xmlSAX2GetLineNumber
;
537 gs
->xmlDefaultSAXLocator
.getColumnNumber
= xmlSAX2GetColumnNumber
;
538 gs
->xmlDoValidityCheckingDefaultValue
=
539 xmlDoValidityCheckingDefaultValueThrDef
;
540 #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
541 gs
->xmlFree
= (xmlFreeFunc
) xmlMemFree
;
542 gs
->xmlMalloc
= (xmlMallocFunc
) xmlMemMalloc
;
543 gs
->xmlMallocAtomic
= (xmlMallocFunc
) xmlMemMalloc
;
544 gs
->xmlRealloc
= (xmlReallocFunc
) xmlMemRealloc
;
545 gs
->xmlMemStrdup
= (xmlStrdupFunc
) xmlMemoryStrdup
;
547 gs
->xmlFree
= (xmlFreeFunc
) free
;
548 gs
->xmlMalloc
= (xmlMallocFunc
) malloc
;
549 gs
->xmlMallocAtomic
= (xmlMallocFunc
) malloc
;
550 gs
->xmlRealloc
= (xmlReallocFunc
) realloc
;
551 gs
->xmlMemStrdup
= (xmlStrdupFunc
) xmlStrdup
;
553 gs
->xmlGetWarningsDefaultValue
= xmlGetWarningsDefaultValueThrDef
;
554 gs
->xmlIndentTreeOutput
= xmlIndentTreeOutputThrDef
;
555 gs
->xmlTreeIndentString
= xmlTreeIndentStringThrDef
;
556 gs
->xmlKeepBlanksDefaultValue
= xmlKeepBlanksDefaultValueThrDef
;
557 gs
->xmlLineNumbersDefaultValue
= xmlLineNumbersDefaultValueThrDef
;
558 gs
->xmlLoadExtDtdDefaultValue
= xmlLoadExtDtdDefaultValueThrDef
;
559 gs
->xmlParserDebugEntities
= xmlParserDebugEntitiesThrDef
;
560 gs
->xmlParserVersion
= LIBXML_VERSION_STRING
;
561 gs
->xmlPedanticParserDefaultValue
= xmlPedanticParserDefaultValueThrDef
;
562 gs
->xmlSaveNoEmptyTags
= xmlSaveNoEmptyTagsThrDef
;
563 gs
->xmlSubstituteEntitiesDefaultValue
=
564 xmlSubstituteEntitiesDefaultValueThrDef
;
566 gs
->xmlGenericError
= xmlGenericErrorThrDef
;
567 gs
->xmlStructuredError
= xmlStructuredErrorThrDef
;
568 gs
->xmlGenericErrorContext
= xmlGenericErrorContextThrDef
;
569 gs
->xmlStructuredErrorContext
= xmlStructuredErrorContextThrDef
;
570 gs
->xmlRegisterNodeDefaultValue
= xmlRegisterNodeDefaultValueThrDef
;
571 gs
->xmlDeregisterNodeDefaultValue
= xmlDeregisterNodeDefaultValueThrDef
;
573 gs
->xmlParserInputBufferCreateFilenameValue
= xmlParserInputBufferCreateFilenameValueThrDef
;
574 gs
->xmlOutputBufferCreateFilenameValue
= xmlOutputBufferCreateFilenameValueThrDef
;
575 memset(&gs
->xmlLastError
, 0, sizeof(xmlError
));
577 xmlMutexUnlock(xmlThrDefMutex
);
581 * DOC_DISABLE : we ignore missing doc for the xmlThrDef functions,
582 * those are really internal work
585 xmlThrDefSetGenericErrorFunc(void *ctx
, xmlGenericErrorFunc handler
) {
586 xmlMutexLock(xmlThrDefMutex
);
587 xmlGenericErrorContextThrDef
= ctx
;
589 xmlGenericErrorThrDef
= handler
;
591 xmlGenericErrorThrDef
= xmlGenericErrorDefaultFunc
;
592 xmlMutexUnlock(xmlThrDefMutex
);
596 xmlThrDefSetStructuredErrorFunc(void *ctx
, xmlStructuredErrorFunc handler
) {
597 xmlMutexLock(xmlThrDefMutex
);
598 xmlStructuredErrorContextThrDef
= ctx
;
599 xmlStructuredErrorThrDef
= handler
;
600 xmlMutexUnlock(xmlThrDefMutex
);
604 * xmlRegisterNodeDefault:
605 * @func: function pointer to the new RegisterNodeFunc
607 * Registers a callback for node creation
609 * Returns the old value of the registration function
612 xmlRegisterNodeDefault(xmlRegisterNodeFunc func
)
614 xmlRegisterNodeFunc old
= xmlRegisterNodeDefaultValue
;
616 __xmlRegisterCallbacks
= 1;
617 xmlRegisterNodeDefaultValue
= func
;
622 xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func
)
624 xmlRegisterNodeFunc old
;
626 xmlMutexLock(xmlThrDefMutex
);
627 old
= xmlRegisterNodeDefaultValueThrDef
;
629 __xmlRegisterCallbacks
= 1;
630 xmlRegisterNodeDefaultValueThrDef
= func
;
631 xmlMutexUnlock(xmlThrDefMutex
);
637 * xmlDeregisterNodeDefault:
638 * @func: function pointer to the new DeregisterNodeFunc
640 * Registers a callback for node destruction
642 * Returns the previous value of the deregistration function
644 xmlDeregisterNodeFunc
645 xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func
)
647 xmlDeregisterNodeFunc old
= xmlDeregisterNodeDefaultValue
;
649 __xmlRegisterCallbacks
= 1;
650 xmlDeregisterNodeDefaultValue
= func
;
654 xmlDeregisterNodeFunc
655 xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func
)
657 xmlDeregisterNodeFunc old
;
659 xmlMutexLock(xmlThrDefMutex
);
660 old
= xmlDeregisterNodeDefaultValueThrDef
;
662 __xmlRegisterCallbacks
= 1;
663 xmlDeregisterNodeDefaultValueThrDef
= func
;
664 xmlMutexUnlock(xmlThrDefMutex
);
669 xmlParserInputBufferCreateFilenameFunc
670 xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func
)
672 xmlParserInputBufferCreateFilenameFunc old
;
674 xmlMutexLock(xmlThrDefMutex
);
675 old
= xmlParserInputBufferCreateFilenameValueThrDef
;
677 old
= __xmlParserInputBufferCreateFilename
;
680 xmlParserInputBufferCreateFilenameValueThrDef
= func
;
681 xmlMutexUnlock(xmlThrDefMutex
);
686 xmlOutputBufferCreateFilenameFunc
687 xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func
)
689 xmlOutputBufferCreateFilenameFunc old
;
691 xmlMutexLock(xmlThrDefMutex
);
692 old
= xmlOutputBufferCreateFilenameValueThrDef
;
693 #ifdef LIBXML_OUTPUT_ENABLED
695 old
= __xmlOutputBufferCreateFilename
;
698 xmlOutputBufferCreateFilenameValueThrDef
= func
;
699 xmlMutexUnlock(xmlThrDefMutex
);
704 #ifdef LIBXML_DOCB_ENABLED
705 #undef docbDefaultSAXHandler
707 __docbDefaultSAXHandler(void) {
709 return (&docbDefaultSAXHandler
);
711 return (&xmlGetGlobalState()->docbDefaultSAXHandler
);
715 #ifdef LIBXML_HTML_ENABLED
716 #undef htmlDefaultSAXHandler
718 __htmlDefaultSAXHandler(void) {
720 return (&htmlDefaultSAXHandler
);
722 return (&xmlGetGlobalState()->htmlDefaultSAXHandler
);
728 __xmlLastError(void) {
730 return (&xmlLastError
);
732 return (&xmlGetGlobalState()->xmlLastError
);
736 * The following memory routines were apparently lost at some point,
737 * and were re-inserted at this point on June 10, 2004. Hope it's
738 * the right place for them :-)
740 #if defined(LIBXML_THREAD_ALLOC_ENABLED) && defined(LIBXML_THREAD_ENABLED)
747 return (&xmlGetGlobalState()->xmlMalloc
);
750 #undef xmlMallocAtomic
752 __xmlMallocAtomic(void){
754 return (&xmlMallocAtomic
);
756 return (&xmlGetGlobalState()->xmlMallocAtomic
);
763 return (&xmlRealloc
);
765 return (&xmlGetGlobalState()->xmlRealloc
);
774 return (&xmlGetGlobalState()->xmlFree
);
778 __xmlMemStrdup(void){
780 return (&xmlMemStrdup
);
782 return (&xmlGetGlobalState()->xmlMemStrdup
);
788 * Everything starting from the line below is
789 * Automatically generated by build_glob.py.
790 * Do not modify the previous line.
794 #undef oldXMLWDcompatibility
796 __oldXMLWDcompatibility(void) {
798 return (&oldXMLWDcompatibility
);
800 return (&xmlGetGlobalState()->oldXMLWDcompatibility
);
803 #undef xmlBufferAllocScheme
804 xmlBufferAllocationScheme
*
805 __xmlBufferAllocScheme(void) {
807 return (&xmlBufferAllocScheme
);
809 return (&xmlGetGlobalState()->xmlBufferAllocScheme
);
811 xmlBufferAllocationScheme
xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v
) {
812 xmlBufferAllocationScheme ret
;
813 xmlMutexLock(xmlThrDefMutex
);
814 ret
= xmlBufferAllocSchemeThrDef
;
815 xmlBufferAllocSchemeThrDef
= v
;
816 xmlMutexUnlock(xmlThrDefMutex
);
820 #undef xmlDefaultBufferSize
822 __xmlDefaultBufferSize(void) {
824 return (&xmlDefaultBufferSize
);
826 return (&xmlGetGlobalState()->xmlDefaultBufferSize
);
828 int xmlThrDefDefaultBufferSize(int v
) {
830 xmlMutexLock(xmlThrDefMutex
);
831 ret
= xmlDefaultBufferSizeThrDef
;
832 xmlDefaultBufferSizeThrDef
= v
;
833 xmlMutexUnlock(xmlThrDefMutex
);
837 #ifdef LIBXML_SAX1_ENABLED
838 #undef xmlDefaultSAXHandler
840 __xmlDefaultSAXHandler(void) {
842 return (&xmlDefaultSAXHandler
);
844 return (&xmlGetGlobalState()->xmlDefaultSAXHandler
);
846 #endif /* LIBXML_SAX1_ENABLED */
848 #undef xmlDefaultSAXLocator
850 __xmlDefaultSAXLocator(void) {
852 return (&xmlDefaultSAXLocator
);
854 return (&xmlGetGlobalState()->xmlDefaultSAXLocator
);
857 #undef xmlDoValidityCheckingDefaultValue
859 __xmlDoValidityCheckingDefaultValue(void) {
861 return (&xmlDoValidityCheckingDefaultValue
);
863 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue
);
865 int xmlThrDefDoValidityCheckingDefaultValue(int v
) {
867 xmlMutexLock(xmlThrDefMutex
);
868 ret
= xmlDoValidityCheckingDefaultValueThrDef
;
869 xmlDoValidityCheckingDefaultValueThrDef
= v
;
870 xmlMutexUnlock(xmlThrDefMutex
);
874 #undef xmlGenericError
875 xmlGenericErrorFunc
* XMLCALL
876 __xmlGenericError(void) {
878 return (&xmlGenericError
);
880 return (&xmlGetGlobalState()->xmlGenericError
);
883 #undef xmlStructuredError
884 xmlStructuredErrorFunc
*
885 __xmlStructuredError(void) {
887 return (&xmlStructuredError
);
889 return (&xmlGetGlobalState()->xmlStructuredError
);
892 #undef xmlGenericErrorContext
894 __xmlGenericErrorContext(void) {
896 return (&xmlGenericErrorContext
);
898 return (&xmlGetGlobalState()->xmlGenericErrorContext
);
901 #undef xmlStructuredErrorContext
903 __xmlStructuredErrorContext(void) {
905 return (&xmlStructuredErrorContext
);
907 return (&xmlGetGlobalState()->xmlStructuredErrorContext
);
910 #undef xmlGetWarningsDefaultValue
912 __xmlGetWarningsDefaultValue(void) {
914 return (&xmlGetWarningsDefaultValue
);
916 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue
);
918 int xmlThrDefGetWarningsDefaultValue(int v
) {
920 xmlMutexLock(xmlThrDefMutex
);
921 ret
= xmlGetWarningsDefaultValueThrDef
;
922 xmlGetWarningsDefaultValueThrDef
= v
;
923 xmlMutexUnlock(xmlThrDefMutex
);
927 #undef xmlIndentTreeOutput
929 __xmlIndentTreeOutput(void) {
931 return (&xmlIndentTreeOutput
);
933 return (&xmlGetGlobalState()->xmlIndentTreeOutput
);
935 int xmlThrDefIndentTreeOutput(int v
) {
937 xmlMutexLock(xmlThrDefMutex
);
938 ret
= xmlIndentTreeOutputThrDef
;
939 xmlIndentTreeOutputThrDef
= v
;
940 xmlMutexUnlock(xmlThrDefMutex
);
944 #undef xmlTreeIndentString
946 __xmlTreeIndentString(void) {
948 return (&xmlTreeIndentString
);
950 return (&xmlGetGlobalState()->xmlTreeIndentString
);
952 const char * xmlThrDefTreeIndentString(const char * v
) {
954 xmlMutexLock(xmlThrDefMutex
);
955 ret
= xmlTreeIndentStringThrDef
;
956 xmlTreeIndentStringThrDef
= v
;
957 xmlMutexUnlock(xmlThrDefMutex
);
961 #undef xmlKeepBlanksDefaultValue
963 __xmlKeepBlanksDefaultValue(void) {
965 return (&xmlKeepBlanksDefaultValue
);
967 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue
);
969 int xmlThrDefKeepBlanksDefaultValue(int v
) {
971 xmlMutexLock(xmlThrDefMutex
);
972 ret
= xmlKeepBlanksDefaultValueThrDef
;
973 xmlKeepBlanksDefaultValueThrDef
= v
;
974 xmlMutexUnlock(xmlThrDefMutex
);
978 #undef xmlLineNumbersDefaultValue
980 __xmlLineNumbersDefaultValue(void) {
982 return (&xmlLineNumbersDefaultValue
);
984 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue
);
986 int xmlThrDefLineNumbersDefaultValue(int v
) {
988 xmlMutexLock(xmlThrDefMutex
);
989 ret
= xmlLineNumbersDefaultValueThrDef
;
990 xmlLineNumbersDefaultValueThrDef
= v
;
991 xmlMutexUnlock(xmlThrDefMutex
);
995 #undef xmlLoadExtDtdDefaultValue
997 __xmlLoadExtDtdDefaultValue(void) {
999 return (&xmlLoadExtDtdDefaultValue
);
1001 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue
);
1003 int xmlThrDefLoadExtDtdDefaultValue(int v
) {
1005 xmlMutexLock(xmlThrDefMutex
);
1006 ret
= xmlLoadExtDtdDefaultValueThrDef
;
1007 xmlLoadExtDtdDefaultValueThrDef
= v
;
1008 xmlMutexUnlock(xmlThrDefMutex
);
1012 #undef xmlParserDebugEntities
1014 __xmlParserDebugEntities(void) {
1016 return (&xmlParserDebugEntities
);
1018 return (&xmlGetGlobalState()->xmlParserDebugEntities
);
1020 int xmlThrDefParserDebugEntities(int v
) {
1022 xmlMutexLock(xmlThrDefMutex
);
1023 ret
= xmlParserDebugEntitiesThrDef
;
1024 xmlParserDebugEntitiesThrDef
= v
;
1025 xmlMutexUnlock(xmlThrDefMutex
);
1029 #undef xmlParserVersion
1031 __xmlParserVersion(void) {
1033 return (&xmlParserVersion
);
1035 return (&xmlGetGlobalState()->xmlParserVersion
);
1038 #undef xmlPedanticParserDefaultValue
1040 __xmlPedanticParserDefaultValue(void) {
1042 return (&xmlPedanticParserDefaultValue
);
1044 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue
);
1046 int xmlThrDefPedanticParserDefaultValue(int v
) {
1048 xmlMutexLock(xmlThrDefMutex
);
1049 ret
= xmlPedanticParserDefaultValueThrDef
;
1050 xmlPedanticParserDefaultValueThrDef
= v
;
1051 xmlMutexUnlock(xmlThrDefMutex
);
1055 #undef xmlSaveNoEmptyTags
1057 __xmlSaveNoEmptyTags(void) {
1059 return (&xmlSaveNoEmptyTags
);
1061 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags
);
1063 int xmlThrDefSaveNoEmptyTags(int v
) {
1065 xmlMutexLock(xmlThrDefMutex
);
1066 ret
= xmlSaveNoEmptyTagsThrDef
;
1067 xmlSaveNoEmptyTagsThrDef
= v
;
1068 xmlMutexUnlock(xmlThrDefMutex
);
1072 #undef xmlSubstituteEntitiesDefaultValue
1074 __xmlSubstituteEntitiesDefaultValue(void) {
1076 return (&xmlSubstituteEntitiesDefaultValue
);
1078 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue
);
1080 int xmlThrDefSubstituteEntitiesDefaultValue(int v
) {
1082 xmlMutexLock(xmlThrDefMutex
);
1083 ret
= xmlSubstituteEntitiesDefaultValueThrDef
;
1084 xmlSubstituteEntitiesDefaultValueThrDef
= v
;
1085 xmlMutexUnlock(xmlThrDefMutex
);
1089 #undef xmlRegisterNodeDefaultValue
1090 xmlRegisterNodeFunc
* XMLCALL
1091 __xmlRegisterNodeDefaultValue(void) {
1093 return (&xmlRegisterNodeDefaultValue
);
1095 return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue
);
1098 #undef xmlDeregisterNodeDefaultValue
1099 xmlDeregisterNodeFunc
* XMLCALL
1100 __xmlDeregisterNodeDefaultValue(void) {
1102 return (&xmlDeregisterNodeDefaultValue
);
1104 return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue
);
1107 #undef xmlParserInputBufferCreateFilenameValue
1108 xmlParserInputBufferCreateFilenameFunc
* XMLCALL
1109 __xmlParserInputBufferCreateFilenameValue(void) {
1111 return (&xmlParserInputBufferCreateFilenameValue
);
1113 return (&xmlGetGlobalState()->xmlParserInputBufferCreateFilenameValue
);
1116 #undef xmlOutputBufferCreateFilenameValue
1117 xmlOutputBufferCreateFilenameFunc
* XMLCALL
1118 __xmlOutputBufferCreateFilenameValue(void) {
1120 return (&xmlOutputBufferCreateFilenameValue
);
1122 return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue
);
1125 #define bottom_globals
1126 #include "elfgcchack.h"