1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
--- ioapi.c.orig 2014-05-24 09:54:26.298884453 +0200
+++ ioapi.c 2014-05-24 09:50:22.708762308 +0200
@@ -89,6 +89,8 @@
static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size));
static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream));
static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
+static int ZCALLBACK fflush_file_func OF((voidpf opaque, voidpf stream));
+
static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream));
static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
@@ -206,6 +208,12 @@
return ret;
}
+static int ZCALLBACK fflush_file_func (voidpf opaque, voidpf stream)
+{
+ int ret;
+ ret = fflush((FILE *)stream);
+ return ret;
+}
static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
{
@@ -229,6 +237,7 @@
pzlib_filefunc_def->zwrite_file = fwrite_file_func;
pzlib_filefunc_def->ztell_file = ftell_file_func;
pzlib_filefunc_def->zseek_file = fseek_file_func;
+ pzlib_filefunc_def->zflush_file = fflush_file_func;
pzlib_filefunc_def->zclose_file = fclose_file_func;
pzlib_filefunc_def->zerror_file = ferror_file_func;
pzlib_filefunc_def->opaque = NULL;
|