fixes the use of 'list' as a parameter added xmlPopInputCallback for Matt
* valid.c include/libxml/valid.h: fixes the use of 'list' as a parameter
* xmlIO.c include/libxml/xmlIO.h: added xmlPopInputCallback for
Matt Sergeant
Daniel
diff --git a/ChangeLog b/ChangeLog
index baeea4d..9c22959 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri May 7 22:31:54 CEST 2004 Daniel Veillard <daniel@veillard.com>
+
+ * valid.c include/libxml/valid.h: fixes the use of 'list' as a parameter
+ * xmlIO.c include/libxml/xmlIO.h: added xmlPopInputCallback for
+ Matt Sergeant
+
Thu May 6 21:14:38 PDT 2004 William Brack <wbrack@mmm.com.hk>
* xmlregexp.c: enhanced the handling of subexpression ranges
diff --git a/NEWS b/NEWS
index 37c8b35..e1b46af 100644
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
dependancy, XML Schemas union support (Kasimier Buchcik), warning removal
clanup (William), keep ChangeLog compressed when installing from RPMs
- documentation: examples and xmlDocDumpMemory docs (John Fleck), new
- example (load, xpath, modify, save), xmlCatalogDump() comments,
+ example (load, xpath, modify, save), xmlCatalogDump() comments,
- Windows: Borland C++ builder (Eric Zurcher), work around Microsoft
compiler NaN handling bug (Mark Vakoc)
diff --git a/include/libxml/valid.h b/include/libxml/valid.h
index 1ff3f0b..004bb90 100644
--- a/include/libxml/valid.h
+++ b/include/libxml/valid.h
@@ -363,7 +363,7 @@
XMLPUBFUN int XMLCALL
xmlValidGetValidElements(xmlNode *prev,
xmlNode *next,
- const xmlChar **list,
+ const xmlChar **names,
int max);
XMLPUBFUN int XMLCALL
xmlValidGetPotentialChildren(xmlElementContent *ctree,
diff --git a/include/libxml/xmlIO.h b/include/libxml/xmlIO.h
index 58a7bb6..2718d51 100644
--- a/include/libxml/xmlIO.h
+++ b/include/libxml/xmlIO.h
@@ -158,6 +158,9 @@
XMLPUBFUN void XMLCALL
xmlCleanupInputCallbacks (void);
+XMLPUBFUN int XMLCALL
+ xmlPopInputCallbacks (void);
+
XMLPUBFUN void XMLCALL
xmlRegisterDefaultInputCallbacks (void);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
diff --git a/valid.c b/valid.c
index 378338b..6460334 100644
--- a/valid.c
+++ b/valid.c
@@ -6586,7 +6586,7 @@
* xmlValidGetValidElements:
* @prev: an element to insert after
* @next: an element to insert next
- * @list: an array to store the list of child names
+ * @names: an array to store the list of child names
* @max: the size of the array
*
* This function returns the list of authorized children to insert
@@ -6608,7 +6608,7 @@
*/
int
-xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **list,
+xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **names,
int max) {
xmlValidCtxt vctxt;
int nb_valid_elements = 0;
@@ -6632,7 +6632,7 @@
if (prev == NULL && next == NULL)
return(-1);
- if (list == NULL) return(-1);
+ if (names == NULL) return(-1);
if (max <= 0) return(-1);
nb_valid_elements = 0;
@@ -6686,8 +6686,8 @@
int j;
for (j = 0; j < nb_valid_elements;j++)
- if (xmlStrEqual(elements[i], list[j])) break;
- list[nb_valid_elements++] = elements[i];
+ if (xmlStrEqual(elements[i], names[j])) break;
+ names[nb_valid_elements++] = elements[i];
if (nb_valid_elements >= max) break;
}
}
diff --git a/xmlIO.c b/xmlIO.c
index 8c4b68f..970fa6e 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -475,6 +475,32 @@
xmlInputCallbackInitialized = 0;
}
+/**
+ * xmlPopInputCallback:
+ *
+ * Clear the top input callback from the input stack. this includes the
+ * compiled-in I/O.
+ *
+ * Returns the number of input callback registered or -1 in case of error.
+ */
+int
+xmlPopInputCallbacks(void)
+{
+ if (!xmlInputCallbackInitialized)
+ return(-1);
+
+ if (xmlInputCallbackNr <= 0)
+ return(-1);
+
+ xmlInputCallbackNr--;
+ xmlInputCallbackTable[xmlInputCallbackNr].matchcallback = NULL;
+ xmlInputCallbackTable[xmlInputCallbackNr].opencallback = NULL;
+ xmlInputCallbackTable[xmlInputCallbackNr].readcallback = NULL;
+ xmlInputCallbackTable[xmlInputCallbackNr].closecallback = NULL;
+
+ return(xmlInputCallbackNr);
+}
+
#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlCleanupOutputCallbacks: