xpathInternals.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. /*
  2. * Summary: internal interfaces for XML Path Language implementation
  3. * Description: internal interfaces for XML Path Language implementation
  4. * used to build new modules on top of XPath like XPointer and
  5. * XSLT
  6. *
  7. * Copy: See Copyright for the status of this software.
  8. *
  9. * Author: Daniel Veillard
  10. */
  11. #ifndef __XML_XPATH_INTERNALS_H__
  12. #define __XML_XPATH_INTERNALS_H__
  13. #include <stdio.h>
  14. #include <libxml/xmlversion.h>
  15. #include <libxml/xpath.h>
  16. #ifdef LIBXML_XPATH_ENABLED
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /************************************************************************
  21. * *
  22. * Helpers *
  23. * *
  24. ************************************************************************/
  25. /*
  26. * Many of these macros may later turn into functions. They
  27. * shouldn't be used in #ifdef's preprocessor instructions.
  28. */
  29. /**
  30. * xmlXPathSetError:
  31. * @ctxt: an XPath parser context
  32. * @err: an xmlXPathError code
  33. *
  34. * Raises an error.
  35. */
  36. #define xmlXPathSetError(ctxt, err) \
  37. { xmlXPatherror((ctxt), __FILE__, __LINE__, (err)); \
  38. if ((ctxt) != NULL) (ctxt)->error = (err); }
  39. /**
  40. * xmlXPathSetArityError:
  41. * @ctxt: an XPath parser context
  42. *
  43. * Raises an XPATH_INVALID_ARITY error.
  44. */
  45. #define xmlXPathSetArityError(ctxt) \
  46. xmlXPathSetError((ctxt), XPATH_INVALID_ARITY)
  47. /**
  48. * xmlXPathSetTypeError:
  49. * @ctxt: an XPath parser context
  50. *
  51. * Raises an XPATH_INVALID_TYPE error.
  52. */
  53. #define xmlXPathSetTypeError(ctxt) \
  54. xmlXPathSetError((ctxt), XPATH_INVALID_TYPE)
  55. /**
  56. * xmlXPathGetError:
  57. * @ctxt: an XPath parser context
  58. *
  59. * Get the error code of an XPath context.
  60. *
  61. * Returns the context error.
  62. */
  63. #define xmlXPathGetError(ctxt) ((ctxt)->error)
  64. /**
  65. * xmlXPathCheckError:
  66. * @ctxt: an XPath parser context
  67. *
  68. * Check if an XPath error was raised.
  69. *
  70. * Returns true if an error has been raised, false otherwise.
  71. */
  72. #define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK)
  73. /**
  74. * xmlXPathGetDocument:
  75. * @ctxt: an XPath parser context
  76. *
  77. * Get the document of an XPath context.
  78. *
  79. * Returns the context document.
  80. */
  81. #define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc)
  82. /**
  83. * xmlXPathGetContextNode:
  84. * @ctxt: an XPath parser context
  85. *
  86. * Get the context node of an XPath context.
  87. *
  88. * Returns the context node.
  89. */
  90. #define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node)
  91. XMLPUBFUN int
  92. xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
  93. XMLPUBFUN double
  94. xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
  95. XMLPUBFUN xmlChar *
  96. xmlXPathPopString (xmlXPathParserContextPtr ctxt);
  97. XMLPUBFUN xmlNodeSetPtr
  98. xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
  99. XMLPUBFUN void *
  100. xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
  101. /**
  102. * xmlXPathReturnBoolean:
  103. * @ctxt: an XPath parser context
  104. * @val: a boolean
  105. *
  106. * Pushes the boolean @val on the context stack.
  107. */
  108. #define xmlXPathReturnBoolean(ctxt, val) \
  109. valuePush((ctxt), xmlXPathNewBoolean(val))
  110. /**
  111. * xmlXPathReturnTrue:
  112. * @ctxt: an XPath parser context
  113. *
  114. * Pushes true on the context stack.
  115. */
  116. #define xmlXPathReturnTrue(ctxt) xmlXPathReturnBoolean((ctxt), 1)
  117. /**
  118. * xmlXPathReturnFalse:
  119. * @ctxt: an XPath parser context
  120. *
  121. * Pushes false on the context stack.
  122. */
  123. #define xmlXPathReturnFalse(ctxt) xmlXPathReturnBoolean((ctxt), 0)
  124. /**
  125. * xmlXPathReturnNumber:
  126. * @ctxt: an XPath parser context
  127. * @val: a double
  128. *
  129. * Pushes the double @val on the context stack.
  130. */
  131. #define xmlXPathReturnNumber(ctxt, val) \
  132. valuePush((ctxt), xmlXPathNewFloat(val))
  133. /**
  134. * xmlXPathReturnString:
  135. * @ctxt: an XPath parser context
  136. * @str: a string
  137. *
  138. * Pushes the string @str on the context stack.
  139. */
  140. #define xmlXPathReturnString(ctxt, str) \
  141. valuePush((ctxt), xmlXPathWrapString(str))
  142. /**
  143. * xmlXPathReturnEmptyString:
  144. * @ctxt: an XPath parser context
  145. *
  146. * Pushes an empty string on the stack.
  147. */
  148. #define xmlXPathReturnEmptyString(ctxt) \
  149. valuePush((ctxt), xmlXPathNewCString(""))
  150. /**
  151. * xmlXPathReturnNodeSet:
  152. * @ctxt: an XPath parser context
  153. * @ns: a node-set
  154. *
  155. * Pushes the node-set @ns on the context stack.
  156. */
  157. #define xmlXPathReturnNodeSet(ctxt, ns) \
  158. valuePush((ctxt), xmlXPathWrapNodeSet(ns))
  159. /**
  160. * xmlXPathReturnEmptyNodeSet:
  161. * @ctxt: an XPath parser context
  162. *
  163. * Pushes an empty node-set on the context stack.
  164. */
  165. #define xmlXPathReturnEmptyNodeSet(ctxt) \
  166. valuePush((ctxt), xmlXPathNewNodeSet(NULL))
  167. /**
  168. * xmlXPathReturnExternal:
  169. * @ctxt: an XPath parser context
  170. * @val: user data
  171. *
  172. * Pushes user data on the context stack.
  173. */
  174. #define xmlXPathReturnExternal(ctxt, val) \
  175. valuePush((ctxt), xmlXPathWrapExternal(val))
  176. /**
  177. * xmlXPathStackIsNodeSet:
  178. * @ctxt: an XPath parser context
  179. *
  180. * Check if the current value on the XPath stack is a node set or
  181. * an XSLT value tree.
  182. *
  183. * Returns true if the current object on the stack is a node-set.
  184. */
  185. #define xmlXPathStackIsNodeSet(ctxt) \
  186. (((ctxt)->value != NULL) \
  187. && (((ctxt)->value->type == XPATH_NODESET) \
  188. || ((ctxt)->value->type == XPATH_XSLT_TREE)))
  189. /**
  190. * xmlXPathStackIsExternal:
  191. * @ctxt: an XPath parser context
  192. *
  193. * Checks if the current value on the XPath stack is an external
  194. * object.
  195. *
  196. * Returns true if the current object on the stack is an external
  197. * object.
  198. */
  199. #define xmlXPathStackIsExternal(ctxt) \
  200. ((ctxt->value != NULL) && (ctxt->value->type == XPATH_USERS))
  201. /**
  202. * xmlXPathEmptyNodeSet:
  203. * @ns: a node-set
  204. *
  205. * Empties a node-set.
  206. */
  207. #define xmlXPathEmptyNodeSet(ns) \
  208. { while ((ns)->nodeNr > 0) (ns)->nodeTab[--(ns)->nodeNr] = NULL; }
  209. /**
  210. * CHECK_ERROR:
  211. *
  212. * Macro to return from the function if an XPath error was detected.
  213. */
  214. #define CHECK_ERROR \
  215. if (ctxt->error != XPATH_EXPRESSION_OK) return
  216. /**
  217. * CHECK_ERROR0:
  218. *
  219. * Macro to return 0 from the function if an XPath error was detected.
  220. */
  221. #define CHECK_ERROR0 \
  222. if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  223. /**
  224. * XP_ERROR:
  225. * @X: the error code
  226. *
  227. * Macro to raise an XPath error and return.
  228. */
  229. #define XP_ERROR(X) \
  230. { xmlXPathErr(ctxt, X); return; }
  231. /**
  232. * XP_ERROR0:
  233. * @X: the error code
  234. *
  235. * Macro to raise an XPath error and return 0.
  236. */
  237. #define XP_ERROR0(X) \
  238. { xmlXPathErr(ctxt, X); return(0); }
  239. /**
  240. * CHECK_TYPE:
  241. * @typeval: the XPath type
  242. *
  243. * Macro to check that the value on top of the XPath stack is of a given
  244. * type.
  245. */
  246. #define CHECK_TYPE(typeval) \
  247. if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
  248. XP_ERROR(XPATH_INVALID_TYPE)
  249. /**
  250. * CHECK_TYPE0:
  251. * @typeval: the XPath type
  252. *
  253. * Macro to check that the value on top of the XPath stack is of a given
  254. * type. Return(0) in case of failure
  255. */
  256. #define CHECK_TYPE0(typeval) \
  257. if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
  258. XP_ERROR0(XPATH_INVALID_TYPE)
  259. /**
  260. * CHECK_ARITY:
  261. * @x: the number of expected args
  262. *
  263. * Macro to check that the number of args passed to an XPath function matches.
  264. */
  265. #define CHECK_ARITY(x) \
  266. if (ctxt == NULL) return; \
  267. if (nargs != (x)) \
  268. XP_ERROR(XPATH_INVALID_ARITY); \
  269. if (ctxt->valueNr < (x)) \
  270. XP_ERROR(XPATH_STACK_ERROR);
  271. /**
  272. * CAST_TO_STRING:
  273. *
  274. * Macro to try to cast the value on the top of the XPath stack to a string.
  275. */
  276. #define CAST_TO_STRING \
  277. if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \
  278. xmlXPathStringFunction(ctxt, 1);
  279. /**
  280. * CAST_TO_NUMBER:
  281. *
  282. * Macro to try to cast the value on the top of the XPath stack to a number.
  283. */
  284. #define CAST_TO_NUMBER \
  285. if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \
  286. xmlXPathNumberFunction(ctxt, 1);
  287. /**
  288. * CAST_TO_BOOLEAN:
  289. *
  290. * Macro to try to cast the value on the top of the XPath stack to a boolean.
  291. */
  292. #define CAST_TO_BOOLEAN \
  293. if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \
  294. xmlXPathBooleanFunction(ctxt, 1);
  295. /*
  296. * Variable Lookup forwarding.
  297. */
  298. XMLPUBFUN void
  299. xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
  300. xmlXPathVariableLookupFunc f,
  301. void *data);
  302. /*
  303. * Function Lookup forwarding.
  304. */
  305. XMLPUBFUN void
  306. xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt,
  307. xmlXPathFuncLookupFunc f,
  308. void *funcCtxt);
  309. /*
  310. * Error reporting.
  311. */
  312. XMLPUBFUN void
  313. xmlXPatherror (xmlXPathParserContextPtr ctxt,
  314. const char *file,
  315. int line,
  316. int no);
  317. XMLPUBFUN void
  318. xmlXPathErr (xmlXPathParserContextPtr ctxt,
  319. int error);
  320. #ifdef LIBXML_DEBUG_ENABLED
  321. XMLPUBFUN void
  322. xmlXPathDebugDumpObject (FILE *output,
  323. xmlXPathObjectPtr cur,
  324. int depth);
  325. XMLPUBFUN void
  326. xmlXPathDebugDumpCompExpr(FILE *output,
  327. xmlXPathCompExprPtr comp,
  328. int depth);
  329. #endif
  330. /**
  331. * NodeSet handling.
  332. */
  333. XMLPUBFUN int
  334. xmlXPathNodeSetContains (xmlNodeSetPtr cur,
  335. xmlNodePtr val);
  336. XMLPUBFUN xmlNodeSetPtr
  337. xmlXPathDifference (xmlNodeSetPtr nodes1,
  338. xmlNodeSetPtr nodes2);
  339. XMLPUBFUN xmlNodeSetPtr
  340. xmlXPathIntersection (xmlNodeSetPtr nodes1,
  341. xmlNodeSetPtr nodes2);
  342. XMLPUBFUN xmlNodeSetPtr
  343. xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
  344. XMLPUBFUN xmlNodeSetPtr
  345. xmlXPathDistinct (xmlNodeSetPtr nodes);
  346. XMLPUBFUN int
  347. xmlXPathHasSameNodes (xmlNodeSetPtr nodes1,
  348. xmlNodeSetPtr nodes2);
  349. XMLPUBFUN xmlNodeSetPtr
  350. xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes,
  351. xmlNodePtr node);
  352. XMLPUBFUN xmlNodeSetPtr
  353. xmlXPathLeadingSorted (xmlNodeSetPtr nodes1,
  354. xmlNodeSetPtr nodes2);
  355. XMLPUBFUN xmlNodeSetPtr
  356. xmlXPathNodeLeading (xmlNodeSetPtr nodes,
  357. xmlNodePtr node);
  358. XMLPUBFUN xmlNodeSetPtr
  359. xmlXPathLeading (xmlNodeSetPtr nodes1,
  360. xmlNodeSetPtr nodes2);
  361. XMLPUBFUN xmlNodeSetPtr
  362. xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes,
  363. xmlNodePtr node);
  364. XMLPUBFUN xmlNodeSetPtr
  365. xmlXPathTrailingSorted (xmlNodeSetPtr nodes1,
  366. xmlNodeSetPtr nodes2);
  367. XMLPUBFUN xmlNodeSetPtr
  368. xmlXPathNodeTrailing (xmlNodeSetPtr nodes,
  369. xmlNodePtr node);
  370. XMLPUBFUN xmlNodeSetPtr
  371. xmlXPathTrailing (xmlNodeSetPtr nodes1,
  372. xmlNodeSetPtr nodes2);
  373. /**
  374. * Extending a context.
  375. */
  376. XMLPUBFUN int
  377. xmlXPathRegisterNs (xmlXPathContextPtr ctxt,
  378. const xmlChar *prefix,
  379. const xmlChar *ns_uri);
  380. XMLPUBFUN const xmlChar *
  381. xmlXPathNsLookup (xmlXPathContextPtr ctxt,
  382. const xmlChar *prefix);
  383. XMLPUBFUN void
  384. xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
  385. XMLPUBFUN int
  386. xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
  387. const xmlChar *name,
  388. xmlXPathFunction f);
  389. XMLPUBFUN int
  390. xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
  391. const xmlChar *name,
  392. const xmlChar *ns_uri,
  393. xmlXPathFunction f);
  394. XMLPUBFUN int
  395. xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
  396. const xmlChar *name,
  397. xmlXPathObjectPtr value);
  398. XMLPUBFUN int
  399. xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
  400. const xmlChar *name,
  401. const xmlChar *ns_uri,
  402. xmlXPathObjectPtr value);
  403. XMLPUBFUN xmlXPathFunction
  404. xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
  405. const xmlChar *name);
  406. XMLPUBFUN xmlXPathFunction
  407. xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
  408. const xmlChar *name,
  409. const xmlChar *ns_uri);
  410. XMLPUBFUN void
  411. xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt);
  412. XMLPUBFUN xmlXPathObjectPtr
  413. xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
  414. const xmlChar *name);
  415. XMLPUBFUN xmlXPathObjectPtr
  416. xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
  417. const xmlChar *name,
  418. const xmlChar *ns_uri);
  419. XMLPUBFUN void
  420. xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
  421. /**
  422. * Utilities to extend XPath.
  423. */
  424. XMLPUBFUN xmlXPathParserContextPtr
  425. xmlXPathNewParserContext (const xmlChar *str,
  426. xmlXPathContextPtr ctxt);
  427. XMLPUBFUN void
  428. xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
  429. /* TODO: remap to xmlXPathValuePop and Push. */
  430. XMLPUBFUN xmlXPathObjectPtr
  431. valuePop (xmlXPathParserContextPtr ctxt);
  432. XMLPUBFUN int
  433. valuePush (xmlXPathParserContextPtr ctxt,
  434. xmlXPathObjectPtr value);
  435. XMLPUBFUN xmlXPathObjectPtr
  436. xmlXPathNewString (const xmlChar *val);
  437. XMLPUBFUN xmlXPathObjectPtr
  438. xmlXPathNewCString (const char *val);
  439. XMLPUBFUN xmlXPathObjectPtr
  440. xmlXPathWrapString (xmlChar *val);
  441. XMLPUBFUN xmlXPathObjectPtr
  442. xmlXPathWrapCString (char * val);
  443. XMLPUBFUN xmlXPathObjectPtr
  444. xmlXPathNewFloat (double val);
  445. XMLPUBFUN xmlXPathObjectPtr
  446. xmlXPathNewBoolean (int val);
  447. XMLPUBFUN xmlXPathObjectPtr
  448. xmlXPathNewNodeSet (xmlNodePtr val);
  449. XMLPUBFUN xmlXPathObjectPtr
  450. xmlXPathNewValueTree (xmlNodePtr val);
  451. XMLPUBFUN int
  452. xmlXPathNodeSetAdd (xmlNodeSetPtr cur,
  453. xmlNodePtr val);
  454. XMLPUBFUN int
  455. xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur,
  456. xmlNodePtr val);
  457. XMLPUBFUN int
  458. xmlXPathNodeSetAddNs (xmlNodeSetPtr cur,
  459. xmlNodePtr node,
  460. xmlNsPtr ns);
  461. XMLPUBFUN void
  462. xmlXPathNodeSetSort (xmlNodeSetPtr set);
  463. XMLPUBFUN void
  464. xmlXPathRoot (xmlXPathParserContextPtr ctxt);
  465. XMLPUBFUN void
  466. xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
  467. XMLPUBFUN xmlChar *
  468. xmlXPathParseName (xmlXPathParserContextPtr ctxt);
  469. XMLPUBFUN xmlChar *
  470. xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
  471. /*
  472. * Existing functions.
  473. */
  474. XMLPUBFUN double
  475. xmlXPathStringEvalNumber (const xmlChar *str);
  476. XMLPUBFUN int
  477. xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt,
  478. xmlXPathObjectPtr res);
  479. XMLPUBFUN void
  480. xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt);
  481. XMLPUBFUN xmlNodeSetPtr
  482. xmlXPathNodeSetMerge (xmlNodeSetPtr val1,
  483. xmlNodeSetPtr val2);
  484. XMLPUBFUN void
  485. xmlXPathNodeSetDel (xmlNodeSetPtr cur,
  486. xmlNodePtr val);
  487. XMLPUBFUN void
  488. xmlXPathNodeSetRemove (xmlNodeSetPtr cur,
  489. int val);
  490. XMLPUBFUN xmlXPathObjectPtr
  491. xmlXPathNewNodeSetList (xmlNodeSetPtr val);
  492. XMLPUBFUN xmlXPathObjectPtr
  493. xmlXPathWrapNodeSet (xmlNodeSetPtr val);
  494. XMLPUBFUN xmlXPathObjectPtr
  495. xmlXPathWrapExternal (void *val);
  496. XMLPUBFUN int xmlXPathEqualValues(xmlXPathParserContextPtr ctxt);
  497. XMLPUBFUN int xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt);
  498. XMLPUBFUN int xmlXPathCompareValues(xmlXPathParserContextPtr ctxt, int inf, int strict);
  499. XMLPUBFUN void xmlXPathValueFlipSign(xmlXPathParserContextPtr ctxt);
  500. XMLPUBFUN void xmlXPathAddValues(xmlXPathParserContextPtr ctxt);
  501. XMLPUBFUN void xmlXPathSubValues(xmlXPathParserContextPtr ctxt);
  502. XMLPUBFUN void xmlXPathMultValues(xmlXPathParserContextPtr ctxt);
  503. XMLPUBFUN void xmlXPathDivValues(xmlXPathParserContextPtr ctxt);
  504. XMLPUBFUN void xmlXPathModValues(xmlXPathParserContextPtr ctxt);
  505. XMLPUBFUN int xmlXPathIsNodeType(const xmlChar *name);
  506. /*
  507. * Some of the axis navigation routines.
  508. */
  509. XMLPUBFUN xmlNodePtr xmlXPathNextSelf(xmlXPathParserContextPtr ctxt,
  510. xmlNodePtr cur);
  511. XMLPUBFUN xmlNodePtr xmlXPathNextChild(xmlXPathParserContextPtr ctxt,
  512. xmlNodePtr cur);
  513. XMLPUBFUN xmlNodePtr xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt,
  514. xmlNodePtr cur);
  515. XMLPUBFUN xmlNodePtr xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt,
  516. xmlNodePtr cur);
  517. XMLPUBFUN xmlNodePtr xmlXPathNextParent(xmlXPathParserContextPtr ctxt,
  518. xmlNodePtr cur);
  519. XMLPUBFUN xmlNodePtr xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt,
  520. xmlNodePtr cur);
  521. XMLPUBFUN xmlNodePtr xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt,
  522. xmlNodePtr cur);
  523. XMLPUBFUN xmlNodePtr xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt,
  524. xmlNodePtr cur);
  525. XMLPUBFUN xmlNodePtr xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt,
  526. xmlNodePtr cur);
  527. XMLPUBFUN xmlNodePtr xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt,
  528. xmlNodePtr cur);
  529. XMLPUBFUN xmlNodePtr xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt,
  530. xmlNodePtr cur);
  531. XMLPUBFUN xmlNodePtr xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt,
  532. xmlNodePtr cur);
  533. XMLPUBFUN xmlNodePtr xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt,
  534. xmlNodePtr cur);
  535. /*
  536. * The official core of XPath functions.
  537. */
  538. XMLPUBFUN void xmlXPathLastFunction(xmlXPathParserContextPtr ctxt, int nargs);
  539. XMLPUBFUN void xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs);
  540. XMLPUBFUN void xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs);
  541. XMLPUBFUN void xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs);
  542. XMLPUBFUN void xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt, int nargs);
  543. XMLPUBFUN void xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs);
  544. XMLPUBFUN void xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs);
  545. XMLPUBFUN void xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt, int nargs);
  546. XMLPUBFUN void xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt, int nargs);
  547. XMLPUBFUN void xmlXPathContainsFunction(xmlXPathParserContextPtr ctxt, int nargs);
  548. XMLPUBFUN void xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt, int nargs);
  549. XMLPUBFUN void xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs);
  550. XMLPUBFUN void xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs);
  551. XMLPUBFUN void xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs);
  552. XMLPUBFUN void xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs);
  553. XMLPUBFUN void xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt, int nargs);
  554. XMLPUBFUN void xmlXPathNotFunction(xmlXPathParserContextPtr ctxt, int nargs);
  555. XMLPUBFUN void xmlXPathTrueFunction(xmlXPathParserContextPtr ctxt, int nargs);
  556. XMLPUBFUN void xmlXPathFalseFunction(xmlXPathParserContextPtr ctxt, int nargs);
  557. XMLPUBFUN void xmlXPathLangFunction(xmlXPathParserContextPtr ctxt, int nargs);
  558. XMLPUBFUN void xmlXPathNumberFunction(xmlXPathParserContextPtr ctxt, int nargs);
  559. XMLPUBFUN void xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs);
  560. XMLPUBFUN void xmlXPathFloorFunction(xmlXPathParserContextPtr ctxt, int nargs);
  561. XMLPUBFUN void xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs);
  562. XMLPUBFUN void xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs);
  563. XMLPUBFUN void xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, int nargs);
  564. /**
  565. * Really internal functions
  566. */
  567. XMLPUBFUN void xmlXPathNodeSetFreeNs(xmlNsPtr ns);
  568. #ifdef __cplusplus
  569. }
  570. #endif
  571. #endif /* LIBXML_XPATH_ENABLED */
  572. #endif /* ! __XML_XPATH_INTERNALS_H__ */