28#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
33 #ifndef __USE_FILE_OFFSET64
34 #define __USE_FILE_OFFSET64
36 #ifndef __USE_LARGEFILE64
37 #define __USE_LARGEFILE64
39 #ifndef _LARGEFILE64_SOURCE
40 #define _LARGEFILE64_SOURCE
42 #ifndef _FILE_OFFSET_BIT
43 #define _FILE_OFFSET_BIT 64
52#if defined(USE_FILE32API)
57#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__) || defined(MINIZIP_FOPEN_NO_64)
59#define ftello64 ftello
60#define fseeko64 fseeko
64 #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC)))
65 #define ftello64 _ftelli64
66 #define fseeko64 _fseeki64
68 #define ftello64 ftell
69 #define fseeko64 fseek
85#ifdef HAVE_MINIZIP64_CONF_H
90#ifdef HAVE_64BIT_INT_CUSTOM
91typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T;
95typedef uint64_t ZPOS64_T;
100#if defined(_MSC_VER) || defined(__BORLANDC__)
101typedef unsigned __int64 ZPOS64_T;
103typedef unsigned long long int ZPOS64_T;
110#define MAXU32 (0xffffffff)
118#define ZLIB_FILEFUNC_SEEK_CUR (1)
119#define ZLIB_FILEFUNC_SEEK_END (2)
120#define ZLIB_FILEFUNC_SEEK_SET (0)
122#define ZLIB_FILEFUNC_MODE_READ (1)
123#define ZLIB_FILEFUNC_MODE_WRITE (2)
124#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
126#define ZLIB_FILEFUNC_MODE_EXISTING (4)
127#define ZLIB_FILEFUNC_MODE_CREATE (8)
131 #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
132 #define ZCALLBACK CALLBACK
141typedef voidpf (ZCALLBACK *open_file_func) (voidpf opaque,
const char* filename,
int mode);
142typedef uLong (ZCALLBACK *read_file_func) (voidpf opaque, voidpf stream,
void* buf, uLong size);
143typedef uLong (ZCALLBACK *write_file_func) (voidpf opaque, voidpf stream,
const void* buf, uLong size);
144typedef int (ZCALLBACK *close_file_func) (voidpf opaque, voidpf stream);
145typedef int (ZCALLBACK *testerror_file_func) (voidpf opaque, voidpf stream);
147typedef long (ZCALLBACK *tell_file_func) (voidpf opaque, voidpf stream);
148typedef long (ZCALLBACK *seek_file_func) (voidpf opaque, voidpf stream, uLong offset,
int origin);
154 open_file_func zopen_file;
155 read_file_func zread_file;
156 write_file_func zwrite_file;
157 tell_file_func ztell_file;
158 seek_file_func zseek_file;
159 close_file_func zclose_file;
160 testerror_file_func zerror_file;
164typedef ZPOS64_T (ZCALLBACK *tell64_file_func) (voidpf opaque, voidpf stream);
165typedef long (ZCALLBACK *seek64_file_func) (voidpf opaque, voidpf stream, ZPOS64_T offset,
int origin);
166typedef voidpf (ZCALLBACK *open64_file_func) (voidpf opaque,
const void* filename,
int mode);
170 open64_file_func zopen64_file;
171 read_file_func zread_file;
172 write_file_func zwrite_file;
173 tell64_file_func ztell64_file;
174 seek64_file_func zseek64_file;
175 close_file_func zclose_file;
176 testerror_file_func zerror_file;
178} zlib_filefunc64_def;
180void fill_fopen64_filefunc(zlib_filefunc64_def* pzlib_filefunc_def);
181void fill_fopen_filefunc(zlib_filefunc_def* pzlib_filefunc_def);
186 zlib_filefunc64_def zfile_func64;
187 open_file_func zopen32_file;
188 tell_file_func ztell32_file;
189 seek_file_func zseek32_file;
190} zlib_filefunc64_32_def;
193#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
194#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
197#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream))
198#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream))
200voidpf call_zopen64(
const zlib_filefunc64_32_def* pfilefunc,
const void*filename,
int mode);
201long call_zseek64(
const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset,
int origin);
202ZPOS64_T call_ztell64(
const zlib_filefunc64_32_def* pfilefunc,voidpf filestream);
204void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,
const zlib_filefunc_def* p_filefunc32);
206#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode)))
207#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream)))
208#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode)))