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

Function xmlPatPushState

ThirdParty/libxml2/vtklibxml2/pattern.c:463–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461 ************************************************************************/
462
463static int
464xmlPatPushState(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:

Callers 1

xmlPatMatchFunction · 0.85

Calls 1

fprintfFunction · 0.85

Tested by

no test coverage detected