1 /* src/vmcore/zip.c - ZIP file handling for bootstrap classloader
3 Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
34 #include "toolbox/hashtable.h"
36 #include "vm/global.h"
38 #include "vmcore/class.h"
39 #include "vmcore/loader.h"
40 #include "vmcore/suck.h"
41 #include "vmcore/utf8.h"
44 /* Local file header ***********************************************************
46 local file header signature 4 bytes (0x04034b50)
47 version needed to extract 2 bytes
48 general purpose bit flag 2 bytes
49 compression method 2 bytes
50 last mod file time 2 bytes
51 last mod file date 2 bytes
53 compressed size 4 bytes
54 uncompressed size 4 bytes
55 file name length 2 bytes
56 extra field length 2 bytes
58 file name (variable size)
59 extra field (variable size)
61 *******************************************************************************/
63 #define LFH_HEADER_SIZE 30
65 #define LFH_SIGNATURE 0x04034b50
66 #define LFH_FILE_NAME_LENGTH 26
67 #define LFH_EXTRA_FIELD_LENGTH 28
69 typedef struct lfh lfh;
79 /* hashtable_zipfile_entry ****************************************************/
81 typedef struct hashtable_zipfile_entry hashtable_zipfile_entry;
83 struct hashtable_zipfile_entry {
89 hashtable_zipfile_entry *hashlink;
93 /* function prototypes ********************************************************/
95 hashtable *zip_open(char *path);
96 hashtable_zipfile_entry *zip_find(list_classpath_entry *lce, utf *u);
97 classbuffer *zip_get(list_classpath_entry *lce, classinfo *c);
102 * These are local overrides for various environment variables in Emacs.
103 * Please do not remove this and leave it at the end of the file, where
104 * Emacs will automagically detect them.
105 * ---------------------------------------------------------------------
108 * indent-tabs-mode: t