* doc/install.texi (Prerequisites): Refine some wording on
[official-gcc.git] / gcc / java / zipfile.h
blob17edb8754929241fd86271233fa56bc11e9d1133
1 /* Definitions for using a zipped' archive.
2 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
3 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to
19 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
22 Java and all Java-based marks are trademarks or registered trademarks
23 of Sun Microsystems, Inc. in the United States and other countries.
24 The Free Software Foundation is independent of Sun Microsystems, Inc. */
26 struct ZipFile {
27 char *name;
28 int fd;
29 long size;
30 long count;
31 long dir_size;
32 char *central_directory;
34 /* Chain together in SeenZipFiles. */
35 struct ZipFile *next;
38 typedef struct ZipFile ZipFile;
40 struct ZipDirectory {
41 int direntry_size;
42 int filename_offset;
43 int compression_method;
44 unsigned size; /* length of file */
45 unsigned uncompressed_size; /* length of uncompressed data */
46 unsigned filestart; /* start of file in archive */
47 ZipFile *zipf;
48 int filename_length;
49 /* char mid_padding[...]; */
50 /* char filename[filename_length]; */
51 /* char end_padding[...]; */
54 typedef struct ZipDirectory ZipDirectory;
56 extern struct ZipFile *SeenZipFiles;
58 #define ZIPDIR_FILENAME(ZIPD) ((char*)(ZIPD)+(ZIPD)->filename_offset)
59 #define ZIPDIR_NEXT(ZIPD) \
60 ((ZipDirectory*)((char*)(ZIPD)+(ZIPD)->direntry_size))
61 #define ZIPMAGIC 0x504b0304
63 extern ZipFile * opendir_in_zip (const char *, int);
64 extern int read_zip_archive (ZipFile *);
65 #ifdef GCC_JCF_H
66 extern int read_zip_member (JCF*, ZipDirectory*, ZipFile *);
67 extern int open_in_zip (struct JCF *, const char *, const char *, int);
68 #endif