* 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 */
| 1457 | * Returns 0 in case of error, the index in the stack otherwise |
| 1458 | */ |
| 1459 | static int |
| 1460 | xmlRelaxNGIncludePush(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: |
no test coverage detected