1
/* zip.h -- IO for compress .zip files using zlib
2
Version 1.01e, February 12th, 2005
4
Copyright (C) 1998-2005 Gilles Vollant
6
This unzip package allow creates .ZIP file, compatible with PKZip 2.04g
7
WinZip, InfoZip tools and compatible.
8
Multi volume ZipFile (span) are not supported.
9
Encryption compatible with pkzip 2.04g only supported
10
Old compressions used by old PKZip 1.x are not supported
12
For uncompress .zip file, look at unzip.h
15
I WAIT FEEDBACK at mail info@winimage.com
16
Visit also http://www.winimage.com/zLibDll/unzip.html for evolution
1
/* zip.h -- IO on .zip files using zlib
2
Version 1.1, February 14h, 2010
3
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
5
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
7
Modifications for Zip64 support
8
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
10
For more info read MiniZip_info.txt
12
---------------------------------------------------------------------------
18
14
Condition of use and distribution are the same than zlib :
33
29
misrepresented as being the original software.
34
30
3. This notice may not be removed or altered from any source distribution.
39
/* for more info about .ZIP format, see
40
http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip
41
http://www.info-zip.org/pub/infozip/doc/
42
PkWare has also a specification at :
43
ftp://ftp.pkware.com/probdesc.zip
32
---------------------------------------------------------------------------
112
114
#define APPEND_STATUS_ADDINZIP (2)
114
116
extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
117
extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
116
119
Create a zipfile.
117
120
pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on
136
139
zipcharpc* globalcomment,
137
140
zlib_filefunc_def* pzlib_filefunc_def));
142
extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname,
144
zipcharpc* globalcomment,
145
zlib_filefunc64_def* pzlib_filefunc_def));
139
147
extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
140
148
const char* filename,
141
149
const zip_fileinfo* zipfi,
146
154
const char* comment,
158
extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file,
159
const char* filename,
160
const zip_fileinfo* zipfi,
161
const void* extrafield_local,
162
uInt size_extrafield_local,
163
const void* extrafield_global,
164
uInt size_extrafield_global,
150
171
Open a file in the ZIP for writing.
151
172
filename : the filename in zip (if NULL, '-' without quote will be used
157
178
if comment != NULL, comment contain the comment string
158
179
method contain the compression method (0 for store, Z_DEFLATED for deflate)
159
180
level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
181
zip64 is set to 1 if a zip64 extended information block should be added to the local file header.
182
this MUST be '1' if the uncompressed size is >= 0xffffffff.
200
extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file,
201
const char* filename,
202
const zip_fileinfo* zipfi,
203
const void* extrafield_local,
204
uInt size_extrafield_local,
205
const void* extrafield_global,
206
uInt size_extrafield_global,
176
213
Same than zipOpenNewFileInZip, except if raw=1, we write raw file
193
230
const char* password,
194
uLong crcForCtypting));
231
uLong crcForCrypting));
233
extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file,
234
const char* filename,
235
const zip_fileinfo* zipfi,
236
const void* extrafield_local,
237
uInt size_extrafield_local,
238
const void* extrafield_global,
239
uInt size_extrafield_global,
247
const char* password,
248
uLong crcForCrypting,
197
253
Same than zipOpenNewFileInZip2, except
198
254
windowBits,memLevel,,strategy : see parameter strategy in deflateInit2
199
255
password : crypting password (NULL for no crypting)
200
crcForCtypting : crc of file to compress (needed for crypting)
256
crcForCrypting : crc of file to compress (needed for crypting)
259
extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file,
260
const char* filename,
261
const zip_fileinfo* zipfi,
262
const void* extrafield_local,
263
uInt size_extrafield_local,
264
const void* extrafield_global,
265
uInt size_extrafield_global,
273
const char* password,
274
uLong crcForCrypting,
280
extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file,
281
const char* filename,
282
const zip_fileinfo* zipfi,
283
const void* extrafield_local,
284
uInt size_extrafield_local,
285
const void* extrafield_global,
286
uInt size_extrafield_global,
294
const char* password,
295
uLong crcForCrypting,
301
Same than zipOpenNewFileInZip4, except
302
versionMadeBy : value for Version made by field
303
flag : value for flag field (compression level info will be added)
216
319
extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
217
320
uLong uncompressed_size,
323
extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file,
324
ZPOS64_T uncompressed_size,
220
Close the current file in the zipfile, for fiel opened with
328
Close the current file in the zipfile, for file opened with
221
329
parameter raw=1 in zipOpenNewFileInZip2
222
330
uncompressed_size and crc32 are value for the uncompressed size
228
336
Close the zipfile
340
extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader));
342
zipRemoveExtraInfoBlock - Added by Mathias Svensson
344
Remove extra information block from a extra information data for the local file header or central directory header
346
It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode.
348
0x0001 is the signature header for the ZIP64 extra information blocks
351
Remove ZIP64 Extra information from a central director extra field data
352
zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001);
354
Remove ZIP64 Extra information from a Local File Header extra field data
355
zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001);
231
358
#ifdef __cplusplus
362
#endif /* _zip64_H */