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 | e709061 | 2001-10-13 12:18:28 +0000 | [diff] [blame] | 21 | #include <libxml/xmlmemory.h> |
| 22 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 23 | /* |
| 24 | * Helpful Macro |
| 25 | */ |
| 26 | #ifdef WITH_PTHREAD_H |
| 27 | #if defined(SOLARIS) |
| 28 | #define THR_MAIN(tid) (-1 == thr_main() || tid == thr_main()) |
| 29 | #else |
| 30 | #define THR_MAIN(tid) (tid == 0 || tid == 1024) |
| 31 | #endif |
| 32 | |
| 33 | #define IS_MAIN_THREAD (THR_MAIN(pthread_self())) |
| 34 | #else |
| 35 | #define IS_MAIN_THREAD 1 |
| 36 | #endif |
| 37 | |
| 38 | /************************************************************************ |
| 39 | * * |
| 40 | * All the user accessible global variables of the library * |
| 41 | * * |
| 42 | ************************************************************************/ |
| 43 | |
| 44 | const char *xmlParserVersion = LIBXML_VERSION_STRING; |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 45 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 46 | /* |
| 47 | * Memory allocation routines |
| 48 | */ |
| 49 | #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY) |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 50 | extern void xmlMemFree(void *ptr); |
| 51 | extern void * xmlMemMalloc(size_t size); |
| 52 | extern void * xmlMemRealloc(void *ptr,size_t size); |
| 53 | extern char * xmlMemoryStrdup(const char *str); |
| 54 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 55 | xmlFreeFunc xmlFree = (xmlFreeFunc) xmlMemFree; |
| 56 | xmlMallocFunc xmlMalloc = (xmlMallocFunc) xmlMemMalloc; |
| 57 | xmlReallocFunc xmlRealloc = (xmlReallocFunc) xmlMemRealloc; |
| 58 | xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup; |
| 59 | #else |
| 60 | xmlFreeFunc xmlFree = (xmlFreeFunc) free; |
| 61 | xmlMallocFunc xmlMalloc = (xmlMallocFunc) malloc; |
| 62 | xmlReallocFunc xmlRealloc = (xmlReallocFunc) realloc; |
| 63 | xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) strdup; |
| 64 | #endif |
| 65 | |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 66 | #include <libxml/threads.h> |
| 67 | #include <libxml/globals.h> |
| 68 | #include <libxml/SAX.h> |
| 69 | |
| 70 | #undef docbDefaultSAXHandler |
| 71 | #undef htmlDefaultSAXHandler |
| 72 | #undef oldXMLWDcompatibility |
| 73 | #undef xmlBufferAllocScheme |
| 74 | #undef xmlDefaultBufferSize |
| 75 | #undef xmlDefaultSAXHandler |
| 76 | #undef xmlDefaultSAXLocator |
| 77 | #undef xmlDoValidityCheckingDefaultValue |
| 78 | #undef xmlGenericError |
| 79 | #undef xmlGenericErrorContext |
| 80 | #undef xmlGetWarningsDefaultValue |
| 81 | #undef xmlIndentTreeOutput |
| 82 | #undef xmlKeepBlanksDefaultValue |
| 83 | #undef xmlLineNumbersDefaultValue |
| 84 | #undef xmlLoadExtDtdDefaultValue |
| 85 | #undef xmlParserDebugEntities |
| 86 | #undef xmlParserVersion |
| 87 | #undef xmlPedanticParserDefaultValue |
| 88 | #undef xmlSaveNoEmptyTags |
| 89 | #undef xmlSubstituteEntitiesDefaultValue |
| 90 | |
| 91 | #undef xmlFree |
| 92 | #undef xmlMalloc |
| 93 | #undef xmlMemStrdup |
| 94 | #undef xmlRealloc |
| 95 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 96 | /* |
| 97 | * Buffers stuff |
| 98 | */ |
| 99 | xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT; |
| 100 | int xmlDefaultBufferSize = BASE_BUFFER_SIZE; |
| 101 | |
| 102 | /* |
| 103 | * Parser defaults |
| 104 | */ |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 105 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 106 | int oldXMLWDcompatibility = 0; /* DEPRECATED */ |
| 107 | int xmlParserDebugEntities = 0; |
| 108 | int xmlDoValidityCheckingDefaultValue = 0; |
| 109 | int xmlGetWarningsDefaultValue = 1; |
| 110 | int xmlLoadExtDtdDefaultValue = 0; |
| 111 | int xmlPedanticParserDefaultValue = 0; |
| 112 | int xmlLineNumbersDefaultValue = 0; |
| 113 | int xmlKeepBlanksDefaultValue = 1; |
| 114 | int xmlSubstituteEntitiesDefaultValue = 0; |
| 115 | |
| 116 | /* |
| 117 | * Error handling |
| 118 | */ |
| 119 | |
| 120 | /* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */ |
| 121 | /* Must initialize xmlGenericError in xmlInitParser */ |
| 122 | xmlGenericErrorFunc xmlGenericError; |
| 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 | { |
| 255 | /* |
| 256 | * Perform initialisation as required by libxml |
| 257 | */ |
| 258 | initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler); |
| 259 | inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler); |
| 260 | gs->oldXMLWDcompatibility = 0; |
| 261 | gs->xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT; |
| 262 | gs->xmlDefaultBufferSize = BASE_BUFFER_SIZE; |
| 263 | initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1); |
| 264 | gs->xmlDefaultSAXLocator.getPublicId = getPublicId; |
| 265 | gs->xmlDefaultSAXLocator.getSystemId = getSystemId; |
| 266 | gs->xmlDefaultSAXLocator.getLineNumber = getLineNumber; |
| 267 | gs->xmlDefaultSAXLocator.getColumnNumber = getColumnNumber; |
| 268 | gs->xmlDoValidityCheckingDefaultValue = 0; |
| 269 | #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY) |
| 270 | gs->xmlFree = (xmlFreeFunc) xmlMemFree; |
| 271 | gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc; |
| 272 | gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc; |
| 273 | gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup; |
| 274 | #else |
| 275 | gs->xmlFree = (xmlFreeFunc) free; |
| 276 | gs->xmlMalloc = (xmlMallocFunc) malloc; |
| 277 | gs->xmlRealloc = (xmlReallocFunc) realloc; |
| 278 | gs->xmlMemStrdup = (xmlStrdupFunc) strdup; |
| 279 | #endif |
| 280 | initGenericErrorDefaultFunc(&gs->xmlGenericError); |
| 281 | gs->xmlGenericErrorContext = NULL; |
| 282 | gs->xmlGetWarningsDefaultValue = 1; |
| 283 | gs->xmlIndentTreeOutput = 0; |
| 284 | gs->xmlKeepBlanksDefaultValue = 1; |
| 285 | gs->xmlLineNumbersDefaultValue = 0; |
| 286 | gs->xmlLoadExtDtdDefaultValue = 0; |
| 287 | gs->xmlParserDebugEntities = 0; |
| 288 | gs->xmlParserVersion = LIBXML_VERSION_STRING; |
| 289 | gs->xmlPedanticParserDefaultValue = 0; |
| 290 | gs->xmlSaveNoEmptyTags = 0; |
| 291 | gs->xmlSubstituteEntitiesDefaultValue = 0; |
| 292 | } |
| 293 | |
| 294 | /* |
| 295 | * Everything starting from the line below is |
| 296 | * Automatically generated by build_glob.py. |
| 297 | * Do not modify the previous line. |
| 298 | */ |
| 299 | |
| 300 | |
| 301 | extern xmlSAXHandler docbDefaultSAXHandler; |
| 302 | #undef docbDefaultSAXHandler |
| 303 | xmlSAXHandler * |
| 304 | __docbDefaultSAXHandler(void) { |
| 305 | if (IS_MAIN_THREAD) |
| 306 | return (&docbDefaultSAXHandler); |
| 307 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 308 | return (&xmlGetGlobalState()->docbDefaultSAXHandler); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 309 | } |
| 310 | |
| 311 | extern xmlSAXHandler htmlDefaultSAXHandler; |
| 312 | #undef htmlDefaultSAXHandler |
| 313 | xmlSAXHandler * |
| 314 | __htmlDefaultSAXHandler(void) { |
| 315 | if (IS_MAIN_THREAD) |
| 316 | return (&htmlDefaultSAXHandler); |
| 317 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 318 | return (&xmlGetGlobalState()->htmlDefaultSAXHandler); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 319 | } |
| 320 | |
| 321 | extern int oldXMLWDcompatibility; |
| 322 | #undef oldXMLWDcompatibility |
| 323 | int * |
| 324 | __oldXMLWDcompatibility(void) { |
| 325 | if (IS_MAIN_THREAD) |
| 326 | return (&oldXMLWDcompatibility); |
| 327 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 328 | return (&xmlGetGlobalState()->oldXMLWDcompatibility); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 329 | } |
| 330 | |
| 331 | extern xmlBufferAllocationScheme xmlBufferAllocScheme; |
| 332 | #undef xmlBufferAllocScheme |
| 333 | xmlBufferAllocationScheme * |
| 334 | __xmlBufferAllocScheme(void) { |
| 335 | if (IS_MAIN_THREAD) |
| 336 | return (&xmlBufferAllocScheme); |
| 337 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 338 | return (&xmlGetGlobalState()->xmlBufferAllocScheme); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 339 | } |
| 340 | |
| 341 | extern int xmlDefaultBufferSize; |
| 342 | #undef xmlDefaultBufferSize |
| 343 | int * |
| 344 | __xmlDefaultBufferSize(void) { |
| 345 | if (IS_MAIN_THREAD) |
| 346 | return (&xmlDefaultBufferSize); |
| 347 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 348 | return (&xmlGetGlobalState()->xmlDefaultBufferSize); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 349 | } |
| 350 | |
| 351 | extern xmlSAXHandler xmlDefaultSAXHandler; |
| 352 | #undef xmlDefaultSAXHandler |
| 353 | xmlSAXHandler * |
| 354 | __xmlDefaultSAXHandler(void) { |
| 355 | if (IS_MAIN_THREAD) |
| 356 | return (&xmlDefaultSAXHandler); |
| 357 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 358 | return (&xmlGetGlobalState()->xmlDefaultSAXHandler); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 359 | } |
| 360 | |
| 361 | extern xmlSAXLocator xmlDefaultSAXLocator; |
| 362 | #undef xmlDefaultSAXLocator |
| 363 | xmlSAXLocator * |
| 364 | __xmlDefaultSAXLocator(void) { |
| 365 | if (IS_MAIN_THREAD) |
| 366 | return (&xmlDefaultSAXLocator); |
| 367 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 368 | return (&xmlGetGlobalState()->xmlDefaultSAXLocator); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 369 | } |
| 370 | |
| 371 | extern int xmlDoValidityCheckingDefaultValue; |
| 372 | #undef xmlDoValidityCheckingDefaultValue |
| 373 | int * |
| 374 | __xmlDoValidityCheckingDefaultValue(void) { |
| 375 | if (IS_MAIN_THREAD) |
| 376 | return (&xmlDoValidityCheckingDefaultValue); |
| 377 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 378 | return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 379 | } |
| 380 | |
| 381 | extern xmlFreeFunc xmlFree; |
| 382 | #undef xmlFree |
| 383 | xmlFreeFunc * |
| 384 | __xmlFree(void) { |
| 385 | if (IS_MAIN_THREAD) |
| 386 | return (&xmlFree); |
| 387 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 388 | return (&xmlGetGlobalState()->xmlFree); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 389 | } |
| 390 | |
| 391 | extern xmlGenericErrorFunc xmlGenericError; |
| 392 | #undef xmlGenericError |
| 393 | xmlGenericErrorFunc * |
| 394 | __xmlGenericError(void) { |
| 395 | if (IS_MAIN_THREAD) |
| 396 | return (&xmlGenericError); |
| 397 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 398 | return (&xmlGetGlobalState()->xmlGenericError); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 399 | } |
| 400 | |
| 401 | extern void * xmlGenericErrorContext; |
| 402 | #undef xmlGenericErrorContext |
| 403 | void * * |
| 404 | __xmlGenericErrorContext(void) { |
| 405 | if (IS_MAIN_THREAD) |
| 406 | return (&xmlGenericErrorContext); |
| 407 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 408 | return (&xmlGetGlobalState()->xmlGenericErrorContext); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 409 | } |
| 410 | |
| 411 | extern int xmlGetWarningsDefaultValue; |
| 412 | #undef xmlGetWarningsDefaultValue |
| 413 | int * |
| 414 | __xmlGetWarningsDefaultValue(void) { |
| 415 | if (IS_MAIN_THREAD) |
| 416 | return (&xmlGetWarningsDefaultValue); |
| 417 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 418 | return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 419 | } |
| 420 | |
| 421 | extern int xmlIndentTreeOutput; |
| 422 | #undef xmlIndentTreeOutput |
| 423 | int * |
| 424 | __xmlIndentTreeOutput(void) { |
| 425 | if (IS_MAIN_THREAD) |
| 426 | return (&xmlIndentTreeOutput); |
| 427 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 428 | return (&xmlGetGlobalState()->xmlIndentTreeOutput); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 429 | } |
| 430 | |
| 431 | extern int xmlKeepBlanksDefaultValue; |
| 432 | #undef xmlKeepBlanksDefaultValue |
| 433 | int * |
| 434 | __xmlKeepBlanksDefaultValue(void) { |
| 435 | if (IS_MAIN_THREAD) |
| 436 | return (&xmlKeepBlanksDefaultValue); |
| 437 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 438 | return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 439 | } |
| 440 | |
| 441 | extern int xmlLineNumbersDefaultValue; |
| 442 | #undef xmlLineNumbersDefaultValue |
| 443 | int * |
| 444 | __xmlLineNumbersDefaultValue(void) { |
| 445 | if (IS_MAIN_THREAD) |
| 446 | return (&xmlLineNumbersDefaultValue); |
| 447 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 448 | return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 449 | } |
| 450 | |
| 451 | extern int xmlLoadExtDtdDefaultValue; |
| 452 | #undef xmlLoadExtDtdDefaultValue |
| 453 | int * |
| 454 | __xmlLoadExtDtdDefaultValue(void) { |
| 455 | if (IS_MAIN_THREAD) |
| 456 | return (&xmlLoadExtDtdDefaultValue); |
| 457 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 458 | return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 459 | } |
| 460 | |
| 461 | extern xmlMallocFunc xmlMalloc; |
| 462 | #undef xmlMalloc |
| 463 | xmlMallocFunc * |
| 464 | __xmlMalloc(void) { |
| 465 | if (IS_MAIN_THREAD) |
| 466 | return (&xmlMalloc); |
| 467 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 468 | return (&xmlGetGlobalState()->xmlMalloc); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 469 | } |
| 470 | |
| 471 | extern xmlStrdupFunc xmlMemStrdup; |
| 472 | #undef xmlMemStrdup |
| 473 | xmlStrdupFunc * |
| 474 | __xmlMemStrdup(void) { |
| 475 | if (IS_MAIN_THREAD) |
| 476 | return (&xmlMemStrdup); |
| 477 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 478 | return (&xmlGetGlobalState()->xmlMemStrdup); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 479 | } |
| 480 | |
| 481 | extern int xmlParserDebugEntities; |
| 482 | #undef xmlParserDebugEntities |
| 483 | int * |
| 484 | __xmlParserDebugEntities(void) { |
| 485 | if (IS_MAIN_THREAD) |
| 486 | return (&xmlParserDebugEntities); |
| 487 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 488 | return (&xmlGetGlobalState()->xmlParserDebugEntities); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 489 | } |
| 490 | |
| 491 | extern const char * xmlParserVersion; |
| 492 | #undef xmlParserVersion |
| 493 | const char * * |
| 494 | __xmlParserVersion(void) { |
| 495 | if (IS_MAIN_THREAD) |
| 496 | return (&xmlParserVersion); |
| 497 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 498 | return (&xmlGetGlobalState()->xmlParserVersion); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 499 | } |
| 500 | |
| 501 | extern int xmlPedanticParserDefaultValue; |
| 502 | #undef xmlPedanticParserDefaultValue |
| 503 | int * |
| 504 | __xmlPedanticParserDefaultValue(void) { |
| 505 | if (IS_MAIN_THREAD) |
| 506 | return (&xmlPedanticParserDefaultValue); |
| 507 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 508 | return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 509 | } |
| 510 | |
| 511 | extern xmlReallocFunc xmlRealloc; |
| 512 | #undef xmlRealloc |
| 513 | xmlReallocFunc * |
| 514 | __xmlRealloc(void) { |
| 515 | if (IS_MAIN_THREAD) |
| 516 | return (&xmlRealloc); |
| 517 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 518 | return (&xmlGetGlobalState()->xmlRealloc); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 519 | } |
| 520 | |
| 521 | extern int xmlSaveNoEmptyTags; |
| 522 | #undef xmlSaveNoEmptyTags |
| 523 | int * |
| 524 | __xmlSaveNoEmptyTags(void) { |
| 525 | if (IS_MAIN_THREAD) |
| 526 | return (&xmlSaveNoEmptyTags); |
| 527 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 528 | return (&xmlGetGlobalState()->xmlSaveNoEmptyTags); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 529 | } |
| 530 | |
| 531 | extern int xmlSubstituteEntitiesDefaultValue; |
| 532 | #undef xmlSubstituteEntitiesDefaultValue |
| 533 | int * |
| 534 | __xmlSubstituteEntitiesDefaultValue(void) { |
| 535 | if (IS_MAIN_THREAD) |
| 536 | return (&xmlSubstituteEntitiesDefaultValue); |
| 537 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 538 | return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 539 | } |