* AccessChecksLevelOption.cs: Fixed line endings. Set eol-style to CRLF.
[mono-project.git] / ikvm-native / jni.c
blob64f93d7cff419ff401a715e1eca4773160ed8272
1 /*
2 Copyright (C) 2004 Jeroen Frijters
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
20 Jeroen Frijters
21 jeroen@frijters.net
24 #include <stdarg.h>
25 #include "jni.h"
27 #ifdef _WIN32
28 #include <malloc.h>
29 #define ALLOCA _alloca
30 #else
31 #if !defined(__FreeBSD__) && !defined(__NetBSD__)
32 #include <alloca.h>
33 #endif
34 #define ALLOCA alloca
35 #endif
37 static jobject JNICALL NewObject(JNIEnv* pEnv, jclass clazz, jmethodID methodID, ...)
39 jobject o;
40 va_list args;
41 va_start(args, methodID);
42 o = (*pEnv)->NewObjectV(pEnv, clazz, methodID, args);
43 va_end(args);
44 return o;
47 #define MAKE_ARG_ARRAY(pEnv, args, argarray) \
48 do { \
49 jbyte sig[257];\
50 int argc = (*pEnv)->GetMethodArgs(pEnv, methodID, sig);\
51 int i;\
52 argarray = (jvalue*)ALLOCA(argc * sizeof(jvalue));\
53 for(i = 0; i < argc; i++)\
55 switch(sig[i])\
57 case 'Z':\
58 case 'B':\
59 case 'S':\
60 case 'C':\
61 case 'I':\
62 argarray[i].i = va_arg(args, jint);\
63 break;\
64 case 'J':\
65 argarray[i].j = va_arg(args, jlong);\
66 break;\
67 case 'L':\
68 argarray[i].l = va_arg(args, jobject);\
69 break;\
70 case 'D':\
71 argarray[i].d = va_arg(args, double);\
72 break;\
73 case 'F':\
74 argarray[i].f = (float)va_arg(args, double);\
75 break;\
78 } while(0);
80 static jobject JNICALL NewObjectV(JNIEnv* pEnv, jclass clazz, jmethodID methodID, va_list args)
82 jvalue* argarray;
83 MAKE_ARG_ARRAY(pEnv, args, argarray);
84 return (*pEnv)->NewObjectA(pEnv, clazz, methodID, argarray);
87 #define MAKE_METHOD(Type, type) \
88 static type JNICALL Call##Type##Method(JNIEnv* pEnv, jobject obj, jmethodID methodID, ...)\
90 type ret;\
91 va_list args;\
92 va_start(args, methodID);\
93 ret = (*pEnv)->Call##Type##MethodV(pEnv, obj, methodID, args);\
94 va_end(args);\
95 return ret;\
97 static type JNICALL Call##Type##MethodV(JNIEnv* pEnv, jobject obj, jmethodID methodID, va_list args)\
99 jvalue* argarray;\
100 MAKE_ARG_ARRAY(pEnv, args, argarray);\
101 return (*pEnv)->Call##Type##MethodA(pEnv, obj, methodID, argarray);\
103 static type JNICALL CallNonvirtual##Type##Method(JNIEnv* pEnv, jobject obj, jclass clazz, jmethodID methodID, ...)\
105 type ret;\
106 va_list args;\
107 va_start(args, methodID);\
108 ret = (*pEnv)->CallNonvirtual##Type##MethodV(pEnv, obj, clazz, methodID, args);\
109 va_end(args);\
110 return ret;\
112 static type JNICALL CallNonvirtual##Type##MethodV(JNIEnv* pEnv, jobject obj, jclass clazz, jmethodID methodID, va_list args)\
114 jvalue* argarray;\
115 MAKE_ARG_ARRAY(pEnv, args, argarray);\
116 return (*pEnv)->CallNonvirtual##Type##MethodA(pEnv, obj, clazz, methodID, argarray);\
118 static type JNICALL CallStatic##Type##Method(JNIEnv* pEnv, jclass clazz, jmethodID methodID, ...)\
120 type ret;\
121 va_list args;\
122 va_start(args, methodID);\
123 ret = (*pEnv)->CallStatic##Type##MethodV(pEnv, clazz, methodID, args);\
124 va_end(args);\
125 return ret;\
127 static type JNICALL CallStatic##Type##MethodV(JNIEnv* pEnv, jclass clazz, jmethodID methodID, va_list args)\
129 jvalue* argarray;\
130 MAKE_ARG_ARRAY(pEnv, args, argarray);\
131 return (*pEnv)->CallStatic##Type##MethodA(pEnv, clazz, methodID, argarray);\
134 MAKE_METHOD(Object, jobject)
135 MAKE_METHOD(Boolean, jboolean)
136 MAKE_METHOD(Byte, jbyte)
137 MAKE_METHOD(Char, jchar)
138 MAKE_METHOD(Short, jshort)
139 MAKE_METHOD(Int, jint)
140 MAKE_METHOD(Long, jlong)
141 MAKE_METHOD(Float, jfloat)
142 MAKE_METHOD(Double, jdouble)
144 static void JNICALL CallVoidMethod(JNIEnv* pEnv, jobject obj, jmethodID methodID, ...)
146 va_list args;
147 va_start(args, methodID);
148 (*pEnv)->CallVoidMethodV(pEnv, obj, methodID, args);
149 va_end(args);
151 static void JNICALL CallVoidMethodV(JNIEnv* pEnv, jobject obj, jmethodID methodID, va_list args)
153 jvalue* argarray;
154 MAKE_ARG_ARRAY(pEnv, args, argarray);
155 (*pEnv)->CallVoidMethodA(pEnv, obj, methodID, argarray);
157 static void JNICALL CallNonvirtualVoidMethod(JNIEnv* pEnv, jobject obj, jclass clazz, jmethodID methodID, ...)
159 va_list args;
160 va_start(args, methodID);
161 (*pEnv)->CallNonvirtualVoidMethodV(pEnv, obj, clazz, methodID, args);
162 va_end(args);
164 static void JNICALL CallNonvirtualVoidMethodV(JNIEnv* pEnv, jobject obj, jclass clazz, jmethodID methodID, va_list args)
166 jvalue* argarray;
167 MAKE_ARG_ARRAY(pEnv, args, argarray);
168 (*pEnv)->CallNonvirtualVoidMethodA(pEnv, obj, clazz, methodID, argarray);
170 static void JNICALL CallStaticVoidMethod(JNIEnv* pEnv, jclass clazz, jmethodID methodID, ...)
172 va_list args;
173 va_start(args, methodID);
174 (*pEnv)->CallStaticVoidMethodV(pEnv, clazz, methodID, args);
175 va_end(args);
177 static void JNICALL CallStaticVoidMethodV(JNIEnv* pEnv, jclass clazz, jmethodID methodID, va_list args)
179 jvalue* argarray;
180 MAKE_ARG_ARRAY(pEnv, args, argarray);
181 (*pEnv)->CallStaticVoidMethodA(pEnv, clazz, methodID, argarray);
184 static void* JNIEnv_vtable[] =
186 0, // void JNICALL reserved0();
187 0, // void JNICALL reserved1();
188 0, // void JNICALL reserved2();
189 0, // void JNICALL reserved3();
191 0, // jint JNICALL GetVersion();
193 0, // jclass JNICALL DefineClass(const char *name, jobject loader, const jbyte *buf, jsize len);
194 0, // jclass JNICALL FindClass(const char *name);
196 0, // jmethodID JNICALL FromReflectedMethod(jobject method);
197 0, // jfieldID JNICALL FromReflectedField(jobject field);
198 0, // jobject JNICALL ToReflectedMethod(jclass clazz, jmethodID methodID);
200 0, // jclass JNICALL GetSuperclass(jclass sub);
201 0, // jboolean JNICALL IsAssignableFrom(jclass sub, jclass sup);
203 0, // jobject JNICALL ToReflectedField(jclass clazz, jfieldID fieldID);
205 0, // jint JNICALL Throw(jthrowable obj);
206 0, // jint JNICALL ThrowNew(jclass clazz, const char *msg);
207 0, // jthrowable JNICALL ExceptionOccurred();
208 0, // void JNICALL ExceptionDescribe();
209 0, // void JNICALL ExceptionClear();
210 0, // void JNICALL FatalError(const char *msg);
212 0, // jint JNICALL PushLocalFrame(jint capacity);
213 0, // jobject JNICALL PopLocalFrame(jobject result);
215 0, // jobject JNICALL NewGlobalRef(jobject lobj);
216 0, // void JNICALL DeleteGlobalRef(jobject gref);
217 0, // void JNICALL DeleteLocalRef(jobject obj);
218 0, // jboolean JNICALL IsSameObject(jobject obj1, jobject obj2);
220 0, // jobject JNICALL NewLocalRef(jobject ref);
221 0, // jint JNICALL EnsureLocalCapacity(jint capacity);
223 0, // jobject JNICALL AllocObject(jclass clazz);
224 NewObject, // jobject JNICALL NewObject(jclass clazz, jmethodID methodID, ...);
225 NewObjectV, // jobject JNICALL NewObjectV(jclass clazz, jmethodID methodID, va_list args);
226 0, // jobject JNICALL NewObjectA(jclass clazz, jmethodID methodID, jvalue *args);
228 0, // jclass JNICALL GetObjectClass(jobject obj);
229 0, // jboolean JNICALL IsInstanceOf(jobject obj, jclass clazz);
231 0, // jmethodID JNICALL GetMethodID(jclass clazz, const char *name, const char *sig);
233 CallObjectMethod, // jobject JNICALL CallObjectMethod(jobject obj, jmethodID methodID, ...);
234 CallObjectMethodV, // jobject JNICALL CallObjectMethodV(jobject obj, jmethodID methodID, va_list args);
235 0, // jobject JNICALL CallObjectMethodA(jobject obj, jmethodID methodID, jvalue * args);
237 CallBooleanMethod, // jboolean JNICALL CallBooleanMethod(jobject obj, jmethodID methodID, ...);
238 CallBooleanMethodV, // jboolean JNICALL CallBooleanMethodV(jobject obj, jmethodID methodID, va_list args);
239 0, // jboolean JNICALL CallBooleanMethodA(jobject obj, jmethodID methodID, jvalue * args);
241 CallByteMethod, // jbyte JNICALL CallByteMethod(jobject obj, jmethodID methodID, ...);
242 CallByteMethodV, // jbyte JNICALL CallByteMethodV(jobject obj, jmethodID methodID, va_list args);
243 0, // jbyte JNICALL CallByteMethodA(jobject obj, jmethodID methodID, jvalue *args);
245 CallCharMethod, // jchar JNICALL CallCharMethod(jobject obj, jmethodID methodID, ...);
246 CallCharMethodV, // jchar JNICALL CallCharMethodV(jobject obj, jmethodID methodID, va_list args);
247 0, // jchar JNICALL CallCharMethodA(jobject obj, jmethodID methodID, jvalue *args);
249 CallShortMethod, // jshort JNICALL CallShortMethod(jobject obj, jmethodID methodID, ...);
250 CallShortMethodV, // jshort JNICALL CallShortMethodV(jobject obj, jmethodID methodID, va_list args);
251 0, // jshort JNICALL CallShortMethodA(jobject obj, jmethodID methodID, jvalue *args);
253 CallIntMethod, // jint JNICALL CallIntMethod(jobject obj, jmethodID methodID, ...);
254 CallIntMethodV, // jint JNICALL CallIntMethodV(jobject obj, jmethodID methodID, va_list args);
255 0, // jint JNICALL CallIntMethodA(jobject obj, jmethodID methodID, jvalue *args);
257 CallLongMethod, // jlong JNICALL CallLongMethod(jobject obj, jmethodID methodID, ...);
258 CallLongMethodV, // jlong JNICALL CallLongMethodV(jobject obj, jmethodID methodID, va_list args);
259 0, // jlong JNICALL CallLongMethodA(jobject obj, jmethodID methodID, jvalue *args);
261 CallFloatMethod, // jfloat JNICALL CallFloatMethod(jobject obj, jmethodID methodID, ...);
262 CallFloatMethodV, // jfloat JNICALL CallFloatMethodV(jobject obj, jmethodID methodID, va_list args);
263 0, // jfloat JNICALL CallFloatMethodA(jobject obj, jmethodID methodID, jvalue *args);
265 CallDoubleMethod, // jdouble JNICALL CallDoubleMethod(jobject obj, jmethodID methodID, ...);
266 CallDoubleMethodV, // jdouble JNICALL CallDoubleMethodV(jobject obj, jmethodID methodID, va_list args);
267 0, // jdouble JNICALL CallDoubleMethodA(jobject obj, jmethodID methodID, jvalue *args);
269 CallVoidMethod, // void JNICALL CallVoidMethod(jobject obj, jmethodID methodID, ...);
270 CallVoidMethodV, // void JNICALL CallVoidMethodV(jobject obj, jmethodID methodID, va_list args);
271 0, // void JNICALL CallVoidMethodA(jobject obj, jmethodID methodID, jvalue * args);
273 CallNonvirtualObjectMethod, // jobject JNICALL CallNonvirtualObjectMethod(jobject obj, jclass clazz, jmethodID methodID, ...);
274 CallNonvirtualObjectMethodV, // jobject JNICALL CallNonvirtualObjectMethodV(jobject obj, jclass clazz, jmethodID methodID, va_list args);
275 0, // jobject JNICALL CallNonvirtualObjectMethodA(jobject obj, jclass clazz, jmethodID methodID, jvalue * args);
277 CallNonvirtualBooleanMethod, // jboolean JNICALL CallNonvirtualBooleanMethod(jobject obj, jclass clazz, jmethodID methodID, ...);
278 CallNonvirtualBooleanMethodV, // jboolean JNICALL CallNonvirtualBooleanMethodV(jobject obj, jclass clazz, jmethodID methodID, va_list args);
279 0, // jboolean JNICALL CallNonvirtualBooleanMethodA(jobject obj, jclass clazz, jmethodID methodID, jvalue * args);
281 CallNonvirtualByteMethod, // jbyte JNICALL CallNonvirtualByteMethod(jobject obj, jclass clazz, jmethodID methodID, ...);
282 CallNonvirtualByteMethodV, // jbyte JNICALL CallNonvirtualByteMethodV(jobject obj, jclass clazz, jmethodID methodID, va_list args);
283 0, // jbyte JNICALL CallNonvirtualByteMethodA(jobject obj, jclass clazz, jmethodID methodID, jvalue *args);
285 CallNonvirtualCharMethod, // jchar JNICALL CallNonvirtualCharMethod(jobject obj, jclass clazz, jmethodID methodID, ...);
286 CallNonvirtualCharMethodV, // jchar JNICALL CallNonvirtualCharMethodV(jobject obj, jclass clazz, jmethodID methodID, va_list args);
287 0, // jchar JNICALL CallNonvirtualCharMethodA(jobject obj, jclass clazz, jmethodID methodID, jvalue *args);
289 CallNonvirtualShortMethod, // jshort JNICALL CallNonvirtualShortMethod(jobject obj, jclass clazz, jmethodID methodID, ...);
290 CallNonvirtualShortMethodV, // jshort JNICALL CallNonvirtualShortMethodV(jobject obj, jclass clazz, jmethodID methodID, va_list args);
291 0, // jshort JNICALL CallNonvirtualShortMethodA(jobject obj, jclass clazz, jmethodID methodID, jvalue *args);
293 CallNonvirtualIntMethod, // jint JNICALL CallNonvirtualIntMethod(jobject obj, jclass clazz, jmethodID methodID, ...);
294 CallNonvirtualIntMethodV, // jint JNICALL CallNonvirtualIntMethodV(jobject obj, jclass clazz, jmethodID methodID, va_list args);
295 0, // jint JNICALL CallNonvirtualIntMethodA(jobject obj, jclass clazz, jmethodID methodID, jvalue *args);
297 CallNonvirtualLongMethod, // jlong JNICALL CallNonvirtualLongMethod(jobject obj, jclass clazz, jmethodID methodID, ...);
298 CallNonvirtualLongMethodV, // jlong JNICALL CallNonvirtualLongMethodV(jobject obj, jclass clazz, jmethodID methodID, va_list args);
299 0, // jlong JNICALL CallNonvirtualLongMethodA(jobject obj, jclass clazz, jmethodID methodID, jvalue *args);
301 CallNonvirtualFloatMethod, // jfloat JNICALL CallNonvirtualFloatMethod(jobject obj, jclass clazz, jmethodID methodID, ...);
302 CallNonvirtualFloatMethodV, // jfloat JNICALL CallNonvirtualFloatMethodV(jobject obj, jclass clazz, jmethodID methodID, va_list args);
303 0, // jfloat JNICALL CallNonvirtualFloatMethodA(jobject obj, jclass clazz, jmethodID methodID, jvalue *args);
305 CallNonvirtualDoubleMethod, // jdouble JNICALL CallNonvirtualDoubleMethod(jobject obj, jclass clazz, jmethodID methodID, ...);
306 CallNonvirtualDoubleMethodV, // jdouble JNICALL CallNonvirtualDoubleMethodV(jobject obj, jclass clazz, jmethodID methodID, va_list args);
307 0, // jdouble JNICALL CallNonvirtualDoubleMethodA(jobject obj, jclass clazz, jmethodID methodID, jvalue *args);
309 CallNonvirtualVoidMethod, // void JNICALL CallNonvirtualVoidMethod(jobject obj, jclass clazz, jmethodID methodID, ...);
310 CallNonvirtualVoidMethodV, // void JNICALL CallNonvirtualVoidMethodV(jobject obj, jclass clazz, jmethodID methodID, va_list args);
311 0, // void JNICALL CallNonvirtualVoidMethodA(jobject obj, jclass clazz, jmethodID methodID, jvalue * args);
313 0, // jfieldID JNICALL GetFieldID(jclass clazz, const char *name, const char *sig);
315 0, // jobject JNICALL GetObjectField(jobject obj, jfieldID fieldID);
316 0, // jboolean JNICALL GetBooleanField(jobject obj, jfieldID fieldID);
317 0, // jbyte JNICALL GetByteField(jobject obj, jfieldID fieldID);
318 0, // jchar JNICALL GetCharField(jobject obj, jfieldID fieldID);
319 0, // jshort JNICALL GetShortField(jobject obj, jfieldID fieldID);
320 0, // jint JNICALL GetIntField(jobject obj, jfieldID fieldID);
321 0, // jlong JNICALL GetLongField(jobject obj, jfieldID fieldID);
322 0, // jfloat JNICALL GetFloatField(jobject obj, jfieldID fieldID);
323 0, // jdouble JNICALL GetDoubleField(jobject obj, jfieldID fieldID);
325 0, // void JNICALL SetObjectField(jobject obj, jfieldID fieldID, jobject val);
326 0, // void JNICALL SetBooleanField(jobject obj, jfieldID fieldID, jboolean val);
327 0, // void JNICALL SetByteField(jobject obj, jfieldID fieldID, jbyte val);
328 0, // void JNICALL SetCharField(jobject obj, jfieldID fieldID, jchar val);
329 0, // void JNICALL SetShortField(jobject obj, jfieldID fieldID, jshort val);
330 0, // void JNICALL SetIntField(jobject obj, jfieldID fieldID, jint val);
331 0, // void JNICALL SetLongField(jobject obj, jfieldID fieldID, jlong val);
332 0, // void JNICALL SetFloatField(jobject obj, jfieldID fieldID, jfloat val);
333 0, // void JNICALL SetDoubleField(jobject obj, jfieldID fieldID, jdouble val);
335 0, // jmethodID JNICALL GetStaticMethodID(jclass clazz, const char *name, const char *sig);
337 CallStaticObjectMethod, // jobject JNICALL CallStaticObjectMethod(jclass clazz, jmethodID methodID, ...);
338 CallStaticObjectMethodV, // jobject JNICALL CallStaticObjectMethodV(jclass clazz, jmethodID methodID, va_list args);
339 0, // jobject JNICALL CallStaticObjectMethodA(jclass clazz, jmethodID methodID, jvalue *args);
341 CallStaticBooleanMethod, // jboolean JNICALL CallStaticBooleanMethod(jclass clazz, jmethodID methodID, ...);
342 CallStaticBooleanMethodV, // jboolean JNICALL CallStaticBooleanMethodV(jclass clazz, jmethodID methodID, va_list args);
343 0, // jboolean JNICALL CallStaticBooleanMethodA(jclass clazz, jmethodID methodID, jvalue *args);
345 CallStaticByteMethod, // jbyte JNICALL CallStaticByteMethod(jclass clazz, jmethodID methodID, ...);
346 CallStaticByteMethodV, // jbyte JNICALL CallStaticByteMethodV(jclass clazz, jmethodID methodID, va_list args);
347 0, // jbyte JNICALL CallStaticByteMethodA(jclass clazz, jmethodID methodID, jvalue *args);
349 CallStaticCharMethod, // jchar JNICALL CallStaticCharMethod(jclass clazz, jmethodID methodID, ...);
350 CallStaticCharMethodV, // jchar JNICALL CallStaticCharMethodV(jclass clazz, jmethodID methodID, va_list args);
351 0, // jchar JNICALL CallStaticCharMethodA(jclass clazz, jmethodID methodID, jvalue *args);
353 CallStaticShortMethod, // jshort JNICALL CallStaticShortMethod(jclass clazz, jmethodID methodID, ...);
354 CallStaticShortMethodV, // jshort JNICALL CallStaticShortMethodV(jclass clazz, jmethodID methodID, va_list args);
355 0, // jshort JNICALL CallStaticShortMethodA(jclass clazz, jmethodID methodID, jvalue *args);
357 CallStaticIntMethod, // jint JNICALL CallStaticIntMethod(jclass clazz, jmethodID methodID, ...);
358 CallStaticIntMethodV, // jint JNICALL CallStaticIntMethodV(jclass clazz, jmethodID methodID, va_list args);
359 0, // jint JNICALL CallStaticIntMethodA(jclass clazz, jmethodID methodID, jvalue *args);
361 CallStaticLongMethod, // jlong JNICALL CallStaticLongMethod(jclass clazz, jmethodID methodID, ...);
362 CallStaticLongMethodV, // jlong JNICALL CallStaticLongMethodV(jclass clazz, jmethodID methodID, va_list args);
363 0, // jlong JNICALL CallStaticLongMethodA(jclass clazz, jmethodID methodID, jvalue *args);
365 CallStaticFloatMethod, // jfloat JNICALL CallStaticFloatMethod(jclass clazz, jmethodID methodID, ...);
366 CallStaticFloatMethodV, // jfloat JNICALL CallStaticFloatMethodV(jclass clazz, jmethodID methodID, va_list args);
367 0, // jfloat JNICALL CallStaticFloatMethodA(jclass clazz, jmethodID methodID, jvalue *args);
369 CallStaticDoubleMethod, // jdouble JNICALL CallStaticDoubleMethod(jclass clazz, jmethodID methodID, ...);
370 CallStaticDoubleMethodV, // jdouble JNICALL CallStaticDoubleMethodV(jclass clazz, jmethodID methodID, va_list args);
371 0, // jdouble JNICALL CallStaticDoubleMethodA(jclass clazz, jmethodID methodID, jvalue *args);
373 CallStaticVoidMethod, // void JNICALL CallStaticVoidMethod(jclass cls, jmethodID methodID, ...);
374 CallStaticVoidMethodV, // void JNICALL CallStaticVoidMethodV(jclass cls, jmethodID methodID, va_list args);
375 0, // void JNICALL CallStaticVoidMethodA(jclass cls, jmethodID methodID, jvalue * args);
377 0, // jfieldID JNICALL GetStaticFieldID(jclass clazz, const char *name, const char *sig);
379 0, // jobject JNICALL GetObjectField(jobject obj, jfieldID fieldID);
380 0, // jboolean JNICALL GetBooleanField(jobject obj, jfieldID fieldID);
381 0, // jbyte JNICALL GetByteField(jobject obj, jfieldID fieldID);
382 0, // jchar JNICALL GetCharField(jobject obj, jfieldID fieldID);
383 0, // jshort JNICALL GetShortField(jobject obj, jfieldID fieldID);
384 0, // jint JNICALL GetIntField(jobject obj, jfieldID fieldID);
385 0, // jlong JNICALL GetLongField(jobject obj, jfieldID fieldID);
386 0, // jfloat JNICALL GetFloatField(jobject obj, jfieldID fieldID);
387 0, // jdouble JNICALL GetDoubleField(jobject obj, jfieldID fieldID);
389 0, // void JNICALL SetObjectField(jobject obj, jfieldID fieldID, jobject val);
390 0, // void JNICALL SetBooleanField(jobject obj, jfieldID fieldID, jboolean val);
391 0, // void JNICALL SetByteField(jobject obj, jfieldID fieldID, jbyte val);
392 0, // void JNICALL SetCharField(jobject obj, jfieldID fieldID, jchar val);
393 0, // void JNICALL SetShortField(jobject obj, jfieldID fieldID, jshort val);
394 0, // void JNICALL SetIntField(jobject obj, jfieldID fieldID, jint val);
395 0, // void JNICALL SetLongField(jobject obj, jfieldID fieldID, jlong val);
396 0, // void JNICALL SetFloatField(jobject obj, jfieldID fieldID, jfloat val);
397 0, // void JNICALL SetDoubleField(jobject obj, jfieldID fieldID, jdouble val);
399 0, // jstring JNICALL NewString(const jchar *unicode, jsize len);
400 0, // jsize JNICALL GetStringLength(jstring str);
401 0, // const jchar *JNICALL GetStringChars(jstring str, jboolean *isCopy);
402 0, // void JNICALL ReleaseStringChars(jstring str, const jchar *chars);
404 0, // jstring JNICALL NewStringUTF(const char *utf);
405 0, // jsize JNICALL GetStringUTFLength(jstring str);
406 0, // const char* JNICALL GetStringUTFChars(jstring str, jboolean *isCopy);
407 0, // void JNICALL ReleaseStringUTFChars(jstring str, const char* chars);
409 0, // jsize JNICALL GetArrayLength(jarray array);
411 0, // jobjectArray JNICALL NewObjectArray(jsize len, jclass clazz, jobject init);
412 0, // jobject JNICALL GetObjectArrayElement(jobjectArray array, jsize index);
413 0, // void JNICALL SetObjectArrayElement(jobjectArray array, jsize index, jobject val);
415 0, // jbooleanArray JNICALL NewBooleanArray(jsize len);
416 0, // jbyteArray JNICALL NewByteArray(jsize len);
417 0, // jcharArray JNICALL NewCharArray(jsize len);
418 0, // jshortArray JNICALL NewShortArray(jsize len);
419 0, // jintArray JNICALL NewIntArray(jsize len);
420 0, // jlongArray JNICALL NewLongArray(jsize len);
421 0, // jfloatArray JNICALL NewFloatArray(jsize len);
422 0, // jdoubleArray JNICALL NewDoubleArray(jsize len);
424 0, // jboolean * JNICALL GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy);
425 0, // jbyte * JNICALL GetByteArrayElements(jbyteArray array, jboolean *isCopy);
426 0, // jchar * JNICALL GetCharArrayElements(jcharArray array, jboolean *isCopy);
427 0, // jshort * JNICALL GetShortArrayElements(jshortArray array, jboolean *isCopy);
428 0, // jint * JNICALL GetIntArrayElements(jintArray array, jboolean *isCopy);
429 0, // jlong * JNICALL GetLongArrayElements(jlongArray array, jboolean *isCopy);
430 0, // jfloat * JNICALL GetFloatArrayElements(jfloatArray array, jboolean *isCopy);
431 0, // jdouble * JNICALL GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy);
433 0, // void JNICALL ReleaseBooleanArrayElements(jbooleanArray array, jboolean *elems, jint mode);
434 0, // void JNICALL ReleaseByteArrayElements(jbyteArray array, jbyte *elems, jint mode);
435 0, // void JNICALL ReleaseCharArrayElements(jcharArray array, jchar *elems, jint mode);
436 0, // void JNICALL ReleaseShortArrayElements(jshortArray array, jshort *elems, jint mode);
437 0, // void JNICALL ReleaseIntArrayElements(jintArray array, jint *elems, jint mode);
438 0, // void JNICALL ReleaseLongArrayElements(jlongArray array, jlong *elems, jint mode);
439 0, // void JNICALL ReleaseFloatArrayElements(jfloatArray array, jfloat *elems, jint mode);
440 0, // void JNICALL ReleaseDoubleArrayElements(jdoubleArray array, jdouble *elems, jint mode);
442 0, // void JNICALL GetBooleanArrayRegion(jbooleanArray array, jsize start, jsize l, jboolean *buf);
443 0, // void JNICALL GetByteArrayRegion(jbyteArray array, jsize start, jsize len, jbyte *buf);
444 0, // void JNICALL GetCharArrayRegion(jcharArray array, jsize start, jsize len, jchar *buf);
445 0, // void JNICALL GetShortArrayRegion(jshortArray array, jsize start, jsize len, jshort *buf);
446 0, // void JNICALL GetIntArrayRegion(jintArray array, jsize start, jsize len, jint *buf);
447 0, // void JNICALL GetLongArrayRegion(jlongArray array, jsize start, jsize len, jlong *buf);
448 0, // void JNICALL GetFloatArrayRegion(jfloatArray array, jsize start, jsize len, jfloat *buf);
449 0, // void JNICALL GetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len, jdouble *buf);
451 0, // void JNICALL SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize l, jboolean *buf);
452 0, // void JNICALL SetByteArrayRegion(jbyteArray array, jsize start, jsize len, jbyte *buf);
453 0, // void JNICALL SetCharArrayRegion(jcharArray array, jsize start, jsize len, jchar *buf);
454 0, // void JNICALL SetShortArrayRegion(jshortArray array, jsize start, jsize len, jshort *buf);
455 0, // void JNICALL SetIntArrayRegion(jintArray array, jsize start, jsize len, jint *buf);
456 0, // void JNICALL SetLongArrayRegion(jlongArray array, jsize start, jsize len, jlong *buf);
457 0, // void JNICALL SetFloatArrayRegion(jfloatArray array, jsize start, jsize len, jfloat *buf);
458 0, // void JNICALL SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len, jdouble *buf);
460 0, // jint JNICALL RegisterNatives(jclass clazz, const JNINativeMethod *methods, jint nMethods);
461 0, // jint JNICALL UnregisterNatives(jclass clazz);
463 0, // jint JNICALL MonitorEnter(jobject obj);
464 0, // jint JNICALL MonitorExit(jobject obj);
466 0, // jint JNICALL GetJavaVM(JavaVM **vm);
468 0, // void JNICALL GetStringRegion(jstring str, jsize start, jsize len, jchar *buf);
469 0, // void JNICALL GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf);
471 0, // void* JNICALL GetPrimitiveArrayCritical(jarray array, jboolean *isCopy);
472 0, // void JNICALL ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode);
474 0, // const jchar* JNICALL GetStringCritical(jstring string, jboolean *isCopy);
475 0, // void JNICALL ReleaseStringCritical(jstring string, const jchar *cstring);
477 0, // jweak JNICALL NewWeakGlobalRef(jobject obj);
478 0, // void JNICALL DeleteWeakGlobalRef(jweak ref);
480 0, // jboolean JNICALL ExceptionCheck();
482 0, // jobject JNICALL NewDirectByteBuffer(void* address, jlong capacity);
483 0, // void* JNICALL GetDirectBufferAddress(jobject buf);
484 0 // jlong JNICALL GetDirectBufferCapacity(jobject buf);
487 JNIEXPORT void** JNICALL ikvm_GetJNIEnvVTable()
489 return JNIEnv_vtable;
492 JNIEXPORT void* JNICALL ikvm_MarshalDelegate(void* p)
494 return p;
497 typedef jint (JNICALL *PJNI_ONLOAD)(JavaVM* vm, void* reserved);
499 JNIEXPORT jint JNICALL ikvm_CallOnLoad(PJNI_ONLOAD method, JavaVM* vm, void* reserved)
501 return method(vm, reserved);