parser: Make nodePush, nodePop, namePush, namePop private
diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml
index 57432d7..8ace68e 100644
--- a/doc/libxml2-api.xml
+++ b/doc/libxml2-api.xml
@@ -835,10 +835,6 @@
<exports symbol='xmlStringTextNoenc' type='variable'/>
<exports symbol='inputPop' type='function'/>
<exports symbol='inputPush' type='function'/>
- <exports symbol='namePop' type='function'/>
- <exports symbol='namePush' type='function'/>
- <exports symbol='nodePop' type='function'/>
- <exports symbol='nodePush' type='function'/>
<exports symbol='xmlCheckLanguageID' type='function'/>
<exports symbol='xmlCopyChar' type='function'/>
<exports symbol='xmlCopyCharMultiByte' type='function'/>
@@ -7441,28 +7437,6 @@
<return type='int' info='1 if true'/>
<arg name='ctx' type='void *' info='the user data (XML parser context)'/>
</functype>
- <function name='namePop' file='parserInternals' module='parser'>
- <info>DEPRECATED: Internal function, do not use. Pops the top element name from the name stack</info>
- <return type='const xmlChar *' info='the name just removed'/>
- <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
- </function>
- <function name='namePush' file='parserInternals' module='parser'>
- <info>DEPRECATED: Internal function, do not use. Pushes a new element name on top of the name stack</info>
- <return type='int' info='-1 in case of error, the index in the stack otherwise'/>
- <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
- <arg name='value' type='const xmlChar *' info='the element name'/>
- </function>
- <function name='nodePop' file='parserInternals' module='parser'>
- <info>DEPRECATED: Internal function, do not use. Pops the top element node from the node stack</info>
- <return type='xmlNodePtr' info='the node just removed'/>
- <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
- </function>
- <function name='nodePush' file='parserInternals' module='parser'>
- <info>DEPRECATED: Internal function, do not use. Pushes a new element node on top of the node stack</info>
- <return type='int' info='-1 in case of error, the index in the stack otherwise'/>
- <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
- <arg name='value' type='xmlNodePtr' info='the element node'/>
- </function>
<functype name='notationDeclSAXFunc' file='parser' module='parser'>
<info>What to do when a notation declaration has been parsed.</info>
<return type='void'/>
diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h
index 12ccb0e..f2748b7 100644
--- a/include/libxml/parserInternals.h
+++ b/include/libxml/parserInternals.h
@@ -561,19 +561,9 @@
/*
* Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
*/
-XML_DEPRECATED
-XMLPUBFUN int nodePush (xmlParserCtxtPtr ctxt,
- xmlNodePtr value);
-XML_DEPRECATED
-XMLPUBFUN xmlNodePtr nodePop (xmlParserCtxtPtr ctxt);
XMLPUBFUN int inputPush (xmlParserCtxtPtr ctxt,
xmlParserInputPtr value);
XMLPUBFUN xmlParserInputPtr inputPop (xmlParserCtxtPtr ctxt);
-XML_DEPRECATED
-XMLPUBFUN const xmlChar * namePop (xmlParserCtxtPtr ctxt);
-XML_DEPRECATED
-XMLPUBFUN int namePush (xmlParserCtxtPtr ctxt,
- const xmlChar *value);
/*
* other commodities shared between parser.c and parserInternals.
diff --git a/include/private/parser.h b/include/private/parser.h
index d79def3..1c92edc 100644
--- a/include/private/parser.h
+++ b/include/private/parser.h
@@ -92,6 +92,11 @@
XML_HIDDEN const xmlChar *
xmlGetActualEncoding(xmlParserCtxtPtr ctxt);
+XML_HIDDEN int
+nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value);
+XML_HIDDEN xmlNodePtr
+nodePop(xmlParserCtxtPtr ctxt);
+
XML_HIDDEN xmlParserNsData *
xmlParserNsCreate(void);
XML_HIDDEN void
diff --git a/parser.c b/parser.c
index a335980..fa16b54 100644
--- a/parser.c
+++ b/parser.c
@@ -2236,46 +2236,6 @@
#endif /* LIBXML_PUSH_ENABLED */
/**
- * 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
- */
-int
-namePush(xmlParserCtxtPtr ctxt, const xmlChar * value)
-{
- if (ctxt == NULL) return (-1);
-
- if (ctxt->nameNr >= ctxt->nameMax) {
- const xmlChar **tmp;
- int newSize;
-
- newSize = xmlGrowCapacity(ctxt->nameMax, sizeof(tmp[0]),
- 10, XML_MAX_ITEMS);
- if (newSize < 0)
- goto mem_error;
-
- tmp = xmlRealloc(ctxt->nameTab, newSize * sizeof(tmp[0]));
- if (tmp == NULL)
- goto mem_error;
- ctxt->nameTab = tmp;
-
- ctxt->nameMax = newSize;
- }
- ctxt->nameTab[ctxt->nameNr] = value;
- ctxt->name = value;
- return (ctxt->nameNr++);
-mem_error:
- xmlErrMemory(ctxt);
- return (-1);
-}
-
-/**
* namePop:
* @ctxt: an XML parser context
*
@@ -2285,7 +2245,7 @@
*
* Returns the name just removed
*/
-const xmlChar *
+static const xmlChar *
namePop(xmlParserCtxtPtr ctxt)
{
const xmlChar *ret;
diff --git a/python/generator.py b/python/generator.py
index 49e7af5..9854796 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -303,10 +303,6 @@
'htmlIsBooleanAttr': True,
'htmlParseCharRef': True,
'htmlParseElement': True,
- 'namePop': True,
- 'namePush': True,
- 'nodePop': True,
- 'nodePush': True,
'xmlByteConsumed': True,
'xmlCheckFilename': True,
'xmlCheckLanguageID': True,
diff --git a/testapi.c b/testapi.c
index fd0e0a1..bbc14c7 100644
--- a/testapi.c
+++ b/testapi.c
@@ -15697,148 +15697,6 @@
static int
-test_namePop(void) {
- int test_ret = 0;
-
- int mem_base;
- const xmlChar * ret_val;
- xmlParserCtxtPtr ctxt; /* an XML parser context */
- int n_ctxt;
-
- for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
- mem_base = xmlMemBlocks();
- ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
-
- ret_val = namePop(ctxt);
- desret_const_xmlChar_ptr(ret_val);
- call_tests++;
- des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
- xmlResetLastError();
- if (mem_base != xmlMemBlocks()) {
- printf("Leak of %d blocks found in namePop",
- xmlMemBlocks() - mem_base);
- test_ret++;
- printf(" %d", n_ctxt);
- printf("\n");
- }
- }
- function_tests++;
-
- return(test_ret);
-}
-
-
-static int
-test_namePush(void) {
- int test_ret = 0;
-
- int mem_base;
- int ret_val;
- xmlParserCtxtPtr ctxt; /* an XML parser context */
- int n_ctxt;
- const xmlChar * value; /* the element name */
- int n_value;
-
- for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
- for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) {
- mem_base = xmlMemBlocks();
- ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
- value = gen_const_xmlChar_ptr(n_value, 1);
-
- ret_val = namePush(ctxt, value);
- desret_int(ret_val);
- call_tests++;
- des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
- des_const_xmlChar_ptr(n_value, value, 1);
- xmlResetLastError();
- if (mem_base != xmlMemBlocks()) {
- printf("Leak of %d blocks found in namePush",
- xmlMemBlocks() - mem_base);
- test_ret++;
- printf(" %d", n_ctxt);
- printf(" %d", n_value);
- printf("\n");
- }
- }
- }
- function_tests++;
-
- return(test_ret);
-}
-
-
-static int
-test_nodePop(void) {
- int test_ret = 0;
-
- int mem_base;
- xmlNodePtr ret_val;
- xmlParserCtxtPtr ctxt; /* an XML parser context */
- int n_ctxt;
-
- for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
- mem_base = xmlMemBlocks();
- ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
-
- ret_val = nodePop(ctxt);
- desret_xmlNodePtr(ret_val);
- call_tests++;
- des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
- xmlResetLastError();
- if (mem_base != xmlMemBlocks()) {
- printf("Leak of %d blocks found in nodePop",
- xmlMemBlocks() - mem_base);
- test_ret++;
- printf(" %d", n_ctxt);
- printf("\n");
- }
- }
- function_tests++;
-
- return(test_ret);
-}
-
-
-static int
-test_nodePush(void) {
- int test_ret = 0;
-
- int mem_base;
- int ret_val;
- xmlParserCtxtPtr ctxt; /* an XML parser context */
- int n_ctxt;
- xmlNodePtr value; /* the element node */
- int n_value;
-
- for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
- for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) {
- mem_base = xmlMemBlocks();
- ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
- value = gen_xmlNodePtr(n_value, 1);
-
- ret_val = nodePush(ctxt, value);
- desret_int(ret_val);
- call_tests++;
- des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
- des_xmlNodePtr(n_value, value, 1);
- xmlResetLastError();
- if (mem_base != xmlMemBlocks()) {
- printf("Leak of %d blocks found in nodePush",
- xmlMemBlocks() - mem_base);
- test_ret++;
- printf(" %d", n_ctxt);
- printf(" %d", n_value);
- printf("\n");
- }
- }
- }
- function_tests++;
-
- return(test_ret);
-}
-
-
-static int
test_xmlCheckLanguageID(void) {
int test_ret = 0;
@@ -16968,13 +16826,9 @@
test_parserInternals(void) {
int test_ret = 0;
- if (quiet == 0) printf("Testing parserInternals : 34 of 81 functions ...\n");
+ if (quiet == 0) printf("Testing parserInternals : 30 of 77 functions ...\n");
test_ret += test_inputPop();
test_ret += test_inputPush();
- test_ret += test_namePop();
- test_ret += test_namePush();
- test_ret += test_nodePop();
- test_ret += test_nodePush();
test_ret += test_xmlCheckLanguageID();
test_ret += test_xmlCopyChar();
test_ret += test_xmlCopyCharMultiByte();