3261N/A * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A * Prototypes for zip file support 0N/A * Header sizes including signatures 0N/A * Header field access macros 0N/A#
define CH(b, n) (((
unsigned char *)(b))[n])
0N/A#
define SH(b, n) (
CH(b, n) | (
CH(b, n+
1) <<
8))
1032N/A#
define LG(b, n) ((
SH(b, n) | (
SH(b, n+
2) <<
16)) &
0xffffffffUL)
0N/A * Macros for getting local file (LOC) header fields 0N/A#
define LOCVER(b)
SH(b,
4)
/* version needed to extract */ 0N/A#
define LOCFLG(b)
SH(b,
6)
/* general purpose bit flags */ 0N/A#
define LOCCRC(b)
LG(b,
14)
/* crc of uncompressed data */ 0N/A#
define LOCLEN(b)
LG(b,
22)
/* uncompressed data size */ 0N/A * Macros for getting extra local (EXT) header fields 0N/A#
define EXTCRC(b)
LG(b,
4)
/* crc of uncompressed data */ 0N/A * Macros for getting central directory header (CEN) fields 0N/A#
define CENVER(b)
SH(b,
6)
/* version needed to extract */ 0N/A#
define CENFLG(b)
SH(b,
8)
/* general purpose bit flags */ 0N/A#
define CENCRC(b)
LG(b,
16)
/* crc of uncompressed data */ 0N/A#
define CENATT(b)
SH(b,
36)
/* internal file attributes */ 0N/A#
define CENATX(b)
LG(b,
38)
/* external file attributes */ 0N/A#
define CENOFF(b)
LG(b,
42)
/* offset of local header */ 0N/A * Macros for getting end of central directory header (END) fields 0N/A#
define ENDSUB(b)
SH(b,
8)
/* number of entries on this disk */ 0N/A#
define ENDTOT(b)
SH(b,
10)
/* total number of entries */ 0N/A#
define ENDSIZ(b)
LG(b,
12)
/* central directory size */ 0N/A#
define ENDOFF(b)
LG(b,
16)
/* central directory offset */ 0N/A#
define ENDCOM(b)
SH(b,
20)
/* size of zip file comment */ 1032N/A * Macros for getting Zip64 end of central directory header fields 1032N/A * Macros for getting Zip64 end of central directory locator fields 0N/A * Supported compression methods 0N/A * Support for reading ZIP/JAR files. Some things worth noting: 0N/A * - Zip file entries larger than 2**32 bytes are not supported. 0N/A * - jzentry time and crc fields are signed even though they really 0N/A * represent unsigned quantities. 0N/A * - If csize is zero then the entry is uncompressed. 0N/A * - If extra != 0 then the first two bytes are the length of the extra 0N/A * data in intel byte order. 0N/A * - If pos <= 0 then it is the position of entry LOC header. 0N/A * If pos > 0 then it is the position of entry data. 0N/A * pos should not be accessed directly, but only by ZIP_GetEntryDataOffset. 0N/A jlong csize;
/* size of compressed data (zero if uncompressed) */ 0N/A * In-memory hash table cell. 0N/A * In a typical system we have a *lot* of these, as we have one for 0N/A * every entry in every active JAR. 0N/A * Note that in order to save space we don't keep the name in memory, 0N/A * but merely remember a 32 bit hash. 0N/A unsigned int hash;
/* 32 bit hashcode on name */ 5840N/A unsigned int next;
/* hash chain: index into jzfile->entries */ 0N/A char *
data;
/* A cached page of CEN headers */ 0N/A * Use ZFILE to represent access to a file in a platform-indepenent 0N/A * Descriptor for a ZIP file. 0N/A unsigned char *
maddr;
/* beginning address of the CEN & ENDHDR */ 0N/A start of the file. */ 0N/A char *
msg;
/* zip error message */ 0N/A /* Information on metadata names in META-INF directory */ 0N/A char **
metanames;
/* array of meta names (may have null names) */ 0N/A * Index representing end of hash chain 0N/A#
endif /* !_ZIP_H_ */