|
GDAL
|
00001 /* $Id: cpl_minizip_ioapi.h 36484 2016-11-24 06:35:54Z goatbar $ */ 00002 00003 /* Modified version by Even Rouault. : 00004 - change fill_fopen_filefunc to cpl_fill_fopen_filefunc 00005 - Add support for ZIP64 00006 00007 * Copyright (c) 2008-2012, Even Rouault <even dot rouault at mines-paris dot org> 00008 00009 Original licence available in port/LICENCE_minizip 00010 */ 00011 00012 /* ioapi.h -- IO base function header for compress/uncompress .zip 00013 files using zlib + zip or unzip API 00014 00015 Version 1.01e, February 12th, 2005 00016 00017 Copyright (C) 1998-2005 Gilles Vollant 00018 */ 00019 00020 #ifndef CPL_MINIZIP_IOAPI_H_INCLUDED 00021 #define CPL_MINIZIP_IOAPI_H_INCLUDED 00022 00023 #ifndef DOXYGEN_SKIP 00024 00025 #include "cpl_vsi.h" 00026 #include "zlib.h" 00027 00028 #define uLong64 vsi_l_offset 00029 00030 #define ZLIB_FILEFUNC_SEEK_CUR (1) 00031 #define ZLIB_FILEFUNC_SEEK_END (2) 00032 #define ZLIB_FILEFUNC_SEEK_SET (0) 00033 00034 #define ZLIB_FILEFUNC_MODE_READ (1) 00035 #define ZLIB_FILEFUNC_MODE_WRITE (2) 00036 #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) 00037 00038 #define ZLIB_FILEFUNC_MODE_EXISTING (4) 00039 #define ZLIB_FILEFUNC_MODE_CREATE (8) 00040 00041 #ifndef ZCALLBACK 00042 00043 #if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) 00044 #define ZCALLBACK CALLBACK 00045 #else 00046 #define ZCALLBACK 00047 #endif 00048 #endif 00049 00050 #ifdef __cplusplus 00051 extern "C" { 00052 #endif 00053 00054 typedef voidpf (ZCALLBACK *open_file_func) (voidpf opaque, const char* filename, int mode); 00055 typedef uLong (ZCALLBACK *read_file_func) (voidpf opaque, voidpf stream, void* buf, uLong size); 00056 typedef uLong (ZCALLBACK *write_file_func) (voidpf opaque, voidpf stream, const void* buf, uLong size); 00057 typedef uLong64 (ZCALLBACK *tell_file_func) (voidpf opaque, voidpf stream); 00058 typedef long (ZCALLBACK *seek_file_func) (voidpf opaque, voidpf stream, uLong64 offset, int origin); 00059 typedef int (ZCALLBACK *close_file_func) (voidpf opaque, voidpf stream); 00060 typedef int (ZCALLBACK *testerror_file_func) (voidpf opaque, voidpf stream); 00061 00062 typedef struct zlib_filefunc_def_s 00063 { 00064 open_file_func zopen_file; 00065 read_file_func zread_file; 00066 write_file_func zwrite_file; 00067 tell_file_func ztell_file; 00068 seek_file_func zseek_file; 00069 close_file_func zclose_file; 00070 testerror_file_func zerror_file; 00071 voidpf opaque; 00072 } zlib_filefunc_def; 00073 00074 void cpl_fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def); 00075 00076 #define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) 00077 #define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) 00078 #define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) 00079 #define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) 00080 #define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) 00081 #define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) 00082 00083 #ifdef __cplusplus 00084 } 00085 #endif 00086 00087 #endif /* #ifndef DOXYGEN_SKIP */ 00088 00089 #endif /* CPL_MINIZIP_IOAPI_H_INCLUDED */
1.7.6.1.