Fix:Core:Better win32 module loading
[navit-package] / navit / zipfile.h
1 /**
2  * Navit, a modular navigation system.
3  * Copyright (C) 2005-2008 Navit Team
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library 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 Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License 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
20 #ifndef __ZIPFILE_H__
21 #ifdef HAVE_API_WIN32_CE
22 #warning OK
23 /* cegcc doesn't honor the __attribute__(packed) need pragma to work */
24 #pragma pack(push)
25 #pragma pack(1)
26 #endif
27
28 #define zip_lfh_sig 0x04034b50
29
30 struct zip_lfh {
31         int ziplocsig;
32         short zipver;
33         short zipgenfld;
34         short zipmthd;
35         short ziptime;
36         short zipdate;
37         int zipcrc;
38         unsigned int zipsize;
39         unsigned int zipuncmp;
40         unsigned short zipfnln;
41         unsigned short zipxtraln;
42         char zipname[0];
43 } __attribute__ ((packed));
44
45 #define zip_cd_sig 0x02014b50
46
47 struct zip_cd {
48         int zipcensig;
49         char zipcver;
50         char zipcos;
51         char zipcvxt;
52         char zipcexos;
53         short zipcflg;
54         short zipcmthd;
55         short ziptim;
56         short zipdat;
57         int zipccrc;
58         unsigned int zipcsiz;
59         unsigned int zipcunc;
60         unsigned short zipcfnl;
61         unsigned short zipcxtl;
62         unsigned short zipccml;
63         unsigned short zipdsk;
64         unsigned short zipint;
65         unsigned int zipext;
66         unsigned int zipofst;
67         char zipcfn[0]; 
68 } __attribute__ ((packed));
69
70 #define zip_eoc_sig 0x6054b50
71
72 struct zip_cd_ext {
73         short tag;
74         short size;
75         unsigned long long zipofst;
76 } __attribute__ ((packed));
77
78 struct zip_eoc {
79         int zipesig;
80         unsigned short zipedsk;
81         unsigned short zipecen;
82         unsigned short zipenum;
83         unsigned short zipecenn;
84         unsigned int zipecsz;
85         unsigned int zipeofst;
86         short zipecoml;
87         char zipecom[0];
88 } __attribute__ ((packed));
89
90 struct zip64_eocl {
91         int zip64lsig;
92         int zip64ldsk;
93         long long zip64lofst;
94         int zip74lnum;
95 } __attribute__ ((packed));
96
97 #define __ZIPFILE_H__
98 #ifdef __CEGCC__
99 #pragma pack(pop)
100 #endif
101
102 #endif