* xmlPatternGetStreamCtxt: * @comp: the precompiled pattern * * Get a streaming context for that pattern * Use xmlFreeStreamCtxt to free the context. * * Returns a pointer to the context or NULL in case of failure */
| 2436 | * Returns a pointer to the context or NULL in case of failure |
| 2437 | */ |
| 2438 | xmlStreamCtxtPtr |
| 2439 | xmlPatternGetStreamCtxt(xmlPatternPtr comp) |
| 2440 | { |
| 2441 | xmlStreamCtxtPtr ret = NULL, cur; |
| 2442 | |
| 2443 | if ((comp == NULL) || (comp->stream == NULL)) |
| 2444 | return(NULL); |
| 2445 | |
| 2446 | while (comp != NULL) { |
| 2447 | if (comp->stream == NULL) |
| 2448 | goto failed; |
| 2449 | cur = xmlNewStreamCtxt(comp->stream); |
| 2450 | if (cur == NULL) |
| 2451 | goto failed; |
| 2452 | if (ret == NULL) |
| 2453 | ret = cur; |
| 2454 | else { |
| 2455 | cur->next = ret->next; |
| 2456 | ret->next = cur; |
| 2457 | } |
| 2458 | cur->flags = comp->flags; |
| 2459 | comp = comp->next; |
| 2460 | } |
| 2461 | return(ret); |
| 2462 | failed: |
| 2463 | xmlFreeStreamCtxt(ret); |
| 2464 | return(NULL); |
| 2465 | } |
| 2466 | |
| 2467 | /** |
| 2468 | * xmlPatternStreamable: |