Mercurial > hg > orthanc
annotate OrthancFramework/Resources/ThirdParty/minizip/unzip.h @ 5103:899f303613fb
merge from 1.11.2 branch
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 27 Oct 2022 12:53:47 +0200 |
parents | bcfb53d1bc56 |
children | 8174e45f48d8 |
rev | line source |
---|---|
4354
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /* unzip.h -- IO for uncompress .zip files using zlib |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 Version 1.1, February 14h, 2010 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 Modifications of Unzip for Zip64 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 Copyright (C) 2007-2008 Even Rouault |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 Modifications for Zip64 support on both zip and unzip |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 For more info read MiniZip_info.txt |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 --------------------------------------------------------------------------------- |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 Condition of use and distribution are the same than zlib : |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 This software is provided 'as-is', without any express or implied |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 warranty. In no event will the authors be held liable for any damages |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 arising from the use of this software. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 Permission is granted to anyone to use this software for any purpose, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 including commercial applications, and to alter it and redistribute it |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 freely, subject to the following restrictions: |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 1. The origin of this software must not be misrepresented; you must not |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 claim that you wrote the original software. If you use this software |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 in a product, an acknowledgment in the product documentation would be |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 appreciated but is not required. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 2. Altered source versions must be plainly marked as such, and must not be |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 misrepresented as being the original software. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 3. This notice may not be removed or altered from any source distribution. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 --------------------------------------------------------------------------------- |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 Changes |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 See header of unzip64.c |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 #ifndef _unz64_H |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 #define _unz64_H |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 #ifdef __cplusplus |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 extern "C" { |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 #endif |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 #ifndef _ZLIB_H |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 #include "zlib.h" |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 #endif |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 #ifndef _ZLIBIOAPI_H |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 #include "ioapi.h" |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 #endif |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 #ifdef HAVE_BZIP2 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 #include "bzlib.h" |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 #endif |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 #define Z_BZIP2ED 12 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 /* like the STRICT of WIN32, we define a pointer that cannot be converted |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 from (void*) without cast */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 typedef struct TagunzFile__ { int unused; } unzFile__; |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 typedef unzFile__ *unzFile; |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 #else |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 typedef voidp unzFile; |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 #endif |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 #define UNZ_OK (0) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 #define UNZ_END_OF_LIST_OF_FILE (-100) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 #define UNZ_ERRNO (Z_ERRNO) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 #define UNZ_EOF (0) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 #define UNZ_PARAMERROR (-102) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 #define UNZ_BADZIPFILE (-103) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 #define UNZ_INTERNALERROR (-104) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 #define UNZ_CRCERROR (-105) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 /* tm_unz contain date/time info */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 typedef struct tm_unz_s |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 { |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 uInt tm_sec; /* seconds after the minute - [0,59] */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 uInt tm_min; /* minutes after the hour - [0,59] */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 uInt tm_hour; /* hours since midnight - [0,23] */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 uInt tm_mday; /* day of the month - [1,31] */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 uInt tm_mon; /* months since January - [0,11] */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 uInt tm_year; /* years - [1980..2044] */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 } tm_unz; |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 /* unz_global_info structure contain global data about the ZIPfile |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 These data comes from the end of central dir */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 typedef struct unz_global_info64_s |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 { |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 ZPOS64_T number_entry; /* total number of entries in |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 the central dir on this disk */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 uLong size_comment; /* size of the global comment of the zipfile */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 } unz_global_info64; |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 typedef struct unz_global_info_s |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 { |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 uLong number_entry; /* total number of entries in |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 the central dir on this disk */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
107 uLong size_comment; /* size of the global comment of the zipfile */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 } unz_global_info; |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 /* unz_file_info contain information about a file in the zipfile */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 typedef struct unz_file_info64_s |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
112 { |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 uLong version; /* version made by 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 uLong version_needed; /* version needed to extract 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 uLong flag; /* general purpose bit flag 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 uLong compression_method; /* compression method 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
117 uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 uLong crc; /* crc-32 4 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 ZPOS64_T compressed_size; /* compressed size 8 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 uLong size_filename; /* filename length 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 uLong size_file_extra; /* extra field length 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 uLong size_file_comment; /* file comment length 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 uLong disk_num_start; /* disk number start 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 uLong internal_fa; /* internal file attributes 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 uLong external_fa; /* external file attributes 4 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 tm_unz tmu_date; |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 } unz_file_info64; |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
131 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 typedef struct unz_file_info_s |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 { |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 uLong version; /* version made by 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 uLong version_needed; /* version needed to extract 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 uLong flag; /* general purpose bit flag 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
137 uLong compression_method; /* compression method 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
139 uLong crc; /* crc-32 4 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 uLong compressed_size; /* compressed size 4 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 uLong uncompressed_size; /* uncompressed size 4 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 uLong size_filename; /* filename length 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
143 uLong size_file_extra; /* extra field length 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 uLong size_file_comment; /* file comment length 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 uLong disk_num_start; /* disk number start 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 uLong internal_fa; /* internal file attributes 2 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
148 uLong external_fa; /* external file attributes 4 bytes */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 tm_unz tmu_date; |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 } unz_file_info; |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
154 const char* fileName2, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 int iCaseSensitivity)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
157 Compare two filename (fileName1,fileName2). |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
159 If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
160 or strcasecmp) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 If iCaseSenisivity = 0, case sensitivity is defaut of your operating system |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
162 (like 1 on Unix, 2 on Windows) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
163 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
164 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
165 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
166 extern unzFile ZEXPORT unzOpen OF((const char *path)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
167 extern unzFile ZEXPORT unzOpen64 OF((const void *path)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
168 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
169 Open a Zip file. path contain the full pathname (by example, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
170 on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
171 "zlib/zlib113.zip". |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
172 If the zipfile cannot be opened (file don't exist or in not valid), the |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
173 return value is NULL. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
174 Else, the return value is a unzFile Handle, usable with other function |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
175 of this unzip package. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
176 the "64" function take a const void* pointer, because the path is just the |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
177 value passed to the open64_file_func callback. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
178 Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
179 is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
180 does not describe the reality |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
181 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
182 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
183 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
184 extern unzFile ZEXPORT unzOpen2 OF((const char *path, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
185 zlib_filefunc_def* pzlib_filefunc_def)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
186 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
187 Open a Zip file, like unzOpen, but provide a set of file low level API |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
188 for read/write the zip file (see ioapi.h) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
189 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
190 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
191 extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
192 zlib_filefunc64_def* pzlib_filefunc_def)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
193 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
194 Open a Zip file, like unz64Open, but provide a set of file low level API |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
195 for read/write the zip file (see ioapi.h) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
196 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
197 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
198 extern int ZEXPORT unzClose OF((unzFile file)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
199 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
200 Close a ZipFile opened with unzOpen. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
201 If there is files inside the .Zip opened with unzOpenCurrentFile (see later), |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
202 these files MUST be closed with unzCloseCurrentFile before call unzClose. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
203 return UNZ_OK if there is no problem. */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
204 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
205 extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
206 unz_global_info *pglobal_info)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
207 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
208 extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
209 unz_global_info64 *pglobal_info)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
210 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
211 Write info about the ZipFile in the *pglobal_info structure. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
212 No preparation of the structure is needed |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
213 return UNZ_OK if there is no problem. */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
214 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
215 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
216 extern int ZEXPORT unzGetGlobalComment OF((unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
217 char *szComment, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
218 uLong uSizeBuf)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
219 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
220 Get the global comment string of the ZipFile, in the szComment buffer. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
221 uSizeBuf is the size of the szComment buffer. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
222 return the number of byte copied or an error code <0 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
223 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
224 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
225 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
226 /***************************************************************************/ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
227 /* Unzip package allow you browse the directory of the zipfile */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
228 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
229 extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
230 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
231 Set the current file of the zipfile to the first file. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
232 return UNZ_OK if there is no problem |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
233 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
234 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
235 extern int ZEXPORT unzGoToNextFile OF((unzFile file)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
236 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
237 Set the current file of the zipfile to the next file. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
238 return UNZ_OK if there is no problem |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
239 return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
240 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
241 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
242 extern int ZEXPORT unzLocateFile OF((unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
243 const char *szFileName, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
244 int iCaseSensitivity)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
245 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
246 Try locate the file szFileName in the zipfile. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
247 For the iCaseSensitivity signification, see unzStringFileNameCompare |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
248 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
249 return value : |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
250 UNZ_OK if the file is found. It becomes the current file. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
251 UNZ_END_OF_LIST_OF_FILE if the file is not found |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
252 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
253 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
254 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
255 /* ****************************************** */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
256 /* Ryan supplied functions */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
257 /* unz_file_info contain information about a file in the zipfile */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
258 typedef struct unz_file_pos_s |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
259 { |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
260 uLong pos_in_zip_directory; /* offset in zip file directory */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
261 uLong num_of_file; /* # of file */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
262 } unz_file_pos; |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
263 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
264 extern int ZEXPORT unzGetFilePos( |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
265 unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
266 unz_file_pos* file_pos); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
267 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
268 extern int ZEXPORT unzGoToFilePos( |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
269 unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
270 unz_file_pos* file_pos); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
271 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
272 typedef struct unz64_file_pos_s |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
273 { |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
274 ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
275 ZPOS64_T num_of_file; /* # of file */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
276 } unz64_file_pos; |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
277 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
278 extern int ZEXPORT unzGetFilePos64( |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
279 unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
280 unz64_file_pos* file_pos); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
281 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
282 extern int ZEXPORT unzGoToFilePos64( |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
283 unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
284 const unz64_file_pos* file_pos); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
285 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
286 /* ****************************************** */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
287 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
288 extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
289 unz_file_info64 *pfile_info, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
290 char *szFileName, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
291 uLong fileNameBufferSize, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
292 void *extraField, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
293 uLong extraFieldBufferSize, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
294 char *szComment, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
295 uLong commentBufferSize)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
296 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
297 extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
298 unz_file_info *pfile_info, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
299 char *szFileName, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
300 uLong fileNameBufferSize, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
301 void *extraField, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
302 uLong extraFieldBufferSize, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
303 char *szComment, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
304 uLong commentBufferSize)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
305 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
306 Get Info about the current file |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
307 if pfile_info!=NULL, the *pfile_info structure will contain somes info about |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
308 the current file |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
309 if szFileName!=NULL, the filemane string will be copied in szFileName |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
310 (fileNameBufferSize is the size of the buffer) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
311 if extraField!=NULL, the extra field information will be copied in extraField |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
312 (extraFieldBufferSize is the size of the buffer). |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
313 This is the Central-header version of the extra field |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
314 if szComment!=NULL, the comment string of the file will be copied in szComment |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
315 (commentBufferSize is the size of the buffer) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
316 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
317 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
318 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
319 /** Addition for GDAL : START */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
320 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
321 extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
322 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
323 /** Addition for GDAL : END */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
324 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
325 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
326 /***************************************************************************/ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
327 /* for reading the content of the current zipfile, you can open it, read data |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
328 from it, and close it (you can close it before reading all the file) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
329 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
330 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
331 extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
332 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
333 Open for reading data the current file in the zipfile. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
334 If there is no error, the return value is UNZ_OK. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
335 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
336 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
337 extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
338 const char* password)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
339 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
340 Open for reading data the current file in the zipfile. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
341 password is a crypting password |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
342 If there is no error, the return value is UNZ_OK. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
343 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
344 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
345 extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
346 int* method, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
347 int* level, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
348 int raw)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
349 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
350 Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
351 if raw==1 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
352 *method will receive method of compression, *level will receive level of |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
353 compression |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
354 note : you can set level parameter as NULL (if you did not want known level, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
355 but you CANNOT set method parameter as NULL |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
356 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
357 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
358 extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
359 int* method, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
360 int* level, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
361 int raw, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
362 const char* password)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
363 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
364 Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
365 if raw==1 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
366 *method will receive method of compression, *level will receive level of |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
367 compression |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
368 note : you can set level parameter as NULL (if you did not want known level, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
369 but you CANNOT set method parameter as NULL |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
370 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
371 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
372 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
373 extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
374 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
375 Close the file in zip opened with unzOpenCurrentFile |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
376 Return UNZ_CRCERROR if all the file was read but the CRC is not good |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
377 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
378 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
379 extern int ZEXPORT unzReadCurrentFile OF((unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
380 voidp buf, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
381 unsigned len)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
382 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
383 Read bytes from the current file (opened by unzOpenCurrentFile) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
384 buf contain buffer where data must be copied |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
385 len the size of buf. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
386 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
387 return the number of byte copied if somes bytes are copied |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
388 return 0 if the end of file was reached |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
389 return <0 with error code if there is an error |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
390 (UNZ_ERRNO for IO error, or zLib error for uncompress error) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
391 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
392 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
393 extern z_off_t ZEXPORT unztell OF((unzFile file)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
394 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
395 extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
396 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
397 Give the current position in uncompressed data |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
398 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
399 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
400 extern int ZEXPORT unzeof OF((unzFile file)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
401 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
402 return 1 if the end of file was reached, 0 elsewhere |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
403 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
404 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
405 extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
406 voidp buf, |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
407 unsigned len)); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
408 /* |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
409 Read extra field from the current file (opened by unzOpenCurrentFile) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
410 This is the local-header version of the extra field (sometimes, there is |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
411 more info in the local-header version than in the central-header) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
412 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
413 if buf==NULL, it return the size of the local extra field |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
414 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
415 if buf!=NULL, len is the size of the buffer, the extra header is copied in |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
416 buf. |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
417 the return value is the number of bytes copied in buf, or (if <0) |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
418 the error code |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
419 */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
420 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
421 /***************************************************************************/ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
422 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
423 /* Get the current file offset */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
424 extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
425 extern uLong ZEXPORT unzGetOffset (unzFile file); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
426 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
427 /* Set the current file offset */ |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
428 extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
429 extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
430 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
431 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
432 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
433 #ifdef __cplusplus |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
434 } |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
435 #endif |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
436 |
bcfb53d1bc56
trying to uncompress one zip archive
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
437 #endif /* _unz64_H */ |