blob: ee6417bc6be8bdc98a7bfca37e4190917d14ae1c [file] [log] [blame]
Daniel Veillardb8478642001-10-12 17:29:10 +00001/*
2 * globals.c: definition and handling of the set of global variables
3 * of the library
4 *
5 * The bottom of this file is automatically generated by build_glob.py
6 * based on the description file global.data
7 *
8 * See Copyright for the status of this software.
9 *
10 * Gary Pennington <Gary.Pennington@uk.sun.com>
11 * daniel@veillard.com
12 */
13
Daniel Veillard34ce8be2002-03-18 19:37:11 +000014#define IN_LIBXML
Daniel Veillardb8478642001-10-12 17:29:10 +000015#include "libxml.h"
16
Daniel Veillarde7090612001-10-13 12:18:28 +000017#ifdef HAVE_STDLIB_H
Jaka Mocnik77d19ae2001-10-13 12:06:09 +000018#include <stdlib.h>
Daniel Veillarde7090612001-10-13 12:18:28 +000019#endif
Jaka Mocnik77d19ae2001-10-13 12:06:09 +000020#include <string.h>
21
Daniel Veillard3c01b1d2001-10-17 15:58:35 +000022#include <libxml/globals.h>
Daniel Veillarde7090612001-10-13 12:18:28 +000023#include <libxml/xmlmemory.h>
Daniel Veillard781ac8b2003-05-15 22:11:36 +000024#include <libxml/threads.h>
Daniel Veillarde7090612001-10-13 12:18:28 +000025
Daniel Veillard3c01b1d2001-10-17 15:58:35 +000026/* #define DEBUG_GLOBALS */
27
Daniel Veillardb8478642001-10-12 17:29:10 +000028/*
29 * Helpful Macro
30 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +000031#ifdef LIBXML_THREAD_ENABLED
32#define IS_MAIN_THREAD (xmlIsMainThread())
Daniel Veillardb8478642001-10-12 17:29:10 +000033#else
34#define IS_MAIN_THREAD 1
35#endif
36
Daniel Veillard781ac8b2003-05-15 22:11:36 +000037/*
38 * Mutex to protect "ForNewThreads" variables
39 */
40static xmlMutexPtr xmlThrDefMutex = NULL;
41
42void xmlInitGlobals()
43{
44 xmlThrDefMutex = xmlNewMutex();
45}
46
47void xmlCleanupGlobals()
48{
49 xmlFreeMutex(xmlThrDefMutex);
50}
51
Daniel Veillardb8478642001-10-12 17:29:10 +000052/************************************************************************
53 * *
54 * All the user accessible global variables of the library *
55 * *
56 ************************************************************************/
57
Daniel Veillardb8478642001-10-12 17:29:10 +000058/*
59 * Memory allocation routines
60 */
Daniel Veillard7216cfd2002-11-08 15:10:00 +000061#if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY)
Daniel Veillardd0463562001-10-13 09:15:48 +000062extern void xmlMemFree(void *ptr);
63extern void * xmlMemMalloc(size_t size);
64extern void * xmlMemRealloc(void *ptr,size_t size);
65extern char * xmlMemoryStrdup(const char *str);
66
Daniel Veillardb8478642001-10-12 17:29:10 +000067xmlFreeFunc xmlFree = (xmlFreeFunc) xmlMemFree;
68xmlMallocFunc xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillard3c908dc2003-04-19 00:07:51 +000069xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillardb8478642001-10-12 17:29:10 +000070xmlReallocFunc xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
71xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
72#else
Daniel Veillard9d06d302002-01-22 18:15:52 +000073/**
74 * xmlFree:
75 * @mem: an already allocated block of memory
76 *
77 * The variable holding the libxml free() implementation
78 */
Daniel Veillardb8478642001-10-12 17:29:10 +000079xmlFreeFunc xmlFree = (xmlFreeFunc) free;
Daniel Veillard9d06d302002-01-22 18:15:52 +000080/**
81 * xmlMalloc:
82 * @size: the size requested in bytes
83 *
84 * The variable holding the libxml malloc() implementation
85 *
86 * Returns a pointer to the newly allocated block or NULL in case of error
87 */
Daniel Veillardb8478642001-10-12 17:29:10 +000088xmlMallocFunc xmlMalloc = (xmlMallocFunc) malloc;
Daniel Veillard9d06d302002-01-22 18:15:52 +000089/**
Daniel Veillard3c908dc2003-04-19 00:07:51 +000090 * xmlMallocAtomic:
91 * @size: the size requested in bytes
92 *
93 * The variable holding the libxml malloc() implementation for atomic
94 * data (i.e. blocks not containings pointers), useful when using a
95 * garbage collecting allocator.
96 *
97 * Returns a pointer to the newly allocated block or NULL in case of error
98 */
99xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) malloc;
100/**
Daniel Veillard9d06d302002-01-22 18:15:52 +0000101 * xmlRealloc:
102 * @mem: an already allocated block of memory
103 * @size: the new size requested in bytes
104 *
105 * The variable holding the libxml realloc() implementation
106 *
107 * Returns a pointer to the newly reallocated block or NULL in case of error
108 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000109xmlReallocFunc xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000110/**
111 * xmlMemStrdup:
112 * @str: a zero terminated string
113 *
114 * The variable holding the libxml strdup() implementation
115 *
116 * Returns the copy of the string or NULL in case of error
117 */
Daniel Veillardb82c1662001-12-09 14:00:54 +0000118xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +0000119#endif
120
Daniel Veillardd0463562001-10-13 09:15:48 +0000121#include <libxml/threads.h>
122#include <libxml/globals.h>
123#include <libxml/SAX.h>
124
125#undef docbDefaultSAXHandler
126#undef htmlDefaultSAXHandler
127#undef oldXMLWDcompatibility
128#undef xmlBufferAllocScheme
129#undef xmlDefaultBufferSize
130#undef xmlDefaultSAXHandler
131#undef xmlDefaultSAXLocator
132#undef xmlDoValidityCheckingDefaultValue
133#undef xmlGenericError
134#undef xmlGenericErrorContext
135#undef xmlGetWarningsDefaultValue
136#undef xmlIndentTreeOutput
Aleksey Sanin23002562002-05-24 07:18:40 +0000137#undef xmlTreeIndentString
Daniel Veillardd0463562001-10-13 09:15:48 +0000138#undef xmlKeepBlanksDefaultValue
139#undef xmlLineNumbersDefaultValue
140#undef xmlLoadExtDtdDefaultValue
141#undef xmlParserDebugEntities
142#undef xmlParserVersion
143#undef xmlPedanticParserDefaultValue
144#undef xmlSaveNoEmptyTags
145#undef xmlSubstituteEntitiesDefaultValue
Daniel Veillard8326e732003-01-07 00:19:07 +0000146#undef xmlRegisterNodeDefaultValue
147#undef xmlDeregisterNodeDefaultValue
Daniel Veillardd0463562001-10-13 09:15:48 +0000148
149#undef xmlFree
150#undef xmlMalloc
Daniel Veillard3c908dc2003-04-19 00:07:51 +0000151#undef xmlMallocAtomic
Daniel Veillardd0463562001-10-13 09:15:48 +0000152#undef xmlMemStrdup
153#undef xmlRealloc
154
Daniel Veillard9d06d302002-01-22 18:15:52 +0000155/**
156 * xmlParserVersion:
157 *
158 * Constant string describing the internal version of the library
159 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000160const char *xmlParserVersion = LIBXML_VERSION_STRING;
161
Daniel Veillard9d06d302002-01-22 18:15:52 +0000162/**
163 * xmlBufferAllocScheme:
164 *
165 * Global setting, default allocation policy for buffers, default is
166 * XML_BUFFER_ALLOC_EXACT
Daniel Veillardb8478642001-10-12 17:29:10 +0000167 */
168xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000169static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef = XML_BUFFER_ALLOC_EXACT;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000170/**
171 * xmlDefaultBufferSize:
172 *
173 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
174 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000175int xmlDefaultBufferSize = BASE_BUFFER_SIZE;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000176static int xmlDefaultBufferSizeThrDef = BASE_BUFFER_SIZE;
Daniel Veillardb8478642001-10-12 17:29:10 +0000177
178/*
179 * Parser defaults
180 */
Daniel Veillardd0463562001-10-13 09:15:48 +0000181
Daniel Veillard9d06d302002-01-22 18:15:52 +0000182/**
183 * oldXMLWDcompatibility:
184 *
185 * Global setting, DEPRECATED.
186 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000187int oldXMLWDcompatibility = 0; /* DEPRECATED */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000188/**
189 * xmlParserDebugEntities:
190 *
191 * Global setting, asking the parser to print out debugging informations.
192 * while handling entities.
193 * Disabled by default
194 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000195int xmlParserDebugEntities = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000196static int xmlParserDebugEntitiesThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000197/**
198 * xmlDoValidityCheckingDefaultValue:
199 *
200 * Global setting, indicate that the parser should work in validating mode.
201 * Disabled by default.
202 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000203int xmlDoValidityCheckingDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000204static int xmlDoValidityCheckingDefaultValueThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000205/**
206 * xmlGetWarningsDefaultValue:
207 *
208 * Global setting, indicate that the parser should provide warnings.
209 * Activated by default.
210 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000211int xmlGetWarningsDefaultValue = 1;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000212static int xmlGetWarningsDefaultValueThrDef = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000213/**
214 * xmlLoadExtDtdDefaultValue:
215 *
216 * Global setting, indicate that the parser should load DTD while not
217 * validating.
218 * Disabled by default.
219 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000220int xmlLoadExtDtdDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000221static int xmlLoadExtDtdDefaultValueThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000222/**
223 * xmlPedanticParserDefaultValue:
224 *
225 * Global setting, indicate that the parser be pedantic
226 * Disabled by default.
227 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000228int xmlPedanticParserDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000229static int xmlPedanticParserDefaultValueThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000230/**
231 * xmlLineNumbersDefaultValue:
232 *
233 * Global setting, indicate that the parser should store the line number
234 * in the content field of elements in the DOM tree.
235 * Disabled by default since this may not be safe for old classes of
236 * applicaton.
237 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000238int xmlLineNumbersDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000239static int xmlLineNumbersDefaultValueThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000240/**
241 * xmlKeepBlanksDefaultValue:
242 *
243 * Global setting, indicate that the parser should keep all blanks
244 * nodes found in the content
245 * Activated by default, this is actually needed to have the parser
246 * conformant to the XML Recommendation, however the option is kept
247 * for some applications since this was libxml1 default behaviour.
248 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000249int xmlKeepBlanksDefaultValue = 1;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000250static int xmlKeepBlanksDefaultValueThrDef = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000251/**
252 * xmlSubstituteEntitiesDefaultValue:
253 *
254 * Global setting, indicate that the parser should not generate entity
255 * references but replace them with the actual content of the entity
256 * Disabled by default, this should be activated when using XPath since
257 * the XPath data model requires entities replacement and the XPath
258 * engine does not handle entities references transparently.
259 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000260int xmlSubstituteEntitiesDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000261static int xmlSubstituteEntitiesDefaultValueThrDef = 0;
Daniel Veillardb8478642001-10-12 17:29:10 +0000262
Daniel Veillard5335dc52003-01-01 20:59:38 +0000263xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000264static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef = NULL;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000265xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue = NULL;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000266static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef = NULL;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000267
Daniel Veillardb8478642001-10-12 17:29:10 +0000268/*
269 * Error handling
270 */
271
272/* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
273/* Must initialize xmlGenericError in xmlInitParser */
Daniel Veillard635ef722001-10-29 11:48:19 +0000274void xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
275 const char *msg,
276 ...);
Daniel Veillard9d06d302002-01-22 18:15:52 +0000277/**
278 * xmlGenericError:
279 *
280 * Global setting: function used for generic error callbacks
281 */
Daniel Veillard635ef722001-10-29 11:48:19 +0000282xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000283static xmlGenericErrorFunc xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000284/**
285 * xmlGenericErrorContext:
286 *
287 * Global setting passed to generic error callbacks
288 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000289void *xmlGenericErrorContext = NULL;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000290static void *xmlGenericErrorContextThrDef = NULL;
Daniel Veillardb8478642001-10-12 17:29:10 +0000291
292/*
293 * output defaults
294 */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000295/**
296 * xmlIndentTreeOutput:
297 *
298 * Global setting, asking the serializer to indent the output tree by default
Aleksey Sanin23002562002-05-24 07:18:40 +0000299 * Enabled by default
Daniel Veillard9d06d302002-01-22 18:15:52 +0000300 */
Aleksey Sanin23002562002-05-24 07:18:40 +0000301int xmlIndentTreeOutput = 1;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000302static int xmlIndentTreeOutputThrDef = 1;
Aleksey Sanin23002562002-05-24 07:18:40 +0000303
304/**
305 * xmlTreeIndentString:
306 *
307 * The string used to do one-level indent. By default is equal to " " (two spaces)
308 */
309const char *xmlTreeIndentString = " ";
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000310static const char *xmlTreeIndentStringThrDef = " ";
Aleksey Sanin23002562002-05-24 07:18:40 +0000311
Daniel Veillard9d06d302002-01-22 18:15:52 +0000312/**
313 * xmlSaveNoEmptyTags:
314 *
315 * Global setting, asking the serializer to not output empty tags
316 * as <empty/> but <empty></empty>. those two forms are undistinguishable
317 * once parsed.
318 * Disabled by default
319 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000320int xmlSaveNoEmptyTags = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000321int xmlSaveNoEmptyTagsThrDef = 0;
Daniel Veillardb8478642001-10-12 17:29:10 +0000322
Daniel Veillard9d06d302002-01-22 18:15:52 +0000323/**
324 * xmlDefaultSAXHandler:
325 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000326 * Default handler for XML, builds the DOM tree
327 */
328xmlSAXHandler xmlDefaultSAXHandler = {
329 internalSubset,
330 isStandalone,
331 hasInternalSubset,
332 hasExternalSubset,
333 resolveEntity,
334 getEntity,
335 entityDecl,
336 notationDecl,
337 attributeDecl,
338 elementDecl,
339 unparsedEntityDecl,
340 setDocumentLocator,
341 startDocument,
342 endDocument,
343 startElement,
344 endElement,
345 reference,
346 characters,
347 characters,
348 processingInstruction,
349 comment,
350 xmlParserWarning,
351 xmlParserError,
352 xmlParserError,
353 getParameterEntity,
354 cdataBlock,
355 externalSubset,
356 0
357};
358
Daniel Veillard9d06d302002-01-22 18:15:52 +0000359/**
360 * xmlDefaultSAXLocator:
361 *
362 * The default SAX Locator
363 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
Daniel Veillardb8478642001-10-12 17:29:10 +0000364 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000365xmlSAXLocator xmlDefaultSAXLocator = {
366 getPublicId, getSystemId, getLineNumber, getColumnNumber
367};
368
369#ifdef LIBXML_HTML_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000370/**
371 * htmlDefaultSAXHandler:
372 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000373 * Default handler for HTML, builds the DOM tree
374 */
375xmlSAXHandler htmlDefaultSAXHandler = {
376 internalSubset,
377 NULL,
378 NULL,
379 NULL,
380 NULL,
381 getEntity,
382 NULL,
383 NULL,
384 NULL,
385 NULL,
386 NULL,
387 setDocumentLocator,
388 startDocument,
389 endDocument,
390 startElement,
391 endElement,
392 NULL,
393 characters,
394 ignorableWhitespace,
395 NULL,
396 comment,
397 xmlParserWarning,
398 xmlParserError,
399 xmlParserError,
400 getParameterEntity,
401 cdataBlock,
402 NULL,
403 0
404};
405#endif /* LIBXML_HTML_ENABLED */
406
407#ifdef LIBXML_DOCB_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000408/**
409 * docbDefaultSAXHandler:
410 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000411 * Default handler for SGML DocBook, builds the DOM tree
412 */
413xmlSAXHandler docbDefaultSAXHandler = {
414 internalSubset,
415 isStandalone,
416 hasInternalSubset,
417 hasExternalSubset,
418 resolveEntity,
419 getEntity,
420 entityDecl,
421 NULL,
422 NULL,
423 NULL,
424 NULL,
425 setDocumentLocator,
426 startDocument,
427 endDocument,
428 startElement,
429 endElement,
430 reference,
431 characters,
432 ignorableWhitespace,
433 NULL,
434 comment,
435 xmlParserWarning,
436 xmlParserError,
437 xmlParserError,
438 getParameterEntity,
439 NULL,
440 NULL,
441 0
442};
443#endif /* LIBXML_DOCB_ENABLED */
444
445/**
446 * xmlInitializeGlobalState:
447 * @gs: a pointer to a newly allocated global state
448 *
449 * xmlInitializeGlobalState() initialize a global state with all the
450 * default values of the library.
451 */
452void
453xmlInitializeGlobalState(xmlGlobalStatePtr gs)
454{
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000455#ifdef DEBUG_GLOBALS
456 fprintf(stderr, "Initializing globals at %lu for thread %d\n",
457 (unsigned long) gs, xmlGetThreadId());
458#endif
459
Daniel Veillardb8478642001-10-12 17:29:10 +0000460 /*
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000461 * Perform initialization as required by libxml
Daniel Veillardb8478642001-10-12 17:29:10 +0000462 */
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000463 xmlMutexLock(xmlThrDefMutex);
William M. Brack8b2c7f12002-11-22 05:07:29 +0000464
Daniel Veillarda4617b82001-11-04 20:19:12 +0000465#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000466 initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000467#endif
468#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000469 inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000470#endif
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000471
Daniel Veillardb8478642001-10-12 17:29:10 +0000472 gs->oldXMLWDcompatibility = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000473 gs->xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef;
474 gs->xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef;
Daniel Veillardb8478642001-10-12 17:29:10 +0000475 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
476 gs->xmlDefaultSAXLocator.getPublicId = getPublicId;
477 gs->xmlDefaultSAXLocator.getSystemId = getSystemId;
478 gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber;
479 gs->xmlDefaultSAXLocator.getColumnNumber = getColumnNumber;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000480 gs->xmlDoValidityCheckingDefaultValue =
481 xmlDoValidityCheckingDefaultValueThrDef;
Daniel Veillardb8478642001-10-12 17:29:10 +0000482#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
483 gs->xmlFree = (xmlFreeFunc) xmlMemFree;
484 gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillard3c908dc2003-04-19 00:07:51 +0000485 gs->xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillardb8478642001-10-12 17:29:10 +0000486 gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
487 gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
488#else
489 gs->xmlFree = (xmlFreeFunc) free;
490 gs->xmlMalloc = (xmlMallocFunc) malloc;
Daniel Veillard3c908dc2003-04-19 00:07:51 +0000491 gs->xmlMallocAtomic = (xmlMallocFunc) malloc;
Daniel Veillardb8478642001-10-12 17:29:10 +0000492 gs->xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard572577e2002-01-18 16:23:55 +0000493 gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +0000494#endif
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000495 gs->xmlGetWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef;
496 gs->xmlIndentTreeOutput = xmlIndentTreeOutputThrDef;
497 gs->xmlTreeIndentString = xmlTreeIndentStringThrDef;
498 gs->xmlKeepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef;
499 gs->xmlLineNumbersDefaultValue = xmlLineNumbersDefaultValueThrDef;
500 gs->xmlLoadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef;
501 gs->xmlParserDebugEntities = xmlParserDebugEntitiesThrDef;
Daniel Veillardb8478642001-10-12 17:29:10 +0000502 gs->xmlParserVersion = LIBXML_VERSION_STRING;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000503 gs->xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef;
504 gs->xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef;
505 gs->xmlSubstituteEntitiesDefaultValue =
506 xmlSubstituteEntitiesDefaultValueThrDef;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000507
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000508 gs->xmlGenericError = xmlGenericErrorThrDef;
509 gs->xmlGenericErrorContext = xmlGenericErrorContextThrDef;
510 gs->xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef;
511 gs->xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef;
512
513 xmlMutexUnlock(xmlThrDefMutex);
514}
515
516void
517xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
518 xmlMutexLock(xmlThrDefMutex);
519 xmlGenericErrorContextThrDef = ctx;
520 if (handler != NULL)
521 xmlGenericErrorThrDef = handler;
522 else
523 xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc;
524 xmlMutexUnlock(xmlThrDefMutex);
Daniel Veillardb8478642001-10-12 17:29:10 +0000525}
526
Daniel Veillard5335dc52003-01-01 20:59:38 +0000527/**
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000528 * xmlRegisterNodeDefault:
Daniel Veillard5335dc52003-01-01 20:59:38 +0000529 * @func: function pointer to the new RegisterNodeFunc
530 *
Daniel Veillard1703c5f2003-02-10 14:28:44 +0000531 * Registers a callback for node creation
532 *
533 * Returns the old value of the registration function
Daniel Veillard5335dc52003-01-01 20:59:38 +0000534 */
535xmlRegisterNodeFunc
536xmlRegisterNodeDefault(xmlRegisterNodeFunc func)
537{
538 xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue;
539
Daniel Veillarda880b122003-04-21 21:36:41 +0000540 __xmlRegisterCallbacks = 1;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000541 xmlRegisterNodeDefaultValue = func;
542 return(old);
543}
544
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000545xmlRegisterNodeFunc
546xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func)
547{
548 xmlRegisterNodeFunc old;
549
550 xmlMutexLock(xmlThrDefMutex);
551 old = xmlRegisterNodeDefaultValueThrDef;
552
553 __xmlRegisterCallbacks = 1;
554 xmlRegisterNodeDefaultValueThrDef = func;
555 xmlMutexUnlock(xmlThrDefMutex);
556
557 return(old);
558}
559
Daniel Veillard5335dc52003-01-01 20:59:38 +0000560/**
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000561 * xmlDeregisterNodeDefault:
Daniel Veillard5335dc52003-01-01 20:59:38 +0000562 * @func: function pointer to the new DeregisterNodeFunc
563 *
Daniel Veillard1703c5f2003-02-10 14:28:44 +0000564 * Registers a callback for node destruction
565 *
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000566 * Returns the previous value of the deregistration function
Daniel Veillard5335dc52003-01-01 20:59:38 +0000567 */
568xmlDeregisterNodeFunc
569xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func)
570{
571 xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue;
572
Daniel Veillarda880b122003-04-21 21:36:41 +0000573 __xmlRegisterCallbacks = 1;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000574 xmlDeregisterNodeDefaultValue = func;
575 return(old);
576}
577
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000578xmlDeregisterNodeFunc
579xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func)
580{
581 xmlDeregisterNodeFunc old;
582
583 xmlMutexLock(xmlThrDefMutex);
584 old = xmlDeregisterNodeDefaultValueThrDef;
585
586 __xmlRegisterCallbacks = 1;
587 xmlDeregisterNodeDefaultValueThrDef = func;
588 xmlMutexUnlock(xmlThrDefMutex);
589
590 return(old);
591}
592
Daniel Veillard5335dc52003-01-01 20:59:38 +0000593
Daniel Veillarda4617b82001-11-04 20:19:12 +0000594#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000595#undef docbDefaultSAXHandler
596xmlSAXHandler *
597__docbDefaultSAXHandler(void) {
598 if (IS_MAIN_THREAD)
599 return (&docbDefaultSAXHandler);
600 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000601 return (&xmlGetGlobalState()->docbDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000602}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000603#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000604
Daniel Veillarda4617b82001-11-04 20:19:12 +0000605#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000606#undef htmlDefaultSAXHandler
607xmlSAXHandler *
608__htmlDefaultSAXHandler(void) {
609 if (IS_MAIN_THREAD)
610 return (&htmlDefaultSAXHandler);
611 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000612 return (&xmlGetGlobalState()->htmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000613}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000614#endif
615
616/*
617 * Everything starting from the line below is
618 * Automatically generated by build_glob.py.
619 * Do not modify the previous line.
620 */
621
Daniel Veillardb8478642001-10-12 17:29:10 +0000622
Daniel Veillardb8478642001-10-12 17:29:10 +0000623#undef oldXMLWDcompatibility
624int *
625__oldXMLWDcompatibility(void) {
626 if (IS_MAIN_THREAD)
627 return (&oldXMLWDcompatibility);
628 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000629 return (&xmlGetGlobalState()->oldXMLWDcompatibility);
Daniel Veillardb8478642001-10-12 17:29:10 +0000630}
631
Daniel Veillardb8478642001-10-12 17:29:10 +0000632#undef xmlBufferAllocScheme
633xmlBufferAllocationScheme *
634__xmlBufferAllocScheme(void) {
635 if (IS_MAIN_THREAD)
636 return (&xmlBufferAllocScheme);
637 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000638 return (&xmlGetGlobalState()->xmlBufferAllocScheme);
Daniel Veillardb8478642001-10-12 17:29:10 +0000639}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000640xmlBufferAllocationScheme xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v) {
641 xmlBufferAllocationScheme ret;
642 xmlMutexLock(xmlThrDefMutex);
643 ret = xmlBufferAllocSchemeThrDef;
644 xmlBufferAllocSchemeThrDef = v;
645 xmlMutexUnlock(xmlThrDefMutex);
646 return ret;
647}
Daniel Veillardb8478642001-10-12 17:29:10 +0000648
Daniel Veillardb8478642001-10-12 17:29:10 +0000649#undef xmlDefaultBufferSize
650int *
651__xmlDefaultBufferSize(void) {
652 if (IS_MAIN_THREAD)
653 return (&xmlDefaultBufferSize);
654 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000655 return (&xmlGetGlobalState()->xmlDefaultBufferSize);
Daniel Veillardb8478642001-10-12 17:29:10 +0000656}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000657int xmlThrDefDefaultBufferSize(int v) {
658 int ret;
659 xmlMutexLock(xmlThrDefMutex);
660 ret = xmlDefaultBufferSizeThrDef;
661 xmlDefaultBufferSizeThrDef = v;
662 xmlMutexUnlock(xmlThrDefMutex);
663 return ret;
664}
Daniel Veillardb8478642001-10-12 17:29:10 +0000665
Daniel Veillardb8478642001-10-12 17:29:10 +0000666#undef xmlDefaultSAXHandler
667xmlSAXHandler *
668__xmlDefaultSAXHandler(void) {
669 if (IS_MAIN_THREAD)
670 return (&xmlDefaultSAXHandler);
671 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000672 return (&xmlGetGlobalState()->xmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000673}
674
Daniel Veillardb8478642001-10-12 17:29:10 +0000675#undef xmlDefaultSAXLocator
676xmlSAXLocator *
677__xmlDefaultSAXLocator(void) {
678 if (IS_MAIN_THREAD)
679 return (&xmlDefaultSAXLocator);
680 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000681 return (&xmlGetGlobalState()->xmlDefaultSAXLocator);
Daniel Veillardb8478642001-10-12 17:29:10 +0000682}
683
Daniel Veillardb8478642001-10-12 17:29:10 +0000684#undef xmlDoValidityCheckingDefaultValue
685int *
686__xmlDoValidityCheckingDefaultValue(void) {
687 if (IS_MAIN_THREAD)
688 return (&xmlDoValidityCheckingDefaultValue);
689 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000690 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000691}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000692int xmlThrDefDoValidityCheckingDefaultValue(int v) {
693 int ret;
694 xmlMutexLock(xmlThrDefMutex);
695 ret = xmlDoValidityCheckingDefaultValueThrDef;
696 xmlDoValidityCheckingDefaultValueThrDef = v;
697 xmlMutexUnlock(xmlThrDefMutex);
698 return ret;
699}
Daniel Veillardb8478642001-10-12 17:29:10 +0000700
Daniel Veillardb8478642001-10-12 17:29:10 +0000701#undef xmlGenericError
702xmlGenericErrorFunc *
703__xmlGenericError(void) {
704 if (IS_MAIN_THREAD)
705 return (&xmlGenericError);
706 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000707 return (&xmlGetGlobalState()->xmlGenericError);
Daniel Veillardb8478642001-10-12 17:29:10 +0000708}
709
Daniel Veillardb8478642001-10-12 17:29:10 +0000710#undef xmlGenericErrorContext
711void * *
712__xmlGenericErrorContext(void) {
713 if (IS_MAIN_THREAD)
714 return (&xmlGenericErrorContext);
715 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000716 return (&xmlGetGlobalState()->xmlGenericErrorContext);
Daniel Veillardb8478642001-10-12 17:29:10 +0000717}
718
Daniel Veillardb8478642001-10-12 17:29:10 +0000719#undef xmlGetWarningsDefaultValue
720int *
721__xmlGetWarningsDefaultValue(void) {
722 if (IS_MAIN_THREAD)
723 return (&xmlGetWarningsDefaultValue);
724 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000725 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000726}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000727int xmlThrDefGetWarningsDefaultValue(int v) {
728 int ret;
729 xmlMutexLock(xmlThrDefMutex);
730 ret = xmlGetWarningsDefaultValueThrDef;
731 xmlGetWarningsDefaultValueThrDef = v;
732 xmlMutexUnlock(xmlThrDefMutex);
733 return ret;
734}
Daniel Veillardb8478642001-10-12 17:29:10 +0000735
Daniel Veillardb8478642001-10-12 17:29:10 +0000736#undef xmlIndentTreeOutput
737int *
738__xmlIndentTreeOutput(void) {
739 if (IS_MAIN_THREAD)
740 return (&xmlIndentTreeOutput);
741 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000742 return (&xmlGetGlobalState()->xmlIndentTreeOutput);
Daniel Veillardb8478642001-10-12 17:29:10 +0000743}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000744int xmlThrDefIndentTreeOutput(int v) {
745 int ret;
746 xmlMutexLock(xmlThrDefMutex);
747 ret = xmlIndentTreeOutputThrDef;
748 xmlIndentTreeOutputThrDef = v;
749 xmlMutexUnlock(xmlThrDefMutex);
750 return ret;
751}
Daniel Veillardb8478642001-10-12 17:29:10 +0000752
Aleksey Sanin23002562002-05-24 07:18:40 +0000753#undef xmlTreeIndentString
754const char * *
755__xmlTreeIndentString(void) {
756 if (IS_MAIN_THREAD)
757 return (&xmlTreeIndentString);
758 else
759 return (&xmlGetGlobalState()->xmlTreeIndentString);
760}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000761const char * xmlThrDefTreeIndentString(const char * v) {
762 const char * ret;
763 xmlMutexLock(xmlThrDefMutex);
764 ret = xmlTreeIndentStringThrDef;
765 xmlTreeIndentStringThrDef = v;
766 xmlMutexUnlock(xmlThrDefMutex);
767 return ret;
768}
Aleksey Sanin23002562002-05-24 07:18:40 +0000769
Daniel Veillardb8478642001-10-12 17:29:10 +0000770#undef xmlKeepBlanksDefaultValue
771int *
772__xmlKeepBlanksDefaultValue(void) {
773 if (IS_MAIN_THREAD)
774 return (&xmlKeepBlanksDefaultValue);
775 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000776 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000777}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000778int xmlThrDefKeepBlanksDefaultValue(int v) {
779 int ret;
780 xmlMutexLock(xmlThrDefMutex);
781 ret = xmlKeepBlanksDefaultValueThrDef;
782 xmlKeepBlanksDefaultValueThrDef = v;
783 xmlMutexUnlock(xmlThrDefMutex);
784 return ret;
785}
Daniel Veillardb8478642001-10-12 17:29:10 +0000786
Daniel Veillardb8478642001-10-12 17:29:10 +0000787#undef xmlLineNumbersDefaultValue
788int *
789__xmlLineNumbersDefaultValue(void) {
790 if (IS_MAIN_THREAD)
791 return (&xmlLineNumbersDefaultValue);
792 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000793 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000794}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000795int xmlThrDefLineNumbersDefaultValue(int v) {
796 int ret;
797 xmlMutexLock(xmlThrDefMutex);
798 ret = xmlLineNumbersDefaultValueThrDef;
799 xmlLineNumbersDefaultValueThrDef = v;
800 xmlMutexUnlock(xmlThrDefMutex);
801 return ret;
802}
Daniel Veillardb8478642001-10-12 17:29:10 +0000803
Daniel Veillardb8478642001-10-12 17:29:10 +0000804#undef xmlLoadExtDtdDefaultValue
805int *
806__xmlLoadExtDtdDefaultValue(void) {
807 if (IS_MAIN_THREAD)
808 return (&xmlLoadExtDtdDefaultValue);
809 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000810 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000811}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000812int xmlThrDefLoadExtDtdDefaultValue(int v) {
813 int ret;
814 xmlMutexLock(xmlThrDefMutex);
815 ret = xmlLoadExtDtdDefaultValueThrDef;
816 xmlLoadExtDtdDefaultValueThrDef = v;
817 xmlMutexUnlock(xmlThrDefMutex);
818 return ret;
819}
Daniel Veillardb8478642001-10-12 17:29:10 +0000820
Daniel Veillardb8478642001-10-12 17:29:10 +0000821#undef xmlParserDebugEntities
822int *
823__xmlParserDebugEntities(void) {
824 if (IS_MAIN_THREAD)
825 return (&xmlParserDebugEntities);
826 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000827 return (&xmlGetGlobalState()->xmlParserDebugEntities);
Daniel Veillardb8478642001-10-12 17:29:10 +0000828}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000829int xmlThrDefParserDebugEntities(int v) {
830 int ret;
831 xmlMutexLock(xmlThrDefMutex);
832 ret = xmlParserDebugEntitiesThrDef;
833 xmlParserDebugEntitiesThrDef = v;
834 xmlMutexUnlock(xmlThrDefMutex);
835 return ret;
836}
Daniel Veillardb8478642001-10-12 17:29:10 +0000837
Daniel Veillardb8478642001-10-12 17:29:10 +0000838#undef xmlParserVersion
839const char * *
840__xmlParserVersion(void) {
841 if (IS_MAIN_THREAD)
842 return (&xmlParserVersion);
843 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000844 return (&xmlGetGlobalState()->xmlParserVersion);
Daniel Veillardb8478642001-10-12 17:29:10 +0000845}
846
Daniel Veillardb8478642001-10-12 17:29:10 +0000847#undef xmlPedanticParserDefaultValue
848int *
849__xmlPedanticParserDefaultValue(void) {
850 if (IS_MAIN_THREAD)
851 return (&xmlPedanticParserDefaultValue);
852 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000853 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000854}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000855int xmlThrDefPedanticParserDefaultValue(int v) {
856 int ret;
857 xmlMutexLock(xmlThrDefMutex);
858 ret = xmlPedanticParserDefaultValueThrDef;
859 xmlPedanticParserDefaultValueThrDef = v;
860 xmlMutexUnlock(xmlThrDefMutex);
861 return ret;
862}
Daniel Veillardb8478642001-10-12 17:29:10 +0000863
Daniel Veillardb8478642001-10-12 17:29:10 +0000864#undef xmlSaveNoEmptyTags
865int *
866__xmlSaveNoEmptyTags(void) {
867 if (IS_MAIN_THREAD)
868 return (&xmlSaveNoEmptyTags);
869 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000870 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags);
Daniel Veillardb8478642001-10-12 17:29:10 +0000871}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000872int xmlThrDefSaveNoEmptyTags(int v) {
873 int ret;
874 xmlMutexLock(xmlThrDefMutex);
875 ret = xmlSaveNoEmptyTagsThrDef;
876 xmlSaveNoEmptyTagsThrDef = v;
877 xmlMutexUnlock(xmlThrDefMutex);
878 return ret;
879}
Daniel Veillardb8478642001-10-12 17:29:10 +0000880
Daniel Veillardb8478642001-10-12 17:29:10 +0000881#undef xmlSubstituteEntitiesDefaultValue
882int *
883__xmlSubstituteEntitiesDefaultValue(void) {
884 if (IS_MAIN_THREAD)
885 return (&xmlSubstituteEntitiesDefaultValue);
886 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000887 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000888}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000889int xmlThrDefSubstituteEntitiesDefaultValue(int v) {
890 int ret;
891 xmlMutexLock(xmlThrDefMutex);
892 ret = xmlSubstituteEntitiesDefaultValueThrDef;
893 xmlSubstituteEntitiesDefaultValueThrDef = v;
894 xmlMutexUnlock(xmlThrDefMutex);
895 return ret;
896}
Daniel Veillard5335dc52003-01-01 20:59:38 +0000897
898#undef xmlRegisterNodeDefaultValue
899xmlRegisterNodeFunc *
900__xmlRegisterNodeDefaultValue(void) {
901 if (IS_MAIN_THREAD)
902 return (&xmlRegisterNodeDefaultValue);
903 else
904 return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue);
905}
906
907#undef xmlDeregisterNodeDefaultValue
908xmlDeregisterNodeFunc *
909__xmlDeregisterNodeDefaultValue(void) {
910 if (IS_MAIN_THREAD)
911 return (&xmlDeregisterNodeDefaultValue);
912 else
913 return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue);
914}