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>
20 #include <libxml/globals.h>
21 #include <libxml/xmlmemory.h>
22 #include <libxml/threads.h>
24 #include "private/error.h"
25 #include "private/globals.h"
26 #include "private/threads.h"
27 #include "private/tree.h"
29 /* #define DEBUG_GLOBALS */
34 #ifdef LIBXML_THREAD_ENABLED
35 #define IS_MAIN_THREAD (xmlIsMainThread())
37 #define IS_MAIN_THREAD 1
41 * Mutex to protect "ForNewThreads" variables
43 static xmlMutex xmlThrDefMutex
;
48 * DEPRECATED: Alias for xmlInitParser.
50 void xmlInitGlobals(void) {
55 * xmlInitGlobalsInternal:
57 * Additional initialisation for multi-threading
59 void xmlInitGlobalsInternal(void) {
60 xmlInitMutex(&xmlThrDefMutex
);
63 /************************************************************************
65 * All the user accessible global variables of the library *
67 ************************************************************************/
70 * Memory allocation routines
74 #undef xmlMallocAtomic
78 #if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY)
79 xmlFreeFunc xmlFree
= (xmlFreeFunc
) xmlMemFree
;
80 xmlMallocFunc xmlMalloc
= (xmlMallocFunc
) xmlMemMalloc
;
81 xmlMallocFunc xmlMallocAtomic
= (xmlMallocFunc
) xmlMemMalloc
;
82 xmlReallocFunc xmlRealloc
= (xmlReallocFunc
) xmlMemRealloc
;
83 xmlStrdupFunc xmlMemStrdup
= (xmlStrdupFunc
) xmlMemoryStrdup
;
87 * @mem: an already allocated block of memory
89 * The variable holding the libxml free() implementation
91 xmlFreeFunc xmlFree
= free
;
94 * @size: the size requested in bytes
96 * The variable holding the libxml malloc() implementation
98 * Returns a pointer to the newly allocated block or NULL in case of error
100 xmlMallocFunc xmlMalloc
= malloc
;
103 * @size: the size requested in bytes
105 * The variable holding the libxml malloc() implementation for atomic
106 * data (i.e. blocks not containing pointers), useful when using a
107 * garbage collecting allocator.
109 * Returns a pointer to the newly allocated block or NULL in case of error
111 xmlMallocFunc xmlMallocAtomic
= malloc
;
114 * @mem: an already allocated block of memory
115 * @size: the new size requested in bytes
117 * The variable holding the libxml realloc() implementation
119 * Returns a pointer to the newly reallocated block or NULL in case of error
121 xmlReallocFunc xmlRealloc
= realloc
;
124 * @cur: the input char *
126 * a strdup implementation with a type signature matching POSIX
128 * Returns a new xmlChar * or NULL
131 xmlPosixStrdup(const char *cur
) {
132 return((char*) xmlCharStrdup(cur
));
136 * @str: a zero terminated string
138 * The variable holding the libxml strdup() implementation
140 * Returns the copy of the string or NULL in case of error
142 xmlStrdupFunc xmlMemStrdup
= xmlPosixStrdup
;
143 #endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */
145 #include <libxml/threads.h>
146 #include <libxml/globals.h>
147 #include <libxml/SAX.h>
149 #undef htmlDefaultSAXHandler
150 #undef oldXMLWDcompatibility
151 #undef xmlBufferAllocScheme
152 #undef xmlDefaultBufferSize
153 #undef xmlDefaultSAXHandler
154 #undef xmlDefaultSAXLocator
155 #undef xmlDoValidityCheckingDefaultValue
156 #undef xmlGenericError
157 #undef xmlStructuredError
158 #undef xmlGenericErrorContext
159 #undef xmlStructuredErrorContext
160 #undef xmlGetWarningsDefaultValue
161 #undef xmlIndentTreeOutput
162 #undef xmlTreeIndentString
163 #undef xmlKeepBlanksDefaultValue
164 #undef xmlLineNumbersDefaultValue
165 #undef xmlLoadExtDtdDefaultValue
166 #undef xmlParserDebugEntities
167 #undef xmlParserVersion
168 #undef xmlPedanticParserDefaultValue
169 #undef xmlSaveNoEmptyTags
170 #undef xmlSubstituteEntitiesDefaultValue
171 #undef xmlRegisterNodeDefaultValue
172 #undef xmlDeregisterNodeDefaultValue
175 #undef xmlParserInputBufferCreateFilenameValue
176 #undef xmlOutputBufferCreateFilenameValue
180 * Constant string describing the internal version of the library
182 const char *xmlParserVersion
= LIBXML_VERSION_STRING LIBXML_VERSION_EXTRA
;
185 * xmlBufferAllocScheme:
187 * DEPRECATED: Don't use.
189 * Global setting, default allocation policy for buffers, default is
190 * XML_BUFFER_ALLOC_EXACT
192 xmlBufferAllocationScheme xmlBufferAllocScheme
= XML_BUFFER_ALLOC_EXACT
;
193 static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef
= XML_BUFFER_ALLOC_EXACT
;
195 * xmlDefaultBufferSize:
197 * DEPRECATED: Don't use.
199 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
201 int xmlDefaultBufferSize
= BASE_BUFFER_SIZE
;
202 static int xmlDefaultBufferSizeThrDef
= BASE_BUFFER_SIZE
;
209 * oldXMLWDcompatibility:
211 * Global setting, DEPRECATED.
213 int oldXMLWDcompatibility
= 0; /* DEPRECATED */
215 * xmlParserDebugEntities:
217 * DEPRECATED: Don't use
219 * Global setting, asking the parser to print out debugging information.
220 * while handling entities.
221 * Disabled by default
223 int xmlParserDebugEntities
= 0;
224 static int xmlParserDebugEntitiesThrDef
= 0;
226 * xmlDoValidityCheckingDefaultValue:
228 * DEPRECATED: Use the modern options API with XML_PARSE_DTDVALID.
230 * Global setting, indicate that the parser should work in validating mode.
231 * Disabled by default.
233 int xmlDoValidityCheckingDefaultValue
= 0;
234 static int xmlDoValidityCheckingDefaultValueThrDef
= 0;
236 * xmlGetWarningsDefaultValue:
238 * DEPRECATED: Don't use
240 * Global setting, indicate that the DTD validation should provide warnings.
241 * Activated by default.
243 int xmlGetWarningsDefaultValue
= 1;
244 static int xmlGetWarningsDefaultValueThrDef
= 1;
246 * xmlLoadExtDtdDefaultValue:
248 * DEPRECATED: Use the modern options API with XML_PARSE_DTDLOAD.
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 * DEPRECATED: Use the modern options API with XML_PARSE_PEDANTIC.
261 * Global setting, indicate that the parser be pedantic
262 * Disabled by default.
264 int xmlPedanticParserDefaultValue
= 0;
265 static int xmlPedanticParserDefaultValueThrDef
= 0;
267 * xmlLineNumbersDefaultValue:
269 * DEPRECATED: The modern options API always enables line numbers.
271 * Global setting, indicate that the parser should store the line number
272 * in the content field of elements in the DOM tree.
273 * Disabled by default since this may not be safe for old classes of
276 int xmlLineNumbersDefaultValue
= 0;
277 static int xmlLineNumbersDefaultValueThrDef
= 0;
279 * xmlKeepBlanksDefaultValue:
281 * DEPRECATED: Use the modern options API with XML_PARSE_NOBLANKS.
283 * Global setting, indicate that the parser should keep all blanks
284 * nodes found in the content
285 * Activated by default, this is actually needed to have the parser
286 * conformant to the XML Recommendation, however the option is kept
287 * for some applications since this was libxml1 default behaviour.
289 int xmlKeepBlanksDefaultValue
= 1;
290 static int xmlKeepBlanksDefaultValueThrDef
= 1;
292 * xmlSubstituteEntitiesDefaultValue:
294 * DEPRECATED: Use the modern options API with XML_PARSE_NOENT.
296 * Global setting, indicate that the parser should not generate entity
297 * references but replace them with the actual content of the entity
298 * Disabled by default, this should be activated when using XPath since
299 * the XPath data model requires entities replacement and the XPath
300 * engine does not handle entities references transparently.
302 int xmlSubstituteEntitiesDefaultValue
= 0;
303 static int xmlSubstituteEntitiesDefaultValueThrDef
= 0;
306 * xmlRegisterNodeDefaultValue:
308 * DEPRECATED: Don't use
310 xmlRegisterNodeFunc xmlRegisterNodeDefaultValue
= NULL
;
311 static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef
= NULL
;
314 * xmlDeregisterNodeDefaultValue:
316 * DEPRECATED: Don't use
318 xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue
= NULL
;
319 static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef
= NULL
;
322 * xmlParserInputBufferCreateFilenameValue:
324 * DEPRECATED: Don't use
326 xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue
= NULL
;
327 static xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValueThrDef
= NULL
;
330 * xmlOutputBufferCreateFilenameValue:
332 * DEPRECATED: Don't use
334 xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue
= NULL
;
335 static xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValueThrDef
= NULL
;
340 * Global setting: function used for generic error callbacks
342 xmlGenericErrorFunc xmlGenericError
= xmlGenericErrorDefaultFunc
;
343 static xmlGenericErrorFunc xmlGenericErrorThrDef
= xmlGenericErrorDefaultFunc
;
345 * xmlStructuredError:
347 * Global setting: function used for structured error callbacks
349 xmlStructuredErrorFunc xmlStructuredError
= NULL
;
350 static xmlStructuredErrorFunc xmlStructuredErrorThrDef
= NULL
;
352 * xmlGenericErrorContext:
354 * Global setting passed to generic error callbacks
356 void *xmlGenericErrorContext
= NULL
;
357 static void *xmlGenericErrorContextThrDef
= NULL
;
359 * xmlStructuredErrorContext:
361 * Global setting passed to structured error callbacks
363 void *xmlStructuredErrorContext
= NULL
;
364 static void *xmlStructuredErrorContextThrDef
= NULL
;
365 xmlError xmlLastError
;
371 * xmlIndentTreeOutput:
373 * Global setting, asking the serializer to indent the output tree by default
376 int xmlIndentTreeOutput
= 1;
377 static int xmlIndentTreeOutputThrDef
= 1;
380 * xmlTreeIndentString:
382 * The string used to do one-level indent. By default is equal to " " (two spaces)
384 const char *xmlTreeIndentString
= " ";
385 static const char *xmlTreeIndentStringThrDef
= " ";
388 * xmlSaveNoEmptyTags:
390 * Global setting, asking the serializer to not output empty tags
391 * as <empty/> but <empty></empty>. those two forms are indistinguishable
393 * Disabled by default
395 int xmlSaveNoEmptyTags
= 0;
396 static int xmlSaveNoEmptyTagsThrDef
= 0;
398 #ifdef LIBXML_SAX1_ENABLED
400 * xmlDefaultSAXHandler:
402 * DEPRECATED: This handler is unused and will be removed from future
405 * Default SAX version1 handler for XML, builds the DOM tree
407 xmlSAXHandlerV1 xmlDefaultSAXHandler
= {
408 xmlSAX2InternalSubset
,
410 xmlSAX2HasInternalSubset
,
411 xmlSAX2HasExternalSubset
,
412 xmlSAX2ResolveEntity
,
416 xmlSAX2AttributeDecl
,
418 xmlSAX2UnparsedEntityDecl
,
419 xmlSAX2SetDocumentLocator
,
420 xmlSAX2StartDocument
,
427 xmlSAX2ProcessingInstruction
,
432 xmlSAX2GetParameterEntity
,
434 xmlSAX2ExternalSubset
,
437 #endif /* LIBXML_SAX1_ENABLED */
440 * xmlDefaultSAXLocator:
442 * DEPRECATED: Don't use
444 * The default SAX Locator
445 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
447 xmlSAXLocator xmlDefaultSAXLocator
= {
450 xmlSAX2GetLineNumber
,
451 xmlSAX2GetColumnNumber
454 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_SAX1_ENABLED)
456 * htmlDefaultSAXHandler:
458 * DEPRECATED: This handler is unused and will be removed from future
461 * Default old SAX v1 handler for HTML, builds the DOM tree
463 xmlSAXHandlerV1 htmlDefaultSAXHandler
= {
464 xmlSAX2InternalSubset
,
475 xmlSAX2SetDocumentLocator
,
476 xmlSAX2StartDocument
,
482 xmlSAX2IgnorableWhitespace
,
483 xmlSAX2ProcessingInstruction
,
493 #endif /* LIBXML_HTML_ENABLED */
496 * xmlInitializeGlobalState:
497 * @gs: a pointer to a newly allocated global state
499 * xmlInitializeGlobalState() initialize a global state with all the
500 * default values of the library.
503 xmlInitializeGlobalState(xmlGlobalStatePtr gs
)
506 fprintf(stderr
, "Initializing globals at %p for thread %d\n",
507 (void *) gs
, xmlGetThreadId());
510 xmlMutexLock(&xmlThrDefMutex
);
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
);
571 * DEPRECATED: This function is a no-op. Call xmlCleanupParser
572 * to free global state but see the warnings there. xmlCleanupParser
573 * should be only called once at program exit. In most cases, you don't
574 * have call cleanup functions at all.
576 void xmlCleanupGlobals(void) {
580 * xmlCleanupGlobalsInternal:
582 * Additional cleanup for multi-threading
584 void xmlCleanupGlobalsInternal(void) {
585 xmlResetError(&xmlLastError
);
587 xmlCleanupMutex(&xmlThrDefMutex
);
588 __xmlGlobalInitMutexDestroy();
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 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_SAX1_ENABLED)
712 #undef htmlDefaultSAXHandler
714 __htmlDefaultSAXHandler(void) {
716 return (&htmlDefaultSAXHandler
);
718 return (&xmlGetGlobalState()->htmlDefaultSAXHandler
);
724 __xmlLastError(void) {
726 return (&xmlLastError
);
728 return (&xmlGetGlobalState()->xmlLastError
);
732 * The following memory routines were apparently lost at some point,
733 * and were re-inserted at this point on June 10, 2004. Hope it's
734 * the right place for them :-)
736 #if defined(LIBXML_THREAD_ALLOC_ENABLED) && defined(LIBXML_THREAD_ENABLED)
743 return (&xmlGetGlobalState()->xmlMalloc
);
746 #undef xmlMallocAtomic
748 __xmlMallocAtomic(void){
750 return (&xmlMallocAtomic
);
752 return (&xmlGetGlobalState()->xmlMallocAtomic
);
759 return (&xmlRealloc
);
761 return (&xmlGetGlobalState()->xmlRealloc
);
770 return (&xmlGetGlobalState()->xmlFree
);
774 __xmlMemStrdup(void){
776 return (&xmlMemStrdup
);
778 return (&xmlGetGlobalState()->xmlMemStrdup
);
784 * Everything starting from the line below is
785 * Automatically generated by build_glob.py.
786 * Do not modify the previous line.
790 #undef oldXMLWDcompatibility
792 __oldXMLWDcompatibility(void) {
794 return (&oldXMLWDcompatibility
);
796 return (&xmlGetGlobalState()->oldXMLWDcompatibility
);
799 #undef xmlBufferAllocScheme
800 xmlBufferAllocationScheme
*
801 __xmlBufferAllocScheme(void) {
803 return (&xmlBufferAllocScheme
);
805 return (&xmlGetGlobalState()->xmlBufferAllocScheme
);
807 xmlBufferAllocationScheme
xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v
) {
808 xmlBufferAllocationScheme ret
;
809 xmlMutexLock(&xmlThrDefMutex
);
810 ret
= xmlBufferAllocSchemeThrDef
;
811 xmlBufferAllocSchemeThrDef
= v
;
812 xmlMutexUnlock(&xmlThrDefMutex
);
816 #undef xmlDefaultBufferSize
818 __xmlDefaultBufferSize(void) {
820 return (&xmlDefaultBufferSize
);
822 return (&xmlGetGlobalState()->xmlDefaultBufferSize
);
824 int xmlThrDefDefaultBufferSize(int v
) {
826 xmlMutexLock(&xmlThrDefMutex
);
827 ret
= xmlDefaultBufferSizeThrDef
;
828 xmlDefaultBufferSizeThrDef
= v
;
829 xmlMutexUnlock(&xmlThrDefMutex
);
833 #ifdef LIBXML_SAX1_ENABLED
834 #undef xmlDefaultSAXHandler
836 __xmlDefaultSAXHandler(void) {
838 return (&xmlDefaultSAXHandler
);
840 return (&xmlGetGlobalState()->xmlDefaultSAXHandler
);
842 #endif /* LIBXML_SAX1_ENABLED */
844 #undef xmlDefaultSAXLocator
846 __xmlDefaultSAXLocator(void) {
848 return (&xmlDefaultSAXLocator
);
850 return (&xmlGetGlobalState()->xmlDefaultSAXLocator
);
853 #undef xmlDoValidityCheckingDefaultValue
855 __xmlDoValidityCheckingDefaultValue(void) {
857 return (&xmlDoValidityCheckingDefaultValue
);
859 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue
);
861 int xmlThrDefDoValidityCheckingDefaultValue(int v
) {
863 xmlMutexLock(&xmlThrDefMutex
);
864 ret
= xmlDoValidityCheckingDefaultValueThrDef
;
865 xmlDoValidityCheckingDefaultValueThrDef
= v
;
866 xmlMutexUnlock(&xmlThrDefMutex
);
870 #undef xmlGenericError
871 xmlGenericErrorFunc
*
872 __xmlGenericError(void) {
874 return (&xmlGenericError
);
876 return (&xmlGetGlobalState()->xmlGenericError
);
879 #undef xmlStructuredError
880 xmlStructuredErrorFunc
*
881 __xmlStructuredError(void) {
883 return (&xmlStructuredError
);
885 return (&xmlGetGlobalState()->xmlStructuredError
);
888 #undef xmlGenericErrorContext
890 __xmlGenericErrorContext(void) {
892 return (&xmlGenericErrorContext
);
894 return (&xmlGetGlobalState()->xmlGenericErrorContext
);
897 #undef xmlStructuredErrorContext
899 __xmlStructuredErrorContext(void) {
901 return (&xmlStructuredErrorContext
);
903 return (&xmlGetGlobalState()->xmlStructuredErrorContext
);
906 #undef xmlGetWarningsDefaultValue
908 __xmlGetWarningsDefaultValue(void) {
910 return (&xmlGetWarningsDefaultValue
);
912 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue
);
914 int xmlThrDefGetWarningsDefaultValue(int v
) {
916 xmlMutexLock(&xmlThrDefMutex
);
917 ret
= xmlGetWarningsDefaultValueThrDef
;
918 xmlGetWarningsDefaultValueThrDef
= v
;
919 xmlMutexUnlock(&xmlThrDefMutex
);
923 #undef xmlIndentTreeOutput
925 __xmlIndentTreeOutput(void) {
927 return (&xmlIndentTreeOutput
);
929 return (&xmlGetGlobalState()->xmlIndentTreeOutput
);
931 int xmlThrDefIndentTreeOutput(int v
) {
933 xmlMutexLock(&xmlThrDefMutex
);
934 ret
= xmlIndentTreeOutputThrDef
;
935 xmlIndentTreeOutputThrDef
= v
;
936 xmlMutexUnlock(&xmlThrDefMutex
);
940 #undef xmlTreeIndentString
942 __xmlTreeIndentString(void) {
944 return (&xmlTreeIndentString
);
946 return (&xmlGetGlobalState()->xmlTreeIndentString
);
948 const char * xmlThrDefTreeIndentString(const char * v
) {
950 xmlMutexLock(&xmlThrDefMutex
);
951 ret
= xmlTreeIndentStringThrDef
;
952 xmlTreeIndentStringThrDef
= v
;
953 xmlMutexUnlock(&xmlThrDefMutex
);
957 #undef xmlKeepBlanksDefaultValue
959 __xmlKeepBlanksDefaultValue(void) {
961 return (&xmlKeepBlanksDefaultValue
);
963 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue
);
965 int xmlThrDefKeepBlanksDefaultValue(int v
) {
967 xmlMutexLock(&xmlThrDefMutex
);
968 ret
= xmlKeepBlanksDefaultValueThrDef
;
969 xmlKeepBlanksDefaultValueThrDef
= v
;
970 xmlMutexUnlock(&xmlThrDefMutex
);
974 #undef xmlLineNumbersDefaultValue
976 __xmlLineNumbersDefaultValue(void) {
978 return (&xmlLineNumbersDefaultValue
);
980 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue
);
982 int xmlThrDefLineNumbersDefaultValue(int v
) {
984 xmlMutexLock(&xmlThrDefMutex
);
985 ret
= xmlLineNumbersDefaultValueThrDef
;
986 xmlLineNumbersDefaultValueThrDef
= v
;
987 xmlMutexUnlock(&xmlThrDefMutex
);
991 #undef xmlLoadExtDtdDefaultValue
993 __xmlLoadExtDtdDefaultValue(void) {
995 return (&xmlLoadExtDtdDefaultValue
);
997 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue
);
999 int xmlThrDefLoadExtDtdDefaultValue(int v
) {
1001 xmlMutexLock(&xmlThrDefMutex
);
1002 ret
= xmlLoadExtDtdDefaultValueThrDef
;
1003 xmlLoadExtDtdDefaultValueThrDef
= v
;
1004 xmlMutexUnlock(&xmlThrDefMutex
);
1008 #undef xmlParserDebugEntities
1010 __xmlParserDebugEntities(void) {
1012 return (&xmlParserDebugEntities
);
1014 return (&xmlGetGlobalState()->xmlParserDebugEntities
);
1016 int xmlThrDefParserDebugEntities(int v
) {
1018 xmlMutexLock(&xmlThrDefMutex
);
1019 ret
= xmlParserDebugEntitiesThrDef
;
1020 xmlParserDebugEntitiesThrDef
= v
;
1021 xmlMutexUnlock(&xmlThrDefMutex
);
1025 #undef xmlParserVersion
1027 __xmlParserVersion(void) {
1029 return (&xmlParserVersion
);
1031 return (&xmlGetGlobalState()->xmlParserVersion
);
1034 #undef xmlPedanticParserDefaultValue
1036 __xmlPedanticParserDefaultValue(void) {
1038 return (&xmlPedanticParserDefaultValue
);
1040 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue
);
1042 int xmlThrDefPedanticParserDefaultValue(int v
) {
1044 xmlMutexLock(&xmlThrDefMutex
);
1045 ret
= xmlPedanticParserDefaultValueThrDef
;
1046 xmlPedanticParserDefaultValueThrDef
= v
;
1047 xmlMutexUnlock(&xmlThrDefMutex
);
1051 #undef xmlSaveNoEmptyTags
1053 __xmlSaveNoEmptyTags(void) {
1055 return (&xmlSaveNoEmptyTags
);
1057 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags
);
1059 int xmlThrDefSaveNoEmptyTags(int v
) {
1061 xmlMutexLock(&xmlThrDefMutex
);
1062 ret
= xmlSaveNoEmptyTagsThrDef
;
1063 xmlSaveNoEmptyTagsThrDef
= v
;
1064 xmlMutexUnlock(&xmlThrDefMutex
);
1068 #undef xmlSubstituteEntitiesDefaultValue
1070 __xmlSubstituteEntitiesDefaultValue(void) {
1072 return (&xmlSubstituteEntitiesDefaultValue
);
1074 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue
);
1076 int xmlThrDefSubstituteEntitiesDefaultValue(int v
) {
1078 xmlMutexLock(&xmlThrDefMutex
);
1079 ret
= xmlSubstituteEntitiesDefaultValueThrDef
;
1080 xmlSubstituteEntitiesDefaultValueThrDef
= v
;
1081 xmlMutexUnlock(&xmlThrDefMutex
);
1085 #undef xmlRegisterNodeDefaultValue
1086 xmlRegisterNodeFunc
* XMLCALL
1087 __xmlRegisterNodeDefaultValue(void) {
1089 return (&xmlRegisterNodeDefaultValue
);
1091 return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue
);
1094 #undef xmlDeregisterNodeDefaultValue
1095 xmlDeregisterNodeFunc
* XMLCALL
1096 __xmlDeregisterNodeDefaultValue(void) {
1098 return (&xmlDeregisterNodeDefaultValue
);
1100 return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue
);
1103 #undef xmlParserInputBufferCreateFilenameValue
1104 xmlParserInputBufferCreateFilenameFunc
* XMLCALL
1105 __xmlParserInputBufferCreateFilenameValue(void) {
1107 return (&xmlParserInputBufferCreateFilenameValue
);
1109 return (&xmlGetGlobalState()->xmlParserInputBufferCreateFilenameValue
);
1112 #undef xmlOutputBufferCreateFilenameValue
1113 xmlOutputBufferCreateFilenameFunc
* XMLCALL
1114 __xmlOutputBufferCreateFilenameValue(void) {
1116 return (&xmlOutputBufferCreateFilenameValue
);
1118 return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue
);