Home | History | Annotate | Download | only in libxml2

Lines Matching refs:cur

106     ctxt->context->lastError.int1 = ctxt->cur - ctxt->base;
116 ctxt->cur - ctxt->base, 0,
127 xmlNodePtr xmlXPtrAdvanceNode(xmlNodePtr cur, int *level);
130 * @cur: the node
135 xmlXPtrGetArity(xmlNodePtr cur) {
137 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
139 cur = cur->children;
140 for (i = 0;cur != NULL;cur = cur->next) {
141 if ((cur->type == XML_ELEMENT_NODE) ||
142 (cur->type == XML_DOCUMENT_NODE) ||
143 (cur->type == XML_HTML_DOCUMENT_NODE)) {
152 * @cur: the node
158 xmlXPtrGetIndex(xmlNodePtr cur) {
160 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
162 for (i = 1;cur != NULL;cur = cur->prev) {
163 if ((cur->type == XML_ELEMENT_NODE) ||
164 (cur->type == XML_DOCUMENT_NODE) ||
165 (cur->type == XML_HTML_DOCUMENT_NODE)) {
174 * @cur: the node
177 * Returns the @no'th element child of @cur or NULL
180 xmlXPtrGetNthChild(xmlNodePtr cur, int no) {
182 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
183 return(cur);
184 cur = cur->children;
185 for (i = 0;i <= no;cur = cur->next) {
186 if (cur == NULL)
187 return(cur);
188 if ((cur->type == XML_ELEMENT_NODE) ||
189 (cur->type == XML_DOCUMENT_NODE) ||
190 (cur->type == XML_HTML_DOCUMENT_NODE)) {
196 return(cur);
635 * @cur: the initial range set
642 xmlXPtrLocationSetAdd(xmlLocationSetPtr cur, xmlXPathObjectPtr val) {
645 if ((cur == NULL) || (val == NULL)) return;
650 for (i = 0;i < cur->locNr;i++) {
651 if (xmlXPtrRangesEqual(cur->locTab[i], val)) {
660 if (cur->locMax == 0) {
661 cur->locTab = (xmlXPathObjectPtr *) xmlMalloc(XML_RANGESET_DEFAULT *
663 if (cur->locTab == NULL) {
667 memset(cur->locTab, 0 ,
669 cur->locMax = XML_RANGESET_DEFAULT;
670 } else if (cur->locNr == cur->locMax) {
673 cur->locMax *= 2;
674 temp = (xmlXPathObjectPtr *) xmlRealloc(cur->locTab, cur->locMax *
680 cur->locTab = temp;
682 cur->locTab[cur->locNr++] = val;
714 * @cur: the initial range set
720 xmlXPtrLocationSetDel(xmlLocationSetPtr cur, xmlXPathObjectPtr val) {
723 if (cur == NULL) return;
729 for (i = 0;i < cur->locNr;i++)
730 if (cur->locTab[i] == val) break;
732 if (i >= cur->locNr) {
739 cur->locNr--;
740 for (;i < cur->locNr;i++)
741 cur->locTab[i] = cur->locTab[i + 1];
742 cur->locTab[cur->locNr] = NULL;
747 * @cur: the initial range set
753 xmlXPtrLocationSetRemove(xmlLocationSetPtr cur, int val) {
754 if (cur == NULL) return;
755 if (val >= cur->locNr) return;
756 cur->locNr--;
757 for (;val < cur->locNr;val++)
758 cur->locTab[val] = cur->locTab[val + 1];
759 cur->locTab[cur->locNr] = NULL;
885 * CUR returns the current xmlChar value, i.e. a 8 bit value
890 * NXT(n) returns the n'th next xmlChar. Same as CUR is should be used only
901 #define CUR (*ctxt->cur)
902 #define SKIP(val) ctxt->cur += (val)
903 #define NXT(val) ctxt->cur[(val)]
904 #define CUR_PTR ctxt->cur
907 while (IS_BLANK_CH(*(ctxt->cur))) NEXT
909 #define CURRENT (*ctxt->cur)
910 #define NEXT ((*ctxt->cur) ? ctxt->cur++: ctxt->cur)
922 xmlNodePtr cur = NULL;
934 cur = xmlXPtrGetNthChild(oldset->nodeTab[0], indx);
935 if (cur == NULL) {
940 oldset->nodeTab[0] = cur;
980 xmlChar *buffer, *cur;
989 if (CUR != '(')
994 len = xmlStrlen(ctxt->cur);
1002 cur = buffer;
1003 while (CUR != 0) {
1004 if (CUR == ')') {
1010 } else if (CUR == '(') {
1012 } else if (CUR == '^') {
1017 *cur++ = CUR;
1020 *cur = 0;
1022 if ((level != 0) && (CUR == 0)) {
1075 if (CUR != '=') {
1085 value = xmlParseURI((const char *)ctxt->cur);
1217 if ((name == NULL) && (CUR == '/') && (NXT(1) != '1')) {
1229 while (CUR == '/') {
1233 while ((CUR >= '0') && (CUR <= '9')) {
1234 child = child * 10 + (CUR - '0');
1268 if (CUR == '/') {
1277 if (CUR == '(') {
1287 if (CUR != 0)
1440 xmlNodePtr start, cur, end;
1457 cur = start;
1460 while (cur != NULL) {
1461 if (cur == end) {
1462 if (cur->type == XML_TEXT_NODE) {
1463 const xmlChar *content = cur->content;
1470 if ((cur == start) && (index1 > 1)) {
1489 tmp = xmlCopyNode(cur, 0);
1502 end = xmlXPtrGetNthChild(cur, index2 - 1);
1505 if ((cur == start) && (index1 > 1)) {
1506 cur = xmlXPtrGetNthChild(cur, index1 - 1);
1509 cur = cur->children;
1512 * Now gather the remaining nodes from cur to end
1516 } else if ((cur == start) &&
1518 if ((cur->type == XML_TEXT_NODE) ||
1519 (cur->type == XML_CDATA_SECTION_NODE)) {
1520 const xmlChar *content = cur->content;
1532 if ((cur == start) && (index1 > 1)) {
1533 tmp = xmlCopyNode(cur, 0);
1537 cur = xmlXPtrGetNthChild(cur, index1 - 1);
1540 * Now gather the remaining nodes from cur to end
1544 tmp = xmlCopyNode(cur, 1);
1551 switch (cur->type) {
1570 tmp = xmlCopyNode(cur, 1);
1593 cur = xmlXPtrAdvanceNode(cur, NULL);
2250 const xmlChar *cur;
2268 cur = ctxt->cur;
2272 ctxt->cur = cur;
2320 * @cur: the node
2329 xmlXPtrAdvanceNode(xmlNodePtr cur, int *level) {
2331 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
2333 if (cur->children != NULL) {
2334 cur = cur->children ;
2340 if (cur->next != NULL) {
2341 cur = cur->next;
2345 cur = cur->parent;
2348 if (cur == NULL) return(NULL);
2349 if (cur->next != NULL) {
2350 cur = cur->next;
2353 } while (cur != NULL);
2356 if ((cur->type != XML_ELEMENT_NODE) &&
2357 (cur->type != XML_TEXT_NODE) &&
2358 (cur->type != XML_DOCUMENT_NODE) &&
2359 (cur->type != XML_HTML_DOCUMENT_NODE) &&
2360 (cur->type != XML_CDATA_SECTION_NODE)) {
2361 if (cur->type == XML_ENTITY_REF_NODE) { /* Shouldn't happen */
2367 return(cur);
2382 xmlNodePtr cur;
2388 cur = *node;
2389 if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
2398 while ((cur != NULL) &&
2399 ((cur->type == XML_ELEMENT_NODE) ||
2400 (cur->type == XML_DOCUMENT_NODE) ||
2401 (cur->type == XML_HTML_DOCUMENT_NODE))) {
2403 cur = xmlXPtrGetNthChild(cur, pos);
2406 cur = xmlXPtrAdvanceNode(cur, NULL);
2411 if (cur == NULL) {
2422 *node = cur;
2430 if ((cur->type != XML_ELEMENT_NODE) &&
2431 (cur->content != NULL)) {
2432 len = xmlStrlen(cur->content);
2441 cur = xmlXPtrAdvanceNode(cur, NULL);
2445 *node = cur;
2472 xmlNodePtr cur;
2485 cur = start;
2490 if ((cur == *end) && (pos + stringlen > *endindex))
2493 if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
2494 len = xmlStrlen(cur->content);
2496 match = (!xmlStrncmp(&cur->content[pos], string, stringlen));
2502 xmlDebugDumpString(stdout, cur->content);
2505 *end = cur;
2513 match = (!xmlStrncmp(&cur->content[pos], string, sub));
2519 xmlDebugDumpString(stdout, cur->content);
2529 cur = xmlXPtrAdvanceNode(cur, NULL);
2530 if (cur == NULL)
2556 xmlNodePtr cur;
2569 cur = *start;
2573 while (cur != NULL) {
2574 if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
2575 len = xmlStrlen(cur->content);
2578 str = xmlStrchr(&cur->content[pos], first);
2580 pos = (str - (xmlChar *)(cur->content));
2585 xmlDebugDumpString(stdout, cur->content);
2588 if (xmlXPtrMatchString(string, cur, pos + 1,
2590 *start = cur;
2608 xmlDebugDumpString(stdout, cur->content);
2611 *start = cur;
2613 *end = cur;
2619 if ((cur == *end) && (pos >= *endindex))
2621 cur = xmlXPtrAdvanceNode(cur, NULL);
2622 if (cur == NULL)
2640 xmlNodePtr cur;
2646 cur = *node;
2649 if ((cur->type == XML_ELEMENT_NODE) ||
2650 (cur->type == XML_DOCUMENT_NODE) ||
2651 (cur->type == XML_HTML_DOCUMENT_NODE)) {
2653 cur = xmlXPtrGetNthChild(cur, pos);
2656 while (cur != NULL) {
2657 if (cur->last != NULL)
2658 cur = cur->last;
2659 else if ((cur->type != XML_ELEMENT_NODE) &&
2660 (cur->content != NULL)) {
2661 len = xmlStrlen(cur->content);
2667 if (cur == NULL)
2669 *node = cur;
2929 const xmlChar *cur;
2939 if (CUR != '[') {
2969 cur = ctxt->cur;
2973 ctxt->cur = cur;
3020 if (CUR != ']') {