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 8137 2007-06-22 16:41:36Z michi $
35 #if !defined(WITH_STATIC_CLASSPATH)
41 #include "native/jni.h"
43 #include "vm/global.h"
45 #include "vmcore/class.h"
46 #include "vmcore/loader.h"
47 #include "vmcore/method.h"
48 #include "vmcore/utf8.h"
51 /* defines ********************************************************************/
53 #define NATIVE_METHODS_COUNT sizeof(methods) / sizeof(JNINativeMethod)
56 /* table for locating native methods */
58 typedef struct nativeref nativeref;
59 typedef struct nativecompref nativecompref;
62 #if !defined(WITH_STATIC_CLASSPATH)
63 typedef struct hashtable_library_loader_entry hashtable_library_loader_entry;
64 typedef struct hashtable_library_name_entry hashtable_library_name_entry;
67 /* native_methods_node_t ******************************************************/
69 typedef struct native_methods_node_t native_methods_node_t;
71 struct native_methods_node_t {
72 utf *classname; /* class name */
73 utf *name; /* method name */
74 utf *descriptor; /* descriptor name */
75 functionptr function; /* pointer to the implementation */
79 /* hashtable_library_loader_entry *********************************************/
81 struct hashtable_library_loader_entry {
82 hashtable_classloader_entry *cle; /* class loader */
83 hashtable_library_name_entry *namelink;/* libs loaded by this loader */
84 hashtable_library_loader_entry *hashlink;/* link for external chaining */
88 /* hashtable_library_name_entry ***********************************************/
90 struct hashtable_library_name_entry {
91 utf *name; /* library name */
92 lt_dlhandle handle; /* libtool library handle */
93 hashtable_library_name_entry *hashlink; /* link for external chaining */
106 /* table for fast string comparison */
108 struct nativecompref {
117 /* function prototypes ********************************************************/
119 bool native_init(void);
121 void native_method_register(utf *classname, const JNINativeMethod *methods,
124 #if defined(WITH_STATIC_CLASSPATH)
126 functionptr native_findfunction(utf *cname, utf *mname, utf *desc,
129 #else /* defined(WITH_STATIC_CLASSPATH) */
131 lt_dlhandle native_library_open(utf *filename);
132 void native_library_add(utf *filename, java_objectheader *loader,
135 hashtable_library_name_entry *native_library_find(utf *filename,
136 java_objectheader *loader);
138 functionptr native_resolve_function(methodinfo *m);
140 #endif /* defined(WITH_STATIC_CLASSPATH) */
142 java_objectheader *native_new_and_init(classinfo *c);
144 java_objectheader *native_new_and_init_string(classinfo *c,
145 java_objectheader *s);
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