| 461 | ************************************************************************/ |
| 462 | |
| 463 | static int |
| 464 | xmlPatPushState(xmlStepStates *states, int step, xmlNodePtr node) { |
| 465 | if ((states->states == NULL) || (states->maxstates <= 0)) { |
| 466 | states->maxstates = 4; |
| 467 | states->nbstates = 0; |
| 468 | states->states = xmlMalloc(4 * sizeof(xmlStepState)); |
| 469 | } |
| 470 | else if (states->maxstates <= states->nbstates) { |
| 471 | xmlStepState *tmp; |
| 472 | |
| 473 | tmp = (xmlStepStatePtr) xmlRealloc(states->states, |
| 474 | 2 * states->maxstates * sizeof(xmlStepState)); |
| 475 | if (tmp == NULL) |
| 476 | return(-1); |
| 477 | states->states = tmp; |
| 478 | states->maxstates *= 2; |
| 479 | } |
| 480 | states->states[states->nbstates].step = step; |
| 481 | states->states[states->nbstates++].node = node; |
| 482 | #if 0 |
| 483 | fprintf(stderr, "Push: %d, %s\n", step, node->name); |
| 484 | #endif |
| 485 | return(0); |
| 486 | } |
| 487 | |
| 488 | /** |
| 489 | * xmlPatMatch: |
no test coverage detected