Commit 86615e43 authored by Nick Wellnhofer's avatar Nick Wellnhofer

Fix IO callback signatures

parent e5f33e56
......@@ -2843,10 +2843,8 @@ xmlOutputBufferCreateBuffer(xmlBufferPtr buffer,
if (buffer == NULL) return(NULL);
ret = xmlOutputBufferCreateIO((xmlOutputWriteCallback)
xmlBufferWrite,
(xmlOutputCloseCallback)
NULL, (void *) buffer, encoder);
ret = xmlOutputBufferCreateIO(xmlBufferWrite, NULL, (void *) buffer,
encoder);
return(ret);
}
......
......@@ -814,13 +814,14 @@ xmlShellReadline(char *prompt) {
* *
************************************************************************/
static int myRead(FILE *f, char * buf, int len) {
return(fread(buf, 1, len, f));
static int myRead(void *f, char *buf, int len) {
return(fread(buf, 1, len, (FILE *) f));
}
static void myClose(FILE *f) {
if (f != stdin) {
fclose(f);
}
static int myClose(void *context) {
FILE *f = (FILE *) context;
if (f == stdin)
return(0);
return(fclose(f));
}
/************************************************************************
......@@ -2303,14 +2304,11 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
#endif
if (f != NULL) {
if (rectxt == NULL)
doc = xmlReadIO((xmlInputReadCallback) myRead,
(xmlInputCloseCallback) myClose, f,
filename, NULL, options);
doc = xmlReadIO(myRead, myClose, f, filename, NULL,
options);
else
doc = xmlCtxtReadIO(rectxt,
(xmlInputReadCallback) myRead,
(xmlInputCloseCallback) myClose, f,
filename, NULL, options);
doc = xmlCtxtReadIO(rectxt, myRead, myClose, f,
filename, NULL, options);
} else
doc = NULL;
}
......
......@@ -110,7 +110,7 @@ static void xmlFreeTextWriterNsStackEntry(xmlLinkPtr lk);
static int xmlCmpTextWriterNsStackEntry(const void *data0,
const void *data1);
static int xmlTextWriterWriteDocCallback(void *context,
const xmlChar * str, int len);
const char *str, int len);
static int xmlTextWriterCloseDocCallback(void *context);
static xmlChar *xmlTextWriterVSprintf(const char *format, va_list argptr) LIBXML_ATTR_FORMAT(1,0);
......@@ -325,9 +325,7 @@ xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt,
return NULL;
}
out = xmlOutputBufferCreateIO((xmlOutputWriteCallback)
xmlTextWriterWriteDocCallback,
(xmlOutputCloseCallback)
out = xmlOutputBufferCreateIO(xmlTextWriterWriteDocCallback,
xmlTextWriterCloseDocCallback,
(void *) ctxt, NULL);
if (out == NULL) {
......@@ -4418,12 +4416,12 @@ xmlCmpTextWriterNsStackEntry(const void *data0, const void *data1)
* Returns -1, 0, 1
*/
static int
xmlTextWriterWriteDocCallback(void *context, const xmlChar * str, int len)
xmlTextWriterWriteDocCallback(void *context, const char *str, int len)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) context;
int rc;
if ((rc = xmlParseChunk(ctxt, (const char *) str, len, 0)) != 0) {
if ((rc = xmlParseChunk(ctxt, str, len, 0)) != 0) {
xmlWriterErrMsgInt(NULL, XML_ERR_INTERNAL_ERROR,
"xmlTextWriterWriteDocCallback : XML error %d !\n",
rc);
......@@ -4449,7 +4447,7 @@ xmlTextWriterCloseDocCallback(void *context)
if ((rc = xmlParseChunk(ctxt, NULL, 0, 1)) != 0) {
xmlWriterErrMsgInt(NULL, XML_ERR_INTERNAL_ERROR,
"xmlTextWriterWriteDocCallback : XML error %d !\n",
"xmlTextWriterCloseDocCallback : XML error %d !\n",
rc);
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment