1 /* src/native/native.h - table of native functions
3 Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA
25 Contact: cacao@cacaojvm.org
27 Authors: Reinhard Grafl
30 $Id: native.h 6251 2006-12-27 23:15:56Z twisti $
40 #if !defined(WITH_STATIC_CLASSPATH)
44 #include "native/jni.h"
45 #include "native/include/java_lang_String.h"
46 #include "native/include/java_lang_Throwable.h"
48 #include "vm/global.h"
49 #include "vm/method.h"
53 /* table for locating native methods */
55 typedef struct nativeref nativeref;
56 typedef struct nativecompref nativecompref;
59 #if !defined(WITH_STATIC_CLASSPATH)
60 typedef struct hashtable_library_loader_entry hashtable_library_loader_entry;
61 typedef struct hashtable_library_name_entry hashtable_library_name_entry;
64 /* hashtable_library_loader_entry *********************************************/
66 struct hashtable_library_loader_entry {
67 java_objectheader *loader; /* class loader */
68 hashtable_library_name_entry *namelink;/* libs loaded by this loader */
69 hashtable_library_loader_entry *hashlink;/* link for external chaining */
73 /* hashtable_library_name_entry ***********************************************/
75 struct hashtable_library_name_entry {
76 utf *name; /* library name */
77 lt_dlhandle handle; /* libtool library handle */
78 hashtable_library_name_entry *hashlink; /* link for external chaining */
91 /* table for fast string comparison */
93 struct nativecompref {
102 /* initialize native subsystem */
103 bool native_init(void);
105 #if defined(WITH_STATIC_CLASSPATH)
107 /* find native function */
108 functionptr native_findfunction(utf *cname, utf *mname, utf *desc,
111 #else /* defined(WITH_STATIC_CLASSPATH) */
113 /* add a library to the library hash */
114 void native_hashtable_library_add(utf *filename, java_objectheader *loader,
117 /* find a library entry in the library hash */
118 hashtable_library_name_entry *native_hashtable_library_find(utf *filename,
119 java_objectheader *loader);
121 /* resolve native function */
122 functionptr native_resolve_function(methodinfo *m);
124 #endif /* defined(WITH_STATIC_CLASSPATH) */
126 /* create new object on the heap and call the initializer */
127 java_objectheader *native_new_and_init(classinfo *c);
129 /* create new object on the heap and call the initializer
130 mainly used for exceptions with a message */
131 java_objectheader *native_new_and_init_string(classinfo *c, java_lang_String *s);
133 /* create new object on the heap and call the initializer
134 mainly used for exceptions with an index */
135 java_objectheader *native_new_and_init_int(classinfo *c, s4 i);
137 /* create new object on the heap and call the initializer
138 mainly used for exceptions with cause */
139 java_objectheader *native_new_and_init_throwable(classinfo *c, java_lang_Throwable *t);
141 java_objectarray *native_get_parametertypes(methodinfo *m);
142 java_objectarray *native_get_exceptiontypes(methodinfo *m);
143 classinfo *native_get_returntype(methodinfo *m);
145 #endif /* _NATIVE_H */
149 * These are local overrides for various environment variables in Emacs.
150 * Please do not remove this and leave it at the end of the file, where
151 * Emacs will automagically detect them.
152 * ---------------------------------------------------------------------
155 * indent-tabs-mode: t