nokolexbor 0.2.5 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/nokolexbor/CMakeLists.txt +7 -4
- data/ext/nokolexbor/config.h.cmake.in +2 -0
- data/ext/nokolexbor/extconf.rb +47 -25
- data/ext/nokolexbor/libxml/SAX2.h +4 -4
- data/ext/nokolexbor/libxml/chvalid.h +21 -21
- data/ext/nokolexbor/libxml/dict.h +13 -13
- data/ext/nokolexbor/libxml/globals.h +202 -202
- data/ext/nokolexbor/libxml/hash.h +25 -25
- data/ext/nokolexbor/libxml/parser.h +5 -5
- data/ext/nokolexbor/libxml/parserInternals.h +4 -4
- data/ext/nokolexbor/libxml/pattern.h +14 -14
- data/ext/nokolexbor/libxml/threads.h +15 -15
- data/ext/nokolexbor/libxml/tree.h +5 -5
- data/ext/nokolexbor/libxml/xmlerror.h +5 -5
- data/ext/nokolexbor/libxml/xmlmemory.h +16 -16
- data/ext/nokolexbor/libxml/xmlstring.h +30 -30
- data/ext/nokolexbor/libxml/xpath.h +43 -43
- data/ext/nokolexbor/libxml/xpathInternals.h +128 -128
- data/ext/nokolexbor/memory.c +6 -6
- data/ext/nokolexbor/nl_cdata.c +44 -0
- data/ext/nokolexbor/nl_comment.c +44 -0
- data/ext/nokolexbor/nl_document.c +23 -9
- data/ext/nokolexbor/nl_node.c +191 -178
- data/ext/nokolexbor/nl_node_set.c +38 -73
- data/ext/nokolexbor/nl_text.c +44 -0
- data/ext/nokolexbor/nl_xpath_context.c +33 -42
- data/ext/nokolexbor/nokolexbor.c +7 -3
- data/ext/nokolexbor/nokolexbor.h +9 -7
- data/ext/nokolexbor/private/buf.h +1 -1
- data/ext/nokolexbor/private/error.h +3 -3
- data/ext/nokolexbor/xml_SAX2.c +8 -8
- data/ext/nokolexbor/xml_buf.c +19 -19
- data/ext/nokolexbor/xml_chvalid.c +25 -25
- data/ext/nokolexbor/xml_dict.c +69 -69
- data/ext/nokolexbor/xml_encoding.c +2 -2
- data/ext/nokolexbor/xml_error.c +51 -51
- data/ext/nokolexbor/xml_globals.c +329 -329
- data/ext/nokolexbor/xml_hash.c +131 -131
- data/ext/nokolexbor/xml_memory.c +25 -25
- data/ext/nokolexbor/xml_parser.c +3 -3
- data/ext/nokolexbor/xml_parserInternals.c +15 -15
- data/ext/nokolexbor/xml_pattern.c +103 -103
- data/ext/nokolexbor/xml_string.c +93 -93
- data/ext/nokolexbor/xml_threads.c +61 -61
- data/ext/nokolexbor/xml_tree.c +12 -12
- data/ext/nokolexbor/xml_xpath.c +1194 -1203
- data/lib/nokolexbor/document.rb +92 -1
- data/lib/nokolexbor/node.rb +64 -0
- data/lib/nokolexbor/node_set.rb +6 -5
- data/lib/nokolexbor/version.rb +1 -1
- data/lib/nokolexbor.rb +21 -1
- data/patches/0001-lexbor-support-text-pseudo-element.patch +1 -1
- metadata +7 -4
@@ -32,7 +32,7 @@
|
|
32
32
|
* Helpful Macro
|
33
33
|
*/
|
34
34
|
#ifdef LIBXML_THREAD_ENABLED
|
35
|
-
#define IS_MAIN_THREAD (
|
35
|
+
#define IS_MAIN_THREAD (nl_xmlIsMainThread())
|
36
36
|
#else
|
37
37
|
#define IS_MAIN_THREAD 1
|
38
38
|
#endif
|
@@ -43,12 +43,12 @@
|
|
43
43
|
static xmlMutex xmlThrDefMutex;
|
44
44
|
|
45
45
|
/**
|
46
|
-
*
|
46
|
+
* nl_xmlInitGlobals:
|
47
47
|
*
|
48
|
-
* DEPRECATED: Alias for
|
48
|
+
* DEPRECATED: Alias for nl_xmlInitParser.
|
49
49
|
*/
|
50
|
-
void
|
51
|
-
|
50
|
+
void nl_xmlInitGlobals(void) {
|
51
|
+
nl_xmlInitParser();
|
52
52
|
}
|
53
53
|
|
54
54
|
/**
|
@@ -69,37 +69,37 @@ void xmlInitGlobalsInternal(void) {
|
|
69
69
|
/*
|
70
70
|
* Memory allocation routines
|
71
71
|
*/
|
72
|
-
#undef
|
73
|
-
#undef
|
74
|
-
#undef
|
75
|
-
#undef
|
76
|
-
#undef
|
72
|
+
#undef nl_xmlFree
|
73
|
+
#undef nl_xmlMalloc
|
74
|
+
#undef nl_xmlMallocAtomic
|
75
|
+
#undef nl_xmlMemStrdup
|
76
|
+
#undef nl_xmlRealloc
|
77
77
|
|
78
78
|
#if defined(DEBUG_MEMORY_LOCATION) || defined(DEBUG_MEMORY)
|
79
|
-
xmlFreeFunc
|
80
|
-
xmlMallocFunc
|
81
|
-
xmlMallocFunc
|
82
|
-
xmlReallocFunc
|
83
|
-
xmlStrdupFunc
|
79
|
+
xmlFreeFunc nl_xmlFree = (xmlFreeFunc) xmlMemFree;
|
80
|
+
xmlMallocFunc nl_xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
|
81
|
+
xmlMallocFunc nl_xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc;
|
82
|
+
xmlReallocFunc nl_xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
|
83
|
+
xmlStrdupFunc nl_xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
|
84
84
|
#else
|
85
85
|
/**
|
86
|
-
*
|
86
|
+
* nl_xmlFree:
|
87
87
|
* @mem: an already allocated block of memory
|
88
88
|
*
|
89
89
|
* The variable holding the libxml free() implementation
|
90
90
|
*/
|
91
|
-
xmlFreeFunc
|
91
|
+
xmlFreeFunc nl_xmlFree = free;
|
92
92
|
/**
|
93
|
-
*
|
93
|
+
* nl_xmlMalloc:
|
94
94
|
* @size: the size requested in bytes
|
95
95
|
*
|
96
96
|
* The variable holding the libxml malloc() implementation
|
97
97
|
*
|
98
98
|
* Returns a pointer to the newly allocated block or NULL in case of error
|
99
99
|
*/
|
100
|
-
xmlMallocFunc
|
100
|
+
xmlMallocFunc nl_xmlMalloc = malloc;
|
101
101
|
/**
|
102
|
-
*
|
102
|
+
* nl_xmlMallocAtomic:
|
103
103
|
* @size: the size requested in bytes
|
104
104
|
*
|
105
105
|
* The variable holding the libxml malloc() implementation for atomic
|
@@ -108,9 +108,9 @@ xmlMallocFunc xmlMalloc = malloc;
|
|
108
108
|
*
|
109
109
|
* Returns a pointer to the newly allocated block or NULL in case of error
|
110
110
|
*/
|
111
|
-
xmlMallocFunc
|
111
|
+
xmlMallocFunc nl_xmlMallocAtomic = malloc;
|
112
112
|
/**
|
113
|
-
*
|
113
|
+
* nl_xmlRealloc:
|
114
114
|
* @mem: an already allocated block of memory
|
115
115
|
* @size: the new size requested in bytes
|
116
116
|
*
|
@@ -118,7 +118,7 @@ xmlMallocFunc xmlMallocAtomic = malloc;
|
|
118
118
|
*
|
119
119
|
* Returns a pointer to the newly reallocated block or NULL in case of error
|
120
120
|
*/
|
121
|
-
xmlReallocFunc
|
121
|
+
xmlReallocFunc nl_xmlRealloc = realloc;
|
122
122
|
/**
|
123
123
|
* xmlPosixStrdup
|
124
124
|
* @cur: the input char *
|
@@ -129,17 +129,17 @@ xmlReallocFunc xmlRealloc = realloc;
|
|
129
129
|
*/
|
130
130
|
static char *
|
131
131
|
xmlPosixStrdup(const char *cur) {
|
132
|
-
return((char*)
|
132
|
+
return((char*) nl_xmlCharStrdup(cur));
|
133
133
|
}
|
134
134
|
/**
|
135
|
-
*
|
135
|
+
* nl_xmlMemStrdup:
|
136
136
|
* @str: a zero terminated string
|
137
137
|
*
|
138
138
|
* The variable holding the libxml strdup() implementation
|
139
139
|
*
|
140
140
|
* Returns the copy of the string or NULL in case of error
|
141
141
|
*/
|
142
|
-
xmlStrdupFunc
|
142
|
+
xmlStrdupFunc nl_xmlMemStrdup = xmlPosixStrdup;
|
143
143
|
#endif /* DEBUG_MEMORY_LOCATION || DEBUG_MEMORY */
|
144
144
|
|
145
145
|
#include "libxml/threads.h"
|
@@ -147,58 +147,58 @@ xmlStrdupFunc xmlMemStrdup = xmlPosixStrdup;
|
|
147
147
|
// #include "libxml/SAX.h"
|
148
148
|
|
149
149
|
#undef htmlDefaultSAXHandler
|
150
|
-
#undef
|
151
|
-
#undef
|
152
|
-
#undef
|
150
|
+
#undef nl_oldXMLWDcompatibility
|
151
|
+
#undef nl_xmlBufferAllocScheme
|
152
|
+
#undef nl_xmlDefaultBufferSize
|
153
153
|
#undef xmlDefaultSAXHandler
|
154
|
-
#undef
|
155
|
-
#undef
|
156
|
-
#undef
|
157
|
-
#undef
|
158
|
-
#undef
|
159
|
-
#undef
|
160
|
-
#undef
|
161
|
-
#undef
|
162
|
-
#undef
|
163
|
-
#undef
|
164
|
-
#undef
|
165
|
-
#undef
|
166
|
-
#undef
|
167
|
-
#undef
|
168
|
-
#undef
|
169
|
-
#undef
|
170
|
-
#undef
|
171
|
-
#undef
|
172
|
-
#undef
|
173
|
-
#undef
|
174
|
-
|
175
|
-
#undef
|
176
|
-
#undef
|
154
|
+
#undef nl_xmlDefaultSAXLocator
|
155
|
+
#undef nl_xmlDoValidityCheckingDefaultValue
|
156
|
+
#undef nl_xmlGenericError
|
157
|
+
#undef nl_xmlStructuredError
|
158
|
+
#undef nl_xmlGenericErrorContext
|
159
|
+
#undef nl_xmlStructuredErrorContext
|
160
|
+
#undef nl_xmlGetWarningsDefaultValue
|
161
|
+
#undef nl_xmlIndentTreeOutput
|
162
|
+
#undef nl_xmlTreeIndentString
|
163
|
+
#undef nl_xmlKeepBlanksDefaultValue
|
164
|
+
#undef nl_xmlLineNumbersDefaultValue
|
165
|
+
#undef nl_xmlLoadExtDtdDefaultValue
|
166
|
+
#undef nl_xmlParserDebugEntities
|
167
|
+
#undef nl_xmlParserVersion
|
168
|
+
#undef nl_xmlPedanticParserDefaultValue
|
169
|
+
#undef nl_xmlSaveNoEmptyTags
|
170
|
+
#undef nl_xmlSubstituteEntitiesDefaultValue
|
171
|
+
#undef nl_xmlRegisterNodeDefaultValue
|
172
|
+
#undef nl_xmlDeregisterNodeDefaultValue
|
173
|
+
#undef nl_xmlLastError
|
174
|
+
|
175
|
+
#undef nl_xmlParserInputBufferCreateFilenameValue
|
176
|
+
#undef nl_xmlOutputBufferCreateFilenameValue
|
177
177
|
/**
|
178
|
-
*
|
178
|
+
* nl_xmlParserVersion:
|
179
179
|
*
|
180
180
|
* Constant string describing the internal version of the library
|
181
181
|
*/
|
182
|
-
const char *
|
182
|
+
const char *nl_xmlParserVersion = LIBXML_VERSION_STRING LIBXML_VERSION_EXTRA;
|
183
183
|
|
184
184
|
/**
|
185
|
-
*
|
185
|
+
* nl_xmlBufferAllocScheme:
|
186
186
|
*
|
187
187
|
* DEPRECATED: Don't use.
|
188
188
|
*
|
189
189
|
* Global setting, default allocation policy for buffers, default is
|
190
190
|
* XML_BUFFER_ALLOC_EXACT
|
191
191
|
*/
|
192
|
-
xmlBufferAllocationScheme
|
192
|
+
xmlBufferAllocationScheme nl_xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
|
193
193
|
static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef = XML_BUFFER_ALLOC_EXACT;
|
194
194
|
/**
|
195
|
-
*
|
195
|
+
* nl_xmlDefaultBufferSize:
|
196
196
|
*
|
197
197
|
* DEPRECATED: Don't use.
|
198
198
|
*
|
199
199
|
* Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
|
200
200
|
*/
|
201
|
-
int
|
201
|
+
int nl_xmlDefaultBufferSize = BASE_BUFFER_SIZE;
|
202
202
|
static int xmlDefaultBufferSizeThrDef = BASE_BUFFER_SIZE;
|
203
203
|
|
204
204
|
/*
|
@@ -206,13 +206,13 @@ static int xmlDefaultBufferSizeThrDef = BASE_BUFFER_SIZE;
|
|
206
206
|
*/
|
207
207
|
|
208
208
|
/**
|
209
|
-
*
|
209
|
+
* nl_oldXMLWDcompatibility:
|
210
210
|
*
|
211
211
|
* Global setting, DEPRECATED.
|
212
212
|
*/
|
213
|
-
int
|
213
|
+
int nl_oldXMLWDcompatibility = 0; /* DEPRECATED */
|
214
214
|
/**
|
215
|
-
*
|
215
|
+
* nl_xmlParserDebugEntities:
|
216
216
|
*
|
217
217
|
* DEPRECATED: Don't use
|
218
218
|
*
|
@@ -220,30 +220,30 @@ int oldXMLWDcompatibility = 0; /* DEPRECATED */
|
|
220
220
|
* while handling entities.
|
221
221
|
* Disabled by default
|
222
222
|
*/
|
223
|
-
int
|
223
|
+
int nl_xmlParserDebugEntities = 0;
|
224
224
|
static int xmlParserDebugEntitiesThrDef = 0;
|
225
225
|
/**
|
226
|
-
*
|
226
|
+
* nl_xmlDoValidityCheckingDefaultValue:
|
227
227
|
*
|
228
228
|
* DEPRECATED: Use the modern options API with XML_PARSE_DTDVALID.
|
229
229
|
*
|
230
230
|
* Global setting, indicate that the parser should work in validating mode.
|
231
231
|
* Disabled by default.
|
232
232
|
*/
|
233
|
-
int
|
233
|
+
int nl_xmlDoValidityCheckingDefaultValue = 0;
|
234
234
|
static int xmlDoValidityCheckingDefaultValueThrDef = 0;
|
235
235
|
/**
|
236
|
-
*
|
236
|
+
* nl_xmlGetWarningsDefaultValue:
|
237
237
|
*
|
238
238
|
* DEPRECATED: Don't use
|
239
239
|
*
|
240
240
|
* Global setting, indicate that the DTD validation should provide warnings.
|
241
241
|
* Activated by default.
|
242
242
|
*/
|
243
|
-
int
|
243
|
+
int nl_xmlGetWarningsDefaultValue = 1;
|
244
244
|
static int xmlGetWarningsDefaultValueThrDef = 1;
|
245
245
|
/**
|
246
|
-
*
|
246
|
+
* nl_xmlLoadExtDtdDefaultValue:
|
247
247
|
*
|
248
248
|
* DEPRECATED: Use the modern options API with XML_PARSE_DTDLOAD.
|
249
249
|
*
|
@@ -251,20 +251,20 @@ static int xmlGetWarningsDefaultValueThrDef = 1;
|
|
251
251
|
* validating.
|
252
252
|
* Disabled by default.
|
253
253
|
*/
|
254
|
-
int
|
254
|
+
int nl_xmlLoadExtDtdDefaultValue = 0;
|
255
255
|
static int xmlLoadExtDtdDefaultValueThrDef = 0;
|
256
256
|
/**
|
257
|
-
*
|
257
|
+
* nl_xmlPedanticParserDefaultValue:
|
258
258
|
*
|
259
259
|
* DEPRECATED: Use the modern options API with XML_PARSE_PEDANTIC.
|
260
260
|
*
|
261
261
|
* Global setting, indicate that the parser be pedantic
|
262
262
|
* Disabled by default.
|
263
263
|
*/
|
264
|
-
int
|
264
|
+
int nl_xmlPedanticParserDefaultValue = 0;
|
265
265
|
static int xmlPedanticParserDefaultValueThrDef = 0;
|
266
266
|
/**
|
267
|
-
*
|
267
|
+
* nl_xmlLineNumbersDefaultValue:
|
268
268
|
*
|
269
269
|
* DEPRECATED: The modern options API always enables line numbers.
|
270
270
|
*
|
@@ -273,10 +273,10 @@ static int xmlPedanticParserDefaultValueThrDef = 0;
|
|
273
273
|
* Disabled by default since this may not be safe for old classes of
|
274
274
|
* application.
|
275
275
|
*/
|
276
|
-
int
|
276
|
+
int nl_xmlLineNumbersDefaultValue = 0;
|
277
277
|
static int xmlLineNumbersDefaultValueThrDef = 0;
|
278
278
|
/**
|
279
|
-
*
|
279
|
+
* nl_xmlKeepBlanksDefaultValue:
|
280
280
|
*
|
281
281
|
* DEPRECATED: Use the modern options API with XML_PARSE_NOBLANKS.
|
282
282
|
*
|
@@ -286,10 +286,10 @@ static int xmlLineNumbersDefaultValueThrDef = 0;
|
|
286
286
|
* conformant to the XML Recommendation, however the option is kept
|
287
287
|
* for some applications since this was libxml1 default behaviour.
|
288
288
|
*/
|
289
|
-
int
|
289
|
+
int nl_xmlKeepBlanksDefaultValue = 1;
|
290
290
|
static int xmlKeepBlanksDefaultValueThrDef = 1;
|
291
291
|
/**
|
292
|
-
*
|
292
|
+
* nl_xmlSubstituteEntitiesDefaultValue:
|
293
293
|
*
|
294
294
|
* DEPRECATED: Use the modern options API with XML_PARSE_NOENT.
|
295
295
|
*
|
@@ -299,100 +299,100 @@ static int xmlKeepBlanksDefaultValueThrDef = 1;
|
|
299
299
|
* the XPath data model requires entities replacement and the XPath
|
300
300
|
* engine does not handle entities references transparently.
|
301
301
|
*/
|
302
|
-
int
|
302
|
+
int nl_xmlSubstituteEntitiesDefaultValue = 0;
|
303
303
|
static int xmlSubstituteEntitiesDefaultValueThrDef = 0;
|
304
304
|
|
305
305
|
/**
|
306
|
-
*
|
306
|
+
* nl_xmlRegisterNodeDefaultValue:
|
307
307
|
*
|
308
308
|
* DEPRECATED: Don't use
|
309
309
|
*/
|
310
|
-
xmlRegisterNodeFunc
|
310
|
+
xmlRegisterNodeFunc nl_xmlRegisterNodeDefaultValue = NULL;
|
311
311
|
static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef = NULL;
|
312
312
|
|
313
313
|
/**
|
314
|
-
*
|
314
|
+
* nl_xmlDeregisterNodeDefaultValue:
|
315
315
|
*
|
316
316
|
* DEPRECATED: Don't use
|
317
317
|
*/
|
318
|
-
xmlDeregisterNodeFunc
|
318
|
+
xmlDeregisterNodeFunc nl_xmlDeregisterNodeDefaultValue = NULL;
|
319
319
|
static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef = NULL;
|
320
320
|
|
321
321
|
/**
|
322
|
-
*
|
322
|
+
* nl_xmlParserInputBufferCreateFilenameValue:
|
323
323
|
*
|
324
324
|
* DEPRECATED: Don't use
|
325
325
|
*/
|
326
|
-
xmlParserInputBufferCreateFilenameFunc
|
326
|
+
xmlParserInputBufferCreateFilenameFunc nl_xmlParserInputBufferCreateFilenameValue = NULL;
|
327
327
|
static xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValueThrDef = NULL;
|
328
328
|
|
329
329
|
/**
|
330
|
-
*
|
330
|
+
* nl_xmlOutputBufferCreateFilenameValue:
|
331
331
|
*
|
332
332
|
* DEPRECATED: Don't use
|
333
333
|
*/
|
334
|
-
xmlOutputBufferCreateFilenameFunc
|
334
|
+
xmlOutputBufferCreateFilenameFunc nl_xmlOutputBufferCreateFilenameValue = NULL;
|
335
335
|
static xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValueThrDef = NULL;
|
336
336
|
|
337
337
|
/**
|
338
|
-
*
|
338
|
+
* nl_xmlGenericError:
|
339
339
|
*
|
340
340
|
* Global setting: function used for generic error callbacks
|
341
341
|
*/
|
342
|
-
xmlGenericErrorFunc
|
343
|
-
static xmlGenericErrorFunc xmlGenericErrorThrDef =
|
342
|
+
xmlGenericErrorFunc nl_xmlGenericError = nl_xmlGenericErrorDefaultFunc;
|
343
|
+
static xmlGenericErrorFunc xmlGenericErrorThrDef = nl_xmlGenericErrorDefaultFunc;
|
344
344
|
/**
|
345
|
-
*
|
345
|
+
* nl_xmlStructuredError:
|
346
346
|
*
|
347
347
|
* Global setting: function used for structured error callbacks
|
348
348
|
*/
|
349
|
-
xmlStructuredErrorFunc
|
349
|
+
xmlStructuredErrorFunc nl_xmlStructuredError = NULL;
|
350
350
|
static xmlStructuredErrorFunc xmlStructuredErrorThrDef = NULL;
|
351
351
|
/**
|
352
|
-
*
|
352
|
+
* nl_xmlGenericErrorContext:
|
353
353
|
*
|
354
354
|
* Global setting passed to generic error callbacks
|
355
355
|
*/
|
356
|
-
void *
|
356
|
+
void *nl_xmlGenericErrorContext = NULL;
|
357
357
|
static void *xmlGenericErrorContextThrDef = NULL;
|
358
358
|
/**
|
359
|
-
*
|
359
|
+
* nl_xmlStructuredErrorContext:
|
360
360
|
*
|
361
361
|
* Global setting passed to structured error callbacks
|
362
362
|
*/
|
363
|
-
void *
|
363
|
+
void *nl_xmlStructuredErrorContext = NULL;
|
364
364
|
static void *xmlStructuredErrorContextThrDef = NULL;
|
365
|
-
xmlError
|
365
|
+
xmlError nl_xmlLastError;
|
366
366
|
|
367
367
|
/*
|
368
368
|
* output defaults
|
369
369
|
*/
|
370
370
|
/**
|
371
|
-
*
|
371
|
+
* nl_xmlIndentTreeOutput:
|
372
372
|
*
|
373
373
|
* Global setting, asking the serializer to indent the output tree by default
|
374
374
|
* Enabled by default
|
375
375
|
*/
|
376
|
-
int
|
376
|
+
int nl_xmlIndentTreeOutput = 1;
|
377
377
|
static int xmlIndentTreeOutputThrDef = 1;
|
378
378
|
|
379
379
|
/**
|
380
|
-
*
|
380
|
+
* nl_xmlTreeIndentString:
|
381
381
|
*
|
382
382
|
* The string used to do one-level indent. By default is equal to " " (two spaces)
|
383
383
|
*/
|
384
|
-
const char *
|
384
|
+
const char *nl_xmlTreeIndentString = " ";
|
385
385
|
static const char *xmlTreeIndentStringThrDef = " ";
|
386
386
|
|
387
387
|
/**
|
388
|
-
*
|
388
|
+
* nl_xmlSaveNoEmptyTags:
|
389
389
|
*
|
390
390
|
* Global setting, asking the serializer to not output empty tags
|
391
391
|
* as <empty/> but <empty></empty>. those two forms are indistinguishable
|
392
392
|
* once parsed.
|
393
393
|
* Disabled by default
|
394
394
|
*/
|
395
|
-
int
|
395
|
+
int nl_xmlSaveNoEmptyTags = 0;
|
396
396
|
static int xmlSaveNoEmptyTagsThrDef = 0;
|
397
397
|
|
398
398
|
#ifdef LIBXML_SAX1_ENABLED
|
@@ -437,18 +437,18 @@ xmlSAXHandlerV1 xmlDefaultSAXHandler = {
|
|
437
437
|
#endif /* LIBXML_SAX1_ENABLED */
|
438
438
|
|
439
439
|
/**
|
440
|
-
*
|
440
|
+
* nl_xmlDefaultSAXLocator:
|
441
441
|
*
|
442
442
|
* DEPRECATED: Don't use
|
443
443
|
*
|
444
444
|
* The default SAX Locator
|
445
445
|
* { getPublicId, getSystemId, getLineNumber, getColumnNumber}
|
446
446
|
*/
|
447
|
-
xmlSAXLocator
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
447
|
+
xmlSAXLocator nl_xmlDefaultSAXLocator = {
|
448
|
+
nl_xmlSAX2GetPublicId,
|
449
|
+
nl_xmlSAX2GetSystemId,
|
450
|
+
nl_xmlSAX2GetLineNumber,
|
451
|
+
nl_xmlSAX2GetColumnNumber
|
452
452
|
};
|
453
453
|
|
454
454
|
#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_SAX1_ENABLED)
|
@@ -493,87 +493,87 @@ xmlSAXHandlerV1 htmlDefaultSAXHandler = {
|
|
493
493
|
#endif /* LIBXML_HTML_ENABLED */
|
494
494
|
|
495
495
|
/**
|
496
|
-
*
|
496
|
+
* nl_xmlInitializeGlobalState:
|
497
497
|
* @gs: a pointer to a newly allocated global state
|
498
498
|
*
|
499
|
-
*
|
499
|
+
* nl_xmlInitializeGlobalState() initialize a global state with all the
|
500
500
|
* default values of the library.
|
501
501
|
*/
|
502
502
|
void
|
503
|
-
|
503
|
+
nl_xmlInitializeGlobalState(xmlGlobalStatePtr gs)
|
504
504
|
{
|
505
505
|
#ifdef DEBUG_GLOBALS
|
506
506
|
fprintf(stderr, "Initializing globals at %p for thread %d\n",
|
507
|
-
(void *) gs,
|
507
|
+
(void *) gs, nl_xmlGetThreadId());
|
508
508
|
#endif
|
509
509
|
|
510
|
-
|
510
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
511
511
|
|
512
512
|
#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_LEGACY_ENABLED) && defined(LIBXML_SAX1_ENABLED)
|
513
513
|
inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
|
514
514
|
#endif
|
515
515
|
|
516
|
-
gs->
|
517
|
-
gs->
|
518
|
-
gs->
|
516
|
+
gs->nl_oldXMLWDcompatibility = 0;
|
517
|
+
gs->nl_xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef;
|
518
|
+
gs->nl_xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef;
|
519
519
|
#if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_LEGACY_ENABLED)
|
520
520
|
initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
|
521
521
|
#endif /* LIBXML_SAX1_ENABLED */
|
522
|
-
gs->
|
523
|
-
gs->
|
524
|
-
gs->
|
525
|
-
gs->
|
526
|
-
gs->
|
522
|
+
gs->nl_xmlDefaultSAXLocator.getPublicId = nl_xmlSAX2GetPublicId;
|
523
|
+
gs->nl_xmlDefaultSAXLocator.getSystemId = nl_xmlSAX2GetSystemId;
|
524
|
+
gs->nl_xmlDefaultSAXLocator.getLineNumber = nl_xmlSAX2GetLineNumber;
|
525
|
+
gs->nl_xmlDefaultSAXLocator.getColumnNumber = nl_xmlSAX2GetColumnNumber;
|
526
|
+
gs->nl_xmlDoValidityCheckingDefaultValue =
|
527
527
|
xmlDoValidityCheckingDefaultValueThrDef;
|
528
528
|
#if defined(DEBUG_MEMORY_LOCATION) | defined(DEBUG_MEMORY)
|
529
|
-
gs->
|
530
|
-
gs->
|
531
|
-
gs->
|
532
|
-
gs->
|
533
|
-
gs->
|
529
|
+
gs->nl_xmlFree = (xmlFreeFunc) xmlMemFree;
|
530
|
+
gs->nl_xmlMalloc = (xmlMallocFunc) xmlMemMalloc;
|
531
|
+
gs->nl_xmlMallocAtomic = (xmlMallocFunc) xmlMemMalloc;
|
532
|
+
gs->nl_xmlRealloc = (xmlReallocFunc) xmlMemRealloc;
|
533
|
+
gs->nl_xmlMemStrdup = (xmlStrdupFunc) xmlMemoryStrdup;
|
534
534
|
#else
|
535
|
-
gs->
|
536
|
-
gs->
|
537
|
-
gs->
|
538
|
-
gs->
|
539
|
-
gs->
|
535
|
+
gs->nl_xmlFree = (xmlFreeFunc) free;
|
536
|
+
gs->nl_xmlMalloc = (xmlMallocFunc) malloc;
|
537
|
+
gs->nl_xmlMallocAtomic = (xmlMallocFunc) malloc;
|
538
|
+
gs->nl_xmlRealloc = (xmlReallocFunc) realloc;
|
539
|
+
gs->nl_xmlMemStrdup = (xmlStrdupFunc) nl_xmlStrdup;
|
540
540
|
#endif
|
541
|
-
gs->
|
542
|
-
gs->
|
543
|
-
gs->
|
544
|
-
gs->
|
545
|
-
gs->
|
546
|
-
gs->
|
547
|
-
gs->
|
548
|
-
gs->
|
549
|
-
gs->
|
550
|
-
gs->
|
551
|
-
gs->
|
541
|
+
gs->nl_xmlGetWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef;
|
542
|
+
gs->nl_xmlIndentTreeOutput = xmlIndentTreeOutputThrDef;
|
543
|
+
gs->nl_xmlTreeIndentString = xmlTreeIndentStringThrDef;
|
544
|
+
gs->nl_xmlKeepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef;
|
545
|
+
gs->nl_xmlLineNumbersDefaultValue = xmlLineNumbersDefaultValueThrDef;
|
546
|
+
gs->nl_xmlLoadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef;
|
547
|
+
gs->nl_xmlParserDebugEntities = xmlParserDebugEntitiesThrDef;
|
548
|
+
gs->nl_xmlParserVersion = LIBXML_VERSION_STRING;
|
549
|
+
gs->nl_xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef;
|
550
|
+
gs->nl_xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef;
|
551
|
+
gs->nl_xmlSubstituteEntitiesDefaultValue =
|
552
552
|
xmlSubstituteEntitiesDefaultValueThrDef;
|
553
553
|
|
554
|
-
gs->
|
555
|
-
gs->
|
556
|
-
gs->
|
557
|
-
gs->
|
558
|
-
gs->
|
559
|
-
gs->
|
554
|
+
gs->nl_xmlGenericError = xmlGenericErrorThrDef;
|
555
|
+
gs->nl_xmlStructuredError = xmlStructuredErrorThrDef;
|
556
|
+
gs->nl_xmlGenericErrorContext = xmlGenericErrorContextThrDef;
|
557
|
+
gs->nl_xmlStructuredErrorContext = xmlStructuredErrorContextThrDef;
|
558
|
+
gs->nl_xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef;
|
559
|
+
gs->nl_xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef;
|
560
560
|
|
561
|
-
gs->
|
562
|
-
gs->
|
563
|
-
memset(&gs->
|
561
|
+
gs->nl_xmlParserInputBufferCreateFilenameValue = xmlParserInputBufferCreateFilenameValueThrDef;
|
562
|
+
gs->nl_xmlOutputBufferCreateFilenameValue = xmlOutputBufferCreateFilenameValueThrDef;
|
563
|
+
memset(&gs->nl_xmlLastError, 0, sizeof(xmlError));
|
564
564
|
|
565
|
-
|
565
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
566
566
|
}
|
567
567
|
|
568
568
|
/**
|
569
|
-
*
|
569
|
+
* nl_xmlCleanupGlobals:
|
570
570
|
*
|
571
571
|
* DEPRECATED: This function is a no-op. Call xmlCleanupParser
|
572
572
|
* to free global state but see the warnings there. xmlCleanupParser
|
573
573
|
* should be only called once at program exit. In most cases, you don't
|
574
574
|
* have call cleanup functions at all.
|
575
575
|
*/
|
576
|
-
void
|
576
|
+
void nl_xmlCleanupGlobals(void) {
|
577
577
|
}
|
578
578
|
|
579
579
|
/**
|
@@ -582,33 +582,33 @@ void xmlCleanupGlobals(void) {
|
|
582
582
|
* Additional cleanup for multi-threading
|
583
583
|
*/
|
584
584
|
void xmlCleanupGlobalsInternal(void) {
|
585
|
-
|
585
|
+
nl_xmlResetError(&nl_xmlLastError);
|
586
586
|
|
587
587
|
xmlCleanupMutex(&xmlThrDefMutex);
|
588
588
|
__xmlGlobalInitMutexDestroy();
|
589
589
|
}
|
590
590
|
|
591
591
|
void
|
592
|
-
|
593
|
-
|
592
|
+
nl_xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
|
593
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
594
594
|
xmlGenericErrorContextThrDef = ctx;
|
595
595
|
if (handler != NULL)
|
596
596
|
xmlGenericErrorThrDef = handler;
|
597
597
|
else
|
598
|
-
xmlGenericErrorThrDef =
|
599
|
-
|
598
|
+
xmlGenericErrorThrDef = nl_xmlGenericErrorDefaultFunc;
|
599
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
600
600
|
}
|
601
601
|
|
602
602
|
void
|
603
|
-
|
604
|
-
|
603
|
+
nl_xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler) {
|
604
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
605
605
|
xmlStructuredErrorContextThrDef = ctx;
|
606
606
|
xmlStructuredErrorThrDef = handler;
|
607
|
-
|
607
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
608
608
|
}
|
609
609
|
|
610
610
|
/**
|
611
|
-
*
|
611
|
+
* nl_xmlRegisterNodeDefault:
|
612
612
|
* @func: function pointer to the new RegisterNodeFunc
|
613
613
|
*
|
614
614
|
* Registers a callback for node creation
|
@@ -616,32 +616,32 @@ xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler) {
|
|
616
616
|
* Returns the old value of the registration function
|
617
617
|
*/
|
618
618
|
xmlRegisterNodeFunc
|
619
|
-
|
619
|
+
nl_xmlRegisterNodeDefault(xmlRegisterNodeFunc func)
|
620
620
|
{
|
621
|
-
xmlRegisterNodeFunc old =
|
621
|
+
xmlRegisterNodeFunc old = nl_xmlRegisterNodeDefaultValue;
|
622
622
|
|
623
623
|
__xmlRegisterCallbacks = 1;
|
624
|
-
|
624
|
+
nl_xmlRegisterNodeDefaultValue = func;
|
625
625
|
return(old);
|
626
626
|
}
|
627
627
|
|
628
628
|
xmlRegisterNodeFunc
|
629
|
-
|
629
|
+
nl_xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func)
|
630
630
|
{
|
631
631
|
xmlRegisterNodeFunc old;
|
632
632
|
|
633
|
-
|
633
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
634
634
|
old = xmlRegisterNodeDefaultValueThrDef;
|
635
635
|
|
636
636
|
__xmlRegisterCallbacks = 1;
|
637
637
|
xmlRegisterNodeDefaultValueThrDef = func;
|
638
|
-
|
638
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
639
639
|
|
640
640
|
return(old);
|
641
641
|
}
|
642
642
|
|
643
643
|
/**
|
644
|
-
*
|
644
|
+
* nl_xmlDeregisterNodeDefault:
|
645
645
|
* @func: function pointer to the new DeregisterNodeFunc
|
646
646
|
*
|
647
647
|
* Registers a callback for node destruction
|
@@ -649,26 +649,26 @@ xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func)
|
|
649
649
|
* Returns the previous value of the deregistration function
|
650
650
|
*/
|
651
651
|
xmlDeregisterNodeFunc
|
652
|
-
|
652
|
+
nl_xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func)
|
653
653
|
{
|
654
|
-
xmlDeregisterNodeFunc old =
|
654
|
+
xmlDeregisterNodeFunc old = nl_xmlDeregisterNodeDefaultValue;
|
655
655
|
|
656
656
|
__xmlRegisterCallbacks = 1;
|
657
|
-
|
657
|
+
nl_xmlDeregisterNodeDefaultValue = func;
|
658
658
|
return(old);
|
659
659
|
}
|
660
660
|
|
661
661
|
xmlDeregisterNodeFunc
|
662
|
-
|
662
|
+
nl_xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func)
|
663
663
|
{
|
664
664
|
xmlDeregisterNodeFunc old;
|
665
665
|
|
666
|
-
|
666
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
667
667
|
old = xmlDeregisterNodeDefaultValueThrDef;
|
668
668
|
|
669
669
|
__xmlRegisterCallbacks = 1;
|
670
670
|
xmlDeregisterNodeDefaultValueThrDef = func;
|
671
|
-
|
671
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
672
672
|
|
673
673
|
return(old);
|
674
674
|
}
|
@@ -680,17 +680,17 @@ __htmlDefaultSAXHandler(void) {
|
|
680
680
|
if (IS_MAIN_THREAD)
|
681
681
|
return (&htmlDefaultSAXHandler);
|
682
682
|
else
|
683
|
-
return (&
|
683
|
+
return (&nl_xmlGetGlobalState()->htmlDefaultSAXHandler);
|
684
684
|
}
|
685
685
|
#endif
|
686
686
|
|
687
|
-
#undef
|
687
|
+
#undef nl_xmlLastError
|
688
688
|
xmlError *
|
689
|
-
|
689
|
+
__nl_xmlLastError(void) {
|
690
690
|
if (IS_MAIN_THREAD)
|
691
|
-
return (&
|
691
|
+
return (&nl_xmlLastError);
|
692
692
|
else
|
693
|
-
return (&
|
693
|
+
return (&nl_xmlGetGlobalState()->nl_xmlLastError);
|
694
694
|
}
|
695
695
|
|
696
696
|
/*
|
@@ -699,48 +699,48 @@ __xmlLastError(void) {
|
|
699
699
|
* the right place for them :-)
|
700
700
|
*/
|
701
701
|
#if defined(LIBXML_THREAD_ALLOC_ENABLED) && defined(LIBXML_THREAD_ENABLED)
|
702
|
-
#undef
|
702
|
+
#undef nl_xmlMalloc
|
703
703
|
xmlMallocFunc *
|
704
704
|
__xmlMalloc(void){
|
705
705
|
if (IS_MAIN_THREAD)
|
706
|
-
return (&
|
706
|
+
return (&nl_xmlMalloc);
|
707
707
|
else
|
708
|
-
return (&
|
708
|
+
return (&nl_xmlGetGlobalState()->nl_xmlMalloc);
|
709
709
|
}
|
710
710
|
|
711
|
-
#undef
|
711
|
+
#undef nl_xmlMallocAtomic
|
712
712
|
xmlMallocFunc *
|
713
713
|
__xmlMallocAtomic(void){
|
714
714
|
if (IS_MAIN_THREAD)
|
715
|
-
return (&
|
715
|
+
return (&nl_xmlMallocAtomic);
|
716
716
|
else
|
717
|
-
return (&
|
717
|
+
return (&nl_xmlGetGlobalState()->nl_xmlMallocAtomic);
|
718
718
|
}
|
719
719
|
|
720
|
-
#undef
|
720
|
+
#undef nl_xmlRealloc
|
721
721
|
xmlReallocFunc *
|
722
722
|
__xmlRealloc(void){
|
723
723
|
if (IS_MAIN_THREAD)
|
724
|
-
return (&
|
724
|
+
return (&nl_xmlRealloc);
|
725
725
|
else
|
726
|
-
return (&
|
726
|
+
return (&nl_xmlGetGlobalState()->nl_xmlRealloc);
|
727
727
|
}
|
728
728
|
|
729
|
-
#undef
|
729
|
+
#undef nl_xmlFree
|
730
730
|
xmlFreeFunc *
|
731
731
|
__xmlFree(void){
|
732
732
|
if (IS_MAIN_THREAD)
|
733
|
-
return (&
|
733
|
+
return (&nl_xmlFree);
|
734
734
|
else
|
735
|
-
return (&
|
735
|
+
return (&nl_xmlGetGlobalState()->nl_xmlFree);
|
736
736
|
}
|
737
737
|
|
738
738
|
xmlStrdupFunc *
|
739
739
|
__xmlMemStrdup(void){
|
740
740
|
if (IS_MAIN_THREAD)
|
741
|
-
return (&
|
741
|
+
return (&nl_xmlMemStrdup);
|
742
742
|
else
|
743
|
-
return (&
|
743
|
+
return (&nl_xmlGetGlobalState()->nl_xmlMemStrdup);
|
744
744
|
}
|
745
745
|
|
746
746
|
#endif
|
@@ -752,46 +752,46 @@ __xmlMemStrdup(void){
|
|
752
752
|
*/
|
753
753
|
|
754
754
|
|
755
|
-
#undef
|
755
|
+
#undef nl_oldXMLWDcompatibility
|
756
756
|
int *
|
757
|
-
|
757
|
+
__nl_oldXMLWDcompatibility(void) {
|
758
758
|
if (IS_MAIN_THREAD)
|
759
|
-
return (&
|
759
|
+
return (&nl_oldXMLWDcompatibility);
|
760
760
|
else
|
761
|
-
return (&
|
761
|
+
return (&nl_xmlGetGlobalState()->nl_oldXMLWDcompatibility);
|
762
762
|
}
|
763
763
|
|
764
|
-
#undef
|
764
|
+
#undef nl_xmlBufferAllocScheme
|
765
765
|
xmlBufferAllocationScheme *
|
766
|
-
|
766
|
+
__nl_xmlBufferAllocScheme(void) {
|
767
767
|
if (IS_MAIN_THREAD)
|
768
|
-
return (&
|
768
|
+
return (&nl_xmlBufferAllocScheme);
|
769
769
|
else
|
770
|
-
return (&
|
770
|
+
return (&nl_xmlGetGlobalState()->nl_xmlBufferAllocScheme);
|
771
771
|
}
|
772
|
-
xmlBufferAllocationScheme
|
772
|
+
xmlBufferAllocationScheme nl_xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v) {
|
773
773
|
xmlBufferAllocationScheme ret;
|
774
|
-
|
774
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
775
775
|
ret = xmlBufferAllocSchemeThrDef;
|
776
776
|
xmlBufferAllocSchemeThrDef = v;
|
777
|
-
|
777
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
778
778
|
return ret;
|
779
779
|
}
|
780
780
|
|
781
|
-
#undef
|
781
|
+
#undef nl_xmlDefaultBufferSize
|
782
782
|
int *
|
783
|
-
|
783
|
+
__nl_xmlDefaultBufferSize(void) {
|
784
784
|
if (IS_MAIN_THREAD)
|
785
|
-
return (&
|
785
|
+
return (&nl_xmlDefaultBufferSize);
|
786
786
|
else
|
787
|
-
return (&
|
787
|
+
return (&nl_xmlGetGlobalState()->nl_xmlDefaultBufferSize);
|
788
788
|
}
|
789
|
-
int
|
789
|
+
int nl_xmlThrDefDefaultBufferSize(int v) {
|
790
790
|
int ret;
|
791
|
-
|
791
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
792
792
|
ret = xmlDefaultBufferSizeThrDef;
|
793
793
|
xmlDefaultBufferSizeThrDef = v;
|
794
|
-
|
794
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
795
795
|
return ret;
|
796
796
|
}
|
797
797
|
|
@@ -802,284 +802,284 @@ __xmlDefaultSAXHandler(void) {
|
|
802
802
|
if (IS_MAIN_THREAD)
|
803
803
|
return (&xmlDefaultSAXHandler);
|
804
804
|
else
|
805
|
-
return (&
|
805
|
+
return (&nl_xmlGetGlobalState()->xmlDefaultSAXHandler);
|
806
806
|
}
|
807
807
|
#endif /* LIBXML_SAX1_ENABLED */
|
808
808
|
|
809
|
-
#undef
|
809
|
+
#undef nl_xmlDefaultSAXLocator
|
810
810
|
xmlSAXLocator *
|
811
|
-
|
811
|
+
__nl_xmlDefaultSAXLocator(void) {
|
812
812
|
if (IS_MAIN_THREAD)
|
813
|
-
return (&
|
813
|
+
return (&nl_xmlDefaultSAXLocator);
|
814
814
|
else
|
815
|
-
return (&
|
815
|
+
return (&nl_xmlGetGlobalState()->nl_xmlDefaultSAXLocator);
|
816
816
|
}
|
817
817
|
|
818
|
-
#undef
|
818
|
+
#undef nl_xmlDoValidityCheckingDefaultValue
|
819
819
|
int *
|
820
|
-
|
820
|
+
__nl_xmlDoValidityCheckingDefaultValue(void) {
|
821
821
|
if (IS_MAIN_THREAD)
|
822
|
-
return (&
|
822
|
+
return (&nl_xmlDoValidityCheckingDefaultValue);
|
823
823
|
else
|
824
|
-
return (&
|
824
|
+
return (&nl_xmlGetGlobalState()->nl_xmlDoValidityCheckingDefaultValue);
|
825
825
|
}
|
826
|
-
int
|
826
|
+
int nl_xmlThrDefDoValidityCheckingDefaultValue(int v) {
|
827
827
|
int ret;
|
828
|
-
|
828
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
829
829
|
ret = xmlDoValidityCheckingDefaultValueThrDef;
|
830
830
|
xmlDoValidityCheckingDefaultValueThrDef = v;
|
831
|
-
|
831
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
832
832
|
return ret;
|
833
833
|
}
|
834
834
|
|
835
|
-
#undef
|
835
|
+
#undef nl_xmlGenericError
|
836
836
|
xmlGenericErrorFunc *
|
837
|
-
|
837
|
+
__nl_xmlGenericError(void) {
|
838
838
|
if (IS_MAIN_THREAD)
|
839
|
-
return (&
|
839
|
+
return (&nl_xmlGenericError);
|
840
840
|
else
|
841
|
-
return (&
|
841
|
+
return (&nl_xmlGetGlobalState()->nl_xmlGenericError);
|
842
842
|
}
|
843
843
|
|
844
|
-
#undef
|
844
|
+
#undef nl_xmlStructuredError
|
845
845
|
xmlStructuredErrorFunc *
|
846
|
-
|
846
|
+
__nl_xmlStructuredError(void) {
|
847
847
|
if (IS_MAIN_THREAD)
|
848
|
-
return (&
|
848
|
+
return (&nl_xmlStructuredError);
|
849
849
|
else
|
850
|
-
return (&
|
850
|
+
return (&nl_xmlGetGlobalState()->nl_xmlStructuredError);
|
851
851
|
}
|
852
852
|
|
853
|
-
#undef
|
853
|
+
#undef nl_xmlGenericErrorContext
|
854
854
|
void * *
|
855
|
-
|
855
|
+
__nl_xmlGenericErrorContext(void) {
|
856
856
|
if (IS_MAIN_THREAD)
|
857
|
-
return (&
|
857
|
+
return (&nl_xmlGenericErrorContext);
|
858
858
|
else
|
859
|
-
return (&
|
859
|
+
return (&nl_xmlGetGlobalState()->nl_xmlGenericErrorContext);
|
860
860
|
}
|
861
861
|
|
862
|
-
#undef
|
862
|
+
#undef nl_xmlStructuredErrorContext
|
863
863
|
void * *
|
864
|
-
|
864
|
+
__nl_xmlStructuredErrorContext(void) {
|
865
865
|
if (IS_MAIN_THREAD)
|
866
|
-
return (&
|
866
|
+
return (&nl_xmlStructuredErrorContext);
|
867
867
|
else
|
868
|
-
return (&
|
868
|
+
return (&nl_xmlGetGlobalState()->nl_xmlStructuredErrorContext);
|
869
869
|
}
|
870
870
|
|
871
|
-
#undef
|
871
|
+
#undef nl_xmlGetWarningsDefaultValue
|
872
872
|
int *
|
873
|
-
|
873
|
+
__nl_xmlGetWarningsDefaultValue(void) {
|
874
874
|
if (IS_MAIN_THREAD)
|
875
|
-
return (&
|
875
|
+
return (&nl_xmlGetWarningsDefaultValue);
|
876
876
|
else
|
877
|
-
return (&
|
877
|
+
return (&nl_xmlGetGlobalState()->nl_xmlGetWarningsDefaultValue);
|
878
878
|
}
|
879
|
-
int
|
879
|
+
int nl_xmlThrDefGetWarningsDefaultValue(int v) {
|
880
880
|
int ret;
|
881
|
-
|
881
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
882
882
|
ret = xmlGetWarningsDefaultValueThrDef;
|
883
883
|
xmlGetWarningsDefaultValueThrDef = v;
|
884
|
-
|
884
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
885
885
|
return ret;
|
886
886
|
}
|
887
887
|
|
888
|
-
#undef
|
888
|
+
#undef nl_xmlIndentTreeOutput
|
889
889
|
int *
|
890
|
-
|
890
|
+
__nl_xmlIndentTreeOutput(void) {
|
891
891
|
if (IS_MAIN_THREAD)
|
892
|
-
return (&
|
892
|
+
return (&nl_xmlIndentTreeOutput);
|
893
893
|
else
|
894
|
-
return (&
|
894
|
+
return (&nl_xmlGetGlobalState()->nl_xmlIndentTreeOutput);
|
895
895
|
}
|
896
|
-
int
|
896
|
+
int nl_xmlThrDefIndentTreeOutput(int v) {
|
897
897
|
int ret;
|
898
|
-
|
898
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
899
899
|
ret = xmlIndentTreeOutputThrDef;
|
900
900
|
xmlIndentTreeOutputThrDef = v;
|
901
|
-
|
901
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
902
902
|
return ret;
|
903
903
|
}
|
904
904
|
|
905
|
-
#undef
|
905
|
+
#undef nl_xmlTreeIndentString
|
906
906
|
const char * *
|
907
|
-
|
907
|
+
__nl_xmlTreeIndentString(void) {
|
908
908
|
if (IS_MAIN_THREAD)
|
909
|
-
return (&
|
909
|
+
return (&nl_xmlTreeIndentString);
|
910
910
|
else
|
911
|
-
return (&
|
911
|
+
return (&nl_xmlGetGlobalState()->nl_xmlTreeIndentString);
|
912
912
|
}
|
913
|
-
const char *
|
913
|
+
const char * nl_xmlThrDefTreeIndentString(const char * v) {
|
914
914
|
const char * ret;
|
915
|
-
|
915
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
916
916
|
ret = xmlTreeIndentStringThrDef;
|
917
917
|
xmlTreeIndentStringThrDef = v;
|
918
|
-
|
918
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
919
919
|
return ret;
|
920
920
|
}
|
921
921
|
|
922
|
-
#undef
|
922
|
+
#undef nl_xmlKeepBlanksDefaultValue
|
923
923
|
int *
|
924
|
-
|
924
|
+
__nl_xmlKeepBlanksDefaultValue(void) {
|
925
925
|
if (IS_MAIN_THREAD)
|
926
|
-
return (&
|
926
|
+
return (&nl_xmlKeepBlanksDefaultValue);
|
927
927
|
else
|
928
|
-
return (&
|
928
|
+
return (&nl_xmlGetGlobalState()->nl_xmlKeepBlanksDefaultValue);
|
929
929
|
}
|
930
|
-
int
|
930
|
+
int nl_xmlThrDefKeepBlanksDefaultValue(int v) {
|
931
931
|
int ret;
|
932
|
-
|
932
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
933
933
|
ret = xmlKeepBlanksDefaultValueThrDef;
|
934
934
|
xmlKeepBlanksDefaultValueThrDef = v;
|
935
|
-
|
935
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
936
936
|
return ret;
|
937
937
|
}
|
938
938
|
|
939
|
-
#undef
|
939
|
+
#undef nl_xmlLineNumbersDefaultValue
|
940
940
|
int *
|
941
|
-
|
941
|
+
__nl_xmlLineNumbersDefaultValue(void) {
|
942
942
|
if (IS_MAIN_THREAD)
|
943
|
-
return (&
|
943
|
+
return (&nl_xmlLineNumbersDefaultValue);
|
944
944
|
else
|
945
|
-
return (&
|
945
|
+
return (&nl_xmlGetGlobalState()->nl_xmlLineNumbersDefaultValue);
|
946
946
|
}
|
947
|
-
int
|
947
|
+
int nl_xmlThrDefLineNumbersDefaultValue(int v) {
|
948
948
|
int ret;
|
949
|
-
|
949
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
950
950
|
ret = xmlLineNumbersDefaultValueThrDef;
|
951
951
|
xmlLineNumbersDefaultValueThrDef = v;
|
952
|
-
|
952
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
953
953
|
return ret;
|
954
954
|
}
|
955
955
|
|
956
|
-
#undef
|
956
|
+
#undef nl_xmlLoadExtDtdDefaultValue
|
957
957
|
int *
|
958
|
-
|
958
|
+
__nl_xmlLoadExtDtdDefaultValue(void) {
|
959
959
|
if (IS_MAIN_THREAD)
|
960
|
-
return (&
|
960
|
+
return (&nl_xmlLoadExtDtdDefaultValue);
|
961
961
|
else
|
962
|
-
return (&
|
962
|
+
return (&nl_xmlGetGlobalState()->nl_xmlLoadExtDtdDefaultValue);
|
963
963
|
}
|
964
|
-
int
|
964
|
+
int nl_xmlThrDefLoadExtDtdDefaultValue(int v) {
|
965
965
|
int ret;
|
966
|
-
|
966
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
967
967
|
ret = xmlLoadExtDtdDefaultValueThrDef;
|
968
968
|
xmlLoadExtDtdDefaultValueThrDef = v;
|
969
|
-
|
969
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
970
970
|
return ret;
|
971
971
|
}
|
972
972
|
|
973
|
-
#undef
|
973
|
+
#undef nl_xmlParserDebugEntities
|
974
974
|
int *
|
975
|
-
|
975
|
+
__nl_xmlParserDebugEntities(void) {
|
976
976
|
if (IS_MAIN_THREAD)
|
977
|
-
return (&
|
977
|
+
return (&nl_xmlParserDebugEntities);
|
978
978
|
else
|
979
|
-
return (&
|
979
|
+
return (&nl_xmlGetGlobalState()->nl_xmlParserDebugEntities);
|
980
980
|
}
|
981
|
-
int
|
981
|
+
int nl_xmlThrDefParserDebugEntities(int v) {
|
982
982
|
int ret;
|
983
|
-
|
983
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
984
984
|
ret = xmlParserDebugEntitiesThrDef;
|
985
985
|
xmlParserDebugEntitiesThrDef = v;
|
986
|
-
|
986
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
987
987
|
return ret;
|
988
988
|
}
|
989
989
|
|
990
|
-
#undef
|
990
|
+
#undef nl_xmlParserVersion
|
991
991
|
const char * *
|
992
|
-
|
992
|
+
__nl_xmlParserVersion(void) {
|
993
993
|
if (IS_MAIN_THREAD)
|
994
|
-
return (&
|
994
|
+
return (&nl_xmlParserVersion);
|
995
995
|
else
|
996
|
-
return (&
|
996
|
+
return (&nl_xmlGetGlobalState()->nl_xmlParserVersion);
|
997
997
|
}
|
998
998
|
|
999
|
-
#undef
|
999
|
+
#undef nl_xmlPedanticParserDefaultValue
|
1000
1000
|
int *
|
1001
|
-
|
1001
|
+
__nl_xmlPedanticParserDefaultValue(void) {
|
1002
1002
|
if (IS_MAIN_THREAD)
|
1003
|
-
return (&
|
1003
|
+
return (&nl_xmlPedanticParserDefaultValue);
|
1004
1004
|
else
|
1005
|
-
return (&
|
1005
|
+
return (&nl_xmlGetGlobalState()->nl_xmlPedanticParserDefaultValue);
|
1006
1006
|
}
|
1007
|
-
int
|
1007
|
+
int nl_xmlThrDefPedanticParserDefaultValue(int v) {
|
1008
1008
|
int ret;
|
1009
|
-
|
1009
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
1010
1010
|
ret = xmlPedanticParserDefaultValueThrDef;
|
1011
1011
|
xmlPedanticParserDefaultValueThrDef = v;
|
1012
|
-
|
1012
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
1013
1013
|
return ret;
|
1014
1014
|
}
|
1015
1015
|
|
1016
|
-
#undef
|
1016
|
+
#undef nl_xmlSaveNoEmptyTags
|
1017
1017
|
int *
|
1018
|
-
|
1018
|
+
__nl_xmlSaveNoEmptyTags(void) {
|
1019
1019
|
if (IS_MAIN_THREAD)
|
1020
|
-
return (&
|
1020
|
+
return (&nl_xmlSaveNoEmptyTags);
|
1021
1021
|
else
|
1022
|
-
return (&
|
1022
|
+
return (&nl_xmlGetGlobalState()->nl_xmlSaveNoEmptyTags);
|
1023
1023
|
}
|
1024
|
-
int
|
1024
|
+
int nl_xmlThrDefSaveNoEmptyTags(int v) {
|
1025
1025
|
int ret;
|
1026
|
-
|
1026
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
1027
1027
|
ret = xmlSaveNoEmptyTagsThrDef;
|
1028
1028
|
xmlSaveNoEmptyTagsThrDef = v;
|
1029
|
-
|
1029
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
1030
1030
|
return ret;
|
1031
1031
|
}
|
1032
1032
|
|
1033
|
-
#undef
|
1033
|
+
#undef nl_xmlSubstituteEntitiesDefaultValue
|
1034
1034
|
int *
|
1035
|
-
|
1035
|
+
__nl_xmlSubstituteEntitiesDefaultValue(void) {
|
1036
1036
|
if (IS_MAIN_THREAD)
|
1037
|
-
return (&
|
1037
|
+
return (&nl_xmlSubstituteEntitiesDefaultValue);
|
1038
1038
|
else
|
1039
|
-
return (&
|
1039
|
+
return (&nl_xmlGetGlobalState()->nl_xmlSubstituteEntitiesDefaultValue);
|
1040
1040
|
}
|
1041
|
-
int
|
1041
|
+
int nl_xmlThrDefSubstituteEntitiesDefaultValue(int v) {
|
1042
1042
|
int ret;
|
1043
|
-
|
1043
|
+
nl_xmlMutexLock(&xmlThrDefMutex);
|
1044
1044
|
ret = xmlSubstituteEntitiesDefaultValueThrDef;
|
1045
1045
|
xmlSubstituteEntitiesDefaultValueThrDef = v;
|
1046
|
-
|
1046
|
+
nl_xmlMutexUnlock(&xmlThrDefMutex);
|
1047
1047
|
return ret;
|
1048
1048
|
}
|
1049
1049
|
|
1050
|
-
#undef
|
1050
|
+
#undef nl_xmlRegisterNodeDefaultValue
|
1051
1051
|
xmlRegisterNodeFunc *
|
1052
|
-
|
1052
|
+
__nl_xmlRegisterNodeDefaultValue(void) {
|
1053
1053
|
if (IS_MAIN_THREAD)
|
1054
|
-
return (&
|
1054
|
+
return (&nl_xmlRegisterNodeDefaultValue);
|
1055
1055
|
else
|
1056
|
-
return (&
|
1056
|
+
return (&nl_xmlGetGlobalState()->nl_xmlRegisterNodeDefaultValue);
|
1057
1057
|
}
|
1058
1058
|
|
1059
|
-
#undef
|
1059
|
+
#undef nl_xmlDeregisterNodeDefaultValue
|
1060
1060
|
xmlDeregisterNodeFunc *
|
1061
|
-
|
1061
|
+
__nl_xmlDeregisterNodeDefaultValue(void) {
|
1062
1062
|
if (IS_MAIN_THREAD)
|
1063
|
-
return (&
|
1063
|
+
return (&nl_xmlDeregisterNodeDefaultValue);
|
1064
1064
|
else
|
1065
|
-
return (&
|
1065
|
+
return (&nl_xmlGetGlobalState()->nl_xmlDeregisterNodeDefaultValue);
|
1066
1066
|
}
|
1067
1067
|
|
1068
|
-
#undef
|
1068
|
+
#undef nl_xmlParserInputBufferCreateFilenameValue
|
1069
1069
|
xmlParserInputBufferCreateFilenameFunc *
|
1070
|
-
|
1070
|
+
__nl_xmlParserInputBufferCreateFilenameValue(void) {
|
1071
1071
|
if (IS_MAIN_THREAD)
|
1072
|
-
return (&
|
1072
|
+
return (&nl_xmlParserInputBufferCreateFilenameValue);
|
1073
1073
|
else
|
1074
|
-
return (&
|
1074
|
+
return (&nl_xmlGetGlobalState()->nl_xmlParserInputBufferCreateFilenameValue);
|
1075
1075
|
}
|
1076
1076
|
|
1077
|
-
#undef
|
1077
|
+
#undef nl_xmlOutputBufferCreateFilenameValue
|
1078
1078
|
xmlOutputBufferCreateFilenameFunc *
|
1079
|
-
|
1079
|
+
__nl_xmlOutputBufferCreateFilenameValue(void) {
|
1080
1080
|
if (IS_MAIN_THREAD)
|
1081
|
-
return (&
|
1081
|
+
return (&nl_xmlOutputBufferCreateFilenameValue);
|
1082
1082
|
else
|
1083
|
-
return (&
|
1083
|
+
return (&nl_xmlGetGlobalState()->nl_xmlOutputBufferCreateFilenameValue);
|
1084
1084
|
}
|
1085
1085
|
|