~ubuntu-branches/ubuntu/wily/zlib/wily

« back to all changes in this revision

Viewing changes to contrib/minizip/zip.h

  • Committer: Package Import Robot
  • Author(s): Mark Brown
  • Date: 2012-06-22 16:55:56 UTC
  • mfrom: (1.1.23 sid)
  • Revision ID: package-import@ubuntu.com-20120622165556-9xuc7gnq4w25b3i0
Yet more s390x cleanup.  Thanks to the s390x porters for thei
prompt an efficient buildd monitoring (closes: #678511).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* zip.h -- IO for compress .zip files using zlib
2
 
   Version 1.01e, February 12th, 2005
3
 
 
4
 
   Copyright (C) 1998-2005 Gilles Vollant
5
 
 
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
11
 
 
12
 
  For uncompress .zip file, look at unzip.h
13
 
 
14
 
 
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 )
 
4
 
 
5
         Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
 
6
 
 
7
         Modifications for Zip64 support
 
8
         Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
 
9
 
 
10
         For more info read MiniZip_info.txt
 
11
 
 
12
         ---------------------------------------------------------------------------
17
13
 
18
14
   Condition of use and distribution are the same than zlib :
19
15
 
33
29
     misrepresented as being the original software.
34
30
  3. This notice may not be removed or altered from any source distribution.
35
31
 
36
 
 
37
 
*/
38
 
 
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
44
 
*/
45
 
 
46
 
#ifndef _zip_H
47
 
#define _zip_H
 
32
        ---------------------------------------------------------------------------
 
33
 
 
34
        Changes
 
35
 
 
36
        See header of zip.h
 
37
 
 
38
*/
 
39
 
 
40
#ifndef _zip12_H
 
41
#define _zip12_H
48
42
 
49
43
#ifdef __cplusplus
50
44
extern "C" {
51
45
#endif
52
46
 
 
47
//#define HAVE_BZIP2
 
48
 
53
49
#ifndef _ZLIB_H
54
50
#include "zlib.h"
55
51
#endif
58
54
#include "ioapi.h"
59
55
#endif
60
56
 
 
57
#ifdef HAVE_BZIP2
 
58
#include "bzlib.h"
 
59
#endif
 
60
 
 
61
#define Z_BZIP2ED 12
 
62
 
61
63
#if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
62
64
/* like the STRICT of WIN32, we define a pointer that cannot be converted
63
65
    from (void*) without cast */
112
114
#define APPEND_STATUS_ADDINZIP      (2)
113
115
 
114
116
extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
 
117
extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
115
118
/*
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));
138
141
 
 
142
extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname,
 
143
                                   int append,
 
144
                                   zipcharpc* globalcomment,
 
145
                                   zlib_filefunc64_def* pzlib_filefunc_def));
 
146
 
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,
147
155
                       int method,
148
156
                       int level));
 
157
 
 
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,
 
165
                       const char* comment,
 
166
                       int method,
 
167
                       int level,
 
168
                       int zip64));
 
169
 
149
170
/*
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.
 
183
 
160
184
*/
161
185
 
162
186
 
172
196
                                            int level,
173
197
                                            int raw));
174
198
 
 
199
 
 
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,
 
207
                                            const char* comment,
 
208
                                            int method,
 
209
                                            int level,
 
210
                                            int raw,
 
211
                                            int zip64));
175
212
/*
176
213
  Same than zipOpenNewFileInZip, except if raw=1, we write raw file
177
214
 */
191
228
                                            int memLevel,
192
229
                                            int strategy,
193
230
                                            const char* password,
194
 
                                            uLong crcForCtypting));
 
231
                                            uLong crcForCrypting));
 
232
 
 
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,
 
240
                                            const char* comment,
 
241
                                            int method,
 
242
                                            int level,
 
243
                                            int raw,
 
244
                                            int windowBits,
 
245
                                            int memLevel,
 
246
                                            int strategy,
 
247
                                            const char* password,
 
248
                                            uLong crcForCrypting,
 
249
                                            int zip64
 
250
                                            ));
195
251
 
196
252
/*
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)
 
257
 */
 
258
 
 
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,
 
266
                                            const char* comment,
 
267
                                            int method,
 
268
                                            int level,
 
269
                                            int raw,
 
270
                                            int windowBits,
 
271
                                            int memLevel,
 
272
                                            int strategy,
 
273
                                            const char* password,
 
274
                                            uLong crcForCrypting,
 
275
                                            uLong versionMadeBy,
 
276
                                            uLong flagBase
 
277
                                            ));
 
278
 
 
279
 
 
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,
 
287
                                            const char* comment,
 
288
                                            int method,
 
289
                                            int level,
 
290
                                            int raw,
 
291
                                            int windowBits,
 
292
                                            int memLevel,
 
293
                                            int strategy,
 
294
                                            const char* password,
 
295
                                            uLong crcForCrypting,
 
296
                                            uLong versionMadeBy,
 
297
                                            uLong flagBase,
 
298
                                            int zip64
 
299
                                            ));
 
300
/*
 
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)
201
304
 */
202
305
 
203
306
 
216
319
extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
217
320
                                            uLong uncompressed_size,
218
321
                                            uLong crc32));
 
322
 
 
323
extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file,
 
324
                                            ZPOS64_T uncompressed_size,
 
325
                                            uLong crc32));
 
326
 
219
327
/*
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
223
331
*/
228
336
  Close the zipfile
229
337
*/
230
338
 
 
339
 
 
340
extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader));
 
341
/*
 
342
  zipRemoveExtraInfoBlock -  Added by Mathias Svensson
 
343
 
 
344
  Remove extra information block from a extra information data for the local file header or central directory header
 
345
 
 
346
  It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode.
 
347
 
 
348
  0x0001 is the signature header for the ZIP64 extra information blocks
 
349
 
 
350
  usage.
 
351
                        Remove ZIP64 Extra information from a central director extra field data
 
352
              zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001);
 
353
 
 
354
                        Remove ZIP64 Extra information from a Local File Header extra field data
 
355
        zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001);
 
356
*/
 
357
 
231
358
#ifdef __cplusplus
232
359
}
233
360
#endif
234
361
 
235
 
#endif /* _zip_H */
 
362
#endif /* _zip64_H */