1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is Mozilla Communicator client code, released
18 * The Initial Developer of the Original Code is
19 * Netscape Communications Corporation.
20 * Portions created by the Initial Developer are Copyright (C) 1998-1999
21 * the Initial Developer. All Rights Reserved.
24 * Daniel Veditz <dveditz@netscape.com>
25 * Jeroen Dobbelaere <jeroen.dobbelaere@acunia.com>
27 * Alternatively, the contents of this file may be used under the terms of
28 * either the GNU General Public License Version 2 or later (the "GPL"), or
29 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 * in which case the provisions of the GPL or the LGPL are applicable instead
31 * of those above. If you wish to allow use of your version of this file only
32 * under the terms of either the GPL or the LGPL, and not to allow others to
33 * use your version of this file under the terms of the MPL, indicate your
34 * decision by deleting the provisions above and replace them with the notice
35 * and other provisions required by the GPL or the LGPL. If you do not delete
36 * the provisions above, a recipient may use your version of this file under
37 * the terms of any one of the MPL, the GPL or the LGPL.
39 * ***** END LICENSE BLOCK ***** */
46 * Certain constants and structures for
47 * the Phil Katz ZIP archive format.
51 typedef struct ZipLocal_
53 unsigned char signature
[4];
54 unsigned char word
[2];
55 unsigned char bitflag
[2];
56 unsigned char method
[2];
57 unsigned char time
[2];
58 unsigned char date
[2];
59 unsigned char crc32
[4];
60 unsigned char size
[4];
61 unsigned char orglen
[4];
62 unsigned char filename_len
[2];
63 unsigned char extrafield_len
[2];
67 * 'sizeof(struct XXX)' includes padding on ARM (see bug 87965)
68 * As the internals of a jar/zip file must not depend on the target
69 * architecture (i386, ppc, ARM, ...), use a fixed value instead.
71 #define ZIPLOCAL_SIZE (4+2+2+2+2+2+4+4+4+2+2)
73 typedef struct ZipCentral_
75 unsigned char signature
[4];
76 unsigned char version_made_by
[2];
77 unsigned char version
[2];
78 unsigned char bitflag
[2];
79 unsigned char method
[2];
80 unsigned char time
[2];
81 unsigned char date
[2];
82 unsigned char crc32
[4];
83 unsigned char size
[4];
84 unsigned char orglen
[4];
85 unsigned char filename_len
[2];
86 unsigned char extrafield_len
[2];
87 unsigned char commentfield_len
[2];
88 unsigned char diskstart_number
[2];
89 unsigned char internal_attributes
[2];
90 unsigned char external_attributes
[4];
91 unsigned char localhdr_offset
[4];
95 * 'sizeof(struct XXX)' includes padding on ARM (see bug 87965)
96 * As the internals of a jar/zip file must not depend on the target
97 * architecture (i386, ppc, ARM, ...), use a fixed value instead.
99 #define ZIPCENTRAL_SIZE (4+2+2+2+2+2+2+4+4+4+2+2+2+2+2+4+4)
101 typedef struct ZipEnd_
103 unsigned char signature
[4];
104 unsigned char disk_nr
[2];
105 unsigned char start_central_dir
[2];
106 unsigned char total_entries_disk
[2];
107 unsigned char total_entries_archive
[2];
108 unsigned char central_dir_size
[4];
109 unsigned char offset_central_dir
[4];
110 unsigned char commentfield_len
[2];
114 * 'sizeof(struct XXX)' includes padding on ARM (see bug 87965)
115 * As the internals of a jar/zip file must not depend on the target
116 * architecture (i386, ppc, ARM, ...), use a fixed value instead.
118 #define ZIPEND_SIZE (4+2+2+2+2+4+4+2)
121 #define LOCALSIG 0x04034B50l
122 #define CENTRALSIG 0x02014B50l
123 #define ENDSIG 0x06054B50l
125 /* compression methods */
135 #define UNSUPPORTED 0xFF
138 #endif /* _zipstruct_h */