/* Returns -1 in case of error, the index in the stack otherwise  */
int namePush(xmlParserCtxtPtr ctxt, const xmlChar *value)
/* Returns -1 in case of error, the index in the stack otherwise  */
int namePush(xmlParserCtxtPtr ctxt, const xmlChar *value)
{
    if (ctxt == NULL) return (-1);
    if (ctxt->nameNr >= ctxt->nameMax) {
        const xmlChar * *tmp;
        tmp = (const xmlChar * *) xmlRealloc((xmlChar * *)ctxt->nameTab,
                                    ctxt->nameMax * 2 *
                                    sizeof(ctxt->nameTab[0]));
        if (tmp == NULL) {
	    goto mem_error;
        }
	ctxt->nameTab = tmp;
        ctxt->nameMax *= 2;
    }
    ctxt->nameTab[ctxt->nameNr] = value;
    ctxt->name = value;
    return (ctxt->nameNr++);
mem_error:
    xmlErrMemory(ctxt, NULL);
    return (-1);
}