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 /* #define DEBUG_GLOBALS */
29 #ifdef LIBXML_THREAD_ENABLED
30 #define IS_MAIN_THREAD (xmlIsMainThread())
32 #define IS_MAIN_THREAD 1
36 * Mutex to protect "ForNewThreads" variables
38 static xmlMutexPtr xmlThrDefMutex
= NULL
;
43 * DEPRECATED: This function will be made private. Call xmlInitParser to
44 * initialize the library.
46 * Additional initialisation for multi-threading
48 void xmlInitGlobals(void)
50 if (xmlThrDefMutex
== NULL
)
51 xmlThrDefMutex
= xmlNewMutex();
54 /************************************************************************
56 * All the user accessible global variables of the library *
58 ************************************************************************/
61 * Memory allocation routines
65 #undef xmlMallocAtomic
69 #if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY)
70 xmlFreeFunc xmlFree
= (xmlFreeFunc
) xmlMemFree
;
71 xmlMallocFunc xmlMalloc
= (xmlMallocFunc
) xmlMemMalloc
;
72 xmlMallocFunc xmlMallocAtomic
= (xmlMallocFunc
) xmlMemMalloc
;
73 xmlReallocFunc xmlRealloc
= (xmlReallocFunc
) xmlMemRealloc
;
74 xmlStrdupFunc xmlMemStrdup
= (xmlStrdupFunc
) xmlMemoryStrdup
;
78 * @mem: an already allocated block of memory
80 * The variable holding the libxml free() implementation
82 xmlFreeFunc xmlFree
= free
;
85 * @size: the size requested in bytes
87 * The variable holding the libxml malloc() implementation
89 * Returns a pointer to the newly allocated block or NULL in case of error
91 xmlMallocFunc xmlMalloc
= malloc
;
94 * @size: the size requested in bytes
96 * The variable holding the libxml malloc() implementation for atomic
97 * data (i.e. blocks not containing pointers), useful when using a
98 * garbage collecting allocator.
100 * Returns a pointer to the newly allocated block or NULL in case of error
102 xmlMallocFunc xmlMallocAtomic
= malloc
;
105 * @mem: an already allocated block of memory
106 * @size: the new size requested in bytes
108 * The variable holding the libxml realloc() implementation
110 * Returns a pointer to the newly reallocated block or NULL in case of error
112 xmlReallocFunc xmlRealloc
= realloc
;
115 * @cur: the input char *
117 * a strdup implementation with a type signature matching POSIX
119 * Returns a new xmlChar * or NULL
122 xmlPosixStrdup(const char *cur
) {
123 return((char*) xmlCharStrdup(cur
));
127 * @str: a zero terminated string
129 * The variable holding the libxml strdup() implementation
131 * Returns the copy of the string or NULL in case of error
133 xmlStrdupFunc xmlMemStrdup
= xmlPosixStrdup
;
134 #endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */
136 #include <libxml/threads.h>
137 #include <libxml/globals.h>
138 #include <libxml/SAX.h>
140 #undef htmlDefaultSAXHandler
141 #undef oldXMLWDcompatibility
142 #undef xmlBufferAllocScheme
143 #undef xmlDefaultBufferSize
144 #undef xmlDefaultSAXHandler
145 #undef xmlDefaultSAXLocator
146 #undef xmlDoValidityCheckingDefaultValue
147 #undef xmlGenericError
148 #undef xmlStructuredError
149 #undef xmlGenericErrorContext
150 #undef xmlStructuredErrorContext
151 #undef xmlGetWarningsDefaultValue
152 #undef xmlIndentTreeOutput
153 #undef xmlTreeIndentString
154 #undef xmlKeepBlanksDefaultValue
155 #undef xmlLineNumbersDefaultValue
156 #undef xmlLoadExtDtdDefaultValue
157 #undef xmlParserDebugEntities
158 #undef xmlParserVersion
159 #undef xmlPedanticParserDefaultValue
160 #undef xmlSaveNoEmptyTags
161 #undef xmlSubstituteEntitiesDefaultValue
162 #undef xmlRegisterNodeDefaultValue
163 #undef xmlDeregisterNodeDefaultValue
166 #undef xmlParserInputBufferCreateFilenameValue
167 #undef xmlOutputBufferCreateFilenameValue
171 * Constant string describing the internal version of the library
173 const char *xmlParserVersion
= LIBXML_VERSION_STRING LIBXML_VERSION_EXTRA
;
176 * xmlBufferAllocScheme:
178 * Global setting, default allocation policy for buffers, default is
179 * XML_BUFFER_ALLOC_EXACT
181 xmlBufferAllocationScheme xmlBufferAllocScheme
= XML_BUFFER_ALLOC_EXACT
;
182 static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef
= XML_BUFFER_ALLOC_EXACT
;
184 * xmlDefaultBufferSize:
186 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
188 int xmlDefaultBufferSize
= BASE_BUFFER_SIZE
;
189 static int xmlDefaultBufferSizeThrDef
= BASE_BUFFER_SIZE
;
196 * oldXMLWDcompatibility:
198 * Global setting, DEPRECATED.
200 int oldXMLWDcompatibility
= 0; /* DEPRECATED */
202 * xmlParserDebugEntities:
204 * Global setting, asking the parser to print out debugging information.
205 * while handling entities.
206 * Disabled by default
208 int xmlParserDebugEntities
= 0;
209 static int xmlParserDebugEntitiesThrDef
= 0;
211 * xmlDoValidityCheckingDefaultValue:
213 * Global setting, indicate that the parser should work in validating mode.
214 * Disabled by default.
216 int xmlDoValidityCheckingDefaultValue
= 0;
217 static int xmlDoValidityCheckingDefaultValueThrDef
= 0;
219 * xmlGetWarningsDefaultValue:
221 * Global setting, indicate that the parser should provide warnings.
222 * Activated by default.
224 int xmlGetWarningsDefaultValue
= 1;
225 static int xmlGetWarningsDefaultValueThrDef
= 1;
227 * xmlLoadExtDtdDefaultValue:
229 * Global setting, indicate that the parser should load DTD while not
231 * Disabled by default.
233 int xmlLoadExtDtdDefaultValue
= 0;
234 static int xmlLoadExtDtdDefaultValueThrDef
= 0;
236 * xmlPedanticParserDefaultValue:
238 * Global setting, indicate that the parser be pedantic
239 * Disabled by default.
241 int xmlPedanticParserDefaultValue
= 0;
242 static int xmlPedanticParserDefaultValueThrDef
= 0;
244 * xmlLineNumbersDefaultValue:
246 * Global setting, indicate that the parser should store the line number
247 * in the content field of elements in the DOM tree.
248 * Disabled by default since this may not be safe for old classes of
251 int xmlLineNumbersDefaultValue
= 0;
252 static int xmlLineNumbersDefaultValueThrDef
= 0;
254 * xmlKeepBlanksDefaultValue:
256 * Global setting, indicate that the parser should keep all blanks
257 * nodes found in the content
258 * Activated by default, this is actually needed to have the parser
259 * conformant to the XML Recommendation, however the option is kept
260 * for some applications since this was libxml1 default behaviour.
262 int xmlKeepBlanksDefaultValue
= 1;
263 static int xmlKeepBlanksDefaultValueThrDef
= 1;
265 * xmlSubstituteEntitiesDefaultValue:
267 * Global setting, indicate that the parser should not generate entity
268 * references but replace them with the actual content of the entity
269 * Disabled by default, this should be activated when using XPath since
270 * the XPath data model requires entities replacement and the XPath
271 * engine does not handle entities references transparently.
273 int xmlSubstituteEntitiesDefaultValue
= 0;
274 static int xmlSubstituteEntitiesDefaultValueThrDef
= 0;
276 xmlRegisterNodeFunc xmlRegisterNodeDefaultValue
= NULL
;
277 static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef
= NULL
;
278 xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue
= NULL
;
279 static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef
= NULL
;
281 xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue
= NULL
;
282 static xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValueThrDef
= NULL
;
284 xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue
= NULL
;
285 static xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValueThrDef
= NULL
;
291 /* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
292 /* Must initialize xmlGenericError in xmlInitParser */
293 void XMLCDECL
xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED
,
299 * Global setting: function used for generic error callbacks
301 xmlGenericErrorFunc xmlGenericError
= xmlGenericErrorDefaultFunc
;
302 static xmlGenericErrorFunc xmlGenericErrorThrDef
= xmlGenericErrorDefaultFunc
;
304 * xmlStructuredError:
306 * Global setting: function used for structured error callbacks
308 xmlStructuredErrorFunc xmlStructuredError
= NULL
;
309 static xmlStructuredErrorFunc xmlStructuredErrorThrDef
= NULL
;
311 * xmlGenericErrorContext:
313 * Global setting passed to generic error callbacks
315 void *xmlGenericErrorContext
= NULL
;
316 static void *xmlGenericErrorContextThrDef
= NULL
;
318 * xmlStructuredErrorContext:
320 * Global setting passed to structured error callbacks
322 void *xmlStructuredErrorContext
= NULL
;
323 static void *xmlStructuredErrorContextThrDef
= NULL
;
324 xmlError xmlLastError
;
330 * xmlIndentTreeOutput:
332 * Global setting, asking the serializer to indent the output tree by default
335 int xmlIndentTreeOutput
= 1;
336 static int xmlIndentTreeOutputThrDef
= 1;
339 * xmlTreeIndentString:
341 * The string used to do one-level indent. By default is equal to " " (two spaces)
343 const char *xmlTreeIndentString
= " ";
344 static const char *xmlTreeIndentStringThrDef
= " ";
347 * xmlSaveNoEmptyTags:
349 * Global setting, asking the serializer to not output empty tags
350 * as <empty/> but <empty></empty>. those two forms are indistinguishable
352 * Disabled by default
354 int xmlSaveNoEmptyTags
= 0;
355 static int xmlSaveNoEmptyTagsThrDef
= 0;
357 #ifdef LIBXML_SAX1_ENABLED
359 * xmlDefaultSAXHandler:
361 * Default SAX version1 handler for XML, builds the DOM tree
363 xmlSAXHandlerV1 xmlDefaultSAXHandler
= {
364 xmlSAX2InternalSubset
,
366 xmlSAX2HasInternalSubset
,
367 xmlSAX2HasExternalSubset
,
368 xmlSAX2ResolveEntity
,
372 xmlSAX2AttributeDecl
,
374 xmlSAX2UnparsedEntityDecl
,
375 xmlSAX2SetDocumentLocator
,
376 xmlSAX2StartDocument
,
383 xmlSAX2ProcessingInstruction
,
388 xmlSAX2GetParameterEntity
,
390 xmlSAX2ExternalSubset
,
393 #endif /* LIBXML_SAX1_ENABLED */
396 * xmlDefaultSAXLocator:
398 * The default SAX Locator
399 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
401 xmlSAXLocator xmlDefaultSAXLocator
= {
404 xmlSAX2GetLineNumber
,
405 xmlSAX2GetColumnNumber
408 #ifdef LIBXML_HTML_ENABLED
410 * htmlDefaultSAXHandler:
412 * Default old SAX v1 handler for HTML, builds the DOM tree
414 xmlSAXHandlerV1 htmlDefaultSAXHandler
= {
415 xmlSAX2InternalSubset
,
426 xmlSAX2SetDocumentLocator
,
427 xmlSAX2StartDocument
,
433 xmlSAX2IgnorableWhitespace
,
434 xmlSAX2ProcessingInstruction
,
439 xmlSAX2GetParameterEntity
,
444 #endif /* LIBXML_HTML_ENABLED */
447 * xmlInitializeGlobalState:
448 * @gs: a pointer to a newly allocated global state
450 * xmlInitializeGlobalState() initialize a global state with all the
451 * default values of the library.
454 xmlInitializeGlobalState(xmlGlobalStatePtr gs
)
457 fprintf(stderr
, "Initializing globals at %lu for thread %d\n",
458 (unsigned long) gs
, xmlGetThreadId());
462 * Perform initialization as required by libxml
464 if (xmlThrDefMutex
== NULL
)
467 xmlMutexLock(xmlThrDefMutex
);
469 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
470 inithtmlDefaultSAXHandler(&gs
->htmlDefaultSAXHandler
);
473 gs
->oldXMLWDcompatibility
= 0;
474 gs
->xmlBufferAllocScheme
= xmlBufferAllocSchemeThrDef
;
475 gs
->xmlDefaultBufferSize
= xmlDefaultBufferSizeThrDef
;
476 #if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_LEGACY_ENABLED)
477 initxmlDefaultSAXHandler(&gs
->xmlDefaultSAXHandler
, 1);
478 #endif /* LIBXML_SAX1_ENABLED */
479 gs
->xmlDefaultSAXLocator
.getPublicId
= xmlSAX2GetPublicId
;
480 gs
->xmlDefaultSAXLocator
.getSystemId
= xmlSAX2GetSystemId
;
481 gs
->xmlDefaultSAXLocator
.getLineNumber
= xmlSAX2GetLineNumber
;
482 gs
->xmlDefaultSAXLocator
.getColumnNumber
= xmlSAX2GetColumnNumber
;
483 gs
->xmlDoValidityCheckingDefaultValue
=
484 xmlDoValidityCheckingDefaultValueThrDef
;
485 #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
486 gs
->xmlFree
= (xmlFreeFunc
) xmlMemFree
;
487 gs
->xmlMalloc
= (xmlMallocFunc
) xmlMemMalloc
;
488 gs
->xmlMallocAtomic
= (xmlMallocFunc
) xmlMemMalloc
;
489 gs
->xmlRealloc
= (xmlReallocFunc
) xmlMemRealloc
;
490 gs
->xmlMemStrdup
= (xmlStrdupFunc
) xmlMemoryStrdup
;
492 gs
->xmlFree
= (xmlFreeFunc
) free
;
493 gs
->xmlMalloc
= (xmlMallocFunc
) malloc
;
494 gs
->xmlMallocAtomic
= (xmlMallocFunc
) malloc
;
495 gs
->xmlRealloc
= (xmlReallocFunc
) realloc
;
496 gs
->xmlMemStrdup
= (xmlStrdupFunc
) xmlStrdup
;
498 gs
->xmlGetWarningsDefaultValue
= xmlGetWarningsDefaultValueThrDef
;
499 gs
->xmlIndentTreeOutput
= xmlIndentTreeOutputThrDef
;
500 gs
->xmlTreeIndentString
= xmlTreeIndentStringThrDef
;
501 gs
->xmlKeepBlanksDefaultValue
= xmlKeepBlanksDefaultValueThrDef
;
502 gs
->xmlLineNumbersDefaultValue
= xmlLineNumbersDefaultValueThrDef
;
503 gs
->xmlLoadExtDtdDefaultValue
= xmlLoadExtDtdDefaultValueThrDef
;
504 gs
->xmlParserDebugEntities
= xmlParserDebugEntitiesThrDef
;
505 gs
->xmlParserVersion
= LIBXML_VERSION_STRING
;
506 gs
->xmlPedanticParserDefaultValue
= xmlPedanticParserDefaultValueThrDef
;
507 gs
->xmlSaveNoEmptyTags
= xmlSaveNoEmptyTagsThrDef
;
508 gs
->xmlSubstituteEntitiesDefaultValue
=
509 xmlSubstituteEntitiesDefaultValueThrDef
;
511 gs
->xmlGenericError
= xmlGenericErrorThrDef
;
512 gs
->xmlStructuredError
= xmlStructuredErrorThrDef
;
513 gs
->xmlGenericErrorContext
= xmlGenericErrorContextThrDef
;
514 gs
->xmlStructuredErrorContext
= xmlStructuredErrorContextThrDef
;
515 gs
->xmlRegisterNodeDefaultValue
= xmlRegisterNodeDefaultValueThrDef
;
516 gs
->xmlDeregisterNodeDefaultValue
= xmlDeregisterNodeDefaultValueThrDef
;
518 gs
->xmlParserInputBufferCreateFilenameValue
= xmlParserInputBufferCreateFilenameValueThrDef
;
519 gs
->xmlOutputBufferCreateFilenameValue
= xmlOutputBufferCreateFilenameValueThrDef
;
520 memset(&gs
->xmlLastError
, 0, sizeof(xmlError
));
522 xmlMutexUnlock(xmlThrDefMutex
);
528 * DEPRECATED: This function will be made private. Call xmlCleanupParser
529 * to free global state but see the warnings there. xmlCleanupParser
530 * should be only called once at program exit. In most cases, you don't
531 * have call cleanup functions at all.
533 * Additional cleanup for multi-threading
535 void xmlCleanupGlobals(void)
537 xmlResetError(&xmlLastError
);
539 if (xmlThrDefMutex
!= NULL
) {
540 xmlFreeMutex(xmlThrDefMutex
);
541 xmlThrDefMutex
= NULL
;
543 __xmlGlobalInitMutexDestroy();
547 * DOC_DISABLE : we ignore missing doc for the xmlThrDef functions,
548 * those are really internal work
551 xmlThrDefSetGenericErrorFunc(void *ctx
, xmlGenericErrorFunc handler
) {
552 xmlMutexLock(xmlThrDefMutex
);
553 xmlGenericErrorContextThrDef
= ctx
;
555 xmlGenericErrorThrDef
= handler
;
557 xmlGenericErrorThrDef
= xmlGenericErrorDefaultFunc
;
558 xmlMutexUnlock(xmlThrDefMutex
);
562 xmlThrDefSetStructuredErrorFunc(void *ctx
, xmlStructuredErrorFunc handler
) {
563 xmlMutexLock(xmlThrDefMutex
);
564 xmlStructuredErrorContextThrDef
= ctx
;
565 xmlStructuredErrorThrDef
= handler
;
566 xmlMutexUnlock(xmlThrDefMutex
);
570 * xmlRegisterNodeDefault:
571 * @func: function pointer to the new RegisterNodeFunc
573 * Registers a callback for node creation
575 * Returns the old value of the registration function
578 xmlRegisterNodeDefault(xmlRegisterNodeFunc func
)
580 xmlRegisterNodeFunc old
= xmlRegisterNodeDefaultValue
;
582 __xmlRegisterCallbacks
= 1;
583 xmlRegisterNodeDefaultValue
= func
;
588 xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func
)
590 xmlRegisterNodeFunc old
;
592 xmlMutexLock(xmlThrDefMutex
);
593 old
= xmlRegisterNodeDefaultValueThrDef
;
595 __xmlRegisterCallbacks
= 1;
596 xmlRegisterNodeDefaultValueThrDef
= func
;
597 xmlMutexUnlock(xmlThrDefMutex
);
603 * xmlDeregisterNodeDefault:
604 * @func: function pointer to the new DeregisterNodeFunc
606 * Registers a callback for node destruction
608 * Returns the previous value of the deregistration function
610 xmlDeregisterNodeFunc
611 xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func
)
613 xmlDeregisterNodeFunc old
= xmlDeregisterNodeDefaultValue
;
615 __xmlRegisterCallbacks
= 1;
616 xmlDeregisterNodeDefaultValue
= func
;
620 xmlDeregisterNodeFunc
621 xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func
)
623 xmlDeregisterNodeFunc old
;
625 xmlMutexLock(xmlThrDefMutex
);
626 old
= xmlDeregisterNodeDefaultValueThrDef
;
628 __xmlRegisterCallbacks
= 1;
629 xmlDeregisterNodeDefaultValueThrDef
= func
;
630 xmlMutexUnlock(xmlThrDefMutex
);
635 xmlParserInputBufferCreateFilenameFunc
636 xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func
)
638 xmlParserInputBufferCreateFilenameFunc old
;
640 xmlMutexLock(xmlThrDefMutex
);
641 old
= xmlParserInputBufferCreateFilenameValueThrDef
;
643 old
= __xmlParserInputBufferCreateFilename
;
646 xmlParserInputBufferCreateFilenameValueThrDef
= func
;
647 xmlMutexUnlock(xmlThrDefMutex
);
652 xmlOutputBufferCreateFilenameFunc
653 xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func
)
655 xmlOutputBufferCreateFilenameFunc old
;
657 xmlMutexLock(xmlThrDefMutex
);
658 old
= xmlOutputBufferCreateFilenameValueThrDef
;
659 #ifdef LIBXML_OUTPUT_ENABLED
661 old
= __xmlOutputBufferCreateFilename
;
664 xmlOutputBufferCreateFilenameValueThrDef
= func
;
665 xmlMutexUnlock(xmlThrDefMutex
);
670 #ifdef LIBXML_HTML_ENABLED
671 #undef htmlDefaultSAXHandler
673 __htmlDefaultSAXHandler(void) {
675 return (&htmlDefaultSAXHandler
);
677 return (&xmlGetGlobalState()->htmlDefaultSAXHandler
);
683 __xmlLastError(void) {
685 return (&xmlLastError
);
687 return (&xmlGetGlobalState()->xmlLastError
);
691 * The following memory routines were apparently lost at some point,
692 * and were re-inserted at this point on June 10, 2004. Hope it's
693 * the right place for them :-)
695 #if defined(LIBXML_THREAD_ALLOC_ENABLED) && defined(LIBXML_THREAD_ENABLED)
702 return (&xmlGetGlobalState()->xmlMalloc
);
705 #undef xmlMallocAtomic
707 __xmlMallocAtomic(void){
709 return (&xmlMallocAtomic
);
711 return (&xmlGetGlobalState()->xmlMallocAtomic
);
718 return (&xmlRealloc
);
720 return (&xmlGetGlobalState()->xmlRealloc
);
729 return (&xmlGetGlobalState()->xmlFree
);
733 __xmlMemStrdup(void){
735 return (&xmlMemStrdup
);
737 return (&xmlGetGlobalState()->xmlMemStrdup
);
743 * Everything starting from the line below is
744 * Automatically generated by build_glob.py.
745 * Do not modify the previous line.
749 #undef oldXMLWDcompatibility
751 __oldXMLWDcompatibility(void) {
753 return (&oldXMLWDcompatibility
);
755 return (&xmlGetGlobalState()->oldXMLWDcompatibility
);
758 #undef xmlBufferAllocScheme
759 xmlBufferAllocationScheme
*
760 __xmlBufferAllocScheme(void) {
762 return (&xmlBufferAllocScheme
);
764 return (&xmlGetGlobalState()->xmlBufferAllocScheme
);
766 xmlBufferAllocationScheme
xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v
) {
767 xmlBufferAllocationScheme ret
;
768 xmlMutexLock(xmlThrDefMutex
);
769 ret
= xmlBufferAllocSchemeThrDef
;
770 xmlBufferAllocSchemeThrDef
= v
;
771 xmlMutexUnlock(xmlThrDefMutex
);
775 #undef xmlDefaultBufferSize
777 __xmlDefaultBufferSize(void) {
779 return (&xmlDefaultBufferSize
);
781 return (&xmlGetGlobalState()->xmlDefaultBufferSize
);
783 int xmlThrDefDefaultBufferSize(int v
) {
785 xmlMutexLock(xmlThrDefMutex
);
786 ret
= xmlDefaultBufferSizeThrDef
;
787 xmlDefaultBufferSizeThrDef
= v
;
788 xmlMutexUnlock(xmlThrDefMutex
);
792 #ifdef LIBXML_SAX1_ENABLED
793 #undef xmlDefaultSAXHandler
795 __xmlDefaultSAXHandler(void) {
797 return (&xmlDefaultSAXHandler
);
799 return (&xmlGetGlobalState()->xmlDefaultSAXHandler
);
801 #endif /* LIBXML_SAX1_ENABLED */
803 #undef xmlDefaultSAXLocator
805 __xmlDefaultSAXLocator(void) {
807 return (&xmlDefaultSAXLocator
);
809 return (&xmlGetGlobalState()->xmlDefaultSAXLocator
);
812 #undef xmlDoValidityCheckingDefaultValue
814 __xmlDoValidityCheckingDefaultValue(void) {
816 return (&xmlDoValidityCheckingDefaultValue
);
818 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue
);
820 int xmlThrDefDoValidityCheckingDefaultValue(int v
) {
822 xmlMutexLock(xmlThrDefMutex
);
823 ret
= xmlDoValidityCheckingDefaultValueThrDef
;
824 xmlDoValidityCheckingDefaultValueThrDef
= v
;
825 xmlMutexUnlock(xmlThrDefMutex
);
829 #undef xmlGenericError
830 xmlGenericErrorFunc
* XMLCALL
831 __xmlGenericError(void) {
833 return (&xmlGenericError
);
835 return (&xmlGetGlobalState()->xmlGenericError
);
838 #undef xmlStructuredError
839 xmlStructuredErrorFunc
*
840 __xmlStructuredError(void) {
842 return (&xmlStructuredError
);
844 return (&xmlGetGlobalState()->xmlStructuredError
);
847 #undef xmlGenericErrorContext
849 __xmlGenericErrorContext(void) {
851 return (&xmlGenericErrorContext
);
853 return (&xmlGetGlobalState()->xmlGenericErrorContext
);
856 #undef xmlStructuredErrorContext
858 __xmlStructuredErrorContext(void) {
860 return (&xmlStructuredErrorContext
);
862 return (&xmlGetGlobalState()->xmlStructuredErrorContext
);
865 #undef xmlGetWarningsDefaultValue
867 __xmlGetWarningsDefaultValue(void) {
869 return (&xmlGetWarningsDefaultValue
);
871 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue
);
873 int xmlThrDefGetWarningsDefaultValue(int v
) {
875 xmlMutexLock(xmlThrDefMutex
);
876 ret
= xmlGetWarningsDefaultValueThrDef
;
877 xmlGetWarningsDefaultValueThrDef
= v
;
878 xmlMutexUnlock(xmlThrDefMutex
);
882 #undef xmlIndentTreeOutput
884 __xmlIndentTreeOutput(void) {
886 return (&xmlIndentTreeOutput
);
888 return (&xmlGetGlobalState()->xmlIndentTreeOutput
);
890 int xmlThrDefIndentTreeOutput(int v
) {
892 xmlMutexLock(xmlThrDefMutex
);
893 ret
= xmlIndentTreeOutputThrDef
;
894 xmlIndentTreeOutputThrDef
= v
;
895 xmlMutexUnlock(xmlThrDefMutex
);
899 #undef xmlTreeIndentString
901 __xmlTreeIndentString(void) {
903 return (&xmlTreeIndentString
);
905 return (&xmlGetGlobalState()->xmlTreeIndentString
);
907 const char * xmlThrDefTreeIndentString(const char * v
) {
909 xmlMutexLock(xmlThrDefMutex
);
910 ret
= xmlTreeIndentStringThrDef
;
911 xmlTreeIndentStringThrDef
= v
;
912 xmlMutexUnlock(xmlThrDefMutex
);
916 #undef xmlKeepBlanksDefaultValue
918 __xmlKeepBlanksDefaultValue(void) {
920 return (&xmlKeepBlanksDefaultValue
);
922 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue
);
924 int xmlThrDefKeepBlanksDefaultValue(int v
) {
926 xmlMutexLock(xmlThrDefMutex
);
927 ret
= xmlKeepBlanksDefaultValueThrDef
;
928 xmlKeepBlanksDefaultValueThrDef
= v
;
929 xmlMutexUnlock(xmlThrDefMutex
);
933 #undef xmlLineNumbersDefaultValue
935 __xmlLineNumbersDefaultValue(void) {
937 return (&xmlLineNumbersDefaultValue
);
939 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue
);
941 int xmlThrDefLineNumbersDefaultValue(int v
) {
943 xmlMutexLock(xmlThrDefMutex
);
944 ret
= xmlLineNumbersDefaultValueThrDef
;
945 xmlLineNumbersDefaultValueThrDef
= v
;
946 xmlMutexUnlock(xmlThrDefMutex
);
950 #undef xmlLoadExtDtdDefaultValue
952 __xmlLoadExtDtdDefaultValue(void) {
954 return (&xmlLoadExtDtdDefaultValue
);
956 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue
);
958 int xmlThrDefLoadExtDtdDefaultValue(int v
) {
960 xmlMutexLock(xmlThrDefMutex
);
961 ret
= xmlLoadExtDtdDefaultValueThrDef
;
962 xmlLoadExtDtdDefaultValueThrDef
= v
;
963 xmlMutexUnlock(xmlThrDefMutex
);
967 #undef xmlParserDebugEntities
969 __xmlParserDebugEntities(void) {
971 return (&xmlParserDebugEntities
);
973 return (&xmlGetGlobalState()->xmlParserDebugEntities
);
975 int xmlThrDefParserDebugEntities(int v
) {
977 xmlMutexLock(xmlThrDefMutex
);
978 ret
= xmlParserDebugEntitiesThrDef
;
979 xmlParserDebugEntitiesThrDef
= v
;
980 xmlMutexUnlock(xmlThrDefMutex
);
984 #undef xmlParserVersion
986 __xmlParserVersion(void) {
988 return (&xmlParserVersion
);
990 return (&xmlGetGlobalState()->xmlParserVersion
);
993 #undef xmlPedanticParserDefaultValue
995 __xmlPedanticParserDefaultValue(void) {
997 return (&xmlPedanticParserDefaultValue
);
999 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue
);
1001 int xmlThrDefPedanticParserDefaultValue(int v
) {
1003 xmlMutexLock(xmlThrDefMutex
);
1004 ret
= xmlPedanticParserDefaultValueThrDef
;
1005 xmlPedanticParserDefaultValueThrDef
= v
;
1006 xmlMutexUnlock(xmlThrDefMutex
);
1010 #undef xmlSaveNoEmptyTags
1012 __xmlSaveNoEmptyTags(void) {
1014 return (&xmlSaveNoEmptyTags
);
1016 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags
);
1018 int xmlThrDefSaveNoEmptyTags(int v
) {
1020 xmlMutexLock(xmlThrDefMutex
);
1021 ret
= xmlSaveNoEmptyTagsThrDef
;
1022 xmlSaveNoEmptyTagsThrDef
= v
;
1023 xmlMutexUnlock(xmlThrDefMutex
);
1027 #undef xmlSubstituteEntitiesDefaultValue
1029 __xmlSubstituteEntitiesDefaultValue(void) {
1031 return (&xmlSubstituteEntitiesDefaultValue
);
1033 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue
);
1035 int xmlThrDefSubstituteEntitiesDefaultValue(int v
) {
1037 xmlMutexLock(xmlThrDefMutex
);
1038 ret
= xmlSubstituteEntitiesDefaultValueThrDef
;
1039 xmlSubstituteEntitiesDefaultValueThrDef
= v
;
1040 xmlMutexUnlock(xmlThrDefMutex
);
1044 #undef xmlRegisterNodeDefaultValue
1045 xmlRegisterNodeFunc
* XMLCALL
1046 __xmlRegisterNodeDefaultValue(void) {
1048 return (&xmlRegisterNodeDefaultValue
);
1050 return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue
);
1053 #undef xmlDeregisterNodeDefaultValue
1054 xmlDeregisterNodeFunc
* XMLCALL
1055 __xmlDeregisterNodeDefaultValue(void) {
1057 return (&xmlDeregisterNodeDefaultValue
);
1059 return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue
);
1062 #undef xmlParserInputBufferCreateFilenameValue
1063 xmlParserInputBufferCreateFilenameFunc
* XMLCALL
1064 __xmlParserInputBufferCreateFilenameValue(void) {
1066 return (&xmlParserInputBufferCreateFilenameValue
);
1068 return (&xmlGetGlobalState()->xmlParserInputBufferCreateFilenameValue
);
1071 #undef xmlOutputBufferCreateFilenameValue
1072 xmlOutputBufferCreateFilenameFunc
* XMLCALL
1073 __xmlOutputBufferCreateFilenameValue(void) {
1075 return (&xmlOutputBufferCreateFilenameValue
);
1077 return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue
);