xpathInternals.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  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. /**
  269. * CAST_TO_STRING:
  270. *
  271. * Macro to try to cast the value on the top of the XPath stack to a string.
  272. */
  273. #define CAST_TO_STRING \
  274. if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \
  275. xmlXPathStringFunction(ctxt, 1);
  276. /**
  277. * CAST_TO_NUMBER:
  278. *
  279. * Macro to try to cast the value on the top of the XPath stack to a number.
  280. */
  281. #define CAST_TO_NUMBER \
  282. if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \
  283. xmlXPathNumberFunction(ctxt, 1);
  284. /**
  285. * CAST_TO_BOOLEAN:
  286. *
  287. * Macro to try to cast the value on the top of the XPath stack to a boolean.
  288. */
  289. #define CAST_TO_BOOLEAN \
  290. if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \
  291. xmlXPathBooleanFunction(ctxt, 1);
  292. /*
  293. * Variable Lookup forwarding.
  294. */
  295. XMLPUBFUN void XMLCALL
  296. xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
  297. xmlXPathVariableLookupFunc f,
  298. void *data);
  299. /*
  300. * Function Lookup forwarding.
  301. */
  302. XMLPUBFUN void XMLCALL
  303. xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt,
  304. xmlXPathFuncLookupFunc f,
  305. void *funcCtxt);
  306. /*
  307. * Error reporting.
  308. */
  309. XMLPUBFUN void XMLCALL
  310. xmlXPatherror (xmlXPathParserContextPtr ctxt,
  311. const char *file,
  312. int line,
  313. int no);
  314. XMLPUBFUN void XMLCALL
  315. xmlXPathErr (xmlXPathParserContextPtr ctxt,
  316. int error);
  317. #ifdef LIBXML_DEBUG_ENABLED
  318. XMLPUBFUN void XMLCALL
  319. xmlXPathDebugDumpObject (FILE *output,
  320. xmlXPathObjectPtr cur,
  321. int depth);
  322. XMLPUBFUN void XMLCALL
  323. xmlXPathDebugDumpCompExpr(FILE *output,
  324. xmlXPathCompExprPtr comp,
  325. int depth);
  326. #endif
  327. /**
  328. * NodeSet handling.
  329. */
  330. XMLPUBFUN int XMLCALL
  331. xmlXPathNodeSetContains (xmlNodeSetPtr cur,
  332. xmlNodePtr val);
  333. XMLPUBFUN xmlNodeSetPtr XMLCALL
  334. xmlXPathDifference (xmlNodeSetPtr nodes1,
  335. xmlNodeSetPtr nodes2);
  336. XMLPUBFUN xmlNodeSetPtr XMLCALL
  337. xmlXPathIntersection (xmlNodeSetPtr nodes1,
  338. xmlNodeSetPtr nodes2);
  339. XMLPUBFUN xmlNodeSetPtr XMLCALL
  340. xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
  341. XMLPUBFUN xmlNodeSetPtr XMLCALL
  342. xmlXPathDistinct (xmlNodeSetPtr nodes);
  343. XMLPUBFUN int XMLCALL
  344. xmlXPathHasSameNodes (xmlNodeSetPtr nodes1,
  345. xmlNodeSetPtr nodes2);
  346. XMLPUBFUN xmlNodeSetPtr XMLCALL
  347. xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes,
  348. xmlNodePtr node);
  349. XMLPUBFUN xmlNodeSetPtr XMLCALL
  350. xmlXPathLeadingSorted (xmlNodeSetPtr nodes1,
  351. xmlNodeSetPtr nodes2);
  352. XMLPUBFUN xmlNodeSetPtr XMLCALL
  353. xmlXPathNodeLeading (xmlNodeSetPtr nodes,
  354. xmlNodePtr node);
  355. XMLPUBFUN xmlNodeSetPtr XMLCALL
  356. xmlXPathLeading (xmlNodeSetPtr nodes1,
  357. xmlNodeSetPtr nodes2);
  358. XMLPUBFUN xmlNodeSetPtr XMLCALL
  359. xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes,
  360. xmlNodePtr node);
  361. XMLPUBFUN xmlNodeSetPtr XMLCALL
  362. xmlXPathTrailingSorted (xmlNodeSetPtr nodes1,
  363. xmlNodeSetPtr nodes2);
  364. XMLPUBFUN xmlNodeSetPtr XMLCALL
  365. xmlXPathNodeTrailing (xmlNodeSetPtr nodes,
  366. xmlNodePtr node);
  367. XMLPUBFUN xmlNodeSetPtr XMLCALL
  368. xmlXPathTrailing (xmlNodeSetPtr nodes1,
  369. xmlNodeSetPtr nodes2);
  370. /**
  371. * Extending a context.
  372. */
  373. XMLPUBFUN int XMLCALL
  374. xmlXPathRegisterNs (xmlXPathContextPtr ctxt,
  375. const xmlChar *prefix,
  376. const xmlChar *ns_uri);
  377. XMLPUBFUN const xmlChar * XMLCALL
  378. xmlXPathNsLookup (xmlXPathContextPtr ctxt,
  379. const xmlChar *prefix);
  380. XMLPUBFUN void XMLCALL
  381. xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
  382. XMLPUBFUN int XMLCALL
  383. xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
  384. const xmlChar *name,
  385. xmlXPathFunction f);
  386. XMLPUBFUN int XMLCALL
  387. xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
  388. const xmlChar *name,
  389. const xmlChar *ns_uri,
  390. xmlXPathFunction f);
  391. XMLPUBFUN int XMLCALL
  392. xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
  393. const xmlChar *name,
  394. xmlXPathObjectPtr value);
  395. XMLPUBFUN int XMLCALL
  396. xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
  397. const xmlChar *name,
  398. const xmlChar *ns_uri,
  399. xmlXPathObjectPtr value);
  400. XMLPUBFUN xmlXPathFunction XMLCALL
  401. xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
  402. const xmlChar *name);
  403. XMLPUBFUN xmlXPathFunction XMLCALL
  404. xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
  405. const xmlChar *name,
  406. const xmlChar *ns_uri);
  407. XMLPUBFUN void XMLCALL
  408. xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt);
  409. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  410. xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
  411. const xmlChar *name);
  412. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  413. xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
  414. const xmlChar *name,
  415. const xmlChar *ns_uri);
  416. XMLPUBFUN void XMLCALL
  417. xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
  418. /**
  419. * Utilities to extend XPath.
  420. */
  421. XMLPUBFUN xmlXPathParserContextPtr XMLCALL
  422. xmlXPathNewParserContext (const xmlChar *str,
  423. xmlXPathContextPtr ctxt);
  424. XMLPUBFUN void XMLCALL
  425. xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
  426. /* TODO: remap to xmlXPathValuePop and Push. */
  427. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  428. valuePop (xmlXPathParserContextPtr ctxt);
  429. XMLPUBFUN int XMLCALL
  430. valuePush (xmlXPathParserContextPtr ctxt,
  431. xmlXPathObjectPtr value);
  432. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  433. xmlXPathNewString (const xmlChar *val);
  434. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  435. xmlXPathNewCString (const char *val);
  436. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  437. xmlXPathWrapString (xmlChar *val);
  438. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  439. xmlXPathWrapCString (char * val);
  440. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  441. xmlXPathNewFloat (double val);
  442. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  443. xmlXPathNewBoolean (int val);
  444. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  445. xmlXPathNewNodeSet (xmlNodePtr val);
  446. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  447. xmlXPathNewValueTree (xmlNodePtr val);
  448. XMLPUBFUN void XMLCALL
  449. xmlXPathNodeSetAdd (xmlNodeSetPtr cur,
  450. xmlNodePtr val);
  451. XMLPUBFUN void XMLCALL
  452. xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur,
  453. xmlNodePtr val);
  454. XMLPUBFUN void XMLCALL
  455. xmlXPathNodeSetAddNs (xmlNodeSetPtr cur,
  456. xmlNodePtr node,
  457. xmlNsPtr ns);
  458. XMLPUBFUN void XMLCALL
  459. xmlXPathNodeSetSort (xmlNodeSetPtr set);
  460. XMLPUBFUN void XMLCALL
  461. xmlXPathRoot (xmlXPathParserContextPtr ctxt);
  462. XMLPUBFUN void XMLCALL
  463. xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
  464. XMLPUBFUN xmlChar * XMLCALL
  465. xmlXPathParseName (xmlXPathParserContextPtr ctxt);
  466. XMLPUBFUN xmlChar * XMLCALL
  467. xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
  468. /*
  469. * Existing functions.
  470. */
  471. XMLPUBFUN double XMLCALL
  472. xmlXPathStringEvalNumber (const xmlChar *str);
  473. XMLPUBFUN int XMLCALL
  474. xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt,
  475. xmlXPathObjectPtr res);
  476. XMLPUBFUN void XMLCALL
  477. xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt);
  478. XMLPUBFUN xmlNodeSetPtr XMLCALL
  479. xmlXPathNodeSetMerge (xmlNodeSetPtr val1,
  480. xmlNodeSetPtr val2);
  481. XMLPUBFUN void XMLCALL
  482. xmlXPathNodeSetDel (xmlNodeSetPtr cur,
  483. xmlNodePtr val);
  484. XMLPUBFUN void XMLCALL
  485. xmlXPathNodeSetRemove (xmlNodeSetPtr cur,
  486. int val);
  487. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  488. xmlXPathNewNodeSetList (xmlNodeSetPtr val);
  489. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  490. xmlXPathWrapNodeSet (xmlNodeSetPtr val);
  491. XMLPUBFUN xmlXPathObjectPtr XMLCALL
  492. xmlXPathWrapExternal (void *val);
  493. XMLPUBFUN int XMLCALL xmlXPathEqualValues(xmlXPathParserContextPtr ctxt);
  494. XMLPUBFUN int XMLCALL xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt);
  495. XMLPUBFUN int XMLCALL xmlXPathCompareValues(xmlXPathParserContextPtr ctxt, int inf, int strict);
  496. XMLPUBFUN void XMLCALL xmlXPathValueFlipSign(xmlXPathParserContextPtr ctxt);
  497. XMLPUBFUN void XMLCALL xmlXPathAddValues(xmlXPathParserContextPtr ctxt);
  498. XMLPUBFUN void XMLCALL xmlXPathSubValues(xmlXPathParserContextPtr ctxt);
  499. XMLPUBFUN void XMLCALL xmlXPathMultValues(xmlXPathParserContextPtr ctxt);
  500. XMLPUBFUN void XMLCALL xmlXPathDivValues(xmlXPathParserContextPtr ctxt);
  501. XMLPUBFUN void XMLCALL xmlXPathModValues(xmlXPathParserContextPtr ctxt);
  502. XMLPUBFUN int XMLCALL xmlXPathIsNodeType(const xmlChar *name);
  503. /*
  504. * Some of the axis navigation routines.
  505. */
  506. XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextSelf(xmlXPathParserContextPtr ctxt,
  507. xmlNodePtr cur);
  508. XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextChild(xmlXPathParserContextPtr ctxt,
  509. xmlNodePtr cur);
  510. XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt,
  511. xmlNodePtr cur);
  512. XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt,
  513. xmlNodePtr cur);
  514. XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextParent(xmlXPathParserContextPtr ctxt,
  515. xmlNodePtr cur);
  516. XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt,
  517. xmlNodePtr cur);
  518. XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt,
  519. xmlNodePtr cur);
  520. XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt,
  521. xmlNodePtr cur);
  522. XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt,
  523. xmlNodePtr cur);
  524. XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt,
  525. xmlNodePtr cur);
  526. XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt,
  527. xmlNodePtr cur);
  528. XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt,
  529. xmlNodePtr cur);
  530. XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt,
  531. xmlNodePtr cur);
  532. /*
  533. * The official core of XPath functions.
  534. */
  535. XMLPUBFUN void XMLCALL xmlXPathLastFunction(xmlXPathParserContextPtr ctxt, int nargs);
  536. XMLPUBFUN void XMLCALL xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs);
  537. XMLPUBFUN void XMLCALL xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs);
  538. XMLPUBFUN void XMLCALL xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs);
  539. XMLPUBFUN void XMLCALL xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt, int nargs);
  540. XMLPUBFUN void XMLCALL xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs);
  541. XMLPUBFUN void XMLCALL xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs);
  542. XMLPUBFUN void XMLCALL xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt, int nargs);
  543. XMLPUBFUN void XMLCALL xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt, int nargs);
  544. XMLPUBFUN void XMLCALL xmlXPathContainsFunction(xmlXPathParserContextPtr ctxt, int nargs);
  545. XMLPUBFUN void XMLCALL xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt, int nargs);
  546. XMLPUBFUN void XMLCALL xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs);
  547. XMLPUBFUN void XMLCALL xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs);
  548. XMLPUBFUN void XMLCALL xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs);
  549. XMLPUBFUN void XMLCALL xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs);
  550. XMLPUBFUN void XMLCALL xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt, int nargs);
  551. XMLPUBFUN void XMLCALL xmlXPathNotFunction(xmlXPathParserContextPtr ctxt, int nargs);
  552. XMLPUBFUN void XMLCALL xmlXPathTrueFunction(xmlXPathParserContextPtr ctxt, int nargs);
  553. XMLPUBFUN void XMLCALL xmlXPathFalseFunction(xmlXPathParserContextPtr ctxt, int nargs);
  554. XMLPUBFUN void XMLCALL xmlXPathLangFunction(xmlXPathParserContextPtr ctxt, int nargs);
  555. XMLPUBFUN void XMLCALL xmlXPathNumberFunction(xmlXPathParserContextPtr ctxt, int nargs);
  556. XMLPUBFUN void XMLCALL xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs);
  557. XMLPUBFUN void XMLCALL xmlXPathFloorFunction(xmlXPathParserContextPtr ctxt, int nargs);
  558. XMLPUBFUN void XMLCALL xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs);
  559. XMLPUBFUN void XMLCALL xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs);
  560. XMLPUBFUN void XMLCALL xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, int nargs);
  561. /**
  562. * Really internal functions
  563. */
  564. XMLPUBFUN void XMLCALL xmlXPathNodeSetFreeNs(xmlNsPtr ns);
  565. #ifdef __cplusplus
  566. }
  567. #endif
  568. #endif /* LIBXML_XPATH_ENABLED */
  569. #endif /* ! __XML_XPATH_INTERNALS_H__ */