1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
11 * Certain constants and structures for
12 * the Phil Katz ZIP archive format.
16 typedef struct ZipLocal_
18 unsigned char signature
[4];
19 unsigned char word
[2];
20 unsigned char bitflag
[2];
21 unsigned char method
[2];
22 unsigned char time
[2];
23 unsigned char date
[2];
24 unsigned char crc32
[4];
25 unsigned char size
[4];
26 unsigned char orglen
[4];
27 unsigned char filename_len
[2];
28 unsigned char extrafield_len
[2];
32 * 'sizeof(struct XXX)' includes padding on ARM (see bug 87965)
33 * As the internals of a jar/zip file must not depend on the target
34 * architecture (i386, ppc, ARM, ...), use a fixed value instead.
36 #define ZIPLOCAL_SIZE (4+2+2+2+2+2+4+4+4+2+2)
38 typedef struct ZipCentral_
40 unsigned char signature
[4];
41 unsigned char version_made_by
[2];
42 unsigned char version
[2];
43 unsigned char bitflag
[2];
44 unsigned char method
[2];
45 unsigned char time
[2];
46 unsigned char date
[2];
47 unsigned char crc32
[4];
48 unsigned char size
[4];
49 unsigned char orglen
[4];
50 unsigned char filename_len
[2];
51 unsigned char extrafield_len
[2];
52 unsigned char commentfield_len
[2];
53 unsigned char diskstart_number
[2];
54 unsigned char internal_attributes
[2];
55 unsigned char external_attributes
[4];
56 unsigned char localhdr_offset
[4];
60 * 'sizeof(struct XXX)' includes padding on ARM (see bug 87965)
61 * As the internals of a jar/zip file must not depend on the target
62 * architecture (i386, ppc, ARM, ...), use a fixed value instead.
64 #define ZIPCENTRAL_SIZE (4+2+2+2+2+2+2+4+4+4+2+2+2+2+2+4+4)
66 typedef struct ZipEnd_
68 unsigned char signature
[4];
69 unsigned char disk_nr
[2];
70 unsigned char start_central_dir
[2];
71 unsigned char total_entries_disk
[2];
72 unsigned char total_entries_archive
[2];
73 unsigned char central_dir_size
[4];
74 unsigned char offset_central_dir
[4];
75 unsigned char commentfield_len
[2];
79 * 'sizeof(struct XXX)' includes padding on ARM (see bug 87965)
80 * As the internals of a jar/zip file must not depend on the target
81 * architecture (i386, ppc, ARM, ...), use a fixed value instead.
83 #define ZIPEND_SIZE (4+2+2+2+2+4+4+2)
86 #define LOCALSIG 0x04034B50l
87 #define CENTRALSIG 0x02014B50l
88 #define ENDSIG 0x06054B50l
91 #define EXTENDED_TIMESTAMP_FIELD 0x5455
92 #define EXTENDED_TIMESTAMP_MODTIME 0x01
94 /* compression methods */
104 #define UNSUPPORTED 0xFF
107 #endif /* _zipstruct_h */