MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlPatternMaxDepth

Function xmlPatternMaxDepth

ThirdParty/libxml2/vtklibxml2/pattern.c:2497–2513  ·  view source on GitHub ↗

* xmlPatternMaxDepth: * @comp: the precompiled pattern * * Check the maximum depth reachable by a pattern * * Returns -2 if no limit (using //), otherwise the depth, * and -1 in case of error */

Source from the content-addressed store, hash-verified

2495 * and -1 in case of error
2496 */
2497int
2498xmlPatternMaxDepth(xmlPatternPtr comp) {
2499 int ret = 0, i;
2500 if (comp == NULL)
2501 return(-1);
2502 while (comp != NULL) {
2503 if (comp->stream == NULL)
2504 return(-1);
2505 for (i = 0;i < comp->stream->nbStep;i++)
2506 if (comp->stream->steps[i].flags & XML_STREAM_STEP_DESC)
2507 return(-2);
2508 if (comp->stream->nbStep > ret)
2509 ret = comp->stream->nbStep;
2510 comp = comp->next;
2511 }
2512 return(ret);
2513}
2514
2515/**
2516 * xmlPatternMinDepth:

Callers 1

xmlXPathRunStreamEvalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected