20#ifndef CPL_MINIZIP_IOAPI_H_INCLUDED
21#define CPL_MINIZIP_IOAPI_H_INCLUDED
28#define uLong64 vsi_l_offset
30#define ZLIB_FILEFUNC_SEEK_CUR (1)
31#define ZLIB_FILEFUNC_SEEK_END (2)
32#define ZLIB_FILEFUNC_SEEK_SET (0)
34#define ZLIB_FILEFUNC_MODE_READ (1)
35#define ZLIB_FILEFUNC_MODE_WRITE (2)
36#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
38#define ZLIB_FILEFUNC_MODE_EXISTING (4)
39#define ZLIB_FILEFUNC_MODE_CREATE (8)
43#if (defined(_WIN32) || defined(WINDOWS) || defined(_WINDOWS)) && \
44 defined(CALLBACK) && defined(USEWINDOWS_CALLBACK)
45#define ZCALLBACK CALLBACK
56 typedef voidpf(ZCALLBACK *open_file_func)(voidpf opaque,
57 const char *filename,
int mode);
58 typedef uLong(ZCALLBACK *read_file_func)(voidpf opaque, voidpf stream,
59 void *buf, uLong size);
60 typedef uLong(ZCALLBACK *write_file_func)(voidpf opaque, voidpf stream,
61 const void *buf, uLong size);
62 typedef uLong64(ZCALLBACK *tell_file_func)(voidpf opaque, voidpf stream);
63 typedef long(ZCALLBACK *seek_file_func)(voidpf opaque, voidpf stream,
64 uLong64 offset,
int origin);
65 typedef int(ZCALLBACK *close_file_func)(voidpf opaque, voidpf stream);
66 typedef int(ZCALLBACK *testerror_file_func)(voidpf opaque, voidpf stream);
68 typedef struct zlib_filefunc_def_s
70 open_file_func zopen_file;
71 read_file_func zread_file;
72 write_file_func zwrite_file;
73 tell_file_func ztell_file;
74 seek_file_func zseek_file;
75 close_file_func zclose_file;
76 testerror_file_func zerror_file;
80 void cpl_fill_fopen_filefunc(zlib_filefunc_def *pzlib_filefunc_def);
82#define ZREAD(filefunc, filestream, buf, size) \
83 ((*((filefunc).zread_file))((filefunc).opaque, filestream, buf, size))
84#define ZWRITE(filefunc, filestream, buf, size) \
85 ((*((filefunc).zwrite_file))((filefunc).opaque, filestream, buf, size))
86#define ZTELL(filefunc, filestream) \
87 ((*((filefunc).ztell_file))((filefunc).opaque, filestream))
88#define ZSEEK(filefunc, filestream, pos, mode) \
89 ((*((filefunc).zseek_file))((filefunc).opaque, filestream, pos, mode))
90#define ZCLOSE(filefunc, filestream) \
91 ((*((filefunc).zclose_file))((filefunc).opaque, filestream))
92#define ZERROR(filefunc, filestream) \
93 ((*((filefunc).zerror_file))((filefunc).opaque, filestream))
96#define ZWRITE64 ZWRITE
99#define ZCLOSE64 ZCLOSE
100#define ZERROR64 ZERROR