2 * @(#)jni.h 1.61 05/11/17
4 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
9 * We used part of Netscape's Java Runtime Interface (JRI) as the starting
10 * point of our design and implementation.
13 /******************************************************************************
14 * Java Runtime Interface
15 * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved.
16 *****************************************************************************/
18 #ifndef _JAVASOFT_JNI_H_
19 #define _JAVASOFT_JNI_H_
24 /* jni_md.h contains the machine-dependent typedefs for jbyte, jint
37 #ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H
39 typedef unsigned char jboolean;
40 typedef unsigned short jchar;
43 typedef double jdouble;
50 class _jclass : public _jobject {};
51 class _jthrowable : public _jobject {};
52 class _jstring : public _jobject {};
53 class _jarray : public _jobject {};
54 class _jbooleanArray : public _jarray {};
55 class _jbyteArray : public _jarray {};
56 class _jcharArray : public _jarray {};
57 class _jshortArray : public _jarray {};
58 class _jintArray : public _jarray {};
59 class _jlongArray : public _jarray {};
60 class _jfloatArray : public _jarray {};
61 class _jdoubleArray : public _jarray {};
62 class _jobjectArray : public _jarray {};
64 typedef _jobject *jobject;
65 typedef _jclass *jclass;
66 typedef _jthrowable *jthrowable;
67 typedef _jstring *jstring;
68 typedef _jarray *jarray;
69 typedef _jbooleanArray *jbooleanArray;
70 typedef _jbyteArray *jbyteArray;
71 typedef _jcharArray *jcharArray;
72 typedef _jshortArray *jshortArray;
73 typedef _jintArray *jintArray;
74 typedef _jlongArray *jlongArray;
75 typedef _jfloatArray *jfloatArray;
76 typedef _jdoubleArray *jdoubleArray;
77 typedef _jobjectArray *jobjectArray;
83 typedef struct _jobject *jobject;
84 typedef jobject jclass;
85 typedef jobject jthrowable;
86 typedef jobject jstring;
87 typedef jobject jarray;
88 typedef jarray jbooleanArray;
89 typedef jarray jbyteArray;
90 typedef jarray jcharArray;
91 typedef jarray jshortArray;
92 typedef jarray jintArray;
93 typedef jarray jlongArray;
94 typedef jarray jfloatArray;
95 typedef jarray jdoubleArray;
96 typedef jarray jobjectArray;
100 typedef jobject jweak;
102 typedef union jvalue {
115 typedef struct _jfieldID *jfieldID;
118 typedef struct _jmethodID *jmethodID;
120 /* Return values from jobjectRefType */
121 typedef enum _jobjectType {
122 JNIInvalidRefType = 0,
124 JNIGlobalRefType = 2,
125 JNIWeakGlobalRefType = 3
129 #endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */
139 * possible return values for JNI functions.
142 #define JNI_OK 0 /* success */
143 #define JNI_ERR (-1) /* unknown error */
144 #define JNI_EDETACHED (-2) /* thread detached from the VM */
145 #define JNI_EVERSION (-3) /* JNI version error */
146 #define JNI_ENOMEM (-4) /* not enough memory */
147 #define JNI_EEXIST (-5) /* VM already created */
148 #define JNI_EINVAL (-6) /* invalid arguments */
151 * used in ReleaseScalarArrayElements
158 * used in RegisterNatives to describe native method name, signature,
159 * and function pointer.
169 * JNI Native Method Interface.
172 struct JNINativeInterface_;
177 typedef JNIEnv_ JNIEnv;
179 typedef const struct JNINativeInterface_ *JNIEnv;
183 * JNI Invocation Interface.
186 struct JNIInvokeInterface_;
191 typedef JavaVM_ JavaVM;
193 typedef const struct JNIInvokeInterface_ *JavaVM;
196 struct JNINativeInterface_ {
202 jint (JNICALL *GetVersion)(JNIEnv *env);
204 jclass (JNICALL *DefineClass)
205 (JNIEnv *env, const char *name, jobject loader, const jbyte *buf,
207 jclass (JNICALL *FindClass)
208 (JNIEnv *env, const char *name);
210 jmethodID (JNICALL *FromReflectedMethod)
211 (JNIEnv *env, jobject method);
212 jfieldID (JNICALL *FromReflectedField)
213 (JNIEnv *env, jobject field);
215 jobject (JNICALL *ToReflectedMethod)
216 (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic);
218 jclass (JNICALL *GetSuperclass)
219 (JNIEnv *env, jclass sub);
220 jboolean (JNICALL *IsAssignableFrom)
221 (JNIEnv *env, jclass sub, jclass sup);
223 jobject (JNICALL *ToReflectedField)
224 (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic);
226 jint (JNICALL *Throw)
227 (JNIEnv *env, jthrowable obj);
228 jint (JNICALL *ThrowNew)
229 (JNIEnv *env, jclass clazz, const char *msg);
230 jthrowable (JNICALL *ExceptionOccurred)
232 void (JNICALL *ExceptionDescribe)
234 void (JNICALL *ExceptionClear)
236 void (JNICALL *FatalError)
237 (JNIEnv *env, const char *msg);
239 jint (JNICALL *PushLocalFrame)
240 (JNIEnv *env, jint capacity);
241 jobject (JNICALL *PopLocalFrame)
242 (JNIEnv *env, jobject result);
244 jobject (JNICALL *NewGlobalRef)
245 (JNIEnv *env, jobject lobj);
246 void (JNICALL *DeleteGlobalRef)
247 (JNIEnv *env, jobject gref);
248 void (JNICALL *DeleteLocalRef)
249 (JNIEnv *env, jobject obj);
250 jboolean (JNICALL *IsSameObject)
251 (JNIEnv *env, jobject obj1, jobject obj2);
252 jobject (JNICALL *NewLocalRef)
253 (JNIEnv *env, jobject ref);
254 jint (JNICALL *EnsureLocalCapacity)
255 (JNIEnv *env, jint capacity);
257 jobject (JNICALL *AllocObject)
258 (JNIEnv *env, jclass clazz);
259 jobject (JNICALL *NewObject)
260 (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
261 jobject (JNICALL *NewObjectV)
262 (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
263 jobject (JNICALL *NewObjectA)
264 (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
266 jclass (JNICALL *GetObjectClass)
267 (JNIEnv *env, jobject obj);
268 jboolean (JNICALL *IsInstanceOf)
269 (JNIEnv *env, jobject obj, jclass clazz);
271 jmethodID (JNICALL *GetMethodID)
272 (JNIEnv *env, jclass clazz, const char *name, const char *sig);
274 jobject (JNICALL *CallObjectMethod)
275 (JNIEnv *env, jobject obj, jmethodID methodID, ...);
276 jobject (JNICALL *CallObjectMethodV)
277 (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
278 jobject (JNICALL *CallObjectMethodA)
279 (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
281 jboolean (JNICALL *CallBooleanMethod)
282 (JNIEnv *env, jobject obj, jmethodID methodID, ...);
283 jboolean (JNICALL *CallBooleanMethodV)
284 (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
285 jboolean (JNICALL *CallBooleanMethodA)
286 (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
288 jbyte (JNICALL *CallByteMethod)
289 (JNIEnv *env, jobject obj, jmethodID methodID, ...);
290 jbyte (JNICALL *CallByteMethodV)
291 (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
292 jbyte (JNICALL *CallByteMethodA)
293 (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
295 jchar (JNICALL *CallCharMethod)
296 (JNIEnv *env, jobject obj, jmethodID methodID, ...);
297 jchar (JNICALL *CallCharMethodV)
298 (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
299 jchar (JNICALL *CallCharMethodA)
300 (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
302 jshort (JNICALL *CallShortMethod)
303 (JNIEnv *env, jobject obj, jmethodID methodID, ...);
304 jshort (JNICALL *CallShortMethodV)
305 (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
306 jshort (JNICALL *CallShortMethodA)
307 (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
309 jint (JNICALL *CallIntMethod)
310 (JNIEnv *env, jobject obj, jmethodID methodID, ...);
311 jint (JNICALL *CallIntMethodV)
312 (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
313 jint (JNICALL *CallIntMethodA)
314 (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
316 jlong (JNICALL *CallLongMethod)
317 (JNIEnv *env, jobject obj, jmethodID methodID, ...);
318 jlong (JNICALL *CallLongMethodV)
319 (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
320 jlong (JNICALL *CallLongMethodA)
321 (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
323 jfloat (JNICALL *CallFloatMethod)
324 (JNIEnv *env, jobject obj, jmethodID methodID, ...);
325 jfloat (JNICALL *CallFloatMethodV)
326 (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
327 jfloat (JNICALL *CallFloatMethodA)
328 (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
330 jdouble (JNICALL *CallDoubleMethod)
331 (JNIEnv *env, jobject obj, jmethodID methodID, ...);
332 jdouble (JNICALL *CallDoubleMethodV)
333 (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
334 jdouble (JNICALL *CallDoubleMethodA)
335 (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
337 void (JNICALL *CallVoidMethod)
338 (JNIEnv *env, jobject obj, jmethodID methodID, ...);
339 void (JNICALL *CallVoidMethodV)
340 (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
341 void (JNICALL *CallVoidMethodA)
342 (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
344 jobject (JNICALL *CallNonvirtualObjectMethod)
345 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
346 jobject (JNICALL *CallNonvirtualObjectMethodV)
347 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
349 jobject (JNICALL *CallNonvirtualObjectMethodA)
350 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
351 const jvalue * args);
353 jboolean (JNICALL *CallNonvirtualBooleanMethod)
354 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
355 jboolean (JNICALL *CallNonvirtualBooleanMethodV)
356 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
358 jboolean (JNICALL *CallNonvirtualBooleanMethodA)
359 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
360 const jvalue * args);
362 jbyte (JNICALL *CallNonvirtualByteMethod)
363 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
364 jbyte (JNICALL *CallNonvirtualByteMethodV)
365 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
367 jbyte (JNICALL *CallNonvirtualByteMethodA)
368 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
371 jchar (JNICALL *CallNonvirtualCharMethod)
372 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
373 jchar (JNICALL *CallNonvirtualCharMethodV)
374 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
376 jchar (JNICALL *CallNonvirtualCharMethodA)
377 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
380 jshort (JNICALL *CallNonvirtualShortMethod)
381 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
382 jshort (JNICALL *CallNonvirtualShortMethodV)
383 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
385 jshort (JNICALL *CallNonvirtualShortMethodA)
386 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
389 jint (JNICALL *CallNonvirtualIntMethod)
390 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
391 jint (JNICALL *CallNonvirtualIntMethodV)
392 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
394 jint (JNICALL *CallNonvirtualIntMethodA)
395 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
398 jlong (JNICALL *CallNonvirtualLongMethod)
399 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
400 jlong (JNICALL *CallNonvirtualLongMethodV)
401 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
403 jlong (JNICALL *CallNonvirtualLongMethodA)
404 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
407 jfloat (JNICALL *CallNonvirtualFloatMethod)
408 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
409 jfloat (JNICALL *CallNonvirtualFloatMethodV)
410 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
412 jfloat (JNICALL *CallNonvirtualFloatMethodA)
413 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
416 jdouble (JNICALL *CallNonvirtualDoubleMethod)
417 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
418 jdouble (JNICALL *CallNonvirtualDoubleMethodV)
419 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
421 jdouble (JNICALL *CallNonvirtualDoubleMethodA)
422 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
425 void (JNICALL *CallNonvirtualVoidMethod)
426 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
427 void (JNICALL *CallNonvirtualVoidMethodV)
428 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
430 void (JNICALL *CallNonvirtualVoidMethodA)
431 (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
432 const jvalue * args);
434 jfieldID (JNICALL *GetFieldID)
435 (JNIEnv *env, jclass clazz, const char *name, const char *sig);
437 jobject (JNICALL *GetObjectField)
438 (JNIEnv *env, jobject obj, jfieldID fieldID);
439 jboolean (JNICALL *GetBooleanField)
440 (JNIEnv *env, jobject obj, jfieldID fieldID);
441 jbyte (JNICALL *GetByteField)
442 (JNIEnv *env, jobject obj, jfieldID fieldID);
443 jchar (JNICALL *GetCharField)
444 (JNIEnv *env, jobject obj, jfieldID fieldID);
445 jshort (JNICALL *GetShortField)
446 (JNIEnv *env, jobject obj, jfieldID fieldID);
447 jint (JNICALL *GetIntField)
448 (JNIEnv *env, jobject obj, jfieldID fieldID);
449 jlong (JNICALL *GetLongField)
450 (JNIEnv *env, jobject obj, jfieldID fieldID);
451 jfloat (JNICALL *GetFloatField)
452 (JNIEnv *env, jobject obj, jfieldID fieldID);
453 jdouble (JNICALL *GetDoubleField)
454 (JNIEnv *env, jobject obj, jfieldID fieldID);
456 void (JNICALL *SetObjectField)
457 (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val);
458 void (JNICALL *SetBooleanField)
459 (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val);
460 void (JNICALL *SetByteField)
461 (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val);
462 void (JNICALL *SetCharField)
463 (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val);
464 void (JNICALL *SetShortField)
465 (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val);
466 void (JNICALL *SetIntField)
467 (JNIEnv *env, jobject obj, jfieldID fieldID, jint val);
468 void (JNICALL *SetLongField)
469 (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val);
470 void (JNICALL *SetFloatField)
471 (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val);
472 void (JNICALL *SetDoubleField)
473 (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val);
475 jmethodID (JNICALL *GetStaticMethodID)
476 (JNIEnv *env, jclass clazz, const char *name, const char *sig);
478 jobject (JNICALL *CallStaticObjectMethod)
479 (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
480 jobject (JNICALL *CallStaticObjectMethodV)
481 (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
482 jobject (JNICALL *CallStaticObjectMethodA)
483 (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
485 jboolean (JNICALL *CallStaticBooleanMethod)
486 (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
487 jboolean (JNICALL *CallStaticBooleanMethodV)
488 (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
489 jboolean (JNICALL *CallStaticBooleanMethodA)
490 (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
492 jbyte (JNICALL *CallStaticByteMethod)
493 (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
494 jbyte (JNICALL *CallStaticByteMethodV)
495 (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
496 jbyte (JNICALL *CallStaticByteMethodA)
497 (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
499 jchar (JNICALL *CallStaticCharMethod)
500 (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
501 jchar (JNICALL *CallStaticCharMethodV)
502 (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
503 jchar (JNICALL *CallStaticCharMethodA)
504 (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
506 jshort (JNICALL *CallStaticShortMethod)
507 (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
508 jshort (JNICALL *CallStaticShortMethodV)
509 (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
510 jshort (JNICALL *CallStaticShortMethodA)
511 (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
513 jint (JNICALL *CallStaticIntMethod)
514 (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
515 jint (JNICALL *CallStaticIntMethodV)
516 (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
517 jint (JNICALL *CallStaticIntMethodA)
518 (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
520 jlong (JNICALL *CallStaticLongMethod)
521 (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
522 jlong (JNICALL *CallStaticLongMethodV)
523 (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
524 jlong (JNICALL *CallStaticLongMethodA)
525 (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
527 jfloat (JNICALL *CallStaticFloatMethod)
528 (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
529 jfloat (JNICALL *CallStaticFloatMethodV)
530 (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
531 jfloat (JNICALL *CallStaticFloatMethodA)
532 (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
534 jdouble (JNICALL *CallStaticDoubleMethod)
535 (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
536 jdouble (JNICALL *CallStaticDoubleMethodV)
537 (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
538 jdouble (JNICALL *CallStaticDoubleMethodA)
539 (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
541 void (JNICALL *CallStaticVoidMethod)
542 (JNIEnv *env, jclass cls, jmethodID methodID, ...);
543 void (JNICALL *CallStaticVoidMethodV)
544 (JNIEnv *env, jclass cls, jmethodID methodID, va_list args);
545 void (JNICALL *CallStaticVoidMethodA)
546 (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args);
548 jfieldID (JNICALL *GetStaticFieldID)
549 (JNIEnv *env, jclass clazz, const char *name, const char *sig);
550 jobject (JNICALL *GetStaticObjectField)
551 (JNIEnv *env, jclass clazz, jfieldID fieldID);
552 jboolean (JNICALL *GetStaticBooleanField)
553 (JNIEnv *env, jclass clazz, jfieldID fieldID);
554 jbyte (JNICALL *GetStaticByteField)
555 (JNIEnv *env, jclass clazz, jfieldID fieldID);
556 jchar (JNICALL *GetStaticCharField)
557 (JNIEnv *env, jclass clazz, jfieldID fieldID);
558 jshort (JNICALL *GetStaticShortField)
559 (JNIEnv *env, jclass clazz, jfieldID fieldID);
560 jint (JNICALL *GetStaticIntField)
561 (JNIEnv *env, jclass clazz, jfieldID fieldID);
562 jlong (JNICALL *GetStaticLongField)
563 (JNIEnv *env, jclass clazz, jfieldID fieldID);
564 jfloat (JNICALL *GetStaticFloatField)
565 (JNIEnv *env, jclass clazz, jfieldID fieldID);
566 jdouble (JNICALL *GetStaticDoubleField)
567 (JNIEnv *env, jclass clazz, jfieldID fieldID);
569 void (JNICALL *SetStaticObjectField)
570 (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value);
571 void (JNICALL *SetStaticBooleanField)
572 (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value);
573 void (JNICALL *SetStaticByteField)
574 (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value);
575 void (JNICALL *SetStaticCharField)
576 (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value);
577 void (JNICALL *SetStaticShortField)
578 (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value);
579 void (JNICALL *SetStaticIntField)
580 (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value);
581 void (JNICALL *SetStaticLongField)
582 (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value);
583 void (JNICALL *SetStaticFloatField)
584 (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value);
585 void (JNICALL *SetStaticDoubleField)
586 (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value);
588 jstring (JNICALL *NewString)
589 (JNIEnv *env, const jchar *unicode, jsize len);
590 jsize (JNICALL *GetStringLength)
591 (JNIEnv *env, jstring str);
592 const jchar *(JNICALL *GetStringChars)
593 (JNIEnv *env, jstring str, jboolean *isCopy);
594 void (JNICALL *ReleaseStringChars)
595 (JNIEnv *env, jstring str, const jchar *chars);
597 jstring (JNICALL *NewStringUTF)
598 (JNIEnv *env, const char *utf);
599 jsize (JNICALL *GetStringUTFLength)
600 (JNIEnv *env, jstring str);
601 const char* (JNICALL *GetStringUTFChars)
602 (JNIEnv *env, jstring str, jboolean *isCopy);
603 void (JNICALL *ReleaseStringUTFChars)
604 (JNIEnv *env, jstring str, const char* chars);
607 jsize (JNICALL *GetArrayLength)
608 (JNIEnv *env, jarray array);
610 jobjectArray (JNICALL *NewObjectArray)
611 (JNIEnv *env, jsize len, jclass clazz, jobject init);
612 jobject (JNICALL *GetObjectArrayElement)
613 (JNIEnv *env, jobjectArray array, jsize index);
614 void (JNICALL *SetObjectArrayElement)
615 (JNIEnv *env, jobjectArray array, jsize index, jobject val);
617 jbooleanArray (JNICALL *NewBooleanArray)
618 (JNIEnv *env, jsize len);
619 jbyteArray (JNICALL *NewByteArray)
620 (JNIEnv *env, jsize len);
621 jcharArray (JNICALL *NewCharArray)
622 (JNIEnv *env, jsize len);
623 jshortArray (JNICALL *NewShortArray)
624 (JNIEnv *env, jsize len);
625 jintArray (JNICALL *NewIntArray)
626 (JNIEnv *env, jsize len);
627 jlongArray (JNICALL *NewLongArray)
628 (JNIEnv *env, jsize len);
629 jfloatArray (JNICALL *NewFloatArray)
630 (JNIEnv *env, jsize len);
631 jdoubleArray (JNICALL *NewDoubleArray)
632 (JNIEnv *env, jsize len);
634 jboolean * (JNICALL *GetBooleanArrayElements)
635 (JNIEnv *env, jbooleanArray array, jboolean *isCopy);
636 jbyte * (JNICALL *GetByteArrayElements)
637 (JNIEnv *env, jbyteArray array, jboolean *isCopy);
638 jchar * (JNICALL *GetCharArrayElements)
639 (JNIEnv *env, jcharArray array, jboolean *isCopy);
640 jshort * (JNICALL *GetShortArrayElements)
641 (JNIEnv *env, jshortArray array, jboolean *isCopy);
642 jint * (JNICALL *GetIntArrayElements)
643 (JNIEnv *env, jintArray array, jboolean *isCopy);
644 jlong * (JNICALL *GetLongArrayElements)
645 (JNIEnv *env, jlongArray array, jboolean *isCopy);
646 jfloat * (JNICALL *GetFloatArrayElements)
647 (JNIEnv *env, jfloatArray array, jboolean *isCopy);
648 jdouble * (JNICALL *GetDoubleArrayElements)
649 (JNIEnv *env, jdoubleArray array, jboolean *isCopy);
651 void (JNICALL *ReleaseBooleanArrayElements)
652 (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode);
653 void (JNICALL *ReleaseByteArrayElements)
654 (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode);
655 void (JNICALL *ReleaseCharArrayElements)
656 (JNIEnv *env, jcharArray array, jchar *elems, jint mode);
657 void (JNICALL *ReleaseShortArrayElements)
658 (JNIEnv *env, jshortArray array, jshort *elems, jint mode);
659 void (JNICALL *ReleaseIntArrayElements)
660 (JNIEnv *env, jintArray array, jint *elems, jint mode);
661 void (JNICALL *ReleaseLongArrayElements)
662 (JNIEnv *env, jlongArray array, jlong *elems, jint mode);
663 void (JNICALL *ReleaseFloatArrayElements)
664 (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode);
665 void (JNICALL *ReleaseDoubleArrayElements)
666 (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode);
668 void (JNICALL *GetBooleanArrayRegion)
669 (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf);
670 void (JNICALL *GetByteArrayRegion)
671 (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf);
672 void (JNICALL *GetCharArrayRegion)
673 (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf);
674 void (JNICALL *GetShortArrayRegion)
675 (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf);
676 void (JNICALL *GetIntArrayRegion)
677 (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf);
678 void (JNICALL *GetLongArrayRegion)
679 (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf);
680 void (JNICALL *GetFloatArrayRegion)
681 (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf);
682 void (JNICALL *GetDoubleArrayRegion)
683 (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf);
685 void (JNICALL *SetBooleanArrayRegion)
686 (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf);
687 void (JNICALL *SetByteArrayRegion)
688 (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf);
689 void (JNICALL *SetCharArrayRegion)
690 (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf);
691 void (JNICALL *SetShortArrayRegion)
692 (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf);
693 void (JNICALL *SetIntArrayRegion)
694 (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf);
695 void (JNICALL *SetLongArrayRegion)
696 (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf);
697 void (JNICALL *SetFloatArrayRegion)
698 (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf);
699 void (JNICALL *SetDoubleArrayRegion)
700 (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf);
702 jint (JNICALL *RegisterNatives)
703 (JNIEnv *env, jclass clazz, const JNINativeMethod *methods,
705 jint (JNICALL *UnregisterNatives)
706 (JNIEnv *env, jclass clazz);
708 jint (JNICALL *MonitorEnter)
709 (JNIEnv *env, jobject obj);
710 jint (JNICALL *MonitorExit)
711 (JNIEnv *env, jobject obj);
713 jint (JNICALL *GetJavaVM)
714 (JNIEnv *env, JavaVM **vm);
716 void (JNICALL *GetStringRegion)
717 (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf);
718 void (JNICALL *GetStringUTFRegion)
719 (JNIEnv *env, jstring str, jsize start, jsize len, char *buf);
721 void * (JNICALL *GetPrimitiveArrayCritical)
722 (JNIEnv *env, jarray array, jboolean *isCopy);
723 void (JNICALL *ReleasePrimitiveArrayCritical)
724 (JNIEnv *env, jarray array, void *carray, jint mode);
726 const jchar * (JNICALL *GetStringCritical)
727 (JNIEnv *env, jstring string, jboolean *isCopy);
728 void (JNICALL *ReleaseStringCritical)
729 (JNIEnv *env, jstring string, const jchar *cstring);
731 jweak (JNICALL *NewWeakGlobalRef)
732 (JNIEnv *env, jobject obj);
733 void (JNICALL *DeleteWeakGlobalRef)
734 (JNIEnv *env, jweak ref);
736 jboolean (JNICALL *ExceptionCheck)
739 jobject (JNICALL *NewDirectByteBuffer)
740 (JNIEnv* env, void* address, jlong capacity);
741 void* (JNICALL *GetDirectBufferAddress)
742 (JNIEnv* env, jobject buf);
743 jlong (JNICALL *GetDirectBufferCapacity)
744 (JNIEnv* env, jobject buf);
746 /* New JNI 1.6 Features */
748 jobjectRefType (JNICALL *GetObjectRefType)
749 (JNIEnv* env, jobject obj);
753 * We use inlined functions for C++ so that programmers can write:
755 * env->FindClass("java/lang/String")
757 * in C++ rather than:
759 * (*env)->FindClass(env, "java/lang/String")
765 const struct JNINativeInterface_ *functions;
769 return functions->GetVersion(this);
771 jclass DefineClass(const char *name, jobject loader, const jbyte *buf,
773 return functions->DefineClass(this, name, loader, buf, len);
775 jclass FindClass(const char *name) {
776 return functions->FindClass(this, name);
778 jmethodID FromReflectedMethod(jobject method) {
779 return functions->FromReflectedMethod(this,method);
781 jfieldID FromReflectedField(jobject field) {
782 return functions->FromReflectedField(this,field);
785 jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) {
786 return functions->ToReflectedMethod(this, cls, methodID, isStatic);
789 jclass GetSuperclass(jclass sub) {
790 return functions->GetSuperclass(this, sub);
792 jboolean IsAssignableFrom(jclass sub, jclass sup) {
793 return functions->IsAssignableFrom(this, sub, sup);
796 jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) {
797 return functions->ToReflectedField(this,cls,fieldID,isStatic);
800 jint Throw(jthrowable obj) {
801 return functions->Throw(this, obj);
803 jint ThrowNew(jclass clazz, const char *msg) {
804 return functions->ThrowNew(this, clazz, msg);
806 jthrowable ExceptionOccurred() {
807 return functions->ExceptionOccurred(this);
809 void ExceptionDescribe() {
810 functions->ExceptionDescribe(this);
812 void ExceptionClear() {
813 functions->ExceptionClear(this);
815 void FatalError(const char *msg) {
816 functions->FatalError(this, msg);
819 jint PushLocalFrame(jint capacity) {
820 return functions->PushLocalFrame(this,capacity);
822 jobject PopLocalFrame(jobject result) {
823 return functions->PopLocalFrame(this,result);
826 jobject NewGlobalRef(jobject lobj) {
827 return functions->NewGlobalRef(this,lobj);
829 void DeleteGlobalRef(jobject gref) {
830 functions->DeleteGlobalRef(this,gref);
832 void DeleteLocalRef(jobject obj) {
833 functions->DeleteLocalRef(this, obj);
836 jboolean IsSameObject(jobject obj1, jobject obj2) {
837 return functions->IsSameObject(this,obj1,obj2);
840 jobject NewLocalRef(jobject ref) {
841 return functions->NewLocalRef(this,ref);
843 jint EnsureLocalCapacity(jint capacity) {
844 return functions->EnsureLocalCapacity(this,capacity);
847 jobject AllocObject(jclass clazz) {
848 return functions->AllocObject(this,clazz);
850 jobject NewObject(jclass clazz, jmethodID methodID, ...) {
853 va_start(args, methodID);
854 result = functions->NewObjectV(this,clazz,methodID,args);
858 jobject NewObjectV(jclass clazz, jmethodID methodID,
860 return functions->NewObjectV(this,clazz,methodID,args);
862 jobject NewObjectA(jclass clazz, jmethodID methodID,
863 const jvalue *args) {
864 return functions->NewObjectA(this,clazz,methodID,args);
867 jclass GetObjectClass(jobject obj) {
868 return functions->GetObjectClass(this,obj);
870 jboolean IsInstanceOf(jobject obj, jclass clazz) {
871 return functions->IsInstanceOf(this,obj,clazz);
874 jmethodID GetMethodID(jclass clazz, const char *name,
876 return functions->GetMethodID(this,clazz,name,sig);
879 jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) {
882 va_start(args,methodID);
883 result = functions->CallObjectMethodV(this,obj,methodID,args);
887 jobject CallObjectMethodV(jobject obj, jmethodID methodID,
889 return functions->CallObjectMethodV(this,obj,methodID,args);
891 jobject CallObjectMethodA(jobject obj, jmethodID methodID,
892 const jvalue * args) {
893 return functions->CallObjectMethodA(this,obj,methodID,args);
896 jboolean CallBooleanMethod(jobject obj,
897 jmethodID methodID, ...) {
900 va_start(args,methodID);
901 result = functions->CallBooleanMethodV(this,obj,methodID,args);
905 jboolean CallBooleanMethodV(jobject obj, jmethodID methodID,
907 return functions->CallBooleanMethodV(this,obj,methodID,args);
909 jboolean CallBooleanMethodA(jobject obj, jmethodID methodID,
910 const jvalue * args) {
911 return functions->CallBooleanMethodA(this,obj,methodID, args);
914 jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) {
917 va_start(args,methodID);
918 result = functions->CallByteMethodV(this,obj,methodID,args);
922 jbyte CallByteMethodV(jobject obj, jmethodID methodID,
924 return functions->CallByteMethodV(this,obj,methodID,args);
926 jbyte CallByteMethodA(jobject obj, jmethodID methodID,
927 const jvalue * args) {
928 return functions->CallByteMethodA(this,obj,methodID,args);
931 jchar CallCharMethod(jobject obj, jmethodID methodID, ...) {
934 va_start(args,methodID);
935 result = functions->CallCharMethodV(this,obj,methodID,args);
939 jchar CallCharMethodV(jobject obj, jmethodID methodID,
941 return functions->CallCharMethodV(this,obj,methodID,args);
943 jchar CallCharMethodA(jobject obj, jmethodID methodID,
944 const jvalue * args) {
945 return functions->CallCharMethodA(this,obj,methodID,args);
948 jshort CallShortMethod(jobject obj, jmethodID methodID, ...) {
951 va_start(args,methodID);
952 result = functions->CallShortMethodV(this,obj,methodID,args);
956 jshort CallShortMethodV(jobject obj, jmethodID methodID,
958 return functions->CallShortMethodV(this,obj,methodID,args);
960 jshort CallShortMethodA(jobject obj, jmethodID methodID,
961 const jvalue * args) {
962 return functions->CallShortMethodA(this,obj,methodID,args);
965 jint CallIntMethod(jobject obj, jmethodID methodID, ...) {
968 va_start(args,methodID);
969 result = functions->CallIntMethodV(this,obj,methodID,args);
973 jint CallIntMethodV(jobject obj, jmethodID methodID,
975 return functions->CallIntMethodV(this,obj,methodID,args);
977 jint CallIntMethodA(jobject obj, jmethodID methodID,
978 const jvalue * args) {
979 return functions->CallIntMethodA(this,obj,methodID,args);
982 jlong CallLongMethod(jobject obj, jmethodID methodID, ...) {
985 va_start(args,methodID);
986 result = functions->CallLongMethodV(this,obj,methodID,args);
990 jlong CallLongMethodV(jobject obj, jmethodID methodID,
992 return functions->CallLongMethodV(this,obj,methodID,args);
994 jlong CallLongMethodA(jobject obj, jmethodID methodID,
995 const jvalue * args) {
996 return functions->CallLongMethodA(this,obj,methodID,args);
999 jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) {
1002 va_start(args,methodID);
1003 result = functions->CallFloatMethodV(this,obj,methodID,args);
1007 jfloat CallFloatMethodV(jobject obj, jmethodID methodID,
1009 return functions->CallFloatMethodV(this,obj,methodID,args);
1011 jfloat CallFloatMethodA(jobject obj, jmethodID methodID,
1012 const jvalue * args) {
1013 return functions->CallFloatMethodA(this,obj,methodID,args);
1016 jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) {
1019 va_start(args,methodID);
1020 result = functions->CallDoubleMethodV(this,obj,methodID,args);
1024 jdouble CallDoubleMethodV(jobject obj, jmethodID methodID,
1026 return functions->CallDoubleMethodV(this,obj,methodID,args);
1028 jdouble CallDoubleMethodA(jobject obj, jmethodID methodID,
1029 const jvalue * args) {
1030 return functions->CallDoubleMethodA(this,obj,methodID,args);
1033 void CallVoidMethod(jobject obj, jmethodID methodID, ...) {
1035 va_start(args,methodID);
1036 functions->CallVoidMethodV(this,obj,methodID,args);
1039 void CallVoidMethodV(jobject obj, jmethodID methodID,
1041 functions->CallVoidMethodV(this,obj,methodID,args);
1043 void CallVoidMethodA(jobject obj, jmethodID methodID,
1044 const jvalue * args) {
1045 functions->CallVoidMethodA(this,obj,methodID,args);
1048 jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz,
1049 jmethodID methodID, ...) {
1052 va_start(args,methodID);
1053 result = functions->CallNonvirtualObjectMethodV(this,obj,clazz,
1058 jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz,
1059 jmethodID methodID, va_list args) {
1060 return functions->CallNonvirtualObjectMethodV(this,obj,clazz,
1063 jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz,
1064 jmethodID methodID, const jvalue * args) {
1065 return functions->CallNonvirtualObjectMethodA(this,obj,clazz,
1069 jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz,
1070 jmethodID methodID, ...) {
1073 va_start(args,methodID);
1074 result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
1079 jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz,
1080 jmethodID methodID, va_list args) {
1081 return functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
1084 jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz,
1085 jmethodID methodID, const jvalue * args) {
1086 return functions->CallNonvirtualBooleanMethodA(this,obj,clazz,
1090 jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz,
1091 jmethodID methodID, ...) {
1094 va_start(args,methodID);
1095 result = functions->CallNonvirtualByteMethodV(this,obj,clazz,
1100 jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz,
1101 jmethodID methodID, va_list args) {
1102 return functions->CallNonvirtualByteMethodV(this,obj,clazz,
1105 jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz,
1106 jmethodID methodID, const jvalue * args) {
1107 return functions->CallNonvirtualByteMethodA(this,obj,clazz,
1111 jchar CallNonvirtualCharMethod(jobject obj, jclass clazz,
1112 jmethodID methodID, ...) {
1115 va_start(args,methodID);
1116 result = functions->CallNonvirtualCharMethodV(this,obj,clazz,
1121 jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz,
1122 jmethodID methodID, va_list args) {
1123 return functions->CallNonvirtualCharMethodV(this,obj,clazz,
1126 jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz,
1127 jmethodID methodID, const jvalue * args) {
1128 return functions->CallNonvirtualCharMethodA(this,obj,clazz,
1132 jshort CallNonvirtualShortMethod(jobject obj, jclass clazz,
1133 jmethodID methodID, ...) {
1136 va_start(args,methodID);
1137 result = functions->CallNonvirtualShortMethodV(this,obj,clazz,
1142 jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz,
1143 jmethodID methodID, va_list args) {
1144 return functions->CallNonvirtualShortMethodV(this,obj,clazz,
1147 jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz,
1148 jmethodID methodID, const jvalue * args) {
1149 return functions->CallNonvirtualShortMethodA(this,obj,clazz,
1153 jint CallNonvirtualIntMethod(jobject obj, jclass clazz,
1154 jmethodID methodID, ...) {
1157 va_start(args,methodID);
1158 result = functions->CallNonvirtualIntMethodV(this,obj,clazz,
1163 jint CallNonvirtualIntMethodV(jobject obj, jclass clazz,
1164 jmethodID methodID, va_list args) {
1165 return functions->CallNonvirtualIntMethodV(this,obj,clazz,
1168 jint CallNonvirtualIntMethodA(jobject obj, jclass clazz,
1169 jmethodID methodID, const jvalue * args) {
1170 return functions->CallNonvirtualIntMethodA(this,obj,clazz,
1174 jlong CallNonvirtualLongMethod(jobject obj, jclass clazz,
1175 jmethodID methodID, ...) {
1178 va_start(args,methodID);
1179 result = functions->CallNonvirtualLongMethodV(this,obj,clazz,
1184 jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz,
1185 jmethodID methodID, va_list args) {
1186 return functions->CallNonvirtualLongMethodV(this,obj,clazz,
1189 jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz,
1190 jmethodID methodID, const jvalue * args) {
1191 return functions->CallNonvirtualLongMethodA(this,obj,clazz,
1195 jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz,
1196 jmethodID methodID, ...) {
1199 va_start(args,methodID);
1200 result = functions->CallNonvirtualFloatMethodV(this,obj,clazz,
1205 jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz,
1208 return functions->CallNonvirtualFloatMethodV(this,obj,clazz,
1211 jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz,
1213 const jvalue * args) {
1214 return functions->CallNonvirtualFloatMethodA(this,obj,clazz,
1218 jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz,
1219 jmethodID methodID, ...) {
1222 va_start(args,methodID);
1223 result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
1228 jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz,
1231 return functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
1234 jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz,
1236 const jvalue * args) {
1237 return functions->CallNonvirtualDoubleMethodA(this,obj,clazz,
1241 void CallNonvirtualVoidMethod(jobject obj, jclass clazz,
1242 jmethodID methodID, ...) {
1244 va_start(args,methodID);
1245 functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
1248 void CallNonvirtualVoidMethodV(jobject obj, jclass clazz,
1251 functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
1253 void CallNonvirtualVoidMethodA(jobject obj, jclass clazz,
1255 const jvalue * args) {
1256 functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args);
1259 jfieldID GetFieldID(jclass clazz, const char *name,
1261 return functions->GetFieldID(this,clazz,name,sig);
1264 jobject GetObjectField(jobject obj, jfieldID fieldID) {
1265 return functions->GetObjectField(this,obj,fieldID);
1267 jboolean GetBooleanField(jobject obj, jfieldID fieldID) {
1268 return functions->GetBooleanField(this,obj,fieldID);
1270 jbyte GetByteField(jobject obj, jfieldID fieldID) {
1271 return functions->GetByteField(this,obj,fieldID);
1273 jchar GetCharField(jobject obj, jfieldID fieldID) {
1274 return functions->GetCharField(this,obj,fieldID);
1276 jshort GetShortField(jobject obj, jfieldID fieldID) {
1277 return functions->GetShortField(this,obj,fieldID);
1279 jint GetIntField(jobject obj, jfieldID fieldID) {
1280 return functions->GetIntField(this,obj,fieldID);
1282 jlong GetLongField(jobject obj, jfieldID fieldID) {
1283 return functions->GetLongField(this,obj,fieldID);
1285 jfloat GetFloatField(jobject obj, jfieldID fieldID) {
1286 return functions->GetFloatField(this,obj,fieldID);
1288 jdouble GetDoubleField(jobject obj, jfieldID fieldID) {
1289 return functions->GetDoubleField(this,obj,fieldID);
1292 void SetObjectField(jobject obj, jfieldID fieldID, jobject val) {
1293 functions->SetObjectField(this,obj,fieldID,val);
1295 void SetBooleanField(jobject obj, jfieldID fieldID,
1297 functions->SetBooleanField(this,obj,fieldID,val);
1299 void SetByteField(jobject obj, jfieldID fieldID,
1301 functions->SetByteField(this,obj,fieldID,val);
1303 void SetCharField(jobject obj, jfieldID fieldID,
1305 functions->SetCharField(this,obj,fieldID,val);
1307 void SetShortField(jobject obj, jfieldID fieldID,
1309 functions->SetShortField(this,obj,fieldID,val);
1311 void SetIntField(jobject obj, jfieldID fieldID,
1313 functions->SetIntField(this,obj,fieldID,val);
1315 void SetLongField(jobject obj, jfieldID fieldID,
1317 functions->SetLongField(this,obj,fieldID,val);
1319 void SetFloatField(jobject obj, jfieldID fieldID,
1321 functions->SetFloatField(this,obj,fieldID,val);
1323 void SetDoubleField(jobject obj, jfieldID fieldID,
1325 functions->SetDoubleField(this,obj,fieldID,val);
1328 jmethodID GetStaticMethodID(jclass clazz, const char *name,
1330 return functions->GetStaticMethodID(this,clazz,name,sig);
1333 jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID,
1337 va_start(args,methodID);
1338 result = functions->CallStaticObjectMethodV(this,clazz,methodID,args);
1342 jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID,
1344 return functions->CallStaticObjectMethodV(this,clazz,methodID,args);
1346 jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID,
1347 const jvalue *args) {
1348 return functions->CallStaticObjectMethodA(this,clazz,methodID,args);
1351 jboolean CallStaticBooleanMethod(jclass clazz,
1352 jmethodID methodID, ...) {
1355 va_start(args,methodID);
1356 result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
1360 jboolean CallStaticBooleanMethodV(jclass clazz,
1361 jmethodID methodID, va_list args) {
1362 return functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
1364 jboolean CallStaticBooleanMethodA(jclass clazz,
1365 jmethodID methodID, const jvalue *args) {
1366 return functions->CallStaticBooleanMethodA(this,clazz,methodID,args);
1369 jbyte CallStaticByteMethod(jclass clazz,
1370 jmethodID methodID, ...) {
1373 va_start(args,methodID);
1374 result = functions->CallStaticByteMethodV(this,clazz,methodID,args);
1378 jbyte CallStaticByteMethodV(jclass clazz,
1379 jmethodID methodID, va_list args) {
1380 return functions->CallStaticByteMethodV(this,clazz,methodID,args);
1382 jbyte CallStaticByteMethodA(jclass clazz,
1383 jmethodID methodID, const jvalue *args) {
1384 return functions->CallStaticByteMethodA(this,clazz,methodID,args);
1387 jchar CallStaticCharMethod(jclass clazz,
1388 jmethodID methodID, ...) {
1391 va_start(args,methodID);
1392 result = functions->CallStaticCharMethodV(this,clazz,methodID,args);
1396 jchar CallStaticCharMethodV(jclass clazz,
1397 jmethodID methodID, va_list args) {
1398 return functions->CallStaticCharMethodV(this,clazz,methodID,args);
1400 jchar CallStaticCharMethodA(jclass clazz,
1401 jmethodID methodID, const jvalue *args) {
1402 return functions->CallStaticCharMethodA(this,clazz,methodID,args);
1405 jshort CallStaticShortMethod(jclass clazz,
1406 jmethodID methodID, ...) {
1409 va_start(args,methodID);
1410 result = functions->CallStaticShortMethodV(this,clazz,methodID,args);
1414 jshort CallStaticShortMethodV(jclass clazz,
1415 jmethodID methodID, va_list args) {
1416 return functions->CallStaticShortMethodV(this,clazz,methodID,args);
1418 jshort CallStaticShortMethodA(jclass clazz,
1419 jmethodID methodID, const jvalue *args) {
1420 return functions->CallStaticShortMethodA(this,clazz,methodID,args);
1423 jint CallStaticIntMethod(jclass clazz,
1424 jmethodID methodID, ...) {
1427 va_start(args,methodID);
1428 result = functions->CallStaticIntMethodV(this,clazz,methodID,args);
1432 jint CallStaticIntMethodV(jclass clazz,
1433 jmethodID methodID, va_list args) {
1434 return functions->CallStaticIntMethodV(this,clazz,methodID,args);
1436 jint CallStaticIntMethodA(jclass clazz,
1437 jmethodID methodID, const jvalue *args) {
1438 return functions->CallStaticIntMethodA(this,clazz,methodID,args);
1441 jlong CallStaticLongMethod(jclass clazz,
1442 jmethodID methodID, ...) {
1445 va_start(args,methodID);
1446 result = functions->CallStaticLongMethodV(this,clazz,methodID,args);
1450 jlong CallStaticLongMethodV(jclass clazz,
1451 jmethodID methodID, va_list args) {
1452 return functions->CallStaticLongMethodV(this,clazz,methodID,args);
1454 jlong CallStaticLongMethodA(jclass clazz,
1455 jmethodID methodID, const jvalue *args) {
1456 return functions->CallStaticLongMethodA(this,clazz,methodID,args);
1459 jfloat CallStaticFloatMethod(jclass clazz,
1460 jmethodID methodID, ...) {
1463 va_start(args,methodID);
1464 result = functions->CallStaticFloatMethodV(this,clazz,methodID,args);
1468 jfloat CallStaticFloatMethodV(jclass clazz,
1469 jmethodID methodID, va_list args) {
1470 return functions->CallStaticFloatMethodV(this,clazz,methodID,args);
1472 jfloat CallStaticFloatMethodA(jclass clazz,
1473 jmethodID methodID, const jvalue *args) {
1474 return functions->CallStaticFloatMethodA(this,clazz,methodID,args);
1477 jdouble CallStaticDoubleMethod(jclass clazz,
1478 jmethodID methodID, ...) {
1481 va_start(args,methodID);
1482 result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
1486 jdouble CallStaticDoubleMethodV(jclass clazz,
1487 jmethodID methodID, va_list args) {
1488 return functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
1490 jdouble CallStaticDoubleMethodA(jclass clazz,
1491 jmethodID methodID, const jvalue *args) {
1492 return functions->CallStaticDoubleMethodA(this,clazz,methodID,args);
1495 void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) {
1497 va_start(args,methodID);
1498 functions->CallStaticVoidMethodV(this,cls,methodID,args);
1501 void CallStaticVoidMethodV(jclass cls, jmethodID methodID,
1503 functions->CallStaticVoidMethodV(this,cls,methodID,args);
1505 void CallStaticVoidMethodA(jclass cls, jmethodID methodID,
1506 const jvalue * args) {
1507 functions->CallStaticVoidMethodA(this,cls,methodID,args);
1510 jfieldID GetStaticFieldID(jclass clazz, const char *name,
1512 return functions->GetStaticFieldID(this,clazz,name,sig);
1514 jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) {
1515 return functions->GetStaticObjectField(this,clazz,fieldID);
1517 jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) {
1518 return functions->GetStaticBooleanField(this,clazz,fieldID);
1520 jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) {
1521 return functions->GetStaticByteField(this,clazz,fieldID);
1523 jchar GetStaticCharField(jclass clazz, jfieldID fieldID) {
1524 return functions->GetStaticCharField(this,clazz,fieldID);
1526 jshort GetStaticShortField(jclass clazz, jfieldID fieldID) {
1527 return functions->GetStaticShortField(this,clazz,fieldID);
1529 jint GetStaticIntField(jclass clazz, jfieldID fieldID) {
1530 return functions->GetStaticIntField(this,clazz,fieldID);
1532 jlong GetStaticLongField(jclass clazz, jfieldID fieldID) {
1533 return functions->GetStaticLongField(this,clazz,fieldID);
1535 jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) {
1536 return functions->GetStaticFloatField(this,clazz,fieldID);
1538 jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) {
1539 return functions->GetStaticDoubleField(this,clazz,fieldID);
1542 void SetStaticObjectField(jclass clazz, jfieldID fieldID,
1544 functions->SetStaticObjectField(this,clazz,fieldID,value);
1546 void SetStaticBooleanField(jclass clazz, jfieldID fieldID,
1548 functions->SetStaticBooleanField(this,clazz,fieldID,value);
1550 void SetStaticByteField(jclass clazz, jfieldID fieldID,
1552 functions->SetStaticByteField(this,clazz,fieldID,value);
1554 void SetStaticCharField(jclass clazz, jfieldID fieldID,
1556 functions->SetStaticCharField(this,clazz,fieldID,value);
1558 void SetStaticShortField(jclass clazz, jfieldID fieldID,
1560 functions->SetStaticShortField(this,clazz,fieldID,value);
1562 void SetStaticIntField(jclass clazz, jfieldID fieldID,
1564 functions->SetStaticIntField(this,clazz,fieldID,value);
1566 void SetStaticLongField(jclass clazz, jfieldID fieldID,
1568 functions->SetStaticLongField(this,clazz,fieldID,value);
1570 void SetStaticFloatField(jclass clazz, jfieldID fieldID,
1572 functions->SetStaticFloatField(this,clazz,fieldID,value);
1574 void SetStaticDoubleField(jclass clazz, jfieldID fieldID,
1576 functions->SetStaticDoubleField(this,clazz,fieldID,value);
1579 jstring NewString(const jchar *unicode, jsize len) {
1580 return functions->NewString(this,unicode,len);
1582 jsize GetStringLength(jstring str) {
1583 return functions->GetStringLength(this,str);
1585 const jchar *GetStringChars(jstring str, jboolean *isCopy) {
1586 return functions->GetStringChars(this,str,isCopy);
1588 void ReleaseStringChars(jstring str, const jchar *chars) {
1589 functions->ReleaseStringChars(this,str,chars);
1592 jstring NewStringUTF(const char *utf) {
1593 return functions->NewStringUTF(this,utf);
1595 jsize GetStringUTFLength(jstring str) {
1596 return functions->GetStringUTFLength(this,str);
1598 const char* GetStringUTFChars(jstring str, jboolean *isCopy) {
1599 return functions->GetStringUTFChars(this,str,isCopy);
1601 void ReleaseStringUTFChars(jstring str, const char* chars) {
1602 functions->ReleaseStringUTFChars(this,str,chars);
1605 jsize GetArrayLength(jarray array) {
1606 return functions->GetArrayLength(this,array);
1609 jobjectArray NewObjectArray(jsize len, jclass clazz,
1611 return functions->NewObjectArray(this,len,clazz,init);
1613 jobject GetObjectArrayElement(jobjectArray array, jsize index) {
1614 return functions->GetObjectArrayElement(this,array,index);
1616 void SetObjectArrayElement(jobjectArray array, jsize index,
1618 functions->SetObjectArrayElement(this,array,index,val);
1621 jbooleanArray NewBooleanArray(jsize len) {
1622 return functions->NewBooleanArray(this,len);
1624 jbyteArray NewByteArray(jsize len) {
1625 return functions->NewByteArray(this,len);
1627 jcharArray NewCharArray(jsize len) {
1628 return functions->NewCharArray(this,len);
1630 jshortArray NewShortArray(jsize len) {
1631 return functions->NewShortArray(this,len);
1633 jintArray NewIntArray(jsize len) {
1634 return functions->NewIntArray(this,len);
1636 jlongArray NewLongArray(jsize len) {
1637 return functions->NewLongArray(this,len);
1639 jfloatArray NewFloatArray(jsize len) {
1640 return functions->NewFloatArray(this,len);
1642 jdoubleArray NewDoubleArray(jsize len) {
1643 return functions->NewDoubleArray(this,len);
1646 jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) {
1647 return functions->GetBooleanArrayElements(this,array,isCopy);
1649 jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) {
1650 return functions->GetByteArrayElements(this,array,isCopy);
1652 jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) {
1653 return functions->GetCharArrayElements(this,array,isCopy);
1655 jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) {
1656 return functions->GetShortArrayElements(this,array,isCopy);
1658 jint * GetIntArrayElements(jintArray array, jboolean *isCopy) {
1659 return functions->GetIntArrayElements(this,array,isCopy);
1661 jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) {
1662 return functions->GetLongArrayElements(this,array,isCopy);
1664 jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) {
1665 return functions->GetFloatArrayElements(this,array,isCopy);
1667 jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) {
1668 return functions->GetDoubleArrayElements(this,array,isCopy);
1671 void ReleaseBooleanArrayElements(jbooleanArray array,
1674 functions->ReleaseBooleanArrayElements(this,array,elems,mode);
1676 void ReleaseByteArrayElements(jbyteArray array,
1679 functions->ReleaseByteArrayElements(this,array,elems,mode);
1681 void ReleaseCharArrayElements(jcharArray array,
1684 functions->ReleaseCharArrayElements(this,array,elems,mode);
1686 void ReleaseShortArrayElements(jshortArray array,
1689 functions->ReleaseShortArrayElements(this,array,elems,mode);
1691 void ReleaseIntArrayElements(jintArray array,
1694 functions->ReleaseIntArrayElements(this,array,elems,mode);
1696 void ReleaseLongArrayElements(jlongArray array,
1699 functions->ReleaseLongArrayElements(this,array,elems,mode);
1701 void ReleaseFloatArrayElements(jfloatArray array,
1704 functions->ReleaseFloatArrayElements(this,array,elems,mode);
1706 void ReleaseDoubleArrayElements(jdoubleArray array,
1709 functions->ReleaseDoubleArrayElements(this,array,elems,mode);
1712 void GetBooleanArrayRegion(jbooleanArray array,
1713 jsize start, jsize len, jboolean *buf) {
1714 functions->GetBooleanArrayRegion(this,array,start,len,buf);
1716 void GetByteArrayRegion(jbyteArray array,
1717 jsize start, jsize len, jbyte *buf) {
1718 functions->GetByteArrayRegion(this,array,start,len,buf);
1720 void GetCharArrayRegion(jcharArray array,
1721 jsize start, jsize len, jchar *buf) {
1722 functions->GetCharArrayRegion(this,array,start,len,buf);
1724 void GetShortArrayRegion(jshortArray array,
1725 jsize start, jsize len, jshort *buf) {
1726 functions->GetShortArrayRegion(this,array,start,len,buf);
1728 void GetIntArrayRegion(jintArray array,
1729 jsize start, jsize len, jint *buf) {
1730 functions->GetIntArrayRegion(this,array,start,len,buf);
1732 void GetLongArrayRegion(jlongArray array,
1733 jsize start, jsize len, jlong *buf) {
1734 functions->GetLongArrayRegion(this,array,start,len,buf);
1736 void GetFloatArrayRegion(jfloatArray array,
1737 jsize start, jsize len, jfloat *buf) {
1738 functions->GetFloatArrayRegion(this,array,start,len,buf);
1740 void GetDoubleArrayRegion(jdoubleArray array,
1741 jsize start, jsize len, jdouble *buf) {
1742 functions->GetDoubleArrayRegion(this,array,start,len,buf);
1745 void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len,
1746 const jboolean *buf) {
1747 functions->SetBooleanArrayRegion(this,array,start,len,buf);
1749 void SetByteArrayRegion(jbyteArray array, jsize start, jsize len,
1751 functions->SetByteArrayRegion(this,array,start,len,buf);
1753 void SetCharArrayRegion(jcharArray array, jsize start, jsize len,
1755 functions->SetCharArrayRegion(this,array,start,len,buf);
1757 void SetShortArrayRegion(jshortArray array, jsize start, jsize len,
1758 const jshort *buf) {
1759 functions->SetShortArrayRegion(this,array,start,len,buf);
1761 void SetIntArrayRegion(jintArray array, jsize start, jsize len,
1763 functions->SetIntArrayRegion(this,array,start,len,buf);
1765 void SetLongArrayRegion(jlongArray array, jsize start, jsize len,
1767 functions->SetLongArrayRegion(this,array,start,len,buf);
1769 void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len,
1770 const jfloat *buf) {
1771 functions->SetFloatArrayRegion(this,array,start,len,buf);
1773 void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len,
1774 const jdouble *buf) {
1775 functions->SetDoubleArrayRegion(this,array,start,len,buf);
1778 jint RegisterNatives(jclass clazz, const JNINativeMethod *methods,
1780 return functions->RegisterNatives(this,clazz,methods,nMethods);
1782 jint UnregisterNatives(jclass clazz) {
1783 return functions->UnregisterNatives(this,clazz);
1786 jint MonitorEnter(jobject obj) {
1787 return functions->MonitorEnter(this,obj);
1789 jint MonitorExit(jobject obj) {
1790 return functions->MonitorExit(this,obj);
1793 jint GetJavaVM(JavaVM **vm) {
1794 return functions->GetJavaVM(this,vm);
1797 void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) {
1798 functions->GetStringRegion(this,str,start,len,buf);
1800 void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) {
1801 functions->GetStringUTFRegion(this,str,start,len,buf);
1804 void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) {
1805 return functions->GetPrimitiveArrayCritical(this,array,isCopy);
1807 void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) {
1808 functions->ReleasePrimitiveArrayCritical(this,array,carray,mode);
1811 const jchar * GetStringCritical(jstring string, jboolean *isCopy) {
1812 return functions->GetStringCritical(this,string,isCopy);
1814 void ReleaseStringCritical(jstring string, const jchar *cstring) {
1815 functions->ReleaseStringCritical(this,string,cstring);
1818 jweak NewWeakGlobalRef(jobject obj) {
1819 return functions->NewWeakGlobalRef(this,obj);
1821 void DeleteWeakGlobalRef(jweak ref) {
1822 functions->DeleteWeakGlobalRef(this,ref);
1825 jboolean ExceptionCheck() {
1826 return functions->ExceptionCheck(this);
1829 jobject NewDirectByteBuffer(void* address, jlong capacity) {
1830 return functions->NewDirectByteBuffer(this, address, capacity);
1832 void* GetDirectBufferAddress(jobject buf) {
1833 return functions->GetDirectBufferAddress(this, buf);
1835 jlong GetDirectBufferCapacity(jobject buf) {
1836 return functions->GetDirectBufferCapacity(this, buf);
1838 jobjectRefType GetObjectRefType(jobject obj) {
1839 return functions->GetObjectRefType(this, obj);
1842 #endif /* __cplusplus */
1845 typedef struct JavaVMOption {
1850 typedef struct JavaVMInitArgs {
1854 JavaVMOption *options;
1855 jboolean ignoreUnrecognized;
1858 typedef struct JavaVMAttachArgs {
1865 /* These structures will be VM-specific. */
1867 typedef struct JDK1_1InitArgs {
1872 jint nativeStackSize;
1879 jint (JNICALL *vfprintf)(FILE *fp, const char *format, va_list args);
1880 void (JNICALL *exit)(jint code);
1881 void (JNICALL *abort)(void);
1884 jint enableVerboseGC;
1885 jint disableAsyncGC;
1891 typedef struct JDK1_1AttachArgs {
1892 void * __padding; /* C compilers don't allow empty structures. */
1898 /* End VM-specific. */
1900 struct JNIInvokeInterface_ {
1905 jint (JNICALL *DestroyJavaVM)(JavaVM *vm);
1907 jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args);
1909 jint (JNICALL *DetachCurrentThread)(JavaVM *vm);
1911 jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version);
1913 jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args);
1917 const struct JNIInvokeInterface_ *functions;
1920 jint DestroyJavaVM() {
1921 return functions->DestroyJavaVM(this);
1923 jint AttachCurrentThread(void **penv, void *args) {
1924 return functions->AttachCurrentThread(this, penv, args);
1926 jint DetachCurrentThread() {
1927 return functions->DetachCurrentThread(this);
1930 jint GetEnv(void **penv, jint version) {
1931 return functions->GetEnv(this, penv, version);
1933 jint AttachCurrentThreadAsDaemon(void **penv, void *args) {
1934 return functions->AttachCurrentThreadAsDaemon(this, penv, args);
1939 #ifdef _JNI_IMPLEMENTATION_
1940 #define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT
1942 #define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT
1944 _JNI_IMPORT_OR_EXPORT_ jint JNICALL
1945 JNI_GetDefaultJavaVMInitArgs(void *args);
1947 _JNI_IMPORT_OR_EXPORT_ jint JNICALL
1948 JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args);
1950 _JNI_IMPORT_OR_EXPORT_ jint JNICALL
1951 JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *);
1953 /* Defined by native libraries. */
1954 JNIEXPORT jint JNICALL
1955 JNI_OnLoad(JavaVM *vm, void *reserved);
1957 JNIEXPORT void JNICALL
1958 JNI_OnUnload(JavaVM *vm, void *reserved);
1960 #define JNI_VERSION_1_1 0x00010001
1961 #define JNI_VERSION_1_2 0x00010002
1962 #define JNI_VERSION_1_4 0x00010004
1963 #define JNI_VERSION_1_6 0x00010006
1967 #endif /* __cplusplus */
1969 #endif /* !_JAVASOFT_JNI_H_ */