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_split_sig 0x08074b50
35#define zip_split_sig_rev 0x504b0708
36
37struct zip_split {
39};
40
41#define zip_lfh_sig 0x04034b50
42#define zip_lfh_sig_rev 0x504b0304
43
44
46
49struct zip_lfh {
51 short zipver;
52 short zipgenfld;
53 short zipmthd;
54 short ziptime;
55 short zipdate;
56 int zipcrc;
57 unsigned int zipsize;
58 unsigned int zipuncmp;
59 unsigned short zipfnln;
60 unsigned short zipxtraln;
61 char zipname[0];
63
64#define zip_cd_sig 0x02014b50
65#define zip_cd_sig_rev 0x504b0102
66
68
71struct zip_cd {
73 char zipcver;
74 char zipcos;
75 char zipcvxt;
76 char zipcexos;
77 short zipcflg;
78 short zipcmthd;
79 short ziptim;
80 short zipdat;
81 int zipccrc;
82 unsigned int zipcsiz;
83 unsigned int zipcunc;
84 unsigned short zipcfnl;
85 unsigned short zipcxtl;
86 unsigned short zipccml;
87 unsigned short zipdsk;
88 unsigned short zipint;
89 unsigned int zipext;
90 unsigned int zipofst;
91 char zipcfn[0];
93
99#define zip_size_64bit_placeholder 0xffffffff
100
104#define zip_extra_header_id_zip64 0x0001
105
107
111 short tag;
112 short size;
113 unsigned long long zipofst;
115
124
125#define zip_eoc_sig 0x6054b50
126#define zip_eoc_sig_rev 0x504b0506
127
129
132struct zip_eoc {
133 int zipesig; /* end of central dir signature */
134 unsigned short zipedsk; /* number of this disk */
135 unsigned short zipecen; /* number of the disk with the start of the central directory */
136 unsigned short zipenum; /* total number of entries in the central directory on this disk */
137 unsigned short zipecenn; /* total number of entries in the central directory */
138 unsigned int zipecsz; /* size of the central directory */
139 unsigned int zipeofst; /* offset of start of central directory with respect to the starting disk number */
140 short zipecoml; /* .ZIP file comment length */
141 char zipecom[0]; /* .ZIP file comment */
143
144#define zip64_eoc_sig 0x6064b50
145#define zip64_eoc_sig_rev 0x504b0606
146
147struct zip64_eoc {
148 int zip64esig; /* zip64 end of central dir signature */
149 unsigned long long zip64esize; /* size of zip64 end of central directory record */
150 unsigned short zip64ever; /* version made by */
151 unsigned short zip64eneed; /* version needed to extract */
152 unsigned int zip64edsk; /* number of this disk */
153 unsigned int zip64ecen; /* number of the disk with the start of the central directory */
154 unsigned long long zip64enum; /* total number of entries in the central directory on this disk */
155 unsigned long long zip64ecenn; /* total number of entries in the central directory */
156 unsigned long long zip64ecsz; /* size of the central directory */
157 unsigned long long zip64eofst; /* offset of start of central directory with respect to the starting disk number */
158 char zip64ecom[0]; /* zip64 extensible data sector */
160
161#define zip64_eocl_sig 0x07064b50
162
169
171 int x[sizeof(struct zip_cd) == 46 ? 1:-1];
172};
173
174#ifdef HAVE_PRAGMA_PACK
175#pragma pack(pop)
176#endif
177#endif
Definition zipfile.h:147
unsigned int zip64ecen
Definition zipfile.h:153
unsigned long long zip64ecenn
Definition zipfile.h:155
unsigned short zip64ever
Definition zipfile.h:150
unsigned long long zip64eofst
Definition zipfile.h:157
int zip64esig
Definition zipfile.h:148
unsigned long long zip64esize
Definition zipfile.h:149
unsigned short zip64eneed
Definition zipfile.h:151
unsigned int zip64edsk
Definition zipfile.h:152
unsigned long long zip64ecsz
Definition zipfile.h:156
char zip64ecom[0]
Definition zipfile.h:158
unsigned long long zip64enum
Definition zipfile.h:154
Definition zipfile.h:163
int zip64ldsk
Definition zipfile.h:165
int zip74lnum
Definition zipfile.h:167
long long zip64lofst
Definition zipfile.h:166
int zip64lsig
Definition zipfile.h:164
Definition zipfile.h:170
int x[sizeof(struct zip_cd)==46 ? 1:-1]
Definition zipfile.h:171
ZIP extra field structure.
Definition zipfile.h:110
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:113
short size
extra field data size
Definition zipfile.h:112
short tag
extra field header ID
Definition zipfile.h:111
ZIP central directory structure.
Definition zipfile.h:71
unsigned int zipcunc
file size (uncompressed)
Definition zipfile.h:83
unsigned int zipext
external attributes
Definition zipfile.h:89
char zipcfn[0]
file name (length as given above)
Definition zipfile.h:91
unsigned int zipcsiz
file size (after compression)
Definition zipfile.h:82
unsigned int zipofst
offset to start of local file header
Definition zipfile.h:90
unsigned short zipccml
comment length
Definition zipfile.h:86
int zipcensig
central directory signature
Definition zipfile.h:72
short zipcflg
general purpose flag
Definition zipfile.h:77
char zipcvxt
minimum zip spec version needed to extract
Definition zipfile.h:75
char zipcos
os compatibility of the file attribute information
Definition zipfile.h:74
unsigned short zipcfnl
file name length
Definition zipfile.h:84
unsigned short zipcxtl
extra field length
Definition zipfile.h:85
unsigned short zipdsk
disk number of file
Definition zipfile.h:87
unsigned short zipint
internal attributes
Definition zipfile.h:88
short zipcmthd
compression method
Definition zipfile.h:78
short ziptim
file modification time
Definition zipfile.h:79
int zipccrc
CRC-32 checksum.
Definition zipfile.h:81
char zipcver
zip spec version of creating software
Definition zipfile.h:73
short zipdat
file modification date
Definition zipfile.h:80
char zipcexos
unused (?)
Definition zipfile.h:76
Definition zipfile.h:116
short compress_method
Definition zipfile.h:122
short version
Definition zipfile.h:119
short efield_header
Definition zipfile.h:117
char vendor_id1
Definition zipfile.h:120
char vendor_id2
Definition zipfile.h:120
char encryption_strength
Definition zipfile.h:121
short efield_size
Definition zipfile.h:118
ZIP end of central directory structure.
Definition zipfile.h:132
unsigned short zipecen
Definition zipfile.h:135
short zipecoml
Definition zipfile.h:140
unsigned int zipeofst
Definition zipfile.h:139
unsigned short zipecenn
Definition zipfile.h:137
unsigned short zipedsk
Definition zipfile.h:134
unsigned short zipenum
Definition zipfile.h:136
unsigned int zipecsz
Definition zipfile.h:138
char zipecom[0]
Definition zipfile.h:141
int zipesig
Definition zipfile.h:133
ZIP local file header structure.
Definition zipfile.h:49
unsigned short zipfnln
file name length
Definition zipfile.h:59
short zipmthd
compression method
Definition zipfile.h:53
unsigned int zipsize
file size (after compression)
Definition zipfile.h:57
char zipname[0]
file name (length as given above)
Definition zipfile.h:61
unsigned short zipxtraln
extra filed length (unused?)
Definition zipfile.h:60
int ziplocsig
local file header signature
Definition zipfile.h:50
unsigned int zipuncmp
file size (uncompressed)
Definition zipfile.h:58
int zipcrc
CRC-32 checksum.
Definition zipfile.h:56
short zipver
minimum zip spec version needed to extract
Definition zipfile.h:51
short ziptime
file modification time
Definition zipfile.h:54
short zipdate
file modification date
Definition zipfile.h:55
short zipgenfld
general purpose flags
Definition zipfile.h:52
Definition zipfile.h:37
int zipsplitsig
Definition zipfile.h:38
#define ATTRIBUTE_PACKED
Definition zipfile.h:31