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