Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / java / zipfile.h
blobd78226a495cbf83c27e2cdfa956e5005044a325a
1 /* Definitions for using a zipped' archive.
2 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2007
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 3, 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 COPYING3. If not see
19 <http://www.gnu.org/licenses/>.
21 Java and all Java-based marks are trademarks or registered trademarks
22 of Sun Microsystems, Inc. in the United States and other countries.
23 The Free Software Foundation is independent of Sun Microsystems, Inc. */
25 struct ZipFile {
26 char *name;
27 int fd;
28 long size;
29 long count;
30 long dir_size;
31 char *central_directory;
33 /* Chain together in SeenZipFiles. */
34 struct ZipFile *next;
37 typedef struct ZipFile ZipFile;
39 struct ZipDirectory {
40 int direntry_size;
41 int filename_offset;
42 int compression_method;
43 unsigned size; /* length of file */
44 unsigned uncompressed_size; /* length of uncompressed data */
45 unsigned filestart; /* start of file in archive */
46 ZipFile *zipf;
47 int filename_length;
48 /* char mid_padding[...]; */
49 /* char filename[filename_length]; */
50 /* char end_padding[...]; */
53 typedef struct ZipDirectory ZipDirectory;
55 extern struct ZipFile *SeenZipFiles;
57 #define ZIPDIR_FILENAME(ZIPD) ((char*)(ZIPD)+(ZIPD)->filename_offset)
58 #define ZIPDIR_NEXT(ZIPD) \
59 ((ZipDirectory*)((char*)(ZIPD)+(ZIPD)->direntry_size))
60 #define ZIPMAGIC 0x504b0304
61 #define ZIPEMPTYMAGIC 0x504b0506
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