diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:27:26 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:27:26 -0700 |
commit | 7751bd4c715ea8478113e34b49b5a794a4642e8e (patch) | |
tree | 537ba82b3780f933c2f17028febd6fe3a2332190 /contrib/minizip/minizip.c | |
parent | e0ff940e1adb68d3575705ebf1546d9f07ad3b4a (diff) | |
download | zlib-1.2.3.9.tar.gz zlib-1.2.3.9.tar.bz2 zlib-1.2.3.9.zip |
zlib 1.2.3.9v1.2.3.9
Diffstat (limited to 'contrib/minizip/minizip.c')
-rw-r--r-- | contrib/minizip/minizip.c | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/contrib/minizip/minizip.c b/contrib/minizip/minizip.c index ca26091..7a4fa5a 100644 --- a/contrib/minizip/minizip.c +++ b/contrib/minizip/minizip.c | |||
@@ -1,31 +1,31 @@ | |||
1 | /* | 1 | /* |
2 | minizip.c | 2 | minizip.c |
3 | Version 1.1, January 7th, 2010 | 3 | Version 1.1, February 14h, 2010 |
4 | sample part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) | 4 | sample part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) |
5 | 5 | ||
6 | Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) | 6 | Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) |
7 | 7 | ||
8 | Modifications of Unzip for Zip64 | 8 | Modifications of Unzip for Zip64 |
9 | Copyright (C) 2007-2008 Even Rouault | 9 | Copyright (C) 2007-2008 Even Rouault |
10 | 10 | ||
11 | Modifications for Zip64 support on both zip and unzip | 11 | Modifications for Zip64 support on both zip and unzip |
12 | Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) | 12 | Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) |
13 | */ | 13 | */ |
14 | 14 | ||
15 | 15 | ||
16 | #ifndef _WIN32 | 16 | #ifndef _WIN32 |
17 | #ifndef __USE_FILE_OFFSET64 | 17 | #ifndef __USE_FILE_OFFSET64 |
18 | #define __USE_FILE_OFFSET64 | 18 | #define __USE_FILE_OFFSET64 |
19 | #endif | 19 | #endif |
20 | #ifndef __USE_LARGEFILE64 | 20 | #ifndef __USE_LARGEFILE64 |
21 | #define __USE_LARGEFILE64 | 21 | #define __USE_LARGEFILE64 |
22 | #endif | 22 | #endif |
23 | #ifndef _LARGEFILE64_SOURCE | 23 | #ifndef _LARGEFILE64_SOURCE |
24 | #define _LARGEFILE64_SOURCE | 24 | #define _LARGEFILE64_SOURCE |
25 | #endif | 25 | #endif |
26 | #ifndef _FILE_OFFSET_BIT | 26 | #ifndef _FILE_OFFSET_BIT |
27 | #define _FILE_OFFSET_BIT 64 | 27 | #define _FILE_OFFSET_BIT 64 |
28 | #endif | 28 | #endif |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | #include <stdio.h> | 31 | #include <stdio.h> |
@@ -48,8 +48,8 @@ | |||
48 | #include "zip.h" | 48 | #include "zip.h" |
49 | 49 | ||
50 | #ifdef _WIN32 | 50 | #ifdef _WIN32 |
51 | #define USEWIN32IOAPI | 51 | #define USEWIN32IOAPI |
52 | #include "iowin32.h" | 52 | #include "iowin32.h" |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | 55 | ||
@@ -152,9 +152,8 @@ int check_exist_file(filename) | |||
152 | 152 | ||
153 | void do_banner() | 153 | void do_banner() |
154 | { | 154 | { |
155 | printf("MiniZip64 1.0, demo of zLib + MiniZip64 package, written by Gilles Vollant\n"); | 155 | printf("MiniZip 1.1, demo of zLib + MiniZip64 package, written by Gilles Vollant\n"); |
156 | printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n"); | 156 | printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n"); |
157 | printf("more info on MiniZip64 at http://result42.com/projects/MiniZip64\n\n"); | ||
158 | } | 157 | } |
159 | 158 | ||
160 | void do_help() | 159 | void do_help() |
@@ -220,12 +219,12 @@ int isLargeFile(const char* filename) | |||
220 | 219 | ||
221 | pos = ftello64(pFile); | 220 | pos = ftello64(pFile); |
222 | 221 | ||
223 | printf("File : %s is %lld bytes\n", filename, pos); | 222 | printf("File : %s is %lld bytes\n", filename, pos); |
224 | 223 | ||
225 | if(pos >= 0xffffffff) | 224 | if(pos >= 0xffffffff) |
226 | largeFile = 1; | 225 | largeFile = 1; |
227 | 226 | ||
228 | fclose(pFile); | 227 | fclose(pFile); |
229 | } | 228 | } |
230 | 229 | ||
231 | return largeFile; | 230 | return largeFile; |
@@ -409,7 +408,7 @@ int main(argc,argv) | |||
409 | 408 | ||
410 | zip64 = isLargeFile(filenameinzip); | 409 | zip64 = isLargeFile(filenameinzip); |
411 | 410 | ||
412 | /* The path name saved, should not include a leading slash. */ | 411 | /* The path name saved, should not include a leading slash. */ |
413 | /*if it did, windows/xp and dynazip couldn't read the zip file. */ | 412 | /*if it did, windows/xp and dynazip couldn't read the zip file. */ |
414 | savefilenameinzip = filenameinzip; | 413 | savefilenameinzip = filenameinzip; |
415 | while( savefilenameinzip[0] == '\\' || savefilenameinzip[0] == '/' ) | 414 | while( savefilenameinzip[0] == '\\' || savefilenameinzip[0] == '/' ) |