blob: aec487361cdb399ea7dfbbf0fdafcd3dd3284646 [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 Veillard98485322003-08-14 15:44:40 +000065#ifndef _DEBUG_MEMORY_ALLOC_
Daniel Veillardd0463562001-10-13 09:15:48 +000066extern void xmlMemFree(void *ptr);
67extern void * xmlMemMalloc(size_t size);
68extern void * xmlMemRealloc(void *ptr,size_t size);
69extern char * xmlMemoryStrdup(const char *str);
Daniel Veillard98485322003-08-14 15:44:40 +000070#endif
Daniel Veillardd0463562001-10-13 09:15:48 +000071
Daniel Veillardb8478642001-10-12 17:29:10 +000072xmlFreeFunc xmlFree = (xmlFreeFunc) xmlMemFree;
73xmlMallocFunc xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillard3c908dc2003-04-19 00:07:51 +000074xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillardb8478642001-10-12 17:29:10 +000075xmlReallocFunc xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
76xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
77#else
Daniel Veillard9d06d302002-01-22 18:15:52 +000078/**
79 * xmlFree:
80 * @mem: an already allocated block of memory
81 *
82 * The variable holding the libxml free() implementation
83 */
Daniel Veillardb8478642001-10-12 17:29:10 +000084xmlFreeFunc xmlFree = (xmlFreeFunc) free;
Daniel Veillard9d06d302002-01-22 18:15:52 +000085/**
86 * xmlMalloc:
87 * @size: the size requested in bytes
88 *
89 * The variable holding the libxml malloc() implementation
90 *
91 * Returns a pointer to the newly allocated block or NULL in case of error
92 */
Daniel Veillardb8478642001-10-12 17:29:10 +000093xmlMallocFunc xmlMalloc = (xmlMallocFunc) malloc;
Daniel Veillard9d06d302002-01-22 18:15:52 +000094/**
Daniel Veillard3c908dc2003-04-19 00:07:51 +000095 * xmlMallocAtomic:
96 * @size: the size requested in bytes
97 *
98 * The variable holding the libxml malloc() implementation for atomic
99 * data (i.e. blocks not containings pointers), useful when using a
100 * garbage collecting allocator.
101 *
102 * Returns a pointer to the newly allocated block or NULL in case of error
103 */
104xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) malloc;
105/**
Daniel Veillard9d06d302002-01-22 18:15:52 +0000106 * xmlRealloc:
107 * @mem: an already allocated block of memory
108 * @size: the new size requested in bytes
109 *
110 * The variable holding the libxml realloc() implementation
111 *
112 * Returns a pointer to the newly reallocated block or NULL in case of error
113 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000114xmlReallocFunc xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000115/**
116 * xmlMemStrdup:
117 * @str: a zero terminated string
118 *
119 * The variable holding the libxml strdup() implementation
120 *
121 * Returns the copy of the string or NULL in case of error
122 */
Daniel Veillardb82c1662001-12-09 14:00:54 +0000123xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +0000124#endif
125
Daniel Veillardd0463562001-10-13 09:15:48 +0000126#include <libxml/threads.h>
127#include <libxml/globals.h>
128#include <libxml/SAX.h>
129
130#undef docbDefaultSAXHandler
131#undef htmlDefaultSAXHandler
132#undef oldXMLWDcompatibility
133#undef xmlBufferAllocScheme
134#undef xmlDefaultBufferSize
135#undef xmlDefaultSAXHandler
136#undef xmlDefaultSAXLocator
137#undef xmlDoValidityCheckingDefaultValue
138#undef xmlGenericError
139#undef xmlGenericErrorContext
140#undef xmlGetWarningsDefaultValue
141#undef xmlIndentTreeOutput
Aleksey Sanin23002562002-05-24 07:18:40 +0000142#undef xmlTreeIndentString
Daniel Veillardd0463562001-10-13 09:15:48 +0000143#undef xmlKeepBlanksDefaultValue
144#undef xmlLineNumbersDefaultValue
145#undef xmlLoadExtDtdDefaultValue
146#undef xmlParserDebugEntities
147#undef xmlParserVersion
148#undef xmlPedanticParserDefaultValue
149#undef xmlSaveNoEmptyTags
150#undef xmlSubstituteEntitiesDefaultValue
Daniel Veillard8326e732003-01-07 00:19:07 +0000151#undef xmlRegisterNodeDefaultValue
152#undef xmlDeregisterNodeDefaultValue
Daniel Veillardd0463562001-10-13 09:15:48 +0000153
154#undef xmlFree
155#undef xmlMalloc
Daniel Veillard3c908dc2003-04-19 00:07:51 +0000156#undef xmlMallocAtomic
Daniel Veillardd0463562001-10-13 09:15:48 +0000157#undef xmlMemStrdup
158#undef xmlRealloc
159
Daniel Veillard9d06d302002-01-22 18:15:52 +0000160/**
161 * xmlParserVersion:
162 *
163 * Constant string describing the internal version of the library
164 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000165const char *xmlParserVersion = LIBXML_VERSION_STRING;
166
Daniel Veillard9d06d302002-01-22 18:15:52 +0000167/**
168 * xmlBufferAllocScheme:
169 *
170 * Global setting, default allocation policy for buffers, default is
171 * XML_BUFFER_ALLOC_EXACT
Daniel Veillardb8478642001-10-12 17:29:10 +0000172 */
173xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000174static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef = XML_BUFFER_ALLOC_EXACT;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000175/**
176 * xmlDefaultBufferSize:
177 *
178 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
179 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000180int xmlDefaultBufferSize = BASE_BUFFER_SIZE;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000181static int xmlDefaultBufferSizeThrDef = BASE_BUFFER_SIZE;
Daniel Veillardb8478642001-10-12 17:29:10 +0000182
183/*
184 * Parser defaults
185 */
Daniel Veillardd0463562001-10-13 09:15:48 +0000186
Daniel Veillard9d06d302002-01-22 18:15:52 +0000187/**
188 * oldXMLWDcompatibility:
189 *
190 * Global setting, DEPRECATED.
191 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000192int oldXMLWDcompatibility = 0; /* DEPRECATED */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000193/**
194 * xmlParserDebugEntities:
195 *
196 * Global setting, asking the parser to print out debugging informations.
197 * while handling entities.
198 * Disabled by default
199 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000200int xmlParserDebugEntities = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000201static int xmlParserDebugEntitiesThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000202/**
203 * xmlDoValidityCheckingDefaultValue:
204 *
205 * Global setting, indicate that the parser should work in validating mode.
206 * Disabled by default.
207 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000208int xmlDoValidityCheckingDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000209static int xmlDoValidityCheckingDefaultValueThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000210/**
211 * xmlGetWarningsDefaultValue:
212 *
213 * Global setting, indicate that the parser should provide warnings.
214 * Activated by default.
215 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000216int xmlGetWarningsDefaultValue = 1;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000217static int xmlGetWarningsDefaultValueThrDef = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000218/**
219 * xmlLoadExtDtdDefaultValue:
220 *
221 * Global setting, indicate that the parser should load DTD while not
222 * validating.
223 * Disabled by default.
224 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000225int xmlLoadExtDtdDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000226static int xmlLoadExtDtdDefaultValueThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000227/**
228 * xmlPedanticParserDefaultValue:
229 *
230 * Global setting, indicate that the parser be pedantic
231 * Disabled by default.
232 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000233int xmlPedanticParserDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000234static int xmlPedanticParserDefaultValueThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000235/**
236 * xmlLineNumbersDefaultValue:
237 *
238 * Global setting, indicate that the parser should store the line number
239 * in the content field of elements in the DOM tree.
240 * Disabled by default since this may not be safe for old classes of
241 * applicaton.
242 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000243int xmlLineNumbersDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000244static int xmlLineNumbersDefaultValueThrDef = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000245/**
246 * xmlKeepBlanksDefaultValue:
247 *
248 * Global setting, indicate that the parser should keep all blanks
249 * nodes found in the content
250 * Activated by default, this is actually needed to have the parser
251 * conformant to the XML Recommendation, however the option is kept
252 * for some applications since this was libxml1 default behaviour.
253 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000254int xmlKeepBlanksDefaultValue = 1;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000255static int xmlKeepBlanksDefaultValueThrDef = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000256/**
257 * xmlSubstituteEntitiesDefaultValue:
258 *
259 * Global setting, indicate that the parser should not generate entity
260 * references but replace them with the actual content of the entity
261 * Disabled by default, this should be activated when using XPath since
262 * the XPath data model requires entities replacement and the XPath
263 * engine does not handle entities references transparently.
264 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000265int xmlSubstituteEntitiesDefaultValue = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000266static int xmlSubstituteEntitiesDefaultValueThrDef = 0;
Daniel Veillardb8478642001-10-12 17:29:10 +0000267
Daniel Veillard5335dc52003-01-01 20:59:38 +0000268xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000269static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef = NULL;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000270xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue = NULL;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000271static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef = NULL;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000272
Daniel Veillardb8478642001-10-12 17:29:10 +0000273/*
274 * Error handling
275 */
276
277/* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
278/* Must initialize xmlGenericError in xmlInitParser */
Daniel Veillard635ef722001-10-29 11:48:19 +0000279void xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
280 const char *msg,
281 ...);
Daniel Veillard9d06d302002-01-22 18:15:52 +0000282/**
283 * xmlGenericError:
284 *
285 * Global setting: function used for generic error callbacks
286 */
Daniel Veillard635ef722001-10-29 11:48:19 +0000287xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000288static xmlGenericErrorFunc xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000289/**
290 * xmlGenericErrorContext:
291 *
292 * Global setting passed to generic error callbacks
293 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000294void *xmlGenericErrorContext = NULL;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000295static void *xmlGenericErrorContextThrDef = NULL;
Daniel Veillardb8478642001-10-12 17:29:10 +0000296
297/*
298 * output defaults
299 */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000300/**
301 * xmlIndentTreeOutput:
302 *
303 * Global setting, asking the serializer to indent the output tree by default
Aleksey Sanin23002562002-05-24 07:18:40 +0000304 * Enabled by default
Daniel Veillard9d06d302002-01-22 18:15:52 +0000305 */
Aleksey Sanin23002562002-05-24 07:18:40 +0000306int xmlIndentTreeOutput = 1;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000307static int xmlIndentTreeOutputThrDef = 1;
Aleksey Sanin23002562002-05-24 07:18:40 +0000308
309/**
310 * xmlTreeIndentString:
311 *
312 * The string used to do one-level indent. By default is equal to " " (two spaces)
313 */
314const char *xmlTreeIndentString = " ";
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000315static const char *xmlTreeIndentStringThrDef = " ";
Aleksey Sanin23002562002-05-24 07:18:40 +0000316
Daniel Veillard9d06d302002-01-22 18:15:52 +0000317/**
318 * xmlSaveNoEmptyTags:
319 *
320 * Global setting, asking the serializer to not output empty tags
321 * as <empty/> but <empty></empty>. those two forms are undistinguishable
322 * once parsed.
323 * Disabled by default
324 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000325int xmlSaveNoEmptyTags = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000326int xmlSaveNoEmptyTagsThrDef = 0;
Daniel Veillardb8478642001-10-12 17:29:10 +0000327
Daniel Veillard9d06d302002-01-22 18:15:52 +0000328/**
329 * xmlDefaultSAXHandler:
330 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000331 * Default handler for XML, builds the DOM tree
332 */
333xmlSAXHandler xmlDefaultSAXHandler = {
334 internalSubset,
335 isStandalone,
336 hasInternalSubset,
337 hasExternalSubset,
338 resolveEntity,
339 getEntity,
340 entityDecl,
341 notationDecl,
342 attributeDecl,
343 elementDecl,
344 unparsedEntityDecl,
345 setDocumentLocator,
346 startDocument,
347 endDocument,
348 startElement,
349 endElement,
350 reference,
351 characters,
352 characters,
353 processingInstruction,
354 comment,
355 xmlParserWarning,
356 xmlParserError,
357 xmlParserError,
358 getParameterEntity,
359 cdataBlock,
360 externalSubset,
361 0
362};
363
Daniel Veillard9d06d302002-01-22 18:15:52 +0000364/**
365 * xmlDefaultSAXLocator:
366 *
367 * The default SAX Locator
368 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
Daniel Veillardb8478642001-10-12 17:29:10 +0000369 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000370xmlSAXLocator xmlDefaultSAXLocator = {
371 getPublicId, getSystemId, getLineNumber, getColumnNumber
372};
373
374#ifdef LIBXML_HTML_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000375/**
376 * htmlDefaultSAXHandler:
377 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000378 * Default handler for HTML, builds the DOM tree
379 */
380xmlSAXHandler htmlDefaultSAXHandler = {
381 internalSubset,
382 NULL,
383 NULL,
384 NULL,
385 NULL,
386 getEntity,
387 NULL,
388 NULL,
389 NULL,
390 NULL,
391 NULL,
392 setDocumentLocator,
393 startDocument,
394 endDocument,
395 startElement,
396 endElement,
397 NULL,
398 characters,
399 ignorableWhitespace,
400 NULL,
401 comment,
402 xmlParserWarning,
403 xmlParserError,
404 xmlParserError,
405 getParameterEntity,
406 cdataBlock,
407 NULL,
408 0
409};
410#endif /* LIBXML_HTML_ENABLED */
411
412#ifdef LIBXML_DOCB_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000413/**
414 * docbDefaultSAXHandler:
415 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000416 * Default handler for SGML DocBook, builds the DOM tree
417 */
418xmlSAXHandler docbDefaultSAXHandler = {
419 internalSubset,
420 isStandalone,
421 hasInternalSubset,
422 hasExternalSubset,
423 resolveEntity,
424 getEntity,
425 entityDecl,
426 NULL,
427 NULL,
428 NULL,
429 NULL,
430 setDocumentLocator,
431 startDocument,
432 endDocument,
433 startElement,
434 endElement,
435 reference,
436 characters,
437 ignorableWhitespace,
438 NULL,
439 comment,
440 xmlParserWarning,
441 xmlParserError,
442 xmlParserError,
443 getParameterEntity,
444 NULL,
445 NULL,
446 0
447};
448#endif /* LIBXML_DOCB_ENABLED */
449
450/**
451 * xmlInitializeGlobalState:
452 * @gs: a pointer to a newly allocated global state
453 *
454 * xmlInitializeGlobalState() initialize a global state with all the
455 * default values of the library.
456 */
457void
458xmlInitializeGlobalState(xmlGlobalStatePtr gs)
459{
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000460#ifdef DEBUG_GLOBALS
461 fprintf(stderr, "Initializing globals at %lu for thread %d\n",
462 (unsigned long) gs, xmlGetThreadId());
463#endif
464
Daniel Veillardb8478642001-10-12 17:29:10 +0000465 /*
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000466 * Perform initialization as required by libxml
Daniel Veillardb8478642001-10-12 17:29:10 +0000467 */
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000468 xmlMutexLock(xmlThrDefMutex);
William M. Brack8b2c7f12002-11-22 05:07:29 +0000469
Daniel Veillarda4617b82001-11-04 20:19:12 +0000470#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000471 initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000472#endif
473#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000474 inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000475#endif
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000476
Daniel Veillardb8478642001-10-12 17:29:10 +0000477 gs->oldXMLWDcompatibility = 0;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000478 gs->xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef;
479 gs->xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef;
Daniel Veillardb8478642001-10-12 17:29:10 +0000480 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
481 gs->xmlDefaultSAXLocator.getPublicId = getPublicId;
482 gs->xmlDefaultSAXLocator.getSystemId = getSystemId;
483 gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber;
484 gs->xmlDefaultSAXLocator.getColumnNumber = getColumnNumber;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000485 gs->xmlDoValidityCheckingDefaultValue =
486 xmlDoValidityCheckingDefaultValueThrDef;
Daniel Veillardb8478642001-10-12 17:29:10 +0000487#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
488 gs->xmlFree = (xmlFreeFunc) xmlMemFree;
489 gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillard3c908dc2003-04-19 00:07:51 +0000490 gs->xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillardb8478642001-10-12 17:29:10 +0000491 gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
492 gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
493#else
494 gs->xmlFree = (xmlFreeFunc) free;
495 gs->xmlMalloc = (xmlMallocFunc) malloc;
Daniel Veillard3c908dc2003-04-19 00:07:51 +0000496 gs->xmlMallocAtomic = (xmlMallocFunc) malloc;
Daniel Veillardb8478642001-10-12 17:29:10 +0000497 gs->xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard572577e2002-01-18 16:23:55 +0000498 gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +0000499#endif
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000500 gs->xmlGetWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef;
501 gs->xmlIndentTreeOutput = xmlIndentTreeOutputThrDef;
502 gs->xmlTreeIndentString = xmlTreeIndentStringThrDef;
503 gs->xmlKeepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef;
504 gs->xmlLineNumbersDefaultValue = xmlLineNumbersDefaultValueThrDef;
505 gs->xmlLoadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef;
506 gs->xmlParserDebugEntities = xmlParserDebugEntitiesThrDef;
Daniel Veillardb8478642001-10-12 17:29:10 +0000507 gs->xmlParserVersion = LIBXML_VERSION_STRING;
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000508 gs->xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef;
509 gs->xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef;
510 gs->xmlSubstituteEntitiesDefaultValue =
511 xmlSubstituteEntitiesDefaultValueThrDef;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000512
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000513 gs->xmlGenericError = xmlGenericErrorThrDef;
514 gs->xmlGenericErrorContext = xmlGenericErrorContextThrDef;
515 gs->xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef;
516 gs->xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef;
517
518 xmlMutexUnlock(xmlThrDefMutex);
519}
520
521void
522xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
523 xmlMutexLock(xmlThrDefMutex);
524 xmlGenericErrorContextThrDef = ctx;
525 if (handler != NULL)
526 xmlGenericErrorThrDef = handler;
527 else
528 xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc;
529 xmlMutexUnlock(xmlThrDefMutex);
Daniel Veillardb8478642001-10-12 17:29:10 +0000530}
531
Daniel Veillard5335dc52003-01-01 20:59:38 +0000532/**
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000533 * xmlRegisterNodeDefault:
Daniel Veillard5335dc52003-01-01 20:59:38 +0000534 * @func: function pointer to the new RegisterNodeFunc
535 *
Daniel Veillard1703c5f2003-02-10 14:28:44 +0000536 * Registers a callback for node creation
537 *
538 * Returns the old value of the registration function
Daniel Veillard5335dc52003-01-01 20:59:38 +0000539 */
540xmlRegisterNodeFunc
541xmlRegisterNodeDefault(xmlRegisterNodeFunc func)
542{
543 xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue;
544
Daniel Veillarda880b122003-04-21 21:36:41 +0000545 __xmlRegisterCallbacks = 1;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000546 xmlRegisterNodeDefaultValue = func;
547 return(old);
548}
549
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000550xmlRegisterNodeFunc
551xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func)
552{
553 xmlRegisterNodeFunc old;
554
555 xmlMutexLock(xmlThrDefMutex);
556 old = xmlRegisterNodeDefaultValueThrDef;
557
558 __xmlRegisterCallbacks = 1;
559 xmlRegisterNodeDefaultValueThrDef = func;
560 xmlMutexUnlock(xmlThrDefMutex);
561
562 return(old);
563}
564
Daniel Veillard5335dc52003-01-01 20:59:38 +0000565/**
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000566 * xmlDeregisterNodeDefault:
Daniel Veillard5335dc52003-01-01 20:59:38 +0000567 * @func: function pointer to the new DeregisterNodeFunc
568 *
Daniel Veillard1703c5f2003-02-10 14:28:44 +0000569 * Registers a callback for node destruction
570 *
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000571 * Returns the previous value of the deregistration function
Daniel Veillard5335dc52003-01-01 20:59:38 +0000572 */
573xmlDeregisterNodeFunc
574xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func)
575{
576 xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue;
577
Daniel Veillarda880b122003-04-21 21:36:41 +0000578 __xmlRegisterCallbacks = 1;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000579 xmlDeregisterNodeDefaultValue = func;
580 return(old);
581}
582
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000583xmlDeregisterNodeFunc
584xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func)
585{
586 xmlDeregisterNodeFunc old;
587
588 xmlMutexLock(xmlThrDefMutex);
589 old = xmlDeregisterNodeDefaultValueThrDef;
590
591 __xmlRegisterCallbacks = 1;
592 xmlDeregisterNodeDefaultValueThrDef = func;
593 xmlMutexUnlock(xmlThrDefMutex);
594
595 return(old);
596}
597
Daniel Veillard5335dc52003-01-01 20:59:38 +0000598
Daniel Veillarda4617b82001-11-04 20:19:12 +0000599#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000600#undef docbDefaultSAXHandler
601xmlSAXHandler *
602__docbDefaultSAXHandler(void) {
603 if (IS_MAIN_THREAD)
604 return (&docbDefaultSAXHandler);
605 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000606 return (&xmlGetGlobalState()->docbDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000607}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000608#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000609
Daniel Veillarda4617b82001-11-04 20:19:12 +0000610#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000611#undef htmlDefaultSAXHandler
612xmlSAXHandler *
613__htmlDefaultSAXHandler(void) {
614 if (IS_MAIN_THREAD)
615 return (&htmlDefaultSAXHandler);
616 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000617 return (&xmlGetGlobalState()->htmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000618}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000619#endif
620
621/*
622 * Everything starting from the line below is
623 * Automatically generated by build_glob.py.
624 * Do not modify the previous line.
625 */
626
Daniel Veillardb8478642001-10-12 17:29:10 +0000627
Daniel Veillardb8478642001-10-12 17:29:10 +0000628#undef oldXMLWDcompatibility
629int *
630__oldXMLWDcompatibility(void) {
631 if (IS_MAIN_THREAD)
632 return (&oldXMLWDcompatibility);
633 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000634 return (&xmlGetGlobalState()->oldXMLWDcompatibility);
Daniel Veillardb8478642001-10-12 17:29:10 +0000635}
636
Daniel Veillardb8478642001-10-12 17:29:10 +0000637#undef xmlBufferAllocScheme
638xmlBufferAllocationScheme *
639__xmlBufferAllocScheme(void) {
640 if (IS_MAIN_THREAD)
641 return (&xmlBufferAllocScheme);
642 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000643 return (&xmlGetGlobalState()->xmlBufferAllocScheme);
Daniel Veillardb8478642001-10-12 17:29:10 +0000644}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000645xmlBufferAllocationScheme xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v) {
646 xmlBufferAllocationScheme ret;
647 xmlMutexLock(xmlThrDefMutex);
648 ret = xmlBufferAllocSchemeThrDef;
649 xmlBufferAllocSchemeThrDef = v;
650 xmlMutexUnlock(xmlThrDefMutex);
651 return ret;
652}
Daniel Veillardb8478642001-10-12 17:29:10 +0000653
Daniel Veillardb8478642001-10-12 17:29:10 +0000654#undef xmlDefaultBufferSize
655int *
656__xmlDefaultBufferSize(void) {
657 if (IS_MAIN_THREAD)
658 return (&xmlDefaultBufferSize);
659 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000660 return (&xmlGetGlobalState()->xmlDefaultBufferSize);
Daniel Veillardb8478642001-10-12 17:29:10 +0000661}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000662int xmlThrDefDefaultBufferSize(int v) {
663 int ret;
664 xmlMutexLock(xmlThrDefMutex);
665 ret = xmlDefaultBufferSizeThrDef;
666 xmlDefaultBufferSizeThrDef = v;
667 xmlMutexUnlock(xmlThrDefMutex);
668 return ret;
669}
Daniel Veillardb8478642001-10-12 17:29:10 +0000670
Daniel Veillardb8478642001-10-12 17:29:10 +0000671#undef xmlDefaultSAXHandler
672xmlSAXHandler *
673__xmlDefaultSAXHandler(void) {
674 if (IS_MAIN_THREAD)
675 return (&xmlDefaultSAXHandler);
676 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000677 return (&xmlGetGlobalState()->xmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000678}
679
Daniel Veillardb8478642001-10-12 17:29:10 +0000680#undef xmlDefaultSAXLocator
681xmlSAXLocator *
682__xmlDefaultSAXLocator(void) {
683 if (IS_MAIN_THREAD)
684 return (&xmlDefaultSAXLocator);
685 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000686 return (&xmlGetGlobalState()->xmlDefaultSAXLocator);
Daniel Veillardb8478642001-10-12 17:29:10 +0000687}
688
Daniel Veillardb8478642001-10-12 17:29:10 +0000689#undef xmlDoValidityCheckingDefaultValue
690int *
691__xmlDoValidityCheckingDefaultValue(void) {
692 if (IS_MAIN_THREAD)
693 return (&xmlDoValidityCheckingDefaultValue);
694 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000695 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000696}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000697int xmlThrDefDoValidityCheckingDefaultValue(int v) {
698 int ret;
699 xmlMutexLock(xmlThrDefMutex);
700 ret = xmlDoValidityCheckingDefaultValueThrDef;
701 xmlDoValidityCheckingDefaultValueThrDef = v;
702 xmlMutexUnlock(xmlThrDefMutex);
703 return ret;
704}
Daniel Veillardb8478642001-10-12 17:29:10 +0000705
Daniel Veillardb8478642001-10-12 17:29:10 +0000706#undef xmlGenericError
707xmlGenericErrorFunc *
708__xmlGenericError(void) {
709 if (IS_MAIN_THREAD)
710 return (&xmlGenericError);
711 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000712 return (&xmlGetGlobalState()->xmlGenericError);
Daniel Veillardb8478642001-10-12 17:29:10 +0000713}
714
Daniel Veillardb8478642001-10-12 17:29:10 +0000715#undef xmlGenericErrorContext
716void * *
717__xmlGenericErrorContext(void) {
718 if (IS_MAIN_THREAD)
719 return (&xmlGenericErrorContext);
720 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000721 return (&xmlGetGlobalState()->xmlGenericErrorContext);
Daniel Veillardb8478642001-10-12 17:29:10 +0000722}
723
Daniel Veillardb8478642001-10-12 17:29:10 +0000724#undef xmlGetWarningsDefaultValue
725int *
726__xmlGetWarningsDefaultValue(void) {
727 if (IS_MAIN_THREAD)
728 return (&xmlGetWarningsDefaultValue);
729 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000730 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000731}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000732int xmlThrDefGetWarningsDefaultValue(int v) {
733 int ret;
734 xmlMutexLock(xmlThrDefMutex);
735 ret = xmlGetWarningsDefaultValueThrDef;
736 xmlGetWarningsDefaultValueThrDef = v;
737 xmlMutexUnlock(xmlThrDefMutex);
738 return ret;
739}
Daniel Veillardb8478642001-10-12 17:29:10 +0000740
Daniel Veillardb8478642001-10-12 17:29:10 +0000741#undef xmlIndentTreeOutput
742int *
743__xmlIndentTreeOutput(void) {
744 if (IS_MAIN_THREAD)
745 return (&xmlIndentTreeOutput);
746 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000747 return (&xmlGetGlobalState()->xmlIndentTreeOutput);
Daniel Veillardb8478642001-10-12 17:29:10 +0000748}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000749int xmlThrDefIndentTreeOutput(int v) {
750 int ret;
751 xmlMutexLock(xmlThrDefMutex);
752 ret = xmlIndentTreeOutputThrDef;
753 xmlIndentTreeOutputThrDef = v;
754 xmlMutexUnlock(xmlThrDefMutex);
755 return ret;
756}
Daniel Veillardb8478642001-10-12 17:29:10 +0000757
Aleksey Sanin23002562002-05-24 07:18:40 +0000758#undef xmlTreeIndentString
759const char * *
760__xmlTreeIndentString(void) {
761 if (IS_MAIN_THREAD)
762 return (&xmlTreeIndentString);
763 else
764 return (&xmlGetGlobalState()->xmlTreeIndentString);
765}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000766const char * xmlThrDefTreeIndentString(const char * v) {
767 const char * ret;
768 xmlMutexLock(xmlThrDefMutex);
769 ret = xmlTreeIndentStringThrDef;
770 xmlTreeIndentStringThrDef = v;
771 xmlMutexUnlock(xmlThrDefMutex);
772 return ret;
773}
Aleksey Sanin23002562002-05-24 07:18:40 +0000774
Daniel Veillardb8478642001-10-12 17:29:10 +0000775#undef xmlKeepBlanksDefaultValue
776int *
777__xmlKeepBlanksDefaultValue(void) {
778 if (IS_MAIN_THREAD)
779 return (&xmlKeepBlanksDefaultValue);
780 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000781 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000782}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000783int xmlThrDefKeepBlanksDefaultValue(int v) {
784 int ret;
785 xmlMutexLock(xmlThrDefMutex);
786 ret = xmlKeepBlanksDefaultValueThrDef;
787 xmlKeepBlanksDefaultValueThrDef = v;
788 xmlMutexUnlock(xmlThrDefMutex);
789 return ret;
790}
Daniel Veillardb8478642001-10-12 17:29:10 +0000791
Daniel Veillardb8478642001-10-12 17:29:10 +0000792#undef xmlLineNumbersDefaultValue
793int *
794__xmlLineNumbersDefaultValue(void) {
795 if (IS_MAIN_THREAD)
796 return (&xmlLineNumbersDefaultValue);
797 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000798 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000799}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000800int xmlThrDefLineNumbersDefaultValue(int v) {
801 int ret;
802 xmlMutexLock(xmlThrDefMutex);
803 ret = xmlLineNumbersDefaultValueThrDef;
804 xmlLineNumbersDefaultValueThrDef = v;
805 xmlMutexUnlock(xmlThrDefMutex);
806 return ret;
807}
Daniel Veillardb8478642001-10-12 17:29:10 +0000808
Daniel Veillardb8478642001-10-12 17:29:10 +0000809#undef xmlLoadExtDtdDefaultValue
810int *
811__xmlLoadExtDtdDefaultValue(void) {
812 if (IS_MAIN_THREAD)
813 return (&xmlLoadExtDtdDefaultValue);
814 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000815 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000816}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000817int xmlThrDefLoadExtDtdDefaultValue(int v) {
818 int ret;
819 xmlMutexLock(xmlThrDefMutex);
820 ret = xmlLoadExtDtdDefaultValueThrDef;
821 xmlLoadExtDtdDefaultValueThrDef = v;
822 xmlMutexUnlock(xmlThrDefMutex);
823 return ret;
824}
Daniel Veillardb8478642001-10-12 17:29:10 +0000825
Daniel Veillardb8478642001-10-12 17:29:10 +0000826#undef xmlParserDebugEntities
827int *
828__xmlParserDebugEntities(void) {
829 if (IS_MAIN_THREAD)
830 return (&xmlParserDebugEntities);
831 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000832 return (&xmlGetGlobalState()->xmlParserDebugEntities);
Daniel Veillardb8478642001-10-12 17:29:10 +0000833}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000834int xmlThrDefParserDebugEntities(int v) {
835 int ret;
836 xmlMutexLock(xmlThrDefMutex);
837 ret = xmlParserDebugEntitiesThrDef;
838 xmlParserDebugEntitiesThrDef = v;
839 xmlMutexUnlock(xmlThrDefMutex);
840 return ret;
841}
Daniel Veillardb8478642001-10-12 17:29:10 +0000842
Daniel Veillardb8478642001-10-12 17:29:10 +0000843#undef xmlParserVersion
844const char * *
845__xmlParserVersion(void) {
846 if (IS_MAIN_THREAD)
847 return (&xmlParserVersion);
848 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000849 return (&xmlGetGlobalState()->xmlParserVersion);
Daniel Veillardb8478642001-10-12 17:29:10 +0000850}
851
Daniel Veillardb8478642001-10-12 17:29:10 +0000852#undef xmlPedanticParserDefaultValue
853int *
854__xmlPedanticParserDefaultValue(void) {
855 if (IS_MAIN_THREAD)
856 return (&xmlPedanticParserDefaultValue);
857 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000858 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000859}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000860int xmlThrDefPedanticParserDefaultValue(int v) {
861 int ret;
862 xmlMutexLock(xmlThrDefMutex);
863 ret = xmlPedanticParserDefaultValueThrDef;
864 xmlPedanticParserDefaultValueThrDef = v;
865 xmlMutexUnlock(xmlThrDefMutex);
866 return ret;
867}
Daniel Veillardb8478642001-10-12 17:29:10 +0000868
Daniel Veillardb8478642001-10-12 17:29:10 +0000869#undef xmlSaveNoEmptyTags
870int *
871__xmlSaveNoEmptyTags(void) {
872 if (IS_MAIN_THREAD)
873 return (&xmlSaveNoEmptyTags);
874 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000875 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags);
Daniel Veillardb8478642001-10-12 17:29:10 +0000876}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000877int xmlThrDefSaveNoEmptyTags(int v) {
878 int ret;
879 xmlMutexLock(xmlThrDefMutex);
880 ret = xmlSaveNoEmptyTagsThrDef;
881 xmlSaveNoEmptyTagsThrDef = v;
882 xmlMutexUnlock(xmlThrDefMutex);
883 return ret;
884}
Daniel Veillardb8478642001-10-12 17:29:10 +0000885
Daniel Veillardb8478642001-10-12 17:29:10 +0000886#undef xmlSubstituteEntitiesDefaultValue
887int *
888__xmlSubstituteEntitiesDefaultValue(void) {
889 if (IS_MAIN_THREAD)
890 return (&xmlSubstituteEntitiesDefaultValue);
891 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000892 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000893}
Daniel Veillard781ac8b2003-05-15 22:11:36 +0000894int xmlThrDefSubstituteEntitiesDefaultValue(int v) {
895 int ret;
896 xmlMutexLock(xmlThrDefMutex);
897 ret = xmlSubstituteEntitiesDefaultValueThrDef;
898 xmlSubstituteEntitiesDefaultValueThrDef = v;
899 xmlMutexUnlock(xmlThrDefMutex);
900 return ret;
901}
Daniel Veillard5335dc52003-01-01 20:59:38 +0000902
903#undef xmlRegisterNodeDefaultValue
904xmlRegisterNodeFunc *
905__xmlRegisterNodeDefaultValue(void) {
906 if (IS_MAIN_THREAD)
907 return (&xmlRegisterNodeDefaultValue);
908 else
909 return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue);
910}
911
912#undef xmlDeregisterNodeDefaultValue
913xmlDeregisterNodeFunc *
914__xmlDeregisterNodeDefaultValue(void) {
915 if (IS_MAIN_THREAD)
916 return (&xmlDeregisterNodeDefaultValue);
917 else
918 return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue);
919}