blob: ff0e3b76be1a760c864a61757d5d7dc39ef8750a [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
14#include "libxml.h"
15
Daniel Veillarde7090612001-10-13 12:18:28 +000016#ifdef HAVE_STDLIB_H
Jaka Mocnik77d19ae2001-10-13 12:06:09 +000017#include <stdlib.h>
Daniel Veillarde7090612001-10-13 12:18:28 +000018#endif
Jaka Mocnik77d19ae2001-10-13 12:06:09 +000019#include <string.h>
20
Daniel Veillard3c01b1d2001-10-17 15:58:35 +000021#include <libxml/globals.h>
Daniel Veillarde7090612001-10-13 12:18:28 +000022#include <libxml/xmlmemory.h>
23
Daniel Veillard3c01b1d2001-10-17 15:58:35 +000024/* #define DEBUG_GLOBALS */
25
Daniel Veillardb8478642001-10-12 17:29:10 +000026/*
27 * Helpful Macro
28 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +000029#ifdef LIBXML_THREAD_ENABLED
30#define IS_MAIN_THREAD (xmlIsMainThread())
Daniel Veillardb8478642001-10-12 17:29:10 +000031#else
32#define IS_MAIN_THREAD 1
33#endif
34
35/************************************************************************
36 * *
37 * All the user accessible global variables of the library *
38 * *
39 ************************************************************************/
40
Daniel Veillardb8478642001-10-12 17:29:10 +000041/*
42 * Memory allocation routines
43 */
44#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
Daniel Veillardd0463562001-10-13 09:15:48 +000045extern void xmlMemFree(void *ptr);
46extern void * xmlMemMalloc(size_t size);
47extern void * xmlMemRealloc(void *ptr,size_t size);
48extern char * xmlMemoryStrdup(const char *str);
49
Daniel Veillardb8478642001-10-12 17:29:10 +000050xmlFreeFunc xmlFree = (xmlFreeFunc) xmlMemFree;
51xmlMallocFunc xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
52xmlReallocFunc xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
53xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
54#else
Daniel Veillard9d06d302002-01-22 18:15:52 +000055/**
56 * xmlFree:
57 * @mem: an already allocated block of memory
58 *
59 * The variable holding the libxml free() implementation
60 */
Daniel Veillardb8478642001-10-12 17:29:10 +000061xmlFreeFunc xmlFree = (xmlFreeFunc) free;
Daniel Veillard9d06d302002-01-22 18:15:52 +000062/**
63 * xmlMalloc:
64 * @size: the size requested in bytes
65 *
66 * The variable holding the libxml malloc() implementation
67 *
68 * Returns a pointer to the newly allocated block or NULL in case of error
69 */
Daniel Veillardb8478642001-10-12 17:29:10 +000070xmlMallocFunc xmlMalloc = (xmlMallocFunc) malloc;
Daniel Veillard9d06d302002-01-22 18:15:52 +000071/**
72 * xmlRealloc:
73 * @mem: an already allocated block of memory
74 * @size: the new size requested in bytes
75 *
76 * The variable holding the libxml realloc() implementation
77 *
78 * Returns a pointer to the newly reallocated block or NULL in case of error
79 */
Daniel Veillardb8478642001-10-12 17:29:10 +000080xmlReallocFunc xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard9d06d302002-01-22 18:15:52 +000081/**
82 * xmlMemStrdup:
83 * @str: a zero terminated string
84 *
85 * The variable holding the libxml strdup() implementation
86 *
87 * Returns the copy of the string or NULL in case of error
88 */
Daniel Veillardb82c1662001-12-09 14:00:54 +000089xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +000090#endif
91
Daniel Veillardd0463562001-10-13 09:15:48 +000092#include <libxml/threads.h>
93#include <libxml/globals.h>
94#include <libxml/SAX.h>
95
96#undef docbDefaultSAXHandler
97#undef htmlDefaultSAXHandler
98#undef oldXMLWDcompatibility
99#undef xmlBufferAllocScheme
100#undef xmlDefaultBufferSize
101#undef xmlDefaultSAXHandler
102#undef xmlDefaultSAXLocator
103#undef xmlDoValidityCheckingDefaultValue
104#undef xmlGenericError
105#undef xmlGenericErrorContext
106#undef xmlGetWarningsDefaultValue
107#undef xmlIndentTreeOutput
108#undef xmlKeepBlanksDefaultValue
109#undef xmlLineNumbersDefaultValue
110#undef xmlLoadExtDtdDefaultValue
111#undef xmlParserDebugEntities
112#undef xmlParserVersion
113#undef xmlPedanticParserDefaultValue
114#undef xmlSaveNoEmptyTags
115#undef xmlSubstituteEntitiesDefaultValue
116
117#undef xmlFree
118#undef xmlMalloc
119#undef xmlMemStrdup
120#undef xmlRealloc
121
Daniel Veillard9d06d302002-01-22 18:15:52 +0000122/**
123 * xmlParserVersion:
124 *
125 * Constant string describing the internal version of the library
126 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000127const char *xmlParserVersion = LIBXML_VERSION_STRING;
128
Daniel Veillard9d06d302002-01-22 18:15:52 +0000129/**
130 * xmlBufferAllocScheme:
131 *
132 * Global setting, default allocation policy for buffers, default is
133 * XML_BUFFER_ALLOC_EXACT
Daniel Veillardb8478642001-10-12 17:29:10 +0000134 */
135xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000136/**
137 * xmlDefaultBufferSize:
138 *
139 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
140 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000141int xmlDefaultBufferSize = BASE_BUFFER_SIZE;
142
143/*
144 * Parser defaults
145 */
Daniel Veillardd0463562001-10-13 09:15:48 +0000146
Daniel Veillard9d06d302002-01-22 18:15:52 +0000147/**
148 * oldXMLWDcompatibility:
149 *
150 * Global setting, DEPRECATED.
151 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000152int oldXMLWDcompatibility = 0; /* DEPRECATED */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000153/**
154 * xmlParserDebugEntities:
155 *
156 * Global setting, asking the parser to print out debugging informations.
157 * while handling entities.
158 * Disabled by default
159 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000160int xmlParserDebugEntities = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000161/**
162 * xmlDoValidityCheckingDefaultValue:
163 *
164 * Global setting, indicate that the parser should work in validating mode.
165 * Disabled by default.
166 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000167int xmlDoValidityCheckingDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000168/**
169 * xmlGetWarningsDefaultValue:
170 *
171 * Global setting, indicate that the parser should provide warnings.
172 * Activated by default.
173 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000174int xmlGetWarningsDefaultValue = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000175/**
176 * xmlLoadExtDtdDefaultValue:
177 *
178 * Global setting, indicate that the parser should load DTD while not
179 * validating.
180 * Disabled by default.
181 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000182int xmlLoadExtDtdDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000183/**
184 * xmlPedanticParserDefaultValue:
185 *
186 * Global setting, indicate that the parser be pedantic
187 * Disabled by default.
188 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000189int xmlPedanticParserDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000190/**
191 * xmlLineNumbersDefaultValue:
192 *
193 * Global setting, indicate that the parser should store the line number
194 * in the content field of elements in the DOM tree.
195 * Disabled by default since this may not be safe for old classes of
196 * applicaton.
197 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000198int xmlLineNumbersDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000199/**
200 * xmlKeepBlanksDefaultValue:
201 *
202 * Global setting, indicate that the parser should keep all blanks
203 * nodes found in the content
204 * Activated by default, this is actually needed to have the parser
205 * conformant to the XML Recommendation, however the option is kept
206 * for some applications since this was libxml1 default behaviour.
207 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000208int xmlKeepBlanksDefaultValue = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000209/**
210 * xmlSubstituteEntitiesDefaultValue:
211 *
212 * Global setting, indicate that the parser should not generate entity
213 * references but replace them with the actual content of the entity
214 * Disabled by default, this should be activated when using XPath since
215 * the XPath data model requires entities replacement and the XPath
216 * engine does not handle entities references transparently.
217 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000218int xmlSubstituteEntitiesDefaultValue = 0;
219
220/*
221 * Error handling
222 */
223
224/* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
225/* Must initialize xmlGenericError in xmlInitParser */
Daniel Veillard635ef722001-10-29 11:48:19 +0000226void xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
227 const char *msg,
228 ...);
Daniel Veillard9d06d302002-01-22 18:15:52 +0000229/**
230 * xmlGenericError:
231 *
232 * Global setting: function used for generic error callbacks
233 */
Daniel Veillard635ef722001-10-29 11:48:19 +0000234xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000235/**
236 * xmlGenericErrorContext:
237 *
238 * Global setting passed to generic error callbacks
239 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000240void *xmlGenericErrorContext = NULL;
241
242/*
243 * output defaults
244 */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000245/**
246 * xmlIndentTreeOutput:
247 *
248 * Global setting, asking the serializer to indent the output tree by default
249 * Disabled by default
250 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000251int xmlIndentTreeOutput = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000252/**
253 * xmlSaveNoEmptyTags:
254 *
255 * Global setting, asking the serializer to not output empty tags
256 * as <empty/> but <empty></empty>. those two forms are undistinguishable
257 * once parsed.
258 * Disabled by default
259 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000260int xmlSaveNoEmptyTags = 0;
261
Daniel Veillard9d06d302002-01-22 18:15:52 +0000262/**
263 * xmlDefaultSAXHandler:
264 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000265 * Default handler for XML, builds the DOM tree
266 */
267xmlSAXHandler xmlDefaultSAXHandler = {
268 internalSubset,
269 isStandalone,
270 hasInternalSubset,
271 hasExternalSubset,
272 resolveEntity,
273 getEntity,
274 entityDecl,
275 notationDecl,
276 attributeDecl,
277 elementDecl,
278 unparsedEntityDecl,
279 setDocumentLocator,
280 startDocument,
281 endDocument,
282 startElement,
283 endElement,
284 reference,
285 characters,
286 characters,
287 processingInstruction,
288 comment,
289 xmlParserWarning,
290 xmlParserError,
291 xmlParserError,
292 getParameterEntity,
293 cdataBlock,
294 externalSubset,
295 0
296};
297
Daniel Veillard9d06d302002-01-22 18:15:52 +0000298/**
299 * xmlDefaultSAXLocator:
300 *
301 * The default SAX Locator
302 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
Daniel Veillardb8478642001-10-12 17:29:10 +0000303 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000304xmlSAXLocator xmlDefaultSAXLocator = {
305 getPublicId, getSystemId, getLineNumber, getColumnNumber
306};
307
308#ifdef LIBXML_HTML_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000309/**
310 * htmlDefaultSAXHandler:
311 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000312 * Default handler for HTML, builds the DOM tree
313 */
314xmlSAXHandler htmlDefaultSAXHandler = {
315 internalSubset,
316 NULL,
317 NULL,
318 NULL,
319 NULL,
320 getEntity,
321 NULL,
322 NULL,
323 NULL,
324 NULL,
325 NULL,
326 setDocumentLocator,
327 startDocument,
328 endDocument,
329 startElement,
330 endElement,
331 NULL,
332 characters,
333 ignorableWhitespace,
334 NULL,
335 comment,
336 xmlParserWarning,
337 xmlParserError,
338 xmlParserError,
339 getParameterEntity,
340 cdataBlock,
341 NULL,
342 0
343};
344#endif /* LIBXML_HTML_ENABLED */
345
346#ifdef LIBXML_DOCB_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000347/**
348 * docbDefaultSAXHandler:
349 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000350 * Default handler for SGML DocBook, builds the DOM tree
351 */
352xmlSAXHandler docbDefaultSAXHandler = {
353 internalSubset,
354 isStandalone,
355 hasInternalSubset,
356 hasExternalSubset,
357 resolveEntity,
358 getEntity,
359 entityDecl,
360 NULL,
361 NULL,
362 NULL,
363 NULL,
364 setDocumentLocator,
365 startDocument,
366 endDocument,
367 startElement,
368 endElement,
369 reference,
370 characters,
371 ignorableWhitespace,
372 NULL,
373 comment,
374 xmlParserWarning,
375 xmlParserError,
376 xmlParserError,
377 getParameterEntity,
378 NULL,
379 NULL,
380 0
381};
382#endif /* LIBXML_DOCB_ENABLED */
383
384/**
385 * xmlInitializeGlobalState:
386 * @gs: a pointer to a newly allocated global state
387 *
388 * xmlInitializeGlobalState() initialize a global state with all the
389 * default values of the library.
390 */
391void
392xmlInitializeGlobalState(xmlGlobalStatePtr gs)
393{
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000394#ifdef DEBUG_GLOBALS
395 fprintf(stderr, "Initializing globals at %lu for thread %d\n",
396 (unsigned long) gs, xmlGetThreadId());
397#endif
398
Daniel Veillardb8478642001-10-12 17:29:10 +0000399 /*
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000400 * Perform initialization as required by libxml
Daniel Veillardb8478642001-10-12 17:29:10 +0000401 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000402 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000403#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000404 initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000405#endif
406#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000407 inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000408#endif
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000409 initGenericErrorDefaultFunc(&gs->xmlGenericError);
410
Daniel Veillardb8478642001-10-12 17:29:10 +0000411 gs->oldXMLWDcompatibility = 0;
412 gs->xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
413 gs->xmlDefaultBufferSize = BASE_BUFFER_SIZE;
414 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
415 gs->xmlDefaultSAXLocator.getPublicId = getPublicId;
416 gs->xmlDefaultSAXLocator.getSystemId = getSystemId;
417 gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber;
418 gs->xmlDefaultSAXLocator.getColumnNumber = getColumnNumber;
419 gs->xmlDoValidityCheckingDefaultValue = 0;
420#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
421 gs->xmlFree = (xmlFreeFunc) xmlMemFree;
422 gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
423 gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
424 gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
425#else
426 gs->xmlFree = (xmlFreeFunc) free;
427 gs->xmlMalloc = (xmlMallocFunc) malloc;
428 gs->xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard572577e2002-01-18 16:23:55 +0000429 gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +0000430#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000431 gs->xmlGenericErrorContext = NULL;
432 gs->xmlGetWarningsDefaultValue = 1;
433 gs->xmlIndentTreeOutput = 0;
434 gs->xmlKeepBlanksDefaultValue = 1;
435 gs->xmlLineNumbersDefaultValue = 0;
436 gs->xmlLoadExtDtdDefaultValue = 0;
437 gs->xmlParserDebugEntities = 0;
438 gs->xmlParserVersion = LIBXML_VERSION_STRING;
439 gs->xmlPedanticParserDefaultValue = 0;
440 gs->xmlSaveNoEmptyTags = 0;
441 gs->xmlSubstituteEntitiesDefaultValue = 0;
442}
443
Daniel Veillarda4617b82001-11-04 20:19:12 +0000444#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000445#undef docbDefaultSAXHandler
446xmlSAXHandler *
447__docbDefaultSAXHandler(void) {
448 if (IS_MAIN_THREAD)
449 return (&docbDefaultSAXHandler);
450 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000451 return (&xmlGetGlobalState()->docbDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000452}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000453#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000454
Daniel Veillarda4617b82001-11-04 20:19:12 +0000455#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000456#undef htmlDefaultSAXHandler
457xmlSAXHandler *
458__htmlDefaultSAXHandler(void) {
459 if (IS_MAIN_THREAD)
460 return (&htmlDefaultSAXHandler);
461 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000462 return (&xmlGetGlobalState()->htmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000463}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000464#endif
465
466/*
467 * Everything starting from the line below is
468 * Automatically generated by build_glob.py.
469 * Do not modify the previous line.
470 */
471
Daniel Veillardb8478642001-10-12 17:29:10 +0000472
Daniel Veillardb8478642001-10-12 17:29:10 +0000473#undef oldXMLWDcompatibility
474int *
475__oldXMLWDcompatibility(void) {
476 if (IS_MAIN_THREAD)
477 return (&oldXMLWDcompatibility);
478 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000479 return (&xmlGetGlobalState()->oldXMLWDcompatibility);
Daniel Veillardb8478642001-10-12 17:29:10 +0000480}
481
Daniel Veillardb8478642001-10-12 17:29:10 +0000482#undef xmlBufferAllocScheme
483xmlBufferAllocationScheme *
484__xmlBufferAllocScheme(void) {
485 if (IS_MAIN_THREAD)
486 return (&xmlBufferAllocScheme);
487 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000488 return (&xmlGetGlobalState()->xmlBufferAllocScheme);
Daniel Veillardb8478642001-10-12 17:29:10 +0000489}
490
Daniel Veillardb8478642001-10-12 17:29:10 +0000491#undef xmlDefaultBufferSize
492int *
493__xmlDefaultBufferSize(void) {
494 if (IS_MAIN_THREAD)
495 return (&xmlDefaultBufferSize);
496 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000497 return (&xmlGetGlobalState()->xmlDefaultBufferSize);
Daniel Veillardb8478642001-10-12 17:29:10 +0000498}
499
Daniel Veillardb8478642001-10-12 17:29:10 +0000500#undef xmlDefaultSAXHandler
501xmlSAXHandler *
502__xmlDefaultSAXHandler(void) {
503 if (IS_MAIN_THREAD)
504 return (&xmlDefaultSAXHandler);
505 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000506 return (&xmlGetGlobalState()->xmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000507}
508
Daniel Veillardb8478642001-10-12 17:29:10 +0000509#undef xmlDefaultSAXLocator
510xmlSAXLocator *
511__xmlDefaultSAXLocator(void) {
512 if (IS_MAIN_THREAD)
513 return (&xmlDefaultSAXLocator);
514 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000515 return (&xmlGetGlobalState()->xmlDefaultSAXLocator);
Daniel Veillardb8478642001-10-12 17:29:10 +0000516}
517
Daniel Veillardb8478642001-10-12 17:29:10 +0000518#undef xmlDoValidityCheckingDefaultValue
519int *
520__xmlDoValidityCheckingDefaultValue(void) {
521 if (IS_MAIN_THREAD)
522 return (&xmlDoValidityCheckingDefaultValue);
523 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000524 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000525}
526
Daniel Veillardb8478642001-10-12 17:29:10 +0000527#undef xmlGenericError
528xmlGenericErrorFunc *
529__xmlGenericError(void) {
530 if (IS_MAIN_THREAD)
531 return (&xmlGenericError);
532 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000533 return (&xmlGetGlobalState()->xmlGenericError);
Daniel Veillardb8478642001-10-12 17:29:10 +0000534}
535
Daniel Veillardb8478642001-10-12 17:29:10 +0000536#undef xmlGenericErrorContext
537void * *
538__xmlGenericErrorContext(void) {
539 if (IS_MAIN_THREAD)
540 return (&xmlGenericErrorContext);
541 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000542 return (&xmlGetGlobalState()->xmlGenericErrorContext);
Daniel Veillardb8478642001-10-12 17:29:10 +0000543}
544
Daniel Veillardb8478642001-10-12 17:29:10 +0000545#undef xmlGetWarningsDefaultValue
546int *
547__xmlGetWarningsDefaultValue(void) {
548 if (IS_MAIN_THREAD)
549 return (&xmlGetWarningsDefaultValue);
550 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000551 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000552}
553
Daniel Veillardb8478642001-10-12 17:29:10 +0000554#undef xmlIndentTreeOutput
555int *
556__xmlIndentTreeOutput(void) {
557 if (IS_MAIN_THREAD)
558 return (&xmlIndentTreeOutput);
559 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000560 return (&xmlGetGlobalState()->xmlIndentTreeOutput);
Daniel Veillardb8478642001-10-12 17:29:10 +0000561}
562
Daniel Veillardb8478642001-10-12 17:29:10 +0000563#undef xmlKeepBlanksDefaultValue
564int *
565__xmlKeepBlanksDefaultValue(void) {
566 if (IS_MAIN_THREAD)
567 return (&xmlKeepBlanksDefaultValue);
568 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000569 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000570}
571
Daniel Veillardb8478642001-10-12 17:29:10 +0000572#undef xmlLineNumbersDefaultValue
573int *
574__xmlLineNumbersDefaultValue(void) {
575 if (IS_MAIN_THREAD)
576 return (&xmlLineNumbersDefaultValue);
577 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000578 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000579}
580
Daniel Veillardb8478642001-10-12 17:29:10 +0000581#undef xmlLoadExtDtdDefaultValue
582int *
583__xmlLoadExtDtdDefaultValue(void) {
584 if (IS_MAIN_THREAD)
585 return (&xmlLoadExtDtdDefaultValue);
586 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000587 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000588}
589
Daniel Veillardb8478642001-10-12 17:29:10 +0000590#undef xmlParserDebugEntities
591int *
592__xmlParserDebugEntities(void) {
593 if (IS_MAIN_THREAD)
594 return (&xmlParserDebugEntities);
595 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000596 return (&xmlGetGlobalState()->xmlParserDebugEntities);
Daniel Veillardb8478642001-10-12 17:29:10 +0000597}
598
Daniel Veillardb8478642001-10-12 17:29:10 +0000599#undef xmlParserVersion
600const char * *
601__xmlParserVersion(void) {
602 if (IS_MAIN_THREAD)
603 return (&xmlParserVersion);
604 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000605 return (&xmlGetGlobalState()->xmlParserVersion);
Daniel Veillardb8478642001-10-12 17:29:10 +0000606}
607
Daniel Veillardb8478642001-10-12 17:29:10 +0000608#undef xmlPedanticParserDefaultValue
609int *
610__xmlPedanticParserDefaultValue(void) {
611 if (IS_MAIN_THREAD)
612 return (&xmlPedanticParserDefaultValue);
613 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000614 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000615}
616
Daniel Veillardb8478642001-10-12 17:29:10 +0000617#undef xmlSaveNoEmptyTags
618int *
619__xmlSaveNoEmptyTags(void) {
620 if (IS_MAIN_THREAD)
621 return (&xmlSaveNoEmptyTags);
622 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000623 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags);
Daniel Veillardb8478642001-10-12 17:29:10 +0000624}
625
Daniel Veillardb8478642001-10-12 17:29:10 +0000626#undef xmlSubstituteEntitiesDefaultValue
627int *
628__xmlSubstituteEntitiesDefaultValue(void) {
629 if (IS_MAIN_THREAD)
630 return (&xmlSubstituteEntitiesDefaultValue);
631 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000632 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000633}