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 | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 328 | /** |
| 329 | * xmlDefaultSAXHandler: |
| 330 | * |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 331 | * Default SAX version1 handler for XML, builds the DOM tree |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 332 | */ |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 333 | xmlSAXHandlerV1 xmlDefaultSAXHandler = { |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 334 | xmlSAX2InternalSubset, |
| 335 | xmlSAX2IsStandalone, |
| 336 | xmlSAX2HasInternalSubset, |
| 337 | xmlSAX2HasExternalSubset, |
| 338 | xmlSAX2ResolveEntity, |
| 339 | xmlSAX2GetEntity, |
| 340 | xmlSAX2EntityDecl, |
| 341 | xmlSAX2NotationDecl, |
| 342 | xmlSAX2AttributeDecl, |
| 343 | xmlSAX2ElementDecl, |
| 344 | xmlSAX2UnparsedEntityDecl, |
| 345 | xmlSAX2SetDocumentLocator, |
| 346 | xmlSAX2StartDocument, |
| 347 | xmlSAX2EndDocument, |
| 348 | xmlSAX2StartElement, |
| 349 | xmlSAX2EndElement, |
| 350 | xmlSAX2Reference, |
| 351 | xmlSAX2Characters, |
| 352 | xmlSAX2Characters, |
| 353 | xmlSAX2ProcessingInstruction, |
| 354 | xmlSAX2Comment, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 355 | xmlParserWarning, |
| 356 | xmlParserError, |
| 357 | xmlParserError, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 358 | xmlSAX2GetParameterEntity, |
| 359 | xmlSAX2CDataBlock, |
| 360 | xmlSAX2ExternalSubset, |
| 361 | 0, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 362 | }; |
| 363 | |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 364 | /** |
| 365 | * xmlDefaultSAXLocator: |
| 366 | * |
| 367 | * The default SAX Locator |
| 368 | * { getPublicId, getSystemId, getLineNumber, getColumnNumber} |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 369 | */ |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 370 | xmlSAXLocator xmlDefaultSAXLocator = { |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 371 | xmlSAX2GetPublicId, |
| 372 | xmlSAX2GetSystemId, |
| 373 | xmlSAX2GetLineNumber, |
| 374 | xmlSAX2GetColumnNumber |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 375 | }; |
| 376 | |
| 377 | #ifdef LIBXML_HTML_ENABLED |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 378 | /** |
| 379 | * htmlDefaultSAXHandler: |
| 380 | * |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 381 | * Default old SAX v1 handler for HTML, builds the DOM tree |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 382 | */ |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 383 | xmlSAXHandlerV1 htmlDefaultSAXHandler = { |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 384 | xmlSAX2InternalSubset, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 385 | NULL, |
| 386 | NULL, |
| 387 | NULL, |
| 388 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 389 | xmlSAX2GetEntity, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 390 | NULL, |
| 391 | NULL, |
| 392 | NULL, |
| 393 | NULL, |
| 394 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 395 | xmlSAX2SetDocumentLocator, |
| 396 | xmlSAX2StartDocument, |
| 397 | xmlSAX2EndDocument, |
| 398 | xmlSAX2StartElement, |
| 399 | xmlSAX2EndElement, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 400 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 401 | xmlSAX2Characters, |
| 402 | xmlSAX2IgnorableWhitespace, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 403 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 404 | xmlSAX2Comment, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 405 | xmlParserWarning, |
| 406 | xmlParserError, |
| 407 | xmlParserError, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 408 | xmlSAX2GetParameterEntity, |
| 409 | xmlSAX2CDataBlock, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 410 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 411 | 0, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 412 | }; |
| 413 | #endif /* LIBXML_HTML_ENABLED */ |
| 414 | |
| 415 | #ifdef LIBXML_DOCB_ENABLED |
Daniel Veillard | 9d06d30 | 2002-01-22 18:15:52 +0000 | [diff] [blame] | 416 | /** |
| 417 | * docbDefaultSAXHandler: |
| 418 | * |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 419 | * Default old SAX v1 handler for SGML DocBook, builds the DOM tree |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 420 | */ |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 421 | xmlSAXHandlerV1 docbDefaultSAXHandler = { |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 422 | xmlSAX2InternalSubset, |
| 423 | xmlSAX2IsStandalone, |
| 424 | xmlSAX2HasInternalSubset, |
| 425 | xmlSAX2HasExternalSubset, |
| 426 | xmlSAX2ResolveEntity, |
| 427 | xmlSAX2GetEntity, |
| 428 | xmlSAX2EntityDecl, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 429 | NULL, |
| 430 | NULL, |
| 431 | NULL, |
| 432 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 433 | xmlSAX2SetDocumentLocator, |
| 434 | xmlSAX2StartDocument, |
| 435 | xmlSAX2EndDocument, |
| 436 | xmlSAX2StartElement, |
| 437 | xmlSAX2EndElement, |
| 438 | xmlSAX2Reference, |
| 439 | xmlSAX2Characters, |
| 440 | xmlSAX2IgnorableWhitespace, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 441 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 442 | xmlSAX2Comment, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 443 | xmlParserWarning, |
| 444 | xmlParserError, |
| 445 | xmlParserError, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 446 | xmlSAX2GetParameterEntity, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 447 | NULL, |
| 448 | NULL, |
Daniel Veillard | 1af9a41 | 2003-08-20 22:54:39 +0000 | [diff] [blame] | 449 | 0, |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 450 | }; |
| 451 | #endif /* LIBXML_DOCB_ENABLED */ |
| 452 | |
| 453 | /** |
| 454 | * xmlInitializeGlobalState: |
| 455 | * @gs: a pointer to a newly allocated global state |
| 456 | * |
| 457 | * xmlInitializeGlobalState() initialize a global state with all the |
| 458 | * default values of the library. |
| 459 | */ |
| 460 | void |
| 461 | xmlInitializeGlobalState(xmlGlobalStatePtr gs) |
| 462 | { |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 463 | #ifdef DEBUG_GLOBALS |
| 464 | fprintf(stderr, "Initializing globals at %lu for thread %d\n", |
| 465 | (unsigned long) gs, xmlGetThreadId()); |
| 466 | #endif |
| 467 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 468 | /* |
Daniel Veillard | cbaf399 | 2001-12-31 16:16:02 +0000 | [diff] [blame] | 469 | * Perform initialization as required by libxml |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 470 | */ |
Daniel Veillard | 5805be2 | 2003-08-28 08:03:23 +0000 | [diff] [blame] | 471 | if (xmlThrDefMutex == NULL) |
| 472 | xmlInitGlobals(); |
| 473 | |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 474 | xmlMutexLock(xmlThrDefMutex); |
William M. Brack | 8b2c7f1 | 2002-11-22 05:07:29 +0000 | [diff] [blame] | 475 | |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 476 | #ifdef LIBXML_DOCB_ENABLED |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 477 | initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler); |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 478 | #endif |
| 479 | #ifdef LIBXML_HTML_ENABLED |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 480 | inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler); |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 481 | #endif |
Daniel Veillard | 3c01b1d | 2001-10-17 15:58:35 +0000 | [diff] [blame] | 482 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 483 | gs->oldXMLWDcompatibility = 0; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 484 | gs->xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef; |
| 485 | gs->xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef; |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 486 | initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1); |
Daniel Veillard | 4432df2 | 2003-09-28 18:58:27 +0000 | [diff] [blame] | 487 | gs->xmlDefaultSAXLocator.getPublicId = xmlSAX2GetPublicId; |
| 488 | gs->xmlDefaultSAXLocator.getSystemId = xmlSAX2GetSystemId; |
| 489 | gs->xmlDefaultSAXLocator.getLineNumber = xmlSAX2GetLineNumber; |
| 490 | gs->xmlDefaultSAXLocator.getColumnNumber = xmlSAX2GetColumnNumber; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 491 | gs->xmlDoValidityCheckingDefaultValue = |
| 492 | xmlDoValidityCheckingDefaultValueThrDef; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 493 | #if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY) |
| 494 | gs->xmlFree = (xmlFreeFunc) xmlMemFree; |
| 495 | gs->xmlMalloc = (xmlMallocFunc) xmlMemMalloc; |
Daniel Veillard | 3c908dc | 2003-04-19 00:07:51 +0000 | [diff] [blame] | 496 | gs->xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 497 | gs->xmlRealloc = (xmlReallocFunc) xmlMemRealloc; |
| 498 | gs->xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup; |
| 499 | #else |
| 500 | gs->xmlFree = (xmlFreeFunc) free; |
| 501 | gs->xmlMalloc = (xmlMallocFunc) malloc; |
Daniel Veillard | 3c908dc | 2003-04-19 00:07:51 +0000 | [diff] [blame] | 502 | gs->xmlMallocAtomic = (xmlMallocFunc) malloc; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 503 | gs->xmlRealloc = (xmlReallocFunc) realloc; |
Daniel Veillard | 572577e | 2002-01-18 16:23:55 +0000 | [diff] [blame] | 504 | gs->xmlMemStrdup = (xmlStrdupFunc) xmlStrdup; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 505 | #endif |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 506 | gs->xmlGetWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef; |
| 507 | gs->xmlIndentTreeOutput = xmlIndentTreeOutputThrDef; |
| 508 | gs->xmlTreeIndentString = xmlTreeIndentStringThrDef; |
| 509 | gs->xmlKeepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef; |
| 510 | gs->xmlLineNumbersDefaultValue = xmlLineNumbersDefaultValueThrDef; |
| 511 | gs->xmlLoadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef; |
| 512 | gs->xmlParserDebugEntities = xmlParserDebugEntitiesThrDef; |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 513 | gs->xmlParserVersion = LIBXML_VERSION_STRING; |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 514 | gs->xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef; |
| 515 | gs->xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef; |
| 516 | gs->xmlSubstituteEntitiesDefaultValue = |
| 517 | xmlSubstituteEntitiesDefaultValueThrDef; |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 518 | |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 519 | gs->xmlGenericError = xmlGenericErrorThrDef; |
| 520 | gs->xmlGenericErrorContext = xmlGenericErrorContextThrDef; |
| 521 | gs->xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef; |
| 522 | gs->xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef; |
| 523 | |
| 524 | xmlMutexUnlock(xmlThrDefMutex); |
| 525 | } |
| 526 | |
| 527 | void |
| 528 | xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) { |
| 529 | xmlMutexLock(xmlThrDefMutex); |
| 530 | xmlGenericErrorContextThrDef = ctx; |
| 531 | if (handler != NULL) |
| 532 | xmlGenericErrorThrDef = handler; |
| 533 | else |
| 534 | xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc; |
| 535 | xmlMutexUnlock(xmlThrDefMutex); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 536 | } |
| 537 | |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 538 | /** |
Daniel Veillard | 7b4b2f9 | 2003-01-06 13:11:20 +0000 | [diff] [blame] | 539 | * xmlRegisterNodeDefault: |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 540 | * @func: function pointer to the new RegisterNodeFunc |
| 541 | * |
Daniel Veillard | 1703c5f | 2003-02-10 14:28:44 +0000 | [diff] [blame] | 542 | * Registers a callback for node creation |
| 543 | * |
| 544 | * Returns the old value of the registration function |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 545 | */ |
| 546 | xmlRegisterNodeFunc |
| 547 | xmlRegisterNodeDefault(xmlRegisterNodeFunc func) |
| 548 | { |
| 549 | xmlRegisterNodeFunc old = xmlRegisterNodeDefaultValue; |
| 550 | |
Daniel Veillard | a880b12 | 2003-04-21 21:36:41 +0000 | [diff] [blame] | 551 | __xmlRegisterCallbacks = 1; |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 552 | xmlRegisterNodeDefaultValue = func; |
| 553 | return(old); |
| 554 | } |
| 555 | |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 556 | xmlRegisterNodeFunc |
| 557 | xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func) |
| 558 | { |
| 559 | xmlRegisterNodeFunc old; |
| 560 | |
| 561 | xmlMutexLock(xmlThrDefMutex); |
| 562 | old = xmlRegisterNodeDefaultValueThrDef; |
| 563 | |
| 564 | __xmlRegisterCallbacks = 1; |
| 565 | xmlRegisterNodeDefaultValueThrDef = func; |
| 566 | xmlMutexUnlock(xmlThrDefMutex); |
| 567 | |
| 568 | return(old); |
| 569 | } |
| 570 | |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 571 | /** |
Daniel Veillard | 7b4b2f9 | 2003-01-06 13:11:20 +0000 | [diff] [blame] | 572 | * xmlDeregisterNodeDefault: |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 573 | * @func: function pointer to the new DeregisterNodeFunc |
| 574 | * |
Daniel Veillard | 1703c5f | 2003-02-10 14:28:44 +0000 | [diff] [blame] | 575 | * Registers a callback for node destruction |
| 576 | * |
Daniel Veillard | 7b4b2f9 | 2003-01-06 13:11:20 +0000 | [diff] [blame] | 577 | * Returns the previous value of the deregistration function |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 578 | */ |
| 579 | xmlDeregisterNodeFunc |
| 580 | xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func) |
| 581 | { |
| 582 | xmlDeregisterNodeFunc old = xmlDeregisterNodeDefaultValue; |
| 583 | |
Daniel Veillard | a880b12 | 2003-04-21 21:36:41 +0000 | [diff] [blame] | 584 | __xmlRegisterCallbacks = 1; |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 585 | xmlDeregisterNodeDefaultValue = func; |
| 586 | return(old); |
| 587 | } |
| 588 | |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 589 | xmlDeregisterNodeFunc |
| 590 | xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func) |
| 591 | { |
| 592 | xmlDeregisterNodeFunc old; |
| 593 | |
| 594 | xmlMutexLock(xmlThrDefMutex); |
| 595 | old = xmlDeregisterNodeDefaultValueThrDef; |
| 596 | |
| 597 | __xmlRegisterCallbacks = 1; |
| 598 | xmlDeregisterNodeDefaultValueThrDef = func; |
| 599 | xmlMutexUnlock(xmlThrDefMutex); |
| 600 | |
| 601 | return(old); |
| 602 | } |
| 603 | |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 604 | |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 605 | #ifdef LIBXML_DOCB_ENABLED |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 606 | #undef docbDefaultSAXHandler |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 607 | xmlSAXHandlerV1 * |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 608 | __docbDefaultSAXHandler(void) { |
| 609 | if (IS_MAIN_THREAD) |
| 610 | return (&docbDefaultSAXHandler); |
| 611 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 612 | return (&xmlGetGlobalState()->docbDefaultSAXHandler); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 613 | } |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 614 | #endif |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 615 | |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 616 | #ifdef LIBXML_HTML_ENABLED |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 617 | #undef htmlDefaultSAXHandler |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 618 | xmlSAXHandlerV1 * |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 619 | __htmlDefaultSAXHandler(void) { |
| 620 | if (IS_MAIN_THREAD) |
| 621 | return (&htmlDefaultSAXHandler); |
| 622 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 623 | return (&xmlGetGlobalState()->htmlDefaultSAXHandler); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 624 | } |
Daniel Veillard | a4617b8 | 2001-11-04 20:19:12 +0000 | [diff] [blame] | 625 | #endif |
| 626 | |
| 627 | /* |
| 628 | * Everything starting from the line below is |
| 629 | * Automatically generated by build_glob.py. |
| 630 | * Do not modify the previous line. |
| 631 | */ |
| 632 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 633 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 634 | #undef oldXMLWDcompatibility |
| 635 | int * |
| 636 | __oldXMLWDcompatibility(void) { |
| 637 | if (IS_MAIN_THREAD) |
| 638 | return (&oldXMLWDcompatibility); |
| 639 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 640 | return (&xmlGetGlobalState()->oldXMLWDcompatibility); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 641 | } |
| 642 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 643 | #undef xmlBufferAllocScheme |
| 644 | xmlBufferAllocationScheme * |
| 645 | __xmlBufferAllocScheme(void) { |
| 646 | if (IS_MAIN_THREAD) |
| 647 | return (&xmlBufferAllocScheme); |
| 648 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 649 | return (&xmlGetGlobalState()->xmlBufferAllocScheme); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 650 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 651 | xmlBufferAllocationScheme xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v) { |
| 652 | xmlBufferAllocationScheme ret; |
| 653 | xmlMutexLock(xmlThrDefMutex); |
| 654 | ret = xmlBufferAllocSchemeThrDef; |
| 655 | xmlBufferAllocSchemeThrDef = v; |
| 656 | xmlMutexUnlock(xmlThrDefMutex); |
| 657 | return ret; |
| 658 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 659 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 660 | #undef xmlDefaultBufferSize |
| 661 | int * |
| 662 | __xmlDefaultBufferSize(void) { |
| 663 | if (IS_MAIN_THREAD) |
| 664 | return (&xmlDefaultBufferSize); |
| 665 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 666 | return (&xmlGetGlobalState()->xmlDefaultBufferSize); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 667 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 668 | int xmlThrDefDefaultBufferSize(int v) { |
| 669 | int ret; |
| 670 | xmlMutexLock(xmlThrDefMutex); |
| 671 | ret = xmlDefaultBufferSizeThrDef; |
| 672 | xmlDefaultBufferSizeThrDef = v; |
| 673 | xmlMutexUnlock(xmlThrDefMutex); |
| 674 | return ret; |
| 675 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 676 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 677 | #undef xmlDefaultSAXHandler |
Daniel Veillard | 092643b | 2003-09-25 14:29:29 +0000 | [diff] [blame] | 678 | xmlSAXHandlerV1 * |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 679 | __xmlDefaultSAXHandler(void) { |
| 680 | if (IS_MAIN_THREAD) |
| 681 | return (&xmlDefaultSAXHandler); |
| 682 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 683 | return (&xmlGetGlobalState()->xmlDefaultSAXHandler); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 684 | } |
| 685 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 686 | #undef xmlDefaultSAXLocator |
| 687 | xmlSAXLocator * |
| 688 | __xmlDefaultSAXLocator(void) { |
| 689 | if (IS_MAIN_THREAD) |
| 690 | return (&xmlDefaultSAXLocator); |
| 691 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 692 | return (&xmlGetGlobalState()->xmlDefaultSAXLocator); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 693 | } |
| 694 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 695 | #undef xmlDoValidityCheckingDefaultValue |
| 696 | int * |
| 697 | __xmlDoValidityCheckingDefaultValue(void) { |
| 698 | if (IS_MAIN_THREAD) |
| 699 | return (&xmlDoValidityCheckingDefaultValue); |
| 700 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 701 | return (&xmlGetGlobalState()->xmlDoValidityCheckingDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 702 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 703 | int xmlThrDefDoValidityCheckingDefaultValue(int v) { |
| 704 | int ret; |
| 705 | xmlMutexLock(xmlThrDefMutex); |
| 706 | ret = xmlDoValidityCheckingDefaultValueThrDef; |
| 707 | xmlDoValidityCheckingDefaultValueThrDef = v; |
| 708 | xmlMutexUnlock(xmlThrDefMutex); |
| 709 | return ret; |
| 710 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 711 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 712 | #undef xmlGenericError |
| 713 | xmlGenericErrorFunc * |
| 714 | __xmlGenericError(void) { |
| 715 | if (IS_MAIN_THREAD) |
| 716 | return (&xmlGenericError); |
| 717 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 718 | return (&xmlGetGlobalState()->xmlGenericError); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 719 | } |
| 720 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 721 | #undef xmlGenericErrorContext |
| 722 | void * * |
| 723 | __xmlGenericErrorContext(void) { |
| 724 | if (IS_MAIN_THREAD) |
| 725 | return (&xmlGenericErrorContext); |
| 726 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 727 | return (&xmlGetGlobalState()->xmlGenericErrorContext); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 728 | } |
| 729 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 730 | #undef xmlGetWarningsDefaultValue |
| 731 | int * |
| 732 | __xmlGetWarningsDefaultValue(void) { |
| 733 | if (IS_MAIN_THREAD) |
| 734 | return (&xmlGetWarningsDefaultValue); |
| 735 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 736 | return (&xmlGetGlobalState()->xmlGetWarningsDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 737 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 738 | int xmlThrDefGetWarningsDefaultValue(int v) { |
| 739 | int ret; |
| 740 | xmlMutexLock(xmlThrDefMutex); |
| 741 | ret = xmlGetWarningsDefaultValueThrDef; |
| 742 | xmlGetWarningsDefaultValueThrDef = v; |
| 743 | xmlMutexUnlock(xmlThrDefMutex); |
| 744 | return ret; |
| 745 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 746 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 747 | #undef xmlIndentTreeOutput |
| 748 | int * |
| 749 | __xmlIndentTreeOutput(void) { |
| 750 | if (IS_MAIN_THREAD) |
| 751 | return (&xmlIndentTreeOutput); |
| 752 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 753 | return (&xmlGetGlobalState()->xmlIndentTreeOutput); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 754 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 755 | int xmlThrDefIndentTreeOutput(int v) { |
| 756 | int ret; |
| 757 | xmlMutexLock(xmlThrDefMutex); |
| 758 | ret = xmlIndentTreeOutputThrDef; |
| 759 | xmlIndentTreeOutputThrDef = v; |
| 760 | xmlMutexUnlock(xmlThrDefMutex); |
| 761 | return ret; |
| 762 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 763 | |
Aleksey Sanin | 2300256 | 2002-05-24 07:18:40 +0000 | [diff] [blame] | 764 | #undef xmlTreeIndentString |
| 765 | const char * * |
| 766 | __xmlTreeIndentString(void) { |
| 767 | if (IS_MAIN_THREAD) |
| 768 | return (&xmlTreeIndentString); |
| 769 | else |
| 770 | return (&xmlGetGlobalState()->xmlTreeIndentString); |
| 771 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 772 | const char * xmlThrDefTreeIndentString(const char * v) { |
| 773 | const char * ret; |
| 774 | xmlMutexLock(xmlThrDefMutex); |
| 775 | ret = xmlTreeIndentStringThrDef; |
| 776 | xmlTreeIndentStringThrDef = v; |
| 777 | xmlMutexUnlock(xmlThrDefMutex); |
| 778 | return ret; |
| 779 | } |
Aleksey Sanin | 2300256 | 2002-05-24 07:18:40 +0000 | [diff] [blame] | 780 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 781 | #undef xmlKeepBlanksDefaultValue |
| 782 | int * |
| 783 | __xmlKeepBlanksDefaultValue(void) { |
| 784 | if (IS_MAIN_THREAD) |
| 785 | return (&xmlKeepBlanksDefaultValue); |
| 786 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 787 | return (&xmlGetGlobalState()->xmlKeepBlanksDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 788 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 789 | int xmlThrDefKeepBlanksDefaultValue(int v) { |
| 790 | int ret; |
| 791 | xmlMutexLock(xmlThrDefMutex); |
| 792 | ret = xmlKeepBlanksDefaultValueThrDef; |
| 793 | xmlKeepBlanksDefaultValueThrDef = v; |
| 794 | xmlMutexUnlock(xmlThrDefMutex); |
| 795 | return ret; |
| 796 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 797 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 798 | #undef xmlLineNumbersDefaultValue |
| 799 | int * |
| 800 | __xmlLineNumbersDefaultValue(void) { |
| 801 | if (IS_MAIN_THREAD) |
| 802 | return (&xmlLineNumbersDefaultValue); |
| 803 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 804 | return (&xmlGetGlobalState()->xmlLineNumbersDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 805 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 806 | int xmlThrDefLineNumbersDefaultValue(int v) { |
| 807 | int ret; |
| 808 | xmlMutexLock(xmlThrDefMutex); |
| 809 | ret = xmlLineNumbersDefaultValueThrDef; |
| 810 | xmlLineNumbersDefaultValueThrDef = v; |
| 811 | xmlMutexUnlock(xmlThrDefMutex); |
| 812 | return ret; |
| 813 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 814 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 815 | #undef xmlLoadExtDtdDefaultValue |
| 816 | int * |
| 817 | __xmlLoadExtDtdDefaultValue(void) { |
| 818 | if (IS_MAIN_THREAD) |
| 819 | return (&xmlLoadExtDtdDefaultValue); |
| 820 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 821 | return (&xmlGetGlobalState()->xmlLoadExtDtdDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 822 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 823 | int xmlThrDefLoadExtDtdDefaultValue(int v) { |
| 824 | int ret; |
| 825 | xmlMutexLock(xmlThrDefMutex); |
| 826 | ret = xmlLoadExtDtdDefaultValueThrDef; |
| 827 | xmlLoadExtDtdDefaultValueThrDef = v; |
| 828 | xmlMutexUnlock(xmlThrDefMutex); |
| 829 | return ret; |
| 830 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 831 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 832 | #undef xmlParserDebugEntities |
| 833 | int * |
| 834 | __xmlParserDebugEntities(void) { |
| 835 | if (IS_MAIN_THREAD) |
| 836 | return (&xmlParserDebugEntities); |
| 837 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 838 | return (&xmlGetGlobalState()->xmlParserDebugEntities); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 839 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 840 | int xmlThrDefParserDebugEntities(int v) { |
| 841 | int ret; |
| 842 | xmlMutexLock(xmlThrDefMutex); |
| 843 | ret = xmlParserDebugEntitiesThrDef; |
| 844 | xmlParserDebugEntitiesThrDef = v; |
| 845 | xmlMutexUnlock(xmlThrDefMutex); |
| 846 | return ret; |
| 847 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 848 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 849 | #undef xmlParserVersion |
| 850 | const char * * |
| 851 | __xmlParserVersion(void) { |
| 852 | if (IS_MAIN_THREAD) |
| 853 | return (&xmlParserVersion); |
| 854 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 855 | return (&xmlGetGlobalState()->xmlParserVersion); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 856 | } |
| 857 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 858 | #undef xmlPedanticParserDefaultValue |
| 859 | int * |
| 860 | __xmlPedanticParserDefaultValue(void) { |
| 861 | if (IS_MAIN_THREAD) |
| 862 | return (&xmlPedanticParserDefaultValue); |
| 863 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 864 | return (&xmlGetGlobalState()->xmlPedanticParserDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 865 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 866 | int xmlThrDefPedanticParserDefaultValue(int v) { |
| 867 | int ret; |
| 868 | xmlMutexLock(xmlThrDefMutex); |
| 869 | ret = xmlPedanticParserDefaultValueThrDef; |
| 870 | xmlPedanticParserDefaultValueThrDef = v; |
| 871 | xmlMutexUnlock(xmlThrDefMutex); |
| 872 | return ret; |
| 873 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 874 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 875 | #undef xmlSaveNoEmptyTags |
| 876 | int * |
| 877 | __xmlSaveNoEmptyTags(void) { |
| 878 | if (IS_MAIN_THREAD) |
| 879 | return (&xmlSaveNoEmptyTags); |
| 880 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 881 | return (&xmlGetGlobalState()->xmlSaveNoEmptyTags); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 882 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 883 | int xmlThrDefSaveNoEmptyTags(int v) { |
| 884 | int ret; |
| 885 | xmlMutexLock(xmlThrDefMutex); |
| 886 | ret = xmlSaveNoEmptyTagsThrDef; |
| 887 | xmlSaveNoEmptyTagsThrDef = v; |
| 888 | xmlMutexUnlock(xmlThrDefMutex); |
| 889 | return ret; |
| 890 | } |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 891 | |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 892 | #undef xmlSubstituteEntitiesDefaultValue |
| 893 | int * |
| 894 | __xmlSubstituteEntitiesDefaultValue(void) { |
| 895 | if (IS_MAIN_THREAD) |
| 896 | return (&xmlSubstituteEntitiesDefaultValue); |
| 897 | else |
Daniel Veillard | d046356 | 2001-10-13 09:15:48 +0000 | [diff] [blame] | 898 | return (&xmlGetGlobalState()->xmlSubstituteEntitiesDefaultValue); |
Daniel Veillard | b847864 | 2001-10-12 17:29:10 +0000 | [diff] [blame] | 899 | } |
Daniel Veillard | 781ac8b | 2003-05-15 22:11:36 +0000 | [diff] [blame] | 900 | int xmlThrDefSubstituteEntitiesDefaultValue(int v) { |
| 901 | int ret; |
| 902 | xmlMutexLock(xmlThrDefMutex); |
| 903 | ret = xmlSubstituteEntitiesDefaultValueThrDef; |
| 904 | xmlSubstituteEntitiesDefaultValueThrDef = v; |
| 905 | xmlMutexUnlock(xmlThrDefMutex); |
| 906 | return ret; |
| 907 | } |
Daniel Veillard | 5335dc5 | 2003-01-01 20:59:38 +0000 | [diff] [blame] | 908 | |
| 909 | #undef xmlRegisterNodeDefaultValue |
| 910 | xmlRegisterNodeFunc * |
| 911 | __xmlRegisterNodeDefaultValue(void) { |
| 912 | if (IS_MAIN_THREAD) |
| 913 | return (&xmlRegisterNodeDefaultValue); |
| 914 | else |
| 915 | return (&xmlGetGlobalState()->xmlRegisterNodeDefaultValue); |
| 916 | } |
| 917 | |
| 918 | #undef xmlDeregisterNodeDefaultValue |
| 919 | xmlDeregisterNodeFunc * |
| 920 | __xmlDeregisterNodeDefaultValue(void) { |
| 921 | if (IS_MAIN_THREAD) |
| 922 | return (&xmlDeregisterNodeDefaultValue); |
| 923 | else |
| 924 | return (&xmlGetGlobalState()->xmlDeregisterNodeDefaultValue); |
| 925 | } |