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