1 /* zip.h -- IO for compress .zip files using zlib
\r
2 Version 0.15 alpha, Mar 19th, 1998,
\r
4 Copyright (C) 1998 Gilles Vollant
\r
6 This unzip package allow creates .ZIP file, compatible with PKZip 2.04g
\r
7 WinZip, InfoZip tools and compatible.
\r
8 Encryption and multi volume ZipFile (span) are not supported.
\r
9 Old compressions used by old PKZip 1.x are not supported
\r
11 For uncompress .zip file, look at unzip.h
\r
13 THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE
\r
14 CAN CHANGE IN FUTURE VERSION !!
\r
15 I WAIT FEEDBACK at mail info@winimage.com
\r
16 Visit also http://www.winimage.com/zLibDll/zip.htm for evolution
\r
18 Condition of use and distribution are the same than zlib :
\r
20 This software is provided 'as-is', without any express or implied
\r
21 warranty. In no event will the authors be held liable for any damages
\r
22 arising from the use of this software.
\r
24 Permission is granted to anyone to use this software for any purpose,
\r
25 including commercial applications, and to alter it and redistribute it
\r
26 freely, subject to the following restrictions:
\r
28 1. The origin of this software must not be misrepresented; you must not
\r
29 claim that you wrote the original software. If you use this software
\r
30 in a product, an acknowledgment in the product documentation would be
\r
31 appreciated but is not required.
\r
32 2. Altered source versions must be plainly marked as such, and must not be
\r
33 misrepresented as being the original software.
\r
34 3. This notice may not be removed or altered from any source distribution.
\r
39 /* for more info about .ZIP format, see
\r
40 ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
\r
41 PkWare has also a specification at :
\r
42 ftp://ftp.pkware.com/probdesc.zip
\r
56 #if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
\r
57 /* like the STRICT of WIN32, we define a pointer that cannot be converted
\r
58 from (void*) without cast */
\r
59 typedef struct TagzipFile__ { int unused; } zipFile__;
\r
60 typedef zipFile__ *zipFile;
\r
62 typedef voidp zipFile;
\r
66 #define ZIP_ERRNO (Z_ERRNO)
\r
67 #define ZIP_PARAMERROR (-102)
\r
68 #define ZIP_INTERNALERROR (-104)
\r
70 /* tm_zip contain date/time info */
\r
71 typedef struct tm_zip_s
\r
73 uInt tm_sec; /* seconds after the minute - [0,59] */
\r
74 uInt tm_min; /* minutes after the hour - [0,59] */
\r
75 uInt tm_hour; /* hours since midnight - [0,23] */
\r
76 uInt tm_mday; /* day of the month - [1,31] */
\r
77 uInt tm_mon; /* months since January - [0,11] */
\r
78 uInt tm_year; /* years - [1980..2044] */
\r
83 tm_zip tmz_date; /* date in understandable format */
\r
84 uLong dosDate; /* if dos_date == 0, tmu_date is used */
\r
85 /* uLong flag; */ /* general purpose bit flag 2 bytes */
\r
87 uLong internal_fa; /* internal file attributes 2 bytes */
\r
88 uLong external_fa; /* external file attributes 4 bytes */
\r
91 extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
\r
94 pathname contain on Windows NT a filename like "c:\\zlib\\zlib111.zip" or on
\r
95 an Unix computer "zlib/zlib111.zip".
\r
96 if the file pathname exist and append=1, the zip will be created at the end
\r
97 of the file. (useful if the file contain a self extractor code)
\r
98 If the zipfile cannot be opened, the return value is NULL.
\r
99 Else, the return value is a zipFile Handle, usable with other function
\r
100 of this zip package.
\r
105 extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
\r
106 const char* filename,
\r
107 const zip_fileinfo* zipfi,
\r
108 const void* extrafield_local,
\r
109 uInt size_extrafield_local,
\r
110 const void* extrafield_global,
\r
111 uInt size_extrafield_global,
\r
112 const char* comment,
\r
116 Open a file in the ZIP for writing.
\r
117 filename : the filename in zip (if NULL, '-' without quote will be used
\r
118 *zipfi contain supplemental information
\r
119 if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local
\r
120 contains the extrafield data the the local header
\r
121 if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global
\r
122 contains the extrafield data the the local header
\r
123 if comment != NULL, comment contain the comment string
\r
124 method contain the compression method (0 for store, Z_DEFLATED for deflate)
\r
125 level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
\r
128 extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
\r
132 Write data in the zipfile
\r
135 extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
\r
137 Close the current file in the zipfile
\r
140 extern int ZEXPORT zipClose OF((zipFile file,
\r
141 const char* global_comment));
\r
150 #endif /* _zip_H */
\r