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

Function nodePush

ThirdParty/libxml2/vtklibxml2/parser.c:2017–2049  ·  view source on GitHub ↗

* nodePush: * @ctxt: an XML parser context * @value: the element node * * DEPRECATED: Internal function, do not use. * * Pushes a new element node on top of the node stack * * Returns -1 in case of error, the index in the stack otherwise */

Source from the content-addressed store, hash-verified

2015 * Returns -1 in case of error, the index in the stack otherwise
2016 */
2017int
2018nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value)
2019{
2020 int maxDepth;
2021
2022 if (ctxt == NULL)
2023 return(0);
2024
2025 maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
2026 if (ctxt->nodeNr > maxDepth) {
2027 xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
2028 "Excessive depth in document: %d use XML_PARSE_HUGE option\n",
2029 ctxt->nodeNr);
2030 xmlHaltParser(ctxt);
2031 return(-1);
2032 }
2033 if (ctxt->nodeNr >= ctxt->nodeMax) {
2034 xmlNodePtr *tmp;
2035
2036 tmp = (xmlNodePtr *) xmlRealloc(ctxt->nodeTab,
2037 ctxt->nodeMax * 2 *
2038 sizeof(ctxt->nodeTab[0]));
2039 if (tmp == NULL) {
2040 xmlErrMemory(ctxt);
2041 return (-1);
2042 }
2043 ctxt->nodeTab = tmp;
2044 ctxt->nodeMax *= 2;
2045 }
2046 ctxt->nodeTab[ctxt->nodeNr] = value;
2047 ctxt->node = value;
2048 return (ctxt->nodeNr++);
2049}
2050
2051/**
2052 * nodePop:

Callers 4

xmlSAX2StartElementFunction · 0.85
xmlSAX2StartElementNsFunction · 0.85
xmlCtxtParseContentFunction · 0.85
xmlParseInNodeContextFunction · 0.85

Calls 2

xmlHaltParserFunction · 0.85
xmlErrMemoryFunction · 0.85

Tested by

no test coverage detected