blob: 2a50a08ef840a70d7ce3579efe698709936af198 [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>
24
Daniel Veillard3c01b1d2001-10-17 15:58:35 +000025/* #define DEBUG_GLOBALS */
26
Daniel Veillardb8478642001-10-12 17:29:10 +000027/*
28 * Helpful Macro
29 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +000030#ifdef LIBXML_THREAD_ENABLED
31#define IS_MAIN_THREAD (xmlIsMainThread())
Daniel Veillardb8478642001-10-12 17:29:10 +000032#else
33#define IS_MAIN_THREAD 1
34#endif
35
36/************************************************************************
37 * *
38 * All the user accessible global variables of the library *
39 * *
40 ************************************************************************/
41
Daniel Veillardb8478642001-10-12 17:29:10 +000042/*
43 * Memory allocation routines
44 */
Daniel Veillard7216cfd2002-11-08 15:10:00 +000045#if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY)
Daniel Veillardd0463562001-10-13 09:15:48 +000046extern void xmlMemFree(void *ptr);
47extern void * xmlMemMalloc(size_t size);
48extern void * xmlMemRealloc(void *ptr,size_t size);
49extern char * xmlMemoryStrdup(const char *str);
50
Daniel Veillardb8478642001-10-12 17:29:10 +000051xmlFreeFunc xmlFree = (xmlFreeFunc) xmlMemFree;
52xmlMallocFunc xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
53xmlReallocFunc xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
54xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
55#else
Daniel Veillard9d06d302002-01-22 18:15:52 +000056/**
57 * xmlFree:
58 * @mem: an already allocated block of memory
59 *
60 * The variable holding the libxml free() implementation
61 */
Daniel Veillardb8478642001-10-12 17:29:10 +000062xmlFreeFunc xmlFree = (xmlFreeFunc) free;
Daniel Veillard9d06d302002-01-22 18:15:52 +000063/**
64 * xmlMalloc:
65 * @size: the size requested in bytes
66 *
67 * The variable holding the libxml malloc() implementation
68 *
69 * Returns a pointer to the newly allocated block or NULL in case of error
70 */
Daniel Veillardb8478642001-10-12 17:29:10 +000071xmlMallocFunc xmlMalloc = (xmlMallocFunc) malloc;
Daniel Veillard9d06d302002-01-22 18:15:52 +000072/**
73 * xmlRealloc:
74 * @mem: an already allocated block of memory
75 * @size: the new size requested in bytes
76 *
77 * The variable holding the libxml realloc() implementation
78 *
79 * Returns a pointer to the newly reallocated block or NULL in case of error
80 */
Daniel Veillardb8478642001-10-12 17:29:10 +000081xmlReallocFunc xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard9d06d302002-01-22 18:15:52 +000082/**
83 * xmlMemStrdup:
84 * @str: a zero terminated string
85 *
86 * The variable holding the libxml strdup() implementation
87 *
88 * Returns the copy of the string or NULL in case of error
89 */
Daniel Veillardb82c1662001-12-09 14:00:54 +000090xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +000091#endif
92
Daniel Veillardd0463562001-10-13 09:15:48 +000093#include <libxml/threads.h>
94#include <libxml/globals.h>
95#include <libxml/SAX.h>
96
97#undef docbDefaultSAXHandler
98#undef htmlDefaultSAXHandler
99#undef oldXMLWDcompatibility
100#undef xmlBufferAllocScheme
101#undef xmlDefaultBufferSize
102#undef xmlDefaultSAXHandler
103#undef xmlDefaultSAXLocator
104#undef xmlDoValidityCheckingDefaultValue
105#undef xmlGenericError
106#undef xmlGenericErrorContext
107#undef xmlGetWarningsDefaultValue
108#undef xmlIndentTreeOutput
Aleksey Sanin23002562002-05-24 07:18:40 +0000109#undef xmlTreeIndentString
Daniel Veillardd0463562001-10-13 09:15:48 +0000110#undef xmlKeepBlanksDefaultValue
111#undef xmlLineNumbersDefaultValue
112#undef xmlLoadExtDtdDefaultValue
113#undef xmlParserDebugEntities
114#undef xmlParserVersion
115#undef xmlPedanticParserDefaultValue
116#undef xmlSaveNoEmptyTags
117#undef xmlSubstituteEntitiesDefaultValue
Daniel Veillard8326e732003-01-07 00:19:07 +0000118#undef xmlRegisterNodeDefaultValue
119#undef xmlDeregisterNodeDefaultValue
Daniel Veillardd0463562001-10-13 09:15:48 +0000120
121#undef xmlFree
122#undef xmlMalloc
123#undef xmlMemStrdup
124#undef xmlRealloc
125
Daniel Veillard9d06d302002-01-22 18:15:52 +0000126/**
127 * xmlParserVersion:
128 *
129 * Constant string describing the internal version of the library
130 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000131const char *xmlParserVersion = LIBXML_VERSION_STRING;
132
Daniel Veillard9d06d302002-01-22 18:15:52 +0000133/**
134 * xmlBufferAllocScheme:
135 *
136 * Global setting, default allocation policy for buffers, default is
137 * XML_BUFFER_ALLOC_EXACT
Daniel Veillardb8478642001-10-12 17:29:10 +0000138 */
139xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000140/**
141 * xmlDefaultBufferSize:
142 *
143 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
144 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000145int xmlDefaultBufferSize = BASE_BUFFER_SIZE;
146
147/*
148 * Parser defaults
149 */
Daniel Veillardd0463562001-10-13 09:15:48 +0000150
Daniel Veillard9d06d302002-01-22 18:15:52 +0000151/**
152 * oldXMLWDcompatibility:
153 *
154 * Global setting, DEPRECATED.
155 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000156int oldXMLWDcompatibility = 0; /* DEPRECATED */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000157/**
158 * xmlParserDebugEntities:
159 *
160 * Global setting, asking the parser to print out debugging informations.
161 * while handling entities.
162 * Disabled by default
163 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000164int xmlParserDebugEntities = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000165/**
166 * xmlDoValidityCheckingDefaultValue:
167 *
168 * Global setting, indicate that the parser should work in validating mode.
169 * Disabled by default.
170 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000171int xmlDoValidityCheckingDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000172/**
173 * xmlGetWarningsDefaultValue:
174 *
175 * Global setting, indicate that the parser should provide warnings.
176 * Activated by default.
177 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000178int xmlGetWarningsDefaultValue = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000179/**
180 * xmlLoadExtDtdDefaultValue:
181 *
182 * Global setting, indicate that the parser should load DTD while not
183 * validating.
184 * Disabled by default.
185 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000186int xmlLoadExtDtdDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000187/**
188 * xmlPedanticParserDefaultValue:
189 *
190 * Global setting, indicate that the parser be pedantic
191 * Disabled by default.
192 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000193int xmlPedanticParserDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000194/**
195 * xmlLineNumbersDefaultValue:
196 *
197 * Global setting, indicate that the parser should store the line number
198 * in the content field of elements in the DOM tree.
199 * Disabled by default since this may not be safe for old classes of
200 * applicaton.
201 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000202int xmlLineNumbersDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000203/**
204 * xmlKeepBlanksDefaultValue:
205 *
206 * Global setting, indicate that the parser should keep all blanks
207 * nodes found in the content
208 * Activated by default, this is actually needed to have the parser
209 * conformant to the XML Recommendation, however the option is kept
210 * for some applications since this was libxml1 default behaviour.
211 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000212int xmlKeepBlanksDefaultValue = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000213/**
214 * xmlSubstituteEntitiesDefaultValue:
215 *
216 * Global setting, indicate that the parser should not generate entity
217 * references but replace them with the actual content of the entity
218 * Disabled by default, this should be activated when using XPath since
219 * the XPath data model requires entities replacement and the XPath
220 * engine does not handle entities references transparently.
221 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000222int xmlSubstituteEntitiesDefaultValue = 0;
223
Daniel Veillard5335dc52003-01-01 20:59:38 +0000224xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL;
225xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue = NULL;
226
Daniel Veillardb8478642001-10-12 17:29:10 +0000227/*
228 * Error handling
229 */
230
231/* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
232/* Must initialize xmlGenericError in xmlInitParser */
Daniel Veillard635ef722001-10-29 11:48:19 +0000233void xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
234 const char *msg,
235 ...);
Daniel Veillard9d06d302002-01-22 18:15:52 +0000236/**
237 * xmlGenericError:
238 *
239 * Global setting: function used for generic error callbacks
240 */
Daniel Veillard635ef722001-10-29 11:48:19 +0000241xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000242/**
243 * xmlGenericErrorContext:
244 *
245 * Global setting passed to generic error callbacks
246 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000247void *xmlGenericErrorContext = NULL;
248
249/*
250 * output defaults
251 */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000252/**
253 * xmlIndentTreeOutput:
254 *
255 * Global setting, asking the serializer to indent the output tree by default
Aleksey Sanin23002562002-05-24 07:18:40 +0000256 * Enabled by default
Daniel Veillard9d06d302002-01-22 18:15:52 +0000257 */
Aleksey Sanin23002562002-05-24 07:18:40 +0000258int xmlIndentTreeOutput = 1;
259
260/**
261 * xmlTreeIndentString:
262 *
263 * The string used to do one-level indent. By default is equal to " " (two spaces)
264 */
265const char *xmlTreeIndentString = " ";
266
Daniel Veillard9d06d302002-01-22 18:15:52 +0000267/**
268 * xmlSaveNoEmptyTags:
269 *
270 * Global setting, asking the serializer to not output empty tags
271 * as <empty/> but <empty></empty>. those two forms are undistinguishable
272 * once parsed.
273 * Disabled by default
274 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000275int xmlSaveNoEmptyTags = 0;
276
Daniel Veillard9d06d302002-01-22 18:15:52 +0000277/**
278 * xmlDefaultSAXHandler:
279 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000280 * Default handler for XML, builds the DOM tree
281 */
282xmlSAXHandler xmlDefaultSAXHandler = {
283 internalSubset,
284 isStandalone,
285 hasInternalSubset,
286 hasExternalSubset,
287 resolveEntity,
288 getEntity,
289 entityDecl,
290 notationDecl,
291 attributeDecl,
292 elementDecl,
293 unparsedEntityDecl,
294 setDocumentLocator,
295 startDocument,
296 endDocument,
297 startElement,
298 endElement,
299 reference,
300 characters,
301 characters,
302 processingInstruction,
303 comment,
304 xmlParserWarning,
305 xmlParserError,
306 xmlParserError,
307 getParameterEntity,
308 cdataBlock,
309 externalSubset,
310 0
311};
312
Daniel Veillard9d06d302002-01-22 18:15:52 +0000313/**
314 * xmlDefaultSAXLocator:
315 *
316 * The default SAX Locator
317 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
Daniel Veillardb8478642001-10-12 17:29:10 +0000318 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000319xmlSAXLocator xmlDefaultSAXLocator = {
320 getPublicId, getSystemId, getLineNumber, getColumnNumber
321};
322
323#ifdef LIBXML_HTML_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000324/**
325 * htmlDefaultSAXHandler:
326 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000327 * Default handler for HTML, builds the DOM tree
328 */
329xmlSAXHandler htmlDefaultSAXHandler = {
330 internalSubset,
331 NULL,
332 NULL,
333 NULL,
334 NULL,
335 getEntity,
336 NULL,
337 NULL,
338 NULL,
339 NULL,
340 NULL,
341 setDocumentLocator,
342 startDocument,
343 endDocument,
344 startElement,
345 endElement,
346 NULL,
347 characters,
348 ignorableWhitespace,
349 NULL,
350 comment,
351 xmlParserWarning,
352 xmlParserError,
353 xmlParserError,
354 getParameterEntity,
355 cdataBlock,
356 NULL,
357 0
358};
359#endif /* LIBXML_HTML_ENABLED */
360
361#ifdef LIBXML_DOCB_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000362/**
363 * docbDefaultSAXHandler:
364 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000365 * Default handler for SGML DocBook, builds the DOM tree
366 */
367xmlSAXHandler docbDefaultSAXHandler = {
368 internalSubset,
369 isStandalone,
370 hasInternalSubset,
371 hasExternalSubset,
372 resolveEntity,
373 getEntity,
374 entityDecl,
375 NULL,
376 NULL,
377 NULL,
378 NULL,
379 setDocumentLocator,
380 startDocument,
381 endDocument,
382 startElement,
383 endElement,
384 reference,
385 characters,
386 ignorableWhitespace,
387 NULL,
388 comment,
389 xmlParserWarning,
390 xmlParserError,
391 xmlParserError,
392 getParameterEntity,
393 NULL,
394 NULL,
395 0
396};
397#endif /* LIBXML_DOCB_ENABLED */
398
399/**
400 * xmlInitializeGlobalState:
401 * @gs: a pointer to a newly allocated global state
402 *
403 * xmlInitializeGlobalState() initialize a global state with all the
404 * default values of the library.
405 */
406void
407xmlInitializeGlobalState(xmlGlobalStatePtr gs)
408{
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000409#ifdef DEBUG_GLOBALS
410 fprintf(stderr, "Initializing globals at %lu for thread %d\n",
411 (unsigned long) gs, xmlGetThreadId());
412#endif
413
Daniel Veillardb8478642001-10-12 17:29:10 +0000414 /*
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000415 * Perform initialization as required by libxml
Daniel Veillardb8478642001-10-12 17:29:10 +0000416 */
William M. Brack8b2c7f12002-11-22 05:07:29 +0000417
Daniel Veillarda4617b82001-11-04 20:19:12 +0000418#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000419 initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000420#endif
421#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000422 inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000423#endif
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000424 initGenericErrorDefaultFunc(&gs->xmlGenericError);
425
Daniel Veillardb8478642001-10-12 17:29:10 +0000426 gs->oldXMLWDcompatibility = 0;
427 gs->xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
428 gs->xmlDefaultBufferSize = BASE_BUFFER_SIZE;
429 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
430 gs->xmlDefaultSAXLocator.getPublicId = getPublicId;
431 gs->xmlDefaultSAXLocator.getSystemId = getSystemId;
432 gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber;
433 gs->xmlDefaultSAXLocator.getColumnNumber = getColumnNumber;
434 gs->xmlDoValidityCheckingDefaultValue = 0;
435#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
436 gs->xmlFree = (xmlFreeFunc) xmlMemFree;
437 gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
438 gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
439 gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
440#else
441 gs->xmlFree = (xmlFreeFunc) free;
442 gs->xmlMalloc = (xmlMallocFunc) malloc;
443 gs->xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard572577e2002-01-18 16:23:55 +0000444 gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +0000445#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000446 gs->xmlGenericErrorContext = NULL;
447 gs->xmlGetWarningsDefaultValue = 1;
Aleksey Sanin23002562002-05-24 07:18:40 +0000448 gs->xmlIndentTreeOutput = 1;
449 gs->xmlTreeIndentString = " ";
Daniel Veillardb8478642001-10-12 17:29:10 +0000450 gs->xmlKeepBlanksDefaultValue = 1;
451 gs->xmlLineNumbersDefaultValue = 0;
452 gs->xmlLoadExtDtdDefaultValue = 0;
453 gs->xmlParserDebugEntities = 0;
454 gs->xmlParserVersion = LIBXML_VERSION_STRING;
455 gs->xmlPedanticParserDefaultValue = 0;
456 gs->xmlSaveNoEmptyTags = 0;
457 gs->xmlSubstituteEntitiesDefaultValue = 0;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000458
459 gs->xmlRegisterNodeDefaultValue = NULL;
460 gs->xmlDeregisterNodeDefaultValue = NULL;
Daniel Veillardb8478642001-10-12 17:29:10 +0000461}
462
Daniel Veillard5335dc52003-01-01 20:59:38 +0000463/**
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000464 * xmlRegisterNodeDefault:
Daniel Veillard5335dc52003-01-01 20:59:38 +0000465 * @func: function pointer to the new RegisterNodeFunc
466 *
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000467 * Returns the previous value of the registration function
Daniel Veillard5335dc52003-01-01 20:59:38 +0000468 */
469xmlRegisterNodeFunc
470xmlRegisterNodeDefault(xmlRegisterNodeFunc func)
471{
472 xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue;
473
474 xmlRegisterNodeDefaultValue = func;
475 return(old);
476}
477
478/**
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000479 * xmlDeregisterNodeDefault:
Daniel Veillard5335dc52003-01-01 20:59:38 +0000480 * @func: function pointer to the new DeregisterNodeFunc
481 *
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000482 * Returns the previous value of the deregistration function
Daniel Veillard5335dc52003-01-01 20:59:38 +0000483 */
484xmlDeregisterNodeFunc
485xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func)
486{
487 xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue;
488
489 xmlDeregisterNodeDefaultValue = func;
490 return(old);
491}
492
493
Daniel Veillarda4617b82001-11-04 20:19:12 +0000494#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000495#undef docbDefaultSAXHandler
496xmlSAXHandler *
497__docbDefaultSAXHandler(void) {
498 if (IS_MAIN_THREAD)
499 return (&docbDefaultSAXHandler);
500 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000501 return (&xmlGetGlobalState()->docbDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000502}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000503#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000504
Daniel Veillarda4617b82001-11-04 20:19:12 +0000505#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000506#undef htmlDefaultSAXHandler
507xmlSAXHandler *
508__htmlDefaultSAXHandler(void) {
509 if (IS_MAIN_THREAD)
510 return (&htmlDefaultSAXHandler);
511 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000512 return (&xmlGetGlobalState()->htmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000513}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000514#endif
515
516/*
517 * Everything starting from the line below is
518 * Automatically generated by build_glob.py.
519 * Do not modify the previous line.
520 */
521
Daniel Veillardb8478642001-10-12 17:29:10 +0000522
Daniel Veillardb8478642001-10-12 17:29:10 +0000523#undef oldXMLWDcompatibility
524int *
525__oldXMLWDcompatibility(void) {
526 if (IS_MAIN_THREAD)
527 return (&oldXMLWDcompatibility);
528 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000529 return (&xmlGetGlobalState()->oldXMLWDcompatibility);
Daniel Veillardb8478642001-10-12 17:29:10 +0000530}
531
Daniel Veillardb8478642001-10-12 17:29:10 +0000532#undef xmlBufferAllocScheme
533xmlBufferAllocationScheme *
534__xmlBufferAllocScheme(void) {
535 if (IS_MAIN_THREAD)
536 return (&xmlBufferAllocScheme);
537 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000538 return (&xmlGetGlobalState()->xmlBufferAllocScheme);
Daniel Veillardb8478642001-10-12 17:29:10 +0000539}
540
Daniel Veillardb8478642001-10-12 17:29:10 +0000541#undef xmlDefaultBufferSize
542int *
543__xmlDefaultBufferSize(void) {
544 if (IS_MAIN_THREAD)
545 return (&xmlDefaultBufferSize);
546 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000547 return (&xmlGetGlobalState()->xmlDefaultBufferSize);
Daniel Veillardb8478642001-10-12 17:29:10 +0000548}
549
Daniel Veillardb8478642001-10-12 17:29:10 +0000550#undef xmlDefaultSAXHandler
551xmlSAXHandler *
552__xmlDefaultSAXHandler(void) {
553 if (IS_MAIN_THREAD)
554 return (&xmlDefaultSAXHandler);
555 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000556 return (&xmlGetGlobalState()->xmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000557}
558
Daniel Veillardb8478642001-10-12 17:29:10 +0000559#undef xmlDefaultSAXLocator
560xmlSAXLocator *
561__xmlDefaultSAXLocator(void) {
562 if (IS_MAIN_THREAD)
563 return (&xmlDefaultSAXLocator);
564 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000565 return (&xmlGetGlobalState()->xmlDefaultSAXLocator);
Daniel Veillardb8478642001-10-12 17:29:10 +0000566}
567
Daniel Veillardb8478642001-10-12 17:29:10 +0000568#undef xmlDoValidityCheckingDefaultValue
569int *
570__xmlDoValidityCheckingDefaultValue(void) {
571 if (IS_MAIN_THREAD)
572 return (&xmlDoValidityCheckingDefaultValue);
573 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000574 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000575}
576
Daniel Veillardb8478642001-10-12 17:29:10 +0000577#undef xmlGenericError
578xmlGenericErrorFunc *
579__xmlGenericError(void) {
580 if (IS_MAIN_THREAD)
581 return (&xmlGenericError);
582 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000583 return (&xmlGetGlobalState()->xmlGenericError);
Daniel Veillardb8478642001-10-12 17:29:10 +0000584}
585
Daniel Veillardb8478642001-10-12 17:29:10 +0000586#undef xmlGenericErrorContext
587void * *
588__xmlGenericErrorContext(void) {
589 if (IS_MAIN_THREAD)
590 return (&xmlGenericErrorContext);
591 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000592 return (&xmlGetGlobalState()->xmlGenericErrorContext);
Daniel Veillardb8478642001-10-12 17:29:10 +0000593}
594
Daniel Veillardb8478642001-10-12 17:29:10 +0000595#undef xmlGetWarningsDefaultValue
596int *
597__xmlGetWarningsDefaultValue(void) {
598 if (IS_MAIN_THREAD)
599 return (&xmlGetWarningsDefaultValue);
600 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000601 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000602}
603
Daniel Veillardb8478642001-10-12 17:29:10 +0000604#undef xmlIndentTreeOutput
605int *
606__xmlIndentTreeOutput(void) {
607 if (IS_MAIN_THREAD)
608 return (&xmlIndentTreeOutput);
609 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000610 return (&xmlGetGlobalState()->xmlIndentTreeOutput);
Daniel Veillardb8478642001-10-12 17:29:10 +0000611}
612
Aleksey Sanin23002562002-05-24 07:18:40 +0000613#undef xmlTreeIndentString
614const char * *
615__xmlTreeIndentString(void) {
616 if (IS_MAIN_THREAD)
617 return (&xmlTreeIndentString);
618 else
619 return (&xmlGetGlobalState()->xmlTreeIndentString);
620}
621
Daniel Veillardb8478642001-10-12 17:29:10 +0000622#undef xmlKeepBlanksDefaultValue
623int *
624__xmlKeepBlanksDefaultValue(void) {
625 if (IS_MAIN_THREAD)
626 return (&xmlKeepBlanksDefaultValue);
627 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000628 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000629}
630
Daniel Veillardb8478642001-10-12 17:29:10 +0000631#undef xmlLineNumbersDefaultValue
632int *
633__xmlLineNumbersDefaultValue(void) {
634 if (IS_MAIN_THREAD)
635 return (&xmlLineNumbersDefaultValue);
636 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000637 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000638}
639
Daniel Veillardb8478642001-10-12 17:29:10 +0000640#undef xmlLoadExtDtdDefaultValue
641int *
642__xmlLoadExtDtdDefaultValue(void) {
643 if (IS_MAIN_THREAD)
644 return (&xmlLoadExtDtdDefaultValue);
645 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000646 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000647}
648
Daniel Veillardb8478642001-10-12 17:29:10 +0000649#undef xmlParserDebugEntities
650int *
651__xmlParserDebugEntities(void) {
652 if (IS_MAIN_THREAD)
653 return (&xmlParserDebugEntities);
654 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000655 return (&xmlGetGlobalState()->xmlParserDebugEntities);
Daniel Veillardb8478642001-10-12 17:29:10 +0000656}
657
Daniel Veillardb8478642001-10-12 17:29:10 +0000658#undef xmlParserVersion
659const char * *
660__xmlParserVersion(void) {
661 if (IS_MAIN_THREAD)
662 return (&xmlParserVersion);
663 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000664 return (&xmlGetGlobalState()->xmlParserVersion);
Daniel Veillardb8478642001-10-12 17:29:10 +0000665}
666
Daniel Veillardb8478642001-10-12 17:29:10 +0000667#undef xmlPedanticParserDefaultValue
668int *
669__xmlPedanticParserDefaultValue(void) {
670 if (IS_MAIN_THREAD)
671 return (&xmlPedanticParserDefaultValue);
672 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000673 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000674}
675
Daniel Veillardb8478642001-10-12 17:29:10 +0000676#undef xmlSaveNoEmptyTags
677int *
678__xmlSaveNoEmptyTags(void) {
679 if (IS_MAIN_THREAD)
680 return (&xmlSaveNoEmptyTags);
681 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000682 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags);
Daniel Veillardb8478642001-10-12 17:29:10 +0000683}
684
Daniel Veillardb8478642001-10-12 17:29:10 +0000685#undef xmlSubstituteEntitiesDefaultValue
686int *
687__xmlSubstituteEntitiesDefaultValue(void) {
688 if (IS_MAIN_THREAD)
689 return (&xmlSubstituteEntitiesDefaultValue);
690 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000691 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000692}
Daniel Veillard5335dc52003-01-01 20:59:38 +0000693
694#undef xmlRegisterNodeDefaultValue
695xmlRegisterNodeFunc *
696__xmlRegisterNodeDefaultValue(void) {
697 if (IS_MAIN_THREAD)
698 return (&xmlRegisterNodeDefaultValue);
699 else
700 return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue);
701}
702
703#undef xmlDeregisterNodeDefaultValue
704xmlDeregisterNodeFunc *
705__xmlDeregisterNodeDefaultValue(void) {
706 if (IS_MAIN_THREAD)
707 return (&xmlDeregisterNodeDefaultValue);
708 else
709 return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue);
710}