xpointer.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. #ifndef __XML_XPTR_H__
  17. #define __XML_XPTR_H__
  18. #include <libxml/xmlversion.h>
  19. #ifdef LIBXML_XPTR_ENABLED
  20. #include <libxml/tree.h>
  21. #include <libxml/xpath.h>
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /*
  26. * A Location Set
  27. */
  28. typedef struct _xmlLocationSet xmlLocationSet;
  29. typedef xmlLocationSet *xmlLocationSetPtr;
  30. struct _xmlLocationSet {
  31. int locNr; /* number of locations in the set */
  32. int locMax; /* size of the array as allocated */
  33. xmlXPathObjectPtr *locTab;/* array of locations */
  34. };
  35. /*
  36. * Handling of location sets.
  37. */
  38. XMLPUBFUN xmlLocationSetPtr XMLCALL
  39. xmlXPtrLocationSetCreate (xmlXPathObjectPtr val);
  40. XMLPUBFUN void XMLCALL
  41. xmlXPtrFreeLocationSet (xmlLocationSetPtr obj);
  42. XMLPUBFUN xmlLocationSetPtr XMLCALL
  43. xmlXPtrLocationSetMerge (xmlLocationSetPtr val1,
  44. xmlLocationSetPtr val2);
  45. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  46. xmlXPtrNewRange (xmlNodePtr start,
  47. int startindex,
  48. xmlNodePtr end,
  49. int endindex);
  50. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  51. xmlXPtrNewRangePoints (xmlXPathObjectPtr start,
  52. xmlXPathObjectPtr end);
  53. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  54. xmlXPtrNewRangeNodePoint (xmlNodePtr start,
  55. xmlXPathObjectPtr end);
  56. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  57. xmlXPtrNewRangePointNode (xmlXPathObjectPtr start,
  58. xmlNodePtr end);
  59. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  60. xmlXPtrNewRangeNodes (xmlNodePtr start,
  61. xmlNodePtr end);
  62. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  63. xmlXPtrNewLocationSetNodes (xmlNodePtr start,
  64. xmlNodePtr end);
  65. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  66. xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
  67. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  68. xmlXPtrNewRangeNodeObject (xmlNodePtr start,
  69. xmlXPathObjectPtr end);
  70. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  71. xmlXPtrNewCollapsedRange (xmlNodePtr start);
  72. XMLPUBFUN void XMLCALL
  73. xmlXPtrLocationSetAdd (xmlLocationSetPtr cur,
  74. xmlXPathObjectPtr val);
  75. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  76. xmlXPtrWrapLocationSet (xmlLocationSetPtr val);
  77. XMLPUBFUN void XMLCALL
  78. xmlXPtrLocationSetDel (xmlLocationSetPtr cur,
  79. xmlXPathObjectPtr val);
  80. XMLPUBFUN void XMLCALL
  81. xmlXPtrLocationSetRemove (xmlLocationSetPtr cur,
  82. int val);
  83. /*
  84. * Functions.
  85. */
  86. XMLPUBFUN xmlXPathContextPtr XMLCALL
  87. xmlXPtrNewContext (xmlDocPtr doc,
  88. xmlNodePtr here,
  89. xmlNodePtr origin);
  90. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  91. xmlXPtrEval (const xmlChar *str,
  92. xmlXPathContextPtr ctx);
  93. XMLPUBFUN void XMLCALL
  94. xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt,
  95. int nargs);
  96. XMLPUBFUN xmlNodePtr XMLCALL
  97. xmlXPtrBuildNodeList (xmlXPathObjectPtr obj);
  98. XMLPUBFUN void XMLCALL
  99. xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt);
  100. #ifdef __cplusplus
  101. }
  102. #endif
  103. #endif /* LIBXML_XPTR_ENABLED */
  104. #endif /* __XML_XPTR_H__ */