mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-02-04 01:47:02 +03:00
function consolidation when writing to xmlBuffer. Return error condition
* xmlIO.c xmlwriter.c: function consolidation when writing to xmlBuffer. Return error condition not len if xmlwriter fails writing to buffer.
This commit is contained in:
parent
9a00fd2991
commit
a44f234d3a
@ -1,3 +1,8 @@
|
||||
Wed Nov 9 13:07:24 EST 2005 Rob Richards <rrichards@ctindustries.net>
|
||||
|
||||
* xmlIO.c xmlwriter.c: function consolidation when writing to xmlBuffer.
|
||||
Return error condition not len if xmlwriter fails writing to buffer.
|
||||
|
||||
Wed Nov 9 09:54:54 CET 2005 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* xmlsave.c xmlIO.c include/libxml/xmlIO.h include/libxml/xmlsave.h:
|
||||
|
11
xmlIO.c
11
xmlIO.c
@ -2490,12 +2490,11 @@ xmlOutputBufferCreateBuffer(xmlBufferPtr buffer,
|
||||
|
||||
if (buffer == NULL) return(NULL);
|
||||
|
||||
ret = xmlAllocOutputBuffer(encoder);
|
||||
if (ret != NULL) {
|
||||
ret->context = buffer;
|
||||
ret->writecallback = xmlBufferWrite;
|
||||
ret->closecallback = xmlBufferClose;
|
||||
}
|
||||
ret = xmlOutputBufferCreateIO((xmlOutputWriteCallback)
|
||||
xmlBufferWrite,
|
||||
(xmlOutputCloseCallback)
|
||||
xmlBufferClose,
|
||||
(void *) buffer, encoder);
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
10
xmlwriter.c
10
xmlwriter.c
@ -99,9 +99,6 @@ static int xmlCmpTextWriterStackEntry(const void *data0,
|
||||
static void xmlFreeTextWriterNsStackEntry(xmlLinkPtr lk);
|
||||
static int xmlCmpTextWriterNsStackEntry(const void *data0,
|
||||
const void *data1);
|
||||
static int xmlTextWriterWriteMemCallback(void *context,
|
||||
const xmlChar * str, int len);
|
||||
static int xmlTextWriterCloseMemCallback(void *context);
|
||||
static int xmlTextWriterWriteDocCallback(void *context,
|
||||
const xmlChar * str, int len);
|
||||
static int xmlTextWriterCloseDocCallback(void *context);
|
||||
@ -275,11 +272,8 @@ xmlNewTextWriterMemory(xmlBufferPtr buf, int compression ATTRIBUTE_UNUSED)
|
||||
xmlOutputBufferPtr out;
|
||||
|
||||
/*::todo handle compression */
|
||||
out = xmlOutputBufferCreateIO((xmlOutputWriteCallback)
|
||||
xmlTextWriterWriteMemCallback,
|
||||
(xmlOutputCloseCallback)
|
||||
xmlTextWriterCloseMemCallback,
|
||||
(void *) buf, NULL);
|
||||
out = xmlOutputBufferCreateBuffer(buf, NULL);
|
||||
|
||||
if (out == NULL) {
|
||||
xmlWriterErrMsg(NULL, XML_ERR_NO_MEMORY,
|
||||
"xmlNewTextWriterMemory : out of memory!\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user