* xmlPatternMinDepth: * @comp: the precompiled pattern * * Check the minimum depth reachable by a pattern, 0 mean the / or . are * part of the set. * * Returns -1 in case of error otherwise the depth, * */
| 2523 | * |
| 2524 | */ |
| 2525 | int |
| 2526 | xmlPatternMinDepth(xmlPatternPtr comp) { |
| 2527 | int ret = 12345678; |
| 2528 | if (comp == NULL) |
| 2529 | return(-1); |
| 2530 | while (comp != NULL) { |
| 2531 | if (comp->stream == NULL) |
| 2532 | return(-1); |
| 2533 | if (comp->stream->nbStep < ret) |
| 2534 | ret = comp->stream->nbStep; |
| 2535 | if (ret == 0) |
| 2536 | return(0); |
| 2537 | comp = comp->next; |
| 2538 | } |
| 2539 | return(ret); |
| 2540 | } |
| 2541 | |
| 2542 | /** |
| 2543 | * xmlPatternFromRoot: |
no outgoing calls
no test coverage detected