mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-12 09:17:37 +03:00
Add xmlPopOutputCallbacks
Add function to pop a single set of output callbacks from the stack. This was only implemented for input callbacks before. Fixes #135.
This commit is contained in:
parent
b07251215e
commit
c2e09f445c
@ -1768,4 +1768,7 @@
|
||||
<release version="2.9.8">
|
||||
<symbol file="hash">xmlHashDefaultDeallocator</symbol>
|
||||
</release>
|
||||
<release version="2.9.11">
|
||||
<symbol file="xmlIO">xmlPopOutputCallbacks</symbol>
|
||||
</release>
|
||||
</symbols>
|
||||
|
@ -217,6 +217,8 @@ xmlParserInputBufferPtr
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCleanupOutputCallbacks (void);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlPopOutputCallbacks (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRegisterDefaultOutputCallbacks(void);
|
||||
XMLPUBFUN xmlOutputBufferPtr XMLCALL
|
||||
|
@ -2286,3 +2286,10 @@ LIBXML2_2.9.8 {
|
||||
xmlHashDefaultDeallocator;
|
||||
} LIBXML2_2.9.1;
|
||||
|
||||
LIBXML2_2.9.11 {
|
||||
global:
|
||||
|
||||
# xmlIO
|
||||
xmlPopOutputCallbacks;
|
||||
} LIBXML2_2.9.8;
|
||||
|
||||
|
27
xmlIO.c
27
xmlIO.c
@ -560,6 +560,33 @@ xmlCleanupOutputCallbacks(void)
|
||||
xmlOutputCallbackNr = 0;
|
||||
xmlOutputCallbackInitialized = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlPopOutputCallbacks:
|
||||
*
|
||||
* Remove the top output callbacks from the output stack. This includes the
|
||||
* compiled-in I/O.
|
||||
*
|
||||
* Returns the number of output callback registered or -1 in case of error.
|
||||
*/
|
||||
int
|
||||
xmlPopOutputCallbacks(void)
|
||||
{
|
||||
if (!xmlOutputCallbackInitialized)
|
||||
return(-1);
|
||||
|
||||
if (xmlOutputCallbackNr <= 0)
|
||||
return(-1);
|
||||
|
||||
xmlOutputCallbackNr--;
|
||||
xmlOutputCallbackTable[xmlOutputCallbackNr].matchcallback = NULL;
|
||||
xmlOutputCallbackTable[xmlOutputCallbackNr].opencallback = NULL;
|
||||
xmlOutputCallbackTable[xmlOutputCallbackNr].writecallback = NULL;
|
||||
xmlOutputCallbackTable[xmlOutputCallbackNr].closecallback = NULL;
|
||||
|
||||
return(xmlOutputCallbackNr);
|
||||
}
|
||||
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
|
||||
/************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user