blob: cce70fbf900db66b94e478b86b76363c60c7b1cc [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
109#undef xmlKeepBlanksDefaultValue
110#undef xmlLineNumbersDefaultValue
111#undef xmlLoadExtDtdDefaultValue
112#undef xmlParserDebugEntities
113#undef xmlParserVersion
114#undef xmlPedanticParserDefaultValue
115#undef xmlSaveNoEmptyTags
116#undef xmlSubstituteEntitiesDefaultValue
117
118#undef xmlFree
119#undef xmlMalloc
120#undef xmlMemStrdup
121#undef xmlRealloc
122
Daniel Veillard9d06d302002-01-22 18:15:52 +0000123/**
124 * xmlParserVersion:
125 *
126 * Constant string describing the internal version of the library
127 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000128const char *xmlParserVersion = LIBXML_VERSION_STRING;
129
Daniel Veillard9d06d302002-01-22 18:15:52 +0000130/**
131 * xmlBufferAllocScheme:
132 *
133 * Global setting, default allocation policy for buffers, default is
134 * XML_BUFFER_ALLOC_EXACT
Daniel Veillardb8478642001-10-12 17:29:10 +0000135 */
136xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000137/**
138 * xmlDefaultBufferSize:
139 *
140 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
141 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000142int xmlDefaultBufferSize = BASE_BUFFER_SIZE;
143
144/*
145 * Parser defaults
146 */
Daniel Veillardd0463562001-10-13 09:15:48 +0000147
Daniel Veillard9d06d302002-01-22 18:15:52 +0000148/**
149 * oldXMLWDcompatibility:
150 *
151 * Global setting, DEPRECATED.
152 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000153int oldXMLWDcompatibility = 0; /* DEPRECATED */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000154/**
155 * xmlParserDebugEntities:
156 *
157 * Global setting, asking the parser to print out debugging informations.
158 * while handling entities.
159 * Disabled by default
160 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000161int xmlParserDebugEntities = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000162/**
163 * xmlDoValidityCheckingDefaultValue:
164 *
165 * Global setting, indicate that the parser should work in validating mode.
166 * Disabled by default.
167 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000168int xmlDoValidityCheckingDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000169/**
170 * xmlGetWarningsDefaultValue:
171 *
172 * Global setting, indicate that the parser should provide warnings.
173 * Activated by default.
174 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000175int xmlGetWarningsDefaultValue = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000176/**
177 * xmlLoadExtDtdDefaultValue:
178 *
179 * Global setting, indicate that the parser should load DTD while not
180 * validating.
181 * Disabled by default.
182 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000183int xmlLoadExtDtdDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000184/**
185 * xmlPedanticParserDefaultValue:
186 *
187 * Global setting, indicate that the parser be pedantic
188 * Disabled by default.
189 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000190int xmlPedanticParserDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000191/**
192 * xmlLineNumbersDefaultValue:
193 *
194 * Global setting, indicate that the parser should store the line number
195 * in the content field of elements in the DOM tree.
196 * Disabled by default since this may not be safe for old classes of
197 * applicaton.
198 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000199int xmlLineNumbersDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000200/**
201 * xmlKeepBlanksDefaultValue:
202 *
203 * Global setting, indicate that the parser should keep all blanks
204 * nodes found in the content
205 * Activated by default, this is actually needed to have the parser
206 * conformant to the XML Recommendation, however the option is kept
207 * for some applications since this was libxml1 default behaviour.
208 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000209int xmlKeepBlanksDefaultValue = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000210/**
211 * xmlSubstituteEntitiesDefaultValue:
212 *
213 * Global setting, indicate that the parser should not generate entity
214 * references but replace them with the actual content of the entity
215 * Disabled by default, this should be activated when using XPath since
216 * the XPath data model requires entities replacement and the XPath
217 * engine does not handle entities references transparently.
218 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000219int xmlSubstituteEntitiesDefaultValue = 0;
220
221/*
222 * Error handling
223 */
224
225/* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
226/* Must initialize xmlGenericError in xmlInitParser */
Daniel Veillard635ef722001-10-29 11:48:19 +0000227void xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
228 const char *msg,
229 ...);
Daniel Veillard9d06d302002-01-22 18:15:52 +0000230/**
231 * xmlGenericError:
232 *
233 * Global setting: function used for generic error callbacks
234 */
Daniel Veillard635ef722001-10-29 11:48:19 +0000235xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000236/**
237 * xmlGenericErrorContext:
238 *
239 * Global setting passed to generic error callbacks
240 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000241void *xmlGenericErrorContext = NULL;
242
243/*
244 * output defaults
245 */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000246/**
247 * xmlIndentTreeOutput:
248 *
249 * Global setting, asking the serializer to indent the output tree by default
250 * Disabled by default
251 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000252int xmlIndentTreeOutput = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000253/**
254 * xmlSaveNoEmptyTags:
255 *
256 * Global setting, asking the serializer to not output empty tags
257 * as <empty/> but <empty></empty>. those two forms are undistinguishable
258 * once parsed.
259 * Disabled by default
260 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000261int xmlSaveNoEmptyTags = 0;
262
Daniel Veillard9d06d302002-01-22 18:15:52 +0000263/**
264 * xmlDefaultSAXHandler:
265 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000266 * Default handler for XML, builds the DOM tree
267 */
268xmlSAXHandler xmlDefaultSAXHandler = {
269 internalSubset,
270 isStandalone,
271 hasInternalSubset,
272 hasExternalSubset,
273 resolveEntity,
274 getEntity,
275 entityDecl,
276 notationDecl,
277 attributeDecl,
278 elementDecl,
279 unparsedEntityDecl,
280 setDocumentLocator,
281 startDocument,
282 endDocument,
283 startElement,
284 endElement,
285 reference,
286 characters,
287 characters,
288 processingInstruction,
289 comment,
290 xmlParserWarning,
291 xmlParserError,
292 xmlParserError,
293 getParameterEntity,
294 cdataBlock,
295 externalSubset,
296 0
297};
298
Daniel Veillard9d06d302002-01-22 18:15:52 +0000299/**
300 * xmlDefaultSAXLocator:
301 *
302 * The default SAX Locator
303 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
Daniel Veillardb8478642001-10-12 17:29:10 +0000304 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000305xmlSAXLocator xmlDefaultSAXLocator = {
306 getPublicId, getSystemId, getLineNumber, getColumnNumber
307};
308
309#ifdef LIBXML_HTML_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000310/**
311 * htmlDefaultSAXHandler:
312 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000313 * Default handler for HTML, builds the DOM tree
314 */
315xmlSAXHandler htmlDefaultSAXHandler = {
316 internalSubset,
317 NULL,
318 NULL,
319 NULL,
320 NULL,
321 getEntity,
322 NULL,
323 NULL,
324 NULL,
325 NULL,
326 NULL,
327 setDocumentLocator,
328 startDocument,
329 endDocument,
330 startElement,
331 endElement,
332 NULL,
333 characters,
334 ignorableWhitespace,
335 NULL,
336 comment,
337 xmlParserWarning,
338 xmlParserError,
339 xmlParserError,
340 getParameterEntity,
341 cdataBlock,
342 NULL,
343 0
344};
345#endif /* LIBXML_HTML_ENABLED */
346
347#ifdef LIBXML_DOCB_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000348/**
349 * docbDefaultSAXHandler:
350 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000351 * Default handler for SGML DocBook, builds the DOM tree
352 */
353xmlSAXHandler docbDefaultSAXHandler = {
354 internalSubset,
355 isStandalone,
356 hasInternalSubset,
357 hasExternalSubset,
358 resolveEntity,
359 getEntity,
360 entityDecl,
361 NULL,
362 NULL,
363 NULL,
364 NULL,
365 setDocumentLocator,
366 startDocument,
367 endDocument,
368 startElement,
369 endElement,
370 reference,
371 characters,
372 ignorableWhitespace,
373 NULL,
374 comment,
375 xmlParserWarning,
376 xmlParserError,
377 xmlParserError,
378 getParameterEntity,
379 NULL,
380 NULL,
381 0
382};
383#endif /* LIBXML_DOCB_ENABLED */
384
385/**
386 * xmlInitializeGlobalState:
387 * @gs: a pointer to a newly allocated global state
388 *
389 * xmlInitializeGlobalState() initialize a global state with all the
390 * default values of the library.
391 */
392void
393xmlInitializeGlobalState(xmlGlobalStatePtr gs)
394{
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000395#ifdef DEBUG_GLOBALS
396 fprintf(stderr, "Initializing globals at %lu for thread %d\n",
397 (unsigned long) gs, xmlGetThreadId());
398#endif
399
Daniel Veillardb8478642001-10-12 17:29:10 +0000400 /*
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000401 * Perform initialization as required by libxml
Daniel Veillardb8478642001-10-12 17:29:10 +0000402 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000403 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000404#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000405 initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000406#endif
407#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000408 inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000409#endif
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000410 initGenericErrorDefaultFunc(&gs->xmlGenericError);
411
Daniel Veillardb8478642001-10-12 17:29:10 +0000412 gs->oldXMLWDcompatibility = 0;
413 gs->xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
414 gs->xmlDefaultBufferSize = BASE_BUFFER_SIZE;
415 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
416 gs->xmlDefaultSAXLocator.getPublicId = getPublicId;
417 gs->xmlDefaultSAXLocator.getSystemId = getSystemId;
418 gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber;
419 gs->xmlDefaultSAXLocator.getColumnNumber = getColumnNumber;
420 gs->xmlDoValidityCheckingDefaultValue = 0;
421#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
422 gs->xmlFree = (xmlFreeFunc) xmlMemFree;
423 gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
424 gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
425 gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
426#else
427 gs->xmlFree = (xmlFreeFunc) free;
428 gs->xmlMalloc = (xmlMallocFunc) malloc;
429 gs->xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard572577e2002-01-18 16:23:55 +0000430 gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +0000431#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000432 gs->xmlGenericErrorContext = NULL;
433 gs->xmlGetWarningsDefaultValue = 1;
434 gs->xmlIndentTreeOutput = 0;
435 gs->xmlKeepBlanksDefaultValue = 1;
436 gs->xmlLineNumbersDefaultValue = 0;
437 gs->xmlLoadExtDtdDefaultValue = 0;
438 gs->xmlParserDebugEntities = 0;
439 gs->xmlParserVersion = LIBXML_VERSION_STRING;
440 gs->xmlPedanticParserDefaultValue = 0;
441 gs->xmlSaveNoEmptyTags = 0;
442 gs->xmlSubstituteEntitiesDefaultValue = 0;
443}
444
Daniel Veillarda4617b82001-11-04 20:19:12 +0000445#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000446#undef docbDefaultSAXHandler
447xmlSAXHandler *
448__docbDefaultSAXHandler(void) {
449 if (IS_MAIN_THREAD)
450 return (&docbDefaultSAXHandler);
451 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000452 return (&xmlGetGlobalState()->docbDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000453}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000454#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000455
Daniel Veillarda4617b82001-11-04 20:19:12 +0000456#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000457#undef htmlDefaultSAXHandler
458xmlSAXHandler *
459__htmlDefaultSAXHandler(void) {
460 if (IS_MAIN_THREAD)
461 return (&htmlDefaultSAXHandler);
462 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000463 return (&xmlGetGlobalState()->htmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000464}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000465#endif
466
467/*
468 * Everything starting from the line below is
469 * Automatically generated by build_glob.py.
470 * Do not modify the previous line.
471 */
472
Daniel Veillardb8478642001-10-12 17:29:10 +0000473
Daniel Veillardb8478642001-10-12 17:29:10 +0000474#undef oldXMLWDcompatibility
475int *
476__oldXMLWDcompatibility(void) {
477 if (IS_MAIN_THREAD)
478 return (&oldXMLWDcompatibility);
479 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000480 return (&xmlGetGlobalState()->oldXMLWDcompatibility);
Daniel Veillardb8478642001-10-12 17:29:10 +0000481}
482
Daniel Veillardb8478642001-10-12 17:29:10 +0000483#undef xmlBufferAllocScheme
484xmlBufferAllocationScheme *
485__xmlBufferAllocScheme(void) {
486 if (IS_MAIN_THREAD)
487 return (&xmlBufferAllocScheme);
488 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000489 return (&xmlGetGlobalState()->xmlBufferAllocScheme);
Daniel Veillardb8478642001-10-12 17:29:10 +0000490}
491
Daniel Veillardb8478642001-10-12 17:29:10 +0000492#undef xmlDefaultBufferSize
493int *
494__xmlDefaultBufferSize(void) {
495 if (IS_MAIN_THREAD)
496 return (&xmlDefaultBufferSize);
497 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000498 return (&xmlGetGlobalState()->xmlDefaultBufferSize);
Daniel Veillardb8478642001-10-12 17:29:10 +0000499}
500
Daniel Veillardb8478642001-10-12 17:29:10 +0000501#undef xmlDefaultSAXHandler
502xmlSAXHandler *
503__xmlDefaultSAXHandler(void) {
504 if (IS_MAIN_THREAD)
505 return (&xmlDefaultSAXHandler);
506 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000507 return (&xmlGetGlobalState()->xmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000508}
509
Daniel Veillardb8478642001-10-12 17:29:10 +0000510#undef xmlDefaultSAXLocator
511xmlSAXLocator *
512__xmlDefaultSAXLocator(void) {
513 if (IS_MAIN_THREAD)
514 return (&xmlDefaultSAXLocator);
515 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000516 return (&xmlGetGlobalState()->xmlDefaultSAXLocator);
Daniel Veillardb8478642001-10-12 17:29:10 +0000517}
518
Daniel Veillardb8478642001-10-12 17:29:10 +0000519#undef xmlDoValidityCheckingDefaultValue
520int *
521__xmlDoValidityCheckingDefaultValue(void) {
522 if (IS_MAIN_THREAD)
523 return (&xmlDoValidityCheckingDefaultValue);
524 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000525 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000526}
527
Daniel Veillardb8478642001-10-12 17:29:10 +0000528#undef xmlGenericError
529xmlGenericErrorFunc *
530__xmlGenericError(void) {
531 if (IS_MAIN_THREAD)
532 return (&xmlGenericError);
533 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000534 return (&xmlGetGlobalState()->xmlGenericError);
Daniel Veillardb8478642001-10-12 17:29:10 +0000535}
536
Daniel Veillardb8478642001-10-12 17:29:10 +0000537#undef xmlGenericErrorContext
538void * *
539__xmlGenericErrorContext(void) {
540 if (IS_MAIN_THREAD)
541 return (&xmlGenericErrorContext);
542 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000543 return (&xmlGetGlobalState()->xmlGenericErrorContext);
Daniel Veillardb8478642001-10-12 17:29:10 +0000544}
545
Daniel Veillardb8478642001-10-12 17:29:10 +0000546#undef xmlGetWarningsDefaultValue
547int *
548__xmlGetWarningsDefaultValue(void) {
549 if (IS_MAIN_THREAD)
550 return (&xmlGetWarningsDefaultValue);
551 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000552 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000553}
554
Daniel Veillardb8478642001-10-12 17:29:10 +0000555#undef xmlIndentTreeOutput
556int *
557__xmlIndentTreeOutput(void) {
558 if (IS_MAIN_THREAD)
559 return (&xmlIndentTreeOutput);
560 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000561 return (&xmlGetGlobalState()->xmlIndentTreeOutput);
Daniel Veillardb8478642001-10-12 17:29:10 +0000562}
563
Daniel Veillardb8478642001-10-12 17:29:10 +0000564#undef xmlKeepBlanksDefaultValue
565int *
566__xmlKeepBlanksDefaultValue(void) {
567 if (IS_MAIN_THREAD)
568 return (&xmlKeepBlanksDefaultValue);
569 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000570 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000571}
572
Daniel Veillardb8478642001-10-12 17:29:10 +0000573#undef xmlLineNumbersDefaultValue
574int *
575__xmlLineNumbersDefaultValue(void) {
576 if (IS_MAIN_THREAD)
577 return (&xmlLineNumbersDefaultValue);
578 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000579 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000580}
581
Daniel Veillardb8478642001-10-12 17:29:10 +0000582#undef xmlLoadExtDtdDefaultValue
583int *
584__xmlLoadExtDtdDefaultValue(void) {
585 if (IS_MAIN_THREAD)
586 return (&xmlLoadExtDtdDefaultValue);
587 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000588 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000589}
590
Daniel Veillardb8478642001-10-12 17:29:10 +0000591#undef xmlParserDebugEntities
592int *
593__xmlParserDebugEntities(void) {
594 if (IS_MAIN_THREAD)
595 return (&xmlParserDebugEntities);
596 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000597 return (&xmlGetGlobalState()->xmlParserDebugEntities);
Daniel Veillardb8478642001-10-12 17:29:10 +0000598}
599
Daniel Veillardb8478642001-10-12 17:29:10 +0000600#undef xmlParserVersion
601const char * *
602__xmlParserVersion(void) {
603 if (IS_MAIN_THREAD)
604 return (&xmlParserVersion);
605 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000606 return (&xmlGetGlobalState()->xmlParserVersion);
Daniel Veillardb8478642001-10-12 17:29:10 +0000607}
608
Daniel Veillardb8478642001-10-12 17:29:10 +0000609#undef xmlPedanticParserDefaultValue
610int *
611__xmlPedanticParserDefaultValue(void) {
612 if (IS_MAIN_THREAD)
613 return (&xmlPedanticParserDefaultValue);
614 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000615 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000616}
617
Daniel Veillardb8478642001-10-12 17:29:10 +0000618#undef xmlSaveNoEmptyTags
619int *
620__xmlSaveNoEmptyTags(void) {
621 if (IS_MAIN_THREAD)
622 return (&xmlSaveNoEmptyTags);
623 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000624 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags);
Daniel Veillardb8478642001-10-12 17:29:10 +0000625}
626
Daniel Veillardb8478642001-10-12 17:29:10 +0000627#undef xmlSubstituteEntitiesDefaultValue
628int *
629__xmlSubstituteEntitiesDefaultValue(void) {
630 if (IS_MAIN_THREAD)
631 return (&xmlSubstituteEntitiesDefaultValue);
632 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000633 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000634}