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

Function nodeVPush

ThirdParty/libxml2/vtklibxml2/valid.c:374–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372#endif /* LIBXML_REGEXP_ENABLED */
373
374static int
375nodeVPush(xmlValidCtxtPtr ctxt, xmlNodePtr value)
376{
377 if (ctxt->nodeMax <= 0) {
378 ctxt->nodeMax = 4;
379 ctxt->nodeTab =
380 (xmlNodePtr *) xmlMalloc(ctxt->nodeMax *
381 sizeof(ctxt->nodeTab[0]));
382 if (ctxt->nodeTab == NULL) {
383 xmlVErrMemory(ctxt);
384 ctxt->nodeMax = 0;
385 return (0);
386 }
387 }
388 if (ctxt->nodeNr >= ctxt->nodeMax) {
389 xmlNodePtr *tmp;
390 tmp = (xmlNodePtr *) xmlRealloc(ctxt->nodeTab,
391 ctxt->nodeMax * 2 * sizeof(ctxt->nodeTab[0]));
392 if (tmp == NULL) {
393 xmlVErrMemory(ctxt);
394 return (0);
395 }
396 ctxt->nodeMax *= 2;
397 ctxt->nodeTab = tmp;
398 }
399 ctxt->nodeTab[ctxt->nodeNr] = value;
400 ctxt->node = value;
401 return (ctxt->nodeNr++);
402}
403static xmlNodePtr
404nodeVPop(xmlValidCtxtPtr ctxt)
405{

Callers 2

Calls 1

xmlVErrMemoryFunction · 0.85

Tested by

no test coverage detected