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

Function namePush

ThirdParty/libxml2/vtklibxml2/parser.c:2174–2196  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2172 * Returns -1 in case of error, the index in the stack otherwise
2173 */
2174int
2175namePush(xmlParserCtxtPtr ctxt, const xmlChar * value)
2176{
2177 if (ctxt == NULL) return (-1);
2178
2179 if (ctxt->nameNr >= ctxt->nameMax) {
2180 const xmlChar * *tmp;
2181 tmp = (const xmlChar * *) xmlRealloc((xmlChar * *)ctxt->nameTab,
2182 ctxt->nameMax * 2 *
2183 sizeof(ctxt->nameTab[0]));
2184 if (tmp == NULL) {
2185 goto mem_error;
2186 }
2187 ctxt->nameTab = tmp;
2188 ctxt->nameMax *= 2;
2189 }
2190 ctxt->nameTab[ctxt->nameNr] = value;
2191 ctxt->name = value;
2192 return (ctxt->nameNr++);
2193mem_error:
2194 xmlErrMemory(ctxt);
2195 return (-1);
2196}
2197
2198/**
2199 * namePop:

Callers

nothing calls this directly

Calls 1

xmlErrMemoryFunction · 0.85

Tested by

no test coverage detected