| 1 | |
| 2 | /* Modified version by Even Rouault. : |
| 3 | - change fill_fopen_filefunc to cpl_fill_fopen_filefunc |
| 4 | - Add support for ZIP64 |
| 5 | |
| 6 | * Copyright (c) 2008-2012, Even Rouault <even dot rouault at spatialys.com> |
| 7 | |
| 8 | Original licence available in port/LICENCE_minizip |
| 9 | */ |
| 10 | |
| 11 | /* ioapi.h -- IO base function header for compress/uncompress .zip |
| 12 | files using zlib + zip or unzip API |
| 13 | |
| 14 | Version 1.01e, February 12th, 2005 |
| 15 | |
| 16 | Copyright (C) 1998-2005 Gilles Vollant |
| 17 | */ |
| 18 | |
| 19 | #ifndef CPL_MINIZIP_IOAPI_H_INCLUDED |
| 20 | #define CPL_MINIZIP_IOAPI_H_INCLUDEDcxx . . $ `port/cpl_minizip_ioapi.h:20:9`! |
| 21 | |
| 22 | #ifndef DOXYGEN_SKIP |
| 23 | |
| 24 | #include "cpl_vsi.h"cxx . . $ `<file>/port/cpl_vsi.h`/ |
| 25 | #include "zlib.h" |
| 26 | |
| 27 | #define uLong64cxx . . $ `port/cpl_minizip_ioapi.h:27:9`! vsi_l_offset |
| 28 | |
| 29 | #define ZLIB_FILEFUNC_SEEK_CURcxx . . $ `port/cpl_minizip_ioapi.h:29:9`! (1) |
| 30 | #define ZLIB_FILEFUNC_SEEK_ENDcxx . . $ `port/cpl_minizip_ioapi.h:30:9`! (2) |
| 31 | #define ZLIB_FILEFUNC_SEEK_SETcxx . . $ `port/cpl_minizip_ioapi.h:31:9`! (0) |
| 32 | |
| 33 | #define ZLIB_FILEFUNC_MODE_READcxx . . $ `port/cpl_minizip_ioapi.h:33:9`! (1) |
| 34 | #define ZLIB_FILEFUNC_MODE_WRITEcxx . . $ `port/cpl_minizip_ioapi.h:34:9`! (2) |
| 35 | #define ZLIB_FILEFUNC_MODE_READWRITEFILTERcxx . . $ `port/cpl_minizip_ioapi.h:35:9`! (3) |
| 36 | |
| 37 | #define ZLIB_FILEFUNC_MODE_EXISTINGcxx . . $ `port/cpl_minizip_ioapi.h:37:9`! (4) |
| 38 | #define ZLIB_FILEFUNC_MODE_CREATEcxx . . $ `port/cpl_minizip_ioapi.h:38:9`! (8) |
| 39 | |
| 40 | #ifndef ZCALLBACK |
| 41 | |
| 42 | #if (defined(_WIN32) || defined(WINDOWS) || defined(_WINDOWS)) && \ |
| 43 | defined(CALLBACK) && defined(USEWINDOWS_CALLBACK) |
| 44 | #define ZCALLBACK CALLBACK |
| 45 | #else |
| 46 | #define ZCALLBACKcxx . . $ `port/cpl_minizip_ioapi.h:46:9`! |
| 47 | #endif |
| 48 | #endif |
| 49 | |
| 50 | #ifdef __cpluspluscxx . . $ `<built-in>:470:9`! |
| 51 | extern "C" |
| 52 | { |
| 53 | #endif |
| 54 | |
| 55 | typedef voidpfcxx . . $ voidpf#(ZCALLBACKcxx . . $ `port/cpl_minizip_ioapi.h:46:9`! *open_file_func)(voidpfcxx . . $ voidpf# opaque, |
| 56 | const char *filename, int mode); |
| 57 | typedef uLongcxx . . $ uLong#(ZCALLBACKcxx . . $ `port/cpl_minizip_ioapi.h:46:9`! *read_file_func)(voidpfcxx . . $ voidpf# opaque, voidpfcxx . . $ voidpf# stream, |
| 58 | void *buf, uLongcxx . . $ uLong# size); |
| 59 | typedef uLongcxx . . $ uLong#(ZCALLBACKcxx . . $ `port/cpl_minizip_ioapi.h:46:9`! *write_file_func)(voidpfcxx . . $ voidpf# opaque, voidpfcxx . . $ voidpf# stream, |
| 60 | const void *buf, uLongcxx . . $ uLong# size); |
| 61 | typedef uLong64cxx . . $ `port/cpl_minizip_ioapi.h:27:9`!(ZCALLBACKcxx . . $ `port/cpl_minizip_ioapi.h:46:9`! *tell_file_func)(voidpfcxx . . $ voidpf# opaque, voidpfcxx . . $ voidpf# stream); |
| 62 | typedef long(ZCALLBACKcxx . . $ `port/cpl_minizip_ioapi.h:46:9`! *seek_file_func)(voidpfcxx . . $ voidpf# opaque, voidpfcxx . . $ voidpf# stream, |
| 63 | uLong64cxx . . $ `port/cpl_minizip_ioapi.h:27:9`! offset, int origin); |
| 64 | typedef int(ZCALLBACKcxx . . $ `port/cpl_minizip_ioapi.h:46:9`! *close_file_func)(voidpfcxx . . $ voidpf# opaque, voidpfcxx . . $ voidpf# stream); |
| 65 | typedef int(ZCALLBACKcxx . . $ `port/cpl_minizip_ioapi.h:46:9`! *testerror_file_func)(voidpfcxx . . $ voidpf# opaque, voidpfcxx . . $ voidpf# stream); |
| 66 | |
| 67 | typedef struct zlib_filefunc_def_s |
| 68 | { |
| 69 | open_file_func zopen_file; |
| 70 | read_file_func zread_file; |
| 71 | write_file_func zwrite_file; |
| 72 | tell_file_func ztell_file; |
| 73 | seek_file_func zseek_file; |
| 74 | close_file_func zclose_file; |
| 75 | testerror_file_func zerror_file; |
| 76 | voidpfcxx . . $ voidpf# opaque; |
| 77 | } zlib_filefunc_def; |
| 78 | |
| 79 | void cpl_fill_fopen_filefunc(zlib_filefunc_def *pzlib_filefunc_def); |
| 80 | |
| 81 | #define ZREADcxx . . $ `port/cpl_minizip_ioapi.h:81:9`!(filefunc, filestream, buf, size) \ |
| 82 | ((*((filefunc).zread_file))((filefunc).opaque, filestream, buf, size)) |
| 83 | #define ZWRITEcxx . . $ `port/cpl_minizip_ioapi.h:83:9`!(filefunc, filestream, buf, size) \ |
| 84 | ((*((filefunc).zwrite_file))((filefunc).opaque, filestream, buf, size)) |
| 85 | #define ZTELLcxx . . $ `port/cpl_minizip_ioapi.h:85:9`!(filefunc, filestream) \ |
| 86 | ((*((filefunc).ztell_file))((filefunc).opaque, filestream)) |
| 87 | #define ZSEEKcxx . . $ `port/cpl_minizip_ioapi.h:87:9`!(filefunc, filestream, pos, mode) \ |
| 88 | ((*((filefunc).zseek_file))((filefunc).opaque, filestream, pos, mode)) |
| 89 | #define ZCLOSEcxx . . $ `port/cpl_minizip_ioapi.h:89:9`!(filefunc, filestream) \ |
| 90 | ((*((filefunc).zclose_file))((filefunc).opaque, filestream)) |
| 91 | #define ZERRORcxx . . $ `port/cpl_minizip_ioapi.h:91:9`!(filefunc, filestream) \ |
| 92 | ((*((filefunc).zerror_file))((filefunc).opaque, filestream)) |
| 93 | |
| 94 | #define ZREAD64cxx . . $ `port/cpl_minizip_ioapi.h:94:9`! ZREAD |
| 95 | #define ZWRITE64cxx . . $ `port/cpl_minizip_ioapi.h:95:9`! ZWRITE |
| 96 | #define ZTELL64cxx . . $ `port/cpl_minizip_ioapi.h:96:9`! ZTELL |
| 97 | #define ZSEEK64cxx . . $ `port/cpl_minizip_ioapi.h:97:9`! ZSEEK |
| 98 | #define ZCLOSE64cxx . . $ `port/cpl_minizip_ioapi.h:98:9`! ZCLOSE |
| 99 | #define ZERROR64cxx . . $ `port/cpl_minizip_ioapi.h:99:9`! ZERROR |
| 100 | |
| 101 | #ifdef __cpluspluscxx . . $ `<built-in>:470:9`! |
| 102 | } |
| 103 | #endif |
| 104 | |
| 105 | #endif /* #ifndef DOXYGEN_SKIP */ |
| 106 | |
| 107 | #endif /* CPL_MINIZIP_IOAPI_H_INCLUDED */ |