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

Function xmlRelaxNGIncludePush

ThirdParty/libxml2/vtklibxml2/relaxng.c:1459–1488  ·  view source on GitHub ↗

* xmlRelaxNGIncludePush: * @ctxt: the parser context * @value: the element doc * * Pushes a new include on top of the include stack * * Returns 0 in case of error, the index in the stack otherwise */

Source from the content-addressed store, hash-verified

1457 * Returns 0 in case of error, the index in the stack otherwise
1458 */
1459static int
1460xmlRelaxNGIncludePush(xmlRelaxNGParserCtxtPtr ctxt,
1461 xmlRelaxNGIncludePtr value)
1462{
1463 if (ctxt->incTab == NULL) {
1464 ctxt->incMax = 4;
1465 ctxt->incNr = 0;
1466 ctxt->incTab =
1467 (xmlRelaxNGIncludePtr *) xmlMalloc(ctxt->incMax *
1468 sizeof(ctxt->incTab[0]));
1469 if (ctxt->incTab == NULL) {
1470 xmlRngPErrMemory(ctxt);
1471 return (0);
1472 }
1473 }
1474 if (ctxt->incNr >= ctxt->incMax) {
1475 ctxt->incMax *= 2;
1476 ctxt->incTab =
1477 (xmlRelaxNGIncludePtr *) xmlRealloc(ctxt->incTab,
1478 ctxt->incMax *
1479 sizeof(ctxt->incTab[0]));
1480 if (ctxt->incTab == NULL) {
1481 xmlRngPErrMemory(ctxt);
1482 return (0);
1483 }
1484 }
1485 ctxt->incTab[ctxt->incNr] = value;
1486 ctxt->inc = value;
1487 return (ctxt->incNr++);
1488}
1489
1490/**
1491 * xmlRelaxNGIncludePop:

Callers 1

xmlRelaxNGLoadIncludeFunction · 0.85

Calls 1

xmlRngPErrMemoryFunction · 0.85

Tested by

no test coverage detected