Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 1 | /* |
| 2 | * globals.c: definition and handling of the set of global variables |
| 3 | * of the library |
| 4 | * |
| 5 | * The bottom of this file is automatically generated by build_glob.py |
| 6 | * based on the description file global.data |
| 7 | * |
| 8 | * See Copyright for the status of this software. |
| 9 | * |
| 10 | * Gary Pennington <Gary.Pennington@uk.sun.com> |
| 11 | * daniel@veillard.com |
| 12 | */ |
| 13 | |
| 14 | #include "libxml.h" |
| 15 | |
Daniel Veillard | e709061 | 2001-10-13 12:18:28 +0000 | [diff] [blame] | 16 | #ifdef HAVE_STDLIB_H |
Jaka Mocnik | 77d19ae | 2001-10-13 12:06:09 +0000 | [diff] [blame] | 17 | #include <stdlib.h> |
Daniel Veillard | e709061 | 2001-10-13 12:18:28 +0000 | [diff] [blame] | 18 | #endif |
Jaka Mocnik | 77d19ae | 2001-10-13 12:06:09 +0000 | [diff] [blame] | 19 | #include <string.h> |
| 20 | |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 21 | #include <libxml/globals.h> |
Daniel Veillard | e709061 | 2001-10-13 12:18:28 +0000 | [diff] [blame] | 22 | #include <libxml/xmlmemory.h> |
| 23 | |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 24 | /* #define DEBUG_GLOBALS */ |
| 25 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 26 | /* |
| 27 | * Helpful Macro |
| 28 | */ |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 29 | #ifdef LIBXML_THREAD_ENABLED |
| 30 | #define IS_MAIN_THREAD (xmlIsMainThread()) |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 31 | #else |
| 32 | #define IS_MAIN_THREAD 1 |
| 33 | #endif |
| 34 | |
| 35 | /************************************************************************ |
| 36 | * * |
| 37 | * All the user accessible global variables of the library * |
| 38 | * * |
| 39 | ************************************************************************/ |
| 40 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 41 | /* |
| 42 | * Memory allocation routines |
| 43 | */ |
| 44 | #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY) |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 45 | extern void xmlMemFree(void *ptr); |
| 46 | extern void * xmlMemMalloc(size_t size); |
| 47 | extern void * xmlMemRealloc(void *ptr,size_t size); |
| 48 | extern char * xmlMemoryStrdup(const char *str); |
| 49 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 50 | xmlFreeFunc xmlFree = (xmlFreeFunc) xmlMemFree; |
| 51 | xmlMallocFunc xmlMalloc = (xmlMallocFunc) xmlMemMalloc; |
| 52 | xmlReallocFunc xmlRealloc = (xmlReallocFunc) xmlMemRealloc; |
| 53 | xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup; |
| 54 | #else |
| 55 | xmlFreeFunc xmlFree = (xmlFreeFunc) free; |
| 56 | xmlMallocFunc xmlMalloc = (xmlMallocFunc) malloc; |
| 57 | xmlReallocFunc xmlRealloc = (xmlReallocFunc) realloc; |
Daniel Veillard | b82c166 | 2001-12-09 14:00:54 +0000 | [diff] [blame^] | 58 | xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlStrdup; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 59 | #endif |
| 60 | |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 61 | #include <libxml/threads.h> |
| 62 | #include <libxml/globals.h> |
| 63 | #include <libxml/SAX.h> |
| 64 | |
| 65 | #undef docbDefaultSAXHandler |
| 66 | #undef htmlDefaultSAXHandler |
| 67 | #undef oldXMLWDcompatibility |
| 68 | #undef xmlBufferAllocScheme |
| 69 | #undef xmlDefaultBufferSize |
| 70 | #undef xmlDefaultSAXHandler |
| 71 | #undef xmlDefaultSAXLocator |
| 72 | #undef xmlDoValidityCheckingDefaultValue |
| 73 | #undef xmlGenericError |
| 74 | #undef xmlGenericErrorContext |
| 75 | #undef xmlGetWarningsDefaultValue |
| 76 | #undef xmlIndentTreeOutput |
| 77 | #undef xmlKeepBlanksDefaultValue |
| 78 | #undef xmlLineNumbersDefaultValue |
| 79 | #undef xmlLoadExtDtdDefaultValue |
| 80 | #undef xmlParserDebugEntities |
| 81 | #undef xmlParserVersion |
| 82 | #undef xmlPedanticParserDefaultValue |
| 83 | #undef xmlSaveNoEmptyTags |
| 84 | #undef xmlSubstituteEntitiesDefaultValue |
| 85 | |
| 86 | #undef xmlFree |
| 87 | #undef xmlMalloc |
| 88 | #undef xmlMemStrdup |
| 89 | #undef xmlRealloc |
| 90 | |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 91 | const char *xmlParserVersion = LIBXML_VERSION_STRING; |
| 92 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 93 | /* |
| 94 | * Buffers stuff |
| 95 | */ |
| 96 | xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT; |
| 97 | int xmlDefaultBufferSize = BASE_BUFFER_SIZE; |
| 98 | |
| 99 | /* |
| 100 | * Parser defaults |
| 101 | */ |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 102 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 103 | int oldXMLWDcompatibility = 0; /* DEPRECATED */ |
| 104 | int xmlParserDebugEntities = 0; |
| 105 | int xmlDoValidityCheckingDefaultValue = 0; |
| 106 | int xmlGetWarningsDefaultValue = 1; |
| 107 | int xmlLoadExtDtdDefaultValue = 0; |
| 108 | int xmlPedanticParserDefaultValue = 0; |
| 109 | int xmlLineNumbersDefaultValue = 0; |
| 110 | int xmlKeepBlanksDefaultValue = 1; |
| 111 | int xmlSubstituteEntitiesDefaultValue = 0; |
| 112 | |
| 113 | /* |
| 114 | * Error handling |
| 115 | */ |
| 116 | |
| 117 | /* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */ |
| 118 | /* Must initialize xmlGenericError in xmlInitParser */ |
Daniel Veillard | 635ef72 | 2001-10-29 11:48:19 +0000 | [diff] [blame] | 119 | void xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED, |
| 120 | const char *msg, |
| 121 | ...); |
| 122 | xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 123 | void *xmlGenericErrorContext = NULL; |
| 124 | |
| 125 | /* |
| 126 | * output defaults |
| 127 | */ |
| 128 | int xmlIndentTreeOutput = 0; |
| 129 | int xmlSaveNoEmptyTags = 0; |
| 130 | |
| 131 | /* |
| 132 | * Default handler for XML, builds the DOM tree |
| 133 | */ |
| 134 | xmlSAXHandler xmlDefaultSAXHandler = { |
| 135 | internalSubset, |
| 136 | isStandalone, |
| 137 | hasInternalSubset, |
| 138 | hasExternalSubset, |
| 139 | resolveEntity, |
| 140 | getEntity, |
| 141 | entityDecl, |
| 142 | notationDecl, |
| 143 | attributeDecl, |
| 144 | elementDecl, |
| 145 | unparsedEntityDecl, |
| 146 | setDocumentLocator, |
| 147 | startDocument, |
| 148 | endDocument, |
| 149 | startElement, |
| 150 | endElement, |
| 151 | reference, |
| 152 | characters, |
| 153 | characters, |
| 154 | processingInstruction, |
| 155 | comment, |
| 156 | xmlParserWarning, |
| 157 | xmlParserError, |
| 158 | xmlParserError, |
| 159 | getParameterEntity, |
| 160 | cdataBlock, |
| 161 | externalSubset, |
| 162 | 0 |
| 163 | }; |
| 164 | |
| 165 | /* |
| 166 | * The default SAX Locator. |
| 167 | */ |
| 168 | |
| 169 | xmlSAXLocator xmlDefaultSAXLocator = { |
| 170 | getPublicId, getSystemId, getLineNumber, getColumnNumber |
| 171 | }; |
| 172 | |
| 173 | #ifdef LIBXML_HTML_ENABLED |
| 174 | /* |
| 175 | * Default handler for HTML, builds the DOM tree |
| 176 | */ |
| 177 | xmlSAXHandler htmlDefaultSAXHandler = { |
| 178 | internalSubset, |
| 179 | NULL, |
| 180 | NULL, |
| 181 | NULL, |
| 182 | NULL, |
| 183 | getEntity, |
| 184 | NULL, |
| 185 | NULL, |
| 186 | NULL, |
| 187 | NULL, |
| 188 | NULL, |
| 189 | setDocumentLocator, |
| 190 | startDocument, |
| 191 | endDocument, |
| 192 | startElement, |
| 193 | endElement, |
| 194 | NULL, |
| 195 | characters, |
| 196 | ignorableWhitespace, |
| 197 | NULL, |
| 198 | comment, |
| 199 | xmlParserWarning, |
| 200 | xmlParserError, |
| 201 | xmlParserError, |
| 202 | getParameterEntity, |
| 203 | cdataBlock, |
| 204 | NULL, |
| 205 | 0 |
| 206 | }; |
| 207 | #endif /* LIBXML_HTML_ENABLED */ |
| 208 | |
| 209 | #ifdef LIBXML_DOCB_ENABLED |
| 210 | /* |
| 211 | * Default handler for SGML DocBook, builds the DOM tree |
| 212 | */ |
| 213 | xmlSAXHandler docbDefaultSAXHandler = { |
| 214 | internalSubset, |
| 215 | isStandalone, |
| 216 | hasInternalSubset, |
| 217 | hasExternalSubset, |
| 218 | resolveEntity, |
| 219 | getEntity, |
| 220 | entityDecl, |
| 221 | NULL, |
| 222 | NULL, |
| 223 | NULL, |
| 224 | NULL, |
| 225 | setDocumentLocator, |
| 226 | startDocument, |
| 227 | endDocument, |
| 228 | startElement, |
| 229 | endElement, |
| 230 | reference, |
| 231 | characters, |
| 232 | ignorableWhitespace, |
| 233 | NULL, |
| 234 | comment, |
| 235 | xmlParserWarning, |
| 236 | xmlParserError, |
| 237 | xmlParserError, |
| 238 | getParameterEntity, |
| 239 | NULL, |
| 240 | NULL, |
| 241 | 0 |
| 242 | }; |
| 243 | #endif /* LIBXML_DOCB_ENABLED */ |
| 244 | |
| 245 | /** |
| 246 | * xmlInitializeGlobalState: |
| 247 | * @gs: a pointer to a newly allocated global state |
| 248 | * |
| 249 | * xmlInitializeGlobalState() initialize a global state with all the |
| 250 | * default values of the library. |
| 251 | */ |
| 252 | void |
| 253 | xmlInitializeGlobalState(xmlGlobalStatePtr gs) |
| 254 | { |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 255 | #ifdef DEBUG_GLOBALS |
| 256 | fprintf(stderr, "Initializing globals at %lu for thread %d\n", |
| 257 | (unsigned long) gs, xmlGetThreadId()); |
| 258 | #endif |
| 259 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 260 | /* |
| 261 | * Perform initialisation as required by libxml |
| 262 | */ |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 263 | initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1); |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 264 | #ifdef LIBXML_DOCB_ENABLED |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 265 | initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler); |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 266 | #endif |
| 267 | #ifdef LIBXML_HTML_ENABLED |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 268 | inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler); |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 269 | #endif |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 270 | initGenericErrorDefaultFunc(&gs->xmlGenericError); |
| 271 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 272 | gs->oldXMLWDcompatibility = 0; |
| 273 | gs->xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT; |
| 274 | gs->xmlDefaultBufferSize = BASE_BUFFER_SIZE; |
| 275 | initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1); |
| 276 | gs->xmlDefaultSAXLocator.getPublicId = getPublicId; |
| 277 | gs->xmlDefaultSAXLocator.getSystemId = getSystemId; |
| 278 | gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber; |
| 279 | gs->xmlDefaultSAXLocator.getColumnNumber = getColumnNumber; |
| 280 | gs->xmlDoValidityCheckingDefaultValue = 0; |
| 281 | #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY) |
| 282 | gs->xmlFree = (xmlFreeFunc) xmlMemFree; |
| 283 | gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc; |
| 284 | gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc; |
| 285 | gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup; |
| 286 | #else |
| 287 | gs->xmlFree = (xmlFreeFunc) free; |
| 288 | gs->xmlMalloc = (xmlMallocFunc) malloc; |
| 289 | gs->xmlRealloc = (xmlReallocFunc) realloc; |
| 290 | gs->xmlMemStrdup = (xmlStrdupFunc) strdup; |
| 291 | #endif |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 292 | gs->xmlGenericErrorContext = NULL; |
| 293 | gs->xmlGetWarningsDefaultValue = 1; |
| 294 | gs->xmlIndentTreeOutput = 0; |
| 295 | gs->xmlKeepBlanksDefaultValue = 1; |
| 296 | gs->xmlLineNumbersDefaultValue = 0; |
| 297 | gs->xmlLoadExtDtdDefaultValue = 0; |
| 298 | gs->xmlParserDebugEntities = 0; |
| 299 | gs->xmlParserVersion = LIBXML_VERSION_STRING; |
| 300 | gs->xmlPedanticParserDefaultValue = 0; |
| 301 | gs->xmlSaveNoEmptyTags = 0; |
| 302 | gs->xmlSubstituteEntitiesDefaultValue = 0; |
| 303 | } |
| 304 | |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 305 | #ifdef LIBXML_DOCB_ENABLED |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 306 | extern xmlSAXHandler docbDefaultSAXHandler; |
| 307 | #undef docbDefaultSAXHandler |
| 308 | xmlSAXHandler * |
| 309 | __docbDefaultSAXHandler(void) { |
| 310 | if (IS_MAIN_THREAD) |
| 311 | return (&docbDefaultSAXHandler); |
| 312 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 313 | return (&xmlGetGlobalState()->docbDefaultSAXHandler); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 314 | } |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 315 | #endif |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 316 | |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 317 | #ifdef LIBXML_HTML_ENABLED |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 318 | extern xmlSAXHandler htmlDefaultSAXHandler; |
| 319 | #undef htmlDefaultSAXHandler |
| 320 | xmlSAXHandler * |
| 321 | __htmlDefaultSAXHandler(void) { |
| 322 | if (IS_MAIN_THREAD) |
| 323 | return (&htmlDefaultSAXHandler); |
| 324 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 325 | return (&xmlGetGlobalState()->htmlDefaultSAXHandler); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 326 | } |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 327 | #endif |
| 328 | |
| 329 | /* |
| 330 | * Everything starting from the line below is |
| 331 | * Automatically generated by build_glob.py. |
| 332 | * Do not modify the previous line. |
| 333 | */ |
| 334 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 335 | |
| 336 | extern int oldXMLWDcompatibility; |
| 337 | #undef oldXMLWDcompatibility |
| 338 | int * |
| 339 | __oldXMLWDcompatibility(void) { |
| 340 | if (IS_MAIN_THREAD) |
| 341 | return (&oldXMLWDcompatibility); |
| 342 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 343 | return (&xmlGetGlobalState()->oldXMLWDcompatibility); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 344 | } |
| 345 | |
| 346 | extern xmlBufferAllocationScheme xmlBufferAllocScheme; |
| 347 | #undef xmlBufferAllocScheme |
| 348 | xmlBufferAllocationScheme * |
| 349 | __xmlBufferAllocScheme(void) { |
| 350 | if (IS_MAIN_THREAD) |
| 351 | return (&xmlBufferAllocScheme); |
| 352 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 353 | return (&xmlGetGlobalState()->xmlBufferAllocScheme); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 354 | } |
| 355 | |
| 356 | extern int xmlDefaultBufferSize; |
| 357 | #undef xmlDefaultBufferSize |
| 358 | int * |
| 359 | __xmlDefaultBufferSize(void) { |
| 360 | if (IS_MAIN_THREAD) |
| 361 | return (&xmlDefaultBufferSize); |
| 362 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 363 | return (&xmlGetGlobalState()->xmlDefaultBufferSize); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 364 | } |
| 365 | |
| 366 | extern xmlSAXHandler xmlDefaultSAXHandler; |
| 367 | #undef xmlDefaultSAXHandler |
| 368 | xmlSAXHandler * |
| 369 | __xmlDefaultSAXHandler(void) { |
| 370 | if (IS_MAIN_THREAD) |
| 371 | return (&xmlDefaultSAXHandler); |
| 372 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 373 | return (&xmlGetGlobalState()->xmlDefaultSAXHandler); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 374 | } |
| 375 | |
| 376 | extern xmlSAXLocator xmlDefaultSAXLocator; |
| 377 | #undef xmlDefaultSAXLocator |
| 378 | xmlSAXLocator * |
| 379 | __xmlDefaultSAXLocator(void) { |
| 380 | if (IS_MAIN_THREAD) |
| 381 | return (&xmlDefaultSAXLocator); |
| 382 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 383 | return (&xmlGetGlobalState()->xmlDefaultSAXLocator); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 384 | } |
| 385 | |
| 386 | extern int xmlDoValidityCheckingDefaultValue; |
| 387 | #undef xmlDoValidityCheckingDefaultValue |
| 388 | int * |
| 389 | __xmlDoValidityCheckingDefaultValue(void) { |
| 390 | if (IS_MAIN_THREAD) |
| 391 | return (&xmlDoValidityCheckingDefaultValue); |
| 392 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 393 | return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 394 | } |
| 395 | |
| 396 | extern xmlFreeFunc xmlFree; |
| 397 | #undef xmlFree |
| 398 | xmlFreeFunc * |
| 399 | __xmlFree(void) { |
| 400 | if (IS_MAIN_THREAD) |
| 401 | return (&xmlFree); |
| 402 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 403 | return (&xmlGetGlobalState()->xmlFree); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 404 | } |
| 405 | |
| 406 | extern xmlGenericErrorFunc xmlGenericError; |
| 407 | #undef xmlGenericError |
| 408 | xmlGenericErrorFunc * |
| 409 | __xmlGenericError(void) { |
| 410 | if (IS_MAIN_THREAD) |
| 411 | return (&xmlGenericError); |
| 412 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 413 | return (&xmlGetGlobalState()->xmlGenericError); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 414 | } |
| 415 | |
| 416 | extern void * xmlGenericErrorContext; |
| 417 | #undef xmlGenericErrorContext |
| 418 | void * * |
| 419 | __xmlGenericErrorContext(void) { |
| 420 | if (IS_MAIN_THREAD) |
| 421 | return (&xmlGenericErrorContext); |
| 422 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 423 | return (&xmlGetGlobalState()->xmlGenericErrorContext); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 424 | } |
| 425 | |
| 426 | extern int xmlGetWarningsDefaultValue; |
| 427 | #undef xmlGetWarningsDefaultValue |
| 428 | int * |
| 429 | __xmlGetWarningsDefaultValue(void) { |
| 430 | if (IS_MAIN_THREAD) |
| 431 | return (&xmlGetWarningsDefaultValue); |
| 432 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 433 | return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 434 | } |
| 435 | |
| 436 | extern int xmlIndentTreeOutput; |
| 437 | #undef xmlIndentTreeOutput |
| 438 | int * |
| 439 | __xmlIndentTreeOutput(void) { |
| 440 | if (IS_MAIN_THREAD) |
| 441 | return (&xmlIndentTreeOutput); |
| 442 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 443 | return (&xmlGetGlobalState()->xmlIndentTreeOutput); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 444 | } |
| 445 | |
| 446 | extern int xmlKeepBlanksDefaultValue; |
| 447 | #undef xmlKeepBlanksDefaultValue |
| 448 | int * |
| 449 | __xmlKeepBlanksDefaultValue(void) { |
| 450 | if (IS_MAIN_THREAD) |
| 451 | return (&xmlKeepBlanksDefaultValue); |
| 452 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 453 | return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 454 | } |
| 455 | |
| 456 | extern int xmlLineNumbersDefaultValue; |
| 457 | #undef xmlLineNumbersDefaultValue |
| 458 | int * |
| 459 | __xmlLineNumbersDefaultValue(void) { |
| 460 | if (IS_MAIN_THREAD) |
| 461 | return (&xmlLineNumbersDefaultValue); |
| 462 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 463 | return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 464 | } |
| 465 | |
| 466 | extern int xmlLoadExtDtdDefaultValue; |
| 467 | #undef xmlLoadExtDtdDefaultValue |
| 468 | int * |
| 469 | __xmlLoadExtDtdDefaultValue(void) { |
| 470 | if (IS_MAIN_THREAD) |
| 471 | return (&xmlLoadExtDtdDefaultValue); |
| 472 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 473 | return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 474 | } |
| 475 | |
| 476 | extern xmlMallocFunc xmlMalloc; |
| 477 | #undef xmlMalloc |
| 478 | xmlMallocFunc * |
| 479 | __xmlMalloc(void) { |
| 480 | if (IS_MAIN_THREAD) |
| 481 | return (&xmlMalloc); |
| 482 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 483 | return (&xmlGetGlobalState()->xmlMalloc); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 484 | } |
| 485 | |
| 486 | extern xmlStrdupFunc xmlMemStrdup; |
| 487 | #undef xmlMemStrdup |
| 488 | xmlStrdupFunc * |
| 489 | __xmlMemStrdup(void) { |
| 490 | if (IS_MAIN_THREAD) |
| 491 | return (&xmlMemStrdup); |
| 492 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 493 | return (&xmlGetGlobalState()->xmlMemStrdup); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 494 | } |
| 495 | |
| 496 | extern int xmlParserDebugEntities; |
| 497 | #undef xmlParserDebugEntities |
| 498 | int * |
| 499 | __xmlParserDebugEntities(void) { |
| 500 | if (IS_MAIN_THREAD) |
| 501 | return (&xmlParserDebugEntities); |
| 502 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 503 | return (&xmlGetGlobalState()->xmlParserDebugEntities); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 504 | } |
| 505 | |
| 506 | extern const char * xmlParserVersion; |
| 507 | #undef xmlParserVersion |
| 508 | const char * * |
| 509 | __xmlParserVersion(void) { |
| 510 | if (IS_MAIN_THREAD) |
| 511 | return (&xmlParserVersion); |
| 512 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 513 | return (&xmlGetGlobalState()->xmlParserVersion); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 514 | } |
| 515 | |
| 516 | extern int xmlPedanticParserDefaultValue; |
| 517 | #undef xmlPedanticParserDefaultValue |
| 518 | int * |
| 519 | __xmlPedanticParserDefaultValue(void) { |
| 520 | if (IS_MAIN_THREAD) |
| 521 | return (&xmlPedanticParserDefaultValue); |
| 522 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 523 | return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 524 | } |
| 525 | |
| 526 | extern xmlReallocFunc xmlRealloc; |
| 527 | #undef xmlRealloc |
| 528 | xmlReallocFunc * |
| 529 | __xmlRealloc(void) { |
| 530 | if (IS_MAIN_THREAD) |
| 531 | return (&xmlRealloc); |
| 532 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 533 | return (&xmlGetGlobalState()->xmlRealloc); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 534 | } |
| 535 | |
| 536 | extern int xmlSaveNoEmptyTags; |
| 537 | #undef xmlSaveNoEmptyTags |
| 538 | int * |
| 539 | __xmlSaveNoEmptyTags(void) { |
| 540 | if (IS_MAIN_THREAD) |
| 541 | return (&xmlSaveNoEmptyTags); |
| 542 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 543 | return (&xmlGetGlobalState()->xmlSaveNoEmptyTags); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 544 | } |
| 545 | |
| 546 | extern int xmlSubstituteEntitiesDefaultValue; |
| 547 | #undef xmlSubstituteEntitiesDefaultValue |
| 548 | int * |
| 549 | __xmlSubstituteEntitiesDefaultValue(void) { |
| 550 | if (IS_MAIN_THREAD) |
| 551 | return (&xmlSubstituteEntitiesDefaultValue); |
| 552 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 553 | return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 554 | } |