27 #ifndef __MINIZIP_IOAPI_H__ 28 #define __MINIZIP_IOAPI_H__ 30 #if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) 35 #ifndef __USE_FILE_OFFSET64 36 #define __USE_FILE_OFFSET64 38 #ifndef __USE_LARGEFILE64 39 #define __USE_LARGEFILE64 41 #ifndef _LARGEFILE64_SOURCE 42 #define _LARGEFILE64_SOURCE 44 #ifndef _FILE_OFFSET_BIT 45 #define _FILE_OFFSET_BIT 64 53 #include "minizip/export.h" 55 #if defined(USE_FILE32API) 57 #define ftello64 ftell 58 #define fseeko64 fseek 62 #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) 63 #define ftello64 _ftelli64 64 #define fseeko64 _fseeki64 66 #define ftello64 ftell 67 #define fseeko64 fseek 83 #ifdef HAVE_MINIZIP64_CONF_H 84 #include "minizip/mz64conf.h" 88 #ifdef HAVE_64BIT_INT_CUSTOM 89 typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T;
92 #include "minizip/stdint.h" 93 typedef uint64_t ZPOS64_T;
97 #if defined(_MSC_VER) || defined(__BORLANDC__) 98 typedef unsigned __int64 ZPOS64_T;
100 typedef unsigned long long int ZPOS64_T;
112 #define ZLIB_FILEFUNC_SEEK_CUR (1) 113 #define ZLIB_FILEFUNC_SEEK_END (2) 114 #define ZLIB_FILEFUNC_SEEK_SET (0) 116 #define ZLIB_FILEFUNC_MODE_READ (1) 117 #define ZLIB_FILEFUNC_MODE_WRITE (2) 118 #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) 120 #define ZLIB_FILEFUNC_MODE_EXISTING (4) 121 #define ZLIB_FILEFUNC_MODE_CREATE (8) 125 #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && \ 126 defined (USEWINDOWS_CALLBACK) 127 #define ZCALLBACK CALLBACK 136 typedef voidpf (ZCALLBACK *open_file_func) OF ((voidpf opaque,
const char* filename,
int mode));
137 typedef uLong (ZCALLBACK *read_file_func) OF ((voidpf opaque, voidpf stream,
void* buf, uLong size));
138 typedef uLong (ZCALLBACK *write_file_func) OF ((voidpf opaque, voidpf stream,
const void* buf, uLong size));
139 typedef int (ZCALLBACK *close_file_func) OF ((voidpf opaque, voidpf stream));
140 typedef int (ZCALLBACK *testerror_file_func) OF ((voidpf opaque, voidpf stream));
142 typedef long (ZCALLBACK *tell_file_func) OF ((voidpf opaque, voidpf stream));
143 typedef long (ZCALLBACK *seek_file_func) OF ((voidpf opaque, voidpf stream, uLong offset,
int origin));
149 open_file_func zopen_file;
150 read_file_func zread_file;
151 write_file_func zwrite_file;
152 tell_file_func ztell_file;
153 seek_file_func zseek_file;
154 close_file_func zclose_file;
155 testerror_file_func zerror_file;
159 typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF ((voidpf opaque, voidpf stream));
160 typedef long (ZCALLBACK *seek64_file_func) OF ((voidpf opaque, voidpf stream, ZPOS64_T offset,
int origin));
161 typedef voidpf (ZCALLBACK *open64_file_func) OF ((voidpf opaque,
const void* filename,
int mode));
165 open64_file_func zopen64_file;
166 read_file_func zread_file;
167 write_file_func zwrite_file;
168 tell64_file_func ztell64_file;
169 seek64_file_func zseek64_file;
170 close_file_func zclose_file;
171 testerror_file_func zerror_file;
176 MINIZIP_API
void fill_fopen_filefunc OF((
zlib_filefunc_def* pzlib_filefunc_def));
182 open_file_func zopen32_file;
183 tell_file_func ztell32_file;
184 seek_file_func zseek32_file;
188 #define ZREAD64(filefunc,filestream,buf, \ 189 size) ((*((filefunc).zfile_func64.zread_file))((filefunc).zfile_func64.opaque,filestream,buf,size)) 190 #define ZWRITE64(filefunc,filestream,buf, \ 191 size) ((*((filefunc).zfile_func64.zwrite_file))((filefunc).zfile_func64.opaque,filestream,buf,size)) 194 #define ZCLOSE64(filefunc, \ 195 filestream) ((*((filefunc).zfile_func64.zclose_file))((filefunc).zfile_func64.opaque, \ 197 #define ZERROR64(filefunc, \ 198 filestream) ((*((filefunc).zfile_func64.zerror_file))((filefunc).zfile_func64.opaque, \ 201 MINIZIP_API voidpf call_zopen64 OF((
const zlib_filefunc64_32_def* pfilefunc,
const void*filename,
int mode));
202 MINIZIP_API
long call_zseek64 OF((
const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset,
209 #define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) 210 #define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) 211 #define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) 217 #endif //__MINIZIP_IOAPI_H__