* 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 */
| 174 | * Returns 0 in case of error, the index in the stack otherwise |
| 175 | */ |
| 176 | static int |
| 177 | htmlNodeInfoPush(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: |
no test coverage detected