1 /****************************** native.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 Contains the codegenerator for an Alpha processor.
8 This module generates Alpha machine code for a sequence of
9 pseudo commands (PCMDs).
11 Authors: Reinhard Grafl EMAIL: cacao@complang.tuwien.ac.at
13 Last Change: 1997/03/12
15 *******************************************************************************/
17 /* Java Native Interface */
20 /* structure for class java.lang.String */
21 struct java_lang_String;
23 /* for raising exceptions from native methods */
24 extern java_objectheader* exceptionptr;
26 /* javastring-hashtable */
27 extern hashtable string_hash;
29 /* load classes required for native methods */
30 void native_loadclasses ();
32 /* set searchpath for classfiles */
33 void native_setclasspath (char *path);
35 /* find native function */
36 functionptr native_findfunction (utf *cname, utf *mname,
37 utf *desc, bool isstatic);
39 /* creates a new object of type java/lang/String from a utf-text */
40 java_objectheader *javastring_new (utf *text);
42 /* creates a new object of type java/lang/String from a c-string */
43 java_objectheader *javastring_new_char (char *text);
45 /* make c-string from a javastring (debugging) */
46 char *javastring_tochar (java_objectheader *s);
48 /* create new object on the heap and call the initializer */
49 java_objectheader *native_new_and_init (classinfo *c);
51 /* add property to system-property vector */
52 void attach_property(char *name, char *value);
54 /* correct vftbl-entries of javastring-hash */
55 void stringtable_update();
57 /* throw classnotfoundexcetion */
58 void throw_classnotfoundexception();
60 /* make utf symbol from javastring */
61 utf *javastring_toutf(struct java_lang_String *string, bool isclassname);
63 /* make utf symbol from u2 array */
64 utf *utf_new_u2(u2 *unicodedata, u4 unicodelength, bool isclassname);
66 /* determine utf length in bytes of a u2 array */
67 u4 u2_utflength(u2 *text, u4 u2_length);
69 /* create systemclassloader object and initialize its instance fields */
70 void init_systemclassloader();
72 /* search 'classinfo'-structure for a field with the specified name */
73 fieldinfo *class_findfield_approx (classinfo *c, utf *name);
75 /* creates a new javastring with the text of the utf-symbol */
76 java_objectheader *literalstring_new (utf *u);
78 /* creates a new javastring with the text of the u2-array */
79 java_objectheader *literalstring_u2 (java_chararray *a, u4 length, bool copymode);
81 /* dispose a javastring */
82 void literalstring_free (java_objectheader*);
84 void systemclassloader_addlibname(java_objectheader *o);
85 void systemclassloader_addlibrary(java_objectheader *o);
87 void copy_vftbl(vftbl **dest, vftbl *src);
91 * These are local overrides for various environment variables in Emacs.
92 * Please do not remove this and leave it at the end of the file, where
93 * Emacs will automagically detect them.
94 * ---------------------------------------------------------------------