This commit was manufactured by cvs2svn to create tag
[cacao.git] / tables.h
1 /* tables.h - 
2
3    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4    R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser,
5    M. Probst, S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck,
6    P. Tomsich, J. Wenninger
7
8    This file is part of CACAO.
9
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.
14
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.
19
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., 59 Temple Place - Suite 330, Boston, MA
23    02111-1307, USA.
24
25    Contact: cacao@complang.tuwien.ac.at
26
27    Authors: Reinhard Grafl
28
29    $Id: tables.h 557 2003-11-02 22:51:59Z twisti $
30
31 */
32
33
34 #ifndef _TABLES_H
35 #define _TABLES_H
36
37 #include <stdio.h>
38 #include "global.h" /* for unicode. -- phil */
39
40 #define CLASS(name)     (unicode_getclasslink(unicode_new_char(name)))
41
42 /* to determine the end of utf strings */
43 #define utf_end(utf) ((char *) utf->text+utf->blength)
44
45 /* switches for debug messages */
46 extern bool collectverbose;
47 extern list unloadedclasses;
48
49 /* function for disposing javastrings */
50 typedef void (*stringdeleter) (java_objectheader *string);
51     
52 /* creates hashtables for symboltables */
53 void tables_init();
54
55 /* free memory for hashtables */ 
56 void tables_close(stringdeleter del);
57
58 /* write utf symbol to file/buffer */
59 void utf_sprint(char *buffer, utf *u);
60 void utf_fprint(FILE *file, utf *u);
61 void utf_display(utf *u);
62
63 /* create new utf-symbol */
64 utf *utf_new(char *text, u2 length);
65 utf *utf_new_char(char *text);
66
67 /* show utf-table */
68 void utf_show();
69
70 /* get next unicode character of a utf-string */
71 u2 utf_nextu2(char **utf);
72
73 /* get number of unicode characters of a utf string */
74 u4 utf_strlen(utf *u);
75
76 /* search for class and create it if not found */
77 classinfo *class_new(utf *u);
78
79 /* get javatype according to a typedescriptor */
80 u2 desc_to_type(utf *descriptor);
81
82 /* get length of a datatype */
83 u2 desc_typesize(utf *descriptor);
84
85 /* determine hashkey of a unicode-symbol */
86 u4 unicode_hashkey(u2 *text, u2 length);
87
88 /* create hashtable */
89 void init_hashtable(hashtable *hash, u4 size);
90
91 /* search for class in classtable */
92 classinfo *class_get(utf *u);
93
94
95 void heap_init (u4 size, u4 startsize, void **stackbottom);
96 void heap_close();
97 void *heap_allocate(u4 bytelength, bool references, methodinfo *finalizer);
98 void heap_addreference(void **reflocation);
99
100 #endif /* _TABLES_H */
101
102
103 /*
104  * These are local overrides for various environment variables in Emacs.
105  * Please do not remove this and leave it at the end of the file, where
106  * Emacs will automagically detect them.
107  * ---------------------------------------------------------------------
108  * Local variables:
109  * mode: c
110  * indent-tabs-mode: t
111  * c-basic-offset: 4
112  * tab-width: 4
113  * End:
114  */