blob: b05decd1929d2c57c242d7230cf4c139ea52c1b2 [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
118
119#undef xmlFree
120#undef xmlMalloc
121#undef xmlMemStrdup
122#undef xmlRealloc
123
Daniel Veillard9d06d302002-01-22 18:15:52 +0000124/**
125 * xmlParserVersion:
126 *
127 * Constant string describing the internal version of the library
128 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000129const char *xmlParserVersion = LIBXML_VERSION_STRING;
130
Daniel Veillard9d06d302002-01-22 18:15:52 +0000131/**
132 * xmlBufferAllocScheme:
133 *
134 * Global setting, default allocation policy for buffers, default is
135 * XML_BUFFER_ALLOC_EXACT
Daniel Veillardb8478642001-10-12 17:29:10 +0000136 */
137xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000138/**
139 * xmlDefaultBufferSize:
140 *
141 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
142 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000143int xmlDefaultBufferSize = BASE_BUFFER_SIZE;
144
145/*
146 * Parser defaults
147 */
Daniel Veillardd0463562001-10-13 09:15:48 +0000148
Daniel Veillard9d06d302002-01-22 18:15:52 +0000149/**
150 * oldXMLWDcompatibility:
151 *
152 * Global setting, DEPRECATED.
153 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000154int oldXMLWDcompatibility = 0; /* DEPRECATED */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000155/**
156 * xmlParserDebugEntities:
157 *
158 * Global setting, asking the parser to print out debugging informations.
159 * while handling entities.
160 * Disabled by default
161 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000162int xmlParserDebugEntities = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000163/**
164 * xmlDoValidityCheckingDefaultValue:
165 *
166 * Global setting, indicate that the parser should work in validating mode.
167 * Disabled by default.
168 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000169int xmlDoValidityCheckingDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000170/**
171 * xmlGetWarningsDefaultValue:
172 *
173 * Global setting, indicate that the parser should provide warnings.
174 * Activated by default.
175 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000176int xmlGetWarningsDefaultValue = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000177/**
178 * xmlLoadExtDtdDefaultValue:
179 *
180 * Global setting, indicate that the parser should load DTD while not
181 * validating.
182 * Disabled by default.
183 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000184int xmlLoadExtDtdDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000185/**
186 * xmlPedanticParserDefaultValue:
187 *
188 * Global setting, indicate that the parser be pedantic
189 * Disabled by default.
190 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000191int xmlPedanticParserDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000192/**
193 * xmlLineNumbersDefaultValue:
194 *
195 * Global setting, indicate that the parser should store the line number
196 * in the content field of elements in the DOM tree.
197 * Disabled by default since this may not be safe for old classes of
198 * applicaton.
199 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000200int xmlLineNumbersDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000201/**
202 * xmlKeepBlanksDefaultValue:
203 *
204 * Global setting, indicate that the parser should keep all blanks
205 * nodes found in the content
206 * Activated by default, this is actually needed to have the parser
207 * conformant to the XML Recommendation, however the option is kept
208 * for some applications since this was libxml1 default behaviour.
209 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000210int xmlKeepBlanksDefaultValue = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000211/**
212 * xmlSubstituteEntitiesDefaultValue:
213 *
214 * Global setting, indicate that the parser should not generate entity
215 * references but replace them with the actual content of the entity
216 * Disabled by default, this should be activated when using XPath since
217 * the XPath data model requires entities replacement and the XPath
218 * engine does not handle entities references transparently.
219 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000220int xmlSubstituteEntitiesDefaultValue = 0;
221
Daniel Veillard5335dc52003-01-01 20:59:38 +0000222xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL;
223xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue = NULL;
224
Daniel Veillardb8478642001-10-12 17:29:10 +0000225/*
226 * Error handling
227 */
228
229/* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
230/* Must initialize xmlGenericError in xmlInitParser */
Daniel Veillard635ef722001-10-29 11:48:19 +0000231void xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
232 const char *msg,
233 ...);
Daniel Veillard9d06d302002-01-22 18:15:52 +0000234/**
235 * xmlGenericError:
236 *
237 * Global setting: function used for generic error callbacks
238 */
Daniel Veillard635ef722001-10-29 11:48:19 +0000239xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000240/**
241 * xmlGenericErrorContext:
242 *
243 * Global setting passed to generic error callbacks
244 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000245void *xmlGenericErrorContext = NULL;
246
247/*
248 * output defaults
249 */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000250/**
251 * xmlIndentTreeOutput:
252 *
253 * Global setting, asking the serializer to indent the output tree by default
Aleksey Sanin23002562002-05-24 07:18:40 +0000254 * Enabled by default
Daniel Veillard9d06d302002-01-22 18:15:52 +0000255 */
Aleksey Sanin23002562002-05-24 07:18:40 +0000256int xmlIndentTreeOutput = 1;
257
258/**
259 * xmlTreeIndentString:
260 *
261 * The string used to do one-level indent. By default is equal to " " (two spaces)
262 */
263const char *xmlTreeIndentString = " ";
264
Daniel Veillard9d06d302002-01-22 18:15:52 +0000265/**
266 * xmlSaveNoEmptyTags:
267 *
268 * Global setting, asking the serializer to not output empty tags
269 * as <empty/> but <empty></empty>. those two forms are undistinguishable
270 * once parsed.
271 * Disabled by default
272 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000273int xmlSaveNoEmptyTags = 0;
274
Daniel Veillard9d06d302002-01-22 18:15:52 +0000275/**
276 * xmlDefaultSAXHandler:
277 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000278 * Default handler for XML, builds the DOM tree
279 */
280xmlSAXHandler xmlDefaultSAXHandler = {
281 internalSubset,
282 isStandalone,
283 hasInternalSubset,
284 hasExternalSubset,
285 resolveEntity,
286 getEntity,
287 entityDecl,
288 notationDecl,
289 attributeDecl,
290 elementDecl,
291 unparsedEntityDecl,
292 setDocumentLocator,
293 startDocument,
294 endDocument,
295 startElement,
296 endElement,
297 reference,
298 characters,
299 characters,
300 processingInstruction,
301 comment,
302 xmlParserWarning,
303 xmlParserError,
304 xmlParserError,
305 getParameterEntity,
306 cdataBlock,
307 externalSubset,
308 0
309};
310
Daniel Veillard9d06d302002-01-22 18:15:52 +0000311/**
312 * xmlDefaultSAXLocator:
313 *
314 * The default SAX Locator
315 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
Daniel Veillardb8478642001-10-12 17:29:10 +0000316 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000317xmlSAXLocator xmlDefaultSAXLocator = {
318 getPublicId, getSystemId, getLineNumber, getColumnNumber
319};
320
321#ifdef LIBXML_HTML_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000322/**
323 * htmlDefaultSAXHandler:
324 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000325 * Default handler for HTML, builds the DOM tree
326 */
327xmlSAXHandler htmlDefaultSAXHandler = {
328 internalSubset,
329 NULL,
330 NULL,
331 NULL,
332 NULL,
333 getEntity,
334 NULL,
335 NULL,
336 NULL,
337 NULL,
338 NULL,
339 setDocumentLocator,
340 startDocument,
341 endDocument,
342 startElement,
343 endElement,
344 NULL,
345 characters,
346 ignorableWhitespace,
347 NULL,
348 comment,
349 xmlParserWarning,
350 xmlParserError,
351 xmlParserError,
352 getParameterEntity,
353 cdataBlock,
354 NULL,
355 0
356};
357#endif /* LIBXML_HTML_ENABLED */
358
359#ifdef LIBXML_DOCB_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000360/**
361 * docbDefaultSAXHandler:
362 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000363 * Default handler for SGML DocBook, builds the DOM tree
364 */
365xmlSAXHandler docbDefaultSAXHandler = {
366 internalSubset,
367 isStandalone,
368 hasInternalSubset,
369 hasExternalSubset,
370 resolveEntity,
371 getEntity,
372 entityDecl,
373 NULL,
374 NULL,
375 NULL,
376 NULL,
377 setDocumentLocator,
378 startDocument,
379 endDocument,
380 startElement,
381 endElement,
382 reference,
383 characters,
384 ignorableWhitespace,
385 NULL,
386 comment,
387 xmlParserWarning,
388 xmlParserError,
389 xmlParserError,
390 getParameterEntity,
391 NULL,
392 NULL,
393 0
394};
395#endif /* LIBXML_DOCB_ENABLED */
396
397/**
398 * xmlInitializeGlobalState:
399 * @gs: a pointer to a newly allocated global state
400 *
401 * xmlInitializeGlobalState() initialize a global state with all the
402 * default values of the library.
403 */
404void
405xmlInitializeGlobalState(xmlGlobalStatePtr gs)
406{
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000407#ifdef DEBUG_GLOBALS
408 fprintf(stderr, "Initializing globals at %lu for thread %d\n",
409 (unsigned long) gs, xmlGetThreadId());
410#endif
411
Daniel Veillardb8478642001-10-12 17:29:10 +0000412 /*
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000413 * Perform initialization as required by libxml
Daniel Veillardb8478642001-10-12 17:29:10 +0000414 */
William M. Brack8b2c7f12002-11-22 05:07:29 +0000415
Daniel Veillarda4617b82001-11-04 20:19:12 +0000416#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000417 initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000418#endif
419#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000420 inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000421#endif
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000422 initGenericErrorDefaultFunc(&gs->xmlGenericError);
423
Daniel Veillardb8478642001-10-12 17:29:10 +0000424 gs->oldXMLWDcompatibility = 0;
425 gs->xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
426 gs->xmlDefaultBufferSize = BASE_BUFFER_SIZE;
427 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
428 gs->xmlDefaultSAXLocator.getPublicId = getPublicId;
429 gs->xmlDefaultSAXLocator.getSystemId = getSystemId;
430 gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber;
431 gs->xmlDefaultSAXLocator.getColumnNumber = getColumnNumber;
432 gs->xmlDoValidityCheckingDefaultValue = 0;
433#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
434 gs->xmlFree = (xmlFreeFunc) xmlMemFree;
435 gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
436 gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
437 gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
438#else
439 gs->xmlFree = (xmlFreeFunc) free;
440 gs->xmlMalloc = (xmlMallocFunc) malloc;
441 gs->xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard572577e2002-01-18 16:23:55 +0000442 gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +0000443#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000444 gs->xmlGenericErrorContext = NULL;
445 gs->xmlGetWarningsDefaultValue = 1;
Aleksey Sanin23002562002-05-24 07:18:40 +0000446 gs->xmlIndentTreeOutput = 1;
447 gs->xmlTreeIndentString = " ";
Daniel Veillardb8478642001-10-12 17:29:10 +0000448 gs->xmlKeepBlanksDefaultValue = 1;
449 gs->xmlLineNumbersDefaultValue = 0;
450 gs->xmlLoadExtDtdDefaultValue = 0;
451 gs->xmlParserDebugEntities = 0;
452 gs->xmlParserVersion = LIBXML_VERSION_STRING;
453 gs->xmlPedanticParserDefaultValue = 0;
454 gs->xmlSaveNoEmptyTags = 0;
455 gs->xmlSubstituteEntitiesDefaultValue = 0;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000456
457 gs->xmlRegisterNodeDefaultValue = NULL;
458 gs->xmlDeregisterNodeDefaultValue = NULL;
Daniel Veillardb8478642001-10-12 17:29:10 +0000459}
460
Daniel Veillard5335dc52003-01-01 20:59:38 +0000461/**
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000462 * xmlRegisterNodeDefault:
Daniel Veillard5335dc52003-01-01 20:59:38 +0000463 * @func: function pointer to the new RegisterNodeFunc
464 *
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000465 * Returns the previous value of the registration function
Daniel Veillard5335dc52003-01-01 20:59:38 +0000466 */
467xmlRegisterNodeFunc
468xmlRegisterNodeDefault(xmlRegisterNodeFunc func)
469{
470 xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue;
471
472 xmlRegisterNodeDefaultValue = func;
473 return(old);
474}
475
476/**
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000477 * xmlDeregisterNodeDefault:
Daniel Veillard5335dc52003-01-01 20:59:38 +0000478 * @func: function pointer to the new DeregisterNodeFunc
479 *
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000480 * Returns the previous value of the deregistration function
Daniel Veillard5335dc52003-01-01 20:59:38 +0000481 */
482xmlDeregisterNodeFunc
483xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func)
484{
485 xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue;
486
487 xmlDeregisterNodeDefaultValue = func;
488 return(old);
489}
490
491
Daniel Veillarda4617b82001-11-04 20:19:12 +0000492#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000493#undef docbDefaultSAXHandler
494xmlSAXHandler *
495__docbDefaultSAXHandler(void) {
496 if (IS_MAIN_THREAD)
497 return (&docbDefaultSAXHandler);
498 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000499 return (&xmlGetGlobalState()->docbDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000500}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000501#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000502
Daniel Veillarda4617b82001-11-04 20:19:12 +0000503#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000504#undef htmlDefaultSAXHandler
505xmlSAXHandler *
506__htmlDefaultSAXHandler(void) {
507 if (IS_MAIN_THREAD)
508 return (&htmlDefaultSAXHandler);
509 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000510 return (&xmlGetGlobalState()->htmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000511}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000512#endif
513
514/*
515 * Everything starting from the line below is
516 * Automatically generated by build_glob.py.
517 * Do not modify the previous line.
518 */
519
Daniel Veillardb8478642001-10-12 17:29:10 +0000520
Daniel Veillardb8478642001-10-12 17:29:10 +0000521#undef oldXMLWDcompatibility
522int *
523__oldXMLWDcompatibility(void) {
524 if (IS_MAIN_THREAD)
525 return (&oldXMLWDcompatibility);
526 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000527 return (&xmlGetGlobalState()->oldXMLWDcompatibility);
Daniel Veillardb8478642001-10-12 17:29:10 +0000528}
529
Daniel Veillardb8478642001-10-12 17:29:10 +0000530#undef xmlBufferAllocScheme
531xmlBufferAllocationScheme *
532__xmlBufferAllocScheme(void) {
533 if (IS_MAIN_THREAD)
534 return (&xmlBufferAllocScheme);
535 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000536 return (&xmlGetGlobalState()->xmlBufferAllocScheme);
Daniel Veillardb8478642001-10-12 17:29:10 +0000537}
538
Daniel Veillardb8478642001-10-12 17:29:10 +0000539#undef xmlDefaultBufferSize
540int *
541__xmlDefaultBufferSize(void) {
542 if (IS_MAIN_THREAD)
543 return (&xmlDefaultBufferSize);
544 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000545 return (&xmlGetGlobalState()->xmlDefaultBufferSize);
Daniel Veillardb8478642001-10-12 17:29:10 +0000546}
547
Daniel Veillardb8478642001-10-12 17:29:10 +0000548#undef xmlDefaultSAXHandler
549xmlSAXHandler *
550__xmlDefaultSAXHandler(void) {
551 if (IS_MAIN_THREAD)
552 return (&xmlDefaultSAXHandler);
553 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000554 return (&xmlGetGlobalState()->xmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000555}
556
Daniel Veillardb8478642001-10-12 17:29:10 +0000557#undef xmlDefaultSAXLocator
558xmlSAXLocator *
559__xmlDefaultSAXLocator(void) {
560 if (IS_MAIN_THREAD)
561 return (&xmlDefaultSAXLocator);
562 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000563 return (&xmlGetGlobalState()->xmlDefaultSAXLocator);
Daniel Veillardb8478642001-10-12 17:29:10 +0000564}
565
Daniel Veillardb8478642001-10-12 17:29:10 +0000566#undef xmlDoValidityCheckingDefaultValue
567int *
568__xmlDoValidityCheckingDefaultValue(void) {
569 if (IS_MAIN_THREAD)
570 return (&xmlDoValidityCheckingDefaultValue);
571 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000572 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000573}
574
Daniel Veillardb8478642001-10-12 17:29:10 +0000575#undef xmlGenericError
576xmlGenericErrorFunc *
577__xmlGenericError(void) {
578 if (IS_MAIN_THREAD)
579 return (&xmlGenericError);
580 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000581 return (&xmlGetGlobalState()->xmlGenericError);
Daniel Veillardb8478642001-10-12 17:29:10 +0000582}
583
Daniel Veillardb8478642001-10-12 17:29:10 +0000584#undef xmlGenericErrorContext
585void * *
586__xmlGenericErrorContext(void) {
587 if (IS_MAIN_THREAD)
588 return (&xmlGenericErrorContext);
589 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000590 return (&xmlGetGlobalState()->xmlGenericErrorContext);
Daniel Veillardb8478642001-10-12 17:29:10 +0000591}
592
Daniel Veillardb8478642001-10-12 17:29:10 +0000593#undef xmlGetWarningsDefaultValue
594int *
595__xmlGetWarningsDefaultValue(void) {
596 if (IS_MAIN_THREAD)
597 return (&xmlGetWarningsDefaultValue);
598 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000599 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000600}
601
Daniel Veillardb8478642001-10-12 17:29:10 +0000602#undef xmlIndentTreeOutput
603int *
604__xmlIndentTreeOutput(void) {
605 if (IS_MAIN_THREAD)
606 return (&xmlIndentTreeOutput);
607 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000608 return (&xmlGetGlobalState()->xmlIndentTreeOutput);
Daniel Veillardb8478642001-10-12 17:29:10 +0000609}
610
Aleksey Sanin23002562002-05-24 07:18:40 +0000611#undef xmlTreeIndentString
612const char * *
613__xmlTreeIndentString(void) {
614 if (IS_MAIN_THREAD)
615 return (&xmlTreeIndentString);
616 else
617 return (&xmlGetGlobalState()->xmlTreeIndentString);
618}
619
Daniel Veillardb8478642001-10-12 17:29:10 +0000620#undef xmlKeepBlanksDefaultValue
621int *
622__xmlKeepBlanksDefaultValue(void) {
623 if (IS_MAIN_THREAD)
624 return (&xmlKeepBlanksDefaultValue);
625 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000626 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000627}
628
Daniel Veillardb8478642001-10-12 17:29:10 +0000629#undef xmlLineNumbersDefaultValue
630int *
631__xmlLineNumbersDefaultValue(void) {
632 if (IS_MAIN_THREAD)
633 return (&xmlLineNumbersDefaultValue);
634 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000635 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000636}
637
Daniel Veillardb8478642001-10-12 17:29:10 +0000638#undef xmlLoadExtDtdDefaultValue
639int *
640__xmlLoadExtDtdDefaultValue(void) {
641 if (IS_MAIN_THREAD)
642 return (&xmlLoadExtDtdDefaultValue);
643 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000644 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000645}
646
Daniel Veillardb8478642001-10-12 17:29:10 +0000647#undef xmlParserDebugEntities
648int *
649__xmlParserDebugEntities(void) {
650 if (IS_MAIN_THREAD)
651 return (&xmlParserDebugEntities);
652 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000653 return (&xmlGetGlobalState()->xmlParserDebugEntities);
Daniel Veillardb8478642001-10-12 17:29:10 +0000654}
655
Daniel Veillardb8478642001-10-12 17:29:10 +0000656#undef xmlParserVersion
657const char * *
658__xmlParserVersion(void) {
659 if (IS_MAIN_THREAD)
660 return (&xmlParserVersion);
661 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000662 return (&xmlGetGlobalState()->xmlParserVersion);
Daniel Veillardb8478642001-10-12 17:29:10 +0000663}
664
Daniel Veillardb8478642001-10-12 17:29:10 +0000665#undef xmlPedanticParserDefaultValue
666int *
667__xmlPedanticParserDefaultValue(void) {
668 if (IS_MAIN_THREAD)
669 return (&xmlPedanticParserDefaultValue);
670 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000671 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000672}
673
Daniel Veillardb8478642001-10-12 17:29:10 +0000674#undef xmlSaveNoEmptyTags
675int *
676__xmlSaveNoEmptyTags(void) {
677 if (IS_MAIN_THREAD)
678 return (&xmlSaveNoEmptyTags);
679 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000680 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags);
Daniel Veillardb8478642001-10-12 17:29:10 +0000681}
682
Daniel Veillardb8478642001-10-12 17:29:10 +0000683#undef xmlSubstituteEntitiesDefaultValue
684int *
685__xmlSubstituteEntitiesDefaultValue(void) {
686 if (IS_MAIN_THREAD)
687 return (&xmlSubstituteEntitiesDefaultValue);
688 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000689 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000690}
Daniel Veillard5335dc52003-01-01 20:59:38 +0000691
692#undef xmlRegisterNodeDefaultValue
693xmlRegisterNodeFunc *
694__xmlRegisterNodeDefaultValue(void) {
695 if (IS_MAIN_THREAD)
696 return (&xmlRegisterNodeDefaultValue);
697 else
698 return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue);
699}
700
701#undef xmlDeregisterNodeDefaultValue
702xmlDeregisterNodeFunc *
703__xmlDeregisterNodeDefaultValue(void) {
704 if (IS_MAIN_THREAD)
705 return (&xmlDeregisterNodeDefaultValue);
706 else
707 return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue);
708}