|
|
1 | /** |
|
|
2 | * ZANavi, Zoff Android Navigation system. |
|
|
3 | * Copyright (C) 2011-2014 Zoff <zoff@zoff.cc> |
|
|
4 | * |
|
|
5 | * This program is free software; you can redistribute it and/or |
|
|
6 | * modify it under the terms of the GNU General Public License |
|
|
7 | * version 2 as published by the Free Software Foundation. |
|
|
8 | * |
|
|
9 | * This program is distributed in the hope that it will be useful, |
|
|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
12 | * GNU General Public License for more details. |
|
|
13 | * |
|
|
14 | * You should have received a copy of the GNU General Public License |
|
|
15 | * along with this program; if not, write to the |
|
|
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
|
17 | * Boston, MA 02110-1301, USA. |
|
|
18 | */ |
|
|
19 | |
1 | /** |
20 | /** |
2 | * Navit, a modular navigation system. |
21 | * Navit, a modular navigation system. |
3 | * Copyright (C) 2005-2008 Navit Team |
22 | * Copyright (C) 2005-2008 Navit Team |
4 | * |
23 | * |
5 | * This program is free software; you can redistribute it and/or |
24 | * This program is free software; you can redistribute it and/or |
… | |
… | |
24 | #pragma pack(1) |
43 | #pragma pack(1) |
25 | #endif |
44 | #endif |
26 | |
45 | |
27 | #define zip_split_sig 0x08074b50 |
46 | #define zip_split_sig 0x08074b50 |
28 | |
47 | |
29 | struct zip_split { |
48 | struct zip_split |
|
|
49 | { |
30 | int zipsplitsig; |
50 | int zipsplitsig; |
31 | }; |
51 | }; |
32 | |
52 | |
|
|
53 | /* this is the normal "magic" header we use!! */ |
33 | #define zip_lfh_sig 0x04034b50 |
54 | #define zip_lfh_sig 0x04034b50 |
|
|
55 | /* this is the normal "magic" header we use!! */ |
34 | |
56 | |
35 | #ifdef _MSC_VER |
57 | #ifdef _MSC_VER |
36 | #pragma pack(push,1) |
58 | #pragma pack(push,1) |
37 | #endif /* _MSC_VER */ |
59 | #endif /* _MSC_VER */ |
38 | struct zip_lfh { |
60 | struct zip_lfh |
|
|
61 | { |
39 | int ziplocsig; |
62 | int ziplocsig; |
40 | short zipver; // 4 |
63 | short zipver; // 4 |
41 | short zipgenfld; // 6 |
64 | short zipgenfld; // 6 |
42 | short zipmthd; // 8 |
65 | short zipmthd; // 8 |
43 | short ziptime; // 10 |
66 | short ziptime; // 10 |
44 | short zipdate; // 12 |
67 | short zipdate; // 12 |
45 | int zipcrc; // 14 |
68 | int zipcrc; // 14 |
46 | unsigned int zipsize; // 18 |
69 | unsigned int zipsize; // 18 |
47 | unsigned int zipuncmp; // 22 |
70 | unsigned int zipuncmp; // 22 |
48 | unsigned short zipfnln; // 26 |
71 | unsigned short zipfnln; // 26 |
49 | unsigned short zipxtraln; // 30 |
72 | unsigned short zipxtraln; // 30 |
50 | char zipname[0]; // 34 |
73 | char zipname[0]; // 34 |
51 | #ifndef _MSC_VER |
74 | #ifndef _MSC_VER |
… | |
… | |
58 | #define zip_cd_sig 0x02014b50 |
81 | #define zip_cd_sig 0x02014b50 |
59 | |
82 | |
60 | #ifdef _MSC_VER |
83 | #ifdef _MSC_VER |
61 | #pragma pack(push,1) |
84 | #pragma pack(push,1) |
62 | #endif /* _MSC_VER */ |
85 | #endif /* _MSC_VER */ |
63 | struct zip_cd { |
86 | struct zip_cd |
|
|
87 | { |
64 | int zipcensig; |
88 | int zipcensig; |
65 | char zipcver; |
89 | char zipcver; |
66 | char zipcos; |
90 | char zipcos; |
67 | char zipcvxt; |
91 | char zipcvxt; |
68 | char zipcexos; |
92 | char zipcexos; |
… | |
… | |
78 | unsigned short zipccml; |
102 | unsigned short zipccml; |
79 | unsigned short zipdsk; |
103 | unsigned short zipdsk; |
80 | unsigned short zipint; |
104 | unsigned short zipint; |
81 | unsigned int zipext; |
105 | unsigned int zipext; |
82 | unsigned int zipofst; |
106 | unsigned int zipofst; |
83 | char zipcfn[0]; |
107 | char zipcfn[0]; |
84 | #ifndef _MSC_VER |
|
|
85 | }__attribute__ ((packed)); |
|
|
86 | #else /* _MSC_VER */ |
|
|
87 | }; |
|
|
88 | #pragma pack(pop) |
|
|
89 | #endif /* _MSC_VER */ |
|
|
90 | |
|
|
91 | |
|
|
92 | #ifdef _MSC_VER |
108 | #ifndef _MSC_VER |
93 | #pragma pack(push,1) |
109 | }__attribute__ ((packed)); |
94 | #endif /* _MSC_VER */ |
110 | #else /* _MSC_VER */ |
|
|
111 | }; |
|
|
112 | #pragma pack(pop) |
|
|
113 | #endif /* _MSC_VER */ |
|
|
114 | |
|
|
115 | #ifdef _MSC_VER |
|
|
116 | #pragma pack(push,1) |
|
|
117 | #endif /* _MSC_VER */ |
95 | struct zip_cd_ext { |
118 | struct zip_cd_ext |
|
|
119 | { |
96 | short tag; |
120 | short tag; |
97 | short size; |
121 | short size; |
98 | unsigned long long zipofst; |
122 | unsigned long long zipofst; |
99 | #ifndef _MSC_VER |
123 | #ifndef _MSC_VER |
100 | }__attribute__ ((packed)); |
124 | }__attribute__ ((packed)); |
… | |
… | |
104 | #endif /* _MSC_VER */ |
128 | #endif /* _MSC_VER */ |
105 | |
129 | |
106 | #ifdef _MSC_VER |
130 | #ifdef _MSC_VER |
107 | #pragma pack(push,1) |
131 | #pragma pack(push,1) |
108 | #endif /* _MSC_VER */ |
132 | #endif /* _MSC_VER */ |
109 | struct zip_enc { |
133 | struct zip_enc |
|
|
134 | { |
110 | short efield_header; |
135 | short efield_header; |
111 | short efield_size; |
136 | short efield_size; |
112 | short version; |
137 | short version; |
113 | char vendor_id1,vendor_id2; |
138 | char vendor_id1, vendor_id2; |
114 | char encryption_strength; |
139 | char encryption_strength; |
115 | short compress_method; |
140 | short compress_method; |
116 | #ifndef _MSC_VER |
141 | #ifndef _MSC_VER |
117 | }__attribute__ ((packed)); |
142 | }__attribute__ ((packed)); |
118 | #else /* _MSC_VER */ |
143 | #else /* _MSC_VER */ |
119 | }; |
144 | }; |
120 | #pragma pack(pop) |
145 | #pragma pack(pop) |
… | |
… | |
123 | #define zip_eoc_sig 0x6054b50 |
148 | #define zip_eoc_sig 0x6054b50 |
124 | |
149 | |
125 | #ifdef _MSC_VER |
150 | #ifdef _MSC_VER |
126 | #pragma pack(push,1) |
151 | #pragma pack(push,1) |
127 | #endif /* _MSC_VER */ |
152 | #endif /* _MSC_VER */ |
128 | struct zip_eoc { |
153 | struct zip_eoc |
|
|
154 | { |
129 | int zipesig; /* end of central dir signature */ |
155 | int zipesig; /* end of central dir signature */ |
130 | unsigned short zipedsk; /* number of this disk */ |
156 | unsigned short zipedsk; /* number of this disk */ |
131 | unsigned short zipecen; /* number of the disk with the start of the central directory */ |
157 | unsigned short zipecen; /* number of the disk with the start of the central directory */ |
132 | unsigned short zipenum; /* total number of entries in the central directory on this disk */ |
158 | unsigned short zipenum; /* total number of entries in the central directory on this disk */ |
133 | unsigned short zipecenn; /* total number of entries in the central directory */ |
159 | unsigned short zipecenn; /* total number of entries in the central directory */ |
134 | unsigned int zipecsz; /* size of the central directory */ |
160 | unsigned long long zipecsz; /* size of the central directory */ |
135 | unsigned int zipeofst; /* offset of start of central directory with respect to the starting disk number */ |
161 | unsigned long long zipeofst; /* offset of start of central directory with respect to the starting disk number */ |
136 | short zipecoml; /* .ZIP file comment length */ |
162 | short zipecoml; /* .ZIP file comment length */ |
137 | char zipecom[0]; /* .ZIP file comment */ |
163 | char zipecom[0]; /* .ZIP file comment */ |
138 | #ifndef _MSC_VER |
164 | #ifndef _MSC_VER |
139 | }__attribute__ ((packed)); |
165 | }__attribute__ ((packed)); |
140 | #else /* _MSC_VER */ |
166 | #else /* _MSC_VER */ |
141 | }; |
167 | }; |
142 | #pragma pack(pop) |
168 | #pragma pack(pop) |
… | |
… | |
145 | #define zip64_eoc_sig 0x6064b50 |
171 | #define zip64_eoc_sig 0x6064b50 |
146 | |
172 | |
147 | #ifdef _MSC_VER |
173 | #ifdef _MSC_VER |
148 | #pragma pack(push,1) |
174 | #pragma pack(push,1) |
149 | #endif /* _MSC_VER */ |
175 | #endif /* _MSC_VER */ |
150 | struct zip64_eoc { |
176 | struct zip64_eoc |
|
|
177 | { |
151 | int zip64esig; /* zip64 end of central dir signature */ |
178 | int zip64esig; /* zip64 end of central dir signature */ |
152 | unsigned long long zip64esize; /* size of zip64 end of central directory record */ |
179 | unsigned long long zip64esize; /* size of zip64 end of central directory record */ |
153 | unsigned short zip64ever; /* version made by */ |
180 | unsigned short zip64ever; /* version made by */ |
154 | unsigned short zip64eneed; /* version needed to extract */ |
181 | unsigned short zip64eneed; /* version needed to extract */ |
155 | unsigned int zip64edsk; /* number of this disk */ |
182 | unsigned int zip64edsk; /* number of this disk */ |
156 | unsigned int zip64ecen; /* number of the disk with the start of the central directory */ |
183 | unsigned int zip64ecen; /* number of the disk with the start of the central directory */ |
157 | unsigned long long zip64enum; /* total number of entries in the central directory on this disk */ |
184 | unsigned long long zip64enum; /* total number of entries in the central directory on this disk */ |
158 | unsigned long long zip64ecenn; /* total number of entries in the central directory */ |
185 | unsigned long long zip64ecenn; /* total number of entries in the central directory */ |
159 | unsigned long long zip64ecsz; /* size of the central directory */ |
186 | unsigned long long zip64ecsz; /* size of the central directory */ |
160 | unsigned long long zip64eofst; /* offset of start of central directory with respect to the starting disk number */ |
187 | unsigned long long zip64eofst; /* offset of start of central directory with respect to the starting disk number */ |
161 | char zip64ecom[0]; /* zip64 extensible data sector */ |
188 | char zip64ecom[0]; /* zip64 extensible data sector */ |
162 | #ifndef _MSC_VER |
189 | #ifndef _MSC_VER |
163 | }__attribute__ ((packed)); |
190 | }__attribute__ ((packed)); |
164 | #else /* _MSC_VER */ |
191 | #else /* _MSC_VER */ |
165 | }; |
192 | }; |
166 | #pragma pack(pop) |
193 | #pragma pack(pop) |
… | |
… | |
169 | #define zip64_eocl_sig 0x07064b50 |
196 | #define zip64_eocl_sig 0x07064b50 |
170 | |
197 | |
171 | #ifdef _MSC_VER |
198 | #ifdef _MSC_VER |
172 | #pragma pack(push,1) |
199 | #pragma pack(push,1) |
173 | #endif /* _MSC_VER */ |
200 | #endif /* _MSC_VER */ |
174 | struct zip64_eocl { |
201 | struct zip64_eocl |
|
|
202 | { |
175 | int zip64lsig; |
203 | int zip64lsig; |
176 | int zip64ldsk; |
204 | int zip64ldsk; |
177 | long long zip64lofst; |
205 | long long zip64lofst; |
178 | int zip74lnum; |
206 | int zip74lnum; |
179 | #ifndef _MSC_VER |
207 | #ifndef _MSC_VER |