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

Function htmlNodeInfoPush

ThirdParty/libxml2/vtklibxml2/HTMLparser.c:176–195  ·  view source on GitHub ↗

* htmlNodeInfoPush: * @ctxt: an HTML parser context * @value: the node info * * Pushes a new element name on top of the node info stack * * Returns 0 in case of error, the index in the stack otherwise */

Source from the content-addressed store, hash-verified

174 * Returns 0 in case of error, the index in the stack otherwise
175 */
176static int
177htmlNodeInfoPush(htmlParserCtxtPtr ctxt, htmlParserNodeInfo *value)
178{
179 if (ctxt->nodeInfoNr >= ctxt->nodeInfoMax) {
180 if (ctxt->nodeInfoMax == 0)
181 ctxt->nodeInfoMax = 5;
182 ctxt->nodeInfoMax *= 2;
183 ctxt->nodeInfoTab = (htmlParserNodeInfo *)
184 xmlRealloc((htmlParserNodeInfo *)ctxt->nodeInfoTab,
185 ctxt->nodeInfoMax *
186 sizeof(ctxt->nodeInfoTab[0]));
187 if (ctxt->nodeInfoTab == NULL) {
188 htmlErrMemory(ctxt);
189 return (0);
190 }
191 }
192 ctxt->nodeInfoTab[ctxt->nodeInfoNr] = *value;
193 ctxt->nodeInfo = &ctxt->nodeInfoTab[ctxt->nodeInfoNr];
194 return (ctxt->nodeInfoNr++);
195}
196
197/**
198 * htmlNodeInfoPop:

Callers 2

htmlParseElementInternalFunction · 0.85
htmlParseTryOrFinishFunction · 0.85

Calls 1

htmlErrMemoryFunction · 0.85

Tested by

no test coverage detected