00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CPL_MINIZIP_IOAPI_H_INCLUDED
00019 #define CPL_MINIZIP_IOAPI_H_INCLUDED
00020
00021 #include "cpl_vsi.h"
00022 #define uLong64 vsi_l_offset
00023
00024 #define ZLIB_FILEFUNC_SEEK_CUR (1)
00025 #define ZLIB_FILEFUNC_SEEK_END (2)
00026 #define ZLIB_FILEFUNC_SEEK_SET (0)
00027
00028 #define ZLIB_FILEFUNC_MODE_READ (1)
00029 #define ZLIB_FILEFUNC_MODE_WRITE (2)
00030 #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
00031
00032 #define ZLIB_FILEFUNC_MODE_EXISTING (4)
00033 #define ZLIB_FILEFUNC_MODE_CREATE (8)
00034
00035 #ifndef ZCALLBACK
00036
00037 #if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
00038 #define ZCALLBACK CALLBACK
00039 #else
00040 #define ZCALLBACK
00041 #endif
00042 #endif
00043
00044 #ifdef __cplusplus
00045 extern "C" {
00046 #endif
00047
00048 typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
00049 typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
00050 typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
00051 typedef uLong64 (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
00052 typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong64 offset, int origin));
00053 typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
00054 typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
00055
00056 typedef struct zlib_filefunc_def_s
00057 {
00058 open_file_func zopen_file;
00059 read_file_func zread_file;
00060 write_file_func zwrite_file;
00061 tell_file_func ztell_file;
00062 seek_file_func zseek_file;
00063 close_file_func zclose_file;
00064 testerror_file_func zerror_file;
00065 voidpf opaque;
00066 } zlib_filefunc_def;
00067
00068
00069
00070 void cpl_fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
00071
00072 #define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size))
00073 #define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size))
00074 #define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream))
00075 #define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode))
00076 #define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream))
00077 #define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream))
00078
00079
00080 #ifdef __cplusplus
00081 }
00082 #endif
00083
00084 #endif