source: trunk/src/gcc/fastjar/zipfile.h@ 2

Last change on this file since 2 was 2, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 2.5 KB
Line 
1/* $Id: zipfile.h,v 1.1 2000/12/09 03:08:23 apbianco Exp $
2
3 $Log: zipfile.h,v $
4 Revision 1.1 2000/12/09 03:08:23 apbianco
5 2000-12-08 Alexandre Petit-Bianco <apbianco@cygnus.com>
6
7 * fastjar: Imported.
8
9 Revision 1.1.1.1 1999/12/06 03:09:11 toast
10 initial checkin..
11
12
13
14 Revision 1.6 1999/05/10 08:33:08 burnsbr
15 added UNPACK_UB4 and UNPACK_UB2
16
17 Revision 1.5 1999/04/26 02:36:34 burnsbr
18 added LOC_EXTRA macro
19
20 Revision 1.4 1999/04/23 12:01:19 burnsbr
21 added more defines
22
23
24*/
25
26/*
27 zipfile.h - defines for indexing zipfile headers
28 Copyright (C) 1999 Bryan Burns
29
30 This program is free software; you can redistribute it and/or
31 modify it under the terms of the GNU General Public License
32 as published by the Free Software Foundation; either version 2
33 of the License, or (at your option) any later version.
34
35 This program is distributed in the hope that it will be useful,
36 but WITHOUT ANY WARRANTY; without even the implied warranty of
37 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 GNU General Public License for more details.
39
40 You should have received a copy of the GNU General Public License
41 along with this program; if not, write to the Free Software
42 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
43 */
44
45#define LOC_EXTRA 6 /* extra bytes */
46#define LOC_COMP 8 /* compression method */
47#define LOC_MODTIME 10 /* last modification time */
48#define LOC_MODDATE 12 /* last modification date */
49#define LOC_CRC 14 /* CRC */
50#define LOC_CSIZE 18 /* compressed size */
51#define LOC_USIZE 22 /* uncompressed size */
52#define LOC_FNLEN 26 /* filename length */
53#define LOC_EFLEN 28 /* extra-field length */
54
55#define CEN_COMP 10 /* compression method */
56#define CEN_MODTIME 12
57#define CEN_MODDATE 14
58#define CEN_CRC 16
59#define CEN_CSIZE 20
60#define CEN_USIZE 24
61#define CEN_FNLEN 28
62#define CEN_EFLEN 30
63#define CEN_COMLEN 32
64#define CEN_OFFSET 42
65
66
67/* macros */
68#define PACK_UB4(d, o, v) d[o] = (ub1)((v) & 0x000000ff); \
69 d[o + 1] = (ub1)(((v) & 0x0000ff00) >> 8); \
70 d[o + 2] = (ub1)(((v) & 0x00ff0000) >> 16); \
71 d[o + 3] = (ub1)(((v) & 0xff000000) >> 24)
72
73#define PACK_UB2(d, o, v) d[o] = (ub1)((v) & 0x00ff); \
74 d[o + 1] = (ub1)(((v) & 0xff00) >> 8)
75
76#define UNPACK_UB4(s, o) (ub4)s[o] + (((ub4)s[o + 1]) << 8) +\
77 (((ub4)s[o + 2]) << 16) + (((ub4)s[o + 3]) << 24)
78
79#define UNPACK_UB2(s, o) (ub2)s[o] + (((ub2)s[o + 1]) << 8)
Note: See TracBrowser for help on using the repository browser.