* 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 */
| 2172 | * Returns -1 in case of error, the index in the stack otherwise |
| 2173 | */ |
| 2174 | int |
| 2175 | namePush(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++); |
| 2193 | mem_error: |
| 2194 | xmlErrMemory(ctxt); |
| 2195 | return (-1); |
| 2196 | } |
| 2197 | |
| 2198 | /** |
| 2199 | * namePop: |
nothing calls this directly
no test coverage detected