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
29 Changes: Christian Thalinger
31 $Id: native.h 4530 2006-02-21 09:11:53Z twisti $
41 #if !defined(WITH_STATIC_CLASSPATH)
46 #include "vm/global.h"
47 #include "vm/method.h"
49 #include "native/jni.h"
50 #include "native/include/java_lang_String.h"
51 #include "native/include/java_lang_ClassLoader.h"
52 #include "native/include/java_lang_Throwable.h"
55 /* table for locating native methods */
57 typedef struct nativeref nativeref;
58 typedef struct nativecompref nativecompref;
61 #if !defined(WITH_STATIC_CLASSPATH)
62 typedef struct hashtable_library_loader_entry hashtable_library_loader_entry;
63 typedef struct hashtable_library_name_entry hashtable_library_name_entry;
66 /* hashtable_library_loader_entry *********************************************/
68 struct hashtable_library_loader_entry {
69 java_objectheader *loader; /* class loader */
70 hashtable_library_name_entry *namelink;/* libs loaded by this loader */
71 hashtable_library_loader_entry *hashlink;/* link for external chaining */
75 /* hashtable_library_name_entry ***********************************************/
77 struct hashtable_library_name_entry {
78 utf *name; /* library name */
79 lt_dlhandle handle; /* libtool library handle */
80 hashtable_library_name_entry *hashlink; /* link for external chaining */
93 /* table for fast string comparison */
95 struct nativecompref {
104 /* initialize native subsystem */
105 bool native_init(void);
107 #if defined(WITH_STATIC_CLASSPATH)
109 /* find native function */
110 functionptr native_findfunction(utf *cname, utf *mname, utf *desc,
113 #else /* defined(WITH_STATIC_CLASSPATH) */
115 /* add a library to the library hash */
116 void native_hashtable_library_add(utf *filename, java_objectheader *loader,
119 /* find a library entry in the library hash */
120 hashtable_library_name_entry *native_hashtable_library_find(utf *filename,
121 java_objectheader *loader);
123 /* resolve native function */
124 functionptr native_resolve_function(methodinfo *m);
126 #endif /* defined(WITH_STATIC_CLASSPATH) */
128 /* create new object on the heap and call the initializer */
129 java_objectheader *native_new_and_init(classinfo *c);
131 /* create new object on the heap and call the initializer
132 mainly used for exceptions with a message */
133 java_objectheader *native_new_and_init_string(classinfo *c, java_lang_String *s);
135 /* create new object on the heap and call the initializer
136 mainly used for exceptions with an index */
137 java_objectheader *native_new_and_init_int(classinfo *c, s4 i);
139 /* create new object on the heap and call the initializer
140 mainly used for exceptions with cause */
141 java_objectheader *native_new_and_init_throwable(classinfo *c, java_lang_Throwable *t);
143 java_objectarray *native_get_parametertypes(methodinfo *m);
144 java_objectarray *native_get_exceptiontypes(methodinfo *m);
145 classinfo *native_get_returntype(methodinfo *m);
147 #endif /* _NATIVE_H */
151 * These are local overrides for various environment variables in Emacs.
152 * Please do not remove this and leave it at the end of the file, where
153 * Emacs will automagically detect them.
154 * ---------------------------------------------------------------------
157 * indent-tabs-mode: t