1 /* src/native/native.h - table of native functions
3 Copyright (C) 1996-2005, 2006, 2007 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 $Id: native.h 7601 2007-03-28 23:02:50Z michi $
35 #if !defined(WITH_STATIC_CLASSPATH)
39 #include "vm/global.h"
41 #include "vmcore/class.h"
42 #include "vmcore/loader.h"
43 #include "vmcore/method.h"
44 #include "vmcore/utf8.h"
47 /* table for locating native methods */
49 typedef struct nativeref nativeref;
50 typedef struct nativecompref nativecompref;
53 #if !defined(WITH_STATIC_CLASSPATH)
54 typedef struct hashtable_library_loader_entry hashtable_library_loader_entry;
55 typedef struct hashtable_library_name_entry hashtable_library_name_entry;
58 /* hashtable_library_loader_entry *********************************************/
60 struct hashtable_library_loader_entry {
61 hashtable_classloader_entry *cle; /* class loader */
62 hashtable_library_name_entry *namelink;/* libs loaded by this loader */
63 hashtable_library_loader_entry *hashlink;/* link for external chaining */
67 /* hashtable_library_name_entry ***********************************************/
69 struct hashtable_library_name_entry {
70 utf *name; /* library name */
71 lt_dlhandle handle; /* libtool library handle */
72 hashtable_library_name_entry *hashlink; /* link for external chaining */
85 /* table for fast string comparison */
87 struct nativecompref {
96 /* initialize native subsystem */
97 bool native_init(void);
99 #if defined(WITH_STATIC_CLASSPATH)
101 /* find native function */
102 functionptr native_findfunction(utf *cname, utf *mname, utf *desc,
105 #else /* defined(WITH_STATIC_CLASSPATH) */
107 /* add a library to the library hash */
108 void native_hashtable_library_add(utf *filename, java_objectheader *loader,
111 /* find a library entry in the library hash */
112 hashtable_library_name_entry *native_hashtable_library_find(utf *filename,
113 java_objectheader *loader);
115 /* resolve native function */
116 functionptr native_resolve_function(methodinfo *m);
118 #endif /* defined(WITH_STATIC_CLASSPATH) */
120 /* create new object on the heap and call the initializer */
121 java_objectheader *native_new_and_init(classinfo *c);
123 /* create new object on the heap and call the initializer
124 mainly used for exceptions with a message */
125 java_objectheader *native_new_and_init_string(classinfo *c,
126 java_objectheader *s);
128 /* create new object on the heap and call the initializer
129 mainly used for exceptions with an index */
130 java_objectheader *native_new_and_init_int(classinfo *c, s4 i);
132 /* create new object on the heap and call the initializer
133 mainly used for exceptions with cause */
134 java_objectheader *native_new_and_init_throwable(classinfo *c,
135 java_objectheader *t);
137 #endif /* _NATIVE_H */
141 * These are local overrides for various environment variables in Emacs.
142 * Please do not remove this and leave it at the end of the file, where
143 * Emacs will automagically detect them.
144 * ---------------------------------------------------------------------
147 * indent-tabs-mode: t