Lines Matching refs:comp

83     if ((c)->comp->dict) \
84 r = (xmlChar *) xmlDictLookup((c)->comp->dict, BAD_CAST nsname, -1); \
87 #define XML_PAT_FREE_STRING(c, r) if ((c)->comp->dict == NULL) xmlFree(r);
110 xmlStreamCompPtr comp; /* the compiled stream */ member
119 static void xmlFreeStreamComp(xmlStreamCompPtr comp);
183 xmlPatternPtr comp; /* the result */ member
231 xmlFreePattern(xmlPatternPtr comp) { in xmlFreePattern() argument
235 if (comp == NULL) in xmlFreePattern()
237 if (comp->next != NULL) in xmlFreePattern()
238 xmlFreePattern(comp->next); in xmlFreePattern()
239 if (comp->stream != NULL) in xmlFreePattern()
240 xmlFreeStreamComp(comp->stream); in xmlFreePattern()
241 if (comp->pattern != NULL) in xmlFreePattern()
242 xmlFree((xmlChar *)comp->pattern); in xmlFreePattern()
243 if (comp->steps != NULL) { in xmlFreePattern()
244 if (comp->dict == NULL) { in xmlFreePattern()
245 for (i = 0;i < comp->nbStep;i++) { in xmlFreePattern()
246 op = &comp->steps[i]; in xmlFreePattern()
253 xmlFree(comp->steps); in xmlFreePattern()
255 if (comp->dict != NULL) in xmlFreePattern()
256 xmlDictFree(comp->dict); in xmlFreePattern()
258 memset(comp, -1, sizeof(xmlPattern)); in xmlFreePattern()
259 xmlFree(comp); in xmlFreePattern()
269 xmlFreePatternList(xmlPatternPtr comp) { in xmlFreePatternList() argument
272 while (comp != NULL) { in xmlFreePatternList()
273 cur = comp; in xmlFreePatternList()
274 comp = comp->next; in xmlFreePatternList()
348 xmlPatternPtr comp, in xmlPatternAdd() argument
351 if (comp->nbStep >= comp->maxStep) { in xmlPatternAdd()
353 temp = (xmlStepOpPtr) xmlRealloc(comp->steps, comp->maxStep * 2 * in xmlPatternAdd()
360 comp->steps = temp; in xmlPatternAdd()
361 comp->maxStep *= 2; in xmlPatternAdd()
363 comp->steps[comp->nbStep].op = op; in xmlPatternAdd()
364 comp->steps[comp->nbStep].value = value; in xmlPatternAdd()
365 comp->steps[comp->nbStep].value2 = value2; in xmlPatternAdd()
366 comp->nbStep++; in xmlPatternAdd()
378 xsltSwapTopPattern(xmlPatternPtr comp) {
380 int j = comp->nbStep - 1;
386 tmp = comp->steps[i].value;
387 comp->steps[i].value = comp->steps[j].value;
388 comp->steps[j].value = tmp;
389 tmp = comp->steps[i].value2;
390 comp->steps[i].value2 = comp->steps[j].value2;
391 comp->steps[j].value2 = tmp;
392 op = comp->steps[i].op;
393 comp->steps[i].op = comp->steps[j].op;
394 comp->steps[j].op = op;
408 xmlReversePattern(xmlPatternPtr comp) { in xmlReversePattern() argument
414 if ((comp->nbStep > 0) && (comp->steps[0].op == XML_OP_ANCESTOR)) { in xmlReversePattern()
415 for (i = 0, j = 1;j < comp->nbStep;i++,j++) { in xmlReversePattern()
416 comp->steps[i].value = comp->steps[j].value; in xmlReversePattern()
417 comp->steps[i].value2 = comp->steps[j].value2; in xmlReversePattern()
418 comp->steps[i].op = comp->steps[j].op; in xmlReversePattern()
420 comp->nbStep--; in xmlReversePattern()
422 if (comp->nbStep >= comp->maxStep) { in xmlReversePattern()
424 temp = (xmlStepOpPtr) xmlRealloc(comp->steps, comp->maxStep * 2 * in xmlReversePattern()
431 comp->steps = temp; in xmlReversePattern()
432 comp->maxStep *= 2; in xmlReversePattern()
435 j = comp->nbStep - 1; in xmlReversePattern()
439 tmp = comp->steps[i].value; in xmlReversePattern()
440 comp->steps[i].value = comp->steps[j].value; in xmlReversePattern()
441 comp->steps[j].value = tmp; in xmlReversePattern()
442 tmp = comp->steps[i].value2; in xmlReversePattern()
443 comp->steps[i].value2 = comp->steps[j].value2; in xmlReversePattern()
444 comp->steps[j].value2 = tmp; in xmlReversePattern()
445 op = comp->steps[i].op; in xmlReversePattern()
446 comp->steps[i].op = comp->steps[j].op; in xmlReversePattern()
447 comp->steps[j].op = op; in xmlReversePattern()
451 comp->steps[comp->nbStep].value = NULL; in xmlReversePattern()
452 comp->steps[comp->nbStep].value2 = NULL; in xmlReversePattern()
453 comp->steps[comp->nbStep++].op = XML_OP_END; in xmlReversePattern()
498 xmlPatMatch(xmlPatternPtr comp, xmlNodePtr node) { in xmlPatMatch() argument
503 if ((comp == NULL) || (node == NULL)) return(-1); in xmlPatMatch()
506 for (;i < comp->nbStep;i++) { in xmlPatMatch()
507 step = &comp->steps[i]; in xmlPatMatch()
619 step = &comp->steps[i]; in xmlPatMatch()
730 if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
1033 if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) { in xmlCompileStepPattern()
1186 if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) { in xmlCompileStepPattern()
1236 ctxt->comp->flags |= PAT_FROM_ROOT; in xmlCompilePathPattern()
1237 } else if ((CUR == '.') || (ctxt->comp->flags & XML_PATTERN_NOTPATTERN)) { in xmlCompilePathPattern()
1238 ctxt->comp->flags |= PAT_FROM_CUR; in xmlCompilePathPattern()
1338 ctxt->comp->flags |= PAT_FROM_CUR; in xmlCompileIDCXPathPath()
1474 if (ctxt->comp->steps[ctxt->states[2 * i]].flags & in xmlDebugStreamCtxt()
1524 xmlFreeStreamComp(xmlStreamCompPtr comp) { in xmlFreeStreamComp() argument
1525 if (comp != NULL) { in xmlFreeStreamComp()
1526 if (comp->steps != NULL) in xmlFreeStreamComp()
1527 xmlFree(comp->steps); in xmlFreeStreamComp()
1528 if (comp->dict != NULL) in xmlFreeStreamComp()
1529 xmlDictFree(comp->dict); in xmlFreeStreamComp()
1530 xmlFree(comp); in xmlFreeStreamComp()
1546 xmlStreamCompAddStep(xmlStreamCompPtr comp, const xmlChar *name, in xmlStreamCompAddStep() argument
1550 if (comp->nbStep >= comp->maxStep) { in xmlStreamCompAddStep()
1551 cur = (xmlStreamStepPtr) xmlRealloc(comp->steps, in xmlStreamCompAddStep()
1552 comp->maxStep * 2 * sizeof(xmlStreamStep)); in xmlStreamCompAddStep()
1558 comp->steps = cur; in xmlStreamCompAddStep()
1559 comp->maxStep *= 2; in xmlStreamCompAddStep()
1561 cur = &comp->steps[comp->nbStep++]; in xmlStreamCompAddStep()
1566 return(comp->nbStep - 1); in xmlStreamCompAddStep()
1578 xmlStreamCompile(xmlPatternPtr comp) { in xmlStreamCompile() argument
1583 if ((comp == NULL) || (comp->steps == NULL)) in xmlStreamCompile()
1588 if ((comp->nbStep == 1) && in xmlStreamCompile()
1589 (comp->steps[0].op == XML_OP_ELEM) && in xmlStreamCompile()
1590 (comp->steps[0].value == NULL) && in xmlStreamCompile()
1591 (comp->steps[0].value2 == NULL)) { in xmlStreamCompile()
1597 comp->stream = stream; in xmlStreamCompile()
1601 stream = xmlNewStreamComp((comp->nbStep / 2) + 1); in xmlStreamCompile()
1604 if (comp->dict != NULL) { in xmlStreamCompile()
1605 stream->dict = comp->dict; in xmlStreamCompile()
1610 if (comp->flags & PAT_FROM_ROOT) in xmlStreamCompile()
1613 for (;i < comp->nbStep;i++) { in xmlStreamCompile()
1614 step = comp->steps[i]; in xmlStreamCompile()
1650 if ((comp->nbStep == i + 1) && in xmlStreamCompile()
1656 if (comp->nbStep == i + 1) { in xmlStreamCompile()
1722 if ((! root) && (comp->flags & XML_PATTERN_NOTPATTERN) == 0) { in xmlStreamCompile()
1744 comp->stream = stream; in xmlStreamCompile()
1780 cur->comp = stream; in xmlNewStreamCtxt()
1814 xmlStreamCtxtAddState(xmlStreamCtxtPtr comp, int idx, int level) { in xmlStreamCtxtAddState() argument
1816 for (i = 0;i < comp->nbState;i++) { in xmlStreamCtxtAddState()
1817 if (comp->states[2 * i] < 0) { in xmlStreamCtxtAddState()
1818 comp->states[2 * i] = idx; in xmlStreamCtxtAddState()
1819 comp->states[2 * i + 1] = level; in xmlStreamCtxtAddState()
1823 if (comp->nbState >= comp->maxState) { in xmlStreamCtxtAddState()
1826 cur = (int *) xmlRealloc(comp->states, in xmlStreamCtxtAddState()
1827 comp->maxState * 4 * sizeof(int)); in xmlStreamCtxtAddState()
1833 comp->states = cur; in xmlStreamCtxtAddState()
1834 comp->maxState *= 2; in xmlStreamCtxtAddState()
1836 comp->states[2 * comp->nbState] = idx; in xmlStreamCtxtAddState()
1837 comp->states[2 * comp->nbState++ + 1] = level; in xmlStreamCtxtAddState()
1838 return(comp->nbState - 1); in xmlStreamCtxtAddState()
1862 xmlStreamCompPtr comp; in xmlStreamPushInternal() local
1872 comp = stream->comp; in xmlStreamPushInternal()
1880 if (comp->flags & XML_STREAM_FROM_ROOT) { in xmlStreamPushInternal()
1881 if (comp->nbStep == 0) { in xmlStreamPushInternal()
1885 if ((comp->nbStep == 1) && in xmlStreamPushInternal()
1886 (comp->steps[0].nodeType == XML_STREAM_ANY_NODE) && in xmlStreamPushInternal()
1887 (comp->steps[0].flags & XML_STREAM_STEP_DESC)) in xmlStreamPushInternal()
1894 } else if (comp->steps[0].flags & XML_STREAM_STEP_ROOT) { in xmlStreamPushInternal()
1909 if (comp->nbStep == 0) { in xmlStreamPushInternal()
1941 ((comp->flags & XML_STREAM_FINAL_IS_ANY_NODE) == 0)) { in xmlStreamPushInternal()
1957 if ((comp->flags & XML_STREAM_DESC) == 0) { in xmlStreamPushInternal()
1992 desc = comp->steps[stepNr].flags & XML_STREAM_STEP_DESC; in xmlStreamPushInternal()
1999 step = comp->steps[stepNr]; in xmlStreamPushInternal()
2005 if ((comp->flags & XML_STREAM_DESC) == 0) in xmlStreamPushInternal()
2039 } else if (comp->dict) { in xmlStreamPushInternal()
2075 if (((comp->flags & XML_STREAM_DESC) == 0) && in xmlStreamPushInternal()
2095 step = comp->steps[0]; in xmlStreamPushInternal()
2179 if (((comp->flags & XML_STREAM_DESC) == 0) && in xmlStreamPushInternal()
2334 if (streamCtxt->comp->flags & XML_STREAM_FINAL_IS_ANY_NODE) in xmlStreamWantsAnyNode()
2402 ctxt->comp = cur; in xmlPatterncompile()
2464 xmlPatternMatch(xmlPatternPtr comp, xmlNodePtr node) in xmlPatternMatch() argument
2468 if ((comp == NULL) || (node == NULL)) in xmlPatternMatch()
2471 while (comp != NULL) { in xmlPatternMatch()
2472 ret = xmlPatMatch(comp, node); in xmlPatternMatch()
2475 comp = comp->next; in xmlPatternMatch()
2490 xmlPatternGetStreamCtxt(xmlPatternPtr comp) in xmlPatternGetStreamCtxt() argument
2494 if ((comp == NULL) || (comp->stream == NULL)) in xmlPatternGetStreamCtxt()
2497 while (comp != NULL) { in xmlPatternGetStreamCtxt()
2498 if (comp->stream == NULL) in xmlPatternGetStreamCtxt()
2500 cur = xmlNewStreamCtxt(comp->stream); in xmlPatternGetStreamCtxt()
2509 cur->flags = comp->flags; in xmlPatternGetStreamCtxt()
2510 comp = comp->next; in xmlPatternGetStreamCtxt()
2528 xmlPatternStreamable(xmlPatternPtr comp) { in xmlPatternStreamable() argument
2529 if (comp == NULL) in xmlPatternStreamable()
2531 while (comp != NULL) { in xmlPatternStreamable()
2532 if (comp->stream == NULL) in xmlPatternStreamable()
2534 comp = comp->next; in xmlPatternStreamable()
2549 xmlPatternMaxDepth(xmlPatternPtr comp) { in xmlPatternMaxDepth() argument
2551 if (comp == NULL) in xmlPatternMaxDepth()
2553 while (comp != NULL) { in xmlPatternMaxDepth()
2554 if (comp->stream == NULL) in xmlPatternMaxDepth()
2556 for (i = 0;i < comp->stream->nbStep;i++) in xmlPatternMaxDepth()
2557 if (comp->stream->steps[i].flags & XML_STREAM_STEP_DESC) in xmlPatternMaxDepth()
2559 if (comp->stream->nbStep > ret) in xmlPatternMaxDepth()
2560 ret = comp->stream->nbStep; in xmlPatternMaxDepth()
2561 comp = comp->next; in xmlPatternMaxDepth()
2577 xmlPatternMinDepth(xmlPatternPtr comp) { in xmlPatternMinDepth() argument
2579 if (comp == NULL) in xmlPatternMinDepth()
2581 while (comp != NULL) { in xmlPatternMinDepth()
2582 if (comp->stream == NULL) in xmlPatternMinDepth()
2584 if (comp->stream->nbStep < ret) in xmlPatternMinDepth()
2585 ret = comp->stream->nbStep; in xmlPatternMinDepth()
2588 comp = comp->next; in xmlPatternMinDepth()
2602 xmlPatternFromRoot(xmlPatternPtr comp) { in xmlPatternFromRoot() argument
2603 if (comp == NULL) in xmlPatternFromRoot()
2605 while (comp != NULL) { in xmlPatternFromRoot()
2606 if (comp->stream == NULL) in xmlPatternFromRoot()
2608 if (comp->flags & PAT_FROM_ROOT) in xmlPatternFromRoot()
2610 comp = comp->next; in xmlPatternFromRoot()