| 372 | #endif /* LIBXML_REGEXP_ENABLED */ |
| 373 | |
| 374 | static int |
| 375 | nodeVPush(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 | } |
| 403 | static xmlNodePtr |
| 404 | nodeVPop(xmlValidCtxtPtr ctxt) |
| 405 | { |
no test coverage detected