aboutsummaryrefslogtreecommitdiff
path: root/contrib/minizip/minizip.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/minizip/minizip.c')
-rw-r--r--contrib/minizip/minizip.c48
1 files changed, 18 insertions, 30 deletions
diff --git a/contrib/minizip/minizip.c b/contrib/minizip/minizip.c
index e8561b1..f0480f2 100644
--- a/contrib/minizip/minizip.c
+++ b/contrib/minizip/minizip.c
@@ -71,11 +71,9 @@
71#define MAXFILENAME (256) 71#define MAXFILENAME (256)
72 72
73#ifdef _WIN32 73#ifdef _WIN32
74static int filetime(f, tmzip, dt) 74/* f: name of file to get info on, tmzip: return value: access,
75 const char *f; /* name of file to get info on */ 75 modification and creation times, dt: dostime */
76 tm_zip *tmzip; /* return value: access, modific. and creation times */ 76static int filetime(const char *f, tm_zip *tmzip, uLong *dt) {
77 uLong *dt; /* dostime */
78{
79 int ret = 0; 77 int ret = 0;
80 { 78 {
81 FILETIME ftLocal; 79 FILETIME ftLocal;
@@ -95,11 +93,9 @@ static int filetime(f, tmzip, dt)
95} 93}
96#else 94#else
97#if defined(unix) || defined(__APPLE__) 95#if defined(unix) || defined(__APPLE__)
98static int filetime(f, tmzip, dt) 96/* f: name of file to get info on, tmzip: return value: access,
99 const char *f; /* name of file to get info on */ 97 modification and creation times, dt: dostime */
100 tm_zip *tmzip; /* return value: access, modific. and creation times */ 98static int filetime(const char *f, tm_zip *tmzip, uLong *dt) {
101 uLong *dt; /* dostime */
102{
103 (void)dt; 99 (void)dt;
104 int ret=0; 100 int ret=0;
105 struct stat s; /* results of stat() */ 101 struct stat s; /* results of stat() */
@@ -138,11 +134,12 @@ static int filetime(f, tmzip, dt)
138 return ret; 134 return ret;
139} 135}
140#else 136#else
141uLong filetime(f, tmzip, dt) 137/* f: name of file to get info on, tmzip: return value: access,
142 const char *f; /* name of file to get info on */ 138 modification and creation times, dt: dostime */
143 tm_zip *tmzip; /* return value: access, modific. and creation times */ 139uLong filetime(const char *f, tm_zip *tmzip, uLong *dt) {
144 uLong *dt; /* dostime */ 140 (void)f;
145{ 141 (void)tmzip;
142 (void)dt;
146 return 0; 143 return 0;
147} 144}
148#endif 145#endif
@@ -151,9 +148,7 @@ uLong filetime(f, tmzip, dt)
151 148
152 149
153 150
154static int check_exist_file(filename) 151static int check_exist_file(const char* filename) {
155 const char* filename;
156{
157 FILE* ftestexist; 152 FILE* ftestexist;
158 int ret = 1; 153 int ret = 1;
159 ftestexist = FOPEN_FUNC(filename,"rb"); 154 ftestexist = FOPEN_FUNC(filename,"rb");
@@ -164,14 +159,12 @@ static int check_exist_file(filename)
164 return ret; 159 return ret;
165} 160}
166 161
167static void do_banner() 162static void do_banner(void) {
168{
169 printf("MiniZip 1.1, demo of zLib + MiniZip64 package, written by Gilles Vollant\n"); 163 printf("MiniZip 1.1, demo of zLib + MiniZip64 package, written by Gilles Vollant\n");
170 printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n"); 164 printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n");
171} 165}
172 166
173static void do_help() 167static void do_help(void) {
174{
175 printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \ 168 printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \
176 " -o Overwrite existing file.zip\n" \ 169 " -o Overwrite existing file.zip\n" \
177 " -a Append to existing file.zip\n" \ 170 " -a Append to existing file.zip\n" \
@@ -183,8 +176,7 @@ static void do_help()
183 176
184/* calculate the CRC32 of a file, 177/* calculate the CRC32 of a file,
185 because to encrypt a file, we need known the CRC32 of the file before */ 178 because to encrypt a file, we need known the CRC32 of the file before */
186static int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc) 179static int getFileCrc(const char* filenameinzip, void* buf, unsigned long size_buf, unsigned long* result_crc) {
187{
188 unsigned long calculate_crc=0; 180 unsigned long calculate_crc=0;
189 int err=ZIP_OK; 181 int err=ZIP_OK;
190 FILE * fin = FOPEN_FUNC(filenameinzip,"rb"); 182 FILE * fin = FOPEN_FUNC(filenameinzip,"rb");
@@ -222,8 +214,7 @@ static int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,
222 return err; 214 return err;
223} 215}
224 216
225static int isLargeFile(const char* filename) 217static int isLargeFile(const char* filename) {
226{
227 int largeFile = 0; 218 int largeFile = 0;
228 ZPOS64_T pos = 0; 219 ZPOS64_T pos = 0;
229 FILE* pFile = FOPEN_FUNC(filename, "rb"); 220 FILE* pFile = FOPEN_FUNC(filename, "rb");
@@ -244,10 +235,7 @@ static int isLargeFile(const char* filename)
244 return largeFile; 235 return largeFile;
245} 236}
246 237
247int main(argc,argv) 238int main(int argc, char *argv[]) {
248 int argc;
249 char *argv[];
250{
251 int i; 239 int i;
252 int opt_overwrite=0; 240 int opt_overwrite=0;
253 int opt_compress_level=Z_DEFAULT_COMPRESSION; 241 int opt_compress_level=Z_DEFAULT_COMPRESSION;