blob: c4eb3f5e9a296c9a54b89b999680818a1e2a265f [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
Daniel Veillard8326e732003-01-07 00:19:07 +0000118#undef xmlRegisterNodeDefaultValue
119#undef xmlDeregisterNodeDefaultValue
Daniel Veillardd0463562001-10-13 09:15:48 +0000120
121#undef xmlFree
122#undef xmlMalloc
123#undef xmlMemStrdup
124#undef xmlRealloc
125
Daniel Veillard9d06d302002-01-22 18:15:52 +0000126/**
127 * xmlParserVersion:
128 *
129 * Constant string describing the internal version of the library
130 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000131const char *xmlParserVersion = LIBXML_VERSION_STRING;
132
Daniel Veillard9d06d302002-01-22 18:15:52 +0000133/**
134 * xmlBufferAllocScheme:
135 *
136 * Global setting, default allocation policy for buffers, default is
137 * XML_BUFFER_ALLOC_EXACT
Daniel Veillardb8478642001-10-12 17:29:10 +0000138 */
139xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000140/**
141 * xmlDefaultBufferSize:
142 *
143 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
144 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000145int xmlDefaultBufferSize = BASE_BUFFER_SIZE;
146
147/*
148 * Parser defaults
149 */
Daniel Veillardd0463562001-10-13 09:15:48 +0000150
Daniel Veillard9d06d302002-01-22 18:15:52 +0000151/**
152 * oldXMLWDcompatibility:
153 *
154 * Global setting, DEPRECATED.
155 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000156int oldXMLWDcompatibility = 0; /* DEPRECATED */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000157/**
158 * xmlParserDebugEntities:
159 *
160 * Global setting, asking the parser to print out debugging informations.
161 * while handling entities.
162 * Disabled by default
163 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000164int xmlParserDebugEntities = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000165/**
166 * xmlDoValidityCheckingDefaultValue:
167 *
168 * Global setting, indicate that the parser should work in validating mode.
169 * Disabled by default.
170 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000171int xmlDoValidityCheckingDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000172/**
173 * xmlGetWarningsDefaultValue:
174 *
175 * Global setting, indicate that the parser should provide warnings.
176 * Activated by default.
177 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000178int xmlGetWarningsDefaultValue = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000179/**
180 * xmlLoadExtDtdDefaultValue:
181 *
182 * Global setting, indicate that the parser should load DTD while not
183 * validating.
184 * Disabled by default.
185 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000186int xmlLoadExtDtdDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000187/**
188 * xmlPedanticParserDefaultValue:
189 *
190 * Global setting, indicate that the parser be pedantic
191 * Disabled by default.
192 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000193int xmlPedanticParserDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000194/**
195 * xmlLineNumbersDefaultValue:
196 *
197 * Global setting, indicate that the parser should store the line number
198 * in the content field of elements in the DOM tree.
199 * Disabled by default since this may not be safe for old classes of
200 * applicaton.
201 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000202int xmlLineNumbersDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000203/**
204 * xmlKeepBlanksDefaultValue:
205 *
206 * Global setting, indicate that the parser should keep all blanks
207 * nodes found in the content
208 * Activated by default, this is actually needed to have the parser
209 * conformant to the XML Recommendation, however the option is kept
210 * for some applications since this was libxml1 default behaviour.
211 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000212int xmlKeepBlanksDefaultValue = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000213/**
214 * xmlSubstituteEntitiesDefaultValue:
215 *
216 * Global setting, indicate that the parser should not generate entity
217 * references but replace them with the actual content of the entity
218 * Disabled by default, this should be activated when using XPath since
219 * the XPath data model requires entities replacement and the XPath
220 * engine does not handle entities references transparently.
221 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000222int xmlSubstituteEntitiesDefaultValue = 0;
223
Daniel Veillard5335dc52003-01-01 20:59:38 +0000224xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL;
225xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue = NULL;
226
Daniel Veillardb8478642001-10-12 17:29:10 +0000227/*
228 * Error handling
229 */
230
231/* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
232/* Must initialize xmlGenericError in xmlInitParser */
Daniel Veillard635ef722001-10-29 11:48:19 +0000233void xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
234 const char *msg,
235 ...);
Daniel Veillard9d06d302002-01-22 18:15:52 +0000236/**
237 * xmlGenericError:
238 *
239 * Global setting: function used for generic error callbacks
240 */
Daniel Veillard635ef722001-10-29 11:48:19 +0000241xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000242/**
243 * xmlGenericErrorContext:
244 *
245 * Global setting passed to generic error callbacks
246 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000247void *xmlGenericErrorContext = NULL;
248
249/*
250 * output defaults
251 */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000252/**
253 * xmlIndentTreeOutput:
254 *
255 * Global setting, asking the serializer to indent the output tree by default
Aleksey Sanin23002562002-05-24 07:18:40 +0000256 * Enabled by default
Daniel Veillard9d06d302002-01-22 18:15:52 +0000257 */
Aleksey Sanin23002562002-05-24 07:18:40 +0000258int xmlIndentTreeOutput = 1;
259
260/**
261 * xmlTreeIndentString:
262 *
263 * The string used to do one-level indent. By default is equal to " " (two spaces)
264 */
265const char *xmlTreeIndentString = " ";
266
Daniel Veillard9d06d302002-01-22 18:15:52 +0000267/**
268 * xmlSaveNoEmptyTags:
269 *
270 * Global setting, asking the serializer to not output empty tags
271 * as <empty/> but <empty></empty>. those two forms are undistinguishable
272 * once parsed.
273 * Disabled by default
274 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000275int xmlSaveNoEmptyTags = 0;
276
Daniel Veillard9d06d302002-01-22 18:15:52 +0000277/**
278 * xmlDefaultSAXHandler:
279 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000280 * Default handler for XML, builds the DOM tree
281 */
282xmlSAXHandler xmlDefaultSAXHandler = {
283 internalSubset,
284 isStandalone,
285 hasInternalSubset,
286 hasExternalSubset,
287 resolveEntity,
288 getEntity,
289 entityDecl,
290 notationDecl,
291 attributeDecl,
292 elementDecl,
293 unparsedEntityDecl,
294 setDocumentLocator,
295 startDocument,
296 endDocument,
297 startElement,
298 endElement,
299 reference,
300 characters,
301 characters,
302 processingInstruction,
303 comment,
304 xmlParserWarning,
305 xmlParserError,
306 xmlParserError,
307 getParameterEntity,
308 cdataBlock,
309 externalSubset,
310 0
311};
312
Daniel Veillard9d06d302002-01-22 18:15:52 +0000313/**
314 * xmlDefaultSAXLocator:
315 *
316 * The default SAX Locator
317 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
Daniel Veillardb8478642001-10-12 17:29:10 +0000318 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000319xmlSAXLocator xmlDefaultSAXLocator = {
320 getPublicId, getSystemId, getLineNumber, getColumnNumber
321};
322
323#ifdef LIBXML_HTML_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000324/**
325 * htmlDefaultSAXHandler:
326 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000327 * Default handler for HTML, builds the DOM tree
328 */
329xmlSAXHandler htmlDefaultSAXHandler = {
330 internalSubset,
331 NULL,
332 NULL,
333 NULL,
334 NULL,
335 getEntity,
336 NULL,
337 NULL,
338 NULL,
339 NULL,
340 NULL,
341 setDocumentLocator,
342 startDocument,
343 endDocument,
344 startElement,
345 endElement,
346 NULL,
347 characters,
348 ignorableWhitespace,
349 NULL,
350 comment,
351 xmlParserWarning,
352 xmlParserError,
353 xmlParserError,
354 getParameterEntity,
355 cdataBlock,
356 NULL,
357 0
358};
359#endif /* LIBXML_HTML_ENABLED */
360
361#ifdef LIBXML_DOCB_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000362/**
363 * docbDefaultSAXHandler:
364 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000365 * Default handler for SGML DocBook, builds the DOM tree
366 */
367xmlSAXHandler docbDefaultSAXHandler = {
368 internalSubset,
369 isStandalone,
370 hasInternalSubset,
371 hasExternalSubset,
372 resolveEntity,
373 getEntity,
374 entityDecl,
375 NULL,
376 NULL,
377 NULL,
378 NULL,
379 setDocumentLocator,
380 startDocument,
381 endDocument,
382 startElement,
383 endElement,
384 reference,
385 characters,
386 ignorableWhitespace,
387 NULL,
388 comment,
389 xmlParserWarning,
390 xmlParserError,
391 xmlParserError,
392 getParameterEntity,
393 NULL,
394 NULL,
395 0
396};
397#endif /* LIBXML_DOCB_ENABLED */
398
399/**
400 * xmlInitializeGlobalState:
401 * @gs: a pointer to a newly allocated global state
402 *
403 * xmlInitializeGlobalState() initialize a global state with all the
404 * default values of the library.
405 */
406void
407xmlInitializeGlobalState(xmlGlobalStatePtr gs)
408{
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000409#ifdef DEBUG_GLOBALS
410 fprintf(stderr, "Initializing globals at %lu for thread %d\n",
411 (unsigned long) gs, xmlGetThreadId());
412#endif
413
Daniel Veillardb8478642001-10-12 17:29:10 +0000414 /*
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000415 * Perform initialization as required by libxml
Daniel Veillardb8478642001-10-12 17:29:10 +0000416 */
William M. Brack8b2c7f12002-11-22 05:07:29 +0000417
Daniel Veillarda4617b82001-11-04 20:19:12 +0000418#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000419 initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000420#endif
421#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000422 inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000423#endif
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000424 initGenericErrorDefaultFunc(&gs->xmlGenericError);
425
Daniel Veillardb8478642001-10-12 17:29:10 +0000426 gs->oldXMLWDcompatibility = 0;
427 gs->xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
428 gs->xmlDefaultBufferSize = BASE_BUFFER_SIZE;
429 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
430 gs->xmlDefaultSAXLocator.getPublicId = getPublicId;
431 gs->xmlDefaultSAXLocator.getSystemId = getSystemId;
432 gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber;
433 gs->xmlDefaultSAXLocator.getColumnNumber = getColumnNumber;
434 gs->xmlDoValidityCheckingDefaultValue = 0;
435#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
436 gs->xmlFree = (xmlFreeFunc) xmlMemFree;
437 gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
438 gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
439 gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
440#else
441 gs->xmlFree = (xmlFreeFunc) free;
442 gs->xmlMalloc = (xmlMallocFunc) malloc;
443 gs->xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard572577e2002-01-18 16:23:55 +0000444 gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +0000445#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000446 gs->xmlGenericErrorContext = NULL;
447 gs->xmlGetWarningsDefaultValue = 1;
Aleksey Sanin23002562002-05-24 07:18:40 +0000448 gs->xmlIndentTreeOutput = 1;
449 gs->xmlTreeIndentString = " ";
Daniel Veillardb8478642001-10-12 17:29:10 +0000450 gs->xmlKeepBlanksDefaultValue = 1;
451 gs->xmlLineNumbersDefaultValue = 0;
452 gs->xmlLoadExtDtdDefaultValue = 0;
453 gs->xmlParserDebugEntities = 0;
454 gs->xmlParserVersion = LIBXML_VERSION_STRING;
455 gs->xmlPedanticParserDefaultValue = 0;
456 gs->xmlSaveNoEmptyTags = 0;
457 gs->xmlSubstituteEntitiesDefaultValue = 0;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000458
459 gs->xmlRegisterNodeDefaultValue = NULL;
460 gs->xmlDeregisterNodeDefaultValue = NULL;
Daniel Veillardb8478642001-10-12 17:29:10 +0000461}
462
Daniel Veillard5335dc52003-01-01 20:59:38 +0000463/**
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000464 * xmlRegisterNodeDefault:
Daniel Veillard5335dc52003-01-01 20:59:38 +0000465 * @func: function pointer to the new RegisterNodeFunc
466 *
Daniel Veillard1703c5f2003-02-10 14:28:44 +0000467 * Registers a callback for node creation
468 *
469 * Returns the old value of the registration function
Daniel Veillard5335dc52003-01-01 20:59:38 +0000470 */
471xmlRegisterNodeFunc
472xmlRegisterNodeDefault(xmlRegisterNodeFunc func)
473{
474 xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue;
475
476 xmlRegisterNodeDefaultValue = func;
477 return(old);
478}
479
480/**
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000481 * xmlDeregisterNodeDefault:
Daniel Veillard5335dc52003-01-01 20:59:38 +0000482 * @func: function pointer to the new DeregisterNodeFunc
483 *
Daniel Veillard1703c5f2003-02-10 14:28:44 +0000484 * Registers a callback for node destruction
485 *
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000486 * Returns the previous value of the deregistration function
Daniel Veillard5335dc52003-01-01 20:59:38 +0000487 */
488xmlDeregisterNodeFunc
489xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func)
490{
491 xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue;
492
493 xmlDeregisterNodeDefaultValue = func;
494 return(old);
495}
496
497
Daniel Veillarda4617b82001-11-04 20:19:12 +0000498#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000499#undef docbDefaultSAXHandler
500xmlSAXHandler *
501__docbDefaultSAXHandler(void) {
502 if (IS_MAIN_THREAD)
503 return (&docbDefaultSAXHandler);
504 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000505 return (&xmlGetGlobalState()->docbDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000506}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000507#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000508
Daniel Veillarda4617b82001-11-04 20:19:12 +0000509#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000510#undef htmlDefaultSAXHandler
511xmlSAXHandler *
512__htmlDefaultSAXHandler(void) {
513 if (IS_MAIN_THREAD)
514 return (&htmlDefaultSAXHandler);
515 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000516 return (&xmlGetGlobalState()->htmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000517}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000518#endif
519
520/*
521 * Everything starting from the line below is
522 * Automatically generated by build_glob.py.
523 * Do not modify the previous line.
524 */
525
Daniel Veillardb8478642001-10-12 17:29:10 +0000526
Daniel Veillardb8478642001-10-12 17:29:10 +0000527#undef oldXMLWDcompatibility
528int *
529__oldXMLWDcompatibility(void) {
530 if (IS_MAIN_THREAD)
531 return (&oldXMLWDcompatibility);
532 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000533 return (&xmlGetGlobalState()->oldXMLWDcompatibility);
Daniel Veillardb8478642001-10-12 17:29:10 +0000534}
535
Daniel Veillardb8478642001-10-12 17:29:10 +0000536#undef xmlBufferAllocScheme
537xmlBufferAllocationScheme *
538__xmlBufferAllocScheme(void) {
539 if (IS_MAIN_THREAD)
540 return (&xmlBufferAllocScheme);
541 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000542 return (&xmlGetGlobalState()->xmlBufferAllocScheme);
Daniel Veillardb8478642001-10-12 17:29:10 +0000543}
544
Daniel Veillardb8478642001-10-12 17:29:10 +0000545#undef xmlDefaultBufferSize
546int *
547__xmlDefaultBufferSize(void) {
548 if (IS_MAIN_THREAD)
549 return (&xmlDefaultBufferSize);
550 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000551 return (&xmlGetGlobalState()->xmlDefaultBufferSize);
Daniel Veillardb8478642001-10-12 17:29:10 +0000552}
553
Daniel Veillardb8478642001-10-12 17:29:10 +0000554#undef xmlDefaultSAXHandler
555xmlSAXHandler *
556__xmlDefaultSAXHandler(void) {
557 if (IS_MAIN_THREAD)
558 return (&xmlDefaultSAXHandler);
559 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000560 return (&xmlGetGlobalState()->xmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000561}
562
Daniel Veillardb8478642001-10-12 17:29:10 +0000563#undef xmlDefaultSAXLocator
564xmlSAXLocator *
565__xmlDefaultSAXLocator(void) {
566 if (IS_MAIN_THREAD)
567 return (&xmlDefaultSAXLocator);
568 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000569 return (&xmlGetGlobalState()->xmlDefaultSAXLocator);
Daniel Veillardb8478642001-10-12 17:29:10 +0000570}
571
Daniel Veillardb8478642001-10-12 17:29:10 +0000572#undef xmlDoValidityCheckingDefaultValue
573int *
574__xmlDoValidityCheckingDefaultValue(void) {
575 if (IS_MAIN_THREAD)
576 return (&xmlDoValidityCheckingDefaultValue);
577 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000578 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000579}
580
Daniel Veillardb8478642001-10-12 17:29:10 +0000581#undef xmlGenericError
582xmlGenericErrorFunc *
583__xmlGenericError(void) {
584 if (IS_MAIN_THREAD)
585 return (&xmlGenericError);
586 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000587 return (&xmlGetGlobalState()->xmlGenericError);
Daniel Veillardb8478642001-10-12 17:29:10 +0000588}
589
Daniel Veillardb8478642001-10-12 17:29:10 +0000590#undef xmlGenericErrorContext
591void * *
592__xmlGenericErrorContext(void) {
593 if (IS_MAIN_THREAD)
594 return (&xmlGenericErrorContext);
595 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000596 return (&xmlGetGlobalState()->xmlGenericErrorContext);
Daniel Veillardb8478642001-10-12 17:29:10 +0000597}
598
Daniel Veillardb8478642001-10-12 17:29:10 +0000599#undef xmlGetWarningsDefaultValue
600int *
601__xmlGetWarningsDefaultValue(void) {
602 if (IS_MAIN_THREAD)
603 return (&xmlGetWarningsDefaultValue);
604 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000605 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000606}
607
Daniel Veillardb8478642001-10-12 17:29:10 +0000608#undef xmlIndentTreeOutput
609int *
610__xmlIndentTreeOutput(void) {
611 if (IS_MAIN_THREAD)
612 return (&xmlIndentTreeOutput);
613 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000614 return (&xmlGetGlobalState()->xmlIndentTreeOutput);
Daniel Veillardb8478642001-10-12 17:29:10 +0000615}
616
Aleksey Sanin23002562002-05-24 07:18:40 +0000617#undef xmlTreeIndentString
618const char * *
619__xmlTreeIndentString(void) {
620 if (IS_MAIN_THREAD)
621 return (&xmlTreeIndentString);
622 else
623 return (&xmlGetGlobalState()->xmlTreeIndentString);
624}
625
Daniel Veillardb8478642001-10-12 17:29:10 +0000626#undef xmlKeepBlanksDefaultValue
627int *
628__xmlKeepBlanksDefaultValue(void) {
629 if (IS_MAIN_THREAD)
630 return (&xmlKeepBlanksDefaultValue);
631 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000632 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000633}
634
Daniel Veillardb8478642001-10-12 17:29:10 +0000635#undef xmlLineNumbersDefaultValue
636int *
637__xmlLineNumbersDefaultValue(void) {
638 if (IS_MAIN_THREAD)
639 return (&xmlLineNumbersDefaultValue);
640 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000641 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000642}
643
Daniel Veillardb8478642001-10-12 17:29:10 +0000644#undef xmlLoadExtDtdDefaultValue
645int *
646__xmlLoadExtDtdDefaultValue(void) {
647 if (IS_MAIN_THREAD)
648 return (&xmlLoadExtDtdDefaultValue);
649 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000650 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000651}
652
Daniel Veillardb8478642001-10-12 17:29:10 +0000653#undef xmlParserDebugEntities
654int *
655__xmlParserDebugEntities(void) {
656 if (IS_MAIN_THREAD)
657 return (&xmlParserDebugEntities);
658 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000659 return (&xmlGetGlobalState()->xmlParserDebugEntities);
Daniel Veillardb8478642001-10-12 17:29:10 +0000660}
661
Daniel Veillardb8478642001-10-12 17:29:10 +0000662#undef xmlParserVersion
663const char * *
664__xmlParserVersion(void) {
665 if (IS_MAIN_THREAD)
666 return (&xmlParserVersion);
667 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000668 return (&xmlGetGlobalState()->xmlParserVersion);
Daniel Veillardb8478642001-10-12 17:29:10 +0000669}
670
Daniel Veillardb8478642001-10-12 17:29:10 +0000671#undef xmlPedanticParserDefaultValue
672int *
673__xmlPedanticParserDefaultValue(void) {
674 if (IS_MAIN_THREAD)
675 return (&xmlPedanticParserDefaultValue);
676 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000677 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000678}
679
Daniel Veillardb8478642001-10-12 17:29:10 +0000680#undef xmlSaveNoEmptyTags
681int *
682__xmlSaveNoEmptyTags(void) {
683 if (IS_MAIN_THREAD)
684 return (&xmlSaveNoEmptyTags);
685 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000686 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags);
Daniel Veillardb8478642001-10-12 17:29:10 +0000687}
688
Daniel Veillardb8478642001-10-12 17:29:10 +0000689#undef xmlSubstituteEntitiesDefaultValue
690int *
691__xmlSubstituteEntitiesDefaultValue(void) {
692 if (IS_MAIN_THREAD)
693 return (&xmlSubstituteEntitiesDefaultValue);
694 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000695 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000696}
Daniel Veillard5335dc52003-01-01 20:59:38 +0000697
698#undef xmlRegisterNodeDefaultValue
699xmlRegisterNodeFunc *
700__xmlRegisterNodeDefaultValue(void) {
701 if (IS_MAIN_THREAD)
702 return (&xmlRegisterNodeDefaultValue);
703 else
704 return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue);
705}
706
707#undef xmlDeregisterNodeDefaultValue
708xmlDeregisterNodeFunc *
709__xmlDeregisterNodeDefaultValue(void) {
710 if (IS_MAIN_THREAD)
711 return (&xmlDeregisterNodeDefaultValue);
712 else
713 return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue);
714}