blob: f1e46a9f225cea87a188a376ecced9af3b8a23f3 [file] [log] [blame]
Daniel Veillardb8478642001-10-12 17:29:10 +00001/*
2 * globals.h: interface for all global variables of the library
3 *
4 * The bottom of this file is automatically generated by build_glob.py
5 * based on the description file global.data
6 *
7 * See Copyright for the status of this software.
8 *
9 * Gary Pennington <Gary.Pennington@uk.sun.com>
10 * daniel@veillard.com
11 */
12
13#ifndef __XML_GLOBALS_H
14#define __XML_GLOBALS_H
15
16#include <libxml/parser.h>
17#include <libxml/xmlerror.h>
18#include <libxml/SAX.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/*
25 * Externally global symbols which need to be protected for backwards
26 * compatibility support.
27 */
Daniel Veillardd0463562001-10-13 09:15:48 +000028
Daniel Veillardb8478642001-10-12 17:29:10 +000029#undef docbDefaultSAXHandler
30#undef htmlDefaultSAXHandler
31#undef oldXMLWDcompatibility
32#undef xmlBufferAllocScheme
33#undef xmlDefaultBufferSize
34#undef xmlDefaultSAXHandler
35#undef xmlDefaultSAXLocator
36#undef xmlDoValidityCheckingDefaultValue
37#undef xmlFree
38#undef xmlGenericError
39#undef xmlGenericErrorContext
40#undef xmlGetWarningsDefaultValue
41#undef xmlIndentTreeOutput
42#undef xmlKeepBlanksDefaultValue
43#undef xmlLineNumbersDefaultValue
44#undef xmlLoadExtDtdDefaultValue
45#undef xmlMalloc
46#undef xmlMemStrdup
47#undef xmlParserDebugEntities
48#undef xmlParserVersion
49#undef xmlPedanticParserDefaultValue
50#undef xmlRealloc
51#undef xmlSaveNoEmptyTags
Daniel Veillardb8478642001-10-12 17:29:10 +000052#undef xmlSubstituteEntitiesDefaultValue
53
54typedef struct _xmlGlobalState xmlGlobalState;
55typedef xmlGlobalState *xmlGlobalStatePtr;
56struct _xmlGlobalState
57{
Daniel Veillardd0463562001-10-13 09:15:48 +000058 const char *xmlParserVersion;
59
Daniel Veillardb8478642001-10-12 17:29:10 +000060 xmlFreeFunc xmlFree;
Daniel Veillardd0463562001-10-13 09:15:48 +000061 xmlMallocFunc xmlMalloc;
62 xmlStrdupFunc xmlMemStrdup;
63 xmlReallocFunc xmlRealloc;
64
Daniel Veillardb8478642001-10-12 17:29:10 +000065 xmlGenericErrorFunc xmlGenericError;
66 void *xmlGenericErrorContext;
Daniel Veillardd0463562001-10-13 09:15:48 +000067
68 xmlSAXLocator xmlDefaultSAXLocator;
69 xmlSAXHandler xmlDefaultSAXHandler;
70 xmlSAXHandler docbDefaultSAXHandler;
71 xmlSAXHandler htmlDefaultSAXHandler;
72
73 int oldXMLWDcompatibility;
74
75 xmlBufferAllocationScheme xmlBufferAllocScheme;
76 int xmlDefaultBufferSize;
77
78 int xmlSubstituteEntitiesDefaultValue;
79 int xmlDoValidityCheckingDefaultValue;
Daniel Veillardb8478642001-10-12 17:29:10 +000080 int xmlGetWarningsDefaultValue;
Daniel Veillardb8478642001-10-12 17:29:10 +000081 int xmlKeepBlanksDefaultValue;
82 int xmlLineNumbersDefaultValue;
83 int xmlLoadExtDtdDefaultValue;
Daniel Veillardb8478642001-10-12 17:29:10 +000084 int xmlParserDebugEntities;
Daniel Veillardb8478642001-10-12 17:29:10 +000085 int xmlPedanticParserDefaultValue;
Daniel Veillardd0463562001-10-13 09:15:48 +000086
Daniel Veillardb8478642001-10-12 17:29:10 +000087 int xmlSaveNoEmptyTags;
Daniel Veillardd0463562001-10-13 09:15:48 +000088 int xmlIndentTreeOutput;
Daniel Veillardb8478642001-10-12 17:29:10 +000089};
90
91void xmlInitializeGlobalState(xmlGlobalStatePtr gs);
92
93/*
Daniel Veillard64a411c2001-10-15 12:32:07 +000094 * In general the memory allocation entry points are not kept
95 * thread specific but this can be overriden by LIBXML_THREAD_ALLOC_ENABLED
96 * - xmlMalloc
97 * - xmlRealloc
98 * - xmlMemStrdup
99 * - xmlFree
100 */
101
102#ifdef LIBXML_THREAD_ALLOC_ENABLED
103#ifdef LIBXML_THREAD_ENABLED
104extern xmlMallocFunc *__xmlMalloc(void);
105#define xmlMalloc \
106(*(__xmlMalloc()))
107#else
108LIBXML_DLL_IMPORT extern xmlMallocFunc xmlMalloc;
109#endif
110
111#ifdef LIBXML_THREAD_ENABLED
112extern xmlReallocFunc *__xmlRealloc(void);
113#define xmlRealloc \
114(*(__xmlRealloc()))
115#else
116LIBXML_DLL_IMPORT extern xmlReallocFunc xmlRealloc;
117#endif
118
119#ifdef LIBXML_THREAD_ENABLED
120extern xmlFreeFunc *__xmlFree(void);
121#define xmlFree \
122(*(__xmlFree()))
123#else
124LIBXML_DLL_IMPORT extern xmlFreeFunc xmlFree;
125#endif
126
127#ifdef LIBXML_THREAD_ENABLED
128extern xmlStrdupFunc *__xmlMemStrdup(void);
129#define xmlMemStrdup \
130(*(__xmlMemStrdup()))
131#else
132LIBXML_DLL_IMPORT extern xmlStrdupFunc xmlMemStrdup;
133#endif
134#else /* !LIBXML_THREAD_ALLOC_ENABLED */
135LIBXML_DLL_IMPORT extern xmlMallocFunc xmlMalloc;
136LIBXML_DLL_IMPORT extern xmlReallocFunc xmlRealloc;
137LIBXML_DLL_IMPORT extern xmlFreeFunc xmlFree;
138LIBXML_DLL_IMPORT extern xmlStrdupFunc xmlMemStrdup;
139#endif /* LIBXML_THREAD_ALLOC_ENABLED */
140
141/*
Daniel Veillardb8478642001-10-12 17:29:10 +0000142 * Everything starting from the line below is
143 * Automatically generated by build_glob.py.
144 * Do not modify the previous line.
145 */
146
147
148#ifdef LIBXML_THREAD_ENABLED
149extern xmlSAXHandler *__docbDefaultSAXHandler(void);
150#define docbDefaultSAXHandler \
151(*(__docbDefaultSAXHandler()))
152#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000153LIBXML_DLL_IMPORT extern xmlSAXHandler docbDefaultSAXHandler;
Daniel Veillardb8478642001-10-12 17:29:10 +0000154#endif
155
156#ifdef LIBXML_THREAD_ENABLED
157extern xmlSAXHandler *__htmlDefaultSAXHandler(void);
158#define htmlDefaultSAXHandler \
159(*(__htmlDefaultSAXHandler()))
160#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000161LIBXML_DLL_IMPORT extern xmlSAXHandler htmlDefaultSAXHandler;
Daniel Veillardb8478642001-10-12 17:29:10 +0000162#endif
163
164#ifdef LIBXML_THREAD_ENABLED
165extern int *__oldXMLWDcompatibility(void);
166#define oldXMLWDcompatibility \
167(*(__oldXMLWDcompatibility()))
168#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000169LIBXML_DLL_IMPORT extern int oldXMLWDcompatibility;
Daniel Veillardb8478642001-10-12 17:29:10 +0000170#endif
171
172#ifdef LIBXML_THREAD_ENABLED
173extern xmlBufferAllocationScheme *__xmlBufferAllocScheme(void);
174#define xmlBufferAllocScheme \
175(*(__xmlBufferAllocScheme()))
176#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000177LIBXML_DLL_IMPORT extern xmlBufferAllocationScheme xmlBufferAllocScheme;
Daniel Veillardb8478642001-10-12 17:29:10 +0000178#endif
179
180#ifdef LIBXML_THREAD_ENABLED
181extern int *__xmlDefaultBufferSize(void);
182#define xmlDefaultBufferSize \
183(*(__xmlDefaultBufferSize()))
184#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000185LIBXML_DLL_IMPORT extern int xmlDefaultBufferSize;
Daniel Veillardb8478642001-10-12 17:29:10 +0000186#endif
187
188#ifdef LIBXML_THREAD_ENABLED
189extern xmlSAXHandler *__xmlDefaultSAXHandler(void);
190#define xmlDefaultSAXHandler \
191(*(__xmlDefaultSAXHandler()))
192#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000193LIBXML_DLL_IMPORT extern xmlSAXHandler xmlDefaultSAXHandler;
Daniel Veillardb8478642001-10-12 17:29:10 +0000194#endif
195
196#ifdef LIBXML_THREAD_ENABLED
197extern xmlSAXLocator *__xmlDefaultSAXLocator(void);
198#define xmlDefaultSAXLocator \
199(*(__xmlDefaultSAXLocator()))
200#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000201LIBXML_DLL_IMPORT extern xmlSAXLocator xmlDefaultSAXLocator;
Daniel Veillardb8478642001-10-12 17:29:10 +0000202#endif
203
204#ifdef LIBXML_THREAD_ENABLED
205extern int *__xmlDoValidityCheckingDefaultValue(void);
206#define xmlDoValidityCheckingDefaultValue \
207(*(__xmlDoValidityCheckingDefaultValue()))
208#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000209LIBXML_DLL_IMPORT extern int xmlDoValidityCheckingDefaultValue;
Daniel Veillardb8478642001-10-12 17:29:10 +0000210#endif
211
212#ifdef LIBXML_THREAD_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000213extern xmlGenericErrorFunc *__xmlGenericError(void);
214#define xmlGenericError \
215(*(__xmlGenericError()))
216#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000217LIBXML_DLL_IMPORT extern xmlGenericErrorFunc xmlGenericError;
Daniel Veillardb8478642001-10-12 17:29:10 +0000218#endif
219
220#ifdef LIBXML_THREAD_ENABLED
221extern void * *__xmlGenericErrorContext(void);
222#define xmlGenericErrorContext \
223(*(__xmlGenericErrorContext()))
224#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000225LIBXML_DLL_IMPORT extern void * xmlGenericErrorContext;
Daniel Veillardb8478642001-10-12 17:29:10 +0000226#endif
227
228#ifdef LIBXML_THREAD_ENABLED
229extern int *__xmlGetWarningsDefaultValue(void);
230#define xmlGetWarningsDefaultValue \
231(*(__xmlGetWarningsDefaultValue()))
232#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000233LIBXML_DLL_IMPORT extern int xmlGetWarningsDefaultValue;
Daniel Veillardb8478642001-10-12 17:29:10 +0000234#endif
235
236#ifdef LIBXML_THREAD_ENABLED
237extern int *__xmlIndentTreeOutput(void);
238#define xmlIndentTreeOutput \
239(*(__xmlIndentTreeOutput()))
240#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000241LIBXML_DLL_IMPORT extern int xmlIndentTreeOutput;
Daniel Veillardb8478642001-10-12 17:29:10 +0000242#endif
243
244#ifdef LIBXML_THREAD_ENABLED
245extern int *__xmlKeepBlanksDefaultValue(void);
246#define xmlKeepBlanksDefaultValue \
247(*(__xmlKeepBlanksDefaultValue()))
248#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000249LIBXML_DLL_IMPORT extern int xmlKeepBlanksDefaultValue;
Daniel Veillardb8478642001-10-12 17:29:10 +0000250#endif
251
252#ifdef LIBXML_THREAD_ENABLED
253extern int *__xmlLineNumbersDefaultValue(void);
254#define xmlLineNumbersDefaultValue \
255(*(__xmlLineNumbersDefaultValue()))
256#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000257LIBXML_DLL_IMPORT extern int xmlLineNumbersDefaultValue;
Daniel Veillardb8478642001-10-12 17:29:10 +0000258#endif
259
260#ifdef LIBXML_THREAD_ENABLED
261extern int *__xmlLoadExtDtdDefaultValue(void);
262#define xmlLoadExtDtdDefaultValue \
263(*(__xmlLoadExtDtdDefaultValue()))
264#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000265LIBXML_DLL_IMPORT extern int xmlLoadExtDtdDefaultValue;
Daniel Veillardb8478642001-10-12 17:29:10 +0000266#endif
267
268#ifdef LIBXML_THREAD_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000269extern int *__xmlParserDebugEntities(void);
270#define xmlParserDebugEntities \
271(*(__xmlParserDebugEntities()))
272#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000273LIBXML_DLL_IMPORT extern int xmlParserDebugEntities;
Daniel Veillardb8478642001-10-12 17:29:10 +0000274#endif
275
276#ifdef LIBXML_THREAD_ENABLED
277extern const char * *__xmlParserVersion(void);
278#define xmlParserVersion \
279(*(__xmlParserVersion()))
280#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000281LIBXML_DLL_IMPORT extern const char * xmlParserVersion;
Daniel Veillardb8478642001-10-12 17:29:10 +0000282#endif
283
284#ifdef LIBXML_THREAD_ENABLED
285extern int *__xmlPedanticParserDefaultValue(void);
286#define xmlPedanticParserDefaultValue \
287(*(__xmlPedanticParserDefaultValue()))
288#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000289LIBXML_DLL_IMPORT extern int xmlPedanticParserDefaultValue;
Daniel Veillardb8478642001-10-12 17:29:10 +0000290#endif
291
292#ifdef LIBXML_THREAD_ENABLED
Daniel Veillardb8478642001-10-12 17:29:10 +0000293extern int *__xmlSaveNoEmptyTags(void);
294#define xmlSaveNoEmptyTags \
295(*(__xmlSaveNoEmptyTags()))
296#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000297LIBXML_DLL_IMPORT extern int xmlSaveNoEmptyTags;
Daniel Veillardb8478642001-10-12 17:29:10 +0000298#endif
299
300#ifdef LIBXML_THREAD_ENABLED
301extern int *__xmlSubstituteEntitiesDefaultValue(void);
302#define xmlSubstituteEntitiesDefaultValue \
303(*(__xmlSubstituteEntitiesDefaultValue()))
304#else
Daniel Veillardd0463562001-10-13 09:15:48 +0000305LIBXML_DLL_IMPORT extern int xmlSubstituteEntitiesDefaultValue;
Daniel Veillardb8478642001-10-12 17:29:10 +0000306#endif
307
308#ifdef __cplusplus
309}
310#endif
311
312#endif /* __XML_GLOBALS_H */