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
= (xmlFreeFunc
) 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
= (xmlMallocFunc
) malloc
;
107 * @size: the size requested in bytes
109 * The variable holding the libxml malloc() implementation for atomic
110 * data (i.e. blocks not containings 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
= (xmlMallocFunc
) 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
= (xmlReallocFunc
) realloc
;
128 * @str: a zero terminated string
130 * The variable holding the libxml strdup() implementation
132 * Returns the copy of the string or NULL in case of error
134 xmlStrdupFunc xmlMemStrdup
= (xmlStrdupFunc
) xmlStrdup
;
135 #endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */
137 #include <libxml/threads.h>
138 #include <libxml/globals.h>
139 #include <libxml/SAX.h>
141 #undef docbDefaultSAXHandler
142 #undef htmlDefaultSAXHandler
143 #undef oldXMLWDcompatibility
144 #undef xmlBufferAllocScheme
145 #undef xmlDefaultBufferSize
146 #undef xmlDefaultSAXHandler
147 #undef xmlDefaultSAXLocator
148 #undef xmlDoValidityCheckingDefaultValue
149 #undef xmlGenericError
150 #undef xmlStructuredError
151 #undef xmlGenericErrorContext
152 #undef xmlStructuredErrorContext
153 #undef xmlGetWarningsDefaultValue
154 #undef xmlIndentTreeOutput
155 #undef xmlTreeIndentString
156 #undef xmlKeepBlanksDefaultValue
157 #undef xmlLineNumbersDefaultValue
158 #undef xmlLoadExtDtdDefaultValue
159 #undef xmlParserDebugEntities
160 #undef xmlParserVersion
161 #undef xmlPedanticParserDefaultValue
162 #undef xmlSaveNoEmptyTags
163 #undef xmlSubstituteEntitiesDefaultValue
164 #undef xmlRegisterNodeDefaultValue
165 #undef xmlDeregisterNodeDefaultValue
168 #undef xmlParserInputBufferCreateFilenameValue
169 #undef xmlOutputBufferCreateFilenameValue
173 * Constant string describing the internal version of the library
175 const char *xmlParserVersion
= LIBXML_VERSION_STRING LIBXML_VERSION_EXTRA
;
178 * xmlBufferAllocScheme:
180 * Global setting, default allocation policy for buffers, default is
181 * XML_BUFFER_ALLOC_EXACT
183 xmlBufferAllocationScheme xmlBufferAllocScheme
= XML_BUFFER_ALLOC_EXACT
;
184 static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef
= XML_BUFFER_ALLOC_EXACT
;
186 * xmlDefaultBufferSize:
188 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
190 int xmlDefaultBufferSize
= BASE_BUFFER_SIZE
;
191 static int xmlDefaultBufferSizeThrDef
= BASE_BUFFER_SIZE
;
198 * oldXMLWDcompatibility:
200 * Global setting, DEPRECATED.
202 int oldXMLWDcompatibility
= 0; /* DEPRECATED */
204 * xmlParserDebugEntities:
206 * Global setting, asking the parser to print out debugging informations.
207 * while handling entities.
208 * Disabled by default
210 int xmlParserDebugEntities
= 0;
211 static int xmlParserDebugEntitiesThrDef
= 0;
213 * xmlDoValidityCheckingDefaultValue:
215 * Global setting, indicate that the parser should work in validating mode.
216 * Disabled by default.
218 int xmlDoValidityCheckingDefaultValue
= 0;
219 static int xmlDoValidityCheckingDefaultValueThrDef
= 0;
221 * xmlGetWarningsDefaultValue:
223 * Global setting, indicate that the parser should provide warnings.
224 * Activated by default.
226 int xmlGetWarningsDefaultValue
= 1;
227 static int xmlGetWarningsDefaultValueThrDef
= 1;
229 * xmlLoadExtDtdDefaultValue:
231 * Global setting, indicate that the parser should load DTD while not
233 * Disabled by default.
235 int xmlLoadExtDtdDefaultValue
= 0;
236 static int xmlLoadExtDtdDefaultValueThrDef
= 0;
238 * xmlPedanticParserDefaultValue:
240 * Global setting, indicate that the parser be pedantic
241 * Disabled by default.
243 int xmlPedanticParserDefaultValue
= 0;
244 static int xmlPedanticParserDefaultValueThrDef
= 0;
246 * xmlLineNumbersDefaultValue:
248 * Global setting, indicate that the parser should store the line number
249 * in the content field of elements in the DOM tree.
250 * Disabled by default since this may not be safe for old classes of
253 int xmlLineNumbersDefaultValue
= 0;
254 static int xmlLineNumbersDefaultValueThrDef
= 0;
256 * xmlKeepBlanksDefaultValue:
258 * Global setting, indicate that the parser should keep all blanks
259 * nodes found in the content
260 * Activated by default, this is actually needed to have the parser
261 * conformant to the XML Recommendation, however the option is kept
262 * for some applications since this was libxml1 default behaviour.
264 int xmlKeepBlanksDefaultValue
= 1;
265 static int xmlKeepBlanksDefaultValueThrDef
= 1;
267 * xmlSubstituteEntitiesDefaultValue:
269 * Global setting, indicate that the parser should not generate entity
270 * references but replace them with the actual content of the entity
271 * Disabled by default, this should be activated when using XPath since
272 * the XPath data model requires entities replacement and the XPath
273 * engine does not handle entities references transparently.
275 int xmlSubstituteEntitiesDefaultValue
= 0;
276 static int xmlSubstituteEntitiesDefaultValueThrDef
= 0;
278 xmlRegisterNodeFunc xmlRegisterNodeDefaultValue
= NULL
;
279 static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef
= NULL
;
280 xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue
= NULL
;
281 static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef
= NULL
;
283 xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue
= NULL
;
284 static xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValueThrDef
= NULL
;
286 xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue
= NULL
;
287 static xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValueThrDef
= NULL
;
293 /* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
294 /* Must initialize xmlGenericError in xmlInitParser */
295 void XMLCDECL
xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED
,
301 * Global setting: function used for generic error callbacks
303 xmlGenericErrorFunc xmlGenericError
= xmlGenericErrorDefaultFunc
;
304 static xmlGenericErrorFunc xmlGenericErrorThrDef
= xmlGenericErrorDefaultFunc
;
306 * xmlStructuredError:
308 * Global setting: function used for structured error callbacks
310 xmlStructuredErrorFunc xmlStructuredError
= NULL
;
311 static xmlStructuredErrorFunc xmlStructuredErrorThrDef
= NULL
;
313 * xmlGenericErrorContext:
315 * Global setting passed to generic error callbacks
317 void *xmlGenericErrorContext
= NULL
;
318 static void *xmlGenericErrorContextThrDef
= NULL
;
320 * xmlStructuredErrorContext:
322 * Global setting passed to structured error callbacks
324 void *xmlStructuredErrorContext
= NULL
;
325 static void *xmlStructuredErrorContextThrDef
= NULL
;
326 xmlError xmlLastError
;
332 * xmlIndentTreeOutput:
334 * Global setting, asking the serializer to indent the output tree by default
337 int xmlIndentTreeOutput
= 1;
338 static int xmlIndentTreeOutputThrDef
= 1;
341 * xmlTreeIndentString:
343 * The string used to do one-level indent. By default is equal to " " (two spaces)
345 const char *xmlTreeIndentString
= " ";
346 static const char *xmlTreeIndentStringThrDef
= " ";
349 * xmlSaveNoEmptyTags:
351 * Global setting, asking the serializer to not output empty tags
352 * as <empty/> but <empty></empty>. those two forms are undistinguishable
354 * Disabled by default
356 int xmlSaveNoEmptyTags
= 0;
357 static int xmlSaveNoEmptyTagsThrDef
= 0;
359 #ifdef LIBXML_SAX1_ENABLED
361 * xmlDefaultSAXHandler:
363 * Default SAX version1 handler for XML, builds the DOM tree
365 xmlSAXHandlerV1 xmlDefaultSAXHandler
= {
366 xmlSAX2InternalSubset
,
368 xmlSAX2HasInternalSubset
,
369 xmlSAX2HasExternalSubset
,
370 xmlSAX2ResolveEntity
,
374 xmlSAX2AttributeDecl
,
376 xmlSAX2UnparsedEntityDecl
,
377 xmlSAX2SetDocumentLocator
,
378 xmlSAX2StartDocument
,
385 xmlSAX2ProcessingInstruction
,
390 xmlSAX2GetParameterEntity
,
392 xmlSAX2ExternalSubset
,
395 #endif /* LIBXML_SAX1_ENABLED */
398 * xmlDefaultSAXLocator:
400 * The default SAX Locator
401 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
403 xmlSAXLocator xmlDefaultSAXLocator
= {
406 xmlSAX2GetLineNumber
,
407 xmlSAX2GetColumnNumber
410 #ifdef LIBXML_HTML_ENABLED
412 * htmlDefaultSAXHandler:
414 * Default old SAX v1 handler for HTML, builds the DOM tree
416 xmlSAXHandlerV1 htmlDefaultSAXHandler
= {
417 xmlSAX2InternalSubset
,
428 xmlSAX2SetDocumentLocator
,
429 xmlSAX2StartDocument
,
435 xmlSAX2IgnorableWhitespace
,
436 xmlSAX2ProcessingInstruction
,
441 xmlSAX2GetParameterEntity
,
446 #endif /* LIBXML_HTML_ENABLED */
448 #ifdef LIBXML_DOCB_ENABLED
450 * docbDefaultSAXHandler:
452 * Default old SAX v1 handler for SGML DocBook, builds the DOM tree
454 xmlSAXHandlerV1 docbDefaultSAXHandler
= {
455 xmlSAX2InternalSubset
,
457 xmlSAX2HasInternalSubset
,
458 xmlSAX2HasExternalSubset
,
459 xmlSAX2ResolveEntity
,
466 xmlSAX2SetDocumentLocator
,
467 xmlSAX2StartDocument
,
473 xmlSAX2IgnorableWhitespace
,
479 xmlSAX2GetParameterEntity
,
484 #endif /* LIBXML_DOCB_ENABLED */
487 * xmlInitializeGlobalState:
488 * @gs: a pointer to a newly allocated global state
490 * xmlInitializeGlobalState() initialize a global state with all the
491 * default values of the library.
494 xmlInitializeGlobalState(xmlGlobalStatePtr gs
)
497 fprintf(stderr
, "Initializing globals at %lu for thread %d\n",
498 (unsigned long) gs
, xmlGetThreadId());
502 * Perform initialization as required by libxml
504 if (xmlThrDefMutex
== NULL
)
507 xmlMutexLock(xmlThrDefMutex
);
509 #if defined(LIBXML_DOCB_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
510 initdocbDefaultSAXHandler(&gs
->docbDefaultSAXHandler
);
512 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
513 inithtmlDefaultSAXHandler(&gs
->htmlDefaultSAXHandler
);
516 gs
->oldXMLWDcompatibility
= 0;
517 gs
->xmlBufferAllocScheme
= xmlBufferAllocSchemeThrDef
;
518 gs
->xmlDefaultBufferSize
= xmlDefaultBufferSizeThrDef
;
519 #if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_LEGACY_ENABLED)
520 initxmlDefaultSAXHandler(&gs
->xmlDefaultSAXHandler
, 1);
521 #endif /* LIBXML_SAX1_ENABLED */
522 gs
->xmlDefaultSAXLocator
.getPublicId
= xmlSAX2GetPublicId
;
523 gs
->xmlDefaultSAXLocator
.getSystemId
= xmlSAX2GetSystemId
;
524 gs
->xmlDefaultSAXLocator
.getLineNumber
= xmlSAX2GetLineNumber
;
525 gs
->xmlDefaultSAXLocator
.getColumnNumber
= xmlSAX2GetColumnNumber
;
526 gs
->xmlDoValidityCheckingDefaultValue
=
527 xmlDoValidityCheckingDefaultValueThrDef
;
528 #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
529 gs
->xmlFree
= (xmlFreeFunc
) xmlMemFree
;
530 gs
->xmlMalloc
= (xmlMallocFunc
) xmlMemMalloc
;
531 gs
->xmlMallocAtomic
= (xmlMallocFunc
) xmlMemMalloc
;
532 gs
->xmlRealloc
= (xmlReallocFunc
) xmlMemRealloc
;
533 gs
->xmlMemStrdup
= (xmlStrdupFunc
) xmlMemoryStrdup
;
535 gs
->xmlFree
= (xmlFreeFunc
) free
;
536 gs
->xmlMalloc
= (xmlMallocFunc
) malloc
;
537 gs
->xmlMallocAtomic
= (xmlMallocFunc
) malloc
;
538 gs
->xmlRealloc
= (xmlReallocFunc
) realloc
;
539 gs
->xmlMemStrdup
= (xmlStrdupFunc
) xmlStrdup
;
541 gs
->xmlGetWarningsDefaultValue
= xmlGetWarningsDefaultValueThrDef
;
542 gs
->xmlIndentTreeOutput
= xmlIndentTreeOutputThrDef
;
543 gs
->xmlTreeIndentString
= xmlTreeIndentStringThrDef
;
544 gs
->xmlKeepBlanksDefaultValue
= xmlKeepBlanksDefaultValueThrDef
;
545 gs
->xmlLineNumbersDefaultValue
= xmlLineNumbersDefaultValueThrDef
;
546 gs
->xmlLoadExtDtdDefaultValue
= xmlLoadExtDtdDefaultValueThrDef
;
547 gs
->xmlParserDebugEntities
= xmlParserDebugEntitiesThrDef
;
548 gs
->xmlParserVersion
= LIBXML_VERSION_STRING
;
549 gs
->xmlPedanticParserDefaultValue
= xmlPedanticParserDefaultValueThrDef
;
550 gs
->xmlSaveNoEmptyTags
= xmlSaveNoEmptyTagsThrDef
;
551 gs
->xmlSubstituteEntitiesDefaultValue
=
552 xmlSubstituteEntitiesDefaultValueThrDef
;
554 gs
->xmlGenericError
= xmlGenericErrorThrDef
;
555 gs
->xmlStructuredError
= xmlStructuredErrorThrDef
;
556 gs
->xmlGenericErrorContext
= xmlGenericErrorContextThrDef
;
557 gs
->xmlStructuredErrorContext
= xmlStructuredErrorContextThrDef
;
558 gs
->xmlRegisterNodeDefaultValue
= xmlRegisterNodeDefaultValueThrDef
;
559 gs
->xmlDeregisterNodeDefaultValue
= xmlDeregisterNodeDefaultValueThrDef
;
561 gs
->xmlParserInputBufferCreateFilenameValue
= xmlParserInputBufferCreateFilenameValueThrDef
;
562 gs
->xmlOutputBufferCreateFilenameValue
= xmlOutputBufferCreateFilenameValueThrDef
;
563 memset(&gs
->xmlLastError
, 0, sizeof(xmlError
));
565 xmlMutexUnlock(xmlThrDefMutex
);
569 * DOC_DISABLE : we ignore missing doc for the xmlThrDef functions,
570 * those are really internal work
573 xmlThrDefSetGenericErrorFunc(void *ctx
, xmlGenericErrorFunc handler
) {
574 xmlMutexLock(xmlThrDefMutex
);
575 xmlGenericErrorContextThrDef
= ctx
;
577 xmlGenericErrorThrDef
= handler
;
579 xmlGenericErrorThrDef
= xmlGenericErrorDefaultFunc
;
580 xmlMutexUnlock(xmlThrDefMutex
);
584 xmlThrDefSetStructuredErrorFunc(void *ctx
, xmlStructuredErrorFunc handler
) {
585 xmlMutexLock(xmlThrDefMutex
);
586 xmlStructuredErrorContextThrDef
= ctx
;
587 xmlStructuredErrorThrDef
= handler
;
588 xmlMutexUnlock(xmlThrDefMutex
);
592 * xmlRegisterNodeDefault:
593 * @func: function pointer to the new RegisterNodeFunc
595 * Registers a callback for node creation
597 * Returns the old value of the registration function
600 xmlRegisterNodeDefault(xmlRegisterNodeFunc func
)
602 xmlRegisterNodeFunc old
= xmlRegisterNodeDefaultValue
;
604 __xmlRegisterCallbacks
= 1;
605 xmlRegisterNodeDefaultValue
= func
;
610 xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func
)
612 xmlRegisterNodeFunc old
;
614 xmlMutexLock(xmlThrDefMutex
);
615 old
= xmlRegisterNodeDefaultValueThrDef
;
617 __xmlRegisterCallbacks
= 1;
618 xmlRegisterNodeDefaultValueThrDef
= func
;
619 xmlMutexUnlock(xmlThrDefMutex
);
625 * xmlDeregisterNodeDefault:
626 * @func: function pointer to the new DeregisterNodeFunc
628 * Registers a callback for node destruction
630 * Returns the previous value of the deregistration function
632 xmlDeregisterNodeFunc
633 xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func
)
635 xmlDeregisterNodeFunc old
= xmlDeregisterNodeDefaultValue
;
637 __xmlRegisterCallbacks
= 1;
638 xmlDeregisterNodeDefaultValue
= func
;
642 xmlDeregisterNodeFunc
643 xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func
)
645 xmlDeregisterNodeFunc old
;
647 xmlMutexLock(xmlThrDefMutex
);
648 old
= xmlDeregisterNodeDefaultValueThrDef
;
650 __xmlRegisterCallbacks
= 1;
651 xmlDeregisterNodeDefaultValueThrDef
= func
;
652 xmlMutexUnlock(xmlThrDefMutex
);
657 xmlParserInputBufferCreateFilenameFunc
658 xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func
)
660 xmlParserInputBufferCreateFilenameFunc old
;
662 xmlMutexLock(xmlThrDefMutex
);
663 old
= xmlParserInputBufferCreateFilenameValueThrDef
;
665 old
= __xmlParserInputBufferCreateFilename
;
668 xmlParserInputBufferCreateFilenameValueThrDef
= func
;
669 xmlMutexUnlock(xmlThrDefMutex
);
674 xmlOutputBufferCreateFilenameFunc
675 xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func
)
677 xmlOutputBufferCreateFilenameFunc old
;
679 xmlMutexLock(xmlThrDefMutex
);
680 old
= xmlOutputBufferCreateFilenameValueThrDef
;
681 #ifdef LIBXML_OUTPUT_ENABLED
683 old
= __xmlOutputBufferCreateFilename
;
686 xmlOutputBufferCreateFilenameValueThrDef
= func
;
687 xmlMutexUnlock(xmlThrDefMutex
);
692 #ifdef LIBXML_DOCB_ENABLED
693 #undef docbDefaultSAXHandler
695 __docbDefaultSAXHandler(void) {
697 return (&docbDefaultSAXHandler
);
699 return (&xmlGetGlobalState()->docbDefaultSAXHandler
);
703 #ifdef LIBXML_HTML_ENABLED
704 #undef htmlDefaultSAXHandler
706 __htmlDefaultSAXHandler(void) {
708 return (&htmlDefaultSAXHandler
);
710 return (&xmlGetGlobalState()->htmlDefaultSAXHandler
);
716 __xmlLastError(void) {
718 return (&xmlLastError
);
720 return (&xmlGetGlobalState()->xmlLastError
);
724 * The following memory routines were apparently lost at some point,
725 * and were re-inserted at this point on June 10, 2004. Hope it's
726 * the right place for them :-)
728 #if defined(LIBXML_THREAD_ALLOC_ENABLED) && defined(LIBXML_THREAD_ENABLED)
735 return (&xmlGetGlobalState()->xmlMalloc
);
738 #undef xmlMallocAtomic
740 __xmlMallocAtomic(void){
742 return (&xmlMallocAtomic
);
744 return (&xmlGetGlobalState()->xmlMallocAtomic
);
751 return (&xmlRealloc
);
753 return (&xmlGetGlobalState()->xmlRealloc
);
762 return (&xmlGetGlobalState()->xmlFree
);
766 __xmlMemStrdup(void){
768 return (&xmlMemStrdup
);
770 return (&xmlGetGlobalState()->xmlMemStrdup
);
776 * Everything starting from the line below is
777 * Automatically generated by build_glob.py.
778 * Do not modify the previous line.
782 #undef oldXMLWDcompatibility
784 __oldXMLWDcompatibility(void) {
786 return (&oldXMLWDcompatibility
);
788 return (&xmlGetGlobalState()->oldXMLWDcompatibility
);
791 #undef xmlBufferAllocScheme
792 xmlBufferAllocationScheme
*
793 __xmlBufferAllocScheme(void) {
795 return (&xmlBufferAllocScheme
);
797 return (&xmlGetGlobalState()->xmlBufferAllocScheme
);
799 xmlBufferAllocationScheme
xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v
) {
800 xmlBufferAllocationScheme ret
;
801 xmlMutexLock(xmlThrDefMutex
);
802 ret
= xmlBufferAllocSchemeThrDef
;
803 xmlBufferAllocSchemeThrDef
= v
;
804 xmlMutexUnlock(xmlThrDefMutex
);
808 #undef xmlDefaultBufferSize
810 __xmlDefaultBufferSize(void) {
812 return (&xmlDefaultBufferSize
);
814 return (&xmlGetGlobalState()->xmlDefaultBufferSize
);
816 int xmlThrDefDefaultBufferSize(int v
) {
818 xmlMutexLock(xmlThrDefMutex
);
819 ret
= xmlDefaultBufferSizeThrDef
;
820 xmlDefaultBufferSizeThrDef
= v
;
821 xmlMutexUnlock(xmlThrDefMutex
);
825 #ifdef LIBXML_SAX1_ENABLED
826 #undef xmlDefaultSAXHandler
828 __xmlDefaultSAXHandler(void) {
830 return (&xmlDefaultSAXHandler
);
832 return (&xmlGetGlobalState()->xmlDefaultSAXHandler
);
834 #endif /* LIBXML_SAX1_ENABLED */
836 #undef xmlDefaultSAXLocator
838 __xmlDefaultSAXLocator(void) {
840 return (&xmlDefaultSAXLocator
);
842 return (&xmlGetGlobalState()->xmlDefaultSAXLocator
);
845 #undef xmlDoValidityCheckingDefaultValue
847 __xmlDoValidityCheckingDefaultValue(void) {
849 return (&xmlDoValidityCheckingDefaultValue
);
851 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue
);
853 int xmlThrDefDoValidityCheckingDefaultValue(int v
) {
855 xmlMutexLock(xmlThrDefMutex
);
856 ret
= xmlDoValidityCheckingDefaultValueThrDef
;
857 xmlDoValidityCheckingDefaultValueThrDef
= v
;
858 xmlMutexUnlock(xmlThrDefMutex
);
862 #undef xmlGenericError
863 xmlGenericErrorFunc
*
864 __xmlGenericError(void) {
866 return (&xmlGenericError
);
868 return (&xmlGetGlobalState()->xmlGenericError
);
871 #undef xmlStructuredError
872 xmlStructuredErrorFunc
*
873 __xmlStructuredError(void) {
875 return (&xmlStructuredError
);
877 return (&xmlGetGlobalState()->xmlStructuredError
);
880 #undef xmlGenericErrorContext
882 __xmlGenericErrorContext(void) {
884 return (&xmlGenericErrorContext
);
886 return (&xmlGetGlobalState()->xmlGenericErrorContext
);
889 #undef xmlStructuredErrorContext
891 __xmlStructuredErrorContext(void) {
893 return (&xmlStructuredErrorContext
);
895 return (&xmlGetGlobalState()->xmlStructuredErrorContext
);
898 #undef xmlGetWarningsDefaultValue
900 __xmlGetWarningsDefaultValue(void) {
902 return (&xmlGetWarningsDefaultValue
);
904 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue
);
906 int xmlThrDefGetWarningsDefaultValue(int v
) {
908 xmlMutexLock(xmlThrDefMutex
);
909 ret
= xmlGetWarningsDefaultValueThrDef
;
910 xmlGetWarningsDefaultValueThrDef
= v
;
911 xmlMutexUnlock(xmlThrDefMutex
);
915 #undef xmlIndentTreeOutput
917 __xmlIndentTreeOutput(void) {
919 return (&xmlIndentTreeOutput
);
921 return (&xmlGetGlobalState()->xmlIndentTreeOutput
);
923 int xmlThrDefIndentTreeOutput(int v
) {
925 xmlMutexLock(xmlThrDefMutex
);
926 ret
= xmlIndentTreeOutputThrDef
;
927 xmlIndentTreeOutputThrDef
= v
;
928 xmlMutexUnlock(xmlThrDefMutex
);
932 #undef xmlTreeIndentString
934 __xmlTreeIndentString(void) {
936 return (&xmlTreeIndentString
);
938 return (&xmlGetGlobalState()->xmlTreeIndentString
);
940 const char * xmlThrDefTreeIndentString(const char * v
) {
942 xmlMutexLock(xmlThrDefMutex
);
943 ret
= xmlTreeIndentStringThrDef
;
944 xmlTreeIndentStringThrDef
= v
;
945 xmlMutexUnlock(xmlThrDefMutex
);
949 #undef xmlKeepBlanksDefaultValue
951 __xmlKeepBlanksDefaultValue(void) {
953 return (&xmlKeepBlanksDefaultValue
);
955 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue
);
957 int xmlThrDefKeepBlanksDefaultValue(int v
) {
959 xmlMutexLock(xmlThrDefMutex
);
960 ret
= xmlKeepBlanksDefaultValueThrDef
;
961 xmlKeepBlanksDefaultValueThrDef
= v
;
962 xmlMutexUnlock(xmlThrDefMutex
);
966 #undef xmlLineNumbersDefaultValue
968 __xmlLineNumbersDefaultValue(void) {
970 return (&xmlLineNumbersDefaultValue
);
972 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue
);
974 int xmlThrDefLineNumbersDefaultValue(int v
) {
976 xmlMutexLock(xmlThrDefMutex
);
977 ret
= xmlLineNumbersDefaultValueThrDef
;
978 xmlLineNumbersDefaultValueThrDef
= v
;
979 xmlMutexUnlock(xmlThrDefMutex
);
983 #undef xmlLoadExtDtdDefaultValue
985 __xmlLoadExtDtdDefaultValue(void) {
987 return (&xmlLoadExtDtdDefaultValue
);
989 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue
);
991 int xmlThrDefLoadExtDtdDefaultValue(int v
) {
993 xmlMutexLock(xmlThrDefMutex
);
994 ret
= xmlLoadExtDtdDefaultValueThrDef
;
995 xmlLoadExtDtdDefaultValueThrDef
= v
;
996 xmlMutexUnlock(xmlThrDefMutex
);
1000 #undef xmlParserDebugEntities
1002 __xmlParserDebugEntities(void) {
1004 return (&xmlParserDebugEntities
);
1006 return (&xmlGetGlobalState()->xmlParserDebugEntities
);
1008 int xmlThrDefParserDebugEntities(int v
) {
1010 xmlMutexLock(xmlThrDefMutex
);
1011 ret
= xmlParserDebugEntitiesThrDef
;
1012 xmlParserDebugEntitiesThrDef
= v
;
1013 xmlMutexUnlock(xmlThrDefMutex
);
1017 #undef xmlParserVersion
1019 __xmlParserVersion(void) {
1021 return (&xmlParserVersion
);
1023 return (&xmlGetGlobalState()->xmlParserVersion
);
1026 #undef xmlPedanticParserDefaultValue
1028 __xmlPedanticParserDefaultValue(void) {
1030 return (&xmlPedanticParserDefaultValue
);
1032 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue
);
1034 int xmlThrDefPedanticParserDefaultValue(int v
) {
1036 xmlMutexLock(xmlThrDefMutex
);
1037 ret
= xmlPedanticParserDefaultValueThrDef
;
1038 xmlPedanticParserDefaultValueThrDef
= v
;
1039 xmlMutexUnlock(xmlThrDefMutex
);
1043 #undef xmlSaveNoEmptyTags
1045 __xmlSaveNoEmptyTags(void) {
1047 return (&xmlSaveNoEmptyTags
);
1049 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags
);
1051 int xmlThrDefSaveNoEmptyTags(int v
) {
1053 xmlMutexLock(xmlThrDefMutex
);
1054 ret
= xmlSaveNoEmptyTagsThrDef
;
1055 xmlSaveNoEmptyTagsThrDef
= v
;
1056 xmlMutexUnlock(xmlThrDefMutex
);
1060 #undef xmlSubstituteEntitiesDefaultValue
1062 __xmlSubstituteEntitiesDefaultValue(void) {
1064 return (&xmlSubstituteEntitiesDefaultValue
);
1066 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue
);
1068 int xmlThrDefSubstituteEntitiesDefaultValue(int v
) {
1070 xmlMutexLock(xmlThrDefMutex
);
1071 ret
= xmlSubstituteEntitiesDefaultValueThrDef
;
1072 xmlSubstituteEntitiesDefaultValueThrDef
= v
;
1073 xmlMutexUnlock(xmlThrDefMutex
);
1077 #undef xmlRegisterNodeDefaultValue
1078 xmlRegisterNodeFunc
*
1079 __xmlRegisterNodeDefaultValue(void) {
1081 return (&xmlRegisterNodeDefaultValue
);
1083 return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue
);
1086 #undef xmlDeregisterNodeDefaultValue
1087 xmlDeregisterNodeFunc
*
1088 __xmlDeregisterNodeDefaultValue(void) {
1090 return (&xmlDeregisterNodeDefaultValue
);
1092 return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue
);
1095 #undef xmlParserInputBufferCreateFilenameValue
1096 xmlParserInputBufferCreateFilenameFunc
*
1097 __xmlParserInputBufferCreateFilenameValue(void) {
1099 return (&xmlParserInputBufferCreateFilenameValue
);
1101 return (&xmlGetGlobalState()->xmlParserInputBufferCreateFilenameValue
);
1104 #undef xmlOutputBufferCreateFilenameValue
1105 xmlOutputBufferCreateFilenameFunc
*
1106 __xmlOutputBufferCreateFilenameValue(void) {
1108 return (&xmlOutputBufferCreateFilenameValue
);
1110 return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue
);
1113 #define bottom_globals
1114 #include "elfgcchack.h"