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