Add PR marker for:
[official-gcc.git] / fastjar / zipfile.h
blob47aaaea92700e5c3c8c1c5f6ba640683328aa915
1 /* $Id: zipfile.h,v 1.1.1.1 1999/12/06 03:09:11 toast Exp $
3 $Log: zipfile.h,v $
4 Revision 1.1.1.1 1999/12/06 03:09:11 toast
5 initial checkin..
9 Revision 1.6 1999/05/10 08:33:08 burnsbr
10 added UNPACK_UB4 and UNPACK_UB2
12 Revision 1.5 1999/04/26 02:36:34 burnsbr
13 added LOC_EXTRA macro
15 Revision 1.4 1999/04/23 12:01:19 burnsbr
16 added more defines
22 zipfile.h - defines for indexing zipfile headers
23 Copyright (C) 1999 Bryan Burns
25 This program is free software; you can redistribute it and/or
26 modify it under the terms of the GNU General Public License
27 as published by the Free Software Foundation; either version 2
28 of the License, or (at your option) any later version.
30 This program is distributed in the hope that it will be useful,
31 but WITHOUT ANY WARRANTY; without even the implied warranty of
32 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 GNU General Public License for more details.
35 You should have received a copy of the GNU General Public License
36 along with this program; if not, write to the Free Software
37 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
40 #define LOC_EXTRA 6 /* extra bytes */
41 #define LOC_COMP 8 /* compression method */
42 #define LOC_MODTIME 10 /* last modification time */
43 #define LOC_MODDATE 12 /* last modification date */
44 #define LOC_CRC 14 /* CRC */
45 #define LOC_CSIZE 18 /* compressed size */
46 #define LOC_USIZE 22 /* uncompressed size */
47 #define LOC_FNLEN 26 /* filename length */
48 #define LOC_EFLEN 28 /* extra-field length */
50 #define CEN_FLAGS 8
51 #define CEN_COMP 10 /* compression method */
52 #define CEN_MODTIME 12
53 #define CEN_MODDATE 14
54 #define CEN_CRC 16
55 #define CEN_CSIZE 20
56 #define CEN_USIZE 24
57 #define CEN_FNLEN 28
58 #define CEN_EFLEN 30
59 #define CEN_COMLEN 32
60 #define CEN_OFFSET 42
63 /* macros */
64 #define PACK_UB4(d, o, v) d[o] = (ub1)((v) & 0x000000ff); \
65 d[o + 1] = (ub1)(((v) & 0x0000ff00) >> 8); \
66 d[o + 2] = (ub1)(((v) & 0x00ff0000) >> 16); \
67 d[o + 3] = (ub1)(((v) & 0xff000000) >> 24)
69 #define PACK_UB2(d, o, v) d[o] = (ub1)((v) & 0x00ff); \
70 d[o + 1] = (ub1)(((v) & 0xff00) >> 8)
72 #define UNPACK_UB4(s, o) (ub4)s[o] + (((ub4)s[o + 1]) << 8) +\
73 (((ub4)s[o + 2]) << 16) + (((ub4)s[o + 3]) << 24)
75 #define UNPACK_UB2(s, o) (ub2)s[o] + (((ub2)s[o + 1]) << 8)