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 7573 2007-03-25 18:55:02Z twisti $
35 #if !defined(WITH_STATIC_CLASSPATH)
39 #include "vm/global.h"
41 #include "vmcore/class.h"
42 #include "vmcore/method.h"
43 #include "vmcore/utf8.h"
46 /* table for locating native methods */
48 typedef struct nativeref nativeref;
49 typedef struct nativecompref nativecompref;
52 #if !defined(WITH_STATIC_CLASSPATH)
53 typedef struct hashtable_library_loader_entry hashtable_library_loader_entry;
54 typedef struct hashtable_library_name_entry hashtable_library_name_entry;
57 /* hashtable_library_loader_entry *********************************************/
59 struct hashtable_library_loader_entry {
60 java_objectheader *loader; /* class loader */
61 hashtable_library_name_entry *namelink;/* libs loaded by this loader */
62 hashtable_library_loader_entry *hashlink;/* link for external chaining */
66 /* hashtable_library_name_entry ***********************************************/
68 struct hashtable_library_name_entry {
69 utf *name; /* library name */
70 lt_dlhandle handle; /* libtool library handle */
71 hashtable_library_name_entry *hashlink; /* link for external chaining */
84 /* table for fast string comparison */
86 struct nativecompref {
95 /* initialize native subsystem */
96 bool native_init(void);
98 #if defined(WITH_STATIC_CLASSPATH)
100 /* find native function */
101 functionptr native_findfunction(utf *cname, utf *mname, utf *desc,
104 #else /* defined(WITH_STATIC_CLASSPATH) */
106 /* add a library to the library hash */
107 void native_hashtable_library_add(utf *filename, java_objectheader *loader,
110 /* find a library entry in the library hash */
111 hashtable_library_name_entry *native_hashtable_library_find(utf *filename,
112 java_objectheader *loader);
114 /* resolve native function */
115 functionptr native_resolve_function(methodinfo *m);
117 #endif /* defined(WITH_STATIC_CLASSPATH) */
119 /* create new object on the heap and call the initializer */
120 java_objectheader *native_new_and_init(classinfo *c);
122 /* create new object on the heap and call the initializer
123 mainly used for exceptions with a message */
124 java_objectheader *native_new_and_init_string(classinfo *c,
125 java_objectheader *s);
127 /* create new object on the heap and call the initializer
128 mainly used for exceptions with an index */
129 java_objectheader *native_new_and_init_int(classinfo *c, s4 i);
131 /* create new object on the heap and call the initializer
132 mainly used for exceptions with cause */
133 java_objectheader *native_new_and_init_throwable(classinfo *c,
134 java_objectheader *t);
136 #endif /* _NATIVE_H */
140 * These are local overrides for various environment variables in Emacs.
141 * Please do not remove this and leave it at the end of the file, where
142 * Emacs will automagically detect them.
143 * ---------------------------------------------------------------------
146 * indent-tabs-mode: t