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