* src/vm/jit/asmpart.h (vm/linker.h): Removed.
[cacao.git] / src / vm / zip.h
1 /* src/vm/zip.c - ZIP file handling for bootstrap classloader
2
3    Copyright (C) 1996-2005, 2006, 2007, 2008
4    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5
6    This file is part of CACAO.
7
8    This program is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License as
10    published by the Free Software Foundation; either version 2, or (at
11    your option) any later version.
12
13    This program is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21    02110-1301, USA.
22
23 */
24
25
26 #ifndef _ZIP_H
27 #define _ZIP_H
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #include "config.h"
34 #include "vm/types.h"
35
36 #include "toolbox/hashtable.h"
37
38 #include "vm/class.h"
39 #include "vm/global.h"
40 #include "vm/loader.h"
41 #include "vm/suck.h"
42 #include "vm/utf8.h"
43
44
45 /* Local file header ***********************************************************
46
47    local file header signature     4 bytes  (0x04034b50)
48    version needed to extract       2 bytes
49    general purpose bit flag        2 bytes
50    compression method              2 bytes
51    last mod file time              2 bytes
52    last mod file date              2 bytes
53    crc-32                          4 bytes
54    compressed size                 4 bytes
55    uncompressed size               4 bytes
56    file name length                2 bytes
57    extra field length              2 bytes
58
59    file name (variable size)
60    extra field (variable size)
61
62 *******************************************************************************/
63
64 #define LFH_HEADER_SIZE              30
65
66 #define LFH_SIGNATURE                0x04034b50
67 #define LFH_FILE_NAME_LENGTH         26
68 #define LFH_EXTRA_FIELD_LENGTH       28
69
70 typedef struct lfh lfh;
71
72 struct lfh {
73         u2 compressionmethod;
74         u4 compressedsize;
75         u4 uncompressedsize;
76         u2 filenamelength;
77         u2 extrafieldlength;
78 };
79
80 /* hashtable_zipfile_entry ****************************************************/
81
82 typedef struct hashtable_zipfile_entry hashtable_zipfile_entry;
83
84 struct hashtable_zipfile_entry {
85         utf                     *filename;
86         u2                       compressionmethod;
87         u4                       compressedsize;
88         u4                       uncompressedsize;
89         u1                      *data;
90         hashtable_zipfile_entry *hashlink;
91 };
92
93
94 /* function prototypes ********************************************************/
95
96 hashtable *zip_open(char *path);
97 hashtable_zipfile_entry *zip_find(list_classpath_entry *lce, utf *u);
98 classbuffer *zip_get(list_classpath_entry *lce, classinfo *c);
99
100 #ifdef __cplusplus
101 }
102 #endif
103
104 #endif /* _ZIP_H */
105
106
107 /*
108  * These are local overrides for various environment variables in Emacs.
109  * Please do not remove this and leave it at the end of the file, where
110  * Emacs will automagically detect them.
111  * ---------------------------------------------------------------------
112  * Local variables:
113  * mode: c
114  * indent-tabs-mode: t
115  * c-basic-offset: 4
116  * tab-width: 4
117  * End:
118  */