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)) | 24 #if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) |
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 #endif | 41 #endif |
42 | 42 |
43 #include <stdio.h> | 43 #include <stdio.h> |
44 #include <stdlib.h> | 44 #include <stdlib.h> |
45 #include "third_party/zlib/zlib.h" | 45 #include "third_party/zlib/zlib.h" |
46 | 46 |
47 #if defined(USE_FILE32API) | 47 #if defined(USE_FILE32API) |
48 #define fopen64 fopen | 48 #define fopen64 fopen |
49 #define ftello64 ftell | 49 #define ftello64 ftell |
50 #define fseeko64 fseek | 50 #define fseeko64 fseek |
51 #else | 51 #else |
| 52 #ifdef __FreeBSD__ |
| 53 #define fopen64 fopen |
| 54 #define ftello64 ftello |
| 55 #define fseeko64 fseeko |
| 56 #endif |
52 #ifdef _MSC_VER | 57 #ifdef _MSC_VER |
53 #define fopen64 fopen | 58 #define fopen64 fopen |
54 #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) | 59 #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) |
55 #define ftello64 _ftelli64 | 60 #define ftello64 _ftelli64 |
56 #define fseeko64 _fseeki64 | 61 #define fseeko64 _fseeki64 |
57 #else // old MSC | 62 #else // old MSC |
58 #define ftello64 ftell | 63 #define ftello64 ftell |
59 #define fseeko64 fseek | 64 #define fseeko64 fseek |
60 #endif | 65 #endif |
61 #endif | 66 #endif |
(...skipping 16 matching lines...) Expand all Loading... |
78 | 83 |
79 /* a type choosen by DEFINE */ | 84 /* a type choosen by DEFINE */ |
80 #ifdef HAVE_64BIT_INT_CUSTOM | 85 #ifdef HAVE_64BIT_INT_CUSTOM |
81 typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; | 86 typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; |
82 #else | 87 #else |
83 #ifdef HAS_STDINT_H | 88 #ifdef HAS_STDINT_H |
84 #include "stdint.h" | 89 #include "stdint.h" |
85 typedef uint64_t ZPOS64_T; | 90 typedef uint64_t ZPOS64_T; |
86 #else | 91 #else |
87 | 92 |
| 93 /* Maximum unsigned 32-bit value used as placeholder for zip64 */ |
| 94 #define MAXU32 0xffffffff |
88 | 95 |
89 #if defined(_MSC_VER) || defined(__BORLANDC__) | 96 #if defined(_MSC_VER) || defined(__BORLANDC__) |
90 typedef unsigned __int64 ZPOS64_T; | 97 typedef unsigned __int64 ZPOS64_T; |
91 #else | 98 #else |
92 typedef unsigned long long int ZPOS64_T; | 99 typedef unsigned long long int ZPOS64_T; |
93 #endif | 100 #endif |
94 #endif | 101 #endif |
95 #endif | 102 #endif |
96 | 103 |
97 | 104 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 198 |
192 #define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(fil
ename),(mode))) | 199 #define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(fil
ename),(mode))) |
193 #define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(fil
estream))) | 200 #define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(fil
estream))) |
194 #define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(fil
estream),(pos),(mode))) | 201 #define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(fil
estream),(pos),(mode))) |
195 | 202 |
196 #ifdef __cplusplus | 203 #ifdef __cplusplus |
197 } | 204 } |
198 #endif | 205 #endif |
199 | 206 |
200 #endif | 207 #endif |
OLD | NEW |