1 /****************************** tables.h ***************************************
3 Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
5 See file COPYRIGHT for information on usage and disclaimer of warranties
7 Author: Reinhard Grafl EMAIL: cacao@complang.tuwien.ac.at
9 Last Change: 1996/11/20
11 *******************************************************************************/
13 #include "global.h" /* for unicode. -- phil */
15 #define CLASS(name) (unicode_getclasslink(unicode_new_char(name)))
17 /* to determine the end of utf strings */
18 #define utf_end(utf) ((char *) utf->text+utf->blength)
20 /* switches for debug messages */
21 extern bool collectverbose;
22 extern list unloadedclasses;
24 /* function for disposing javastrings */
25 typedef void (*stringdeleter) ( java_objectheader *string );
27 /* creates hashtables for symboltables */
30 /* free memory for hashtables */
31 void tables_close (stringdeleter del);
33 /* write utf symbol to file/buffer */
34 void utf_sprint (char *buffer, utf *u);
35 void utf_fprint (FILE *file, utf *u);
36 void utf_display (utf *u);
38 /* create new utf-symbol */
39 utf *utf_new (char *text, u2 length);
40 utf *utf_new_char (char *text);
45 /* get next unicode character of a utf-string */
46 u2 utf_nextu2(char **utf);
48 /* get number of unicode characters of a utf string */
49 u4 utf_strlen(utf *u);
51 /* search for class and create it if not found */
52 classinfo *class_new (utf *u);
54 /* get javatype according to a typedescriptor */
55 u2 desc_to_type (utf *descriptor);
57 /* get length of a datatype */
58 u2 desc_typesize (utf *descriptor);
60 /* determine hashkey of a unicode-symbol */
61 u4 unicode_hashkey (u2 *text, u2 length);
63 /* create hashtable */
64 void init_hashtable(hashtable *hash, u4 size);
66 /* search for class in classtable */
67 classinfo *class_get (utf *u);
70 void heap_init (u4 size, u4 startsize, void **stackbottom);
72 void *heap_allocate (u4 bytelength, bool references, methodinfo *finalizer);
73 void heap_addreference (void **reflocation);
76 void gc_thread (void);