1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

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
This commit is contained in:
Daniel Veillard
2004-05-08 02:32:07 +00:00
parent 51c2cfa053
commit aecc0dc1f5
6 changed files with 42 additions and 7 deletions

View File

@ -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> Thu May 6 21:14:38 PDT 2004 William Brack <wbrack@mmm.com.hk>
* xmlregexp.c: enhanced the handling of subexpression ranges * xmlregexp.c: enhanced the handling of subexpression ranges

2
NEWS
View File

@ -25,7 +25,7 @@ There is the list of public releases:
dependancy, XML Schemas union support (Kasimier Buchcik), warning removal dependancy, XML Schemas union support (Kasimier Buchcik), warning removal
clanup (William), keep ChangeLog compressed when installing from RPMs clanup (William), keep ChangeLog compressed when installing from RPMs
- documentation: examples and xmlDocDumpMemory docs (John Fleck), new - 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 - Windows: Borland C++ builder (Eric Zurcher), work around Microsoft
compiler NaN handling bug (Mark Vakoc) compiler NaN handling bug (Mark Vakoc)

View File

@ -363,7 +363,7 @@ XMLPUBFUN xmlElementPtr XMLCALL
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlValidGetValidElements(xmlNode *prev, xmlValidGetValidElements(xmlNode *prev,
xmlNode *next, xmlNode *next,
const xmlChar **list, const xmlChar **names,
int max); int max);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlValidGetPotentialChildren(xmlElementContent *ctree, xmlValidGetPotentialChildren(xmlElementContent *ctree,

View File

@ -158,6 +158,9 @@ struct _xmlOutputBuffer {
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlCleanupInputCallbacks (void); xmlCleanupInputCallbacks (void);
XMLPUBFUN int XMLCALL
xmlPopInputCallbacks (void);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlRegisterDefaultInputCallbacks (void); xmlRegisterDefaultInputCallbacks (void);
XMLPUBFUN xmlParserInputBufferPtr XMLCALL XMLPUBFUN xmlParserInputBufferPtr XMLCALL

10
valid.c
View File

@ -6586,7 +6586,7 @@ xmlValidGetPotentialChildren(xmlElementContent *ctree, const xmlChar **list,
* xmlValidGetValidElements: * xmlValidGetValidElements:
* @prev: an element to insert after * @prev: an element to insert after
* @next: an element to insert next * @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 * @max: the size of the array
* *
* This function returns the list of authorized children to insert * This function returns the list of authorized children to insert
@ -6608,7 +6608,7 @@ xmlValidGetPotentialChildren(xmlElementContent *ctree, const xmlChar **list,
*/ */
int int
xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **list, xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **names,
int max) { int max) {
xmlValidCtxt vctxt; xmlValidCtxt vctxt;
int nb_valid_elements = 0; int nb_valid_elements = 0;
@ -6632,7 +6632,7 @@ xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **list,
if (prev == NULL && next == NULL) if (prev == NULL && next == NULL)
return(-1); return(-1);
if (list == NULL) return(-1); if (names == NULL) return(-1);
if (max <= 0) return(-1); if (max <= 0) return(-1);
nb_valid_elements = 0; nb_valid_elements = 0;
@ -6686,8 +6686,8 @@ xmlValidGetValidElements(xmlNode *prev, xmlNode *next, const xmlChar **list,
int j; int j;
for (j = 0; j < nb_valid_elements;j++) for (j = 0; j < nb_valid_elements;j++)
if (xmlStrEqual(elements[i], list[j])) break; if (xmlStrEqual(elements[i], names[j])) break;
list[nb_valid_elements++] = elements[i]; names[nb_valid_elements++] = elements[i];
if (nb_valid_elements >= max) break; if (nb_valid_elements >= max) break;
} }
} }

26
xmlIO.c
View File

@ -475,6 +475,32 @@ xmlCleanupInputCallbacks(void)
xmlInputCallbackInitialized = 0; 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 #ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlCleanupOutputCallbacks: * xmlCleanupOutputCallbacks: