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