blob: 9c1b1d246bd612f89db209f8c87d1db83282a990 [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{
Daniel Veillard2009c4e2003-07-15 20:04:34 +000049 if (xmlThrDefMutex != NULL) {
Daniel Veillarddf101d82003-07-08 14:03:36 +000050 xmlFreeMutex(xmlThrDefMutex);
Daniel Veillard2009c4e2003-07-15 20:04:34 +000051 xmlThrDefMutex = NULL;
52 }
Daniel Veillard781ac8b2003-05-15 22:11:36 +000053}
54
Daniel Veillardb8478642001-10-12 17:29:10 +000055/************************************************************************
56 * *
57 * All the user accessible global variables of the library *
58 * *
59 ************************************************************************/
60
Daniel Veillardb8478642001-10-12 17:29:10 +000061/*
62 * Memory allocation routines
63 */
Daniel Veillard7216cfd2002-11-08 15:10:00 +000064#if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY)
Daniel Veillardd0463562001-10-13 09:15:48 +000065extern void xmlMemFree(void *ptr);
66extern void * xmlMemMalloc(size_t size);
67extern void * xmlMemRealloc(void *ptr,size_t size);
68extern char * xmlMemoryStrdup(const char *str);
69
Daniel Veillardb8478642001-10-12 17:29:10 +000070xmlFreeFunc xmlFree = (xmlFreeFunc) xmlMemFree;
71xmlMallocFunc xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillard3c908dc2003-04-19 00:07:51 +000072xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillardb8478642001-10-12 17:29:10 +000073xmlReallocFunc xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
74xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
75#else
Daniel Veillard9d06d302002-01-22 18:15:52 +000076/**
77 * xmlFree:
78 * @mem: an already allocated block of memory
79 *
80 * The variable holding the libxml free() implementation
81 */
Daniel Veillardb8478642001-10-12 17:29:10 +000082xmlFreeFunc xmlFree = (xmlFreeFunc) free;
Daniel Veillard9d06d302002-01-22 18:15:52 +000083/**
84 * xmlMalloc:
85 * @size: the size requested in bytes
86 *
87 * The variable holding the libxml malloc() implementation
88 *
89 * Returns a pointer to the newly allocated block or NULL in case of error
90 */
Daniel Veillardb8478642001-10-12 17:29:10 +000091xmlMallocFunc xmlMalloc = (xmlMallocFunc) malloc;
Daniel Veillard9d06d302002-01-22 18:15:52 +000092/**
Daniel Veillard3c908dc2003-04-19 00:07:51 +000093 * xmlMallocAtomic:
94 * @size: the size requested in bytes
95 *
96 * The variable holding the libxml malloc() implementation for atomic
97 * data (i.e. blocks not containings pointers), useful when using a
98 * garbage collecting allocator.
99 *
100 * Returns a pointer to the newly allocated block or NULL in case of error
101 */
102xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) malloc;
103/**
Daniel Veillard9d06d302002-01-22 18:15:52 +0000104 * xmlRealloc:
105 * @mem: an already allocated block of memory
106 * @size: the new size requested in bytes
107 *
108 * The variable holding the libxml realloc() implementation
109 *
110 * Returns a pointer to the newly reallocated block or NULL in case of error
111 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000112xmlReallocFunc xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000113/**
114 * xmlMemStrdup:
115 * @str: a zero terminated string
116 *
117 * The variable holding the libxml strdup() implementation
118 *
119 * Returns the copy of the string or NULL in case of error
120 */
Daniel Veillardb82c1662001-12-09 14:00:54 +0000121xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +0000122#endif
123
Daniel Veillardd0463562001-10-13 09:15:48 +0000124#include <libxml/threads.h>
125#include <libxml/globals.h>
126#include <libxml/SAX.h>
127
128#undef docbDefaultSAXHandler
129#undef htmlDefaultSAXHandler
130#undef oldXMLWDcompatibility
131#undef xmlBufferAllocScheme
132#undef xmlDefaultBufferSize
133#undef xmlDefaultSAXHandler
134#undef xmlDefaultSAXLocator
135#undef xmlDoValidityCheckingDefaultValue
136#undef xmlGenericError
137#undef xmlGenericErrorContext
138#undef xmlGetWarningsDefaultValue
139#undef xmlIndentTreeOutput
Aleksey Sanin23002562002-05-24 07:18:40 +0000140#undef xmlTreeIndentString
Daniel Veillardd0463562001-10-13 09:15:48 +0000141#undef xmlKeepBlanksDefaultValue
142#undef xmlLineNumbersDefaultValue
143#undef xmlLoadExtDtdDefaultValue
144#undef xmlParserDebugEntities
145#undef xmlParserVersion
146#undef xmlPedanticParserDefaultValue
147#undef xmlSaveNoEmptyTags
148#undef xmlSubstituteEntitiesDefaultValue
Daniel Veillard8326e732003-01-07 00:19:07 +0000149#undef xmlRegisterNodeDefaultValue
150#undef xmlDeregisterNodeDefaultValue
Daniel Veillardd0463562001-10-13 09:15:48 +0000151
152#undef xmlFree
153#undef xmlMalloc
Daniel Veillard3c908dc2003-04-19 00:07:51 +0000154#undef xmlMallocAtomic
Daniel Veillardd0463562001-10-13 09:15:48 +0000155#undef xmlMemStrdup
156#undef xmlRealloc
157
Daniel Veillard9d06d302002-01-22 18:15:52 +0000158/**
159 * xmlParserVersion:
160 *
161 * Constant string describing the internal version of the library
162 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000163const char *xmlParserVersion = LIBXML_VERSION_STRING;
164
Daniel Veillard9d06d302002-01-22 18:15:52 +0000165/**
166 * xmlBufferAllocScheme:
167 *
168 * Global setting, default allocation policy for buffers, default is
169 * XML_BUFFER_ALLOC_EXACT
Daniel Veillardb8478642001-10-12 17:29:10 +0000170 */
171xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000172static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef = XML_BUFFER_ALLOC_EXACT;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000173/**
174 * xmlDefaultBufferSize:
175 *
176 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
177 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000178int xmlDefaultBufferSize = BASE_BUFFER_SIZE;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000179static int xmlDefaultBufferSizeThrDef = BASE_BUFFER_SIZE;
Daniel Veillardb8478642001-10-12 17:29:10 +0000180
181/*
182 * Parser defaults
183 */
Daniel Veillardd0463562001-10-13 09:15:48 +0000184
Daniel Veillard9d06d302002-01-22 18:15:52 +0000185/**
186 * oldXMLWDcompatibility:
187 *
188 * Global setting, DEPRECATED.
189 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000190int oldXMLWDcompatibility = 0; /* DEPRECATED */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000191/**
192 * xmlParserDebugEntities:
193 *
194 * Global setting, asking the parser to print out debugging informations.
195 * while handling entities.
196 * Disabled by default
197 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000198int xmlParserDebugEntities = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000199static int xmlParserDebugEntitiesThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000200/**
201 * xmlDoValidityCheckingDefaultValue:
202 *
203 * Global setting, indicate that the parser should work in validating mode.
204 * Disabled by default.
205 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000206int xmlDoValidityCheckingDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000207static int xmlDoValidityCheckingDefaultValueThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000208/**
209 * xmlGetWarningsDefaultValue:
210 *
211 * Global setting, indicate that the parser should provide warnings.
212 * Activated by default.
213 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000214int xmlGetWarningsDefaultValue = 1;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000215static int xmlGetWarningsDefaultValueThrDef = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000216/**
217 * xmlLoadExtDtdDefaultValue:
218 *
219 * Global setting, indicate that the parser should load DTD while not
220 * validating.
221 * Disabled by default.
222 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000223int xmlLoadExtDtdDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000224static int xmlLoadExtDtdDefaultValueThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000225/**
226 * xmlPedanticParserDefaultValue:
227 *
228 * Global setting, indicate that the parser be pedantic
229 * Disabled by default.
230 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000231int xmlPedanticParserDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000232static int xmlPedanticParserDefaultValueThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000233/**
234 * xmlLineNumbersDefaultValue:
235 *
236 * Global setting, indicate that the parser should store the line number
237 * in the content field of elements in the DOM tree.
238 * Disabled by default since this may not be safe for old classes of
239 * applicaton.
240 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000241int xmlLineNumbersDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000242static int xmlLineNumbersDefaultValueThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000243/**
244 * xmlKeepBlanksDefaultValue:
245 *
246 * Global setting, indicate that the parser should keep all blanks
247 * nodes found in the content
248 * Activated by default, this is actually needed to have the parser
249 * conformant to the XML Recommendation, however the option is kept
250 * for some applications since this was libxml1 default behaviour.
251 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000252int xmlKeepBlanksDefaultValue = 1;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000253static int xmlKeepBlanksDefaultValueThrDef = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000254/**
255 * xmlSubstituteEntitiesDefaultValue:
256 *
257 * Global setting, indicate that the parser should not generate entity
258 * references but replace them with the actual content of the entity
259 * Disabled by default, this should be activated when using XPath since
260 * the XPath data model requires entities replacement and the XPath
261 * engine does not handle entities references transparently.
262 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000263int xmlSubstituteEntitiesDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000264static int xmlSubstituteEntitiesDefaultValueThrDef = 0;
Daniel Veillardb8478642001-10-12 17:29:10 +0000265
Daniel Veillard5335dc52003-01-01 20:59:38 +0000266xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000267static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef = NULL;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000268xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue = NULL;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000269static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef = NULL;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000270
Daniel Veillardb8478642001-10-12 17:29:10 +0000271/*
272 * Error handling
273 */
274
275/* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
276/* Must initialize xmlGenericError in xmlInitParser */
Daniel Veillard635ef722001-10-29 11:48:19 +0000277void xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
278 const char *msg,
279 ...);
Daniel Veillard9d06d302002-01-22 18:15:52 +0000280/**
281 * xmlGenericError:
282 *
283 * Global setting: function used for generic error callbacks
284 */
Daniel Veillard635ef722001-10-29 11:48:19 +0000285xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000286static xmlGenericErrorFunc xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000287/**
288 * xmlGenericErrorContext:
289 *
290 * Global setting passed to generic error callbacks
291 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000292void *xmlGenericErrorContext = NULL;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000293static void *xmlGenericErrorContextThrDef = NULL;
Daniel Veillardb8478642001-10-12 17:29:10 +0000294
295/*
296 * output defaults
297 */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000298/**
299 * xmlIndentTreeOutput:
300 *
301 * Global setting, asking the serializer to indent the output tree by default
Aleksey Sanin23002562002-05-24 07:18:40 +0000302 * Enabled by default
Daniel Veillard9d06d302002-01-22 18:15:52 +0000303 */
Aleksey Sanin23002562002-05-24 07:18:40 +0000304int xmlIndentTreeOutput = 1;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000305static int xmlIndentTreeOutputThrDef = 1;
Aleksey Sanin23002562002-05-24 07:18:40 +0000306
307/**
308 * xmlTreeIndentString:
309 *
310 * The string used to do one-level indent. By default is equal to " " (two spaces)
311 */
312const char *xmlTreeIndentString = " ";
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000313static const char *xmlTreeIndentStringThrDef = " ";
Aleksey Sanin23002562002-05-24 07:18:40 +0000314
Daniel Veillard9d06d302002-01-22 18:15:52 +0000315/**
316 * xmlSaveNoEmptyTags:
317 *
318 * Global setting, asking the serializer to not output empty tags
319 * as <empty/> but <empty></empty>. those two forms are undistinguishable
320 * once parsed.
321 * Disabled by default
322 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000323int xmlSaveNoEmptyTags = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000324int xmlSaveNoEmptyTagsThrDef = 0;
Daniel Veillardb8478642001-10-12 17:29:10 +0000325
Daniel Veillard9d06d302002-01-22 18:15:52 +0000326/**
327 * xmlDefaultSAXHandler:
328 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000329 * Default handler for XML, builds the DOM tree
330 */
331xmlSAXHandler xmlDefaultSAXHandler = {
332 internalSubset,
333 isStandalone,
334 hasInternalSubset,
335 hasExternalSubset,
336 resolveEntity,
337 getEntity,
338 entityDecl,
339 notationDecl,
340 attributeDecl,
341 elementDecl,
342 unparsedEntityDecl,
343 setDocumentLocator,
344 startDocument,
345 endDocument,
346 startElement,
347 endElement,
348 reference,
349 characters,
350 characters,
351 processingInstruction,
352 comment,
353 xmlParserWarning,
354 xmlParserError,
355 xmlParserError,
356 getParameterEntity,
357 cdataBlock,
358 externalSubset,
359 0
360};
361
Daniel Veillard9d06d302002-01-22 18:15:52 +0000362/**
363 * xmlDefaultSAXLocator:
364 *
365 * The default SAX Locator
366 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
Daniel Veillardb8478642001-10-12 17:29:10 +0000367 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000368xmlSAXLocator xmlDefaultSAXLocator = {
369 getPublicId, getSystemId, getLineNumber, getColumnNumber
370};
371
372#ifdef LIBXML_HTML_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000373/**
374 * htmlDefaultSAXHandler:
375 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000376 * Default handler for HTML, builds the DOM tree
377 */
378xmlSAXHandler htmlDefaultSAXHandler = {
379 internalSubset,
380 NULL,
381 NULL,
382 NULL,
383 NULL,
384 getEntity,
385 NULL,
386 NULL,
387 NULL,
388 NULL,
389 NULL,
390 setDocumentLocator,
391 startDocument,
392 endDocument,
393 startElement,
394 endElement,
395 NULL,
396 characters,
397 ignorableWhitespace,
398 NULL,
399 comment,
400 xmlParserWarning,
401 xmlParserError,
402 xmlParserError,
403 getParameterEntity,
404 cdataBlock,
405 NULL,
406 0
407};
408#endif /* LIBXML_HTML_ENABLED */
409
410#ifdef LIBXML_DOCB_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000411/**
412 * docbDefaultSAXHandler:
413 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000414 * Default handler for SGML DocBook, builds the DOM tree
415 */
416xmlSAXHandler docbDefaultSAXHandler = {
417 internalSubset,
418 isStandalone,
419 hasInternalSubset,
420 hasExternalSubset,
421 resolveEntity,
422 getEntity,
423 entityDecl,
424 NULL,
425 NULL,
426 NULL,
427 NULL,
428 setDocumentLocator,
429 startDocument,
430 endDocument,
431 startElement,
432 endElement,
433 reference,
434 characters,
435 ignorableWhitespace,
436 NULL,
437 comment,
438 xmlParserWarning,
439 xmlParserError,
440 xmlParserError,
441 getParameterEntity,
442 NULL,
443 NULL,
444 0
445};
446#endif /* LIBXML_DOCB_ENABLED */
447
448/**
449 * xmlInitializeGlobalState:
450 * @gs: a pointer to a newly allocated global state
451 *
452 * xmlInitializeGlobalState() initialize a global state with all the
453 * default values of the library.
454 */
455void
456xmlInitializeGlobalState(xmlGlobalStatePtr gs)
457{
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000458#ifdef DEBUG_GLOBALS
459 fprintf(stderr, "Initializing globals at %lu for thread %d\n",
460 (unsigned long) gs, xmlGetThreadId());
461#endif
462
Daniel Veillardb8478642001-10-12 17:29:10 +0000463 /*
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000464 * Perform initialization as required by libxml
Daniel Veillardb8478642001-10-12 17:29:10 +0000465 */
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000466 xmlMutexLock(xmlThrDefMutex);
William M. Brack8b2c7f12002-11-22 05:07:29 +0000467
Daniel Veillarda4617b82001-11-04 20:19:12 +0000468#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000469 initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000470#endif
471#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000472 inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000473#endif
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000474
Daniel Veillardb8478642001-10-12 17:29:10 +0000475 gs->oldXMLWDcompatibility = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000476 gs->xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef;
477 gs->xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef;
Daniel Veillardb8478642001-10-12 17:29:10 +0000478 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
479 gs->xmlDefaultSAXLocator.getPublicId = getPublicId;
480 gs->xmlDefaultSAXLocator.getSystemId = getSystemId;
481 gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber;
482 gs->xmlDefaultSAXLocator.getColumnNumber = getColumnNumber;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000483 gs->xmlDoValidityCheckingDefaultValue =
484 xmlDoValidityCheckingDefaultValueThrDef;
Daniel Veillardb8478642001-10-12 17:29:10 +0000485#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
486 gs->xmlFree = (xmlFreeFunc) xmlMemFree;
487 gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillard3c908dc2003-04-19 00:07:51 +0000488 gs->xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillardb8478642001-10-12 17:29:10 +0000489 gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
490 gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
491#else
492 gs->xmlFree = (xmlFreeFunc) free;
493 gs->xmlMalloc = (xmlMallocFunc) malloc;
Daniel Veillard3c908dc2003-04-19 00:07:51 +0000494 gs->xmlMallocAtomic = (xmlMallocFunc) malloc;
Daniel Veillardb8478642001-10-12 17:29:10 +0000495 gs->xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard572577e2002-01-18 16:23:55 +0000496 gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +0000497#endif
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000498 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;
Daniel Veillardb8478642001-10-12 17:29:10 +0000505 gs->xmlParserVersion = LIBXML_VERSION_STRING;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000506 gs->xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef;
507 gs->xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef;
508 gs->xmlSubstituteEntitiesDefaultValue =
509 xmlSubstituteEntitiesDefaultValueThrDef;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000510
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000511 gs->xmlGenericError = xmlGenericErrorThrDef;
512 gs->xmlGenericErrorContext = xmlGenericErrorContextThrDef;
513 gs->xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef;
514 gs->xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef;
515
516 xmlMutexUnlock(xmlThrDefMutex);
517}
518
519void
520xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
521 xmlMutexLock(xmlThrDefMutex);
522 xmlGenericErrorContextThrDef = ctx;
523 if (handler != NULL)
524 xmlGenericErrorThrDef = handler;
525 else
526 xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc;
527 xmlMutexUnlock(xmlThrDefMutex);
Daniel Veillardb8478642001-10-12 17:29:10 +0000528}
529
Daniel Veillard5335dc52003-01-01 20:59:38 +0000530/**
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000531 * xmlRegisterNodeDefault:
Daniel Veillard5335dc52003-01-01 20:59:38 +0000532 * @func: function pointer to the new RegisterNodeFunc
533 *
Daniel Veillard1703c5f2003-02-10 14:28:44 +0000534 * Registers a callback for node creation
535 *
536 * Returns the old value of the registration function
Daniel Veillard5335dc52003-01-01 20:59:38 +0000537 */
538xmlRegisterNodeFunc
539xmlRegisterNodeDefault(xmlRegisterNodeFunc func)
540{
541 xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue;
542
Daniel Veillarda880b122003-04-21 21:36:41 +0000543 __xmlRegisterCallbacks = 1;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000544 xmlRegisterNodeDefaultValue = func;
545 return(old);
546}
547
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000548xmlRegisterNodeFunc
549xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func)
550{
551 xmlRegisterNodeFunc old;
552
553 xmlMutexLock(xmlThrDefMutex);
554 old = xmlRegisterNodeDefaultValueThrDef;
555
556 __xmlRegisterCallbacks = 1;
557 xmlRegisterNodeDefaultValueThrDef = func;
558 xmlMutexUnlock(xmlThrDefMutex);
559
560 return(old);
561}
562
Daniel Veillard5335dc52003-01-01 20:59:38 +0000563/**
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000564 * xmlDeregisterNodeDefault:
Daniel Veillard5335dc52003-01-01 20:59:38 +0000565 * @func: function pointer to the new DeregisterNodeFunc
566 *
Daniel Veillard1703c5f2003-02-10 14:28:44 +0000567 * Registers a callback for node destruction
568 *
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000569 * Returns the previous value of the deregistration function
Daniel Veillard5335dc52003-01-01 20:59:38 +0000570 */
571xmlDeregisterNodeFunc
572xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func)
573{
574 xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue;
575
Daniel Veillarda880b122003-04-21 21:36:41 +0000576 __xmlRegisterCallbacks = 1;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000577 xmlDeregisterNodeDefaultValue = func;
578 return(old);
579}
580
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000581xmlDeregisterNodeFunc
582xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func)
583{
584 xmlDeregisterNodeFunc old;
585
586 xmlMutexLock(xmlThrDefMutex);
587 old = xmlDeregisterNodeDefaultValueThrDef;
588
589 __xmlRegisterCallbacks = 1;
590 xmlDeregisterNodeDefaultValueThrDef = func;
591 xmlMutexUnlock(xmlThrDefMutex);
592
593 return(old);
594}
595
Daniel Veillard5335dc52003-01-01 20:59:38 +0000596
Daniel Veillarda4617b82001-11-04 20:19:12 +0000597#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000598#undef docbDefaultSAXHandler
599xmlSAXHandler *
600__docbDefaultSAXHandler(void) {
601 if (IS_MAIN_THREAD)
602 return (&docbDefaultSAXHandler);
603 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000604 return (&xmlGetGlobalState()->docbDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000605}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000606#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000607
Daniel Veillarda4617b82001-11-04 20:19:12 +0000608#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000609#undef htmlDefaultSAXHandler
610xmlSAXHandler *
611__htmlDefaultSAXHandler(void) {
612 if (IS_MAIN_THREAD)
613 return (&htmlDefaultSAXHandler);
614 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000615 return (&xmlGetGlobalState()->htmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000616}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000617#endif
618
619/*
620 * Everything starting from the line below is
621 * Automatically generated by build_glob.py.
622 * Do not modify the previous line.
623 */
624
Daniel Veillardb8478642001-10-12 17:29:10 +0000625
Daniel Veillardb8478642001-10-12 17:29:10 +0000626#undef oldXMLWDcompatibility
627int *
628__oldXMLWDcompatibility(void) {
629 if (IS_MAIN_THREAD)
630 return (&oldXMLWDcompatibility);
631 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000632 return (&xmlGetGlobalState()->oldXMLWDcompatibility);
Daniel Veillardb8478642001-10-12 17:29:10 +0000633}
634
Daniel Veillardb8478642001-10-12 17:29:10 +0000635#undef xmlBufferAllocScheme
636xmlBufferAllocationScheme *
637__xmlBufferAllocScheme(void) {
638 if (IS_MAIN_THREAD)
639 return (&xmlBufferAllocScheme);
640 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000641 return (&xmlGetGlobalState()->xmlBufferAllocScheme);
Daniel Veillardb8478642001-10-12 17:29:10 +0000642}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000643xmlBufferAllocationScheme xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v) {
644 xmlBufferAllocationScheme ret;
645 xmlMutexLock(xmlThrDefMutex);
646 ret = xmlBufferAllocSchemeThrDef;
647 xmlBufferAllocSchemeThrDef = v;
648 xmlMutexUnlock(xmlThrDefMutex);
649 return ret;
650}
Daniel Veillardb8478642001-10-12 17:29:10 +0000651
Daniel Veillardb8478642001-10-12 17:29:10 +0000652#undef xmlDefaultBufferSize
653int *
654__xmlDefaultBufferSize(void) {
655 if (IS_MAIN_THREAD)
656 return (&xmlDefaultBufferSize);
657 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000658 return (&xmlGetGlobalState()->xmlDefaultBufferSize);
Daniel Veillardb8478642001-10-12 17:29:10 +0000659}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000660int xmlThrDefDefaultBufferSize(int v) {
661 int ret;
662 xmlMutexLock(xmlThrDefMutex);
663 ret = xmlDefaultBufferSizeThrDef;
664 xmlDefaultBufferSizeThrDef = v;
665 xmlMutexUnlock(xmlThrDefMutex);
666 return ret;
667}
Daniel Veillardb8478642001-10-12 17:29:10 +0000668
Daniel Veillardb8478642001-10-12 17:29:10 +0000669#undef xmlDefaultSAXHandler
670xmlSAXHandler *
671__xmlDefaultSAXHandler(void) {
672 if (IS_MAIN_THREAD)
673 return (&xmlDefaultSAXHandler);
674 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000675 return (&xmlGetGlobalState()->xmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000676}
677
Daniel Veillardb8478642001-10-12 17:29:10 +0000678#undef xmlDefaultSAXLocator
679xmlSAXLocator *
680__xmlDefaultSAXLocator(void) {
681 if (IS_MAIN_THREAD)
682 return (&xmlDefaultSAXLocator);
683 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000684 return (&xmlGetGlobalState()->xmlDefaultSAXLocator);
Daniel Veillardb8478642001-10-12 17:29:10 +0000685}
686
Daniel Veillardb8478642001-10-12 17:29:10 +0000687#undef xmlDoValidityCheckingDefaultValue
688int *
689__xmlDoValidityCheckingDefaultValue(void) {
690 if (IS_MAIN_THREAD)
691 return (&xmlDoValidityCheckingDefaultValue);
692 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000693 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000694}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000695int xmlThrDefDoValidityCheckingDefaultValue(int v) {
696 int ret;
697 xmlMutexLock(xmlThrDefMutex);
698 ret = xmlDoValidityCheckingDefaultValueThrDef;
699 xmlDoValidityCheckingDefaultValueThrDef = v;
700 xmlMutexUnlock(xmlThrDefMutex);
701 return ret;
702}
Daniel Veillardb8478642001-10-12 17:29:10 +0000703
Daniel Veillardb8478642001-10-12 17:29:10 +0000704#undef xmlGenericError
705xmlGenericErrorFunc *
706__xmlGenericError(void) {
707 if (IS_MAIN_THREAD)
708 return (&xmlGenericError);
709 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000710 return (&xmlGetGlobalState()->xmlGenericError);
Daniel Veillardb8478642001-10-12 17:29:10 +0000711}
712
Daniel Veillardb8478642001-10-12 17:29:10 +0000713#undef xmlGenericErrorContext
714void * *
715__xmlGenericErrorContext(void) {
716 if (IS_MAIN_THREAD)
717 return (&xmlGenericErrorContext);
718 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000719 return (&xmlGetGlobalState()->xmlGenericErrorContext);
Daniel Veillardb8478642001-10-12 17:29:10 +0000720}
721
Daniel Veillardb8478642001-10-12 17:29:10 +0000722#undef xmlGetWarningsDefaultValue
723int *
724__xmlGetWarningsDefaultValue(void) {
725 if (IS_MAIN_THREAD)
726 return (&xmlGetWarningsDefaultValue);
727 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000728 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000729}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000730int xmlThrDefGetWarningsDefaultValue(int v) {
731 int ret;
732 xmlMutexLock(xmlThrDefMutex);
733 ret = xmlGetWarningsDefaultValueThrDef;
734 xmlGetWarningsDefaultValueThrDef = v;
735 xmlMutexUnlock(xmlThrDefMutex);
736 return ret;
737}
Daniel Veillardb8478642001-10-12 17:29:10 +0000738
Daniel Veillardb8478642001-10-12 17:29:10 +0000739#undef xmlIndentTreeOutput
740int *
741__xmlIndentTreeOutput(void) {
742 if (IS_MAIN_THREAD)
743 return (&xmlIndentTreeOutput);
744 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000745 return (&xmlGetGlobalState()->xmlIndentTreeOutput);
Daniel Veillardb8478642001-10-12 17:29:10 +0000746}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000747int xmlThrDefIndentTreeOutput(int v) {
748 int ret;
749 xmlMutexLock(xmlThrDefMutex);
750 ret = xmlIndentTreeOutputThrDef;
751 xmlIndentTreeOutputThrDef = v;
752 xmlMutexUnlock(xmlThrDefMutex);
753 return ret;
754}
Daniel Veillardb8478642001-10-12 17:29:10 +0000755
Aleksey Sanin23002562002-05-24 07:18:40 +0000756#undef xmlTreeIndentString
757const char * *
758__xmlTreeIndentString(void) {
759 if (IS_MAIN_THREAD)
760 return (&xmlTreeIndentString);
761 else
762 return (&xmlGetGlobalState()->xmlTreeIndentString);
763}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000764const char * xmlThrDefTreeIndentString(const char * v) {
765 const char * ret;
766 xmlMutexLock(xmlThrDefMutex);
767 ret = xmlTreeIndentStringThrDef;
768 xmlTreeIndentStringThrDef = v;
769 xmlMutexUnlock(xmlThrDefMutex);
770 return ret;
771}
Aleksey Sanin23002562002-05-24 07:18:40 +0000772
Daniel Veillardb8478642001-10-12 17:29:10 +0000773#undef xmlKeepBlanksDefaultValue
774int *
775__xmlKeepBlanksDefaultValue(void) {
776 if (IS_MAIN_THREAD)
777 return (&xmlKeepBlanksDefaultValue);
778 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000779 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000780}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000781int xmlThrDefKeepBlanksDefaultValue(int v) {
782 int ret;
783 xmlMutexLock(xmlThrDefMutex);
784 ret = xmlKeepBlanksDefaultValueThrDef;
785 xmlKeepBlanksDefaultValueThrDef = v;
786 xmlMutexUnlock(xmlThrDefMutex);
787 return ret;
788}
Daniel Veillardb8478642001-10-12 17:29:10 +0000789
Daniel Veillardb8478642001-10-12 17:29:10 +0000790#undef xmlLineNumbersDefaultValue
791int *
792__xmlLineNumbersDefaultValue(void) {
793 if (IS_MAIN_THREAD)
794 return (&xmlLineNumbersDefaultValue);
795 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000796 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000797}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000798int xmlThrDefLineNumbersDefaultValue(int v) {
799 int ret;
800 xmlMutexLock(xmlThrDefMutex);
801 ret = xmlLineNumbersDefaultValueThrDef;
802 xmlLineNumbersDefaultValueThrDef = v;
803 xmlMutexUnlock(xmlThrDefMutex);
804 return ret;
805}
Daniel Veillardb8478642001-10-12 17:29:10 +0000806
Daniel Veillardb8478642001-10-12 17:29:10 +0000807#undef xmlLoadExtDtdDefaultValue
808int *
809__xmlLoadExtDtdDefaultValue(void) {
810 if (IS_MAIN_THREAD)
811 return (&xmlLoadExtDtdDefaultValue);
812 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000813 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000814}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000815int xmlThrDefLoadExtDtdDefaultValue(int v) {
816 int ret;
817 xmlMutexLock(xmlThrDefMutex);
818 ret = xmlLoadExtDtdDefaultValueThrDef;
819 xmlLoadExtDtdDefaultValueThrDef = v;
820 xmlMutexUnlock(xmlThrDefMutex);
821 return ret;
822}
Daniel Veillardb8478642001-10-12 17:29:10 +0000823
Daniel Veillardb8478642001-10-12 17:29:10 +0000824#undef xmlParserDebugEntities
825int *
826__xmlParserDebugEntities(void) {
827 if (IS_MAIN_THREAD)
828 return (&xmlParserDebugEntities);
829 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000830 return (&xmlGetGlobalState()->xmlParserDebugEntities);
Daniel Veillardb8478642001-10-12 17:29:10 +0000831}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000832int xmlThrDefParserDebugEntities(int v) {
833 int ret;
834 xmlMutexLock(xmlThrDefMutex);
835 ret = xmlParserDebugEntitiesThrDef;
836 xmlParserDebugEntitiesThrDef = v;
837 xmlMutexUnlock(xmlThrDefMutex);
838 return ret;
839}
Daniel Veillardb8478642001-10-12 17:29:10 +0000840
Daniel Veillardb8478642001-10-12 17:29:10 +0000841#undef xmlParserVersion
842const char * *
843__xmlParserVersion(void) {
844 if (IS_MAIN_THREAD)
845 return (&xmlParserVersion);
846 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000847 return (&xmlGetGlobalState()->xmlParserVersion);
Daniel Veillardb8478642001-10-12 17:29:10 +0000848}
849
Daniel Veillardb8478642001-10-12 17:29:10 +0000850#undef xmlPedanticParserDefaultValue
851int *
852__xmlPedanticParserDefaultValue(void) {
853 if (IS_MAIN_THREAD)
854 return (&xmlPedanticParserDefaultValue);
855 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000856 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000857}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000858int xmlThrDefPedanticParserDefaultValue(int v) {
859 int ret;
860 xmlMutexLock(xmlThrDefMutex);
861 ret = xmlPedanticParserDefaultValueThrDef;
862 xmlPedanticParserDefaultValueThrDef = v;
863 xmlMutexUnlock(xmlThrDefMutex);
864 return ret;
865}
Daniel Veillardb8478642001-10-12 17:29:10 +0000866
Daniel Veillardb8478642001-10-12 17:29:10 +0000867#undef xmlSaveNoEmptyTags
868int *
869__xmlSaveNoEmptyTags(void) {
870 if (IS_MAIN_THREAD)
871 return (&xmlSaveNoEmptyTags);
872 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000873 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags);
Daniel Veillardb8478642001-10-12 17:29:10 +0000874}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000875int xmlThrDefSaveNoEmptyTags(int v) {
876 int ret;
877 xmlMutexLock(xmlThrDefMutex);
878 ret = xmlSaveNoEmptyTagsThrDef;
879 xmlSaveNoEmptyTagsThrDef = v;
880 xmlMutexUnlock(xmlThrDefMutex);
881 return ret;
882}
Daniel Veillardb8478642001-10-12 17:29:10 +0000883
Daniel Veillardb8478642001-10-12 17:29:10 +0000884#undef xmlSubstituteEntitiesDefaultValue
885int *
886__xmlSubstituteEntitiesDefaultValue(void) {
887 if (IS_MAIN_THREAD)
888 return (&xmlSubstituteEntitiesDefaultValue);
889 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000890 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000891}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000892int xmlThrDefSubstituteEntitiesDefaultValue(int v) {
893 int ret;
894 xmlMutexLock(xmlThrDefMutex);
895 ret = xmlSubstituteEntitiesDefaultValueThrDef;
896 xmlSubstituteEntitiesDefaultValueThrDef = v;
897 xmlMutexUnlock(xmlThrDefMutex);
898 return ret;
899}
Daniel Veillard5335dc52003-01-01 20:59:38 +0000900
901#undef xmlRegisterNodeDefaultValue
902xmlRegisterNodeFunc *
903__xmlRegisterNodeDefaultValue(void) {
904 if (IS_MAIN_THREAD)
905 return (&xmlRegisterNodeDefaultValue);
906 else
907 return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue);
908}
909
910#undef xmlDeregisterNodeDefaultValue
911xmlDeregisterNodeFunc *
912__xmlDeregisterNodeDefaultValue(void) {
913 if (IS_MAIN_THREAD)
914 return (&xmlDeregisterNodeDefaultValue);
915 else
916 return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue);
917}