• Home
  • Raw
  • Download

Lines Matching refs:comp

80     if ((c)->comp->dict) \
81 r = (xmlChar *) xmlDictLookup((c)->comp->dict, BAD_CAST nsname, -1); \
84 #define XML_PAT_FREE_STRING(c, r) if ((c)->comp->dict == NULL) xmlFree(r);
107 xmlStreamCompPtr comp; /* the compiled stream */ member
116 static void xmlFreeStreamComp(xmlStreamCompPtr comp);
180 xmlPatternPtr comp; /* the result */ member
228 xmlFreePattern(xmlPatternPtr comp) { in xmlFreePattern() argument
232 if (comp == NULL) in xmlFreePattern()
234 if (comp->next != NULL) in xmlFreePattern()
235 xmlFreePattern(comp->next); in xmlFreePattern()
236 if (comp->stream != NULL) in xmlFreePattern()
237 xmlFreeStreamComp(comp->stream); in xmlFreePattern()
238 if (comp->pattern != NULL) in xmlFreePattern()
239 xmlFree((xmlChar *)comp->pattern); in xmlFreePattern()
240 if (comp->steps != NULL) { in xmlFreePattern()
241 if (comp->dict == NULL) { in xmlFreePattern()
242 for (i = 0;i < comp->nbStep;i++) { in xmlFreePattern()
243 op = &comp->steps[i]; in xmlFreePattern()
250 xmlFree(comp->steps); in xmlFreePattern()
252 if (comp->dict != NULL) in xmlFreePattern()
253 xmlDictFree(comp->dict); in xmlFreePattern()
255 memset(comp, -1, sizeof(xmlPattern)); in xmlFreePattern()
256 xmlFree(comp); in xmlFreePattern()
266 xmlFreePatternList(xmlPatternPtr comp) { in xmlFreePatternList() argument
269 while (comp != NULL) { in xmlFreePatternList()
270 cur = comp; in xmlFreePatternList()
271 comp = comp->next; in xmlFreePatternList()
344 xmlPatternPtr comp, in xmlPatternAdd() argument
347 if (comp->nbStep >= comp->maxStep) { in xmlPatternAdd()
349 temp = (xmlStepOpPtr) xmlRealloc(comp->steps, comp->maxStep * 2 * in xmlPatternAdd()
356 comp->steps = temp; in xmlPatternAdd()
357 comp->maxStep *= 2; in xmlPatternAdd()
359 comp->steps[comp->nbStep].op = op; in xmlPatternAdd()
360 comp->steps[comp->nbStep].value = value; in xmlPatternAdd()
361 comp->steps[comp->nbStep].value2 = value2; in xmlPatternAdd()
362 comp->nbStep++; in xmlPatternAdd()
374 xsltSwapTopPattern(xmlPatternPtr comp) {
376 int j = comp->nbStep - 1;
382 tmp = comp->steps[i].value;
383 comp->steps[i].value = comp->steps[j].value;
384 comp->steps[j].value = tmp;
385 tmp = comp->steps[i].value2;
386 comp->steps[i].value2 = comp->steps[j].value2;
387 comp->steps[j].value2 = tmp;
388 op = comp->steps[i].op;
389 comp->steps[i].op = comp->steps[j].op;
390 comp->steps[j].op = op;
404 xmlReversePattern(xmlPatternPtr comp) { in xmlReversePattern() argument
410 if ((comp->nbStep > 0) && (comp->steps[0].op == XML_OP_ANCESTOR)) { in xmlReversePattern()
411 for (i = 0, j = 1;j < comp->nbStep;i++,j++) { in xmlReversePattern()
412 comp->steps[i].value = comp->steps[j].value; in xmlReversePattern()
413 comp->steps[i].value2 = comp->steps[j].value2; in xmlReversePattern()
414 comp->steps[i].op = comp->steps[j].op; in xmlReversePattern()
416 comp->nbStep--; in xmlReversePattern()
418 if (comp->nbStep >= comp->maxStep) { in xmlReversePattern()
420 temp = (xmlStepOpPtr) xmlRealloc(comp->steps, comp->maxStep * 2 * in xmlReversePattern()
427 comp->steps = temp; in xmlReversePattern()
428 comp->maxStep *= 2; in xmlReversePattern()
431 j = comp->nbStep - 1; in xmlReversePattern()
435 tmp = comp->steps[i].value; in xmlReversePattern()
436 comp->steps[i].value = comp->steps[j].value; in xmlReversePattern()
437 comp->steps[j].value = tmp; in xmlReversePattern()
438 tmp = comp->steps[i].value2; in xmlReversePattern()
439 comp->steps[i].value2 = comp->steps[j].value2; in xmlReversePattern()
440 comp->steps[j].value2 = tmp; in xmlReversePattern()
441 op = comp->steps[i].op; in xmlReversePattern()
442 comp->steps[i].op = comp->steps[j].op; in xmlReversePattern()
443 comp->steps[j].op = op; in xmlReversePattern()
447 comp->steps[comp->nbStep].value = NULL; in xmlReversePattern()
448 comp->steps[comp->nbStep].value2 = NULL; in xmlReversePattern()
449 comp->steps[comp->nbStep++].op = XML_OP_END; in xmlReversePattern()
494 xmlPatMatch(xmlPatternPtr comp, xmlNodePtr node) { in xmlPatMatch() argument
499 if ((comp == NULL) || (node == NULL)) return(-1); in xmlPatMatch()
502 for (;i < comp->nbStep;i++) { in xmlPatMatch()
503 step = &comp->steps[i]; in xmlPatMatch()
615 step = &comp->steps[i]; in xmlPatMatch()
726 if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
1028 if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) { in xmlCompileStepPattern()
1181 if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) { in xmlCompileStepPattern()
1231 ctxt->comp->flags |= PAT_FROM_ROOT; in xmlCompilePathPattern()
1232 } else if ((CUR == '.') || (ctxt->comp->flags & XML_PATTERN_NOTPATTERN)) { in xmlCompilePathPattern()
1233 ctxt->comp->flags |= PAT_FROM_CUR; in xmlCompilePathPattern()
1333 ctxt->comp->flags |= PAT_FROM_CUR; in xmlCompileIDCXPathPath()
1469 if (ctxt->comp->steps[ctxt->states[2 * i]].flags & in xmlDebugStreamCtxt()
1519 xmlFreeStreamComp(xmlStreamCompPtr comp) { in xmlFreeStreamComp() argument
1520 if (comp != NULL) { in xmlFreeStreamComp()
1521 if (comp->steps != NULL) in xmlFreeStreamComp()
1522 xmlFree(comp->steps); in xmlFreeStreamComp()
1523 if (comp->dict != NULL) in xmlFreeStreamComp()
1524 xmlDictFree(comp->dict); in xmlFreeStreamComp()
1525 xmlFree(comp); in xmlFreeStreamComp()
1541 xmlStreamCompAddStep(xmlStreamCompPtr comp, const xmlChar *name, in xmlStreamCompAddStep() argument
1545 if (comp->nbStep >= comp->maxStep) { in xmlStreamCompAddStep()
1546 cur = (xmlStreamStepPtr) xmlRealloc(comp->steps, in xmlStreamCompAddStep()
1547 comp->maxStep * 2 * sizeof(xmlStreamStep)); in xmlStreamCompAddStep()
1553 comp->steps = cur; in xmlStreamCompAddStep()
1554 comp->maxStep *= 2; in xmlStreamCompAddStep()
1556 cur = &comp->steps[comp->nbStep++]; in xmlStreamCompAddStep()
1561 return(comp->nbStep - 1); in xmlStreamCompAddStep()
1573 xmlStreamCompile(xmlPatternPtr comp) { in xmlStreamCompile() argument
1578 if ((comp == NULL) || (comp->steps == NULL)) in xmlStreamCompile()
1583 if ((comp->nbStep == 1) && in xmlStreamCompile()
1584 (comp->steps[0].op == XML_OP_ELEM) && in xmlStreamCompile()
1585 (comp->steps[0].value == NULL) && in xmlStreamCompile()
1586 (comp->steps[0].value2 == NULL)) { in xmlStreamCompile()
1592 comp->stream = stream; in xmlStreamCompile()
1596 stream = xmlNewStreamComp((comp->nbStep / 2) + 1); in xmlStreamCompile()
1599 if (comp->dict != NULL) { in xmlStreamCompile()
1600 stream->dict = comp->dict; in xmlStreamCompile()
1605 if (comp->flags & PAT_FROM_ROOT) in xmlStreamCompile()
1608 for (;i < comp->nbStep;i++) { in xmlStreamCompile()
1609 step = comp->steps[i]; in xmlStreamCompile()
1645 if ((comp->nbStep == i + 1) && in xmlStreamCompile()
1651 if (comp->nbStep == i + 1) { in xmlStreamCompile()
1717 if ((! root) && (comp->flags & XML_PATTERN_NOTPATTERN) == 0) { in xmlStreamCompile()
1739 comp->stream = stream; in xmlStreamCompile()
1775 cur->comp = stream; in xmlNewStreamCtxt()
1809 xmlStreamCtxtAddState(xmlStreamCtxtPtr comp, int idx, int level) { in xmlStreamCtxtAddState() argument
1811 for (i = 0;i < comp->nbState;i++) { in xmlStreamCtxtAddState()
1812 if (comp->states[2 * i] < 0) { in xmlStreamCtxtAddState()
1813 comp->states[2 * i] = idx; in xmlStreamCtxtAddState()
1814 comp->states[2 * i + 1] = level; in xmlStreamCtxtAddState()
1818 if (comp->nbState >= comp->maxState) { in xmlStreamCtxtAddState()
1821 cur = (int *) xmlRealloc(comp->states, in xmlStreamCtxtAddState()
1822 comp->maxState * 4 * sizeof(int)); in xmlStreamCtxtAddState()
1828 comp->states = cur; in xmlStreamCtxtAddState()
1829 comp->maxState *= 2; in xmlStreamCtxtAddState()
1831 comp->states[2 * comp->nbState] = idx; in xmlStreamCtxtAddState()
1832 comp->states[2 * comp->nbState++ + 1] = level; in xmlStreamCtxtAddState()
1833 return(comp->nbState - 1); in xmlStreamCtxtAddState()
1857 xmlStreamCompPtr comp; in xmlStreamPushInternal() local
1867 comp = stream->comp; in xmlStreamPushInternal()
1875 if (comp->flags & XML_STREAM_FROM_ROOT) { in xmlStreamPushInternal()
1876 if (comp->nbStep == 0) { in xmlStreamPushInternal()
1880 if ((comp->nbStep == 1) && in xmlStreamPushInternal()
1881 (comp->steps[0].nodeType == XML_STREAM_ANY_NODE) && in xmlStreamPushInternal()
1882 (comp->steps[0].flags & XML_STREAM_STEP_DESC)) in xmlStreamPushInternal()
1889 } else if (comp->steps[0].flags & XML_STREAM_STEP_ROOT) { in xmlStreamPushInternal()
1904 if (comp->nbStep == 0) { in xmlStreamPushInternal()
1936 ((comp->flags & XML_STREAM_FINAL_IS_ANY_NODE) == 0)) { in xmlStreamPushInternal()
1952 if ((comp->flags & XML_STREAM_DESC) == 0) { in xmlStreamPushInternal()
1987 desc = comp->steps[stepNr].flags & XML_STREAM_STEP_DESC; in xmlStreamPushInternal()
1994 step = comp->steps[stepNr]; in xmlStreamPushInternal()
2000 if ((comp->flags & XML_STREAM_DESC) == 0) in xmlStreamPushInternal()
2034 } else if (comp->dict) { in xmlStreamPushInternal()
2070 if (((comp->flags & XML_STREAM_DESC) == 0) && in xmlStreamPushInternal()
2090 step = comp->steps[0]; in xmlStreamPushInternal()
2174 if (((comp->flags & XML_STREAM_DESC) == 0) && in xmlStreamPushInternal()
2329 if (streamCtxt->comp->flags & XML_STREAM_FINAL_IS_ANY_NODE) in xmlStreamWantsAnyNode()
2397 ctxt->comp = cur; in xmlPatterncompile()
2459 xmlPatternMatch(xmlPatternPtr comp, xmlNodePtr node) in xmlPatternMatch() argument
2463 if ((comp == NULL) || (node == NULL)) in xmlPatternMatch()
2466 while (comp != NULL) { in xmlPatternMatch()
2467 ret = xmlPatMatch(comp, node); in xmlPatternMatch()
2470 comp = comp->next; in xmlPatternMatch()
2485 xmlPatternGetStreamCtxt(xmlPatternPtr comp) in xmlPatternGetStreamCtxt() argument
2489 if ((comp == NULL) || (comp->stream == NULL)) in xmlPatternGetStreamCtxt()
2492 while (comp != NULL) { in xmlPatternGetStreamCtxt()
2493 if (comp->stream == NULL) in xmlPatternGetStreamCtxt()
2495 cur = xmlNewStreamCtxt(comp->stream); in xmlPatternGetStreamCtxt()
2504 cur->flags = comp->flags; in xmlPatternGetStreamCtxt()
2505 comp = comp->next; in xmlPatternGetStreamCtxt()
2523 xmlPatternStreamable(xmlPatternPtr comp) { in xmlPatternStreamable() argument
2524 if (comp == NULL) in xmlPatternStreamable()
2526 while (comp != NULL) { in xmlPatternStreamable()
2527 if (comp->stream == NULL) in xmlPatternStreamable()
2529 comp = comp->next; in xmlPatternStreamable()
2544 xmlPatternMaxDepth(xmlPatternPtr comp) { in xmlPatternMaxDepth() argument
2546 if (comp == NULL) in xmlPatternMaxDepth()
2548 while (comp != NULL) { in xmlPatternMaxDepth()
2549 if (comp->stream == NULL) in xmlPatternMaxDepth()
2551 for (i = 0;i < comp->stream->nbStep;i++) in xmlPatternMaxDepth()
2552 if (comp->stream->steps[i].flags & XML_STREAM_STEP_DESC) in xmlPatternMaxDepth()
2554 if (comp->stream->nbStep > ret) in xmlPatternMaxDepth()
2555 ret = comp->stream->nbStep; in xmlPatternMaxDepth()
2556 comp = comp->next; in xmlPatternMaxDepth()
2572 xmlPatternMinDepth(xmlPatternPtr comp) { in xmlPatternMinDepth() argument
2574 if (comp == NULL) in xmlPatternMinDepth()
2576 while (comp != NULL) { in xmlPatternMinDepth()
2577 if (comp->stream == NULL) in xmlPatternMinDepth()
2579 if (comp->stream->nbStep < ret) in xmlPatternMinDepth()
2580 ret = comp->stream->nbStep; in xmlPatternMinDepth()
2583 comp = comp->next; in xmlPatternMinDepth()
2597 xmlPatternFromRoot(xmlPatternPtr comp) { in xmlPatternFromRoot() argument
2598 if (comp == NULL) in xmlPatternFromRoot()
2600 while (comp != NULL) { in xmlPatternFromRoot()
2601 if (comp->stream == NULL) in xmlPatternFromRoot()
2603 if (comp->flags & PAT_FROM_ROOT) in xmlPatternFromRoot()
2605 comp = comp->next; in xmlPatternFromRoot()