summaryrefslogtreecommitdiff
path: root/xmllint.c
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2017-11-09 17:47:47 +0100
committerNick Wellnhofer <wellnhofer@aevum.de>2017-11-09 17:47:47 +0100
commit86615e43bbac2315aa069ca3ef4712477d61605c (patch)
treef6fd6a6a734f140516026ae8d6e42142986bc54e /xmllint.c
parente5f33e56bafc332fd63f6643b687ebfe14bcba56 (diff)
downloadlibxml2-86615e43bbac2315aa069ca3ef4712477d61605c.tar.gz
Fix IO callback signatures
Diffstat (limited to 'xmllint.c')
-rw-r--r--xmllint.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/xmllint.c b/xmllint.c
index a691aa68..75d2f9b4 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -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;
}