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