12#ifndef __XML_XPATH_INTERNALS_H__
13#define __XML_XPATH_INTERNALS_H__
18#ifdef LIBXML_XPATH_ENABLED
41#define xmlXPathSetError(ctxt, err) \
42 { xmlXPatherror((ctxt), __FILE__, __LINE__, (err)); \
43 if ((ctxt) != NULL) (ctxt)->error = (err); }
51#define xmlXPathSetArityError(ctxt) \
52 xmlXPathSetError((ctxt), XPATH_INVALID_ARITY)
60#define xmlXPathSetTypeError(ctxt) \
61 xmlXPathSetError((ctxt), XPATH_INVALID_TYPE)
71#define xmlXPathGetError(ctxt) ((ctxt)->error)
81#define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK)
91#define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc)
101#define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node)
104 xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
106 xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
108 xmlXPathPopString (xmlXPathParserContextPtr ctxt);
110 xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
112 xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
121#define xmlXPathReturnBoolean(ctxt, val) \
122 valuePush((ctxt), xmlXPathNewBoolean(val))
130#define xmlXPathReturnTrue(ctxt) xmlXPathReturnBoolean((ctxt), 1)
138#define xmlXPathReturnFalse(ctxt) xmlXPathReturnBoolean((ctxt), 0)
147#define xmlXPathReturnNumber(ctxt, val) \
148 valuePush((ctxt), xmlXPathNewFloat(val))
157#define xmlXPathReturnString(ctxt, str) \
158 valuePush((ctxt), xmlXPathWrapString(str))
166#define xmlXPathReturnEmptyString(ctxt) \
167 valuePush((ctxt), xmlXPathNewCString(""))
176#define xmlXPathReturnNodeSet(ctxt, ns) \
177 valuePush((ctxt), xmlXPathWrapNodeSet(ns))
185#define xmlXPathReturnEmptyNodeSet(ctxt) \
186 valuePush((ctxt), xmlXPathNewNodeSet(NULL))
195#define xmlXPathReturnExternal(ctxt, val) \
196 valuePush((ctxt), xmlXPathWrapExternal(val))
207#define xmlXPathStackIsNodeSet(ctxt) \
208 (((ctxt)->value != NULL) \
209 && (((ctxt)->value->type == XPATH_NODESET) \
210 || ((ctxt)->value->type == XPATH_XSLT_TREE)))
222#define xmlXPathStackIsExternal(ctxt) \
223 ((ctxt->value != NULL) && (ctxt->value->type == XPATH_USERS))
231#define xmlXPathEmptyNodeSet(ns) \
232 { while ((ns)->nodeNr > 0) (ns)->nodeTab[--(ns)->nodeNr] = NULL; }
240 if (ctxt->error != XPATH_EXPRESSION_OK) return
247#define CHECK_ERROR0 \
248 if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
257 { xmlXPathErr(ctxt, X); return; }
265#define XP_ERROR0(X) \
266 { xmlXPathErr(ctxt, X); return(0); }
275#define CHECK_TYPE(typeval) \
276 if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
277 XP_ERROR(XPATH_INVALID_TYPE)
286#define CHECK_TYPE0(typeval) \
287 if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
288 XP_ERROR0(XPATH_INVALID_TYPE)
296#define CHECK_ARITY(x) \
297 if (ctxt == NULL) return; \
299 XP_ERROR(XPATH_INVALID_ARITY); \
300 if (ctxt->valueNr < ctxt->valueFrame + (x)) \
301 XP_ERROR(XPATH_STACK_ERROR);
308#define CAST_TO_STRING \
309 if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \
310 xmlXPathStringFunction(ctxt, 1);
317#define CAST_TO_NUMBER \
318 if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \
319 xmlXPathNumberFunction(ctxt, 1);
326#define CAST_TO_BOOLEAN \
327 if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \
328 xmlXPathBooleanFunction(ctxt, 1);
335 xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
336 xmlXPathVariableLookupFunc
f,
344 xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt,
345 xmlXPathFuncLookupFunc
f,
352 xmlXPatherror (xmlXPathParserContextPtr ctxt,
358 xmlXPathErr (xmlXPathParserContextPtr ctxt,
361#ifdef LIBXML_DEBUG_ENABLED
363 xmlXPathDebugDumpObject (
FILE *output,
364 xmlXPathObjectPtr
cur,
367 xmlXPathDebugDumpCompExpr(
FILE *output,
368 xmlXPathCompExprPtr comp,
375 xmlXPathNodeSetContains (xmlNodeSetPtr
cur,
378 xmlXPathDifference (xmlNodeSetPtr nodes1,
379 xmlNodeSetPtr nodes2);
381 xmlXPathIntersection (xmlNodeSetPtr nodes1,
382 xmlNodeSetPtr nodes2);
385 xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
387 xmlXPathDistinct (xmlNodeSetPtr nodes);
390 xmlXPathHasSameNodes (xmlNodeSetPtr nodes1,
391 xmlNodeSetPtr nodes2);
394 xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes,
397 xmlXPathLeadingSorted (xmlNodeSetPtr nodes1,
398 xmlNodeSetPtr nodes2);
400 xmlXPathNodeLeading (xmlNodeSetPtr nodes,
403 xmlXPathLeading (xmlNodeSetPtr nodes1,
404 xmlNodeSetPtr nodes2);
407 xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes,
410 xmlXPathTrailingSorted (xmlNodeSetPtr nodes1,
411 xmlNodeSetPtr nodes2);
413 xmlXPathNodeTrailing (xmlNodeSetPtr nodes,
416 xmlXPathTrailing (xmlNodeSetPtr nodes1,
417 xmlNodeSetPtr nodes2);
425 xmlXPathRegisterNs (xmlXPathContextPtr ctxt,
429 xmlXPathNsLookup (xmlXPathContextPtr ctxt,
432 xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
435 xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
439 xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
444 xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
446 xmlXPathObjectPtr
value);
448 xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
451 xmlXPathObjectPtr
value);
453 xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
456 xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
460 xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt);
462 xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
465 xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
469 xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
476 xmlXPathContextPtr ctxt);
478 xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
482 valuePop (xmlXPathParserContextPtr ctxt);
484 valuePush (xmlXPathParserContextPtr ctxt,
485 xmlXPathObjectPtr
value);
490 xmlXPathNewCString (
const char *
val);
494 xmlXPathWrapCString (
char *
val);
496 xmlXPathNewFloat (
double val);
498 xmlXPathNewBoolean (
int val);
504 xmlXPathNodeSetAdd (xmlNodeSetPtr
cur,
507 xmlXPathNodeSetAddUnique (xmlNodeSetPtr
cur,
510 xmlXPathNodeSetAddNs (xmlNodeSetPtr
cur,
514 xmlXPathNodeSetSort (xmlNodeSetPtr
set);
517 xmlXPathRoot (xmlXPathParserContextPtr ctxt);
519 xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
521 xmlXPathParseName (xmlXPathParserContextPtr ctxt);
523 xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
531 xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt,
532 xmlXPathObjectPtr
res);
534 xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt);
536 xmlXPathNodeSetMerge (xmlNodeSetPtr val1,
539 xmlXPathNodeSetDel (xmlNodeSetPtr
cur,
542 xmlXPathNodeSetRemove (xmlNodeSetPtr
cur,
545 xmlXPathNewNodeSetList (xmlNodeSetPtr
val);
547 xmlXPathWrapNodeSet (xmlNodeSetPtr
val);
549 xmlXPathWrapExternal (
void *
val);
595XMLPUBFUN void XMLCALL xmlXPathLastFunction(xmlXPathParserContextPtr ctxt,
int nargs);
596XMLPUBFUN void XMLCALL xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt,
int nargs);
597XMLPUBFUN void XMLCALL xmlXPathCountFunction(xmlXPathParserContextPtr ctxt,
int nargs);
598XMLPUBFUN void XMLCALL xmlXPathIdFunction(xmlXPathParserContextPtr ctxt,
int nargs);
599XMLPUBFUN void XMLCALL xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt,
int nargs);
600XMLPUBFUN void XMLCALL xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt,
int nargs);
601XMLPUBFUN void XMLCALL xmlXPathStringFunction(xmlXPathParserContextPtr ctxt,
int nargs);
602XMLPUBFUN void XMLCALL xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt,
int nargs);
603XMLPUBFUN void XMLCALL xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt,
int nargs);
604XMLPUBFUN void XMLCALL xmlXPathContainsFunction(xmlXPathParserContextPtr ctxt,
int nargs);
605XMLPUBFUN void XMLCALL xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt,
int nargs);
606XMLPUBFUN void XMLCALL xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt,
int nargs);
607XMLPUBFUN void XMLCALL xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt,
int nargs);
608XMLPUBFUN void XMLCALL xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt,
int nargs);
609XMLPUBFUN void XMLCALL xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt,
int nargs);
610XMLPUBFUN void XMLCALL xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt,
int nargs);
611XMLPUBFUN void XMLCALL xmlXPathNotFunction(xmlXPathParserContextPtr ctxt,
int nargs);
612XMLPUBFUN void XMLCALL xmlXPathTrueFunction(xmlXPathParserContextPtr ctxt,
int nargs);
613XMLPUBFUN void XMLCALL xmlXPathFalseFunction(xmlXPathParserContextPtr ctxt,
int nargs);
614XMLPUBFUN void XMLCALL xmlXPathLangFunction(xmlXPathParserContextPtr ctxt,
int nargs);
615XMLPUBFUN void XMLCALL xmlXPathNumberFunction(xmlXPathParserContextPtr ctxt,
int nargs);
616XMLPUBFUN void XMLCALL xmlXPathSumFunction(xmlXPathParserContextPtr ctxt,
int nargs);
617XMLPUBFUN void XMLCALL xmlXPathFloorFunction(xmlXPathParserContextPtr ctxt,
int nargs);
618XMLPUBFUN void XMLCALL xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt,
int nargs);
619XMLPUBFUN void XMLCALL xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt,
int nargs);
620XMLPUBFUN void XMLCALL xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt,
int nargs);
static WCHAR no[MAX_STRING_RESOURCE_LEN]
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
double xmlXPathStringEvalNumber(const xmlChar *str)