xref: /aosp_15_r20/external/cronet/third_party/libxml/src/include/libxml/xpointer.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 /*
2  * Summary: API to handle XML Pointers
3  * Description: API to handle XML Pointers
4  * Base implementation was made accordingly to
5  * W3C Candidate Recommendation 7 June 2000
6  * http://www.w3.org/TR/2000/CR-xptr-20000607
7  *
8  * Added support for the element() scheme described in:
9  * W3C Proposed Recommendation 13 November 2002
10  * http://www.w3.org/TR/2002/PR-xptr-element-20021113/
11  *
12  * Copy: See Copyright for the status of this software.
13  *
14  * Author: Daniel Veillard
15  */
16 
17 #ifndef __XML_XPTR_H__
18 #define __XML_XPTR_H__
19 
20 #include <libxml/xmlversion.h>
21 
22 #ifdef LIBXML_XPTR_ENABLED
23 
24 #include <libxml/tree.h>
25 #include <libxml/xpath.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #if defined(LIBXML_XPTR_LOCS_ENABLED)
32 /*
33  * A Location Set
34  */
35 typedef struct _xmlLocationSet xmlLocationSet;
36 typedef xmlLocationSet *xmlLocationSetPtr;
37 struct _xmlLocationSet {
38     int locNr;		      /* number of locations in the set */
39     int locMax;		      /* size of the array as allocated */
40     xmlXPathObjectPtr *locTab;/* array of locations */
41 };
42 
43 /*
44  * Handling of location sets.
45  */
46 
47 XML_DEPRECATED
48 XMLPUBFUN xmlLocationSetPtr
49 		    xmlXPtrLocationSetCreate	(xmlXPathObjectPtr val);
50 XML_DEPRECATED
51 XMLPUBFUN void
52 		    xmlXPtrFreeLocationSet	(xmlLocationSetPtr obj);
53 XML_DEPRECATED
54 XMLPUBFUN xmlLocationSetPtr
55 		    xmlXPtrLocationSetMerge	(xmlLocationSetPtr val1,
56 						 xmlLocationSetPtr val2);
57 XML_DEPRECATED
58 XMLPUBFUN xmlXPathObjectPtr
59 		    xmlXPtrNewRange		(xmlNodePtr start,
60 						 int startindex,
61 						 xmlNodePtr end,
62 						 int endindex);
63 XML_DEPRECATED
64 XMLPUBFUN xmlXPathObjectPtr
65 		    xmlXPtrNewRangePoints	(xmlXPathObjectPtr start,
66 						 xmlXPathObjectPtr end);
67 XML_DEPRECATED
68 XMLPUBFUN xmlXPathObjectPtr
69 		    xmlXPtrNewRangeNodePoint	(xmlNodePtr start,
70 						 xmlXPathObjectPtr end);
71 XML_DEPRECATED
72 XMLPUBFUN xmlXPathObjectPtr
73 		    xmlXPtrNewRangePointNode	(xmlXPathObjectPtr start,
74 						 xmlNodePtr end);
75 XML_DEPRECATED
76 XMLPUBFUN xmlXPathObjectPtr
77 		    xmlXPtrNewRangeNodes	(xmlNodePtr start,
78 						 xmlNodePtr end);
79 XML_DEPRECATED
80 XMLPUBFUN xmlXPathObjectPtr
81 		    xmlXPtrNewLocationSetNodes	(xmlNodePtr start,
82 						 xmlNodePtr end);
83 XML_DEPRECATED
84 XMLPUBFUN xmlXPathObjectPtr
85 		    xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
86 XML_DEPRECATED
87 XMLPUBFUN xmlXPathObjectPtr
88 		    xmlXPtrNewRangeNodeObject	(xmlNodePtr start,
89 						 xmlXPathObjectPtr end);
90 XML_DEPRECATED
91 XMLPUBFUN xmlXPathObjectPtr
92 		    xmlXPtrNewCollapsedRange	(xmlNodePtr start);
93 XML_DEPRECATED
94 XMLPUBFUN void
95 		    xmlXPtrLocationSetAdd	(xmlLocationSetPtr cur,
96 						 xmlXPathObjectPtr val);
97 XML_DEPRECATED
98 XMLPUBFUN xmlXPathObjectPtr
99 		    xmlXPtrWrapLocationSet	(xmlLocationSetPtr val);
100 XML_DEPRECATED
101 XMLPUBFUN void
102 		    xmlXPtrLocationSetDel	(xmlLocationSetPtr cur,
103 						 xmlXPathObjectPtr val);
104 XML_DEPRECATED
105 XMLPUBFUN void
106 		    xmlXPtrLocationSetRemove	(xmlLocationSetPtr cur,
107 						 int val);
108 #endif /* defined(LIBXML_XPTR_LOCS_ENABLED) */
109 
110 /*
111  * Functions.
112  */
113 XMLPUBFUN xmlXPathContextPtr
114 		    xmlXPtrNewContext		(xmlDocPtr doc,
115 						 xmlNodePtr here,
116 						 xmlNodePtr origin);
117 XMLPUBFUN xmlXPathObjectPtr
118 		    xmlXPtrEval			(const xmlChar *str,
119 						 xmlXPathContextPtr ctx);
120 
121 #if defined(LIBXML_XPTR_LOCS_ENABLED)
122 XML_DEPRECATED
123 XMLPUBFUN void
124 		    xmlXPtrRangeToFunction	(xmlXPathParserContextPtr ctxt,
125 						 int nargs);
126 XML_DEPRECATED
127 XMLPUBFUN xmlNodePtr
128 		    xmlXPtrBuildNodeList	(xmlXPathObjectPtr obj);
129 XML_DEPRECATED
130 XMLPUBFUN void
131 		    xmlXPtrEvalRangePredicate	(xmlXPathParserContextPtr ctxt);
132 #endif /* defined(LIBXML_XPTR_LOCS_ENABLED) */
133 #ifdef __cplusplus
134 }
135 #endif
136 
137 #endif /* LIBXML_XPTR_ENABLED */
138 #endif /* __XML_XPTR_H__ */
139