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 | |
Daniel Veillard | 34ce8be | 2002-03-18 19:37:11 +0000 | [diff] [blame] | 14 | #define IN_LIBXML |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 15 | #include "libxml.h" |
| 16 | |
Daniel Veillard | e709061 | 2001-10-13 12:18:28 +0000 | [diff] [blame] | 17 | #ifdef HAVE_STDLIB_H |
Jaka Mocnik | 77d19ae | 2001-10-13 12:06:09 +0000 | [diff] [blame] | 18 | #include <stdlib.h> |
Daniel Veillard | e709061 | 2001-10-13 12:18:28 +0000 | [diff] [blame] | 19 | #endif |
Jaka Mocnik | 77d19ae | 2001-10-13 12:06:09 +0000 | [diff] [blame] | 20 | #include <string.h> |
| 21 | |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 22 | #include <libxml/globals.h> |
Daniel Veillard | e709061 | 2001-10-13 12:18:28 +0000 | [diff] [blame] | 23 | #include <libxml/xmlmemory.h> |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 24 | #include <libxml/threads.h> |
Daniel Veillard | e709061 | 2001-10-13 12:18:28 +0000 | [diff] [blame] | 25 | |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 26 | /* #define DEBUG_GLOBALS */ |
| 27 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 28 | /* |
| 29 | * Helpful Macro |
| 30 | */ |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 31 | #ifdef LIBXML_THREAD_ENABLED |
| 32 | #define IS_MAIN_THREAD (xmlIsMainThread()) |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 33 | #else |
| 34 | #define IS_MAIN_THREAD 1 |
| 35 | #endif |
| 36 | |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 37 | /* |
| 38 | * Mutex to protect "ForNewThreads" variables |
| 39 | */ |
| 40 | static xmlMutexPtr xmlThrDefMutex = NULL; |
| 41 | |
| 42 | void xmlInitGlobals() |
| 43 | { |
| 44 | xmlThrDefMutex = xmlNewMutex(); |
| 45 | } |
| 46 | |
| 47 | void xmlCleanupGlobals() |
| 48 | { |
Daniel Veillard | 2009c4e | 2003-07-15 20:04:34 +0000 | [diff] [blame] | 49 | if (xmlThrDefMutex != NULL) { |
Daniel Veillard | df101d8 | 2003-07-08 14:03:36 +0000 | [diff] [blame] | 50 | xmlFreeMutex(xmlThrDefMutex); |
Daniel Veillard | 2009c4e | 2003-07-15 20:04:34 +0000 | [diff] [blame] | 51 | xmlThrDefMutex = NULL; |
| 52 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 53 | } |
| 54 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 55 | /************************************************************************ |
| 56 | * * |
| 57 | * All the user accessible global variables of the library * |
| 58 | * * |
| 59 | ************************************************************************/ |
| 60 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 61 | /* |
| 62 | * Memory allocation routines |
| 63 | */ |
Daniel Veillard | 7216cfd | 2002-11-08 15:10:00 +0000 | [diff] [blame] | 64 | #if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY) |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 65 | #ifndef __DEBUG_MEMORY_ALLOC__ |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 66 | extern void xmlMemFree(void *ptr); |
| 67 | extern void * xmlMemMalloc(size_t size); |
| 68 | extern void * xmlMemRealloc(void *ptr,size_t size); |
| 69 | extern char * xmlMemoryStrdup(const char *str); |
Daniel Veillard | 9848532 | 2003-08-14 15:44:40 +0000 | [diff] [blame] | 70 | #endif |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 71 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 72 | xmlFreeFunc xmlFree = (xmlFreeFunc) xmlMemFree; |
| 73 | xmlMallocFunc xmlMalloc = (xmlMallocFunc) xmlMemMalloc; |
Daniel Veillard | 3c908dc | 2003-04-19 00:07:51 +0000 | [diff] [blame] | 74 | xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 75 | xmlReallocFunc xmlRealloc = (xmlReallocFunc) xmlMemRealloc; |
| 76 | xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup; |
| 77 | #else |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 78 | /** |
| 79 | * xmlFree: |
| 80 | * @mem: an already allocated block of memory |
| 81 | * |
| 82 | * The variable holding the libxml free() implementation |
| 83 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 84 | xmlFreeFunc xmlFree = (xmlFreeFunc) free; |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 85 | /** |
| 86 | * xmlMalloc: |
| 87 | * @size: the size requested in bytes |
| 88 | * |
| 89 | * The variable holding the libxml malloc() implementation |
| 90 | * |
| 91 | * Returns a pointer to the newly allocated block or NULL in case of error |
| 92 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 93 | xmlMallocFunc xmlMalloc = (xmlMallocFunc) malloc; |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 94 | /** |
Daniel Veillard | 3c908dc | 2003-04-19 00:07:51 +0000 | [diff] [blame] | 95 | * xmlMallocAtomic: |
| 96 | * @size: the size requested in bytes |
| 97 | * |
| 98 | * The variable holding the libxml malloc() implementation for atomic |
| 99 | * data (i.e. blocks not containings pointers), useful when using a |
| 100 | * garbage collecting allocator. |
| 101 | * |
| 102 | * Returns a pointer to the newly allocated block or NULL in case of error |
| 103 | */ |
| 104 | xmlMallocFunc xmlMallocAtomic = (xmlMallocFunc) malloc; |
| 105 | /** |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 106 | * xmlRealloc: |
| 107 | * @mem: an already allocated block of memory |
| 108 | * @size: the new size requested in bytes |
| 109 | * |
| 110 | * The variable holding the libxml realloc() implementation |
| 111 | * |
| 112 | * Returns a pointer to the newly reallocated block or NULL in case of error |
| 113 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 114 | xmlReallocFunc xmlRealloc = (xmlReallocFunc) realloc; |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 115 | /** |
| 116 | * xmlMemStrdup: |
| 117 | * @str: a zero terminated string |
| 118 | * |
| 119 | * The variable holding the libxml strdup() implementation |
| 120 | * |
| 121 | * Returns the copy of the string or NULL in case of error |
| 122 | */ |
Daniel Veillard | b82c166 | 2001-12-09 14:00:54 +0000 | [diff] [blame] | 123 | xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlStrdup; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 124 | #endif |
| 125 | |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 126 | #include <libxml/threads.h> |
| 127 | #include <libxml/globals.h> |
| 128 | #include <libxml/SAX.h> |
| 129 | |
| 130 | #undef docbDefaultSAXHandler |
| 131 | #undef htmlDefaultSAXHandler |
| 132 | #undef oldXMLWDcompatibility |
| 133 | #undef xmlBufferAllocScheme |
| 134 | #undef xmlDefaultBufferSize |
| 135 | #undef xmlDefaultSAXHandler |
| 136 | #undef xmlDefaultSAXLocator |
| 137 | #undef xmlDoValidityCheckingDefaultValue |
| 138 | #undef xmlGenericError |
| 139 | #undef xmlGenericErrorContext |
| 140 | #undef xmlGetWarningsDefaultValue |
| 141 | #undef xmlIndentTreeOutput |
Aleksey Sanin | 2300256 | 2002-05-24 07:18:40 +0000 | [diff] [blame] | 142 | #undef xmlTreeIndentString |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 143 | #undef xmlKeepBlanksDefaultValue |
| 144 | #undef xmlLineNumbersDefaultValue |
| 145 | #undef xmlLoadExtDtdDefaultValue |
| 146 | #undef xmlParserDebugEntities |
| 147 | #undef xmlParserVersion |
| 148 | #undef xmlPedanticParserDefaultValue |
| 149 | #undef xmlSaveNoEmptyTags |
| 150 | #undef xmlSubstituteEntitiesDefaultValue |
Daniel Veillard | 8326e73 | 2003-01-07 00:19:07 +0000 | [diff] [blame] | 151 | #undef xmlRegisterNodeDefaultValue |
| 152 | #undef xmlDeregisterNodeDefaultValue |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 153 | |
| 154 | #undef xmlFree |
| 155 | #undef xmlMalloc |
Daniel Veillard | 3c908dc | 2003-04-19 00:07:51 +0000 | [diff] [blame] | 156 | #undef xmlMallocAtomic |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 157 | #undef xmlMemStrdup |
| 158 | #undef xmlRealloc |
| 159 | |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 160 | /** |
| 161 | * xmlParserVersion: |
| 162 | * |
| 163 | * Constant string describing the internal version of the library |
| 164 | */ |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 165 | const char *xmlParserVersion = LIBXML_VERSION_STRING; |
| 166 | |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 167 | /** |
| 168 | * xmlBufferAllocScheme: |
| 169 | * |
| 170 | * Global setting, default allocation policy for buffers, default is |
| 171 | * XML_BUFFER_ALLOC_EXACT |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 172 | */ |
| 173 | xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 174 | static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef = XML_BUFFER_ALLOC_EXACT; |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 175 | /** |
| 176 | * xmlDefaultBufferSize: |
| 177 | * |
| 178 | * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE |
| 179 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 180 | int xmlDefaultBufferSize = BASE_BUFFER_SIZE; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 181 | static int xmlDefaultBufferSizeThrDef = BASE_BUFFER_SIZE; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 182 | |
| 183 | /* |
| 184 | * Parser defaults |
| 185 | */ |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 186 | |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 187 | /** |
| 188 | * oldXMLWDcompatibility: |
| 189 | * |
| 190 | * Global setting, DEPRECATED. |
| 191 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 192 | int oldXMLWDcompatibility = 0; /* DEPRECATED */ |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 193 | /** |
| 194 | * xmlParserDebugEntities: |
| 195 | * |
| 196 | * Global setting, asking the parser to print out debugging informations. |
| 197 | * while handling entities. |
| 198 | * Disabled by default |
| 199 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 200 | int xmlParserDebugEntities = 0; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 201 | static int xmlParserDebugEntitiesThrDef = 0; |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 202 | /** |
| 203 | * xmlDoValidityCheckingDefaultValue: |
| 204 | * |
| 205 | * Global setting, indicate that the parser should work in validating mode. |
| 206 | * Disabled by default. |
| 207 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 208 | int xmlDoValidityCheckingDefaultValue = 0; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 209 | static int xmlDoValidityCheckingDefaultValueThrDef = 0; |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 210 | /** |
| 211 | * xmlGetWarningsDefaultValue: |
| 212 | * |
| 213 | * Global setting, indicate that the parser should provide warnings. |
| 214 | * Activated by default. |
| 215 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 216 | int xmlGetWarningsDefaultValue = 1; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 217 | static int xmlGetWarningsDefaultValueThrDef = 1; |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 218 | /** |
| 219 | * xmlLoadExtDtdDefaultValue: |
| 220 | * |
| 221 | * Global setting, indicate that the parser should load DTD while not |
| 222 | * validating. |
| 223 | * Disabled by default. |
| 224 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 225 | int xmlLoadExtDtdDefaultValue = 0; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 226 | static int xmlLoadExtDtdDefaultValueThrDef = 0; |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 227 | /** |
| 228 | * xmlPedanticParserDefaultValue: |
| 229 | * |
| 230 | * Global setting, indicate that the parser be pedantic |
| 231 | * Disabled by default. |
| 232 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 233 | int xmlPedanticParserDefaultValue = 0; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 234 | static int xmlPedanticParserDefaultValueThrDef = 0; |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 235 | /** |
| 236 | * xmlLineNumbersDefaultValue: |
| 237 | * |
| 238 | * Global setting, indicate that the parser should store the line number |
| 239 | * in the content field of elements in the DOM tree. |
| 240 | * Disabled by default since this may not be safe for old classes of |
| 241 | * applicaton. |
| 242 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 243 | int xmlLineNumbersDefaultValue = 0; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 244 | static int xmlLineNumbersDefaultValueThrDef = 0; |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 245 | /** |
| 246 | * xmlKeepBlanksDefaultValue: |
| 247 | * |
| 248 | * Global setting, indicate that the parser should keep all blanks |
| 249 | * nodes found in the content |
| 250 | * Activated by default, this is actually needed to have the parser |
| 251 | * conformant to the XML Recommendation, however the option is kept |
| 252 | * for some applications since this was libxml1 default behaviour. |
| 253 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 254 | int xmlKeepBlanksDefaultValue = 1; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 255 | static int xmlKeepBlanksDefaultValueThrDef = 1; |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 256 | /** |
| 257 | * xmlSubstituteEntitiesDefaultValue: |
| 258 | * |
| 259 | * Global setting, indicate that the parser should not generate entity |
| 260 | * references but replace them with the actual content of the entity |
| 261 | * Disabled by default, this should be activated when using XPath since |
| 262 | * the XPath data model requires entities replacement and the XPath |
| 263 | * engine does not handle entities references transparently. |
| 264 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 265 | int xmlSubstituteEntitiesDefaultValue = 0; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 266 | static int xmlSubstituteEntitiesDefaultValueThrDef = 0; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 267 | |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 268 | xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 269 | static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef = NULL; |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 270 | xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue = NULL; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 271 | static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef = NULL; |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 272 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 273 | /* |
| 274 | * Error handling |
| 275 | */ |
| 276 | |
| 277 | /* xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; */ |
| 278 | /* Must initialize xmlGenericError in xmlInitParser */ |
Daniel Veillard | 635ef72 | 2001-10-29 11:48:19 +0000 | [diff] [blame] | 279 | void xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED, |
| 280 | const char *msg, |
| 281 | ...); |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 282 | /** |
| 283 | * xmlGenericError: |
| 284 | * |
| 285 | * Global setting: function used for generic error callbacks |
| 286 | */ |
Daniel Veillard | 635ef72 | 2001-10-29 11:48:19 +0000 | [diff] [blame] | 287 | xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 288 | static xmlGenericErrorFunc xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc; |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 289 | /** |
| 290 | * xmlGenericErrorContext: |
| 291 | * |
| 292 | * Global setting passed to generic error callbacks |
| 293 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 294 | void *xmlGenericErrorContext = NULL; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 295 | static void *xmlGenericErrorContextThrDef = NULL; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 296 | |
| 297 | /* |
| 298 | * output defaults |
| 299 | */ |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 300 | /** |
| 301 | * xmlIndentTreeOutput: |
| 302 | * |
| 303 | * Global setting, asking the serializer to indent the output tree by default |
Aleksey Sanin | 2300256 | 2002-05-24 07:18:40 +0000 | [diff] [blame] | 304 | * Enabled by default |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 305 | */ |
Aleksey Sanin | 2300256 | 2002-05-24 07:18:40 +0000 | [diff] [blame] | 306 | int xmlIndentTreeOutput = 1; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 307 | static int xmlIndentTreeOutputThrDef = 1; |
Aleksey Sanin | 2300256 | 2002-05-24 07:18:40 +0000 | [diff] [blame] | 308 | |
| 309 | /** |
| 310 | * xmlTreeIndentString: |
| 311 | * |
| 312 | * The string used to do one-level indent. By default is equal to " " (two spaces) |
| 313 | */ |
| 314 | const char *xmlTreeIndentString = " "; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 315 | static const char *xmlTreeIndentStringThrDef = " "; |
Aleksey Sanin | 2300256 | 2002-05-24 07:18:40 +0000 | [diff] [blame] | 316 | |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 317 | /** |
| 318 | * xmlSaveNoEmptyTags: |
| 319 | * |
| 320 | * Global setting, asking the serializer to not output empty tags |
| 321 | * as <empty/> but <empty></empty>. those two forms are undistinguishable |
| 322 | * once parsed. |
| 323 | * Disabled by default |
| 324 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 325 | int xmlSaveNoEmptyTags = 0; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 326 | int xmlSaveNoEmptyTagsThrDef = 0; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 327 | |
Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 328 | #ifdef LIBXML_SAX1_ENABLED |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 329 | /** |
| 330 | * xmlDefaultSAXHandler: |
| 331 | * |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 332 | * Default SAX version1 handler for XML, builds the DOM tree |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 333 | */ |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 334 | xmlSAXHandlerV1 xmlDefaultSAXHandler = { |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 335 | xmlSAX2InternalSubset, |
| 336 | xmlSAX2IsStandalone, |
| 337 | xmlSAX2HasInternalSubset, |
| 338 | xmlSAX2HasExternalSubset, |
| 339 | xmlSAX2ResolveEntity, |
| 340 | xmlSAX2GetEntity, |
| 341 | xmlSAX2EntityDecl, |
| 342 | xmlSAX2NotationDecl, |
| 343 | xmlSAX2AttributeDecl, |
| 344 | xmlSAX2ElementDecl, |
| 345 | xmlSAX2UnparsedEntityDecl, |
| 346 | xmlSAX2SetDocumentLocator, |
| 347 | xmlSAX2StartDocument, |
| 348 | xmlSAX2EndDocument, |
| 349 | xmlSAX2StartElement, |
| 350 | xmlSAX2EndElement, |
| 351 | xmlSAX2Reference, |
| 352 | xmlSAX2Characters, |
| 353 | xmlSAX2Characters, |
| 354 | xmlSAX2ProcessingInstruction, |
| 355 | xmlSAX2Comment, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 356 | xmlParserWarning, |
| 357 | xmlParserError, |
| 358 | xmlParserError, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 359 | xmlSAX2GetParameterEntity, |
| 360 | xmlSAX2CDataBlock, |
| 361 | xmlSAX2ExternalSubset, |
| 362 | 0, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 363 | }; |
Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 364 | #endif /* LIBXML_SAX1_ENABLED */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 365 | |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 366 | /** |
| 367 | * xmlDefaultSAXLocator: |
| 368 | * |
| 369 | * The default SAX Locator |
| 370 | * { getPublicId, getSystemId, getLineNumber, getColumnNumber} |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 371 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 372 | xmlSAXLocator xmlDefaultSAXLocator = { |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 373 | xmlSAX2GetPublicId, |
| 374 | xmlSAX2GetSystemId, |
| 375 | xmlSAX2GetLineNumber, |
| 376 | xmlSAX2GetColumnNumber |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 377 | }; |
| 378 | |
| 379 | #ifdef LIBXML_HTML_ENABLED |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 380 | /** |
| 381 | * htmlDefaultSAXHandler: |
| 382 | * |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 383 | * Default old SAX v1 handler for HTML, builds the DOM tree |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 384 | */ |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 385 | xmlSAXHandlerV1 htmlDefaultSAXHandler = { |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 386 | xmlSAX2InternalSubset, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 387 | NULL, |
| 388 | NULL, |
| 389 | NULL, |
| 390 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 391 | xmlSAX2GetEntity, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 392 | NULL, |
| 393 | NULL, |
| 394 | NULL, |
| 395 | NULL, |
| 396 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 397 | xmlSAX2SetDocumentLocator, |
| 398 | xmlSAX2StartDocument, |
| 399 | xmlSAX2EndDocument, |
| 400 | xmlSAX2StartElement, |
| 401 | xmlSAX2EndElement, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 402 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 403 | xmlSAX2Characters, |
| 404 | xmlSAX2IgnorableWhitespace, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 405 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 406 | xmlSAX2Comment, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 407 | xmlParserWarning, |
| 408 | xmlParserError, |
| 409 | xmlParserError, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 410 | xmlSAX2GetParameterEntity, |
| 411 | xmlSAX2CDataBlock, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 412 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 413 | 0, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 414 | }; |
| 415 | #endif /* LIBXML_HTML_ENABLED */ |
| 416 | |
| 417 | #ifdef LIBXML_DOCB_ENABLED |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 418 | /** |
| 419 | * docbDefaultSAXHandler: |
| 420 | * |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 421 | * Default old SAX v1 handler for SGML DocBook, builds the DOM tree |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 422 | */ |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 423 | xmlSAXHandlerV1 docbDefaultSAXHandler = { |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 424 | xmlSAX2InternalSubset, |
| 425 | xmlSAX2IsStandalone, |
| 426 | xmlSAX2HasInternalSubset, |
| 427 | xmlSAX2HasExternalSubset, |
| 428 | xmlSAX2ResolveEntity, |
| 429 | xmlSAX2GetEntity, |
| 430 | xmlSAX2EntityDecl, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 431 | NULL, |
| 432 | NULL, |
| 433 | NULL, |
| 434 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 435 | xmlSAX2SetDocumentLocator, |
| 436 | xmlSAX2StartDocument, |
| 437 | xmlSAX2EndDocument, |
| 438 | xmlSAX2StartElement, |
| 439 | xmlSAX2EndElement, |
| 440 | xmlSAX2Reference, |
| 441 | xmlSAX2Characters, |
| 442 | xmlSAX2IgnorableWhitespace, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 443 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 444 | xmlSAX2Comment, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 445 | xmlParserWarning, |
| 446 | xmlParserError, |
| 447 | xmlParserError, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 448 | xmlSAX2GetParameterEntity, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 449 | NULL, |
| 450 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 451 | 0, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 452 | }; |
| 453 | #endif /* LIBXML_DOCB_ENABLED */ |
| 454 | |
| 455 | /** |
| 456 | * xmlInitializeGlobalState: |
| 457 | * @gs: a pointer to a newly allocated global state |
| 458 | * |
| 459 | * xmlInitializeGlobalState() initialize a global state with all the |
| 460 | * default values of the library. |
| 461 | */ |
| 462 | void |
| 463 | xmlInitializeGlobalState(xmlGlobalStatePtr gs) |
| 464 | { |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 465 | #ifdef DEBUG_GLOBALS |
| 466 | fprintf(stderr, "Initializing globals at %lu for thread %d\n", |
| 467 | (unsigned long) gs, xmlGetThreadId()); |
| 468 | #endif |
| 469 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 470 | /* |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 471 | * Perform initialization as required by libxml |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 472 | */ |
Daniel Veillard | 5805be2 | 2003-08-28 08:03:23 +0000 | [diff] [blame] | 473 | if (xmlThrDefMutex == NULL) |
| 474 | xmlInitGlobals(); |
| 475 | |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 476 | xmlMutexLock(xmlThrDefMutex); |
William M. Brack | 8b2c7f1 | 2002-11-22 05:07:29 +0000 | [diff] [blame] | 477 | |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 478 | #ifdef LIBXML_DOCB_ENABLED |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 479 | initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler); |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 480 | #endif |
| 481 | #ifdef LIBXML_HTML_ENABLED |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 482 | inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler); |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 483 | #endif |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 484 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 485 | gs->oldXMLWDcompatibility = 0; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 486 | gs->xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef; |
| 487 | gs->xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef; |
Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 488 | #ifdef LIBXML_SAX1_ENABLED |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 489 | initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1); |
Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 490 | #endif /* LIBXML_SAX1_ENABLED */ |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 491 | gs->xmlDefaultSAXLocator.getPublicId = xmlSAX2GetPublicId; |
| 492 | gs->xmlDefaultSAXLocator.getSystemId = xmlSAX2GetSystemId; |
| 493 | gs->xmlDefaultSAXLocator.getLineNumber = xmlSAX2GetLineNumber; |
| 494 | gs->xmlDefaultSAXLocator.getColumnNumber = xmlSAX2GetColumnNumber; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 495 | gs->xmlDoValidityCheckingDefaultValue = |
| 496 | xmlDoValidityCheckingDefaultValueThrDef; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 497 | #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY) |
| 498 | gs->xmlFree = (xmlFreeFunc) xmlMemFree; |
| 499 | gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc; |
Daniel Veillard | 3c908dc | 2003-04-19 00:07:51 +0000 | [diff] [blame] | 500 | gs->xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 501 | gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc; |
| 502 | gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup; |
| 503 | #else |
| 504 | gs->xmlFree = (xmlFreeFunc) free; |
| 505 | gs->xmlMalloc = (xmlMallocFunc) malloc; |
Daniel Veillard | 3c908dc | 2003-04-19 00:07:51 +0000 | [diff] [blame] | 506 | gs->xmlMallocAtomic = (xmlMallocFunc) malloc; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 507 | gs->xmlRealloc = (xmlReallocFunc) realloc; |
Daniel Veillard | 572577e | 2002-01-18 16:23:55 +0000 | [diff] [blame] | 508 | gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 509 | #endif |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 510 | gs->xmlGetWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef; |
| 511 | gs->xmlIndentTreeOutput = xmlIndentTreeOutputThrDef; |
| 512 | gs->xmlTreeIndentString = xmlTreeIndentStringThrDef; |
| 513 | gs->xmlKeepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef; |
| 514 | gs->xmlLineNumbersDefaultValue = xmlLineNumbersDefaultValueThrDef; |
| 515 | gs->xmlLoadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef; |
| 516 | gs->xmlParserDebugEntities = xmlParserDebugEntitiesThrDef; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 517 | gs->xmlParserVersion = LIBXML_VERSION_STRING; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 518 | gs->xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef; |
| 519 | gs->xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef; |
| 520 | gs->xmlSubstituteEntitiesDefaultValue = |
| 521 | xmlSubstituteEntitiesDefaultValueThrDef; |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 522 | |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 523 | gs->xmlGenericError = xmlGenericErrorThrDef; |
| 524 | gs->xmlGenericErrorContext = xmlGenericErrorContextThrDef; |
| 525 | gs->xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef; |
| 526 | gs->xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef; |
| 527 | |
| 528 | xmlMutexUnlock(xmlThrDefMutex); |
| 529 | } |
| 530 | |
| 531 | void |
| 532 | xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) { |
| 533 | xmlMutexLock(xmlThrDefMutex); |
| 534 | xmlGenericErrorContextThrDef = ctx; |
| 535 | if (handler != NULL) |
| 536 | xmlGenericErrorThrDef = handler; |
| 537 | else |
| 538 | xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc; |
| 539 | xmlMutexUnlock(xmlThrDefMutex); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 540 | } |
| 541 | |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 542 | /** |
Daniel Veillard | 7b4b2f9 | 2003-01-06 13:11:20 +0000 | [diff] [blame] | 543 | * xmlRegisterNodeDefault: |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 544 | * @func: function pointer to the new RegisterNodeFunc |
| 545 | * |
Daniel Veillard | 1703c5f | 2003-02-10 14:28:44 +0000 | [diff] [blame] | 546 | * Registers a callback for node creation |
| 547 | * |
| 548 | * Returns the old value of the registration function |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 549 | */ |
| 550 | xmlRegisterNodeFunc |
| 551 | xmlRegisterNodeDefault(xmlRegisterNodeFunc func) |
| 552 | { |
| 553 | xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue; |
| 554 | |
Daniel Veillard | a880b12 | 2003-04-21 21:36:41 +0000 | [diff] [blame] | 555 | __xmlRegisterCallbacks = 1; |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 556 | xmlRegisterNodeDefaultValue = func; |
| 557 | return(old); |
| 558 | } |
| 559 | |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 560 | xmlRegisterNodeFunc |
| 561 | xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func) |
| 562 | { |
| 563 | xmlRegisterNodeFunc old; |
| 564 | |
| 565 | xmlMutexLock(xmlThrDefMutex); |
| 566 | old = xmlRegisterNodeDefaultValueThrDef; |
| 567 | |
| 568 | __xmlRegisterCallbacks = 1; |
| 569 | xmlRegisterNodeDefaultValueThrDef = func; |
| 570 | xmlMutexUnlock(xmlThrDefMutex); |
| 571 | |
| 572 | return(old); |
| 573 | } |
| 574 | |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 575 | /** |
Daniel Veillard | 7b4b2f9 | 2003-01-06 13:11:20 +0000 | [diff] [blame] | 576 | * xmlDeregisterNodeDefault: |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 577 | * @func: function pointer to the new DeregisterNodeFunc |
| 578 | * |
Daniel Veillard | 1703c5f | 2003-02-10 14:28:44 +0000 | [diff] [blame] | 579 | * Registers a callback for node destruction |
| 580 | * |
Daniel Veillard | 7b4b2f9 | 2003-01-06 13:11:20 +0000 | [diff] [blame] | 581 | * Returns the previous value of the deregistration function |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 582 | */ |
| 583 | xmlDeregisterNodeFunc |
| 584 | xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func) |
| 585 | { |
| 586 | xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue; |
| 587 | |
Daniel Veillard | a880b12 | 2003-04-21 21:36:41 +0000 | [diff] [blame] | 588 | __xmlRegisterCallbacks = 1; |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 589 | xmlDeregisterNodeDefaultValue = func; |
| 590 | return(old); |
| 591 | } |
| 592 | |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 593 | xmlDeregisterNodeFunc |
| 594 | xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func) |
| 595 | { |
| 596 | xmlDeregisterNodeFunc old; |
| 597 | |
| 598 | xmlMutexLock(xmlThrDefMutex); |
| 599 | old = xmlDeregisterNodeDefaultValueThrDef; |
| 600 | |
| 601 | __xmlRegisterCallbacks = 1; |
| 602 | xmlDeregisterNodeDefaultValueThrDef = func; |
| 603 | xmlMutexUnlock(xmlThrDefMutex); |
| 604 | |
| 605 | return(old); |
| 606 | } |
| 607 | |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 608 | |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 609 | #ifdef LIBXML_DOCB_ENABLED |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 610 | #undef docbDefaultSAXHandler |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 611 | xmlSAXHandlerV1 * |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 612 | __docbDefaultSAXHandler(void) { |
| 613 | if (IS_MAIN_THREAD) |
| 614 | return (&docbDefaultSAXHandler); |
| 615 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 616 | return (&xmlGetGlobalState()->docbDefaultSAXHandler); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 617 | } |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 618 | #endif |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 619 | |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 620 | #ifdef LIBXML_HTML_ENABLED |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 621 | #undef htmlDefaultSAXHandler |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 622 | xmlSAXHandlerV1 * |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 623 | __htmlDefaultSAXHandler(void) { |
| 624 | if (IS_MAIN_THREAD) |
| 625 | return (&htmlDefaultSAXHandler); |
| 626 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 627 | return (&xmlGetGlobalState()->htmlDefaultSAXHandler); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 628 | } |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 629 | #endif |
| 630 | |
| 631 | /* |
| 632 | * Everything starting from the line below is |
| 633 | * Automatically generated by build_glob.py. |
| 634 | * Do not modify the previous line. |
| 635 | */ |
| 636 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 637 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 638 | #undef oldXMLWDcompatibility |
| 639 | int * |
| 640 | __oldXMLWDcompatibility(void) { |
| 641 | if (IS_MAIN_THREAD) |
| 642 | return (&oldXMLWDcompatibility); |
| 643 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 644 | return (&xmlGetGlobalState()->oldXMLWDcompatibility); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 645 | } |
| 646 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 647 | #undef xmlBufferAllocScheme |
| 648 | xmlBufferAllocationScheme * |
| 649 | __xmlBufferAllocScheme(void) { |
| 650 | if (IS_MAIN_THREAD) |
| 651 | return (&xmlBufferAllocScheme); |
| 652 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 653 | return (&xmlGetGlobalState()->xmlBufferAllocScheme); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 654 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 655 | xmlBufferAllocationScheme xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v) { |
| 656 | xmlBufferAllocationScheme ret; |
| 657 | xmlMutexLock(xmlThrDefMutex); |
| 658 | ret = xmlBufferAllocSchemeThrDef; |
| 659 | xmlBufferAllocSchemeThrDef = v; |
| 660 | xmlMutexUnlock(xmlThrDefMutex); |
| 661 | return ret; |
| 662 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 663 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 664 | #undef xmlDefaultBufferSize |
| 665 | int * |
| 666 | __xmlDefaultBufferSize(void) { |
| 667 | if (IS_MAIN_THREAD) |
| 668 | return (&xmlDefaultBufferSize); |
| 669 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 670 | return (&xmlGetGlobalState()->xmlDefaultBufferSize); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 671 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 672 | int xmlThrDefDefaultBufferSize(int v) { |
| 673 | int ret; |
| 674 | xmlMutexLock(xmlThrDefMutex); |
| 675 | ret = xmlDefaultBufferSizeThrDef; |
| 676 | xmlDefaultBufferSizeThrDef = v; |
| 677 | xmlMutexUnlock(xmlThrDefMutex); |
| 678 | return ret; |
| 679 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 680 | |
Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 681 | #ifdef LIBXML_SAX1_ENABLED |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 682 | #undef xmlDefaultSAXHandler |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 683 | xmlSAXHandlerV1 * |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 684 | __xmlDefaultSAXHandler(void) { |
| 685 | if (IS_MAIN_THREAD) |
| 686 | return (&xmlDefaultSAXHandler); |
| 687 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 688 | return (&xmlGetGlobalState()->xmlDefaultSAXHandler); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 689 | } |
Daniel Veillard | 8127390 | 2003-09-30 00:43:48 +0000 | [diff] [blame] | 690 | #endif /* LIBXML_SAX1_ENABLED */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 691 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 692 | #undef xmlDefaultSAXLocator |
| 693 | xmlSAXLocator * |
| 694 | __xmlDefaultSAXLocator(void) { |
| 695 | if (IS_MAIN_THREAD) |
| 696 | return (&xmlDefaultSAXLocator); |
| 697 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 698 | return (&xmlGetGlobalState()->xmlDefaultSAXLocator); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 699 | } |
| 700 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 701 | #undef xmlDoValidityCheckingDefaultValue |
| 702 | int * |
| 703 | __xmlDoValidityCheckingDefaultValue(void) { |
| 704 | if (IS_MAIN_THREAD) |
| 705 | return (&xmlDoValidityCheckingDefaultValue); |
| 706 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 707 | return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 708 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 709 | int xmlThrDefDoValidityCheckingDefaultValue(int v) { |
| 710 | int ret; |
| 711 | xmlMutexLock(xmlThrDefMutex); |
| 712 | ret = xmlDoValidityCheckingDefaultValueThrDef; |
| 713 | xmlDoValidityCheckingDefaultValueThrDef = v; |
| 714 | xmlMutexUnlock(xmlThrDefMutex); |
| 715 | return ret; |
| 716 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 717 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 718 | #undef xmlGenericError |
| 719 | xmlGenericErrorFunc * |
| 720 | __xmlGenericError(void) { |
| 721 | if (IS_MAIN_THREAD) |
| 722 | return (&xmlGenericError); |
| 723 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 724 | return (&xmlGetGlobalState()->xmlGenericError); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 725 | } |
| 726 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 727 | #undef xmlGenericErrorContext |
| 728 | void * * |
| 729 | __xmlGenericErrorContext(void) { |
| 730 | if (IS_MAIN_THREAD) |
| 731 | return (&xmlGenericErrorContext); |
| 732 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 733 | return (&xmlGetGlobalState()->xmlGenericErrorContext); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 734 | } |
| 735 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 736 | #undef xmlGetWarningsDefaultValue |
| 737 | int * |
| 738 | __xmlGetWarningsDefaultValue(void) { |
| 739 | if (IS_MAIN_THREAD) |
| 740 | return (&xmlGetWarningsDefaultValue); |
| 741 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 742 | return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 743 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 744 | int xmlThrDefGetWarningsDefaultValue(int v) { |
| 745 | int ret; |
| 746 | xmlMutexLock(xmlThrDefMutex); |
| 747 | ret = xmlGetWarningsDefaultValueThrDef; |
| 748 | xmlGetWarningsDefaultValueThrDef = v; |
| 749 | xmlMutexUnlock(xmlThrDefMutex); |
| 750 | return ret; |
| 751 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 752 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 753 | #undef xmlIndentTreeOutput |
| 754 | int * |
| 755 | __xmlIndentTreeOutput(void) { |
| 756 | if (IS_MAIN_THREAD) |
| 757 | return (&xmlIndentTreeOutput); |
| 758 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 759 | return (&xmlGetGlobalState()->xmlIndentTreeOutput); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 760 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 761 | int xmlThrDefIndentTreeOutput(int v) { |
| 762 | int ret; |
| 763 | xmlMutexLock(xmlThrDefMutex); |
| 764 | ret = xmlIndentTreeOutputThrDef; |
| 765 | xmlIndentTreeOutputThrDef = v; |
| 766 | xmlMutexUnlock(xmlThrDefMutex); |
| 767 | return ret; |
| 768 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 769 | |
Aleksey Sanin | 2300256 | 2002-05-24 07:18:40 +0000 | [diff] [blame] | 770 | #undef xmlTreeIndentString |
| 771 | const char * * |
| 772 | __xmlTreeIndentString(void) { |
| 773 | if (IS_MAIN_THREAD) |
| 774 | return (&xmlTreeIndentString); |
| 775 | else |
| 776 | return (&xmlGetGlobalState()->xmlTreeIndentString); |
| 777 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 778 | const char * xmlThrDefTreeIndentString(const char * v) { |
| 779 | const char * ret; |
| 780 | xmlMutexLock(xmlThrDefMutex); |
| 781 | ret = xmlTreeIndentStringThrDef; |
| 782 | xmlTreeIndentStringThrDef = v; |
| 783 | xmlMutexUnlock(xmlThrDefMutex); |
| 784 | return ret; |
| 785 | } |
Aleksey Sanin | 2300256 | 2002-05-24 07:18:40 +0000 | [diff] [blame] | 786 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 787 | #undef xmlKeepBlanksDefaultValue |
| 788 | int * |
| 789 | __xmlKeepBlanksDefaultValue(void) { |
| 790 | if (IS_MAIN_THREAD) |
| 791 | return (&xmlKeepBlanksDefaultValue); |
| 792 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 793 | return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 794 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 795 | int xmlThrDefKeepBlanksDefaultValue(int v) { |
| 796 | int ret; |
| 797 | xmlMutexLock(xmlThrDefMutex); |
| 798 | ret = xmlKeepBlanksDefaultValueThrDef; |
| 799 | xmlKeepBlanksDefaultValueThrDef = v; |
| 800 | xmlMutexUnlock(xmlThrDefMutex); |
| 801 | return ret; |
| 802 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 803 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 804 | #undef xmlLineNumbersDefaultValue |
| 805 | int * |
| 806 | __xmlLineNumbersDefaultValue(void) { |
| 807 | if (IS_MAIN_THREAD) |
| 808 | return (&xmlLineNumbersDefaultValue); |
| 809 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 810 | return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 811 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 812 | int xmlThrDefLineNumbersDefaultValue(int v) { |
| 813 | int ret; |
| 814 | xmlMutexLock(xmlThrDefMutex); |
| 815 | ret = xmlLineNumbersDefaultValueThrDef; |
| 816 | xmlLineNumbersDefaultValueThrDef = v; |
| 817 | xmlMutexUnlock(xmlThrDefMutex); |
| 818 | return ret; |
| 819 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 820 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 821 | #undef xmlLoadExtDtdDefaultValue |
| 822 | int * |
| 823 | __xmlLoadExtDtdDefaultValue(void) { |
| 824 | if (IS_MAIN_THREAD) |
| 825 | return (&xmlLoadExtDtdDefaultValue); |
| 826 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 827 | return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 828 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 829 | int xmlThrDefLoadExtDtdDefaultValue(int v) { |
| 830 | int ret; |
| 831 | xmlMutexLock(xmlThrDefMutex); |
| 832 | ret = xmlLoadExtDtdDefaultValueThrDef; |
| 833 | xmlLoadExtDtdDefaultValueThrDef = v; |
| 834 | xmlMutexUnlock(xmlThrDefMutex); |
| 835 | return ret; |
| 836 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 837 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 838 | #undef xmlParserDebugEntities |
| 839 | int * |
| 840 | __xmlParserDebugEntities(void) { |
| 841 | if (IS_MAIN_THREAD) |
| 842 | return (&xmlParserDebugEntities); |
| 843 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 844 | return (&xmlGetGlobalState()->xmlParserDebugEntities); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 845 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 846 | int xmlThrDefParserDebugEntities(int v) { |
| 847 | int ret; |
| 848 | xmlMutexLock(xmlThrDefMutex); |
| 849 | ret = xmlParserDebugEntitiesThrDef; |
| 850 | xmlParserDebugEntitiesThrDef = v; |
| 851 | xmlMutexUnlock(xmlThrDefMutex); |
| 852 | return ret; |
| 853 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 854 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 855 | #undef xmlParserVersion |
| 856 | const char * * |
| 857 | __xmlParserVersion(void) { |
| 858 | if (IS_MAIN_THREAD) |
| 859 | return (&xmlParserVersion); |
| 860 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 861 | return (&xmlGetGlobalState()->xmlParserVersion); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 862 | } |
| 863 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 864 | #undef xmlPedanticParserDefaultValue |
| 865 | int * |
| 866 | __xmlPedanticParserDefaultValue(void) { |
| 867 | if (IS_MAIN_THREAD) |
| 868 | return (&xmlPedanticParserDefaultValue); |
| 869 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 870 | return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 871 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 872 | int xmlThrDefPedanticParserDefaultValue(int v) { |
| 873 | int ret; |
| 874 | xmlMutexLock(xmlThrDefMutex); |
| 875 | ret = xmlPedanticParserDefaultValueThrDef; |
| 876 | xmlPedanticParserDefaultValueThrDef = v; |
| 877 | xmlMutexUnlock(xmlThrDefMutex); |
| 878 | return ret; |
| 879 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 880 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 881 | #undef xmlSaveNoEmptyTags |
| 882 | int * |
| 883 | __xmlSaveNoEmptyTags(void) { |
| 884 | if (IS_MAIN_THREAD) |
| 885 | return (&xmlSaveNoEmptyTags); |
| 886 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 887 | return (&xmlGetGlobalState()->xmlSaveNoEmptyTags); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 888 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 889 | int xmlThrDefSaveNoEmptyTags(int v) { |
| 890 | int ret; |
| 891 | xmlMutexLock(xmlThrDefMutex); |
| 892 | ret = xmlSaveNoEmptyTagsThrDef; |
| 893 | xmlSaveNoEmptyTagsThrDef = v; |
| 894 | xmlMutexUnlock(xmlThrDefMutex); |
| 895 | return ret; |
| 896 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 897 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 898 | #undef xmlSubstituteEntitiesDefaultValue |
| 899 | int * |
| 900 | __xmlSubstituteEntitiesDefaultValue(void) { |
| 901 | if (IS_MAIN_THREAD) |
| 902 | return (&xmlSubstituteEntitiesDefaultValue); |
| 903 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 904 | return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 905 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 906 | int xmlThrDefSubstituteEntitiesDefaultValue(int v) { |
| 907 | int ret; |
| 908 | xmlMutexLock(xmlThrDefMutex); |
| 909 | ret = xmlSubstituteEntitiesDefaultValueThrDef; |
| 910 | xmlSubstituteEntitiesDefaultValueThrDef = v; |
| 911 | xmlMutexUnlock(xmlThrDefMutex); |
| 912 | return ret; |
| 913 | } |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 914 | |
| 915 | #undef xmlRegisterNodeDefaultValue |
| 916 | xmlRegisterNodeFunc * |
| 917 | __xmlRegisterNodeDefaultValue(void) { |
| 918 | if (IS_MAIN_THREAD) |
| 919 | return (&xmlRegisterNodeDefaultValue); |
| 920 | else |
| 921 | return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue); |
| 922 | } |
| 923 | |
| 924 | #undef xmlDeregisterNodeDefaultValue |
| 925 | xmlDeregisterNodeFunc * |
| 926 | __xmlDeregisterNodeDefaultValue(void) { |
| 927 | if (IS_MAIN_THREAD) |
| 928 | return (&xmlDeregisterNodeDefaultValue); |
| 929 | else |
| 930 | return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue); |
| 931 | } |