OLD | NEW |
1 /* ioapi.h -- IO base function header for compress/uncompress .zip | 1 /* ioapi.h -- IO base function header for compress/uncompress .zip |
2 part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html
) | 2 part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html
) |
3 | 3 |
4 Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.
com/zLibDll/minizip.html ) | 4 Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.
com/zLibDll/minizip.html ) |
5 | 5 |
6 Modifications for Zip64 support | 6 Modifications for Zip64 support |
7 Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) | 7 Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) |
8 | 8 |
9 For more info read MiniZip_info.txt | 9 For more info read MiniZip_info.txt |
10 | 10 |
11 Changes | 11 Changes |
12 | 12 |
13 Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (mi
ght need to find a better why for this) | 13 Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (mi
ght need to find a better why for this) |
14 Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would wor
k on linux. | 14 Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would wor
k on linux. |
15 More if/def section may be needed to support other platforms | 15 More if/def section may be needed to support other platforms |
16 Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would c
ompile on windows. | 16 Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would c
ompile on windows. |
17 (but you should use iowin32.c for windows instead) | 17 (but you should use iowin32.c for windows instead) |
18 | 18 |
19 */ | 19 */ |
20 | 20 |
21 #ifndef _ZLIBIOAPI64_H | 21 #ifndef _ZLIBIOAPI64_H |
22 #define _ZLIBIOAPI64_H | 22 #define _ZLIBIOAPI64_H |
23 | 23 |
24 #if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) | 24 #if (!defined(_WIN32)) && (!defined(WIN32)) |
25 | 25 |
26 // Linux needs this to support file operation on files larger then 4+GB | 26 // Linux needs this to support file operation on files larger then 4+GB |
27 // But might need better if/def to select just the platforms that needs them. | 27 // But might need better if/def to select just the platforms that needs them. |
28 | 28 |
29 #ifndef __USE_FILE_OFFSET64 | 29 #ifndef __USE_FILE_OFFSET64 |
30 #define __USE_FILE_OFFSET64 | 30 #define __USE_FILE_OFFSET64 |
31 #endif | 31 #endif |
32 #ifndef __USE_LARGEFILE64 | 32 #ifndef __USE_LARGEFILE64 |
33 #define __USE_LARGEFILE64 | 33 #define __USE_LARGEFILE64 |
34 #endif | 34 #endif |
35 #ifndef _LARGEFILE64_SOURCE | 35 #ifndef _LARGEFILE64_SOURCE |
36 #define _LARGEFILE64_SOURCE | 36 #define _LARGEFILE64_SOURCE |
37 #endif | 37 #endif |
38 #ifndef _FILE_OFFSET_BIT | 38 #ifndef _FILE_OFFSET_BIT |
39 #define _FILE_OFFSET_BIT 64 | 39 #define _FILE_OFFSET_BIT 64 |
40 #endif | 40 #endif |
41 | |
42 #endif | 41 #endif |
43 | 42 |
44 #include <stdio.h> | 43 #include <stdio.h> |
45 #include <stdlib.h> | 44 #include <stdlib.h> |
46 #include "third_party/zlib/zlib.h" | 45 #include "third_party/zlib/zlib.h" |
47 | 46 |
48 #if defined(USE_FILE32API) | 47 #if defined(USE_FILE32API) |
49 #define fopen64 fopen | 48 #define fopen64 fopen |
50 #define ftello64 ftell | 49 #define ftello64 ftell |
51 #define fseeko64 fseek | 50 #define fseeko64 fseek |
52 #else | 51 #else |
53 #ifdef __FreeBSD__ | |
54 #define fopen64 fopen | |
55 #define ftello64 ftello | |
56 #define fseeko64 fseeko | |
57 #endif | |
58 #ifdef _MSC_VER | 52 #ifdef _MSC_VER |
59 #define fopen64 fopen | 53 #define fopen64 fopen |
60 #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) | 54 #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) |
61 #define ftello64 _ftelli64 | 55 #define ftello64 _ftelli64 |
62 #define fseeko64 _fseeki64 | 56 #define fseeko64 _fseeki64 |
63 #else // old MSC | 57 #else // old MSC |
64 #define ftello64 ftell | 58 #define ftello64 ftell |
65 #define fseeko64 fseek | 59 #define fseeko64 fseek |
66 #endif | 60 #endif |
67 #endif | 61 #endif |
(...skipping 16 matching lines...) Expand all Loading... |
84 | 78 |
85 /* a type choosen by DEFINE */ | 79 /* a type choosen by DEFINE */ |
86 #ifdef HAVE_64BIT_INT_CUSTOM | 80 #ifdef HAVE_64BIT_INT_CUSTOM |
87 typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; | 81 typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; |
88 #else | 82 #else |
89 #ifdef HAS_STDINT_H | 83 #ifdef HAS_STDINT_H |
90 #include "stdint.h" | 84 #include "stdint.h" |
91 typedef uint64_t ZPOS64_T; | 85 typedef uint64_t ZPOS64_T; |
92 #else | 86 #else |
93 | 87 |
94 /* Maximum unsigned 32-bit value used as placeholder for zip64 */ | |
95 #define MAXU32 0xffffffff | |
96 | 88 |
97 #if defined(_MSC_VER) || defined(__BORLANDC__) | 89 #if defined(_MSC_VER) || defined(__BORLANDC__) |
98 typedef unsigned __int64 ZPOS64_T; | 90 typedef unsigned __int64 ZPOS64_T; |
99 #else | 91 #else |
100 typedef unsigned long long int ZPOS64_T; | 92 typedef unsigned long long int ZPOS64_T; |
101 #endif | 93 #endif |
102 #endif | 94 #endif |
103 #endif | 95 #endif |
104 | 96 |
105 | 97 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 191 |
200 #define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(fil
ename),(mode))) | 192 #define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(fil
ename),(mode))) |
201 #define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(fil
estream))) | 193 #define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(fil
estream))) |
202 #define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(fil
estream),(pos),(mode))) | 194 #define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(fil
estream),(pos),(mode))) |
203 | 195 |
204 #ifdef __cplusplus | 196 #ifdef __cplusplus |
205 } | 197 } |
206 #endif | 198 #endif |
207 | 199 |
208 #endif | 200 #endif |
OLD | NEW |