in util/src/minizip/ioapi.c [48:101]
voidpf ZCALLBACK fopen_file_func OF(
(voidpf opaque,
const char *filename,
int mode));
uLong ZCALLBACK fread_file_func OF(
(voidpf opaque,
voidpf stream,
void *buf,
uLong size));
uLong ZCALLBACK fwrite_file_func OF(
(voidpf opaque,
voidpf stream,
const void *buf,
uLong size));
long ZCALLBACK ftell_file_func OF(
(voidpf opaque,
voidpf stream));
long ZCALLBACK fseek_file_func OF(
(voidpf opaque,
voidpf stream,
uLong offset,
int origin));
int ZCALLBACK fclose_file_func OF(
(voidpf opaque,
voidpf stream));
int ZCALLBACK ferror_file_func OF(
(voidpf opaque,
voidpf stream));
voidpf ZCALLBACK
fopen_file_func(
voidpf opaque,
const char *filename,
int mode)
{
FILE *file = NULL;
const char *mode_fopen = NULL;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER) == ZLIB_FILEFUNC_MODE_READ)
mode_fopen = "rb";
else if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
mode_fopen = "r+b";
else if (mode & ZLIB_FILEFUNC_MODE_CREATE)
mode_fopen = "wb";
if ((filename) && (mode_fopen != NULL))
file = fopen(filename, mode_fopen);
return file;
}