merge from gnuclasspath branch. I hope I didn't miss or revert any modifications...
[cacao.git] / src / native / native.h
1 /****************************** native.h ***************************************
2
3         Copyright (c) 1997 A. Krall, R. Grafl, M. Gschwind, M. Probst
4
5         See file COPYRIGHT for information on usage and disclaimer of warranties
6
7         Contains the codegenerator for an Alpha processor.
8         This module generates Alpha machine code for a sequence of
9         pseudo commands (PCMDs).
10
11         Authors: Reinhard Grafl      EMAIL: cacao@complang.tuwien.ac.at
12
13         Last Change: 1997/03/12
14
15 *******************************************************************************/
16
17 /* Java Native Interface */
18 #include "jni.h"
19
20 /* structure for class java.lang.String */
21 struct java_lang_String;
22
23 /* for raising exceptions from native methods */
24 extern java_objectheader* exceptionptr;
25
26 /* javastring-hashtable */
27 extern hashtable string_hash; 
28
29 /* load classes required for native methods */
30 void native_loadclasses ();
31
32 /* set searchpath for classfiles */
33 void native_setclasspath (char *path);
34
35 /* find native function */
36 functionptr native_findfunction (utf *cname, utf *mname, 
37                                  utf *desc, bool isstatic);
38
39 /* creates a new object of type java/lang/String from a utf-text */
40 java_objectheader *javastring_new (utf *text);
41
42 /* creates a new object of type java/lang/String from a c-string */
43 java_objectheader *javastring_new_char (char *text);
44
45 /* make c-string from a javastring (debugging) */
46 char *javastring_tochar (java_objectheader *s);
47
48 /* create new object on the heap and call the initializer */
49 java_objectheader *native_new_and_init (classinfo *c);
50
51 /* add property to system-property vector */
52 void attach_property(char *name, char *value);
53
54 /* correct vftbl-entries of javastring-hash */
55 void stringtable_update();
56
57 /* throw classnotfoundexcetion */
58 void throw_classnotfoundexception();
59
60 void throw_classnotfoundexception2(utf* classname);
61
62 /* make utf symbol from javastring */
63 utf *javastring_toutf(struct java_lang_String *string, bool isclassname);
64
65 /* make utf symbol from u2 array */
66 utf *utf_new_u2(u2 *unicodedata, u4 unicodelength, bool isclassname);
67
68 /* determine utf length in bytes of a u2 array */
69 u4 u2_utflength(u2 *text, u4 u2_length);
70
71 /* create systemclassloader object and initialize its instance fields  */
72 void init_systemclassloader();
73
74 /* search 'classinfo'-structure for a field with the specified name */
75 fieldinfo *class_findfield_approx (classinfo *c, utf *name);
76
77 /* creates a new javastring with the text of the utf-symbol */
78 java_objectheader *literalstring_new (utf *u);
79
80 /* creates a new javastring with the text of the u2-array */
81 java_objectheader *literalstring_u2 (java_chararray *a, u4 length, bool copymode);
82
83 /* dispose a javastring */
84 void literalstring_free (java_objectheader*);
85
86 void systemclassloader_addlibname(java_objectheader *o);
87 void systemclassloader_addlibrary(java_objectheader *o);
88
89 void copy_vftbl(vftbl **dest, vftbl *src);
90
91
92 /*
93  * These are local overrides for various environment variables in Emacs.
94  * Please do not remove this and leave it at the end of the file, where
95  * Emacs will automagically detect them.
96  * ---------------------------------------------------------------------
97  * Local variables:
98  * mode: c
99  * indent-tabs-mode: t
100  * c-basic-offset: 4
101  * tab-width: 4
102  * End:
103  */