blob: 72446929dd632699a548ec4a8be62638ee53ba73 [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/**
462 * xmlRegisterNodeDefault
463 * @func: function pointer to the new RegisterNodeFunc
464 *
465 */
466xmlRegisterNodeFunc
467xmlRegisterNodeDefault(xmlRegisterNodeFunc func)
468{
469 xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue;
470
471 xmlRegisterNodeDefaultValue = func;
472 return(old);
473}
474
475/**
476 * xmlDeegisterNodeDefault
477 * @func: function pointer to the new DeregisterNodeFunc
478 *
479 */
480xmlDeregisterNodeFunc
481xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func)
482{
483 xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue;
484
485 xmlDeregisterNodeDefaultValue = func;
486 return(old);
487}
488
489
Daniel Veillarda4617b82001-11-04 20:19:12 +0000490#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000491#undef docbDefaultSAXHandler
492xmlSAXHandler *
493__docbDefaultSAXHandler(void) {
494 if (IS_MAIN_THREAD)
495 return (&docbDefaultSAXHandler);
496 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000497 return (&xmlGetGlobalState()->docbDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000498}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000499#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000500
Daniel Veillarda4617b82001-11-04 20:19:12 +0000501#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000502#undef htmlDefaultSAXHandler
503xmlSAXHandler *
504__htmlDefaultSAXHandler(void) {
505 if (IS_MAIN_THREAD)
506 return (&htmlDefaultSAXHandler);
507 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000508 return (&xmlGetGlobalState()->htmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000509}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000510#endif
511
512/*
513 * Everything starting from the line below is
514 * Automatically generated by build_glob.py.
515 * Do not modify the previous line.
516 */
517
Daniel Veillardb8478642001-10-12 17:29:10 +0000518
Daniel Veillardb8478642001-10-12 17:29:10 +0000519#undef oldXMLWDcompatibility
520int *
521__oldXMLWDcompatibility(void) {
522 if (IS_MAIN_THREAD)
523 return (&oldXMLWDcompatibility);
524 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000525 return (&xmlGetGlobalState()->oldXMLWDcompatibility);
Daniel Veillardb8478642001-10-12 17:29:10 +0000526}
527
Daniel Veillardb8478642001-10-12 17:29:10 +0000528#undef xmlBufferAllocScheme
529xmlBufferAllocationScheme *
530__xmlBufferAllocScheme(void) {
531 if (IS_MAIN_THREAD)
532 return (&xmlBufferAllocScheme);
533 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000534 return (&xmlGetGlobalState()->xmlBufferAllocScheme);
Daniel Veillardb8478642001-10-12 17:29:10 +0000535}
536
Daniel Veillardb8478642001-10-12 17:29:10 +0000537#undef xmlDefaultBufferSize
538int *
539__xmlDefaultBufferSize(void) {
540 if (IS_MAIN_THREAD)
541 return (&xmlDefaultBufferSize);
542 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000543 return (&xmlGetGlobalState()->xmlDefaultBufferSize);
Daniel Veillardb8478642001-10-12 17:29:10 +0000544}
545
Daniel Veillardb8478642001-10-12 17:29:10 +0000546#undef xmlDefaultSAXHandler
547xmlSAXHandler *
548__xmlDefaultSAXHandler(void) {
549 if (IS_MAIN_THREAD)
550 return (&xmlDefaultSAXHandler);
551 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000552 return (&xmlGetGlobalState()->xmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000553}
554
Daniel Veillardb8478642001-10-12 17:29:10 +0000555#undef xmlDefaultSAXLocator
556xmlSAXLocator *
557__xmlDefaultSAXLocator(void) {
558 if (IS_MAIN_THREAD)
559 return (&xmlDefaultSAXLocator);
560 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000561 return (&xmlGetGlobalState()->xmlDefaultSAXLocator);
Daniel Veillardb8478642001-10-12 17:29:10 +0000562}
563
Daniel Veillardb8478642001-10-12 17:29:10 +0000564#undef xmlDoValidityCheckingDefaultValue
565int *
566__xmlDoValidityCheckingDefaultValue(void) {
567 if (IS_MAIN_THREAD)
568 return (&xmlDoValidityCheckingDefaultValue);
569 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000570 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000571}
572
Daniel Veillardb8478642001-10-12 17:29:10 +0000573#undef xmlGenericError
574xmlGenericErrorFunc *
575__xmlGenericError(void) {
576 if (IS_MAIN_THREAD)
577 return (&xmlGenericError);
578 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000579 return (&xmlGetGlobalState()->xmlGenericError);
Daniel Veillardb8478642001-10-12 17:29:10 +0000580}
581
Daniel Veillardb8478642001-10-12 17:29:10 +0000582#undef xmlGenericErrorContext
583void * *
584__xmlGenericErrorContext(void) {
585 if (IS_MAIN_THREAD)
586 return (&xmlGenericErrorContext);
587 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000588 return (&xmlGetGlobalState()->xmlGenericErrorContext);
Daniel Veillardb8478642001-10-12 17:29:10 +0000589}
590
Daniel Veillardb8478642001-10-12 17:29:10 +0000591#undef xmlGetWarningsDefaultValue
592int *
593__xmlGetWarningsDefaultValue(void) {
594 if (IS_MAIN_THREAD)
595 return (&xmlGetWarningsDefaultValue);
596 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000597 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000598}
599
Daniel Veillardb8478642001-10-12 17:29:10 +0000600#undef xmlIndentTreeOutput
601int *
602__xmlIndentTreeOutput(void) {
603 if (IS_MAIN_THREAD)
604 return (&xmlIndentTreeOutput);
605 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000606 return (&xmlGetGlobalState()->xmlIndentTreeOutput);
Daniel Veillardb8478642001-10-12 17:29:10 +0000607}
608
Aleksey Sanin23002562002-05-24 07:18:40 +0000609#undef xmlTreeIndentString
610const char * *
611__xmlTreeIndentString(void) {
612 if (IS_MAIN_THREAD)
613 return (&xmlTreeIndentString);
614 else
615 return (&xmlGetGlobalState()->xmlTreeIndentString);
616}
617
Daniel Veillardb8478642001-10-12 17:29:10 +0000618#undef xmlKeepBlanksDefaultValue
619int *
620__xmlKeepBlanksDefaultValue(void) {
621 if (IS_MAIN_THREAD)
622 return (&xmlKeepBlanksDefaultValue);
623 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000624 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000625}
626
Daniel Veillardb8478642001-10-12 17:29:10 +0000627#undef xmlLineNumbersDefaultValue
628int *
629__xmlLineNumbersDefaultValue(void) {
630 if (IS_MAIN_THREAD)
631 return (&xmlLineNumbersDefaultValue);
632 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000633 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000634}
635
Daniel Veillardb8478642001-10-12 17:29:10 +0000636#undef xmlLoadExtDtdDefaultValue
637int *
638__xmlLoadExtDtdDefaultValue(void) {
639 if (IS_MAIN_THREAD)
640 return (&xmlLoadExtDtdDefaultValue);
641 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000642 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000643}
644
Daniel Veillardb8478642001-10-12 17:29:10 +0000645#undef xmlParserDebugEntities
646int *
647__xmlParserDebugEntities(void) {
648 if (IS_MAIN_THREAD)
649 return (&xmlParserDebugEntities);
650 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000651 return (&xmlGetGlobalState()->xmlParserDebugEntities);
Daniel Veillardb8478642001-10-12 17:29:10 +0000652}
653
Daniel Veillardb8478642001-10-12 17:29:10 +0000654#undef xmlParserVersion
655const char * *
656__xmlParserVersion(void) {
657 if (IS_MAIN_THREAD)
658 return (&xmlParserVersion);
659 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000660 return (&xmlGetGlobalState()->xmlParserVersion);
Daniel Veillardb8478642001-10-12 17:29:10 +0000661}
662
Daniel Veillardb8478642001-10-12 17:29:10 +0000663#undef xmlPedanticParserDefaultValue
664int *
665__xmlPedanticParserDefaultValue(void) {
666 if (IS_MAIN_THREAD)
667 return (&xmlPedanticParserDefaultValue);
668 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000669 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000670}
671
Daniel Veillardb8478642001-10-12 17:29:10 +0000672#undef xmlSaveNoEmptyTags
673int *
674__xmlSaveNoEmptyTags(void) {
675 if (IS_MAIN_THREAD)
676 return (&xmlSaveNoEmptyTags);
677 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000678 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags);
Daniel Veillardb8478642001-10-12 17:29:10 +0000679}
680
Daniel Veillardb8478642001-10-12 17:29:10 +0000681#undef xmlSubstituteEntitiesDefaultValue
682int *
683__xmlSubstituteEntitiesDefaultValue(void) {
684 if (IS_MAIN_THREAD)
685 return (&xmlSubstituteEntitiesDefaultValue);
686 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000687 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000688}
Daniel Veillard5335dc52003-01-01 20:59:38 +0000689
690#undef xmlRegisterNodeDefaultValue
691xmlRegisterNodeFunc *
692__xmlRegisterNodeDefaultValue(void) {
693 if (IS_MAIN_THREAD)
694 return (&xmlRegisterNodeDefaultValue);
695 else
696 return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue);
697}
698
699#undef xmlDeregisterNodeDefaultValue
700xmlDeregisterNodeFunc *
701__xmlDeregisterNodeDefaultValue(void) {
702 if (IS_MAIN_THREAD)
703 return (&xmlDeregisterNodeDefaultValue);
704 else
705 return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue);
706}