blob: ac99093a6763ecb4a8718732a46ab817f8b0aad7 [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 */
45#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
222/*
223 * Error handling
224 */
225
226/* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
227/* Must initialize xmlGenericError in xmlInitParser */
Daniel Veillard635ef722001-10-29 11:48:19 +0000228void xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
229 const char *msg,
230 ...);
Daniel Veillard9d06d302002-01-22 18:15:52 +0000231/**
232 * xmlGenericError:
233 *
234 * Global setting: function used for generic error callbacks
235 */
Daniel Veillard635ef722001-10-29 11:48:19 +0000236xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000237/**
238 * xmlGenericErrorContext:
239 *
240 * Global setting passed to generic error callbacks
241 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000242void *xmlGenericErrorContext = NULL;
243
244/*
245 * output defaults
246 */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000247/**
248 * xmlIndentTreeOutput:
249 *
250 * Global setting, asking the serializer to indent the output tree by default
Aleksey Sanin23002562002-05-24 07:18:40 +0000251 * Enabled by default
Daniel Veillard9d06d302002-01-22 18:15:52 +0000252 */
Aleksey Sanin23002562002-05-24 07:18:40 +0000253int xmlIndentTreeOutput = 1;
254
255/**
256 * xmlTreeIndentString:
257 *
258 * The string used to do one-level indent. By default is equal to " " (two spaces)
259 */
260const char *xmlTreeIndentString = " ";
261
Daniel Veillard9d06d302002-01-22 18:15:52 +0000262/**
263 * xmlSaveNoEmptyTags:
264 *
265 * Global setting, asking the serializer to not output empty tags
266 * as <empty/> but <empty></empty>. those two forms are undistinguishable
267 * once parsed.
268 * Disabled by default
269 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000270int xmlSaveNoEmptyTags = 0;
271
Daniel Veillard9d06d302002-01-22 18:15:52 +0000272/**
273 * xmlDefaultSAXHandler:
274 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000275 * Default handler for XML, builds the DOM tree
276 */
277xmlSAXHandler xmlDefaultSAXHandler = {
278 internalSubset,
279 isStandalone,
280 hasInternalSubset,
281 hasExternalSubset,
282 resolveEntity,
283 getEntity,
284 entityDecl,
285 notationDecl,
286 attributeDecl,
287 elementDecl,
288 unparsedEntityDecl,
289 setDocumentLocator,
290 startDocument,
291 endDocument,
292 startElement,
293 endElement,
294 reference,
295 characters,
296 characters,
297 processingInstruction,
298 comment,
299 xmlParserWarning,
300 xmlParserError,
301 xmlParserError,
302 getParameterEntity,
303 cdataBlock,
304 externalSubset,
305 0
306};
307
Daniel Veillard9d06d302002-01-22 18:15:52 +0000308/**
309 * xmlDefaultSAXLocator:
310 *
311 * The default SAX Locator
312 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
Daniel Veillardb8478642001-10-12 17:29:10 +0000313 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000314xmlSAXLocator xmlDefaultSAXLocator = {
315 getPublicId, getSystemId, getLineNumber, getColumnNumber
316};
317
318#ifdef LIBXML_HTML_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000319/**
320 * htmlDefaultSAXHandler:
321 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000322 * Default handler for HTML, builds the DOM tree
323 */
324xmlSAXHandler htmlDefaultSAXHandler = {
325 internalSubset,
326 NULL,
327 NULL,
328 NULL,
329 NULL,
330 getEntity,
331 NULL,
332 NULL,
333 NULL,
334 NULL,
335 NULL,
336 setDocumentLocator,
337 startDocument,
338 endDocument,
339 startElement,
340 endElement,
341 NULL,
342 characters,
343 ignorableWhitespace,
344 NULL,
345 comment,
346 xmlParserWarning,
347 xmlParserError,
348 xmlParserError,
349 getParameterEntity,
350 cdataBlock,
351 NULL,
352 0
353};
354#endif /* LIBXML_HTML_ENABLED */
355
356#ifdef LIBXML_DOCB_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000357/**
358 * docbDefaultSAXHandler:
359 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000360 * Default handler for SGML DocBook, builds the DOM tree
361 */
362xmlSAXHandler docbDefaultSAXHandler = {
363 internalSubset,
364 isStandalone,
365 hasInternalSubset,
366 hasExternalSubset,
367 resolveEntity,
368 getEntity,
369 entityDecl,
370 NULL,
371 NULL,
372 NULL,
373 NULL,
374 setDocumentLocator,
375 startDocument,
376 endDocument,
377 startElement,
378 endElement,
379 reference,
380 characters,
381 ignorableWhitespace,
382 NULL,
383 comment,
384 xmlParserWarning,
385 xmlParserError,
386 xmlParserError,
387 getParameterEntity,
388 NULL,
389 NULL,
390 0
391};
392#endif /* LIBXML_DOCB_ENABLED */
393
394/**
395 * xmlInitializeGlobalState:
396 * @gs: a pointer to a newly allocated global state
397 *
398 * xmlInitializeGlobalState() initialize a global state with all the
399 * default values of the library.
400 */
401void
402xmlInitializeGlobalState(xmlGlobalStatePtr gs)
403{
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000404#ifdef DEBUG_GLOBALS
405 fprintf(stderr, "Initializing globals at %lu for thread %d\n",
406 (unsigned long) gs, xmlGetThreadId());
407#endif
408
Daniel Veillardb8478642001-10-12 17:29:10 +0000409 /*
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000410 * Perform initialization as required by libxml
Daniel Veillardb8478642001-10-12 17:29:10 +0000411 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000412 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000413#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000414 initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000415#endif
416#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000417 inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000418#endif
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000419 initGenericErrorDefaultFunc(&gs->xmlGenericError);
420
Daniel Veillardb8478642001-10-12 17:29:10 +0000421 gs->oldXMLWDcompatibility = 0;
422 gs->xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
423 gs->xmlDefaultBufferSize = BASE_BUFFER_SIZE;
424 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
425 gs->xmlDefaultSAXLocator.getPublicId = getPublicId;
426 gs->xmlDefaultSAXLocator.getSystemId = getSystemId;
427 gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber;
428 gs->xmlDefaultSAXLocator.getColumnNumber = getColumnNumber;
429 gs->xmlDoValidityCheckingDefaultValue = 0;
430#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
431 gs->xmlFree = (xmlFreeFunc) xmlMemFree;
432 gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
433 gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
434 gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
435#else
436 gs->xmlFree = (xmlFreeFunc) free;
437 gs->xmlMalloc = (xmlMallocFunc) malloc;
438 gs->xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard572577e2002-01-18 16:23:55 +0000439 gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +0000440#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000441 gs->xmlGenericErrorContext = NULL;
442 gs->xmlGetWarningsDefaultValue = 1;
Aleksey Sanin23002562002-05-24 07:18:40 +0000443 gs->xmlIndentTreeOutput = 1;
444 gs->xmlTreeIndentString = " ";
Daniel Veillardb8478642001-10-12 17:29:10 +0000445 gs->xmlKeepBlanksDefaultValue = 1;
446 gs->xmlLineNumbersDefaultValue = 0;
447 gs->xmlLoadExtDtdDefaultValue = 0;
448 gs->xmlParserDebugEntities = 0;
449 gs->xmlParserVersion = LIBXML_VERSION_STRING;
450 gs->xmlPedanticParserDefaultValue = 0;
451 gs->xmlSaveNoEmptyTags = 0;
452 gs->xmlSubstituteEntitiesDefaultValue = 0;
453}
454
Daniel Veillarda4617b82001-11-04 20:19:12 +0000455#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000456#undef docbDefaultSAXHandler
457xmlSAXHandler *
458__docbDefaultSAXHandler(void) {
459 if (IS_MAIN_THREAD)
460 return (&docbDefaultSAXHandler);
461 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000462 return (&xmlGetGlobalState()->docbDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000463}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000464#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000465
Daniel Veillarda4617b82001-11-04 20:19:12 +0000466#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000467#undef htmlDefaultSAXHandler
468xmlSAXHandler *
469__htmlDefaultSAXHandler(void) {
470 if (IS_MAIN_THREAD)
471 return (&htmlDefaultSAXHandler);
472 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000473 return (&xmlGetGlobalState()->htmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000474}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000475#endif
476
477/*
478 * Everything starting from the line below is
479 * Automatically generated by build_glob.py.
480 * Do not modify the previous line.
481 */
482
Daniel Veillardb8478642001-10-12 17:29:10 +0000483
Daniel Veillardb8478642001-10-12 17:29:10 +0000484#undef oldXMLWDcompatibility
485int *
486__oldXMLWDcompatibility(void) {
487 if (IS_MAIN_THREAD)
488 return (&oldXMLWDcompatibility);
489 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000490 return (&xmlGetGlobalState()->oldXMLWDcompatibility);
Daniel Veillardb8478642001-10-12 17:29:10 +0000491}
492
Daniel Veillardb8478642001-10-12 17:29:10 +0000493#undef xmlBufferAllocScheme
494xmlBufferAllocationScheme *
495__xmlBufferAllocScheme(void) {
496 if (IS_MAIN_THREAD)
497 return (&xmlBufferAllocScheme);
498 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000499 return (&xmlGetGlobalState()->xmlBufferAllocScheme);
Daniel Veillardb8478642001-10-12 17:29:10 +0000500}
501
Daniel Veillardb8478642001-10-12 17:29:10 +0000502#undef xmlDefaultBufferSize
503int *
504__xmlDefaultBufferSize(void) {
505 if (IS_MAIN_THREAD)
506 return (&xmlDefaultBufferSize);
507 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000508 return (&xmlGetGlobalState()->xmlDefaultBufferSize);
Daniel Veillardb8478642001-10-12 17:29:10 +0000509}
510
Daniel Veillardb8478642001-10-12 17:29:10 +0000511#undef xmlDefaultSAXHandler
512xmlSAXHandler *
513__xmlDefaultSAXHandler(void) {
514 if (IS_MAIN_THREAD)
515 return (&xmlDefaultSAXHandler);
516 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000517 return (&xmlGetGlobalState()->xmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000518}
519
Daniel Veillardb8478642001-10-12 17:29:10 +0000520#undef xmlDefaultSAXLocator
521xmlSAXLocator *
522__xmlDefaultSAXLocator(void) {
523 if (IS_MAIN_THREAD)
524 return (&xmlDefaultSAXLocator);
525 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000526 return (&xmlGetGlobalState()->xmlDefaultSAXLocator);
Daniel Veillardb8478642001-10-12 17:29:10 +0000527}
528
Daniel Veillardb8478642001-10-12 17:29:10 +0000529#undef xmlDoValidityCheckingDefaultValue
530int *
531__xmlDoValidityCheckingDefaultValue(void) {
532 if (IS_MAIN_THREAD)
533 return (&xmlDoValidityCheckingDefaultValue);
534 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000535 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000536}
537
Daniel Veillardb8478642001-10-12 17:29:10 +0000538#undef xmlGenericError
539xmlGenericErrorFunc *
540__xmlGenericError(void) {
541 if (IS_MAIN_THREAD)
542 return (&xmlGenericError);
543 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000544 return (&xmlGetGlobalState()->xmlGenericError);
Daniel Veillardb8478642001-10-12 17:29:10 +0000545}
546
Daniel Veillardb8478642001-10-12 17:29:10 +0000547#undef xmlGenericErrorContext
548void * *
549__xmlGenericErrorContext(void) {
550 if (IS_MAIN_THREAD)
551 return (&xmlGenericErrorContext);
552 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000553 return (&xmlGetGlobalState()->xmlGenericErrorContext);
Daniel Veillardb8478642001-10-12 17:29:10 +0000554}
555
Daniel Veillardb8478642001-10-12 17:29:10 +0000556#undef xmlGetWarningsDefaultValue
557int *
558__xmlGetWarningsDefaultValue(void) {
559 if (IS_MAIN_THREAD)
560 return (&xmlGetWarningsDefaultValue);
561 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000562 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000563}
564
Daniel Veillardb8478642001-10-12 17:29:10 +0000565#undef xmlIndentTreeOutput
566int *
567__xmlIndentTreeOutput(void) {
568 if (IS_MAIN_THREAD)
569 return (&xmlIndentTreeOutput);
570 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000571 return (&xmlGetGlobalState()->xmlIndentTreeOutput);
Daniel Veillardb8478642001-10-12 17:29:10 +0000572}
573
Aleksey Sanin23002562002-05-24 07:18:40 +0000574#undef xmlTreeIndentString
575const char * *
576__xmlTreeIndentString(void) {
577 if (IS_MAIN_THREAD)
578 return (&xmlTreeIndentString);
579 else
580 return (&xmlGetGlobalState()->xmlTreeIndentString);
581}
582
Daniel Veillardb8478642001-10-12 17:29:10 +0000583#undef xmlKeepBlanksDefaultValue
584int *
585__xmlKeepBlanksDefaultValue(void) {
586 if (IS_MAIN_THREAD)
587 return (&xmlKeepBlanksDefaultValue);
588 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000589 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000590}
591
Daniel Veillardb8478642001-10-12 17:29:10 +0000592#undef xmlLineNumbersDefaultValue
593int *
594__xmlLineNumbersDefaultValue(void) {
595 if (IS_MAIN_THREAD)
596 return (&xmlLineNumbersDefaultValue);
597 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000598 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000599}
600
Daniel Veillardb8478642001-10-12 17:29:10 +0000601#undef xmlLoadExtDtdDefaultValue
602int *
603__xmlLoadExtDtdDefaultValue(void) {
604 if (IS_MAIN_THREAD)
605 return (&xmlLoadExtDtdDefaultValue);
606 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000607 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000608}
609
Daniel Veillardb8478642001-10-12 17:29:10 +0000610#undef xmlParserDebugEntities
611int *
612__xmlParserDebugEntities(void) {
613 if (IS_MAIN_THREAD)
614 return (&xmlParserDebugEntities);
615 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000616 return (&xmlGetGlobalState()->xmlParserDebugEntities);
Daniel Veillardb8478642001-10-12 17:29:10 +0000617}
618
Daniel Veillardb8478642001-10-12 17:29:10 +0000619#undef xmlParserVersion
620const char * *
621__xmlParserVersion(void) {
622 if (IS_MAIN_THREAD)
623 return (&xmlParserVersion);
624 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000625 return (&xmlGetGlobalState()->xmlParserVersion);
Daniel Veillardb8478642001-10-12 17:29:10 +0000626}
627
Daniel Veillardb8478642001-10-12 17:29:10 +0000628#undef xmlPedanticParserDefaultValue
629int *
630__xmlPedanticParserDefaultValue(void) {
631 if (IS_MAIN_THREAD)
632 return (&xmlPedanticParserDefaultValue);
633 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000634 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000635}
636
Daniel Veillardb8478642001-10-12 17:29:10 +0000637#undef xmlSaveNoEmptyTags
638int *
639__xmlSaveNoEmptyTags(void) {
640 if (IS_MAIN_THREAD)
641 return (&xmlSaveNoEmptyTags);
642 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000643 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags);
Daniel Veillardb8478642001-10-12 17:29:10 +0000644}
645
Daniel Veillardb8478642001-10-12 17:29:10 +0000646#undef xmlSubstituteEntitiesDefaultValue
647int *
648__xmlSubstituteEntitiesDefaultValue(void) {
649 if (IS_MAIN_THREAD)
650 return (&xmlSubstituteEntitiesDefaultValue);
651 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000652 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000653}