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