1 /* libxml2 - Library for parsing XML documents
2  * Copyright (C) 2006-2019 Free Software Foundation, Inc.
3  *
4  * This file is not part of the GNU gettext program, but is used with
5  * GNU gettext.
6  *
7  * The original copyright notice is as follows:
8  */
9 
10 /*
11  * Copyright (C) 1998-2012 Daniel Veillard.  All Rights Reserved.
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a copy
14  * of this software and associated documentation files (the "Software"), to deal
15  * in the Software without restriction, including without limitation the rights
16  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17  * copies of the Software, and to permit persons to whom the Software is fur-
18  * nished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included in
21  * all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
25  * NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
26  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29  * THE SOFTWARE.
30  *
31  * Gary Pennington <Gary.Pennington@uk.sun.com>
32  * daniel@veillard.com
33  */
34 
35 /*
36  * globals.c: definition and handling of the set of global variables
37  *            of the library
38  *
39  * The bottom of this file is automatically generated by build_glob.py
40  * based on the description file global.data
41  */
42 
43 #define IN_LIBXML
44 #include "libxml.h"
45 
46 #ifdef HAVE_STDLIB_H
47 #include <stdlib.h>
48 #endif
49 #include <string.h>
50 
51 #include <libxml/globals.h>
52 #include <libxml/xmlmemory.h>
53 #include <libxml/threads.h>
54 
55 /* #define DEBUG_GLOBALS */
56 
57 /*
58  * Helpful Macro
59  */
60 #ifdef LIBXML_THREAD_ENABLED
61 #define IS_MAIN_THREAD (xmlIsMainThread())
62 #else
63 #define IS_MAIN_THREAD 1
64 #endif
65 
66 /*
67  * Mutex to protect "ForNewThreads" variables
68  */
69 static xmlMutexPtr xmlThrDefMutex = NULL;
70 
71 /**
72  * xmlInitGlobals:
73  *
74  * Additional initialisation for multi-threading
75  */
xmlInitGlobals(void)76 void xmlInitGlobals(void)
77 {
78     if (xmlThrDefMutex == NULL)
79         xmlThrDefMutex = xmlNewMutex();
80 }
81 
82 /**
83  * xmlCleanupGlobals:
84  *
85  * Additional cleanup for multi-threading
86  */
xmlCleanupGlobals(void)87 void xmlCleanupGlobals(void)
88 {
89     if (xmlThrDefMutex != NULL) {
90 	xmlFreeMutex(xmlThrDefMutex);
91 	xmlThrDefMutex = NULL;
92     }
93     __xmlGlobalInitMutexDestroy();
94 }
95 
96 /************************************************************************
97  *									*
98  *	All the user accessible global variables of the library		*
99  *									*
100  ************************************************************************/
101 
102 #if !defined IN_LIBTEXTSTYLE
103 
104 /*
105  * Memory allocation routines
106  */
107 #undef	xmlFree
108 #undef	xmlMalloc
109 #undef	xmlMallocAtomic
110 #undef	xmlMemStrdup
111 #undef	xmlRealloc
112 
113 #endif
114 
115 #if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY)
116 xmlFreeFunc xmlFree = (xmlFreeFunc) xmlMemFree;
117 xmlMallocFunc xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
118 xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc;
119 xmlReallocFunc xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
120 xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
121 #else
122 /**
123  * xmlFree:
124  * @mem: an already allocated block of memory
125  *
126  * The variable holding the libxml free() implementation
127  */
128 xmlFreeFunc xmlFree = free;
129 /**
130  * xmlMalloc:
131  * @size:  the size requested in bytes
132  *
133  * The variable holding the libxml malloc() implementation
134  *
135  * Returns a pointer to the newly allocated block or NULL in case of error
136  */
137 xmlMallocFunc xmlMalloc = malloc;
138 /**
139  * xmlMallocAtomic:
140  * @size:  the size requested in bytes
141  *
142  * The variable holding the libxml malloc() implementation for atomic
143  * data (i.e. blocks not containings pointers), useful when using a
144  * garbage collecting allocator.
145  *
146  * Returns a pointer to the newly allocated block or NULL in case of error
147  */
148 xmlMallocFunc xmlMallocAtomic = malloc;
149 /**
150  * xmlRealloc:
151  * @mem: an already allocated block of memory
152  * @size:  the new size requested in bytes
153  *
154  * The variable holding the libxml realloc() implementation
155  *
156  * Returns a pointer to the newly reallocated block or NULL in case of error
157  */
158 xmlReallocFunc xmlRealloc = realloc;
159 /**
160  * xmlPosixStrdup
161  * @cur:  the input char *
162  *
163  * a strdup implementation with a type signature matching POSIX
164  *
165  * Returns a new xmlChar * or NULL
166  */
167 static char *
xmlPosixStrdup(const char * cur)168 xmlPosixStrdup(const char *cur) {
169     return((char*) xmlCharStrdup(cur));
170 }
171 /**
172  * xmlMemStrdup:
173  * @str: a zero terminated string
174  *
175  * The variable holding the libxml strdup() implementation
176  *
177  * Returns the copy of the string or NULL in case of error
178  */
179 xmlStrdupFunc xmlMemStrdup = xmlPosixStrdup;
180 #endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */
181 
182 #include <libxml/threads.h>
183 #include <libxml/globals.h>
184 #include <libxml/SAX.h>
185 
186 #if !defined IN_LIBTEXTSTYLE
187 
188 #undef	docbDefaultSAXHandler
189 #undef	htmlDefaultSAXHandler
190 #undef	oldXMLWDcompatibility
191 #undef	xmlBufferAllocScheme
192 #undef	xmlDefaultBufferSize
193 #undef	xmlDefaultSAXHandler
194 #undef	xmlDefaultSAXLocator
195 #undef	xmlDoValidityCheckingDefaultValue
196 #undef	xmlGenericError
197 #undef	xmlStructuredError
198 #undef	xmlGenericErrorContext
199 #undef	xmlStructuredErrorContext
200 #undef	xmlGetWarningsDefaultValue
201 #undef	xmlIndentTreeOutput
202 #undef  xmlTreeIndentString
203 #undef	xmlKeepBlanksDefaultValue
204 #undef	xmlLineNumbersDefaultValue
205 #undef	xmlLoadExtDtdDefaultValue
206 #undef	xmlParserDebugEntities
207 #undef	xmlParserVersion
208 #undef	xmlPedanticParserDefaultValue
209 #undef	xmlSaveNoEmptyTags
210 #undef	xmlSubstituteEntitiesDefaultValue
211 #undef	xmlRegisterNodeDefaultValue
212 #undef	xmlDeregisterNodeDefaultValue
213 #undef	xmlLastError
214 
215 #undef  xmlParserInputBufferCreateFilenameValue
216 #undef  xmlOutputBufferCreateFilenameValue
217 
218 #endif
219 
220 /**
221  * xmlParserVersion:
222  *
223  * Constant string describing the internal version of the library
224  */
225 const char *xmlParserVersion = LIBXML_VERSION_STRING LIBXML_VERSION_EXTRA;
226 
227 /**
228  * xmlBufferAllocScheme:
229  *
230  * Global setting, default allocation policy for buffers, default is
231  * XML_BUFFER_ALLOC_EXACT
232  */
233 xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
234 static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef = XML_BUFFER_ALLOC_EXACT;
235 /**
236  * xmlDefaultBufferSize:
237  *
238  * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
239  */
240 int xmlDefaultBufferSize = BASE_BUFFER_SIZE;
241 static int xmlDefaultBufferSizeThrDef = BASE_BUFFER_SIZE;
242 
243 /*
244  * Parser defaults
245  */
246 
247 /**
248  * oldXMLWDcompatibility:
249  *
250  * Global setting, DEPRECATED.
251  */
252 int oldXMLWDcompatibility = 0; /* DEPRECATED */
253 /**
254  * xmlParserDebugEntities:
255  *
256  * Global setting, asking the parser to print out debugging informations.
257  * while handling entities.
258  * Disabled by default
259  */
260 int xmlParserDebugEntities = 0;
261 static int xmlParserDebugEntitiesThrDef = 0;
262 /**
263  * xmlDoValidityCheckingDefaultValue:
264  *
265  * Global setting, indicate that the parser should work in validating mode.
266  * Disabled by default.
267  */
268 int xmlDoValidityCheckingDefaultValue = 0;
269 static int xmlDoValidityCheckingDefaultValueThrDef = 0;
270 /**
271  * xmlGetWarningsDefaultValue:
272  *
273  * Global setting, indicate that the parser should provide warnings.
274  * Activated by default.
275  */
276 int xmlGetWarningsDefaultValue = 1;
277 static int xmlGetWarningsDefaultValueThrDef = 1;
278 /**
279  * xmlLoadExtDtdDefaultValue:
280  *
281  * Global setting, indicate that the parser should load DTD while not
282  * validating.
283  * Disabled by default.
284  */
285 int xmlLoadExtDtdDefaultValue = 0;
286 static int xmlLoadExtDtdDefaultValueThrDef = 0;
287 /**
288  * xmlPedanticParserDefaultValue:
289  *
290  * Global setting, indicate that the parser be pedantic
291  * Disabled by default.
292  */
293 int xmlPedanticParserDefaultValue = 0;
294 static int xmlPedanticParserDefaultValueThrDef = 0;
295 /**
296  * xmlLineNumbersDefaultValue:
297  *
298  * Global setting, indicate that the parser should store the line number
299  * in the content field of elements in the DOM tree.
300  * Disabled by default since this may not be safe for old classes of
301  * applicaton.
302  */
303 int xmlLineNumbersDefaultValue = 0;
304 static int xmlLineNumbersDefaultValueThrDef = 0;
305 /**
306  * xmlKeepBlanksDefaultValue:
307  *
308  * Global setting, indicate that the parser should keep all blanks
309  * nodes found in the content
310  * Activated by default, this is actually needed to have the parser
311  * conformant to the XML Recommendation, however the option is kept
312  * for some applications since this was libxml1 default behaviour.
313  */
314 int xmlKeepBlanksDefaultValue = 1;
315 static int xmlKeepBlanksDefaultValueThrDef = 1;
316 /**
317  * xmlSubstituteEntitiesDefaultValue:
318  *
319  * Global setting, indicate that the parser should not generate entity
320  * references but replace them with the actual content of the entity
321  * Disabled by default, this should be activated when using XPath since
322  * the XPath data model requires entities replacement and the XPath
323  * engine does not handle entities references transparently.
324  */
325 int xmlSubstituteEntitiesDefaultValue = 0;
326 static int xmlSubstituteEntitiesDefaultValueThrDef = 0;
327 
328 xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL;
329 static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef = NULL;
330 xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue = NULL;
331 static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef = NULL;
332 
333 xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue = NULL;
334 static xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValueThrDef = NULL;
335 
336 xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue = NULL;
337 static xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValueThrDef = NULL;
338 
339 /*
340  * Error handling
341  */
342 
343 /* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
344 /* Must initialize xmlGenericError in xmlInitParser */
345 void XMLCDECL xmlGenericErrorDefaultFunc	(void *ctx ATTRIBUTE_UNUSED,
346 				 const char *msg,
347 				 ...);
348 /**
349  * xmlGenericError:
350  *
351  * Global setting: function used for generic error callbacks
352  */
353 xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc;
354 static xmlGenericErrorFunc xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc;
355 /**
356  * xmlStructuredError:
357  *
358  * Global setting: function used for structured error callbacks
359  */
360 xmlStructuredErrorFunc xmlStructuredError = NULL;
361 static xmlStructuredErrorFunc xmlStructuredErrorThrDef = NULL;
362 /**
363  * xmlGenericErrorContext:
364  *
365  * Global setting passed to generic error callbacks
366  */
367 void *xmlGenericErrorContext = NULL;
368 static void *xmlGenericErrorContextThrDef = NULL;
369 /**
370  * xmlStructuredErrorContext:
371  *
372  * Global setting passed to structured error callbacks
373  */
374 void *xmlStructuredErrorContext = NULL;
375 static void *xmlStructuredErrorContextThrDef = NULL;
376 xmlError xmlLastError;
377 
378 /*
379  * output defaults
380  */
381 /**
382  * xmlIndentTreeOutput:
383  *
384  * Global setting, asking the serializer to indent the output tree by default
385  * Enabled by default
386  */
387 int xmlIndentTreeOutput = 1;
388 static int xmlIndentTreeOutputThrDef = 1;
389 
390 /**
391  * xmlTreeIndentString:
392  *
393  * The string used to do one-level indent. By default is equal to "  " (two spaces)
394  */
395 const char *xmlTreeIndentString = "  ";
396 static const char *xmlTreeIndentStringThrDef = "  ";
397 
398 /**
399  * xmlSaveNoEmptyTags:
400  *
401  * Global setting, asking the serializer to not output empty tags
402  * as <empty/> but <empty></empty>. those two forms are undistinguishable
403  * once parsed.
404  * Disabled by default
405  */
406 int xmlSaveNoEmptyTags = 0;
407 static int xmlSaveNoEmptyTagsThrDef = 0;
408 
409 #ifdef LIBXML_SAX1_ENABLED
410 /**
411  * xmlDefaultSAXHandler:
412  *
413  * Default SAX version1 handler for XML, builds the DOM tree
414  */
415 xmlSAXHandlerV1 xmlDefaultSAXHandler = {
416     xmlSAX2InternalSubset,
417     xmlSAX2IsStandalone,
418     xmlSAX2HasInternalSubset,
419     xmlSAX2HasExternalSubset,
420     xmlSAX2ResolveEntity,
421     xmlSAX2GetEntity,
422     xmlSAX2EntityDecl,
423     xmlSAX2NotationDecl,
424     xmlSAX2AttributeDecl,
425     xmlSAX2ElementDecl,
426     xmlSAX2UnparsedEntityDecl,
427     xmlSAX2SetDocumentLocator,
428     xmlSAX2StartDocument,
429     xmlSAX2EndDocument,
430     xmlSAX2StartElement,
431     xmlSAX2EndElement,
432     xmlSAX2Reference,
433     xmlSAX2Characters,
434     xmlSAX2Characters,
435     xmlSAX2ProcessingInstruction,
436     xmlSAX2Comment,
437     xmlParserWarning,
438     xmlParserError,
439     xmlParserError,
440     xmlSAX2GetParameterEntity,
441     xmlSAX2CDataBlock,
442     xmlSAX2ExternalSubset,
443     0,
444 };
445 #endif /* LIBXML_SAX1_ENABLED */
446 
447 /**
448  * xmlDefaultSAXLocator:
449  *
450  * The default SAX Locator
451  * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
452  */
453 xmlSAXLocator xmlDefaultSAXLocator = {
454     xmlSAX2GetPublicId,
455     xmlSAX2GetSystemId,
456     xmlSAX2GetLineNumber,
457     xmlSAX2GetColumnNumber
458 };
459 
460 #ifdef LIBXML_HTML_ENABLED
461 /**
462  * htmlDefaultSAXHandler:
463  *
464  * Default old SAX v1 handler for HTML, builds the DOM tree
465  */
466 xmlSAXHandlerV1 htmlDefaultSAXHandler = {
467     xmlSAX2InternalSubset,
468     NULL,
469     NULL,
470     NULL,
471     NULL,
472     xmlSAX2GetEntity,
473     NULL,
474     NULL,
475     NULL,
476     NULL,
477     NULL,
478     xmlSAX2SetDocumentLocator,
479     xmlSAX2StartDocument,
480     xmlSAX2EndDocument,
481     xmlSAX2StartElement,
482     xmlSAX2EndElement,
483     NULL,
484     xmlSAX2Characters,
485     xmlSAX2IgnorableWhitespace,
486     xmlSAX2ProcessingInstruction,
487     xmlSAX2Comment,
488     xmlParserWarning,
489     xmlParserError,
490     xmlParserError,
491     xmlSAX2GetParameterEntity,
492     xmlSAX2CDataBlock,
493     NULL,
494     0,
495 };
496 #endif /* LIBXML_HTML_ENABLED */
497 
498 #ifdef LIBXML_DOCB_ENABLED
499 /**
500  * docbDefaultSAXHandler:
501  *
502  * Default old SAX v1 handler for SGML DocBook, builds the DOM tree
503  */
504 xmlSAXHandlerV1 docbDefaultSAXHandler = {
505     xmlSAX2InternalSubset,
506     xmlSAX2IsStandalone,
507     xmlSAX2HasInternalSubset,
508     xmlSAX2HasExternalSubset,
509     xmlSAX2ResolveEntity,
510     xmlSAX2GetEntity,
511     xmlSAX2EntityDecl,
512     NULL,
513     NULL,
514     NULL,
515     NULL,
516     xmlSAX2SetDocumentLocator,
517     xmlSAX2StartDocument,
518     xmlSAX2EndDocument,
519     xmlSAX2StartElement,
520     xmlSAX2EndElement,
521     xmlSAX2Reference,
522     xmlSAX2Characters,
523     xmlSAX2IgnorableWhitespace,
524     NULL,
525     xmlSAX2Comment,
526     xmlParserWarning,
527     xmlParserError,
528     xmlParserError,
529     xmlSAX2GetParameterEntity,
530     NULL,
531     NULL,
532     0,
533 };
534 #endif /* LIBXML_DOCB_ENABLED */
535 
536 /**
537  * xmlInitializeGlobalState:
538  * @gs: a pointer to a newly allocated global state
539  *
540  * xmlInitializeGlobalState() initialize a global state with all the
541  * default values of the library.
542  */
543 void
xmlInitializeGlobalState(xmlGlobalStatePtr gs)544 xmlInitializeGlobalState(xmlGlobalStatePtr gs)
545 {
546 #ifdef DEBUG_GLOBALS
547     fprintf(stderr, "Initializing globals at %lu for thread %d\n",
548 	    (unsigned long) gs, xmlGetThreadId());
549 #endif
550 
551     /*
552      * Perform initialization as required by libxml
553      */
554     if (xmlThrDefMutex == NULL)
555         xmlInitGlobals();
556 
557     xmlMutexLock(xmlThrDefMutex);
558 
559 #if defined(LIBXML_DOCB_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
560     initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
561 #endif
562 #if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
563     inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
564 #endif
565 
566     gs->oldXMLWDcompatibility = 0;
567     gs->xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef;
568     gs->xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef;
569 #if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_LEGACY_ENABLED)
570     initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
571 #endif /* LIBXML_SAX1_ENABLED */
572     gs->xmlDefaultSAXLocator.getPublicId = xmlSAX2GetPublicId;
573     gs->xmlDefaultSAXLocator.getSystemId = xmlSAX2GetSystemId;
574     gs->xmlDefaultSAXLocator.getLineNumber = xmlSAX2GetLineNumber;
575     gs->xmlDefaultSAXLocator.getColumnNumber = xmlSAX2GetColumnNumber;
576     gs->xmlDoValidityCheckingDefaultValue =
577          xmlDoValidityCheckingDefaultValueThrDef;
578 #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
579     gs->xmlFree = (xmlFreeFunc) xmlMemFree;
580     gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
581     gs->xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc;
582     gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
583     gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
584 #else
585     gs->xmlFree = (xmlFreeFunc) free;
586     gs->xmlMalloc = (xmlMallocFunc) malloc;
587     gs->xmlMallocAtomic = (xmlMallocFunc) malloc;
588     gs->xmlRealloc = (xmlReallocFunc) realloc;
589     gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
590 #endif
591     gs->xmlGetWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef;
592     gs->xmlIndentTreeOutput = xmlIndentTreeOutputThrDef;
593     gs->xmlTreeIndentString = xmlTreeIndentStringThrDef;
594     gs->xmlKeepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef;
595     gs->xmlLineNumbersDefaultValue = xmlLineNumbersDefaultValueThrDef;
596     gs->xmlLoadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef;
597     gs->xmlParserDebugEntities = xmlParserDebugEntitiesThrDef;
598     gs->xmlParserVersion = LIBXML_VERSION_STRING;
599     gs->xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef;
600     gs->xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef;
601     gs->xmlSubstituteEntitiesDefaultValue =
602         xmlSubstituteEntitiesDefaultValueThrDef;
603 
604     gs->xmlGenericError = xmlGenericErrorThrDef;
605     gs->xmlStructuredError = xmlStructuredErrorThrDef;
606     gs->xmlGenericErrorContext = xmlGenericErrorContextThrDef;
607     gs->xmlStructuredErrorContext = xmlStructuredErrorContextThrDef;
608     gs->xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef;
609     gs->xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef;
610 
611 	gs->xmlParserInputBufferCreateFilenameValue = xmlParserInputBufferCreateFilenameValueThrDef;
612 	gs->xmlOutputBufferCreateFilenameValue = xmlOutputBufferCreateFilenameValueThrDef;
613     memset(&gs->xmlLastError, 0, sizeof(xmlError));
614 
615     xmlMutexUnlock(xmlThrDefMutex);
616 }
617 
618 /**
619  * DOC_DISABLE : we ignore missing doc for the xmlThrDef functions,
620  *               those are really internal work
621  */
622 void
xmlThrDefSetGenericErrorFunc(void * ctx,xmlGenericErrorFunc handler)623 xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
624     xmlMutexLock(xmlThrDefMutex);
625     xmlGenericErrorContextThrDef = ctx;
626     if (handler != NULL)
627 	xmlGenericErrorThrDef = handler;
628     else
629 	xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc;
630     xmlMutexUnlock(xmlThrDefMutex);
631 }
632 
633 void
xmlThrDefSetStructuredErrorFunc(void * ctx,xmlStructuredErrorFunc handler)634 xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler) {
635     xmlMutexLock(xmlThrDefMutex);
636     xmlStructuredErrorContextThrDef = ctx;
637     xmlStructuredErrorThrDef = handler;
638     xmlMutexUnlock(xmlThrDefMutex);
639 }
640 
641 /**
642  * xmlRegisterNodeDefault:
643  * @func: function pointer to the new RegisterNodeFunc
644  *
645  * Registers a callback for node creation
646  *
647  * Returns the old value of the registration function
648  */
649 xmlRegisterNodeFunc
xmlRegisterNodeDefault(xmlRegisterNodeFunc func)650 xmlRegisterNodeDefault(xmlRegisterNodeFunc func)
651 {
652     xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue;
653 
654     __xmlRegisterCallbacks = 1;
655     xmlRegisterNodeDefaultValue = func;
656     return(old);
657 }
658 
659 xmlRegisterNodeFunc
xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func)660 xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func)
661 {
662     xmlRegisterNodeFunc old;
663 
664     xmlMutexLock(xmlThrDefMutex);
665     old = xmlRegisterNodeDefaultValueThrDef;
666 
667     __xmlRegisterCallbacks = 1;
668     xmlRegisterNodeDefaultValueThrDef = func;
669     xmlMutexUnlock(xmlThrDefMutex);
670 
671     return(old);
672 }
673 
674 /**
675  * xmlDeregisterNodeDefault:
676  * @func: function pointer to the new DeregisterNodeFunc
677  *
678  * Registers a callback for node destruction
679  *
680  * Returns the previous value of the deregistration function
681  */
682 xmlDeregisterNodeFunc
xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func)683 xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func)
684 {
685     xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue;
686 
687     __xmlRegisterCallbacks = 1;
688     xmlDeregisterNodeDefaultValue = func;
689     return(old);
690 }
691 
692 xmlDeregisterNodeFunc
xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func)693 xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func)
694 {
695     xmlDeregisterNodeFunc old;
696 
697     xmlMutexLock(xmlThrDefMutex);
698     old = xmlDeregisterNodeDefaultValueThrDef;
699 
700     __xmlRegisterCallbacks = 1;
701     xmlDeregisterNodeDefaultValueThrDef = func;
702     xmlMutexUnlock(xmlThrDefMutex);
703 
704     return(old);
705 }
706 
707 xmlParserInputBufferCreateFilenameFunc
xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func)708 xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func)
709 {
710     xmlParserInputBufferCreateFilenameFunc old;
711 
712     xmlMutexLock(xmlThrDefMutex);
713     old = xmlParserInputBufferCreateFilenameValueThrDef;
714     if (old == NULL) {
715 		old = __xmlParserInputBufferCreateFilename;
716 	}
717 
718     xmlParserInputBufferCreateFilenameValueThrDef = func;
719     xmlMutexUnlock(xmlThrDefMutex);
720 
721     return(old);
722 }
723 
724 xmlOutputBufferCreateFilenameFunc
xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func)725 xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func)
726 {
727     xmlOutputBufferCreateFilenameFunc old;
728 
729     xmlMutexLock(xmlThrDefMutex);
730     old = xmlOutputBufferCreateFilenameValueThrDef;
731 #ifdef LIBXML_OUTPUT_ENABLED
732     if (old == NULL) {
733 		old = __xmlOutputBufferCreateFilename;
734 	}
735 #endif
736     xmlOutputBufferCreateFilenameValueThrDef = func;
737     xmlMutexUnlock(xmlThrDefMutex);
738 
739     return(old);
740 }
741 
742 #ifdef LIBXML_DOCB_ENABLED
743 #if !defined IN_LIBTEXTSTYLE
744 #undef	docbDefaultSAXHandler
745 #endif
746 xmlSAXHandlerV1 *
__docbDefaultSAXHandler(void)747 __docbDefaultSAXHandler(void) {
748     if (IS_MAIN_THREAD)
749 	return (&docbDefaultSAXHandler);
750     else
751 	return (&xmlGetGlobalState()->docbDefaultSAXHandler);
752 }
753 #endif
754 
755 #ifdef LIBXML_HTML_ENABLED
756 #if !defined IN_LIBTEXTSTYLE
757 #undef	htmlDefaultSAXHandler
758 #endif
759 xmlSAXHandlerV1 *
__htmlDefaultSAXHandler(void)760 __htmlDefaultSAXHandler(void) {
761     if (IS_MAIN_THREAD)
762 	return (&htmlDefaultSAXHandler);
763     else
764 	return (&xmlGetGlobalState()->htmlDefaultSAXHandler);
765 }
766 #endif
767 
768 #if !defined IN_LIBTEXTSTYLE
769 #undef xmlLastError
770 #endif
771 xmlError *
__xmlLastError(void)772 __xmlLastError(void) {
773     if (IS_MAIN_THREAD)
774 	return (&xmlLastError);
775     else
776 	return (&xmlGetGlobalState()->xmlLastError);
777 }
778 
779 /*
780  * The following memory routines were apparently lost at some point,
781  * and were re-inserted at this point on June 10, 2004.  Hope it's
782  * the right place for them :-)
783  */
784 #if defined(LIBXML_THREAD_ALLOC_ENABLED) && defined(LIBXML_THREAD_ENABLED)
785 #if !defined IN_LIBTEXTSTYLE
786 #undef xmlMalloc
787 #endif
788 xmlMallocFunc *
__xmlMalloc(void)789 __xmlMalloc(void){
790     if (IS_MAIN_THREAD)
791         return (&xmlMalloc);
792     else
793 	return (&xmlGetGlobalState()->xmlMalloc);
794 }
795 
796 #if !defined IN_LIBTEXTSTYLE
797 #undef xmlMallocAtomic
798 #endif
799 xmlMallocFunc *
__xmlMallocAtomic(void)800 __xmlMallocAtomic(void){
801     if (IS_MAIN_THREAD)
802         return (&xmlMallocAtomic);
803     else
804         return (&xmlGetGlobalState()->xmlMallocAtomic);
805 }
806 
807 #if !defined IN_LIBTEXTSTYLE
808 #undef xmlRealloc
809 #endif
810 xmlReallocFunc *
__xmlRealloc(void)811 __xmlRealloc(void){
812     if (IS_MAIN_THREAD)
813         return (&xmlRealloc);
814     else
815         return (&xmlGetGlobalState()->xmlRealloc);
816 }
817 
818 #if !defined IN_LIBTEXTSTYLE
819 #undef xmlFree
820 #endif
821 xmlFreeFunc *
__xmlFree(void)822 __xmlFree(void){
823     if (IS_MAIN_THREAD)
824         return (&xmlFree);
825     else
826         return (&xmlGetGlobalState()->xmlFree);
827 }
828 
829 xmlStrdupFunc *
__xmlMemStrdup(void)830 __xmlMemStrdup(void){
831     if (IS_MAIN_THREAD)
832         return (&xmlMemStrdup);
833     else
834         return (&xmlGetGlobalState()->xmlMemStrdup);
835 }
836 
837 #endif
838 
839 /*
840  * Everything starting from the line below is
841  * Automatically generated by build_glob.py.
842  * Do not modify the previous line.
843  */
844 
845 
846 #if !defined IN_LIBTEXTSTYLE
847 #undef	oldXMLWDcompatibility
848 #endif
849 int *
__oldXMLWDcompatibility(void)850 __oldXMLWDcompatibility(void) {
851     if (IS_MAIN_THREAD)
852 	return (&oldXMLWDcompatibility);
853     else
854 	return (&xmlGetGlobalState()->oldXMLWDcompatibility);
855 }
856 
857 #if !defined IN_LIBTEXTSTYLE
858 #undef	xmlBufferAllocScheme
859 #endif
860 xmlBufferAllocationScheme *
__xmlBufferAllocScheme(void)861 __xmlBufferAllocScheme(void) {
862     if (IS_MAIN_THREAD)
863 	return (&xmlBufferAllocScheme);
864     else
865 	return (&xmlGetGlobalState()->xmlBufferAllocScheme);
866 }
xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v)867 xmlBufferAllocationScheme xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v) {
868     xmlBufferAllocationScheme ret;
869     xmlMutexLock(xmlThrDefMutex);
870     ret = xmlBufferAllocSchemeThrDef;
871     xmlBufferAllocSchemeThrDef = v;
872     xmlMutexUnlock(xmlThrDefMutex);
873     return ret;
874 }
875 
876 #if !defined IN_LIBTEXTSTYLE
877 #undef	xmlDefaultBufferSize
878 #endif
879 int *
__xmlDefaultBufferSize(void)880 __xmlDefaultBufferSize(void) {
881     if (IS_MAIN_THREAD)
882 	return (&xmlDefaultBufferSize);
883     else
884 	return (&xmlGetGlobalState()->xmlDefaultBufferSize);
885 }
xmlThrDefDefaultBufferSize(int v)886 int xmlThrDefDefaultBufferSize(int v) {
887     int ret;
888     xmlMutexLock(xmlThrDefMutex);
889     ret = xmlDefaultBufferSizeThrDef;
890     xmlDefaultBufferSizeThrDef = v;
891     xmlMutexUnlock(xmlThrDefMutex);
892     return ret;
893 }
894 
895 #ifdef LIBXML_SAX1_ENABLED
896 #if !defined IN_LIBTEXTSTYLE
897 #undef	xmlDefaultSAXHandler
898 #endif
899 xmlSAXHandlerV1 *
__xmlDefaultSAXHandler(void)900 __xmlDefaultSAXHandler(void) {
901     if (IS_MAIN_THREAD)
902 	return (&xmlDefaultSAXHandler);
903     else
904 	return (&xmlGetGlobalState()->xmlDefaultSAXHandler);
905 }
906 #endif /* LIBXML_SAX1_ENABLED */
907 
908 #if !defined IN_LIBTEXTSTYLE
909 #undef	xmlDefaultSAXLocator
910 #endif
911 xmlSAXLocator *
__xmlDefaultSAXLocator(void)912 __xmlDefaultSAXLocator(void) {
913     if (IS_MAIN_THREAD)
914 	return (&xmlDefaultSAXLocator);
915     else
916 	return (&xmlGetGlobalState()->xmlDefaultSAXLocator);
917 }
918 
919 #if !defined IN_LIBTEXTSTYLE
920 #undef	xmlDoValidityCheckingDefaultValue
921 #endif
922 int *
__xmlDoValidityCheckingDefaultValue(void)923 __xmlDoValidityCheckingDefaultValue(void) {
924     if (IS_MAIN_THREAD)
925 	return (&xmlDoValidityCheckingDefaultValue);
926     else
927 	return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue);
928 }
xmlThrDefDoValidityCheckingDefaultValue(int v)929 int xmlThrDefDoValidityCheckingDefaultValue(int v) {
930     int ret;
931     xmlMutexLock(xmlThrDefMutex);
932     ret = xmlDoValidityCheckingDefaultValueThrDef;
933     xmlDoValidityCheckingDefaultValueThrDef = v;
934     xmlMutexUnlock(xmlThrDefMutex);
935     return ret;
936 }
937 
938 #if !defined IN_LIBTEXTSTYLE
939 #undef	xmlGenericError
940 #endif
941 xmlGenericErrorFunc *
__xmlGenericError(void)942 __xmlGenericError(void) {
943     if (IS_MAIN_THREAD)
944 	return (&xmlGenericError);
945     else
946 	return (&xmlGetGlobalState()->xmlGenericError);
947 }
948 
949 #if !defined IN_LIBTEXTSTYLE
950 #undef	xmlStructuredError
951 #endif
952 xmlStructuredErrorFunc *
__xmlStructuredError(void)953 __xmlStructuredError(void) {
954     if (IS_MAIN_THREAD)
955 	return (&xmlStructuredError);
956     else
957 	return (&xmlGetGlobalState()->xmlStructuredError);
958 }
959 
960 #if !defined IN_LIBTEXTSTYLE
961 #undef	xmlGenericErrorContext
962 #endif
963 void * *
__xmlGenericErrorContext(void)964 __xmlGenericErrorContext(void) {
965     if (IS_MAIN_THREAD)
966 	return (&xmlGenericErrorContext);
967     else
968 	return (&xmlGetGlobalState()->xmlGenericErrorContext);
969 }
970 
971 #if !defined IN_LIBTEXTSTYLE
972 #undef	xmlStructuredErrorContext
973 #endif
974 void * *
__xmlStructuredErrorContext(void)975 __xmlStructuredErrorContext(void) {
976     if (IS_MAIN_THREAD)
977 	return (&xmlStructuredErrorContext);
978     else
979 	return (&xmlGetGlobalState()->xmlStructuredErrorContext);
980 }
981 
982 #if !defined IN_LIBTEXTSTYLE
983 #undef	xmlGetWarningsDefaultValue
984 #endif
985 int *
__xmlGetWarningsDefaultValue(void)986 __xmlGetWarningsDefaultValue(void) {
987     if (IS_MAIN_THREAD)
988 	return (&xmlGetWarningsDefaultValue);
989     else
990 	return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue);
991 }
xmlThrDefGetWarningsDefaultValue(int v)992 int xmlThrDefGetWarningsDefaultValue(int v) {
993     int ret;
994     xmlMutexLock(xmlThrDefMutex);
995     ret = xmlGetWarningsDefaultValueThrDef;
996     xmlGetWarningsDefaultValueThrDef = v;
997     xmlMutexUnlock(xmlThrDefMutex);
998     return ret;
999 }
1000 
1001 #if !defined IN_LIBTEXTSTYLE
1002 #undef	xmlIndentTreeOutput
1003 #endif
1004 int *
__xmlIndentTreeOutput(void)1005 __xmlIndentTreeOutput(void) {
1006     if (IS_MAIN_THREAD)
1007 	return (&xmlIndentTreeOutput);
1008     else
1009 	return (&xmlGetGlobalState()->xmlIndentTreeOutput);
1010 }
xmlThrDefIndentTreeOutput(int v)1011 int xmlThrDefIndentTreeOutput(int v) {
1012     int ret;
1013     xmlMutexLock(xmlThrDefMutex);
1014     ret = xmlIndentTreeOutputThrDef;
1015     xmlIndentTreeOutputThrDef = v;
1016     xmlMutexUnlock(xmlThrDefMutex);
1017     return ret;
1018 }
1019 
1020 #if !defined IN_LIBTEXTSTYLE
1021 #undef	xmlTreeIndentString
1022 #endif
1023 const char * *
__xmlTreeIndentString(void)1024 __xmlTreeIndentString(void) {
1025     if (IS_MAIN_THREAD)
1026 	return (&xmlTreeIndentString);
1027     else
1028 	return (&xmlGetGlobalState()->xmlTreeIndentString);
1029 }
xmlThrDefTreeIndentString(const char * v)1030 const char * xmlThrDefTreeIndentString(const char * v) {
1031     const char * ret;
1032     xmlMutexLock(xmlThrDefMutex);
1033     ret = xmlTreeIndentStringThrDef;
1034     xmlTreeIndentStringThrDef = v;
1035     xmlMutexUnlock(xmlThrDefMutex);
1036     return ret;
1037 }
1038 
1039 #if !defined IN_LIBTEXTSTYLE
1040 #undef	xmlKeepBlanksDefaultValue
1041 #endif
1042 int *
__xmlKeepBlanksDefaultValue(void)1043 __xmlKeepBlanksDefaultValue(void) {
1044     if (IS_MAIN_THREAD)
1045 	return (&xmlKeepBlanksDefaultValue);
1046     else
1047 	return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue);
1048 }
xmlThrDefKeepBlanksDefaultValue(int v)1049 int xmlThrDefKeepBlanksDefaultValue(int v) {
1050     int ret;
1051     xmlMutexLock(xmlThrDefMutex);
1052     ret = xmlKeepBlanksDefaultValueThrDef;
1053     xmlKeepBlanksDefaultValueThrDef = v;
1054     xmlMutexUnlock(xmlThrDefMutex);
1055     return ret;
1056 }
1057 
1058 #if !defined IN_LIBTEXTSTYLE
1059 #undef	xmlLineNumbersDefaultValue
1060 #endif
1061 int *
__xmlLineNumbersDefaultValue(void)1062 __xmlLineNumbersDefaultValue(void) {
1063     if (IS_MAIN_THREAD)
1064 	return (&xmlLineNumbersDefaultValue);
1065     else
1066 	return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue);
1067 }
xmlThrDefLineNumbersDefaultValue(int v)1068 int xmlThrDefLineNumbersDefaultValue(int v) {
1069     int ret;
1070     xmlMutexLock(xmlThrDefMutex);
1071     ret = xmlLineNumbersDefaultValueThrDef;
1072     xmlLineNumbersDefaultValueThrDef = v;
1073     xmlMutexUnlock(xmlThrDefMutex);
1074     return ret;
1075 }
1076 
1077 #if !defined IN_LIBTEXTSTYLE
1078 #undef	xmlLoadExtDtdDefaultValue
1079 #endif
1080 int *
__xmlLoadExtDtdDefaultValue(void)1081 __xmlLoadExtDtdDefaultValue(void) {
1082     if (IS_MAIN_THREAD)
1083 	return (&xmlLoadExtDtdDefaultValue);
1084     else
1085 	return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue);
1086 }
xmlThrDefLoadExtDtdDefaultValue(int v)1087 int xmlThrDefLoadExtDtdDefaultValue(int v) {
1088     int ret;
1089     xmlMutexLock(xmlThrDefMutex);
1090     ret = xmlLoadExtDtdDefaultValueThrDef;
1091     xmlLoadExtDtdDefaultValueThrDef = v;
1092     xmlMutexUnlock(xmlThrDefMutex);
1093     return ret;
1094 }
1095 
1096 #if !defined IN_LIBTEXTSTYLE
1097 #undef	xmlParserDebugEntities
1098 #endif
1099 int *
__xmlParserDebugEntities(void)1100 __xmlParserDebugEntities(void) {
1101     if (IS_MAIN_THREAD)
1102 	return (&xmlParserDebugEntities);
1103     else
1104 	return (&xmlGetGlobalState()->xmlParserDebugEntities);
1105 }
xmlThrDefParserDebugEntities(int v)1106 int xmlThrDefParserDebugEntities(int v) {
1107     int ret;
1108     xmlMutexLock(xmlThrDefMutex);
1109     ret = xmlParserDebugEntitiesThrDef;
1110     xmlParserDebugEntitiesThrDef = v;
1111     xmlMutexUnlock(xmlThrDefMutex);
1112     return ret;
1113 }
1114 
1115 #if !defined IN_LIBTEXTSTYLE
1116 #undef	xmlParserVersion
1117 #endif
1118 const char * *
__xmlParserVersion(void)1119 __xmlParserVersion(void) {
1120     if (IS_MAIN_THREAD)
1121 	return (&xmlParserVersion);
1122     else
1123 	return (&xmlGetGlobalState()->xmlParserVersion);
1124 }
1125 
1126 #if !defined IN_LIBTEXTSTYLE
1127 #undef	xmlPedanticParserDefaultValue
1128 #endif
1129 int *
__xmlPedanticParserDefaultValue(void)1130 __xmlPedanticParserDefaultValue(void) {
1131     if (IS_MAIN_THREAD)
1132 	return (&xmlPedanticParserDefaultValue);
1133     else
1134 	return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue);
1135 }
xmlThrDefPedanticParserDefaultValue(int v)1136 int xmlThrDefPedanticParserDefaultValue(int v) {
1137     int ret;
1138     xmlMutexLock(xmlThrDefMutex);
1139     ret = xmlPedanticParserDefaultValueThrDef;
1140     xmlPedanticParserDefaultValueThrDef = v;
1141     xmlMutexUnlock(xmlThrDefMutex);
1142     return ret;
1143 }
1144 
1145 #if !defined IN_LIBTEXTSTYLE
1146 #undef	xmlSaveNoEmptyTags
1147 #endif
1148 int *
__xmlSaveNoEmptyTags(void)1149 __xmlSaveNoEmptyTags(void) {
1150     if (IS_MAIN_THREAD)
1151 	return (&xmlSaveNoEmptyTags);
1152     else
1153 	return (&xmlGetGlobalState()->xmlSaveNoEmptyTags);
1154 }
xmlThrDefSaveNoEmptyTags(int v)1155 int xmlThrDefSaveNoEmptyTags(int v) {
1156     int ret;
1157     xmlMutexLock(xmlThrDefMutex);
1158     ret = xmlSaveNoEmptyTagsThrDef;
1159     xmlSaveNoEmptyTagsThrDef = v;
1160     xmlMutexUnlock(xmlThrDefMutex);
1161     return ret;
1162 }
1163 
1164 #if !defined IN_LIBTEXTSTYLE
1165 #undef	xmlSubstituteEntitiesDefaultValue
1166 #endif
1167 int *
__xmlSubstituteEntitiesDefaultValue(void)1168 __xmlSubstituteEntitiesDefaultValue(void) {
1169     if (IS_MAIN_THREAD)
1170 	return (&xmlSubstituteEntitiesDefaultValue);
1171     else
1172 	return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue);
1173 }
xmlThrDefSubstituteEntitiesDefaultValue(int v)1174 int xmlThrDefSubstituteEntitiesDefaultValue(int v) {
1175     int ret;
1176     xmlMutexLock(xmlThrDefMutex);
1177     ret = xmlSubstituteEntitiesDefaultValueThrDef;
1178     xmlSubstituteEntitiesDefaultValueThrDef = v;
1179     xmlMutexUnlock(xmlThrDefMutex);
1180     return ret;
1181 }
1182 
1183 #if !defined IN_LIBTEXTSTYLE
1184 #undef	xmlRegisterNodeDefaultValue
1185 #endif
1186 xmlRegisterNodeFunc *
__xmlRegisterNodeDefaultValue(void)1187 __xmlRegisterNodeDefaultValue(void) {
1188     if (IS_MAIN_THREAD)
1189 	return (&xmlRegisterNodeDefaultValue);
1190     else
1191 	return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue);
1192 }
1193 
1194 #if !defined IN_LIBTEXTSTYLE
1195 #undef	xmlDeregisterNodeDefaultValue
1196 #endif
1197 xmlDeregisterNodeFunc *
__xmlDeregisterNodeDefaultValue(void)1198 __xmlDeregisterNodeDefaultValue(void) {
1199     if (IS_MAIN_THREAD)
1200 	return (&xmlDeregisterNodeDefaultValue);
1201     else
1202 	return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue);
1203 }
1204 
1205 #if !defined IN_LIBTEXTSTYLE
1206 #undef	xmlParserInputBufferCreateFilenameValue
1207 #endif
1208 xmlParserInputBufferCreateFilenameFunc *
__xmlParserInputBufferCreateFilenameValue(void)1209 __xmlParserInputBufferCreateFilenameValue(void) {
1210     if (IS_MAIN_THREAD)
1211 	return (&xmlParserInputBufferCreateFilenameValue);
1212     else
1213 	return (&xmlGetGlobalState()->xmlParserInputBufferCreateFilenameValue);
1214 }
1215 
1216 #if !defined IN_LIBTEXTSTYLE
1217 #undef	xmlOutputBufferCreateFilenameValue
1218 #endif
1219 xmlOutputBufferCreateFilenameFunc *
__xmlOutputBufferCreateFilenameValue(void)1220 __xmlOutputBufferCreateFilenameValue(void) {
1221     if (IS_MAIN_THREAD)
1222 	return (&xmlOutputBufferCreateFilenameValue);
1223     else
1224 	return (&xmlGetGlobalState()->xmlOutputBufferCreateFilenameValue);
1225 }
1226 
1227 #define bottom_globals
1228 #include "elfgcchack.h"
1229