navit 0.5.3-trunk
Loading...
Searching...
No Matches
zipfile.h
Go to the documentation of this file.
1
20#ifndef __ZIPFILE_H__
21#define __ZIPFILE_H__
22
23#ifdef HAVE_PRAGMA_PACK
24# pragma pack(push)
25# pragma pack(1)
26#endif
27
28#ifdef __GNUC__
29# define ATTRIBUTE_PACKED __attribute__((packed))
30#else
31# define ATTRIBUTE_PACKED
32#endif
33
34#define ZIP_COMPRESSION_STORED 0
35#define ZIP_COMPRESSION_DEFLATE 8
36#define ZIP_COMPRESSION_LZMA 14
37
38#define zip_split_sig 0x08074b50
39#define zip_split_sig_rev 0x504b0708
40
41struct zip_split {
43};
44
45#define zip_lfh_sig 0x04034b50
46#define zip_lfh_sig_rev 0x504b0304
47
49
52struct zip_lfh {
54 short zipver;
55 short zipgenfld;
56 short zipmthd;
57 short ziptime;
58 short zipdate;
59 int zipcrc;
60 unsigned int zipsize;
61 unsigned int zipuncmp;
62 unsigned short zipfnln;
63 unsigned short zipxtraln;
64 char zipname[0];
66
67#define zip_cd_sig 0x02014b50
68#define zip_cd_sig_rev 0x504b0102
69
71
74struct zip_cd {
76 char zipcver;
77 char zipcos;
78 char zipcvxt;
79 char zipcexos;
80 short zipcflg;
81 short zipcmthd;
82 short ziptim;
83 short zipdat;
84 int zipccrc;
85 unsigned int zipcsiz;
86 unsigned int zipcunc;
87 unsigned short zipcfnl;
88 unsigned short zipcxtl;
89 unsigned short zipccml;
90 unsigned short zipdsk;
91 unsigned short zipint;
92 unsigned int zipext;
93 unsigned int zipofst;
94 char zipcfn[0];
96
102#define zip_size_64bit_placeholder 0xffffffff
103
107#define zip_extra_header_id_zip64 0x0001
108
110
114 short tag;
115 short size;
116 unsigned long long
119
128
129#define zip_eoc_sig 0x6054b50
130#define zip_eoc_sig_rev 0x504b0506
131
133
136struct zip_eoc {
137 int zipesig; /* end of central dir signature */
138 unsigned short zipedsk; /* number of this disk */
139 unsigned short zipecen; /* number of the disk with the start of the central directory */
140 unsigned short zipenum; /* total number of entries in the central directory on this disk */
141 unsigned short zipecenn; /* total number of entries in the central directory */
142 unsigned int zipecsz; /* size of the central directory */
143 unsigned int zipeofst; /* offset of start of central directory with respect to the starting disk number */
144 short zipecoml; /* .ZIP file comment length */
145 char zipecom[0]; /* .ZIP file comment */
147
148#define zip64_eoc_sig 0x6064b50
149#define zip64_eoc_sig_rev 0x504b0606
150
151struct zip64_eoc {
152 int zip64esig; /* zip64 end of central dir signature */
153 unsigned long long zip64esize; /* size of zip64 end of central directory record */
154 unsigned short zip64ever; /* version made by */
155 unsigned short zip64eneed; /* version needed to extract */
156 unsigned int zip64edsk; /* number of this disk */
157 unsigned int zip64ecen; /* number of the disk with the start of the central directory */
158 unsigned long long zip64enum; /* total number of entries in the central directory on this disk */
159 unsigned long long zip64ecenn; /* total number of entries in the central directory */
160 unsigned long long zip64ecsz; /* size of the central directory */
161 unsigned long long zip64eofst; /* offset of start of central directory with respect to the starting disk number */
162 char zip64ecom[0]; /* zip64 extensible data sector */
164
165#define zip64_eocl_sig 0x07064b50
166
173
175 int x[sizeof(struct zip_cd) == 46 ? 1 : -1];
176};
177
178#ifdef HAVE_PRAGMA_PACK
179# pragma pack(pop)
180#endif
181#endif
Definition zipfile.h:151
unsigned int zip64ecen
Definition zipfile.h:157
unsigned long long zip64ecenn
Definition zipfile.h:159
unsigned short zip64ever
Definition zipfile.h:154
unsigned long long zip64eofst
Definition zipfile.h:161
int zip64esig
Definition zipfile.h:152
unsigned long long zip64esize
Definition zipfile.h:153
unsigned short zip64eneed
Definition zipfile.h:155
unsigned int zip64edsk
Definition zipfile.h:156
unsigned long long zip64ecsz
Definition zipfile.h:160
char zip64ecom[0]
Definition zipfile.h:162
unsigned long long zip64enum
Definition zipfile.h:158
Definition zipfile.h:167
int zip64ldsk
Definition zipfile.h:169
int zip74lnum
Definition zipfile.h:171
long long zip64lofst
Definition zipfile.h:170
int zip64lsig
Definition zipfile.h:168
Definition zipfile.h:174
int x[sizeof(struct zip_cd)==46 ? 1 :-1]
Definition zipfile.h:175
ZIP extra field structure.
Definition zipfile.h:113
unsigned long long zipofst
offset to start of local file header (only valid if the struct is for a ZIP64 extra field)
Definition zipfile.h:117
short size
extra field data size
Definition zipfile.h:115
short tag
extra field header ID
Definition zipfile.h:114
ZIP central directory structure.
Definition zipfile.h:74
unsigned int zipcunc
file size (uncompressed)
Definition zipfile.h:86
unsigned int zipext
external attributes
Definition zipfile.h:92
char zipcfn[0]
file name (length as given above)
Definition zipfile.h:94
unsigned int zipcsiz
file size (after compression)
Definition zipfile.h:85
unsigned int zipofst
offset to start of local file header
Definition zipfile.h:93
unsigned short zipccml
comment length
Definition zipfile.h:89
int zipcensig
central directory signature
Definition zipfile.h:75
short zipcflg
general purpose flag
Definition zipfile.h:80
char zipcvxt
minimum zip spec version needed to extract
Definition zipfile.h:78
char zipcos
os compatibility of the file attribute information
Definition zipfile.h:77
unsigned short zipcfnl
file name length
Definition zipfile.h:87
unsigned short zipcxtl
extra field length
Definition zipfile.h:88
unsigned short zipdsk
disk number of file
Definition zipfile.h:90
unsigned short zipint
internal attributes
Definition zipfile.h:91
short zipcmthd
compression method
Definition zipfile.h:81
short ziptim
file modification time
Definition zipfile.h:82
int zipccrc
CRC-32 checksum.
Definition zipfile.h:84
char zipcver
zip spec version of creating software
Definition zipfile.h:76
short zipdat
file modification date
Definition zipfile.h:83
char zipcexos
unused (?)
Definition zipfile.h:79
Definition zipfile.h:120
short compress_method
Definition zipfile.h:126
short version
Definition zipfile.h:123
short efield_header
Definition zipfile.h:121
char vendor_id1
Definition zipfile.h:124
char vendor_id2
Definition zipfile.h:124
char encryption_strength
Definition zipfile.h:125
short efield_size
Definition zipfile.h:122
ZIP end of central directory structure.
Definition zipfile.h:136
unsigned short zipecen
Definition zipfile.h:139
short zipecoml
Definition zipfile.h:144
unsigned int zipeofst
Definition zipfile.h:143
unsigned short zipecenn
Definition zipfile.h:141
unsigned short zipedsk
Definition zipfile.h:138
unsigned short zipenum
Definition zipfile.h:140
unsigned int zipecsz
Definition zipfile.h:142
char zipecom[0]
Definition zipfile.h:145
int zipesig
Definition zipfile.h:137
ZIP local file header structure.
Definition zipfile.h:52
unsigned short zipfnln
file name length
Definition zipfile.h:62
short zipmthd
compression method
Definition zipfile.h:56
unsigned int zipsize
file size (after compression)
Definition zipfile.h:60
char zipname[0]
file name (length as given above)
Definition zipfile.h:64
unsigned short zipxtraln
extra filed length (unused?)
Definition zipfile.h:63
int ziplocsig
local file header signature
Definition zipfile.h:53
unsigned int zipuncmp
file size (uncompressed)
Definition zipfile.h:61
int zipcrc
CRC-32 checksum.
Definition zipfile.h:59
short zipver
minimum zip spec version needed to extract
Definition zipfile.h:54
short ziptime
file modification time
Definition zipfile.h:57
short zipdate
file modification date
Definition zipfile.h:58
short zipgenfld
general purpose flags
Definition zipfile.h:55
Definition zipfile.h:41
int zipsplitsig
Definition zipfile.h:42
#define ATTRIBUTE_PACKED
Definition zipfile.h:31