• Home
  • Raw
  • Download

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
232 xmlFreePatternList(comp); in xmlFreePattern()
236 xmlFreePatternInternal(xmlPatternPtr comp) { in xmlFreePatternInternal() argument
240 if (comp == NULL) in xmlFreePatternInternal()
242 if (comp->stream != NULL) in xmlFreePatternInternal()
243 xmlFreeStreamComp(comp->stream); in xmlFreePatternInternal()
244 if (comp->pattern != NULL) in xmlFreePatternInternal()
245 xmlFree((xmlChar *)comp->pattern); in xmlFreePatternInternal()
246 if (comp->steps != NULL) { in xmlFreePatternInternal()
247 if (comp->dict == NULL) { in xmlFreePatternInternal()
248 for (i = 0;i < comp->nbStep;i++) { in xmlFreePatternInternal()
249 op = &comp->steps[i]; in xmlFreePatternInternal()
256 xmlFree(comp->steps); in xmlFreePatternInternal()
258 if (comp->dict != NULL) in xmlFreePatternInternal()
259 xmlDictFree(comp->dict); in xmlFreePatternInternal()
261 memset(comp, -1, sizeof(xmlPattern)); in xmlFreePatternInternal()
262 xmlFree(comp); in xmlFreePatternInternal()
272 xmlFreePatternList(xmlPatternPtr comp) { in xmlFreePatternList() argument
275 while (comp != NULL) { in xmlFreePatternList()
276 cur = comp; in xmlFreePatternList()
277 comp = comp->next; in xmlFreePatternList()
351 xmlPatternPtr comp, in xmlPatternAdd() argument
354 if (comp->nbStep >= comp->maxStep) { in xmlPatternAdd()
356 temp = (xmlStepOpPtr) xmlRealloc(comp->steps, comp->maxStep * 2 * in xmlPatternAdd()
363 comp->steps = temp; in xmlPatternAdd()
364 comp->maxStep *= 2; in xmlPatternAdd()
366 comp->steps[comp->nbStep].op = op; in xmlPatternAdd()
367 comp->steps[comp->nbStep].value = value; in xmlPatternAdd()
368 comp->steps[comp->nbStep].value2 = value2; in xmlPatternAdd()
369 comp->nbStep++; in xmlPatternAdd()
381 xsltSwapTopPattern(xmlPatternPtr comp) {
383 int j = comp->nbStep - 1;
389 tmp = comp->steps[i].value;
390 comp->steps[i].value = comp->steps[j].value;
391 comp->steps[j].value = tmp;
392 tmp = comp->steps[i].value2;
393 comp->steps[i].value2 = comp->steps[j].value2;
394 comp->steps[j].value2 = tmp;
395 op = comp->steps[i].op;
396 comp->steps[i].op = comp->steps[j].op;
397 comp->steps[j].op = op;
411 xmlReversePattern(xmlPatternPtr comp) { in xmlReversePattern() argument
417 if ((comp->nbStep > 0) && (comp->steps[0].op == XML_OP_ANCESTOR)) { in xmlReversePattern()
418 for (i = 0, j = 1;j < comp->nbStep;i++,j++) { in xmlReversePattern()
419 comp->steps[i].value = comp->steps[j].value; in xmlReversePattern()
420 comp->steps[i].value2 = comp->steps[j].value2; in xmlReversePattern()
421 comp->steps[i].op = comp->steps[j].op; in xmlReversePattern()
423 comp->nbStep--; in xmlReversePattern()
425 if (comp->nbStep >= comp->maxStep) { in xmlReversePattern()
427 temp = (xmlStepOpPtr) xmlRealloc(comp->steps, comp->maxStep * 2 * in xmlReversePattern()
434 comp->steps = temp; in xmlReversePattern()
435 comp->maxStep *= 2; in xmlReversePattern()
438 j = comp->nbStep - 1; in xmlReversePattern()
442 tmp = comp->steps[i].value; in xmlReversePattern()
443 comp->steps[i].value = comp->steps[j].value; in xmlReversePattern()
444 comp->steps[j].value = tmp; in xmlReversePattern()
445 tmp = comp->steps[i].value2; in xmlReversePattern()
446 comp->steps[i].value2 = comp->steps[j].value2; in xmlReversePattern()
447 comp->steps[j].value2 = tmp; in xmlReversePattern()
448 op = comp->steps[i].op; in xmlReversePattern()
449 comp->steps[i].op = comp->steps[j].op; in xmlReversePattern()
450 comp->steps[j].op = op; in xmlReversePattern()
454 comp->steps[comp->nbStep].value = NULL; in xmlReversePattern()
455 comp->steps[comp->nbStep].value2 = NULL; in xmlReversePattern()
456 comp->steps[comp->nbStep++].op = XML_OP_END; in xmlReversePattern()
501 xmlPatMatch(xmlPatternPtr comp, xmlNodePtr node) { in xmlPatMatch() argument
506 if ((comp == NULL) || (node == NULL)) return(-1); in xmlPatMatch()
509 for (;i < comp->nbStep;i++) { in xmlPatMatch()
510 step = &comp->steps[i]; in xmlPatMatch()
613 step = &comp->steps[i]; in xmlPatMatch()
721 if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
1024 if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) { in xmlCompileStepPattern()
1177 if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) { in xmlCompileStepPattern()
1227 ctxt->comp->flags |= PAT_FROM_ROOT; in xmlCompilePathPattern()
1228 } else if ((CUR == '.') || (ctxt->comp->flags & XML_PATTERN_NOTPATTERN)) { in xmlCompilePathPattern()
1229 ctxt->comp->flags |= PAT_FROM_CUR; in xmlCompilePathPattern()
1329 ctxt->comp->flags |= PAT_FROM_CUR; in xmlCompileIDCXPathPath()
1465 if (ctxt->comp->steps[ctxt->states[2 * i]].flags & in xmlDebugStreamCtxt()
1515 xmlFreeStreamComp(xmlStreamCompPtr comp) { in xmlFreeStreamComp() argument
1516 if (comp != NULL) { in xmlFreeStreamComp()
1517 if (comp->steps != NULL) in xmlFreeStreamComp()
1518 xmlFree(comp->steps); in xmlFreeStreamComp()
1519 if (comp->dict != NULL) in xmlFreeStreamComp()
1520 xmlDictFree(comp->dict); in xmlFreeStreamComp()
1521 xmlFree(comp); in xmlFreeStreamComp()
1537 xmlStreamCompAddStep(xmlStreamCompPtr comp, const xmlChar *name, in xmlStreamCompAddStep() argument
1541 if (comp->nbStep >= comp->maxStep) { in xmlStreamCompAddStep()
1542 cur = (xmlStreamStepPtr) xmlRealloc(comp->steps, in xmlStreamCompAddStep()
1543 comp->maxStep * 2 * sizeof(xmlStreamStep)); in xmlStreamCompAddStep()
1549 comp->steps = cur; in xmlStreamCompAddStep()
1550 comp->maxStep *= 2; in xmlStreamCompAddStep()
1552 cur = &comp->steps[comp->nbStep++]; in xmlStreamCompAddStep()
1557 return(comp->nbStep - 1); in xmlStreamCompAddStep()
1569 xmlStreamCompile(xmlPatternPtr comp) { in xmlStreamCompile() argument
1574 if ((comp == NULL) || (comp->steps == NULL)) in xmlStreamCompile()
1579 if ((comp->nbStep == 1) && in xmlStreamCompile()
1580 (comp->steps[0].op == XML_OP_ELEM) && in xmlStreamCompile()
1581 (comp->steps[0].value == NULL) && in xmlStreamCompile()
1582 (comp->steps[0].value2 == NULL)) { in xmlStreamCompile()
1588 comp->stream = stream; in xmlStreamCompile()
1592 stream = xmlNewStreamComp((comp->nbStep / 2) + 1); in xmlStreamCompile()
1595 if (comp->dict != NULL) { in xmlStreamCompile()
1596 stream->dict = comp->dict; in xmlStreamCompile()
1601 if (comp->flags & PAT_FROM_ROOT) in xmlStreamCompile()
1604 for (;i < comp->nbStep;i++) { in xmlStreamCompile()
1605 step = comp->steps[i]; in xmlStreamCompile()
1641 if ((comp->nbStep == i + 1) && in xmlStreamCompile()
1647 if (comp->nbStep == i + 1) { in xmlStreamCompile()
1713 if ((! root) && (comp->flags & XML_PATTERN_NOTPATTERN) == 0) { in xmlStreamCompile()
1735 comp->stream = stream; in xmlStreamCompile()
1771 cur->comp = stream; in xmlNewStreamCtxt()
1805 xmlStreamCtxtAddState(xmlStreamCtxtPtr comp, int idx, int level) { in xmlStreamCtxtAddState() argument
1807 for (i = 0;i < comp->nbState;i++) { in xmlStreamCtxtAddState()
1808 if (comp->states[2 * i] < 0) { in xmlStreamCtxtAddState()
1809 comp->states[2 * i] = idx; in xmlStreamCtxtAddState()
1810 comp->states[2 * i + 1] = level; in xmlStreamCtxtAddState()
1814 if (comp->nbState >= comp->maxState) { in xmlStreamCtxtAddState()
1817 cur = (int *) xmlRealloc(comp->states, in xmlStreamCtxtAddState()
1818 comp->maxState * 4 * sizeof(int)); in xmlStreamCtxtAddState()
1824 comp->states = cur; in xmlStreamCtxtAddState()
1825 comp->maxState *= 2; in xmlStreamCtxtAddState()
1827 comp->states[2 * comp->nbState] = idx; in xmlStreamCtxtAddState()
1828 comp->states[2 * comp->nbState++ + 1] = level; in xmlStreamCtxtAddState()
1829 return(comp->nbState - 1); in xmlStreamCtxtAddState()
1853 xmlStreamCompPtr comp; in xmlStreamPushInternal() local
1863 comp = stream->comp; in xmlStreamPushInternal()
1871 if (comp->flags & XML_STREAM_FROM_ROOT) { in xmlStreamPushInternal()
1872 if (comp->nbStep == 0) { in xmlStreamPushInternal()
1876 if ((comp->nbStep == 1) && in xmlStreamPushInternal()
1877 (comp->steps[0].nodeType == XML_STREAM_ANY_NODE) && in xmlStreamPushInternal()
1878 (comp->steps[0].flags & XML_STREAM_STEP_DESC)) in xmlStreamPushInternal()
1885 } else if (comp->steps[0].flags & XML_STREAM_STEP_ROOT) { in xmlStreamPushInternal()
1900 if (comp->nbStep == 0) { in xmlStreamPushInternal()
1932 ((comp->flags & XML_STREAM_FINAL_IS_ANY_NODE) == 0)) { in xmlStreamPushInternal()
1948 if ((comp->flags & XML_STREAM_DESC) == 0) { in xmlStreamPushInternal()
1983 desc = comp->steps[stepNr].flags & XML_STREAM_STEP_DESC; in xmlStreamPushInternal()
1990 step = comp->steps[stepNr]; in xmlStreamPushInternal()
1996 if ((comp->flags & XML_STREAM_DESC) == 0) in xmlStreamPushInternal()
2030 } else if (comp->dict) { in xmlStreamPushInternal()
2056 if (((comp->flags & XML_STREAM_DESC) == 0) && in xmlStreamPushInternal()
2076 step = comp->steps[0]; in xmlStreamPushInternal()
2160 if (((comp->flags & XML_STREAM_DESC) == 0) && in xmlStreamPushInternal()
2315 if (streamCtxt->comp->flags & XML_STREAM_FINAL_IS_ANY_NODE) in xmlStreamWantsAnyNode()
2383 ctxt->comp = cur; in xmlPatterncompile()
2445 xmlPatternMatch(xmlPatternPtr comp, xmlNodePtr node) in xmlPatternMatch() argument
2449 if ((comp == NULL) || (node == NULL)) in xmlPatternMatch()
2452 while (comp != NULL) { in xmlPatternMatch()
2453 ret = xmlPatMatch(comp, node); in xmlPatternMatch()
2456 comp = comp->next; in xmlPatternMatch()
2471 xmlPatternGetStreamCtxt(xmlPatternPtr comp) in xmlPatternGetStreamCtxt() argument
2475 if ((comp == NULL) || (comp->stream == NULL)) in xmlPatternGetStreamCtxt()
2478 while (comp != NULL) { in xmlPatternGetStreamCtxt()
2479 if (comp->stream == NULL) in xmlPatternGetStreamCtxt()
2481 cur = xmlNewStreamCtxt(comp->stream); in xmlPatternGetStreamCtxt()
2490 cur->flags = comp->flags; in xmlPatternGetStreamCtxt()
2491 comp = comp->next; in xmlPatternGetStreamCtxt()
2509 xmlPatternStreamable(xmlPatternPtr comp) { in xmlPatternStreamable() argument
2510 if (comp == NULL) in xmlPatternStreamable()
2512 while (comp != NULL) { in xmlPatternStreamable()
2513 if (comp->stream == NULL) in xmlPatternStreamable()
2515 comp = comp->next; in xmlPatternStreamable()
2530 xmlPatternMaxDepth(xmlPatternPtr comp) { in xmlPatternMaxDepth() argument
2532 if (comp == NULL) in xmlPatternMaxDepth()
2534 while (comp != NULL) { in xmlPatternMaxDepth()
2535 if (comp->stream == NULL) in xmlPatternMaxDepth()
2537 for (i = 0;i < comp->stream->nbStep;i++) in xmlPatternMaxDepth()
2538 if (comp->stream->steps[i].flags & XML_STREAM_STEP_DESC) in xmlPatternMaxDepth()
2540 if (comp->stream->nbStep > ret) in xmlPatternMaxDepth()
2541 ret = comp->stream->nbStep; in xmlPatternMaxDepth()
2542 comp = comp->next; in xmlPatternMaxDepth()
2558 xmlPatternMinDepth(xmlPatternPtr comp) { in xmlPatternMinDepth() argument
2560 if (comp == NULL) in xmlPatternMinDepth()
2562 while (comp != NULL) { in xmlPatternMinDepth()
2563 if (comp->stream == NULL) in xmlPatternMinDepth()
2565 if (comp->stream->nbStep < ret) in xmlPatternMinDepth()
2566 ret = comp->stream->nbStep; in xmlPatternMinDepth()
2569 comp = comp->next; in xmlPatternMinDepth()
2583 xmlPatternFromRoot(xmlPatternPtr comp) { in xmlPatternFromRoot() argument
2584 if (comp == NULL) in xmlPatternFromRoot()
2586 while (comp != NULL) { in xmlPatternFromRoot()
2587 if (comp->stream == NULL) in xmlPatternFromRoot()
2589 if (comp->flags & PAT_FROM_ROOT) in xmlPatternFromRoot()
2591 comp = comp->next; in xmlPatternFromRoot()