Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1 | /* |
| 2 | * xpointer.h : API to handle XML Pointers |
| 3 | * |
| 4 | * World Wide Web Consortium Working Draft 03-March-1998 |
| 5 | * http://www.w3.org/TR/1998/WD-xptr-19980303 |
| 6 | * |
| 7 | * See Copyright for the status of this software. |
| 8 | * |
| 9 | * Daniel.Veillard@w3.org |
| 10 | */ |
| 11 | |
| 12 | #ifndef __XML_XPTR_H__ |
| 13 | #define __XML_XPTR_H__ |
| 14 | |
| 15 | #include <libxml/tree.h> |
| 16 | #include <libxml/xpath.h> |
| 17 | |
| 18 | #ifdef __cplusplus |
| 19 | extern "C" { |
| 20 | #endif |
| 21 | |
| 22 | /* |
| 23 | * A Location Set |
| 24 | */ |
| 25 | typedef struct _xmlLocationSet xmlLocationSet; |
| 26 | typedef xmlLocationSet *xmlLocationSetPtr; |
| 27 | struct _xmlLocationSet { |
| 28 | int locNr; /* number of locations in the set */ |
| 29 | int locMax; /* size of the array as allocated */ |
| 30 | xmlXPathObjectPtr *locTab;/* array of locations */ |
| 31 | }; |
| 32 | |
| 33 | /* |
| 34 | * Handling of location sets |
| 35 | */ |
| 36 | |
Daniel Veillard | 9e7160d | 2001-03-18 23:17:47 +0000 | [diff] [blame] | 37 | xmlLocationSetPtr xmlXPtrLocationSetCreate(xmlXPathObjectPtr val); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 38 | void xmlXPtrFreeLocationSet (xmlLocationSetPtr obj); |
| 39 | xmlLocationSetPtr xmlXPtrLocationSetMerge (xmlLocationSetPtr val1, |
| 40 | xmlLocationSetPtr val2); |
Daniel Veillard | 56a4cb8 | 2001-03-24 17:00:36 +0000 | [diff] [blame^] | 41 | xmlXPathObjectPtr xmlXPtrNewRange (xmlNodePtr start, |
| 42 | int startindex, |
| 43 | xmlNodePtr end, |
| 44 | int endindex); |
| 45 | xmlXPathObjectPtr xmlXPtrNewRangePoints (xmlXPathObjectPtr start, |
| 46 | xmlXPathObjectPtr end); |
| 47 | xmlXPathObjectPtr xmlXPtrNewRangeNodePoint(xmlNodePtr start, |
| 48 | xmlXPathObjectPtr end); |
| 49 | xmlXPathObjectPtr xmlXPtrNewRangePointNode(xmlXPathObjectPtr start, |
| 50 | xmlNodePtr end); |
| 51 | xmlXPathObjectPtr xmlXPtrNewRangeNodes (xmlNodePtr start, |
| 52 | xmlNodePtr end); |
| 53 | xmlXPathObjectPtr xmlXPtrNewLocationSetNodes(xmlNodePtr start, |
| 54 | xmlNodePtr end); |
| 55 | xmlXPathObjectPtr xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set); |
Daniel Veillard | 9e7160d | 2001-03-18 23:17:47 +0000 | [diff] [blame] | 56 | xmlXPathObjectPtr xmlXPtrNewRangeNodeObject(xmlNodePtr start, |
| 57 | xmlXPathObjectPtr end); |
Daniel Veillard | 56a4cb8 | 2001-03-24 17:00:36 +0000 | [diff] [blame^] | 58 | xmlXPathObjectPtr xmlXPtrNewCollapsedRange(xmlNodePtr start); |
Daniel Veillard | 9e7160d | 2001-03-18 23:17:47 +0000 | [diff] [blame] | 59 | void xmlXPtrLocationSetAdd (xmlLocationSetPtr cur, |
| 60 | xmlXPathObjectPtr val); |
| 61 | xmlXPathObjectPtr xmlXPtrWrapLocationSet (xmlLocationSetPtr val); |
Daniel Veillard | 56a4cb8 | 2001-03-24 17:00:36 +0000 | [diff] [blame^] | 62 | void xmlXPtrLocationSetDel (xmlLocationSetPtr cur, |
| 63 | xmlXPathObjectPtr val); |
| 64 | void xmlXPtrLocationSetRemove(xmlLocationSetPtr cur, |
| 65 | int val); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 66 | |
| 67 | /* |
| 68 | * Functions |
| 69 | */ |
| 70 | xmlXPathContextPtr xmlXPtrNewContext (xmlDocPtr doc, |
| 71 | xmlNodePtr here, |
| 72 | xmlNodePtr origin); |
| 73 | xmlXPathObjectPtr xmlXPtrEval (const xmlChar *str, |
| 74 | xmlXPathContextPtr ctx); |
| 75 | void xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt, |
| 76 | int nargs); |
| 77 | xmlNodePtr xmlXPtrBuildNodeList (xmlXPathObjectPtr obj); |
| 78 | void xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt); |
| 79 | |
| 80 | #ifdef __cplusplus |
| 81 | } |
| 82 | #endif |
| 83 | #endif /* __XML_XPTR_H__ */ |