13 #if defined(_WIN32) && (!(defined(_CRT_SECURE_NO_WARNINGS)))
14 #define _CRT_SECURE_NO_WARNINGS
17 #if defined(__APPLE__) || defined(IOAPI_NO_64)
19 #define FOPEN_FUNC(filename, mode) fopen(filename, mode)
20 #define FTELLO_FUNC(stream) ftello(stream)
21 #define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin)
23 #define FOPEN_FUNC(filename, mode) fopen64(filename, mode)
24 #define FTELLO_FUNC(stream) ftello64(stream)
25 #define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin)
48 if (offsetTruncated != offset)
62 if ((tell_uLong) ==
MAXU32)
98 const char* mode_fopen = NULL;
108 if ((filename!=NULL) && (mode_fopen != NULL))
109 file = fopen(filename, mode_fopen);
116 const char* mode_fopen = NULL;
126 if ((filename!=NULL) && (mode_fopen != NULL))
127 file =
FOPEN_FUNC((
const char*)filename, mode_fopen);
135 ret = (
uLong)fread(buf, 1, (
size_t)
size, (FILE *)stream);
142 ret = (
uLong)fwrite(buf, 1, (
size_t)
size, (FILE *)stream);
149 ret = ftell((FILE *)stream);
179 if (fseek((FILE *)stream, offset, fseek_origin) != 0)
203 if(
FSEEKO_FUNC((FILE *)stream, offset, fseek_origin) != 0)
213 ret = fclose((FILE *)stream);
220 ret = ferror((FILE *)stream);
234 pzlib_filefunc_def->opaque = NULL;
246 pzlib_filefunc_def->
opaque = NULL;
open_file_func zopen32_file
static long ZCALLBACK ftell_file_func(voidpf opaque, voidpf stream)
testerror_file_func zerror_file
static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char *filename, int mode))
testerror_file_func zerror_file
ZPOS64_T call_ztell64(const zlib_filefunc64_32_def *pfilefunc, voidpf filestream)
static int ZCALLBACK fclose_file_func(voidpf opaque, voidpf stream)
write_file_func zwrite_file
#define ZLIB_FILEFUNC_MODE_READWRITEFILTER
static long ZCALLBACK fseek64_file_func(voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)
#define ZLIB_FILEFUNC_MODE_READ
static ZPOS64_T ZCALLBACK ftell64_file_func(voidpf opaque, voidpf stream)
write_file_func zwrite_file
seek_file_func zseek32_file
#define ZLIB_FILEFUNC_SEEK_CUR
close_file_func zclose_file
read_file_func zread_file
seek_file_func zseek_file
zlib_filefunc64_def zfile_func64
#define ZLIB_FILEFUNC_MODE_CREATE
unsigned long long int ZPOS64_T
#define FTELLO_FUNC(stream)
tell_file_func ztell_file
void fill_fopen64_filefunc(zlib_filefunc64_def *pzlib_filefunc_def)
#define ZLIB_FILEFUNC_MODE_EXISTING
close_file_func zclose_file
tell_file_func ztell32_file
static int ZCALLBACK ferror_file_func(voidpf opaque, voidpf stream)
open_file_func zopen_file
read_file_func zread_file
static voidpf ZCALLBACK fopen_file_func(voidpf opaque, const char *filename, int mode)
#define FOPEN_FUNC(filename, mode)
static long ZCALLBACK fseek_file_func(voidpf opaque, voidpf stream, uLong offset, int origin)
open64_file_func zopen64_file
#define ZLIB_FILEFUNC_SEEK_END
#define FSEEKO_FUNC(stream, offset, origin)
seek64_file_func zseek64_file
static voidpf ZCALLBACK fopen64_file_func(voidpf opaque, const void *filename, int mode)
void fill_fopen_filefunc(zlib_filefunc_def *pzlib_filefunc_def)
#define ZLIB_FILEFUNC_SEEK_SET
voidpf call_zopen64(const zlib_filefunc64_32_def *pfilefunc, const void *filename, int mode)
long call_zseek64(const zlib_filefunc64_32_def *pfilefunc, voidpf filestream, ZPOS64_T offset, int origin)
static uLong ZCALLBACK fwrite_file_func(voidpf opaque, voidpf stream, const void *buf, uLong size)
void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def *p_filefunc64_32, const zlib_filefunc_def *p_filefunc32)
static uLong ZCALLBACK fread_file_func(voidpf opaque, voidpf stream, void *buf, uLong size)
tell64_file_func ztell64_file