* Removed all Id tags.
[cacao.git] / src / native / jni.h
1 /* src/native/jni.h - JNI types and data structures
2
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
7
8    This file is part of CACAO.
9
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.
14
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.
19
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
23    02110-1301, USA.
24
25 */
26
27
28 /* GNU Classpath jni.h *********************************************************
29
30    ATTENTION: We include this file before we actually define our own
31    jni.h.  We do this because, otherwise we can get into unresolvable
32    circular header dependencies.
33
34    This is OK as GNU Classpath defines:
35
36    #define _CLASSPATH_JNI_H
37
38    CLASSPATH_JNI_H is in config.h defined.
39
40 *******************************************************************************/
41
42 #include "config.h"
43
44 /* XXX quick hack to not include GCJ's jni_md.h */
45 #define __GCJ_JNI_MD_H__
46
47 #include CLASSPATH_JNI_MD_H
48 #include CLASSPATH_JNI_H
49
50 #ifndef _JNI_H
51 #define _JNI_H
52
53
54 #include "vm/types.h"
55
56 #include "vm/global.h"
57
58 #include "vmcore/method.h"
59
60
61 /* _Jv_JNIEnv *****************************************************************/
62
63 typedef struct _Jv_JNIEnv _Jv_JNIEnv;
64
65 struct _Jv_JNIEnv {
66         const struct JNINativeInterface_ *env;    /* This MUST be the first entry */
67 };
68
69
70 /* _Jv_JavaVM *****************************************************************/
71
72 typedef struct _Jv_JavaVM _Jv_JavaVM;
73
74 struct _Jv_JavaVM {
75         const struct JNIInvokeInterface_ *functions;/*This MUST be the first entry*/
76
77         /* JVM instance-specific variables */
78
79         s8 starttime;                       /* VM startup time                    */
80
81         s4 Java_gnu_java_lang_management_VMClassLoadingMXBeanImpl_verbose;
82         s4 Java_gnu_java_lang_management_VMMemoryMXBeanImpl_verbose;
83         s4 java_lang_management_ThreadMXBean_PeakThreadCount;
84         s4 java_lang_management_ThreadMXBean_ThreadCount;
85         s8 java_lang_management_ThreadMXBean_TotalStartedThreadCount;
86         s4 Java_java_lang_VMClassLoader_defaultAssertionStatus;
87 };
88
89
90 /* CACAO related stuff ********************************************************/
91
92 extern const struct JNIInvokeInterface_ _Jv_JNIInvokeInterface;
93 extern struct JNINativeInterface_ _Jv_JNINativeInterface;
94
95
96 /* hashtable_global_ref_entry *************************************************/
97
98 typedef struct hashtable_global_ref_entry hashtable_global_ref_entry;
99
100 struct hashtable_global_ref_entry {
101         java_object_t              *o;      /* object pointer of global ref       */
102         s4                          refs;   /* references of the current pointer  */
103         hashtable_global_ref_entry *hashlink; /* link for external chaining       */
104 };
105
106
107 /* function prototypes ********************************************************/
108
109 /* initialize JNI subsystem */
110 bool jni_init(void);
111
112 java_handle_t *_Jv_jni_invokeNative(methodinfo *m, java_handle_t *o,
113                                                                         java_handle_objectarray_t *params);
114
115 #endif /* _JNI_H */
116
117
118 /*
119  * These are local overrides for various environment variables in Emacs.
120  * Please do not remove this and leave it at the end of the file, where
121  * Emacs will automagically detect them.
122  * ---------------------------------------------------------------------
123  * Local variables:
124  * mode: c
125  * indent-tabs-mode: t
126  * c-basic-offset: 4
127  * tab-width: 4
128  * End:
129  */