You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

632 lines
19 KiB

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