blob: 380c94e63106508caab2a311d01f9c9a594a440d [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;
Daniel Veillard3c908dc2003-04-19 00:07:51 +000053xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillardb8478642001-10-12 17:29:10 +000054xmlReallocFunc xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
55xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
56#else
Daniel Veillard9d06d302002-01-22 18:15:52 +000057/**
58 * xmlFree:
59 * @mem: an already allocated block of memory
60 *
61 * The variable holding the libxml free() implementation
62 */
Daniel Veillardb8478642001-10-12 17:29:10 +000063xmlFreeFunc xmlFree = (xmlFreeFunc) free;
Daniel Veillard9d06d302002-01-22 18:15:52 +000064/**
65 * xmlMalloc:
66 * @size: the size requested in bytes
67 *
68 * The variable holding the libxml malloc() implementation
69 *
70 * Returns a pointer to the newly allocated block or NULL in case of error
71 */
Daniel Veillardb8478642001-10-12 17:29:10 +000072xmlMallocFunc xmlMalloc = (xmlMallocFunc) malloc;
Daniel Veillard9d06d302002-01-22 18:15:52 +000073/**
Daniel Veillard3c908dc2003-04-19 00:07:51 +000074 * xmlMallocAtomic:
75 * @size: the size requested in bytes
76 *
77 * The variable holding the libxml malloc() implementation for atomic
78 * data (i.e. blocks not containings pointers), useful when using a
79 * garbage collecting allocator.
80 *
81 * Returns a pointer to the newly allocated block or NULL in case of error
82 */
83xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) malloc;
84/**
Daniel Veillard9d06d302002-01-22 18:15:52 +000085 * xmlRealloc:
86 * @mem: an already allocated block of memory
87 * @size: the new size requested in bytes
88 *
89 * The variable holding the libxml realloc() implementation
90 *
91 * Returns a pointer to the newly reallocated block or NULL in case of error
92 */
Daniel Veillardb8478642001-10-12 17:29:10 +000093xmlReallocFunc xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard9d06d302002-01-22 18:15:52 +000094/**
95 * xmlMemStrdup:
96 * @str: a zero terminated string
97 *
98 * The variable holding the libxml strdup() implementation
99 *
100 * Returns the copy of the string or NULL in case of error
101 */
Daniel Veillardb82c1662001-12-09 14:00:54 +0000102xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +0000103#endif
104
Daniel Veillardd0463562001-10-13 09:15:48 +0000105#include <libxml/threads.h>
106#include <libxml/globals.h>
107#include <libxml/SAX.h>
108
109#undef docbDefaultSAXHandler
110#undef htmlDefaultSAXHandler
111#undef oldXMLWDcompatibility
112#undef xmlBufferAllocScheme
113#undef xmlDefaultBufferSize
114#undef xmlDefaultSAXHandler
115#undef xmlDefaultSAXLocator
116#undef xmlDoValidityCheckingDefaultValue
117#undef xmlGenericError
118#undef xmlGenericErrorContext
119#undef xmlGetWarningsDefaultValue
120#undef xmlIndentTreeOutput
Aleksey Sanin23002562002-05-24 07:18:40 +0000121#undef xmlTreeIndentString
Daniel Veillardd0463562001-10-13 09:15:48 +0000122#undef xmlKeepBlanksDefaultValue
123#undef xmlLineNumbersDefaultValue
124#undef xmlLoadExtDtdDefaultValue
125#undef xmlParserDebugEntities
126#undef xmlParserVersion
127#undef xmlPedanticParserDefaultValue
128#undef xmlSaveNoEmptyTags
129#undef xmlSubstituteEntitiesDefaultValue
Daniel Veillard8326e732003-01-07 00:19:07 +0000130#undef xmlRegisterNodeDefaultValue
131#undef xmlDeregisterNodeDefaultValue
Daniel Veillardd0463562001-10-13 09:15:48 +0000132
133#undef xmlFree
134#undef xmlMalloc
Daniel Veillard3c908dc2003-04-19 00:07:51 +0000135#undef xmlMallocAtomic
Daniel Veillardd0463562001-10-13 09:15:48 +0000136#undef xmlMemStrdup
137#undef xmlRealloc
138
Daniel Veillard9d06d302002-01-22 18:15:52 +0000139/**
140 * xmlParserVersion:
141 *
142 * Constant string describing the internal version of the library
143 */
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000144const char *xmlParserVersion = LIBXML_VERSION_STRING;
145
Daniel Veillard9d06d302002-01-22 18:15:52 +0000146/**
147 * xmlBufferAllocScheme:
148 *
149 * Global setting, default allocation policy for buffers, default is
150 * XML_BUFFER_ALLOC_EXACT
Daniel Veillardb8478642001-10-12 17:29:10 +0000151 */
152xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000153/**
154 * xmlDefaultBufferSize:
155 *
156 * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
157 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000158int xmlDefaultBufferSize = BASE_BUFFER_SIZE;
159
160/*
161 * Parser defaults
162 */
Daniel Veillardd0463562001-10-13 09:15:48 +0000163
Daniel Veillard9d06d302002-01-22 18:15:52 +0000164/**
165 * oldXMLWDcompatibility:
166 *
167 * Global setting, DEPRECATED.
168 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000169int oldXMLWDcompatibility = 0; /* DEPRECATED */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000170/**
171 * xmlParserDebugEntities:
172 *
173 * Global setting, asking the parser to print out debugging informations.
174 * while handling entities.
175 * Disabled by default
176 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000177int xmlParserDebugEntities = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000178/**
179 * xmlDoValidityCheckingDefaultValue:
180 *
181 * Global setting, indicate that the parser should work in validating mode.
182 * Disabled by default.
183 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000184int xmlDoValidityCheckingDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000185/**
186 * xmlGetWarningsDefaultValue:
187 *
188 * Global setting, indicate that the parser should provide warnings.
189 * Activated by default.
190 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000191int xmlGetWarningsDefaultValue = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000192/**
193 * xmlLoadExtDtdDefaultValue:
194 *
195 * Global setting, indicate that the parser should load DTD while not
196 * validating.
197 * Disabled by default.
198 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000199int xmlLoadExtDtdDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000200/**
201 * xmlPedanticParserDefaultValue:
202 *
203 * Global setting, indicate that the parser be pedantic
204 * Disabled by default.
205 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000206int xmlPedanticParserDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000207/**
208 * xmlLineNumbersDefaultValue:
209 *
210 * Global setting, indicate that the parser should store the line number
211 * in the content field of elements in the DOM tree.
212 * Disabled by default since this may not be safe for old classes of
213 * applicaton.
214 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000215int xmlLineNumbersDefaultValue = 0;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000216/**
217 * xmlKeepBlanksDefaultValue:
218 *
219 * Global setting, indicate that the parser should keep all blanks
220 * nodes found in the content
221 * Activated by default, this is actually needed to have the parser
222 * conformant to the XML Recommendation, however the option is kept
223 * for some applications since this was libxml1 default behaviour.
224 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000225int xmlKeepBlanksDefaultValue = 1;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000226/**
227 * xmlSubstituteEntitiesDefaultValue:
228 *
229 * Global setting, indicate that the parser should not generate entity
230 * references but replace them with the actual content of the entity
231 * Disabled by default, this should be activated when using XPath since
232 * the XPath data model requires entities replacement and the XPath
233 * engine does not handle entities references transparently.
234 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000235int xmlSubstituteEntitiesDefaultValue = 0;
236
Daniel Veillard5335dc52003-01-01 20:59:38 +0000237xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL;
238xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue = NULL;
239
Daniel Veillardb8478642001-10-12 17:29:10 +0000240/*
241 * Error handling
242 */
243
244/* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */
245/* Must initialize xmlGenericError in xmlInitParser */
Daniel Veillard635ef722001-10-29 11:48:19 +0000246void xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
247 const char *msg,
248 ...);
Daniel Veillard9d06d302002-01-22 18:15:52 +0000249/**
250 * xmlGenericError:
251 *
252 * Global setting: function used for generic error callbacks
253 */
Daniel Veillard635ef722001-10-29 11:48:19 +0000254xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc;
Daniel Veillard9d06d302002-01-22 18:15:52 +0000255/**
256 * xmlGenericErrorContext:
257 *
258 * Global setting passed to generic error callbacks
259 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000260void *xmlGenericErrorContext = NULL;
261
262/*
263 * output defaults
264 */
Daniel Veillard9d06d302002-01-22 18:15:52 +0000265/**
266 * xmlIndentTreeOutput:
267 *
268 * Global setting, asking the serializer to indent the output tree by default
Aleksey Sanin23002562002-05-24 07:18:40 +0000269 * Enabled by default
Daniel Veillard9d06d302002-01-22 18:15:52 +0000270 */
Aleksey Sanin23002562002-05-24 07:18:40 +0000271int xmlIndentTreeOutput = 1;
272
273/**
274 * xmlTreeIndentString:
275 *
276 * The string used to do one-level indent. By default is equal to " " (two spaces)
277 */
278const char *xmlTreeIndentString = " ";
279
Daniel Veillard9d06d302002-01-22 18:15:52 +0000280/**
281 * xmlSaveNoEmptyTags:
282 *
283 * Global setting, asking the serializer to not output empty tags
284 * as <empty/> but <empty></empty>. those two forms are undistinguishable
285 * once parsed.
286 * Disabled by default
287 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000288int xmlSaveNoEmptyTags = 0;
289
Daniel Veillard9d06d302002-01-22 18:15:52 +0000290/**
291 * xmlDefaultSAXHandler:
292 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000293 * Default handler for XML, builds the DOM tree
294 */
295xmlSAXHandler xmlDefaultSAXHandler = {
296 internalSubset,
297 isStandalone,
298 hasInternalSubset,
299 hasExternalSubset,
300 resolveEntity,
301 getEntity,
302 entityDecl,
303 notationDecl,
304 attributeDecl,
305 elementDecl,
306 unparsedEntityDecl,
307 setDocumentLocator,
308 startDocument,
309 endDocument,
310 startElement,
311 endElement,
312 reference,
313 characters,
314 characters,
315 processingInstruction,
316 comment,
317 xmlParserWarning,
318 xmlParserError,
319 xmlParserError,
320 getParameterEntity,
321 cdataBlock,
322 externalSubset,
323 0
324};
325
Daniel Veillard9d06d302002-01-22 18:15:52 +0000326/**
327 * xmlDefaultSAXLocator:
328 *
329 * The default SAX Locator
330 * { getPublicId, getSystemId, getLineNumber, getColumnNumber}
Daniel Veillardb8478642001-10-12 17:29:10 +0000331 */
Daniel Veillardb8478642001-10-12 17:29:10 +0000332xmlSAXLocator xmlDefaultSAXLocator = {
333 getPublicId, getSystemId, getLineNumber, getColumnNumber
334};
335
336#ifdef LIBXML_HTML_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000337/**
338 * htmlDefaultSAXHandler:
339 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000340 * Default handler for HTML, builds the DOM tree
341 */
342xmlSAXHandler htmlDefaultSAXHandler = {
343 internalSubset,
344 NULL,
345 NULL,
346 NULL,
347 NULL,
348 getEntity,
349 NULL,
350 NULL,
351 NULL,
352 NULL,
353 NULL,
354 setDocumentLocator,
355 startDocument,
356 endDocument,
357 startElement,
358 endElement,
359 NULL,
360 characters,
361 ignorableWhitespace,
362 NULL,
363 comment,
364 xmlParserWarning,
365 xmlParserError,
366 xmlParserError,
367 getParameterEntity,
368 cdataBlock,
369 NULL,
370 0
371};
372#endif /* LIBXML_HTML_ENABLED */
373
374#ifdef LIBXML_DOCB_ENABLED
Daniel Veillard9d06d302002-01-22 18:15:52 +0000375/**
376 * docbDefaultSAXHandler:
377 *
Daniel Veillardb8478642001-10-12 17:29:10 +0000378 * Default handler for SGML DocBook, builds the DOM tree
379 */
380xmlSAXHandler docbDefaultSAXHandler = {
381 internalSubset,
382 isStandalone,
383 hasInternalSubset,
384 hasExternalSubset,
385 resolveEntity,
386 getEntity,
387 entityDecl,
388 NULL,
389 NULL,
390 NULL,
391 NULL,
392 setDocumentLocator,
393 startDocument,
394 endDocument,
395 startElement,
396 endElement,
397 reference,
398 characters,
399 ignorableWhitespace,
400 NULL,
401 comment,
402 xmlParserWarning,
403 xmlParserError,
404 xmlParserError,
405 getParameterEntity,
406 NULL,
407 NULL,
408 0
409};
410#endif /* LIBXML_DOCB_ENABLED */
411
412/**
413 * xmlInitializeGlobalState:
414 * @gs: a pointer to a newly allocated global state
415 *
416 * xmlInitializeGlobalState() initialize a global state with all the
417 * default values of the library.
418 */
419void
420xmlInitializeGlobalState(xmlGlobalStatePtr gs)
421{
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000422#ifdef DEBUG_GLOBALS
423 fprintf(stderr, "Initializing globals at %lu for thread %d\n",
424 (unsigned long) gs, xmlGetThreadId());
425#endif
426
Daniel Veillardb8478642001-10-12 17:29:10 +0000427 /*
Daniel Veillardcbaf3992001-12-31 16:16:02 +0000428 * Perform initialization as required by libxml
Daniel Veillardb8478642001-10-12 17:29:10 +0000429 */
William M. Brack8b2c7f12002-11-22 05:07:29 +0000430
Daniel Veillarda4617b82001-11-04 20:19:12 +0000431#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000432 initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000433#endif
434#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000435 inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
Daniel Veillarda4617b82001-11-04 20:19:12 +0000436#endif
Daniel Veillard3c01b1d2001-10-17 15:58:35 +0000437 initGenericErrorDefaultFunc(&gs->xmlGenericError);
438
Daniel Veillardb8478642001-10-12 17:29:10 +0000439 gs->oldXMLWDcompatibility = 0;
440 gs->xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
441 gs->xmlDefaultBufferSize = BASE_BUFFER_SIZE;
442 initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
443 gs->xmlDefaultSAXLocator.getPublicId = getPublicId;
444 gs->xmlDefaultSAXLocator.getSystemId = getSystemId;
445 gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber;
446 gs->xmlDefaultSAXLocator.getColumnNumber = getColumnNumber;
447 gs->xmlDoValidityCheckingDefaultValue = 0;
448#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
449 gs->xmlFree = (xmlFreeFunc) xmlMemFree;
450 gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillard3c908dc2003-04-19 00:07:51 +0000451 gs->xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc;
Daniel Veillardb8478642001-10-12 17:29:10 +0000452 gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
453 gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
454#else
455 gs->xmlFree = (xmlFreeFunc) free;
456 gs->xmlMalloc = (xmlMallocFunc) malloc;
Daniel Veillard3c908dc2003-04-19 00:07:51 +0000457 gs->xmlMallocAtomic = (xmlMallocFunc) malloc;
Daniel Veillardb8478642001-10-12 17:29:10 +0000458 gs->xmlRealloc = (xmlReallocFunc) realloc;
Daniel Veillard572577e2002-01-18 16:23:55 +0000459 gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
Daniel Veillardb8478642001-10-12 17:29:10 +0000460#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000461 gs->xmlGenericErrorContext = NULL;
462 gs->xmlGetWarningsDefaultValue = 1;
Aleksey Sanin23002562002-05-24 07:18:40 +0000463 gs->xmlIndentTreeOutput = 1;
464 gs->xmlTreeIndentString = " ";
Daniel Veillardb8478642001-10-12 17:29:10 +0000465 gs->xmlKeepBlanksDefaultValue = 1;
466 gs->xmlLineNumbersDefaultValue = 0;
467 gs->xmlLoadExtDtdDefaultValue = 0;
468 gs->xmlParserDebugEntities = 0;
469 gs->xmlParserVersion = LIBXML_VERSION_STRING;
470 gs->xmlPedanticParserDefaultValue = 0;
471 gs->xmlSaveNoEmptyTags = 0;
472 gs->xmlSubstituteEntitiesDefaultValue = 0;
Daniel Veillard5335dc52003-01-01 20:59:38 +0000473
474 gs->xmlRegisterNodeDefaultValue = NULL;
475 gs->xmlDeregisterNodeDefaultValue = NULL;
Daniel Veillardb8478642001-10-12 17:29:10 +0000476}
477
Daniel Veillard5335dc52003-01-01 20:59:38 +0000478/**
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000479 * xmlRegisterNodeDefault:
Daniel Veillard5335dc52003-01-01 20:59:38 +0000480 * @func: function pointer to the new RegisterNodeFunc
481 *
Daniel Veillard1703c5f2003-02-10 14:28:44 +0000482 * Registers a callback for node creation
483 *
484 * Returns the old value of the registration function
Daniel Veillard5335dc52003-01-01 20:59:38 +0000485 */
486xmlRegisterNodeFunc
487xmlRegisterNodeDefault(xmlRegisterNodeFunc func)
488{
489 xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue;
490
491 xmlRegisterNodeDefaultValue = func;
492 return(old);
493}
494
495/**
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000496 * xmlDeregisterNodeDefault:
Daniel Veillard5335dc52003-01-01 20:59:38 +0000497 * @func: function pointer to the new DeregisterNodeFunc
498 *
Daniel Veillard1703c5f2003-02-10 14:28:44 +0000499 * Registers a callback for node destruction
500 *
Daniel Veillard7b4b2f92003-01-06 13:11:20 +0000501 * Returns the previous value of the deregistration function
Daniel Veillard5335dc52003-01-01 20:59:38 +0000502 */
503xmlDeregisterNodeFunc
504xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func)
505{
506 xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue;
507
508 xmlDeregisterNodeDefaultValue = func;
509 return(old);
510}
511
512
Daniel Veillarda4617b82001-11-04 20:19:12 +0000513#ifdef LIBXML_DOCB_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000514#undef docbDefaultSAXHandler
515xmlSAXHandler *
516__docbDefaultSAXHandler(void) {
517 if (IS_MAIN_THREAD)
518 return (&docbDefaultSAXHandler);
519 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000520 return (&xmlGetGlobalState()->docbDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000521}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000522#endif
Daniel Veillardb8478642001-10-12 17:29:10 +0000523
Daniel Veillarda4617b82001-11-04 20:19:12 +0000524#ifdef LIBXML_HTML_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000525#undef htmlDefaultSAXHandler
526xmlSAXHandler *
527__htmlDefaultSAXHandler(void) {
528 if (IS_MAIN_THREAD)
529 return (&htmlDefaultSAXHandler);
530 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000531 return (&xmlGetGlobalState()->htmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000532}
Daniel Veillarda4617b82001-11-04 20:19:12 +0000533#endif
534
535/*
536 * Everything starting from the line below is
537 * Automatically generated by build_glob.py.
538 * Do not modify the previous line.
539 */
540
Daniel Veillardb8478642001-10-12 17:29:10 +0000541
Daniel Veillardb8478642001-10-12 17:29:10 +0000542#undef oldXMLWDcompatibility
543int *
544__oldXMLWDcompatibility(void) {
545 if (IS_MAIN_THREAD)
546 return (&oldXMLWDcompatibility);
547 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000548 return (&xmlGetGlobalState()->oldXMLWDcompatibility);
Daniel Veillardb8478642001-10-12 17:29:10 +0000549}
550
Daniel Veillardb8478642001-10-12 17:29:10 +0000551#undef xmlBufferAllocScheme
552xmlBufferAllocationScheme *
553__xmlBufferAllocScheme(void) {
554 if (IS_MAIN_THREAD)
555 return (&xmlBufferAllocScheme);
556 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000557 return (&xmlGetGlobalState()->xmlBufferAllocScheme);
Daniel Veillardb8478642001-10-12 17:29:10 +0000558}
559
Daniel Veillardb8478642001-10-12 17:29:10 +0000560#undef xmlDefaultBufferSize
561int *
562__xmlDefaultBufferSize(void) {
563 if (IS_MAIN_THREAD)
564 return (&xmlDefaultBufferSize);
565 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000566 return (&xmlGetGlobalState()->xmlDefaultBufferSize);
Daniel Veillardb8478642001-10-12 17:29:10 +0000567}
568
Daniel Veillardb8478642001-10-12 17:29:10 +0000569#undef xmlDefaultSAXHandler
570xmlSAXHandler *
571__xmlDefaultSAXHandler(void) {
572 if (IS_MAIN_THREAD)
573 return (&xmlDefaultSAXHandler);
574 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000575 return (&xmlGetGlobalState()->xmlDefaultSAXHandler);
Daniel Veillardb8478642001-10-12 17:29:10 +0000576}
577
Daniel Veillardb8478642001-10-12 17:29:10 +0000578#undef xmlDefaultSAXLocator
579xmlSAXLocator *
580__xmlDefaultSAXLocator(void) {
581 if (IS_MAIN_THREAD)
582 return (&xmlDefaultSAXLocator);
583 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000584 return (&xmlGetGlobalState()->xmlDefaultSAXLocator);
Daniel Veillardb8478642001-10-12 17:29:10 +0000585}
586
Daniel Veillardb8478642001-10-12 17:29:10 +0000587#undef xmlDoValidityCheckingDefaultValue
588int *
589__xmlDoValidityCheckingDefaultValue(void) {
590 if (IS_MAIN_THREAD)
591 return (&xmlDoValidityCheckingDefaultValue);
592 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000593 return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000594}
595
Daniel Veillardb8478642001-10-12 17:29:10 +0000596#undef xmlGenericError
597xmlGenericErrorFunc *
598__xmlGenericError(void) {
599 if (IS_MAIN_THREAD)
600 return (&xmlGenericError);
601 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000602 return (&xmlGetGlobalState()->xmlGenericError);
Daniel Veillardb8478642001-10-12 17:29:10 +0000603}
604
Daniel Veillardb8478642001-10-12 17:29:10 +0000605#undef xmlGenericErrorContext
606void * *
607__xmlGenericErrorContext(void) {
608 if (IS_MAIN_THREAD)
609 return (&xmlGenericErrorContext);
610 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000611 return (&xmlGetGlobalState()->xmlGenericErrorContext);
Daniel Veillardb8478642001-10-12 17:29:10 +0000612}
613
Daniel Veillardb8478642001-10-12 17:29:10 +0000614#undef xmlGetWarningsDefaultValue
615int *
616__xmlGetWarningsDefaultValue(void) {
617 if (IS_MAIN_THREAD)
618 return (&xmlGetWarningsDefaultValue);
619 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000620 return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000621}
622
Daniel Veillardb8478642001-10-12 17:29:10 +0000623#undef xmlIndentTreeOutput
624int *
625__xmlIndentTreeOutput(void) {
626 if (IS_MAIN_THREAD)
627 return (&xmlIndentTreeOutput);
628 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000629 return (&xmlGetGlobalState()->xmlIndentTreeOutput);
Daniel Veillardb8478642001-10-12 17:29:10 +0000630}
631
Aleksey Sanin23002562002-05-24 07:18:40 +0000632#undef xmlTreeIndentString
633const char * *
634__xmlTreeIndentString(void) {
635 if (IS_MAIN_THREAD)
636 return (&xmlTreeIndentString);
637 else
638 return (&xmlGetGlobalState()->xmlTreeIndentString);
639}
640
Daniel Veillardb8478642001-10-12 17:29:10 +0000641#undef xmlKeepBlanksDefaultValue
642int *
643__xmlKeepBlanksDefaultValue(void) {
644 if (IS_MAIN_THREAD)
645 return (&xmlKeepBlanksDefaultValue);
646 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000647 return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000648}
649
Daniel Veillardb8478642001-10-12 17:29:10 +0000650#undef xmlLineNumbersDefaultValue
651int *
652__xmlLineNumbersDefaultValue(void) {
653 if (IS_MAIN_THREAD)
654 return (&xmlLineNumbersDefaultValue);
655 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000656 return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000657}
658
Daniel Veillardb8478642001-10-12 17:29:10 +0000659#undef xmlLoadExtDtdDefaultValue
660int *
661__xmlLoadExtDtdDefaultValue(void) {
662 if (IS_MAIN_THREAD)
663 return (&xmlLoadExtDtdDefaultValue);
664 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000665 return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000666}
667
Daniel Veillardb8478642001-10-12 17:29:10 +0000668#undef xmlParserDebugEntities
669int *
670__xmlParserDebugEntities(void) {
671 if (IS_MAIN_THREAD)
672 return (&xmlParserDebugEntities);
673 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000674 return (&xmlGetGlobalState()->xmlParserDebugEntities);
Daniel Veillardb8478642001-10-12 17:29:10 +0000675}
676
Daniel Veillardb8478642001-10-12 17:29:10 +0000677#undef xmlParserVersion
678const char * *
679__xmlParserVersion(void) {
680 if (IS_MAIN_THREAD)
681 return (&xmlParserVersion);
682 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000683 return (&xmlGetGlobalState()->xmlParserVersion);
Daniel Veillardb8478642001-10-12 17:29:10 +0000684}
685
Daniel Veillardb8478642001-10-12 17:29:10 +0000686#undef xmlPedanticParserDefaultValue
687int *
688__xmlPedanticParserDefaultValue(void) {
689 if (IS_MAIN_THREAD)
690 return (&xmlPedanticParserDefaultValue);
691 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000692 return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000693}
694
Daniel Veillardb8478642001-10-12 17:29:10 +0000695#undef xmlSaveNoEmptyTags
696int *
697__xmlSaveNoEmptyTags(void) {
698 if (IS_MAIN_THREAD)
699 return (&xmlSaveNoEmptyTags);
700 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000701 return (&xmlGetGlobalState()->xmlSaveNoEmptyTags);
Daniel Veillardb8478642001-10-12 17:29:10 +0000702}
703
Daniel Veillardb8478642001-10-12 17:29:10 +0000704#undef xmlSubstituteEntitiesDefaultValue
705int *
706__xmlSubstituteEntitiesDefaultValue(void) {
707 if (IS_MAIN_THREAD)
708 return (&xmlSubstituteEntitiesDefaultValue);
709 else
Daniel Veillardd0463562001-10-13 09:15:48 +0000710 return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue);
Daniel Veillardb8478642001-10-12 17:29:10 +0000711}
Daniel Veillard5335dc52003-01-01 20:59:38 +0000712
713#undef xmlRegisterNodeDefaultValue
714xmlRegisterNodeFunc *
715__xmlRegisterNodeDefaultValue(void) {
716 if (IS_MAIN_THREAD)
717 return (&xmlRegisterNodeDefaultValue);
718 else
719 return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue);
720}
721
722#undef xmlDeregisterNodeDefaultValue
723xmlDeregisterNodeFunc *
724__xmlDeregisterNodeDefaultValue(void) {
725 if (IS_MAIN_THREAD)
726 return (&xmlDeregisterNodeDefaultValue);
727 else
728 return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue);
729}