Home | History | Annotate | Download | only in libxml2

Lines Matching defs:ctxt

83  * @ctxt:  an XPTR evaluation context
89 xmlXPtrErr(xmlXPathParserContextPtr ctxt, int error,
92 if (ctxt != NULL)
93 ctxt->error = error;
94 if ((ctxt == NULL) || (ctxt->context == NULL)) {
102 ctxt->context->lastError.domain = XML_FROM_XPOINTER;
103 ctxt->context->lastError.code = error;
104 ctxt->context->lastError.level = XML_ERR_ERROR;
105 ctxt->context->lastError.str1 = (char *) xmlStrdup(ctxt->base);
106 ctxt->context->lastError.int1 = ctxt->cur - ctxt->base;
107 ctxt->context->lastError.node = ctxt->context->debugNode;
108 if (ctxt->context->error != NULL) {
109 ctxt->context->error(ctxt->context->userData,
110 &ctxt->context->lastError);
113 NULL, ctxt->context->debugNode, XML_FROM_XPOINTER,
115 (const char *) extra, (const char *) ctxt->base, NULL,
116 ctxt->cur - ctxt->base, 0,
839 static void xmlXPtrEvalChildSeq(xmlXPathParserContextPtr ctxt, xmlChar *name);
864 #define CUR (*ctxt->cur)
865 #define SKIP(val) ctxt->cur += (val)
866 #define NXT(val) ctxt->cur[(val)]
867 #define CUR_PTR ctxt->cur
870 while (IS_BLANK_CH(*(ctxt->cur))) NEXT
872 #define CURRENT (*ctxt->cur)
873 #define NEXT ((*ctxt->cur) ? ctxt->cur++: ctxt->cur)
877 * @ctxt: the XPointer Parser context
884 xmlXPtrGetChildNo(xmlXPathParserContextPtr ctxt, int indx) {
890 obj = valuePop(ctxt);
894 valuePush(ctxt, xmlXPathNewNodeSet(NULL));
900 valuePush(ctxt, xmlXPathNewNodeSet(NULL));
904 valuePush(ctxt, obj);
909 * @ctxt: the XPointer Parser context
942 xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) {
948 name = xmlXPathParseName(ctxt);
957 len = xmlStrlen(ctxt->cur);
1000 ctxt->context->node = (xmlNodePtr)ctxt->context->doc;
1001 ctxt->context->proximityPosition = 1;
1002 ctxt->context->contextSize = 1;
1003 xmlXPathEvalExpr(ctxt);
1011 xmlXPathRoot(ctxt);
1012 xmlXPtrEvalChildSeq(ctxt, NULL);
1014 name2 = xmlXPathParseName(ctxt);
1020 xmlXPtrEvalChildSeq(ctxt, name2);
1031 prefix = xmlXPathParseNCName(ctxt);
1048 value = xmlParseURI((const char *)ctxt->cur);
1064 xmlXPathRegisterNs(ctxt->context, prefix, URI);
1070 xmlXPtrErr(ctxt, XML_XPTR_UNKNOWN_SCHEME,
1079 * @ctxt: the XPointer Parser context
1105 xmlXPtrEvalFullXPtr(xmlXPathParserContextPtr ctxt, xmlChar *name) {
1107 name = xmlXPathParseName(ctxt);
1111 ctxt->error = XPATH_EXPRESSION_OK;
1112 xmlXPtrEvalXPtrPart(ctxt, name);
1115 if ((ctxt->error != XPATH_EXPRESSION_OK) &&
1116 (ctxt->error != XML_XPTR_UNKNOWN_SCHEME))
1123 if (ctxt->value != NULL) {
1124 xmlXPathObjectPtr obj = ctxt->value;
1128 xmlLocationSetPtr loc = ctxt->value->user;
1134 xmlNodeSetPtr loc = ctxt->value->nodesetval;
1148 obj = valuePop(ctxt);
1159 name = xmlXPathParseName(ctxt);
1165 * @ctxt: the XPointer Parser context
1175 xmlXPtrEvalChildSeq(xmlXPathParserContextPtr ctxt, xmlChar *name) {
1181 xmlXPtrErr(ctxt, XML_XPTR_CHILDSEQ_START,
1186 valuePush(ctxt, xmlXPathNewString(name));
1188 xmlXPathIdFunction(ctxt, 1);
1200 xmlXPtrGetChildNo(ctxt, child);
1207 * @ctxt: the XPointer Parser context
1216 xmlXPtrEvalXPointer(xmlXPathParserContextPtr ctxt) {
1217 if (ctxt->valueTab == NULL) {
1219 ctxt->valueTab = (xmlXPathObjectPtr *)
1221 if (ctxt->valueTab == NULL) {
1225 ctxt->valueNr = 0;
1226 ctxt->valueMax = 10;
1227 ctxt->value = NULL;
1228 ctxt->valueFrame = 0;
1232 xmlXPathRoot(ctxt);
1233 xmlXPtrEvalChildSeq(ctxt, NULL);
1237 name = xmlXPathParseName(ctxt);
1241 xmlXPtrEvalFullXPtr(ctxt, name);
1246 xmlXPtrEvalChildSeq(ctxt, name);
1262 void xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs);
1264 void xmlXPtrStartPointFunction(xmlXPathParserContextPtr ctxt, int nargs);
1266 void xmlXPtrEndPointFunction(xmlXPathParserContextPtr ctxt, int nargs);
1268 void xmlXPtrHereFunction(xmlXPathParserContextPtr ctxt, int nargs);
1270 void xmlXPtrOriginFunction(xmlXPathParserContextPtr ctxt, int nargs);
1272 void xmlXPtrRangeInsideFunction(xmlXPathParserContextPtr ctxt, int nargs);
1274 void xmlXPtrRangeFunction(xmlXPathParserContextPtr ctxt, int nargs);
1328 xmlXPathParserContextPtr ctxt;
1338 ctxt = xmlXPathNewParserContext(str, ctx);
1339 if (ctxt == NULL)
1341 ctxt->xptr = 1;
1342 xmlXPtrEvalXPointer(ctxt);
1344 if ((ctxt->value != NULL) &&
1345 (ctxt->value->type != XPATH_NODESET) &&
1346 (ctxt->value->type != XPATH_LOCATIONSET)) {
1347 xmlXPtrErr(ctxt, XML_XPTR_EVAL_FAILED,
1351 res = valuePop(ctxt);
1355 tmp = valuePop(ctxt);
1374 xmlXPtrErr(ctxt, XML_XPTR_EXTRA_OBJECTS,
1378 if (ctxt->error != XPATH_EXPRESSION_OK) {
1383 xmlXPathFreeParserContext(ctxt);
1697 * @ctxt: the XPointer Parser context
1704 xmlXPtrHereFunction(xmlXPathParserContextPtr ctxt, int nargs) {
1707 if (ctxt->context->here == NULL)
1710 valuePush(ctxt, xmlXPtrNewLocationSetNodes(ctxt->context->here, NULL));
1715 * @ctxt: the XPointer Parser context
1722 xmlXPtrOriginFunction(xmlXPathParserContextPtr ctxt, int nargs) {
1725 if (ctxt->context->origin == NULL)
1728 valuePush(ctxt, xmlXPtrNewLocationSetNodes(ctxt->context->origin, NULL));
1733 * @ctxt: the XPointer Parser context
1755 xmlXPtrStartPointFunction(xmlXPathParserContextPtr ctxt, int nargs) {
1761 if ((ctxt->value == NULL) ||
1762 ((ctxt->value->type != XPATH_LOCATIONSET) &&
1763 (ctxt->value->type != XPATH_NODESET)))
1766 obj = valuePop(ctxt);
1822 valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
1827 * @ctxt: the XPointer Parser context
1851 xmlXPtrEndPointFunction(xmlXPathParserContextPtr ctxt, int nargs) {
1857 if ((ctxt->value == NULL) ||
1858 ((ctxt->value->type != XPATH_LOCATIONSET) &&
1859 (ctxt->value->type != XPATH_NODESET)))
1862 obj = valuePop(ctxt);
1921 valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
1927 * @ctxt: the XPointer Parser context
1937 xmlXPtrCoveringRange(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr loc) {
1940 if ((ctxt == NULL) || (ctxt->context == NULL) ||
1941 (ctxt->context->doc == NULL))
1953 if (node == (xmlNodePtr) ctxt->context->doc) {
1990 * @ctxt: the XPointer Parser context
2002 xmlXPtrRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
2009 if ((ctxt->value == NULL) ||
2010 ((ctxt->value->type != XPATH_LOCATIONSET) &&
2011 (ctxt->value->type != XPATH_NODESET)))
2014 set = valuePop(ctxt);
2039 xmlXPtrCoveringRange(ctxt, oldset->locTab[i]));
2045 valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
2051 * @ctxt: the XPointer Parser context
2059 xmlXPtrInsideRange(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr loc) {
2062 if ((ctxt == NULL) || (ctxt->context == NULL) ||
2063 (ctxt->context->doc == NULL))
2135 * @ctxt: the XPointer Parser context
2154 xmlXPtrRangeInsideFunction(xmlXPathParserContextPtr ctxt, int nargs) {
2161 if ((ctxt->value == NULL) ||
2162 ((ctxt->value->type != XPATH_LOCATIONSET) &&
2163 (ctxt->value->type != XPATH_NODESET)))
2166 set = valuePop(ctxt);
2191 xmlXPtrInsideRange(ctxt, oldset->locTab[i]));
2197 valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
2203 * @ctxt: the XPointer Parser context
2212 xmlXPtrRangeToFunction(xmlXPathParserContextPtr ctxt,
2647 * @ctxt: the XPointer Parser context
2682 xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
2701 number = valuePop(ctxt);
2707 position = valuePop(ctxt);
2712 string = valuePop(ctxt);
2713 if ((ctxt->value == NULL) ||
2714 ((ctxt->value->type != XPATH_LOCATIONSET) &&
2715 (ctxt->value->type != XPATH_NODESET)))
2718 set = valuePop(ctxt);
2809 valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
2818 * @ctxt: the XPointer Parser context
2827 xmlXPtrEvalRangePredicate(xmlXPathParserContextPtr ctxt) {
2835 if (ctxt == NULL) return;
2850 obj = valuePop(ctxt);
2852 ctxt->context->node = NULL;
2855 ctxt->context->contextSize = 0;
2856 ctxt->context->proximityPosition = 0;
2857 xmlXPathEvalExpr(ctxt);
2858 res = valuePop(ctxt);
2861 valuePush(ctxt, obj);
2868 cur = ctxt->cur;
2872 ctxt->cur = cur;
2878 ctxt->context->node = oldset->locTab[i]->user;
2879 tmp = xmlXPathNewNodeSet(ctxt->context->node);
2880 valuePush(ctxt, tmp);
2881 ctxt->context->contextSize = oldset->locNr;
2882 ctxt->context->proximityPosition = i + 1;
2884 xmlXPathEvalExpr(ctxt);
2891 res = valuePop(ctxt);
2892 if (xmlXPathEvaluatePredicateResult(ctxt, res)) {
2902 if (ctxt->value == tmp) {
2903 res = valuePop(ctxt);
2907 ctxt->context->node = NULL;
2914 ctxt->context->node = NULL;
2915 ctxt->context->contextSize = -1;
2916 ctxt->context->proximityPosition = -1;
2917 valuePush(ctxt, xmlXPtrWrapLocationSet(newset));