diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2017-11-09 17:47:47 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2017-11-09 17:47:47 +0100 |
commit | 86615e43bbac2315aa069ca3ef4712477d61605c (patch) | |
tree | f6fd6a6a734f140516026ae8d6e42142986bc54e /xmllint.c | |
parent | e5f33e56bafc332fd63f6643b687ebfe14bcba56 (diff) | |
download | libxml2-86615e43bbac2315aa069ca3ef4712477d61605c.tar.gz |
Fix IO callback signatures
Diffstat (limited to 'xmllint.c')
-rw-r--r-- | xmllint.c | 24 |
1 files changed, 11 insertions, 13 deletions
@@ -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; } |