@img/sharp-libvips-dev 1.2.2 → 1.2.4-rc.0
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.
- package/include/archive.h +2 -2
- package/include/archive_entry.h +1 -1
- package/include/expat.h +39 -25
- package/include/expat_config.h +9 -9
- package/include/expat_external.h +62 -61
- package/include/harfbuzz/hb-ot-layout.h +6 -0
- package/include/harfbuzz/hb-script-list.h +1 -1
- package/include/harfbuzz/hb-subset.h +5 -0
- package/include/harfbuzz/hb-version.h +3 -3
- package/include/jconfig.h +37 -14
- package/include/jerror.h +47 -42
- package/include/jmorecfg.h +21 -18
- package/include/jpeglib.h +216 -132
- package/include/librsvg-2.0/librsvg/rsvg-version.h +2 -2
- package/include/libxml2/libxml/HTMLparser.h +159 -101
- package/include/libxml2/libxml/HTMLtree.h +49 -74
- package/include/libxml2/libxml/SAX.h +8 -5
- package/include/libxml2/libxml/SAX2.h +18 -15
- package/include/libxml2/libxml/c14n.h +30 -29
- package/include/libxml2/libxml/catalog.h +47 -22
- package/include/libxml2/libxml/chvalid.h +52 -64
- package/include/libxml2/libxml/debugXML.h +18 -15
- package/include/libxml2/libxml/dict.h +22 -19
- package/include/libxml2/libxml/encoding.h +144 -111
- package/include/libxml2/libxml/entities.h +95 -75
- package/include/libxml2/libxml/globals.h +7 -4
- package/include/libxml2/libxml/hash.h +61 -64
- package/include/libxml2/libxml/list.h +59 -51
- package/include/libxml2/libxml/nanoftp.h +7 -4
- package/include/libxml2/libxml/nanohttp.h +10 -7
- package/include/libxml2/libxml/parser.h +1091 -563
- package/include/libxml2/libxml/parserInternals.h +167 -214
- package/include/libxml2/libxml/pattern.h +29 -31
- package/include/libxml2/libxml/relaxng.h +59 -58
- package/include/libxml2/libxml/schemasInternals.h +114 -268
- package/include/libxml2/libxml/schematron.h +59 -51
- package/include/libxml2/libxml/threads.h +19 -20
- package/include/libxml2/libxml/tree.h +873 -623
- package/include/libxml2/libxml/uri.h +21 -22
- package/include/libxml2/libxml/valid.h +169 -199
- package/include/libxml2/libxml/xinclude.h +24 -43
- package/include/libxml2/libxml/xlink.h +55 -51
- package/include/libxml2/libxml/xmlIO.h +127 -145
- package/include/libxml2/libxml/xmlautomata.h +66 -65
- package/include/libxml2/libxml/xmlerror.h +197 -94
- package/include/libxml2/libxml/xmlexports.h +20 -18
- package/include/libxml2/libxml/xmlmemory.h +44 -29
- package/include/libxml2/libxml/xmlmodule.h +14 -15
- package/include/libxml2/libxml/xmlreader.h +137 -131
- package/include/libxml2/libxml/xmlregexp.h +28 -31
- package/include/libxml2/libxml/xmlsave.h +81 -36
- package/include/libxml2/libxml/xmlschemas.h +61 -67
- package/include/libxml2/libxml/xmlschemastypes.h +60 -54
- package/include/libxml2/libxml/xmlstring.h +8 -9
- package/include/libxml2/libxml/xmlunicode.h +6 -3
- package/include/libxml2/libxml/xmlversion.h +44 -121
- package/include/libxml2/libxml/xmlwriter.h +97 -97
- package/include/libxml2/libxml/xpath.h +235 -232
- package/include/libxml2/libxml/xpathInternals.h +247 -277
- package/include/libxml2/libxml/xpointer.h +21 -17
- package/include/tiff.h +1 -0
- package/include/tiffconf.h +1 -1
- package/include/tiffio.h +23 -5
- package/include/tiffvers.h +4 -4
- package/include/vips/version.h +4 -4
- package/package.json +1 -1
- package/versions.json +9 -9
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
1
|
+
/**
|
|
2
|
+
* @file
|
|
3
|
+
*
|
|
4
|
+
* @brief XML Path Language implementation
|
|
5
|
+
*
|
|
6
|
+
* API for the XML Path Language implementation
|
|
4
7
|
*
|
|
5
8
|
* XML Path Language implementation
|
|
6
9
|
* XPath is a language for addressing parts of an XML document,
|
|
@@ -11,9 +14,9 @@
|
|
|
11
14
|
* W3C Recommendation 16 November 1999
|
|
12
15
|
* http://www.w3.org/TR/1999/REC-xpath-19991116
|
|
13
16
|
*
|
|
14
|
-
*
|
|
17
|
+
* @copyright See Copyright for the status of this software.
|
|
15
18
|
*
|
|
16
|
-
*
|
|
19
|
+
* @author Daniel Veillard
|
|
17
20
|
*/
|
|
18
21
|
|
|
19
22
|
#ifndef __XML_XPATH_H__
|
|
@@ -31,8 +34,10 @@
|
|
|
31
34
|
extern "C" {
|
|
32
35
|
#endif
|
|
33
36
|
|
|
37
|
+
/** XPath context */
|
|
34
38
|
typedef struct _xmlXPathContext xmlXPathContext;
|
|
35
39
|
typedef xmlXPathContext *xmlXPathContextPtr;
|
|
40
|
+
/** XPath parser and evaluation context */
|
|
36
41
|
typedef struct _xmlXPathParserContext xmlXPathParserContext;
|
|
37
42
|
typedef xmlXPathParserContext *xmlXPathParserContextPtr;
|
|
38
43
|
|
|
@@ -70,29 +75,30 @@ typedef enum {
|
|
|
70
75
|
XPATH_RECURSION_LIMIT_EXCEEDED
|
|
71
76
|
} xmlXPathError;
|
|
72
77
|
|
|
73
|
-
|
|
74
|
-
* A node-set (an unordered collection of nodes without duplicates).
|
|
75
|
-
*/
|
|
78
|
+
/** XPath node set */
|
|
76
79
|
typedef struct _xmlNodeSet xmlNodeSet;
|
|
77
80
|
typedef xmlNodeSet *xmlNodeSetPtr;
|
|
81
|
+
/**
|
|
82
|
+
* A node-set (an unordered collection of nodes without duplicates).
|
|
83
|
+
*/
|
|
78
84
|
struct _xmlNodeSet {
|
|
79
|
-
|
|
80
|
-
int
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
/** number of nodes in the set */
|
|
86
|
+
int nodeNr;
|
|
87
|
+
/** size of the array as allocated */
|
|
88
|
+
int nodeMax;
|
|
89
|
+
/** array of nodes in no particular order */
|
|
90
|
+
xmlNode **nodeTab;
|
|
83
91
|
};
|
|
84
92
|
|
|
85
|
-
|
|
93
|
+
/**
|
|
86
94
|
* An expression is evaluated to yield an object, which
|
|
87
95
|
* has one of the following four basic types:
|
|
96
|
+
*
|
|
88
97
|
* - node-set
|
|
89
98
|
* - boolean
|
|
90
99
|
* - number
|
|
91
100
|
* - string
|
|
92
|
-
*
|
|
93
|
-
* @@ XPointer will add more types !
|
|
94
101
|
*/
|
|
95
|
-
|
|
96
102
|
typedef enum {
|
|
97
103
|
XPATH_UNDEFINED = 0,
|
|
98
104
|
XPATH_NODESET = 1,
|
|
@@ -103,19 +109,28 @@ typedef enum {
|
|
|
103
109
|
XPATH_XSLT_TREE = 9 /* An XSLT value tree, non modifiable */
|
|
104
110
|
} xmlXPathObjectType;
|
|
105
111
|
|
|
106
|
-
/**
|
|
112
|
+
/** @cond IGNORE */
|
|
107
113
|
#define XPATH_POINT 5
|
|
108
114
|
#define XPATH_RANGE 6
|
|
109
115
|
#define XPATH_LOCATIONSET 7
|
|
110
|
-
/**
|
|
116
|
+
/** @endcond */
|
|
111
117
|
|
|
118
|
+
/** XPath object */
|
|
112
119
|
typedef struct _xmlXPathObject xmlXPathObject;
|
|
113
120
|
typedef xmlXPathObject *xmlXPathObjectPtr;
|
|
121
|
+
/**
|
|
122
|
+
* An XPath object
|
|
123
|
+
*/
|
|
114
124
|
struct _xmlXPathObject {
|
|
125
|
+
/** object type */
|
|
115
126
|
xmlXPathObjectType type;
|
|
116
|
-
|
|
127
|
+
/** node set */
|
|
128
|
+
xmlNodeSet *nodesetval;
|
|
129
|
+
/** boolean */
|
|
117
130
|
int boolval;
|
|
131
|
+
/** number */
|
|
118
132
|
double floatval;
|
|
133
|
+
/** string */
|
|
119
134
|
xmlChar *stringval;
|
|
120
135
|
void *user;
|
|
121
136
|
int index;
|
|
@@ -123,22 +138,12 @@ struct _xmlXPathObject {
|
|
|
123
138
|
int index2;
|
|
124
139
|
};
|
|
125
140
|
|
|
126
|
-
/**
|
|
127
|
-
* xmlXPathConvertFunc:
|
|
128
|
-
* @obj: an XPath object
|
|
129
|
-
* @type: the number of the target type
|
|
130
|
-
*
|
|
131
|
-
* A conversion function is associated to a type and used to cast
|
|
132
|
-
* the new type to primitive values.
|
|
133
|
-
*
|
|
134
|
-
* Returns -1 in case of error, 0 otherwise
|
|
135
|
-
*/
|
|
136
|
-
typedef int (*xmlXPathConvertFunc) (xmlXPathObjectPtr obj, int type);
|
|
141
|
+
/** @cond ignore */
|
|
137
142
|
|
|
138
143
|
/*
|
|
139
|
-
*
|
|
144
|
+
* unused
|
|
140
145
|
*/
|
|
141
|
-
|
|
146
|
+
typedef int (*xmlXPathConvertFunc) (xmlXPathObject *obj, int type);
|
|
142
147
|
typedef struct _xmlXPathType xmlXPathType;
|
|
143
148
|
typedef xmlXPathType *xmlXPathTypePtr;
|
|
144
149
|
struct _xmlXPathType {
|
|
@@ -147,31 +152,20 @@ struct _xmlXPathType {
|
|
|
147
152
|
};
|
|
148
153
|
|
|
149
154
|
/*
|
|
150
|
-
*
|
|
155
|
+
* unused
|
|
151
156
|
*/
|
|
152
|
-
|
|
153
157
|
typedef struct _xmlXPathVariable xmlXPathVariable;
|
|
154
158
|
typedef xmlXPathVariable *xmlXPathVariablePtr;
|
|
155
159
|
struct _xmlXPathVariable {
|
|
156
160
|
const xmlChar *name; /* the variable name */
|
|
157
|
-
|
|
161
|
+
xmlXPathObject *value; /* the value */
|
|
158
162
|
};
|
|
159
163
|
|
|
160
|
-
/**
|
|
161
|
-
* xmlXPathEvalFunc:
|
|
162
|
-
* @ctxt: an XPath parser context
|
|
163
|
-
* @nargs: the number of arguments passed to the function
|
|
164
|
-
*
|
|
165
|
-
* An XPath evaluation function, the parameters are on the XPath context stack.
|
|
166
|
-
*/
|
|
167
|
-
|
|
168
|
-
typedef void (*xmlXPathEvalFunc)(xmlXPathParserContextPtr ctxt,
|
|
169
|
-
int nargs);
|
|
170
|
-
|
|
171
164
|
/*
|
|
172
|
-
*
|
|
165
|
+
* unused
|
|
173
166
|
*/
|
|
174
|
-
|
|
167
|
+
typedef void (*xmlXPathEvalFunc)(xmlXPathParserContext *ctxt,
|
|
168
|
+
int nargs);
|
|
175
169
|
typedef struct _xmlXPathFunct xmlXPathFunct;
|
|
176
170
|
typedef xmlXPathFunct *xmlXPathFuncPtr;
|
|
177
171
|
struct _xmlXPathFunct {
|
|
@@ -179,25 +173,11 @@ struct _xmlXPathFunct {
|
|
|
179
173
|
xmlXPathEvalFunc func; /* the evaluation function */
|
|
180
174
|
};
|
|
181
175
|
|
|
182
|
-
/**
|
|
183
|
-
* xmlXPathAxisFunc:
|
|
184
|
-
* @ctxt: the XPath interpreter context
|
|
185
|
-
* @cur: the previous node being explored on that axis
|
|
186
|
-
*
|
|
187
|
-
* An axis traversal function. To traverse an axis, the engine calls
|
|
188
|
-
* the first time with cur == NULL and repeat until the function returns
|
|
189
|
-
* NULL indicating the end of the axis traversal.
|
|
190
|
-
*
|
|
191
|
-
* Returns the next node in that axis or NULL if at the end of the axis.
|
|
192
|
-
*/
|
|
193
|
-
|
|
194
|
-
typedef xmlXPathObjectPtr (*xmlXPathAxisFunc) (xmlXPathParserContextPtr ctxt,
|
|
195
|
-
xmlXPathObjectPtr cur);
|
|
196
|
-
|
|
197
176
|
/*
|
|
198
|
-
*
|
|
177
|
+
* unused
|
|
199
178
|
*/
|
|
200
|
-
|
|
179
|
+
typedef xmlXPathObject *(*xmlXPathAxisFunc) (xmlXPathParserContext *ctxt,
|
|
180
|
+
xmlXPathObject *cur);
|
|
201
181
|
typedef struct _xmlXPathAxis xmlXPathAxis;
|
|
202
182
|
typedef xmlXPathAxis *xmlXPathAxisPtr;
|
|
203
183
|
struct _xmlXPathAxis {
|
|
@@ -205,72 +185,62 @@ struct _xmlXPathAxis {
|
|
|
205
185
|
xmlXPathAxisFunc func; /* the search function */
|
|
206
186
|
};
|
|
207
187
|
|
|
188
|
+
/** @endcond */
|
|
189
|
+
|
|
208
190
|
/**
|
|
209
|
-
* xmlXPathFunction:
|
|
210
|
-
* @ctxt: the XPath interprestation context
|
|
211
|
-
* @nargs: the number of arguments
|
|
212
|
-
*
|
|
213
191
|
* An XPath function.
|
|
214
192
|
* The arguments (if any) are popped out from the context stack
|
|
215
193
|
* and the result is pushed on the stack.
|
|
194
|
+
*
|
|
195
|
+
* @param ctxt the XPath interprestation context
|
|
196
|
+
* @param nargs the number of arguments
|
|
216
197
|
*/
|
|
217
198
|
|
|
218
|
-
typedef void (*xmlXPathFunction) (
|
|
199
|
+
typedef void (*xmlXPathFunction) (xmlXPathParserContext *ctxt, int nargs);
|
|
219
200
|
|
|
220
201
|
/*
|
|
221
202
|
* Function and Variable Lookup.
|
|
222
203
|
*/
|
|
223
204
|
|
|
224
205
|
/**
|
|
225
|
-
* xmlXPathVariableLookupFunc:
|
|
226
|
-
* @ctxt: an XPath context
|
|
227
|
-
* @name: name of the variable
|
|
228
|
-
* @ns_uri: the namespace name hosting this variable
|
|
229
|
-
*
|
|
230
206
|
* Prototype for callbacks used to plug variable lookup in the XPath
|
|
231
207
|
* engine.
|
|
232
208
|
*
|
|
233
|
-
*
|
|
209
|
+
* @param ctxt an XPath context
|
|
210
|
+
* @param name name of the variable
|
|
211
|
+
* @param ns_uri the namespace name hosting this variable
|
|
212
|
+
* @returns the XPath object value or NULL if not found.
|
|
234
213
|
*/
|
|
235
|
-
typedef
|
|
214
|
+
typedef xmlXPathObject *(*xmlXPathVariableLookupFunc) (void *ctxt,
|
|
236
215
|
const xmlChar *name,
|
|
237
216
|
const xmlChar *ns_uri);
|
|
238
217
|
|
|
239
218
|
/**
|
|
240
|
-
* xmlXPathFuncLookupFunc:
|
|
241
|
-
* @ctxt: an XPath context
|
|
242
|
-
* @name: name of the function
|
|
243
|
-
* @ns_uri: the namespace name hosting this function
|
|
244
|
-
*
|
|
245
219
|
* Prototype for callbacks used to plug function lookup in the XPath
|
|
246
220
|
* engine.
|
|
247
221
|
*
|
|
248
|
-
*
|
|
222
|
+
* @param ctxt an XPath context
|
|
223
|
+
* @param name name of the function
|
|
224
|
+
* @param ns_uri the namespace name hosting this function
|
|
225
|
+
* @returns the XPath function or NULL if not found.
|
|
249
226
|
*/
|
|
250
227
|
typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt,
|
|
251
228
|
const xmlChar *name,
|
|
252
229
|
const xmlChar *ns_uri);
|
|
253
230
|
|
|
254
231
|
/**
|
|
255
|
-
* xmlXPathFlags:
|
|
256
232
|
* Flags for XPath engine compilation and runtime
|
|
257
233
|
*/
|
|
258
234
|
/**
|
|
259
|
-
* XML_XPATH_CHECKNS:
|
|
260
|
-
*
|
|
261
235
|
* check namespaces at compilation
|
|
262
236
|
*/
|
|
263
237
|
#define XML_XPATH_CHECKNS (1<<0)
|
|
264
238
|
/**
|
|
265
|
-
* XML_XPATH_NOVAR:
|
|
266
|
-
*
|
|
267
239
|
* forbid variables in expression
|
|
268
240
|
*/
|
|
269
241
|
#define XML_XPATH_NOVAR (1<<1)
|
|
270
242
|
|
|
271
243
|
/**
|
|
272
|
-
* xmlXPathContext:
|
|
273
|
-
*
|
|
274
244
|
* Expression evaluation occurs with respect to a context.
|
|
275
245
|
* he context consists of:
|
|
276
246
|
* - a node (the context node)
|
|
@@ -284,71 +254,98 @@ typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt,
|
|
|
284
254
|
* for an XPath evaluation so you may need to initialize it again
|
|
285
255
|
* before the next call.
|
|
286
256
|
*/
|
|
287
|
-
|
|
288
257
|
struct _xmlXPathContext {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
int
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
int
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
/*
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
/*
|
|
318
|
-
int
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
/*
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
void *extra; /* needed for XSLT */
|
|
258
|
+
/** The current document */
|
|
259
|
+
xmlDoc *doc;
|
|
260
|
+
/** The current node */
|
|
261
|
+
xmlNode *node;
|
|
262
|
+
|
|
263
|
+
/* unused (hash table) */
|
|
264
|
+
int nb_variables_unused;
|
|
265
|
+
/* unused (hash table) */
|
|
266
|
+
int max_variables_unused;
|
|
267
|
+
/* Hash table of defined variables */
|
|
268
|
+
xmlHashTable *varHash;
|
|
269
|
+
|
|
270
|
+
/* number of defined types */
|
|
271
|
+
int nb_types;
|
|
272
|
+
/* max number of types */
|
|
273
|
+
int max_types;
|
|
274
|
+
/* Array of defined types */
|
|
275
|
+
xmlXPathType *types;
|
|
276
|
+
|
|
277
|
+
/* unused (hash table) */
|
|
278
|
+
int nb_funcs_unused;
|
|
279
|
+
/* unused (hash table) */
|
|
280
|
+
int max_funcs_unused;
|
|
281
|
+
/* Hash table of defined funcs */
|
|
282
|
+
xmlHashTable *funcHash;
|
|
283
|
+
|
|
284
|
+
/* number of defined axis */
|
|
285
|
+
int nb_axis;
|
|
286
|
+
/* max number of axis */
|
|
287
|
+
int max_axis;
|
|
288
|
+
/* Array of defined axis */
|
|
289
|
+
xmlXPathAxis *axis;
|
|
290
|
+
|
|
291
|
+
/* Array of namespaces */
|
|
292
|
+
xmlNs **namespaces;
|
|
293
|
+
/* number of namespace in scope */
|
|
294
|
+
int nsNr;
|
|
295
|
+
/* function to free */
|
|
296
|
+
void *user;
|
|
329
297
|
|
|
330
|
-
|
|
298
|
+
/** the context size */
|
|
299
|
+
int contextSize;
|
|
300
|
+
/** the proximity position */
|
|
301
|
+
int proximityPosition;
|
|
302
|
+
|
|
303
|
+
/* is this an XPointer context? */
|
|
304
|
+
int xptr;
|
|
305
|
+
/* for here() */
|
|
306
|
+
xmlNode *here;
|
|
307
|
+
/* for origin() */
|
|
308
|
+
xmlNode *origin;
|
|
309
|
+
|
|
310
|
+
/* The namespaces hash table */
|
|
311
|
+
xmlHashTable *nsHash;
|
|
312
|
+
/* variable lookup func */
|
|
313
|
+
xmlXPathVariableLookupFunc varLookupFunc;
|
|
314
|
+
/* variable lookup data */
|
|
315
|
+
void *varLookupData;
|
|
316
|
+
|
|
317
|
+
/* needed for XSLT */
|
|
318
|
+
void *extra;
|
|
319
|
+
|
|
320
|
+
/* The function name when calling a function */
|
|
331
321
|
const xmlChar *function;
|
|
322
|
+
/* The namespace URI when calling a function */
|
|
332
323
|
const xmlChar *functionURI;
|
|
333
324
|
|
|
334
|
-
/* function lookup
|
|
335
|
-
xmlXPathFuncLookupFunc funcLookupFunc
|
|
336
|
-
|
|
325
|
+
/* function lookup func */
|
|
326
|
+
xmlXPathFuncLookupFunc funcLookupFunc;
|
|
327
|
+
/* function lookup data */
|
|
328
|
+
void *funcLookupData;
|
|
337
329
|
|
|
338
|
-
/*
|
|
339
|
-
|
|
340
|
-
|
|
330
|
+
/* Array of temp namespaces */
|
|
331
|
+
xmlNs **tmpNsList;
|
|
332
|
+
/* number of namespaces in scope */
|
|
333
|
+
int tmpNsNr;
|
|
341
334
|
|
|
342
|
-
/*
|
|
343
|
-
void *userData;
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
335
|
+
/* user specific data block */
|
|
336
|
+
void *userData;
|
|
337
|
+
/* the callback in case of errors */
|
|
338
|
+
xmlStructuredErrorFunc error;
|
|
339
|
+
/* the last error */
|
|
340
|
+
xmlError lastError;
|
|
341
|
+
/* the source node XSLT */
|
|
342
|
+
xmlNode *debugNode;
|
|
347
343
|
|
|
348
|
-
/* dictionary */
|
|
349
|
-
|
|
344
|
+
/* dictionary if any */
|
|
345
|
+
xmlDict *dict;
|
|
350
346
|
|
|
351
|
-
|
|
347
|
+
/** flags to control compilation */
|
|
348
|
+
int flags;
|
|
352
349
|
|
|
353
350
|
/* Cache for reusal of XPath objects */
|
|
354
351
|
void *cache;
|
|
@@ -359,36 +356,45 @@ struct _xmlXPathContext {
|
|
|
359
356
|
int depth;
|
|
360
357
|
};
|
|
361
358
|
|
|
362
|
-
|
|
363
|
-
* The structure of a compiled expression form is not public.
|
|
364
|
-
*/
|
|
365
|
-
|
|
359
|
+
/** Compiled XPath expression */
|
|
366
360
|
typedef struct _xmlXPathCompExpr xmlXPathCompExpr;
|
|
367
361
|
typedef xmlXPathCompExpr *xmlXPathCompExprPtr;
|
|
368
362
|
|
|
369
363
|
/**
|
|
370
|
-
* xmlXPathParserContext:
|
|
371
|
-
*
|
|
372
364
|
* An XPath parser context. It contains pure parsing information,
|
|
373
365
|
* an xmlXPathContext, and the stack of objects.
|
|
366
|
+
*
|
|
367
|
+
* This struct is used for evaluation as well and misnamed.
|
|
374
368
|
*/
|
|
375
369
|
struct _xmlXPathParserContext {
|
|
376
|
-
|
|
377
|
-
const xmlChar *
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
int
|
|
370
|
+
/* the current char being parsed */
|
|
371
|
+
const xmlChar *cur;
|
|
372
|
+
/* the full expression */
|
|
373
|
+
const xmlChar *base;
|
|
374
|
+
|
|
375
|
+
/** error code */
|
|
376
|
+
int error;
|
|
377
|
+
|
|
378
|
+
/** the evaluation context */
|
|
379
|
+
xmlXPathContext *context;
|
|
380
|
+
/** the current value */
|
|
381
|
+
xmlXPathObject *value;
|
|
382
|
+
/* number of values stacked */
|
|
383
|
+
int valueNr;
|
|
384
|
+
/* max number of values stacked */
|
|
385
|
+
int valueMax;
|
|
386
|
+
/* stack of values */
|
|
387
|
+
xmlXPathObject **valueTab;
|
|
388
|
+
|
|
389
|
+
/* the precompiled expression */
|
|
390
|
+
xmlXPathCompExpr *comp;
|
|
391
|
+
/* it this an XPointer expression */
|
|
392
|
+
int xptr;
|
|
393
|
+
/* used for walking preceding axis */
|
|
394
|
+
xmlNode *ancestor;
|
|
395
|
+
|
|
396
|
+
/* always zero for compatibility */
|
|
397
|
+
int valueFrame;
|
|
392
398
|
};
|
|
393
399
|
|
|
394
400
|
/************************************************************************
|
|
@@ -401,6 +407,8 @@ struct _xmlXPathParserContext {
|
|
|
401
407
|
* Objects and Nodesets handling
|
|
402
408
|
*/
|
|
403
409
|
|
|
410
|
+
/** @cond ignore */
|
|
411
|
+
|
|
404
412
|
XML_DEPRECATED
|
|
405
413
|
XMLPUBVAR double xmlXPathNAN;
|
|
406
414
|
XML_DEPRECATED
|
|
@@ -410,23 +418,19 @@ XMLPUBVAR double xmlXPathNINF;
|
|
|
410
418
|
|
|
411
419
|
/* These macros may later turn into functions */
|
|
412
420
|
/**
|
|
413
|
-
* xmlXPathNodeSetGetLength:
|
|
414
|
-
* @ns: a node-set
|
|
415
|
-
*
|
|
416
421
|
* Implement a functionality similar to the DOM NodeList.length.
|
|
417
422
|
*
|
|
418
|
-
*
|
|
423
|
+
* @param ns a node-set
|
|
424
|
+
* @returns the number of nodes in the node-set.
|
|
419
425
|
*/
|
|
420
426
|
#define xmlXPathNodeSetGetLength(ns) ((ns) ? (ns)->nodeNr : 0)
|
|
421
427
|
/**
|
|
422
|
-
* xmlXPathNodeSetItem:
|
|
423
|
-
* @ns: a node-set
|
|
424
|
-
* @index: index of a node in the set
|
|
425
|
-
*
|
|
426
428
|
* Implements a functionality similar to the DOM NodeList.item().
|
|
427
429
|
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
+
* @param ns a node-set
|
|
431
|
+
* @param index index of a node in the set
|
|
432
|
+
* @returns the xmlNode at the given `index` in `ns` or NULL if
|
|
433
|
+
* `index` is out of range (0 to length-1)
|
|
430
434
|
*/
|
|
431
435
|
#define xmlXPathNodeSetItem(ns, index) \
|
|
432
436
|
((((ns) != NULL) && \
|
|
@@ -434,30 +438,29 @@ XMLPUBVAR double xmlXPathNINF;
|
|
|
434
438
|
(ns)->nodeTab[(index)] \
|
|
435
439
|
: NULL)
|
|
436
440
|
/**
|
|
437
|
-
*
|
|
438
|
-
* @ns: a node-set
|
|
439
|
-
*
|
|
440
|
-
* Checks whether @ns is empty or not.
|
|
441
|
+
* Checks whether `ns` is empty or not.
|
|
441
442
|
*
|
|
442
|
-
*
|
|
443
|
+
* @param ns a node-set
|
|
444
|
+
* @returns %TRUE if `ns` is an empty node-set.
|
|
443
445
|
*/
|
|
444
446
|
#define xmlXPathNodeSetIsEmpty(ns) \
|
|
445
447
|
(((ns) == NULL) || ((ns)->nodeNr == 0) || ((ns)->nodeTab == NULL))
|
|
446
448
|
|
|
449
|
+
/** @endcond */
|
|
447
450
|
|
|
448
451
|
XMLPUBFUN void
|
|
449
|
-
xmlXPathFreeObject (
|
|
450
|
-
XMLPUBFUN
|
|
451
|
-
xmlXPathNodeSetCreate (
|
|
452
|
+
xmlXPathFreeObject (xmlXPathObject *obj);
|
|
453
|
+
XMLPUBFUN xmlNodeSet *
|
|
454
|
+
xmlXPathNodeSetCreate (xmlNode *val);
|
|
452
455
|
XMLPUBFUN void
|
|
453
|
-
xmlXPathFreeNodeSetList (
|
|
456
|
+
xmlXPathFreeNodeSetList (xmlXPathObject *obj);
|
|
454
457
|
XMLPUBFUN void
|
|
455
|
-
xmlXPathFreeNodeSet (
|
|
456
|
-
XMLPUBFUN
|
|
457
|
-
xmlXPathObjectCopy (
|
|
458
|
+
xmlXPathFreeNodeSet (xmlNodeSet *obj);
|
|
459
|
+
XMLPUBFUN xmlXPathObject *
|
|
460
|
+
xmlXPathObjectCopy (xmlXPathObject *val);
|
|
458
461
|
XMLPUBFUN int
|
|
459
|
-
xmlXPathCmpNodes (
|
|
460
|
-
|
|
462
|
+
xmlXPathCmpNodes (xmlNode *node1,
|
|
463
|
+
xmlNode *node2);
|
|
461
464
|
/**
|
|
462
465
|
* Conversion functions to basic types.
|
|
463
466
|
*/
|
|
@@ -466,52 +469,52 @@ XMLPUBFUN int
|
|
|
466
469
|
XMLPUBFUN int
|
|
467
470
|
xmlXPathCastStringToBoolean (const xmlChar * val);
|
|
468
471
|
XMLPUBFUN int
|
|
469
|
-
xmlXPathCastNodeSetToBoolean(
|
|
472
|
+
xmlXPathCastNodeSetToBoolean(xmlNodeSet *ns);
|
|
470
473
|
XMLPUBFUN int
|
|
471
|
-
xmlXPathCastToBoolean (
|
|
474
|
+
xmlXPathCastToBoolean (xmlXPathObject *val);
|
|
472
475
|
|
|
473
476
|
XMLPUBFUN double
|
|
474
477
|
xmlXPathCastBooleanToNumber (int val);
|
|
475
478
|
XMLPUBFUN double
|
|
476
479
|
xmlXPathCastStringToNumber (const xmlChar * val);
|
|
477
480
|
XMLPUBFUN double
|
|
478
|
-
xmlXPathCastNodeToNumber (
|
|
481
|
+
xmlXPathCastNodeToNumber (xmlNode *node);
|
|
479
482
|
XMLPUBFUN double
|
|
480
|
-
xmlXPathCastNodeSetToNumber (
|
|
483
|
+
xmlXPathCastNodeSetToNumber (xmlNodeSet *ns);
|
|
481
484
|
XMLPUBFUN double
|
|
482
|
-
xmlXPathCastToNumber (
|
|
485
|
+
xmlXPathCastToNumber (xmlXPathObject *val);
|
|
483
486
|
|
|
484
487
|
XMLPUBFUN xmlChar *
|
|
485
488
|
xmlXPathCastBooleanToString (int val);
|
|
486
489
|
XMLPUBFUN xmlChar *
|
|
487
490
|
xmlXPathCastNumberToString (double val);
|
|
488
491
|
XMLPUBFUN xmlChar *
|
|
489
|
-
xmlXPathCastNodeToString (
|
|
492
|
+
xmlXPathCastNodeToString (xmlNode *node);
|
|
490
493
|
XMLPUBFUN xmlChar *
|
|
491
|
-
xmlXPathCastNodeSetToString (
|
|
494
|
+
xmlXPathCastNodeSetToString (xmlNodeSet *ns);
|
|
492
495
|
XMLPUBFUN xmlChar *
|
|
493
|
-
xmlXPathCastToString (
|
|
496
|
+
xmlXPathCastToString (xmlXPathObject *val);
|
|
494
497
|
|
|
495
|
-
XMLPUBFUN
|
|
496
|
-
xmlXPathConvertBoolean (
|
|
497
|
-
XMLPUBFUN
|
|
498
|
-
xmlXPathConvertNumber (
|
|
499
|
-
XMLPUBFUN
|
|
500
|
-
xmlXPathConvertString (
|
|
498
|
+
XMLPUBFUN xmlXPathObject *
|
|
499
|
+
xmlXPathConvertBoolean (xmlXPathObject *val);
|
|
500
|
+
XMLPUBFUN xmlXPathObject *
|
|
501
|
+
xmlXPathConvertNumber (xmlXPathObject *val);
|
|
502
|
+
XMLPUBFUN xmlXPathObject *
|
|
503
|
+
xmlXPathConvertString (xmlXPathObject *val);
|
|
501
504
|
|
|
502
505
|
/**
|
|
503
506
|
* Context handling.
|
|
504
507
|
*/
|
|
505
|
-
XMLPUBFUN
|
|
506
|
-
xmlXPathNewContext (
|
|
508
|
+
XMLPUBFUN xmlXPathContext *
|
|
509
|
+
xmlXPathNewContext (xmlDoc *doc);
|
|
507
510
|
XMLPUBFUN void
|
|
508
|
-
xmlXPathFreeContext (
|
|
511
|
+
xmlXPathFreeContext (xmlXPathContext *ctxt);
|
|
509
512
|
XMLPUBFUN void
|
|
510
|
-
xmlXPathSetErrorHandler(
|
|
513
|
+
xmlXPathSetErrorHandler(xmlXPathContext *ctxt,
|
|
511
514
|
xmlStructuredErrorFunc handler,
|
|
512
515
|
void *context);
|
|
513
516
|
XMLPUBFUN int
|
|
514
|
-
xmlXPathContextSetCache(
|
|
517
|
+
xmlXPathContextSetCache(xmlXPathContext *ctxt,
|
|
515
518
|
int active,
|
|
516
519
|
int value,
|
|
517
520
|
int options);
|
|
@@ -519,39 +522,39 @@ XMLPUBFUN int
|
|
|
519
522
|
* Evaluation functions.
|
|
520
523
|
*/
|
|
521
524
|
XMLPUBFUN long
|
|
522
|
-
xmlXPathOrderDocElems (
|
|
525
|
+
xmlXPathOrderDocElems (xmlDoc *doc);
|
|
523
526
|
XMLPUBFUN int
|
|
524
|
-
xmlXPathSetContextNode (
|
|
525
|
-
|
|
526
|
-
XMLPUBFUN
|
|
527
|
-
xmlXPathNodeEval (
|
|
527
|
+
xmlXPathSetContextNode (xmlNode *node,
|
|
528
|
+
xmlXPathContext *ctx);
|
|
529
|
+
XMLPUBFUN xmlXPathObject *
|
|
530
|
+
xmlXPathNodeEval (xmlNode *node,
|
|
528
531
|
const xmlChar *str,
|
|
529
|
-
|
|
530
|
-
XMLPUBFUN
|
|
532
|
+
xmlXPathContext *ctx);
|
|
533
|
+
XMLPUBFUN xmlXPathObject *
|
|
531
534
|
xmlXPathEval (const xmlChar *str,
|
|
532
|
-
|
|
533
|
-
XMLPUBFUN
|
|
535
|
+
xmlXPathContext *ctx);
|
|
536
|
+
XMLPUBFUN xmlXPathObject *
|
|
534
537
|
xmlXPathEvalExpression (const xmlChar *str,
|
|
535
|
-
|
|
538
|
+
xmlXPathContext *ctxt);
|
|
536
539
|
XMLPUBFUN int
|
|
537
|
-
xmlXPathEvalPredicate (
|
|
538
|
-
|
|
540
|
+
xmlXPathEvalPredicate (xmlXPathContext *ctxt,
|
|
541
|
+
xmlXPathObject *res);
|
|
539
542
|
/**
|
|
540
543
|
* Separate compilation/evaluation entry points.
|
|
541
544
|
*/
|
|
542
|
-
XMLPUBFUN
|
|
545
|
+
XMLPUBFUN xmlXPathCompExpr *
|
|
543
546
|
xmlXPathCompile (const xmlChar *str);
|
|
544
|
-
XMLPUBFUN
|
|
545
|
-
xmlXPathCtxtCompile (
|
|
547
|
+
XMLPUBFUN xmlXPathCompExpr *
|
|
548
|
+
xmlXPathCtxtCompile (xmlXPathContext *ctxt,
|
|
546
549
|
const xmlChar *str);
|
|
547
|
-
XMLPUBFUN
|
|
548
|
-
xmlXPathCompiledEval (
|
|
549
|
-
|
|
550
|
+
XMLPUBFUN xmlXPathObject *
|
|
551
|
+
xmlXPathCompiledEval (xmlXPathCompExpr *comp,
|
|
552
|
+
xmlXPathContext *ctx);
|
|
550
553
|
XMLPUBFUN int
|
|
551
|
-
xmlXPathCompiledEvalToBoolean(
|
|
552
|
-
|
|
554
|
+
xmlXPathCompiledEvalToBoolean(xmlXPathCompExpr *comp,
|
|
555
|
+
xmlXPathContext *ctxt);
|
|
553
556
|
XMLPUBFUN void
|
|
554
|
-
xmlXPathFreeCompExpr (
|
|
557
|
+
xmlXPathFreeCompExpr (xmlXPathCompExpr *comp);
|
|
555
558
|
|
|
556
559
|
XML_DEPRECATED
|
|
557
560
|
XMLPUBFUN void
|