1 /*
   2  * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /*
  27  * We used part of Netscape's Java Runtime Interface (JRI) as the starting
  28  * point of our design and implementation.
  29  */
  30 
  31 /******************************************************************************
  32  * Java Runtime Interface
  33  * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved.
  34  *****************************************************************************/
  35 
  36 #ifndef _JAVASOFT_JNI_H_
  37 #define _JAVASOFT_JNI_H_
  38 
  39 #include <stdio.h>
  40 #include <stdarg.h>
  41 
  42 /* jni_md.h contains the machine-dependent typedefs for jbyte, jint
  43    and jlong */
  44 
  45 #include "jni_md.h"
  46 
  47 #ifdef __cplusplus
  48 extern "C" {
  49 #endif
  50 
  51 /*
  52  * JNI Types
  53  */
  54 
  55 #ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H
  56 
  57 typedef unsigned char   jboolean;
  58 typedef unsigned short  jchar;
  59 typedef short           jshort;
  60 typedef float           jfloat;
  61 typedef double          jdouble;
  62 
  63 typedef jint            jsize;
  64 
  65 #ifdef __cplusplus
  66 
  67 class _jvaluetype {};
  68 class _jobject {};
  69 class _jclass : public _jobject {};
  70 class _jthrowable : public _jobject {};
  71 class _jstring : public _jobject {};
  72 class _jarray : public _jobject {};
  73 class _jbooleanArray : public _jarray {};
  74 class _jbyteArray : public _jarray {};
  75 class _jcharArray : public _jarray {};
  76 class _jshortArray : public _jarray {};
  77 class _jintArray : public _jarray {};
  78 class _jlongArray : public _jarray {};
  79 class _jfloatArray : public _jarray {};
  80 class _jdoubleArray : public _jarray {};
  81 class _jobjectArray : public _jarray {};
  82 
  83 typedef _jvaluetype *jvaluetype;
  84 typedef _jobject *jobject;
  85 typedef _jclass *jclass;
  86 typedef _jthrowable *jthrowable;
  87 typedef _jstring *jstring;
  88 typedef _jarray *jarray;
  89 typedef _jbooleanArray *jbooleanArray;
  90 typedef _jbyteArray *jbyteArray;
  91 typedef _jcharArray *jcharArray;
  92 typedef _jshortArray *jshortArray;
  93 typedef _jintArray *jintArray;
  94 typedef _jlongArray *jlongArray;
  95 typedef _jfloatArray *jfloatArray;
  96 typedef _jdoubleArray *jdoubleArray;
  97 typedef _jobjectArray *jobjectArray;
  98 
  99 #else
 100 
 101 struct _jvaluetype;
 102 struct _jobject;
 103 
 104 typedef struct _jvaluetype *jvaluetype;
 105 typedef struct _jobject *jobject;
 106 typedef jobject jclass;
 107 typedef jobject jthrowable;
 108 typedef jobject jstring;
 109 typedef jobject jarray;
 110 typedef jarray jbooleanArray;
 111 typedef jarray jbyteArray;
 112 typedef jarray jcharArray;
 113 typedef jarray jshortArray;
 114 typedef jarray jintArray;
 115 typedef jarray jlongArray;
 116 typedef jarray jfloatArray;
 117 typedef jarray jdoubleArray;
 118 typedef jarray jobjectArray;
 119 
 120 #endif
 121 
 122 typedef jobject jweak;
 123 
 124 typedef union jvalue {
 125     jboolean z;
 126     jbyte    b;
 127     jchar    c;
 128     jshort   s;
 129     jint     i;
 130     jlong    j;
 131     jfloat   f;
 132     jdouble  d;
 133     jobject  l;
 134     jvaluetype q;
 135 } jvalue;
 136 
 137 struct _jfieldID;
 138 typedef struct _jfieldID *jfieldID;
 139 
 140 struct _jmethodID;
 141 typedef struct _jmethodID *jmethodID;
 142 
 143 /* Return values from jobjectRefType */
 144 typedef enum _jobjectType {
 145      JNIInvalidRefType    = 0,
 146      JNILocalRefType      = 1,
 147      JNIGlobalRefType     = 2,
 148      JNIWeakGlobalRefType = 3
 149 } jobjectRefType;
 150 
 151 
 152 #endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */
 153 
 154 /*
 155  * jboolean constants
 156  */
 157 
 158 #define JNI_FALSE 0
 159 #define JNI_TRUE 1
 160 
 161 /*
 162  * possible return values for JNI functions.
 163  */
 164 
 165 #define JNI_OK           0                 /* success */
 166 #define JNI_ERR          (-1)              /* unknown error */
 167 #define JNI_EDETACHED    (-2)              /* thread detached from the VM */
 168 #define JNI_EVERSION     (-3)              /* JNI version error */
 169 #define JNI_ENOMEM       (-4)              /* not enough memory */
 170 #define JNI_EEXIST       (-5)              /* VM already created */
 171 #define JNI_EINVAL       (-6)              /* invalid arguments */
 172 
 173 /*
 174  * used in ReleaseScalarArrayElements
 175  */
 176 
 177 #define JNI_COMMIT 1
 178 #define JNI_ABORT 2
 179 
 180 /*
 181  * used in RegisterNatives to describe native method name, signature,
 182  * and function pointer.
 183  */
 184 
 185 typedef struct {
 186     char *name;
 187     char *signature;
 188     void *fnPtr;
 189 } JNINativeMethod;
 190 
 191 /*
 192  * JNI Native Method Interface.
 193  */
 194 
 195 struct JNINativeInterface_;
 196 
 197 struct JNIEnv_;
 198 
 199 #ifdef __cplusplus
 200 typedef JNIEnv_ JNIEnv;
 201 #else
 202 typedef const struct JNINativeInterface_ *JNIEnv;
 203 #endif
 204 
 205 /*
 206  * JNI Invocation Interface.
 207  */
 208 
 209 struct JNIInvokeInterface_;
 210 
 211 struct JavaVM_;
 212 
 213 #ifdef __cplusplus
 214 typedef JavaVM_ JavaVM;
 215 #else
 216 typedef const struct JNIInvokeInterface_ *JavaVM;
 217 #endif
 218 
 219 struct JNINativeInterface_ {
 220     void *reserved0;
 221     void *reserved1;
 222     void *reserved2;
 223 
 224     void *reserved3;
 225     jint (JNICALL *GetVersion)(JNIEnv *env);
 226 
 227     jclass (JNICALL *DefineClass)
 228       (JNIEnv *env, const char *name, jobject loader, const jbyte *buf,
 229        jsize len);
 230     jclass (JNICALL *FindClass)
 231       (JNIEnv *env, const char *name);
 232 
 233     jmethodID (JNICALL *FromReflectedMethod)
 234       (JNIEnv *env, jobject method);
 235     jfieldID (JNICALL *FromReflectedField)
 236       (JNIEnv *env, jobject field);
 237 
 238     jobject (JNICALL *ToReflectedMethod)
 239       (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic);
 240 
 241     jclass (JNICALL *GetSuperclass)
 242       (JNIEnv *env, jclass sub);
 243     jboolean (JNICALL *IsAssignableFrom)
 244       (JNIEnv *env, jclass sub, jclass sup);
 245 
 246     jobject (JNICALL *ToReflectedField)
 247       (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic);
 248 
 249     jint (JNICALL *Throw)
 250       (JNIEnv *env, jthrowable obj);
 251     jint (JNICALL *ThrowNew)
 252       (JNIEnv *env, jclass clazz, const char *msg);
 253     jthrowable (JNICALL *ExceptionOccurred)
 254       (JNIEnv *env);
 255     void (JNICALL *ExceptionDescribe)
 256       (JNIEnv *env);
 257     void (JNICALL *ExceptionClear)
 258       (JNIEnv *env);
 259     void (JNICALL *FatalError)
 260       (JNIEnv *env, const char *msg);
 261 
 262     jint (JNICALL *PushLocalFrame)
 263       (JNIEnv *env, jint capacity);
 264     jobject (JNICALL *PopLocalFrame)
 265       (JNIEnv *env, jobject result);
 266 
 267     jobject (JNICALL *NewGlobalRef)
 268       (JNIEnv *env, jobject lobj);
 269     void (JNICALL *DeleteGlobalRef)
 270       (JNIEnv *env, jobject gref);
 271     void (JNICALL *DeleteLocalRef)
 272       (JNIEnv *env, jobject obj);
 273     jboolean (JNICALL *IsSameObject)
 274       (JNIEnv *env, jobject obj1, jobject obj2);
 275     jobject (JNICALL *NewLocalRef)
 276       (JNIEnv *env, jobject ref);
 277     jint (JNICALL *EnsureLocalCapacity)
 278       (JNIEnv *env, jint capacity);
 279 
 280     jobject (JNICALL *AllocObject)
 281       (JNIEnv *env, jclass clazz);
 282     jobject (JNICALL *NewObject)
 283       (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
 284     jobject (JNICALL *NewObjectV)
 285       (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
 286     jobject (JNICALL *NewObjectA)
 287       (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
 288 
 289     jclass (JNICALL *GetObjectClass)
 290       (JNIEnv *env, jobject obj);
 291     jboolean (JNICALL *IsInstanceOf)
 292       (JNIEnv *env, jobject obj, jclass clazz);
 293 
 294     jmethodID (JNICALL *GetMethodID)
 295       (JNIEnv *env, jclass clazz, const char *name, const char *sig);
 296 
 297     jobject (JNICALL *CallObjectMethod)
 298       (JNIEnv *env, jobject obj, jmethodID methodID, ...);
 299     jobject (JNICALL *CallObjectMethodV)
 300       (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
 301     jobject (JNICALL *CallObjectMethodA)
 302       (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
 303 
 304     jboolean (JNICALL *CallBooleanMethod)
 305       (JNIEnv *env, jobject obj, jmethodID methodID, ...);
 306     jboolean (JNICALL *CallBooleanMethodV)
 307       (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
 308     jboolean (JNICALL *CallBooleanMethodA)
 309       (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
 310 
 311     jbyte (JNICALL *CallByteMethod)
 312       (JNIEnv *env, jobject obj, jmethodID methodID, ...);
 313     jbyte (JNICALL *CallByteMethodV)
 314       (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
 315     jbyte (JNICALL *CallByteMethodA)
 316       (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
 317 
 318     jchar (JNICALL *CallCharMethod)
 319       (JNIEnv *env, jobject obj, jmethodID methodID, ...);
 320     jchar (JNICALL *CallCharMethodV)
 321       (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
 322     jchar (JNICALL *CallCharMethodA)
 323       (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
 324 
 325     jshort (JNICALL *CallShortMethod)
 326       (JNIEnv *env, jobject obj, jmethodID methodID, ...);
 327     jshort (JNICALL *CallShortMethodV)
 328       (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
 329     jshort (JNICALL *CallShortMethodA)
 330       (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
 331 
 332     jint (JNICALL *CallIntMethod)
 333       (JNIEnv *env, jobject obj, jmethodID methodID, ...);
 334     jint (JNICALL *CallIntMethodV)
 335       (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
 336     jint (JNICALL *CallIntMethodA)
 337       (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
 338 
 339     jlong (JNICALL *CallLongMethod)
 340       (JNIEnv *env, jobject obj, jmethodID methodID, ...);
 341     jlong (JNICALL *CallLongMethodV)
 342       (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
 343     jlong (JNICALL *CallLongMethodA)
 344       (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
 345 
 346     jfloat (JNICALL *CallFloatMethod)
 347       (JNIEnv *env, jobject obj, jmethodID methodID, ...);
 348     jfloat (JNICALL *CallFloatMethodV)
 349       (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
 350     jfloat (JNICALL *CallFloatMethodA)
 351       (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
 352 
 353     jdouble (JNICALL *CallDoubleMethod)
 354       (JNIEnv *env, jobject obj, jmethodID methodID, ...);
 355     jdouble (JNICALL *CallDoubleMethodV)
 356       (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
 357     jdouble (JNICALL *CallDoubleMethodA)
 358       (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
 359 
 360     void (JNICALL *CallVoidMethod)
 361       (JNIEnv *env, jobject obj, jmethodID methodID, ...);
 362     void (JNICALL *CallVoidMethodV)
 363       (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
 364     void (JNICALL *CallVoidMethodA)
 365       (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
 366 
 367     jobject (JNICALL *CallNonvirtualObjectMethod)
 368       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
 369     jobject (JNICALL *CallNonvirtualObjectMethodV)
 370       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 371        va_list args);
 372     jobject (JNICALL *CallNonvirtualObjectMethodA)
 373       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 374        const jvalue * args);
 375 
 376     jboolean (JNICALL *CallNonvirtualBooleanMethod)
 377       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
 378     jboolean (JNICALL *CallNonvirtualBooleanMethodV)
 379       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 380        va_list args);
 381     jboolean (JNICALL *CallNonvirtualBooleanMethodA)
 382       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 383        const jvalue * args);
 384 
 385     jbyte (JNICALL *CallNonvirtualByteMethod)
 386       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
 387     jbyte (JNICALL *CallNonvirtualByteMethodV)
 388       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 389        va_list args);
 390     jbyte (JNICALL *CallNonvirtualByteMethodA)
 391       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 392        const jvalue *args);
 393 
 394     jchar (JNICALL *CallNonvirtualCharMethod)
 395       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
 396     jchar (JNICALL *CallNonvirtualCharMethodV)
 397       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 398        va_list args);
 399     jchar (JNICALL *CallNonvirtualCharMethodA)
 400       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 401        const jvalue *args);
 402 
 403     jshort (JNICALL *CallNonvirtualShortMethod)
 404       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
 405     jshort (JNICALL *CallNonvirtualShortMethodV)
 406       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 407        va_list args);
 408     jshort (JNICALL *CallNonvirtualShortMethodA)
 409       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 410        const jvalue *args);
 411 
 412     jint (JNICALL *CallNonvirtualIntMethod)
 413       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
 414     jint (JNICALL *CallNonvirtualIntMethodV)
 415       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 416        va_list args);
 417     jint (JNICALL *CallNonvirtualIntMethodA)
 418       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 419        const jvalue *args);
 420 
 421     jlong (JNICALL *CallNonvirtualLongMethod)
 422       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
 423     jlong (JNICALL *CallNonvirtualLongMethodV)
 424       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 425        va_list args);
 426     jlong (JNICALL *CallNonvirtualLongMethodA)
 427       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 428        const jvalue *args);
 429 
 430     jfloat (JNICALL *CallNonvirtualFloatMethod)
 431       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
 432     jfloat (JNICALL *CallNonvirtualFloatMethodV)
 433       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 434        va_list args);
 435     jfloat (JNICALL *CallNonvirtualFloatMethodA)
 436       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 437        const jvalue *args);
 438 
 439     jdouble (JNICALL *CallNonvirtualDoubleMethod)
 440       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
 441     jdouble (JNICALL *CallNonvirtualDoubleMethodV)
 442       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 443        va_list args);
 444     jdouble (JNICALL *CallNonvirtualDoubleMethodA)
 445       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 446        const jvalue *args);
 447 
 448     void (JNICALL *CallNonvirtualVoidMethod)
 449       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
 450     void (JNICALL *CallNonvirtualVoidMethodV)
 451       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 452        va_list args);
 453     void (JNICALL *CallNonvirtualVoidMethodA)
 454       (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
 455        const jvalue * args);
 456 
 457     jfieldID (JNICALL *GetFieldID)
 458       (JNIEnv *env, jclass clazz, const char *name, const char *sig);
 459 
 460     jobject (JNICALL *GetObjectField)
 461       (JNIEnv *env, jobject obj, jfieldID fieldID);
 462     jboolean (JNICALL *GetBooleanField)
 463       (JNIEnv *env, jobject obj, jfieldID fieldID);
 464     jbyte (JNICALL *GetByteField)
 465       (JNIEnv *env, jobject obj, jfieldID fieldID);
 466     jchar (JNICALL *GetCharField)
 467       (JNIEnv *env, jobject obj, jfieldID fieldID);
 468     jshort (JNICALL *GetShortField)
 469       (JNIEnv *env, jobject obj, jfieldID fieldID);
 470     jint (JNICALL *GetIntField)
 471       (JNIEnv *env, jobject obj, jfieldID fieldID);
 472     jlong (JNICALL *GetLongField)
 473       (JNIEnv *env, jobject obj, jfieldID fieldID);
 474     jfloat (JNICALL *GetFloatField)
 475       (JNIEnv *env, jobject obj, jfieldID fieldID);
 476     jdouble (JNICALL *GetDoubleField)
 477       (JNIEnv *env, jobject obj, jfieldID fieldID);
 478 
 479     void (JNICALL *SetObjectField)
 480       (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val);
 481     void (JNICALL *SetBooleanField)
 482       (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val);
 483     void (JNICALL *SetByteField)
 484       (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val);
 485     void (JNICALL *SetCharField)
 486       (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val);
 487     void (JNICALL *SetShortField)
 488       (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val);
 489     void (JNICALL *SetIntField)
 490       (JNIEnv *env, jobject obj, jfieldID fieldID, jint val);
 491     void (JNICALL *SetLongField)
 492       (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val);
 493     void (JNICALL *SetFloatField)
 494       (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val);
 495     void (JNICALL *SetDoubleField)
 496       (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val);
 497 
 498     jmethodID (JNICALL *GetStaticMethodID)
 499       (JNIEnv *env, jclass clazz, const char *name, const char *sig);
 500 
 501     jobject (JNICALL *CallStaticObjectMethod)
 502       (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
 503     jobject (JNICALL *CallStaticObjectMethodV)
 504       (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
 505     jobject (JNICALL *CallStaticObjectMethodA)
 506       (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
 507 
 508     jboolean (JNICALL *CallStaticBooleanMethod)
 509       (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
 510     jboolean (JNICALL *CallStaticBooleanMethodV)
 511       (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
 512     jboolean (JNICALL *CallStaticBooleanMethodA)
 513       (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
 514 
 515     jbyte (JNICALL *CallStaticByteMethod)
 516       (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
 517     jbyte (JNICALL *CallStaticByteMethodV)
 518       (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
 519     jbyte (JNICALL *CallStaticByteMethodA)
 520       (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
 521 
 522     jchar (JNICALL *CallStaticCharMethod)
 523       (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
 524     jchar (JNICALL *CallStaticCharMethodV)
 525       (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
 526     jchar (JNICALL *CallStaticCharMethodA)
 527       (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
 528 
 529     jshort (JNICALL *CallStaticShortMethod)
 530       (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
 531     jshort (JNICALL *CallStaticShortMethodV)
 532       (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
 533     jshort (JNICALL *CallStaticShortMethodA)
 534       (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
 535 
 536     jint (JNICALL *CallStaticIntMethod)
 537       (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
 538     jint (JNICALL *CallStaticIntMethodV)
 539       (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
 540     jint (JNICALL *CallStaticIntMethodA)
 541       (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
 542 
 543     jlong (JNICALL *CallStaticLongMethod)
 544       (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
 545     jlong (JNICALL *CallStaticLongMethodV)
 546       (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
 547     jlong (JNICALL *CallStaticLongMethodA)
 548       (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
 549 
 550     jfloat (JNICALL *CallStaticFloatMethod)
 551       (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
 552     jfloat (JNICALL *CallStaticFloatMethodV)
 553       (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
 554     jfloat (JNICALL *CallStaticFloatMethodA)
 555       (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
 556 
 557     jdouble (JNICALL *CallStaticDoubleMethod)
 558       (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
 559     jdouble (JNICALL *CallStaticDoubleMethodV)
 560       (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
 561     jdouble (JNICALL *CallStaticDoubleMethodA)
 562       (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
 563 
 564     void (JNICALL *CallStaticVoidMethod)
 565       (JNIEnv *env, jclass cls, jmethodID methodID, ...);
 566     void (JNICALL *CallStaticVoidMethodV)
 567       (JNIEnv *env, jclass cls, jmethodID methodID, va_list args);
 568     void (JNICALL *CallStaticVoidMethodA)
 569       (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args);
 570 
 571     jfieldID (JNICALL *GetStaticFieldID)
 572       (JNIEnv *env, jclass clazz, const char *name, const char *sig);
 573     jobject (JNICALL *GetStaticObjectField)
 574       (JNIEnv *env, jclass clazz, jfieldID fieldID);
 575     jboolean (JNICALL *GetStaticBooleanField)
 576       (JNIEnv *env, jclass clazz, jfieldID fieldID);
 577     jbyte (JNICALL *GetStaticByteField)
 578       (JNIEnv *env, jclass clazz, jfieldID fieldID);
 579     jchar (JNICALL *GetStaticCharField)
 580       (JNIEnv *env, jclass clazz, jfieldID fieldID);
 581     jshort (JNICALL *GetStaticShortField)
 582       (JNIEnv *env, jclass clazz, jfieldID fieldID);
 583     jint (JNICALL *GetStaticIntField)
 584       (JNIEnv *env, jclass clazz, jfieldID fieldID);
 585     jlong (JNICALL *GetStaticLongField)
 586       (JNIEnv *env, jclass clazz, jfieldID fieldID);
 587     jfloat (JNICALL *GetStaticFloatField)
 588       (JNIEnv *env, jclass clazz, jfieldID fieldID);
 589     jdouble (JNICALL *GetStaticDoubleField)
 590       (JNIEnv *env, jclass clazz, jfieldID fieldID);
 591 
 592     void (JNICALL *SetStaticObjectField)
 593       (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value);
 594     void (JNICALL *SetStaticBooleanField)
 595       (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value);
 596     void (JNICALL *SetStaticByteField)
 597       (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value);
 598     void (JNICALL *SetStaticCharField)
 599       (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value);
 600     void (JNICALL *SetStaticShortField)
 601       (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value);
 602     void (JNICALL *SetStaticIntField)
 603       (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value);
 604     void (JNICALL *SetStaticLongField)
 605       (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value);
 606     void (JNICALL *SetStaticFloatField)
 607       (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value);
 608     void (JNICALL *SetStaticDoubleField)
 609       (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value);
 610 
 611     jstring (JNICALL *NewString)
 612       (JNIEnv *env, const jchar *unicode, jsize len);
 613     jsize (JNICALL *GetStringLength)
 614       (JNIEnv *env, jstring str);
 615     const jchar *(JNICALL *GetStringChars)
 616       (JNIEnv *env, jstring str, jboolean *isCopy);
 617     void (JNICALL *ReleaseStringChars)
 618       (JNIEnv *env, jstring str, const jchar *chars);
 619 
 620     jstring (JNICALL *NewStringUTF)
 621       (JNIEnv *env, const char *utf);
 622     jsize (JNICALL *GetStringUTFLength)
 623       (JNIEnv *env, jstring str);
 624     const char* (JNICALL *GetStringUTFChars)
 625       (JNIEnv *env, jstring str, jboolean *isCopy);
 626     void (JNICALL *ReleaseStringUTFChars)
 627       (JNIEnv *env, jstring str, const char* chars);
 628 
 629 
 630     jsize (JNICALL *GetArrayLength)
 631       (JNIEnv *env, jarray array);
 632 
 633     jobjectArray (JNICALL *NewObjectArray)
 634       (JNIEnv *env, jsize len, jclass clazz, jobject init);
 635     jobject (JNICALL *GetObjectArrayElement)
 636       (JNIEnv *env, jobjectArray array, jsize index);
 637     void (JNICALL *SetObjectArrayElement)
 638       (JNIEnv *env, jobjectArray array, jsize index, jobject val);
 639 
 640     jbooleanArray (JNICALL *NewBooleanArray)
 641       (JNIEnv *env, jsize len);
 642     jbyteArray (JNICALL *NewByteArray)
 643       (JNIEnv *env, jsize len);
 644     jcharArray (JNICALL *NewCharArray)
 645       (JNIEnv *env, jsize len);
 646     jshortArray (JNICALL *NewShortArray)
 647       (JNIEnv *env, jsize len);
 648     jintArray (JNICALL *NewIntArray)
 649       (JNIEnv *env, jsize len);
 650     jlongArray (JNICALL *NewLongArray)
 651       (JNIEnv *env, jsize len);
 652     jfloatArray (JNICALL *NewFloatArray)
 653       (JNIEnv *env, jsize len);
 654     jdoubleArray (JNICALL *NewDoubleArray)
 655       (JNIEnv *env, jsize len);
 656 
 657     jboolean * (JNICALL *GetBooleanArrayElements)
 658       (JNIEnv *env, jbooleanArray array, jboolean *isCopy);
 659     jbyte * (JNICALL *GetByteArrayElements)
 660       (JNIEnv *env, jbyteArray array, jboolean *isCopy);
 661     jchar * (JNICALL *GetCharArrayElements)
 662       (JNIEnv *env, jcharArray array, jboolean *isCopy);
 663     jshort * (JNICALL *GetShortArrayElements)
 664       (JNIEnv *env, jshortArray array, jboolean *isCopy);
 665     jint * (JNICALL *GetIntArrayElements)
 666       (JNIEnv *env, jintArray array, jboolean *isCopy);
 667     jlong * (JNICALL *GetLongArrayElements)
 668       (JNIEnv *env, jlongArray array, jboolean *isCopy);
 669     jfloat * (JNICALL *GetFloatArrayElements)
 670       (JNIEnv *env, jfloatArray array, jboolean *isCopy);
 671     jdouble * (JNICALL *GetDoubleArrayElements)
 672       (JNIEnv *env, jdoubleArray array, jboolean *isCopy);
 673 
 674     void (JNICALL *ReleaseBooleanArrayElements)
 675       (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode);
 676     void (JNICALL *ReleaseByteArrayElements)
 677       (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode);
 678     void (JNICALL *ReleaseCharArrayElements)
 679       (JNIEnv *env, jcharArray array, jchar *elems, jint mode);
 680     void (JNICALL *ReleaseShortArrayElements)
 681       (JNIEnv *env, jshortArray array, jshort *elems, jint mode);
 682     void (JNICALL *ReleaseIntArrayElements)
 683       (JNIEnv *env, jintArray array, jint *elems, jint mode);
 684     void (JNICALL *ReleaseLongArrayElements)
 685       (JNIEnv *env, jlongArray array, jlong *elems, jint mode);
 686     void (JNICALL *ReleaseFloatArrayElements)
 687       (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode);
 688     void (JNICALL *ReleaseDoubleArrayElements)
 689       (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode);
 690         
 691     void (JNICALL *GetBooleanArrayRegion)
 692       (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf);
 693     void (JNICALL *GetByteArrayRegion)
 694       (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf);
 695     void (JNICALL *GetCharArrayRegion)
 696       (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf);
 697     void (JNICALL *GetShortArrayRegion)
 698       (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf);
 699     void (JNICALL *GetIntArrayRegion)
 700       (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf);
 701     void (JNICALL *GetLongArrayRegion)
 702       (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf);
 703     void (JNICALL *GetFloatArrayRegion)
 704       (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf);
 705     void (JNICALL *GetDoubleArrayRegion)
 706       (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf);
 707 
 708     void (JNICALL *SetBooleanArrayRegion)
 709       (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf);
 710     void (JNICALL *SetByteArrayRegion)
 711       (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf);
 712     void (JNICALL *SetCharArrayRegion)
 713       (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf);
 714     void (JNICALL *SetShortArrayRegion)
 715       (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf);
 716     void (JNICALL *SetIntArrayRegion)
 717       (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf);
 718     void (JNICALL *SetLongArrayRegion)
 719       (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf);
 720     void (JNICALL *SetFloatArrayRegion)
 721       (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf);
 722     void (JNICALL *SetDoubleArrayRegion)
 723       (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf);
 724 
 725     jint (JNICALL *RegisterNatives)
 726       (JNIEnv *env, jclass clazz, const JNINativeMethod *methods,
 727        jint nMethods);
 728     jint (JNICALL *UnregisterNatives)
 729       (JNIEnv *env, jclass clazz);
 730 
 731     jint (JNICALL *MonitorEnter)
 732       (JNIEnv *env, jobject obj);
 733     jint (JNICALL *MonitorExit)
 734       (JNIEnv *env, jobject obj);
 735 
 736     jint (JNICALL *GetJavaVM)
 737       (JNIEnv *env, JavaVM **vm);
 738 
 739     void (JNICALL *GetStringRegion)
 740       (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf);
 741     void (JNICALL *GetStringUTFRegion)
 742       (JNIEnv *env, jstring str, jsize start, jsize len, char *buf);
 743 
 744     void * (JNICALL *GetPrimitiveArrayCritical)
 745       (JNIEnv *env, jarray array, jboolean *isCopy);
 746     void (JNICALL *ReleasePrimitiveArrayCritical)
 747       (JNIEnv *env, jarray array, void *carray, jint mode);
 748 
 749     const jchar * (JNICALL *GetStringCritical)
 750       (JNIEnv *env, jstring string, jboolean *isCopy);
 751     void (JNICALL *ReleaseStringCritical)
 752       (JNIEnv *env, jstring string, const jchar *cstring);
 753 
 754     jweak (JNICALL *NewWeakGlobalRef)
 755        (JNIEnv *env, jobject obj);
 756     void (JNICALL *DeleteWeakGlobalRef)
 757        (JNIEnv *env, jweak ref);
 758 
 759     jboolean (JNICALL *ExceptionCheck)
 760        (JNIEnv *env);
 761 
 762     jobject (JNICALL *NewDirectByteBuffer)
 763        (JNIEnv* env, void* address, jlong capacity);
 764     void* (JNICALL *GetDirectBufferAddress)
 765        (JNIEnv* env, jobject buf);
 766     jlong (JNICALL *GetDirectBufferCapacity)
 767        (JNIEnv* env, jobject buf);
 768 
 769     /* New JNI 1.6 Features */
 770 
 771     jobjectRefType (JNICALL *GetObjectRefType)
 772         (JNIEnv* env, jobject obj);
 773 
 774     /* Module Features */
 775 
 776     jobject (JNICALL *GetModule)
 777        (JNIEnv* env, jclass clazz);
 778 
 779     /* Flattened arrays Features */
 780     void* (JNICALL *GetFlattenedArrayElements)
 781       (JNIEnv* env, jarray array , jboolean *isCopy);
 782     void (JNICALL *ReleaseFlattenedArrayElements)
 783       (JNIEnv* env, jarray, void* elem, jint mode);
 784     jclass (JNICALL *GetFlattenedArrayElementClass)
 785       (JNIEnv* env, jarray array);
 786     jsize (JNICALL *GetFlattenedArrayElementSize)
 787       (JNIEnv* env, jarray array);
 788     jsize (JNICALL *GetFieldOffsetInFlattenedLayout)
 789       (JNIEnv* env, jclass clazz,  const char *name, const char *signature, jboolean* isFlattened);
 790 };
 791 
 792 /*
 793  * We use inlined functions for C++ so that programmers can write:
 794  *
 795  *    env->FindClass("java/lang/String")
 796  *
 797  * in C++ rather than:
 798  *
 799  *    (*env)->FindClass(env, "java/lang/String")
 800  *
 801  * in C.
 802  */
 803 
 804 struct JNIEnv_ {
 805     const struct JNINativeInterface_ *functions;
 806 #ifdef __cplusplus
 807 
 808     jint GetVersion() {
 809         return functions->GetVersion(this);
 810     }
 811     jclass DefineClass(const char *name, jobject loader, const jbyte *buf,
 812                        jsize len) {
 813         return functions->DefineClass(this, name, loader, buf, len);
 814     }
 815     jclass FindClass(const char *name) {
 816         return functions->FindClass(this, name);
 817     }
 818     jmethodID FromReflectedMethod(jobject method) {
 819         return functions->FromReflectedMethod(this,method);
 820     }
 821     jfieldID FromReflectedField(jobject field) {
 822         return functions->FromReflectedField(this,field);
 823     }
 824 
 825     jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) {
 826         return functions->ToReflectedMethod(this, cls, methodID, isStatic);
 827     }
 828 
 829     jclass GetSuperclass(jclass sub) {
 830         return functions->GetSuperclass(this, sub);
 831     }
 832     jboolean IsAssignableFrom(jclass sub, jclass sup) {
 833         return functions->IsAssignableFrom(this, sub, sup);
 834     }
 835 
 836     jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) {
 837         return functions->ToReflectedField(this,cls,fieldID,isStatic);
 838     }
 839 
 840     jint Throw(jthrowable obj) {
 841         return functions->Throw(this, obj);
 842     }
 843     jint ThrowNew(jclass clazz, const char *msg) {
 844         return functions->ThrowNew(this, clazz, msg);
 845     }
 846     jthrowable ExceptionOccurred() {
 847         return functions->ExceptionOccurred(this);
 848     }
 849     void ExceptionDescribe() {
 850         functions->ExceptionDescribe(this);
 851     }
 852     void ExceptionClear() {
 853         functions->ExceptionClear(this);
 854     }
 855     void FatalError(const char *msg) {
 856         functions->FatalError(this, msg);
 857     }
 858 
 859     jint PushLocalFrame(jint capacity) {
 860         return functions->PushLocalFrame(this,capacity);
 861     }
 862     jobject PopLocalFrame(jobject result) {
 863         return functions->PopLocalFrame(this,result);
 864     }
 865 
 866     jobject NewGlobalRef(jobject lobj) {
 867         return functions->NewGlobalRef(this,lobj);
 868     }
 869     void DeleteGlobalRef(jobject gref) {
 870         functions->DeleteGlobalRef(this,gref);
 871     }
 872     void DeleteLocalRef(jobject obj) {
 873         functions->DeleteLocalRef(this, obj);
 874     }
 875 
 876     jboolean IsSameObject(jobject obj1, jobject obj2) {
 877         return functions->IsSameObject(this,obj1,obj2);
 878     }
 879 
 880     jobject NewLocalRef(jobject ref) {
 881         return functions->NewLocalRef(this,ref);
 882     }
 883     jint EnsureLocalCapacity(jint capacity) {
 884         return functions->EnsureLocalCapacity(this,capacity);
 885     }
 886 
 887     jobject AllocObject(jclass clazz) {
 888         return functions->AllocObject(this,clazz);
 889     }
 890     jobject NewObject(jclass clazz, jmethodID methodID, ...) {
 891         va_list args;
 892         jobject result;
 893         va_start(args, methodID);
 894         result = functions->NewObjectV(this,clazz,methodID,args);
 895         va_end(args);
 896         return result;
 897     }
 898     jobject NewObjectV(jclass clazz, jmethodID methodID,
 899                        va_list args) {
 900         return functions->NewObjectV(this,clazz,methodID,args);
 901     }
 902     jobject NewObjectA(jclass clazz, jmethodID methodID,
 903                        const jvalue *args) {
 904         return functions->NewObjectA(this,clazz,methodID,args);
 905     }
 906 
 907     jclass GetObjectClass(jobject obj) {
 908         return functions->GetObjectClass(this,obj);
 909     }
 910     jboolean IsInstanceOf(jobject obj, jclass clazz) {
 911         return functions->IsInstanceOf(this,obj,clazz);
 912     }
 913 
 914     jmethodID GetMethodID(jclass clazz, const char *name,
 915                           const char *sig) {
 916         return functions->GetMethodID(this,clazz,name,sig);
 917     }
 918 
 919     jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) {
 920         va_list args;
 921         jobject result;
 922         va_start(args,methodID);
 923         result = functions->CallObjectMethodV(this,obj,methodID,args);
 924         va_end(args);
 925         return result;
 926     }
 927     jobject CallObjectMethodV(jobject obj, jmethodID methodID,
 928                         va_list args) {
 929         return functions->CallObjectMethodV(this,obj,methodID,args);
 930     }
 931     jobject CallObjectMethodA(jobject obj, jmethodID methodID,
 932                         const jvalue * args) {
 933         return functions->CallObjectMethodA(this,obj,methodID,args);
 934     }
 935 
 936     jboolean CallBooleanMethod(jobject obj,
 937                                jmethodID methodID, ...) {
 938         va_list args;
 939         jboolean result;
 940         va_start(args,methodID);
 941         result = functions->CallBooleanMethodV(this,obj,methodID,args);
 942         va_end(args);
 943         return result;
 944     }
 945     jboolean CallBooleanMethodV(jobject obj, jmethodID methodID,
 946                                 va_list args) {
 947         return functions->CallBooleanMethodV(this,obj,methodID,args);
 948     }
 949     jboolean CallBooleanMethodA(jobject obj, jmethodID methodID,
 950                                 const jvalue * args) {
 951         return functions->CallBooleanMethodA(this,obj,methodID, args);
 952     }
 953 
 954     jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) {
 955         va_list args;
 956         jbyte result;
 957         va_start(args,methodID);
 958         result = functions->CallByteMethodV(this,obj,methodID,args);
 959         va_end(args);
 960         return result;
 961     }
 962     jbyte CallByteMethodV(jobject obj, jmethodID methodID,
 963                           va_list args) {
 964         return functions->CallByteMethodV(this,obj,methodID,args);
 965     }
 966     jbyte CallByteMethodA(jobject obj, jmethodID methodID,
 967                           const jvalue * args) {
 968         return functions->CallByteMethodA(this,obj,methodID,args);
 969     }
 970 
 971     jchar CallCharMethod(jobject obj, jmethodID methodID, ...) {
 972         va_list args;
 973         jchar result;
 974         va_start(args,methodID);
 975         result = functions->CallCharMethodV(this,obj,methodID,args);
 976         va_end(args);
 977         return result;
 978     }
 979     jchar CallCharMethodV(jobject obj, jmethodID methodID,
 980                           va_list args) {
 981         return functions->CallCharMethodV(this,obj,methodID,args);
 982     }
 983     jchar CallCharMethodA(jobject obj, jmethodID methodID,
 984                           const jvalue * args) {
 985         return functions->CallCharMethodA(this,obj,methodID,args);
 986     }
 987 
 988     jshort CallShortMethod(jobject obj, jmethodID methodID, ...) {
 989         va_list args;
 990         jshort result;
 991         va_start(args,methodID);
 992         result = functions->CallShortMethodV(this,obj,methodID,args);
 993         va_end(args);
 994         return result;
 995     }
 996     jshort CallShortMethodV(jobject obj, jmethodID methodID,
 997                             va_list args) {
 998         return functions->CallShortMethodV(this,obj,methodID,args);
 999     }
1000     jshort CallShortMethodA(jobject obj, jmethodID methodID,
1001                             const jvalue * args) {
1002         return functions->CallShortMethodA(this,obj,methodID,args);
1003     }
1004 
1005     jint CallIntMethod(jobject obj, jmethodID methodID, ...) {
1006         va_list args;
1007         jint result;
1008         va_start(args,methodID);
1009         result = functions->CallIntMethodV(this,obj,methodID,args);
1010         va_end(args);
1011         return result;
1012     }
1013     jint CallIntMethodV(jobject obj, jmethodID methodID,
1014                         va_list args) {
1015         return functions->CallIntMethodV(this,obj,methodID,args);
1016     }
1017     jint CallIntMethodA(jobject obj, jmethodID methodID,
1018                         const jvalue * args) {
1019         return functions->CallIntMethodA(this,obj,methodID,args);
1020     }
1021 
1022     jlong CallLongMethod(jobject obj, jmethodID methodID, ...) {
1023         va_list args;
1024         jlong result;
1025         va_start(args,methodID);
1026         result = functions->CallLongMethodV(this,obj,methodID,args);
1027         va_end(args);
1028         return result;
1029     }
1030     jlong CallLongMethodV(jobject obj, jmethodID methodID,
1031                           va_list args) {
1032         return functions->CallLongMethodV(this,obj,methodID,args);
1033     }
1034     jlong CallLongMethodA(jobject obj, jmethodID methodID,
1035                           const jvalue * args) {
1036         return functions->CallLongMethodA(this,obj,methodID,args);
1037     }
1038 
1039     jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) {
1040         va_list args;
1041         jfloat result;
1042         va_start(args,methodID);
1043         result = functions->CallFloatMethodV(this,obj,methodID,args);
1044         va_end(args);
1045         return result;
1046     }
1047     jfloat CallFloatMethodV(jobject obj, jmethodID methodID,
1048                             va_list args) {
1049         return functions->CallFloatMethodV(this,obj,methodID,args);
1050     }
1051     jfloat CallFloatMethodA(jobject obj, jmethodID methodID,
1052                             const jvalue * args) {
1053         return functions->CallFloatMethodA(this,obj,methodID,args);
1054     }
1055 
1056     jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) {
1057         va_list args;
1058         jdouble result;
1059         va_start(args,methodID);
1060         result = functions->CallDoubleMethodV(this,obj,methodID,args);
1061         va_end(args);
1062         return result;
1063     }
1064     jdouble CallDoubleMethodV(jobject obj, jmethodID methodID,
1065                         va_list args) {
1066         return functions->CallDoubleMethodV(this,obj,methodID,args);
1067     }
1068     jdouble CallDoubleMethodA(jobject obj, jmethodID methodID,
1069                         const jvalue * args) {
1070         return functions->CallDoubleMethodA(this,obj,methodID,args);
1071     }
1072 
1073     void CallVoidMethod(jobject obj, jmethodID methodID, ...) {
1074         va_list args;
1075         va_start(args,methodID);
1076         functions->CallVoidMethodV(this,obj,methodID,args);
1077         va_end(args);
1078     }
1079     void CallVoidMethodV(jobject obj, jmethodID methodID,
1080                          va_list args) {
1081         functions->CallVoidMethodV(this,obj,methodID,args);
1082     }
1083     void CallVoidMethodA(jobject obj, jmethodID methodID,
1084                          const jvalue * args) {
1085         functions->CallVoidMethodA(this,obj,methodID,args);
1086     }
1087 
1088     jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz,
1089                                        jmethodID methodID, ...) {
1090         va_list args;
1091         jobject result;
1092         va_start(args,methodID);
1093         result = functions->CallNonvirtualObjectMethodV(this,obj,clazz,
1094                                                         methodID,args);
1095         va_end(args);
1096         return result;
1097     }
1098     jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz,
1099                                         jmethodID methodID, va_list args) {
1100         return functions->CallNonvirtualObjectMethodV(this,obj,clazz,
1101                                                       methodID,args);
1102     }
1103     jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz,
1104                                         jmethodID methodID, const jvalue * args) {
1105         return functions->CallNonvirtualObjectMethodA(this,obj,clazz,
1106                                                       methodID,args);
1107     }
1108 
1109     jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz,
1110                                          jmethodID methodID, ...) {
1111         va_list args;
1112         jboolean result;
1113         va_start(args,methodID);
1114         result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
1115                                                          methodID,args);
1116         va_end(args);
1117         return result;
1118     }
1119     jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz,
1120                                           jmethodID methodID, va_list args) {
1121         return functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
1122                                                        methodID,args);
1123     }
1124     jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz,
1125                                           jmethodID methodID, const jvalue * args) {
1126         return functions->CallNonvirtualBooleanMethodA(this,obj,clazz,
1127                                                        methodID, args);
1128     }
1129 
1130     jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz,
1131                                    jmethodID methodID, ...) {
1132         va_list args;
1133         jbyte result;
1134         va_start(args,methodID);
1135         result = functions->CallNonvirtualByteMethodV(this,obj,clazz,
1136                                                       methodID,args);
1137         va_end(args);
1138         return result;
1139     }
1140     jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz,
1141                                     jmethodID methodID, va_list args) {
1142         return functions->CallNonvirtualByteMethodV(this,obj,clazz,
1143                                                     methodID,args);
1144     }
1145     jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz,
1146                                     jmethodID methodID, const jvalue * args) {
1147         return functions->CallNonvirtualByteMethodA(this,obj,clazz,
1148                                                     methodID,args);
1149     }
1150 
1151     jchar CallNonvirtualCharMethod(jobject obj, jclass clazz,
1152                                    jmethodID methodID, ...) {
1153         va_list args;
1154         jchar result;
1155         va_start(args,methodID);
1156         result = functions->CallNonvirtualCharMethodV(this,obj,clazz,
1157                                                       methodID,args);
1158         va_end(args);
1159         return result;
1160     }
1161     jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz,
1162                                     jmethodID methodID, va_list args) {
1163         return functions->CallNonvirtualCharMethodV(this,obj,clazz,
1164                                                     methodID,args);
1165     }
1166     jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz,
1167                                     jmethodID methodID, const jvalue * args) {
1168         return functions->CallNonvirtualCharMethodA(this,obj,clazz,
1169                                                     methodID,args);
1170     }
1171 
1172     jshort CallNonvirtualShortMethod(jobject obj, jclass clazz,
1173                                      jmethodID methodID, ...) {
1174         va_list args;
1175         jshort result;
1176         va_start(args,methodID);
1177         result = functions->CallNonvirtualShortMethodV(this,obj,clazz,
1178                                                        methodID,args);
1179         va_end(args);
1180         return result;
1181     }
1182     jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz,
1183                                       jmethodID methodID, va_list args) {
1184         return functions->CallNonvirtualShortMethodV(this,obj,clazz,
1185                                                      methodID,args);
1186     }
1187     jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz,
1188                                       jmethodID methodID, const jvalue * args) {
1189         return functions->CallNonvirtualShortMethodA(this,obj,clazz,
1190                                                      methodID,args);
1191     }
1192 
1193     jint CallNonvirtualIntMethod(jobject obj, jclass clazz,
1194                                  jmethodID methodID, ...) {
1195         va_list args;
1196         jint result;
1197         va_start(args,methodID);
1198         result = functions->CallNonvirtualIntMethodV(this,obj,clazz,
1199                                                      methodID,args);
1200         va_end(args);
1201         return result;
1202     }
1203     jint CallNonvirtualIntMethodV(jobject obj, jclass clazz,
1204                                   jmethodID methodID, va_list args) {
1205         return functions->CallNonvirtualIntMethodV(this,obj,clazz,
1206                                                    methodID,args);
1207     }
1208     jint CallNonvirtualIntMethodA(jobject obj, jclass clazz,
1209                                   jmethodID methodID, const jvalue * args) {
1210         return functions->CallNonvirtualIntMethodA(this,obj,clazz,
1211                                                    methodID,args);
1212     }
1213 
1214     jlong CallNonvirtualLongMethod(jobject obj, jclass clazz,
1215                                    jmethodID methodID, ...) {
1216         va_list args;
1217         jlong result;
1218         va_start(args,methodID);
1219         result = functions->CallNonvirtualLongMethodV(this,obj,clazz,
1220                                                       methodID,args);
1221         va_end(args);
1222         return result;
1223     }
1224     jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz,
1225                                     jmethodID methodID, va_list args) {
1226         return functions->CallNonvirtualLongMethodV(this,obj,clazz,
1227                                                     methodID,args);
1228     }
1229     jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz,
1230                                     jmethodID methodID, const jvalue * args) {
1231         return functions->CallNonvirtualLongMethodA(this,obj,clazz,
1232                                                     methodID,args);
1233     }
1234 
1235     jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz,
1236                                      jmethodID methodID, ...) {
1237         va_list args;
1238         jfloat result;
1239         va_start(args,methodID);
1240         result = functions->CallNonvirtualFloatMethodV(this,obj,clazz,
1241                                                        methodID,args);
1242         va_end(args);
1243         return result;
1244     }
1245     jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz,
1246                                       jmethodID methodID,
1247                                       va_list args) {
1248         return functions->CallNonvirtualFloatMethodV(this,obj,clazz,
1249                                                      methodID,args);
1250     }
1251     jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz,
1252                                       jmethodID methodID,
1253                                       const jvalue * args) {
1254         return functions->CallNonvirtualFloatMethodA(this,obj,clazz,
1255                                                      methodID,args);
1256     }
1257 
1258     jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz,
1259                                        jmethodID methodID, ...) {
1260         va_list args;
1261         jdouble result;
1262         va_start(args,methodID);
1263         result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
1264                                                         methodID,args);
1265         va_end(args);
1266         return result;
1267     }
1268     jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz,
1269                                         jmethodID methodID,
1270                                         va_list args) {
1271         return functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
1272                                                       methodID,args);
1273     }
1274     jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz,
1275                                         jmethodID methodID,
1276                                         const jvalue * args) {
1277         return functions->CallNonvirtualDoubleMethodA(this,obj,clazz,
1278                                                       methodID,args);
1279     }
1280 
1281     void CallNonvirtualVoidMethod(jobject obj, jclass clazz,
1282                                   jmethodID methodID, ...) {
1283         va_list args;
1284         va_start(args,methodID);
1285         functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
1286         va_end(args);
1287     }
1288     void CallNonvirtualVoidMethodV(jobject obj, jclass clazz,
1289                                    jmethodID methodID,
1290                                    va_list args) {
1291         functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
1292     }
1293     void CallNonvirtualVoidMethodA(jobject obj, jclass clazz,
1294                                    jmethodID methodID,
1295                                    const jvalue * args) {
1296         functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args);
1297     }
1298 
1299     jfieldID GetFieldID(jclass clazz, const char *name,
1300                         const char *sig) {
1301         return functions->GetFieldID(this,clazz,name,sig);
1302     }
1303 
1304     jobject GetObjectField(jobject obj, jfieldID fieldID) {
1305         return functions->GetObjectField(this,obj,fieldID);
1306     }
1307     jboolean GetBooleanField(jobject obj, jfieldID fieldID) {
1308         return functions->GetBooleanField(this,obj,fieldID);
1309     }
1310     jbyte GetByteField(jobject obj, jfieldID fieldID) {
1311         return functions->GetByteField(this,obj,fieldID);
1312     }
1313     jchar GetCharField(jobject obj, jfieldID fieldID) {
1314         return functions->GetCharField(this,obj,fieldID);
1315     }
1316     jshort GetShortField(jobject obj, jfieldID fieldID) {
1317         return functions->GetShortField(this,obj,fieldID);
1318     }
1319     jint GetIntField(jobject obj, jfieldID fieldID) {
1320         return functions->GetIntField(this,obj,fieldID);
1321     }
1322     jlong GetLongField(jobject obj, jfieldID fieldID) {
1323         return functions->GetLongField(this,obj,fieldID);
1324     }
1325     jfloat GetFloatField(jobject obj, jfieldID fieldID) {
1326         return functions->GetFloatField(this,obj,fieldID);
1327     }
1328     jdouble GetDoubleField(jobject obj, jfieldID fieldID) {
1329         return functions->GetDoubleField(this,obj,fieldID);
1330     }
1331 
1332     void SetObjectField(jobject obj, jfieldID fieldID, jobject val) {
1333         functions->SetObjectField(this,obj,fieldID,val);
1334     }
1335     void SetBooleanField(jobject obj, jfieldID fieldID,
1336                          jboolean val) {
1337         functions->SetBooleanField(this,obj,fieldID,val);
1338     }
1339     void SetByteField(jobject obj, jfieldID fieldID,
1340                       jbyte val) {
1341         functions->SetByteField(this,obj,fieldID,val);
1342     }
1343     void SetCharField(jobject obj, jfieldID fieldID,
1344                       jchar val) {
1345         functions->SetCharField(this,obj,fieldID,val);
1346     }
1347     void SetShortField(jobject obj, jfieldID fieldID,
1348                        jshort val) {
1349         functions->SetShortField(this,obj,fieldID,val);
1350     }
1351     void SetIntField(jobject obj, jfieldID fieldID,
1352                      jint val) {
1353         functions->SetIntField(this,obj,fieldID,val);
1354     }
1355     void SetLongField(jobject obj, jfieldID fieldID,
1356                       jlong val) {
1357         functions->SetLongField(this,obj,fieldID,val);
1358     }
1359     void SetFloatField(jobject obj, jfieldID fieldID,
1360                        jfloat val) {
1361         functions->SetFloatField(this,obj,fieldID,val);
1362     }
1363     void SetDoubleField(jobject obj, jfieldID fieldID,
1364                         jdouble val) {
1365         functions->SetDoubleField(this,obj,fieldID,val);
1366     }
1367 
1368     jmethodID GetStaticMethodID(jclass clazz, const char *name,
1369                                 const char *sig) {
1370         return functions->GetStaticMethodID(this,clazz,name,sig);
1371     }
1372 
1373     jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID,
1374                              ...) {
1375         va_list args;
1376         jobject result;
1377         va_start(args,methodID);
1378         result = functions->CallStaticObjectMethodV(this,clazz,methodID,args);
1379         va_end(args);
1380         return result;
1381     }
1382     jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID,
1383                               va_list args) {
1384         return functions->CallStaticObjectMethodV(this,clazz,methodID,args);
1385     }
1386     jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID,
1387                               const jvalue *args) {
1388         return functions->CallStaticObjectMethodA(this,clazz,methodID,args);
1389     }
1390 
1391     jboolean CallStaticBooleanMethod(jclass clazz,
1392                                      jmethodID methodID, ...) {
1393         va_list args;
1394         jboolean result;
1395         va_start(args,methodID);
1396         result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
1397         va_end(args);
1398         return result;
1399     }
1400     jboolean CallStaticBooleanMethodV(jclass clazz,
1401                                       jmethodID methodID, va_list args) {
1402         return functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
1403     }
1404     jboolean CallStaticBooleanMethodA(jclass clazz,
1405                                       jmethodID methodID, const jvalue *args) {
1406         return functions->CallStaticBooleanMethodA(this,clazz,methodID,args);
1407     }
1408 
1409     jbyte CallStaticByteMethod(jclass clazz,
1410                                jmethodID methodID, ...) {
1411         va_list args;
1412         jbyte result;
1413         va_start(args,methodID);
1414         result = functions->CallStaticByteMethodV(this,clazz,methodID,args);
1415         va_end(args);
1416         return result;
1417     }
1418     jbyte CallStaticByteMethodV(jclass clazz,
1419                                 jmethodID methodID, va_list args) {
1420         return functions->CallStaticByteMethodV(this,clazz,methodID,args);
1421     }
1422     jbyte CallStaticByteMethodA(jclass clazz,
1423                                 jmethodID methodID, const jvalue *args) {
1424         return functions->CallStaticByteMethodA(this,clazz,methodID,args);
1425     }
1426 
1427     jchar CallStaticCharMethod(jclass clazz,
1428                                jmethodID methodID, ...) {
1429         va_list args;
1430         jchar result;
1431         va_start(args,methodID);
1432         result = functions->CallStaticCharMethodV(this,clazz,methodID,args);
1433         va_end(args);
1434         return result;
1435     }
1436     jchar CallStaticCharMethodV(jclass clazz,
1437                                 jmethodID methodID, va_list args) {
1438         return functions->CallStaticCharMethodV(this,clazz,methodID,args);
1439     }
1440     jchar CallStaticCharMethodA(jclass clazz,
1441                                 jmethodID methodID, const jvalue *args) {
1442         return functions->CallStaticCharMethodA(this,clazz,methodID,args);
1443     }
1444 
1445     jshort CallStaticShortMethod(jclass clazz,
1446                                  jmethodID methodID, ...) {
1447         va_list args;
1448         jshort result;
1449         va_start(args,methodID);
1450         result = functions->CallStaticShortMethodV(this,clazz,methodID,args);
1451         va_end(args);
1452         return result;
1453     }
1454     jshort CallStaticShortMethodV(jclass clazz,
1455                                   jmethodID methodID, va_list args) {
1456         return functions->CallStaticShortMethodV(this,clazz,methodID,args);
1457     }
1458     jshort CallStaticShortMethodA(jclass clazz,
1459                                   jmethodID methodID, const jvalue *args) {
1460         return functions->CallStaticShortMethodA(this,clazz,methodID,args);
1461     }
1462 
1463     jint CallStaticIntMethod(jclass clazz,
1464                              jmethodID methodID, ...) {
1465         va_list args;
1466         jint result;
1467         va_start(args,methodID);
1468         result = functions->CallStaticIntMethodV(this,clazz,methodID,args);
1469         va_end(args);
1470         return result;
1471     }
1472     jint CallStaticIntMethodV(jclass clazz,
1473                               jmethodID methodID, va_list args) {
1474         return functions->CallStaticIntMethodV(this,clazz,methodID,args);
1475     }
1476     jint CallStaticIntMethodA(jclass clazz,
1477                               jmethodID methodID, const jvalue *args) {
1478         return functions->CallStaticIntMethodA(this,clazz,methodID,args);
1479     }
1480 
1481     jlong CallStaticLongMethod(jclass clazz,
1482                                jmethodID methodID, ...) {
1483         va_list args;
1484         jlong result;
1485         va_start(args,methodID);
1486         result = functions->CallStaticLongMethodV(this,clazz,methodID,args);
1487         va_end(args);
1488         return result;
1489     }
1490     jlong CallStaticLongMethodV(jclass clazz,
1491                                 jmethodID methodID, va_list args) {
1492         return functions->CallStaticLongMethodV(this,clazz,methodID,args);
1493     }
1494     jlong CallStaticLongMethodA(jclass clazz,
1495                                 jmethodID methodID, const jvalue *args) {
1496         return functions->CallStaticLongMethodA(this,clazz,methodID,args);
1497     }
1498 
1499     jfloat CallStaticFloatMethod(jclass clazz,
1500                                  jmethodID methodID, ...) {
1501         va_list args;
1502         jfloat result;
1503         va_start(args,methodID);
1504         result = functions->CallStaticFloatMethodV(this,clazz,methodID,args);
1505         va_end(args);
1506         return result;
1507     }
1508     jfloat CallStaticFloatMethodV(jclass clazz,
1509                                   jmethodID methodID, va_list args) {
1510         return functions->CallStaticFloatMethodV(this,clazz,methodID,args);
1511     }
1512     jfloat CallStaticFloatMethodA(jclass clazz,
1513                                   jmethodID methodID, const jvalue *args) {
1514         return functions->CallStaticFloatMethodA(this,clazz,methodID,args);
1515     }
1516 
1517     jdouble CallStaticDoubleMethod(jclass clazz,
1518                                    jmethodID methodID, ...) {
1519         va_list args;
1520         jdouble result;
1521         va_start(args,methodID);
1522         result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
1523         va_end(args);
1524         return result;
1525     }
1526     jdouble CallStaticDoubleMethodV(jclass clazz,
1527                                     jmethodID methodID, va_list args) {
1528         return functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
1529     }
1530     jdouble CallStaticDoubleMethodA(jclass clazz,
1531                                     jmethodID methodID, const jvalue *args) {
1532         return functions->CallStaticDoubleMethodA(this,clazz,methodID,args);
1533     }
1534 
1535     void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) {
1536         va_list args;
1537         va_start(args,methodID);
1538         functions->CallStaticVoidMethodV(this,cls,methodID,args);
1539         va_end(args);
1540     }
1541     void CallStaticVoidMethodV(jclass cls, jmethodID methodID,
1542                                va_list args) {
1543         functions->CallStaticVoidMethodV(this,cls,methodID,args);
1544     }
1545     void CallStaticVoidMethodA(jclass cls, jmethodID methodID,
1546                                const jvalue * args) {
1547         functions->CallStaticVoidMethodA(this,cls,methodID,args);
1548     }
1549 
1550     jfieldID GetStaticFieldID(jclass clazz, const char *name,
1551                               const char *sig) {
1552         return functions->GetStaticFieldID(this,clazz,name,sig);
1553     }
1554     jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) {
1555         return functions->GetStaticObjectField(this,clazz,fieldID);
1556     }
1557     jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) {
1558         return functions->GetStaticBooleanField(this,clazz,fieldID);
1559     }
1560     jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) {
1561         return functions->GetStaticByteField(this,clazz,fieldID);
1562     }
1563     jchar GetStaticCharField(jclass clazz, jfieldID fieldID) {
1564         return functions->GetStaticCharField(this,clazz,fieldID);
1565     }
1566     jshort GetStaticShortField(jclass clazz, jfieldID fieldID) {
1567         return functions->GetStaticShortField(this,clazz,fieldID);
1568     }
1569     jint GetStaticIntField(jclass clazz, jfieldID fieldID) {
1570         return functions->GetStaticIntField(this,clazz,fieldID);
1571     }
1572     jlong GetStaticLongField(jclass clazz, jfieldID fieldID) {
1573         return functions->GetStaticLongField(this,clazz,fieldID);
1574     }
1575     jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) {
1576         return functions->GetStaticFloatField(this,clazz,fieldID);
1577     }
1578     jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) {
1579         return functions->GetStaticDoubleField(this,clazz,fieldID);
1580     }
1581 
1582     void SetStaticObjectField(jclass clazz, jfieldID fieldID,
1583                         jobject value) {
1584       functions->SetStaticObjectField(this,clazz,fieldID,value);
1585     }
1586     void SetStaticBooleanField(jclass clazz, jfieldID fieldID,
1587                         jboolean value) {
1588       functions->SetStaticBooleanField(this,clazz,fieldID,value);
1589     }
1590     void SetStaticByteField(jclass clazz, jfieldID fieldID,
1591                         jbyte value) {
1592       functions->SetStaticByteField(this,clazz,fieldID,value);
1593     }
1594     void SetStaticCharField(jclass clazz, jfieldID fieldID,
1595                         jchar value) {
1596       functions->SetStaticCharField(this,clazz,fieldID,value);
1597     }
1598     void SetStaticShortField(jclass clazz, jfieldID fieldID,
1599                         jshort value) {
1600       functions->SetStaticShortField(this,clazz,fieldID,value);
1601     }
1602     void SetStaticIntField(jclass clazz, jfieldID fieldID,
1603                         jint value) {
1604       functions->SetStaticIntField(this,clazz,fieldID,value);
1605     }
1606     void SetStaticLongField(jclass clazz, jfieldID fieldID,
1607                         jlong value) {
1608       functions->SetStaticLongField(this,clazz,fieldID,value);
1609     }
1610     void SetStaticFloatField(jclass clazz, jfieldID fieldID,
1611                         jfloat value) {
1612       functions->SetStaticFloatField(this,clazz,fieldID,value);
1613     }
1614     void SetStaticDoubleField(jclass clazz, jfieldID fieldID,
1615                         jdouble value) {
1616       functions->SetStaticDoubleField(this,clazz,fieldID,value);
1617     }
1618 
1619     jstring NewString(const jchar *unicode, jsize len) {
1620         return functions->NewString(this,unicode,len);
1621     }
1622     jsize GetStringLength(jstring str) {
1623         return functions->GetStringLength(this,str);
1624     }
1625     const jchar *GetStringChars(jstring str, jboolean *isCopy) {
1626         return functions->GetStringChars(this,str,isCopy);
1627     }
1628     void ReleaseStringChars(jstring str, const jchar *chars) {
1629         functions->ReleaseStringChars(this,str,chars);
1630     }
1631 
1632     jstring NewStringUTF(const char *utf) {
1633         return functions->NewStringUTF(this,utf);
1634     }
1635     jsize GetStringUTFLength(jstring str) {
1636         return functions->GetStringUTFLength(this,str);
1637     }
1638     const char* GetStringUTFChars(jstring str, jboolean *isCopy) {
1639         return functions->GetStringUTFChars(this,str,isCopy);
1640     }
1641     void ReleaseStringUTFChars(jstring str, const char* chars) {
1642         functions->ReleaseStringUTFChars(this,str,chars);
1643     }
1644 
1645     jsize GetArrayLength(jarray array) {
1646         return functions->GetArrayLength(this,array);
1647     }
1648 
1649     jobjectArray NewObjectArray(jsize len, jclass clazz,
1650                                 jobject init) {
1651         return functions->NewObjectArray(this,len,clazz,init);
1652     }
1653     jobject GetObjectArrayElement(jobjectArray array, jsize index) {
1654         return functions->GetObjectArrayElement(this,array,index);
1655     }
1656     void SetObjectArrayElement(jobjectArray array, jsize index,
1657                                jobject val) {
1658         functions->SetObjectArrayElement(this,array,index,val);
1659     }
1660 
1661     jbooleanArray NewBooleanArray(jsize len) {
1662         return functions->NewBooleanArray(this,len);
1663     }
1664     jbyteArray NewByteArray(jsize len) {
1665         return functions->NewByteArray(this,len);
1666     }
1667     jcharArray NewCharArray(jsize len) {
1668         return functions->NewCharArray(this,len);
1669     }
1670     jshortArray NewShortArray(jsize len) {
1671         return functions->NewShortArray(this,len);
1672     }
1673     jintArray NewIntArray(jsize len) {
1674         return functions->NewIntArray(this,len);
1675     }
1676     jlongArray NewLongArray(jsize len) {
1677         return functions->NewLongArray(this,len);
1678     }
1679     jfloatArray NewFloatArray(jsize len) {
1680         return functions->NewFloatArray(this,len);
1681     }
1682     jdoubleArray NewDoubleArray(jsize len) {
1683         return functions->NewDoubleArray(this,len);
1684     }
1685 
1686     jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) {
1687         return functions->GetBooleanArrayElements(this,array,isCopy);
1688     }
1689     jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) {
1690         return functions->GetByteArrayElements(this,array,isCopy);
1691     }
1692     jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) {
1693         return functions->GetCharArrayElements(this,array,isCopy);
1694     }
1695     jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) {
1696         return functions->GetShortArrayElements(this,array,isCopy);
1697     }
1698     jint * GetIntArrayElements(jintArray array, jboolean *isCopy) {
1699         return functions->GetIntArrayElements(this,array,isCopy);
1700     }
1701     jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) {
1702         return functions->GetLongArrayElements(this,array,isCopy);
1703     }
1704     jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) {
1705         return functions->GetFloatArrayElements(this,array,isCopy);
1706     }
1707     jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) {
1708         return functions->GetDoubleArrayElements(this,array,isCopy);
1709     }
1710 
1711     void ReleaseBooleanArrayElements(jbooleanArray array,
1712                                      jboolean *elems,
1713                                      jint mode) {
1714         functions->ReleaseBooleanArrayElements(this,array,elems,mode);
1715     }
1716     void ReleaseByteArrayElements(jbyteArray array,
1717                                   jbyte *elems,
1718                                   jint mode) {
1719         functions->ReleaseByteArrayElements(this,array,elems,mode);
1720     }
1721     void ReleaseCharArrayElements(jcharArray array,
1722                                   jchar *elems,
1723                                   jint mode) {
1724         functions->ReleaseCharArrayElements(this,array,elems,mode);
1725     }
1726     void ReleaseShortArrayElements(jshortArray array,
1727                                    jshort *elems,
1728                                    jint mode) {
1729         functions->ReleaseShortArrayElements(this,array,elems,mode);
1730     }
1731     void ReleaseIntArrayElements(jintArray array,
1732                                  jint *elems,
1733                                  jint mode) {
1734         functions->ReleaseIntArrayElements(this,array,elems,mode);
1735     }
1736     void ReleaseLongArrayElements(jlongArray array,
1737                                   jlong *elems,
1738                                   jint mode) {
1739         functions->ReleaseLongArrayElements(this,array,elems,mode);
1740     }
1741     void ReleaseFloatArrayElements(jfloatArray array,
1742                                    jfloat *elems,
1743                                    jint mode) {
1744         functions->ReleaseFloatArrayElements(this,array,elems,mode);
1745     }
1746     void ReleaseDoubleArrayElements(jdoubleArray array,
1747                                     jdouble *elems,
1748                                     jint mode) {
1749         functions->ReleaseDoubleArrayElements(this,array,elems,mode);
1750     }
1751 
1752     void GetBooleanArrayRegion(jbooleanArray array,
1753                                jsize start, jsize len, jboolean *buf) {
1754         functions->GetBooleanArrayRegion(this,array,start,len,buf);
1755     }
1756     void GetByteArrayRegion(jbyteArray array,
1757                             jsize start, jsize len, jbyte *buf) {
1758         functions->GetByteArrayRegion(this,array,start,len,buf);
1759     }
1760     void GetCharArrayRegion(jcharArray array,
1761                             jsize start, jsize len, jchar *buf) {
1762         functions->GetCharArrayRegion(this,array,start,len,buf);
1763     }
1764     void GetShortArrayRegion(jshortArray array,
1765                              jsize start, jsize len, jshort *buf) {
1766         functions->GetShortArrayRegion(this,array,start,len,buf);
1767     }
1768     void GetIntArrayRegion(jintArray array,
1769                            jsize start, jsize len, jint *buf) {
1770         functions->GetIntArrayRegion(this,array,start,len,buf);
1771     }
1772     void GetLongArrayRegion(jlongArray array,
1773                             jsize start, jsize len, jlong *buf) {
1774         functions->GetLongArrayRegion(this,array,start,len,buf);
1775     }
1776     void GetFloatArrayRegion(jfloatArray array,
1777                              jsize start, jsize len, jfloat *buf) {
1778         functions->GetFloatArrayRegion(this,array,start,len,buf);
1779     }
1780     void GetDoubleArrayRegion(jdoubleArray array,
1781                               jsize start, jsize len, jdouble *buf) {
1782         functions->GetDoubleArrayRegion(this,array,start,len,buf);
1783     }
1784 
1785     void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len,
1786                                const jboolean *buf) {
1787         functions->SetBooleanArrayRegion(this,array,start,len,buf);
1788     }
1789     void SetByteArrayRegion(jbyteArray array, jsize start, jsize len,
1790                             const jbyte *buf) {
1791         functions->SetByteArrayRegion(this,array,start,len,buf);
1792     }
1793     void SetCharArrayRegion(jcharArray array, jsize start, jsize len,
1794                             const jchar *buf) {
1795         functions->SetCharArrayRegion(this,array,start,len,buf);
1796     }
1797     void SetShortArrayRegion(jshortArray array, jsize start, jsize len,
1798                              const jshort *buf) {
1799         functions->SetShortArrayRegion(this,array,start,len,buf);
1800     }
1801     void SetIntArrayRegion(jintArray array, jsize start, jsize len,
1802                            const jint *buf) {
1803         functions->SetIntArrayRegion(this,array,start,len,buf);
1804     }
1805     void SetLongArrayRegion(jlongArray array, jsize start, jsize len,
1806                             const jlong *buf) {
1807         functions->SetLongArrayRegion(this,array,start,len,buf);
1808     }
1809     void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len,
1810                              const jfloat *buf) {
1811         functions->SetFloatArrayRegion(this,array,start,len,buf);
1812     }
1813     void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len,
1814                               const jdouble *buf) {
1815         functions->SetDoubleArrayRegion(this,array,start,len,buf);
1816     }
1817 
1818     jint RegisterNatives(jclass clazz, const JNINativeMethod *methods,
1819                          jint nMethods) {
1820         return functions->RegisterNatives(this,clazz,methods,nMethods);
1821     }
1822     jint UnregisterNatives(jclass clazz) {
1823         return functions->UnregisterNatives(this,clazz);
1824     }
1825 
1826     jint MonitorEnter(jobject obj) {
1827         return functions->MonitorEnter(this,obj);
1828     }
1829     jint MonitorExit(jobject obj) {
1830         return functions->MonitorExit(this,obj);
1831     }
1832 
1833     jint GetJavaVM(JavaVM **vm) {
1834         return functions->GetJavaVM(this,vm);
1835     }
1836 
1837     void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) {
1838         functions->GetStringRegion(this,str,start,len,buf);
1839     }
1840     void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) {
1841         functions->GetStringUTFRegion(this,str,start,len,buf);
1842     }
1843 
1844     void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) {
1845         return functions->GetPrimitiveArrayCritical(this,array,isCopy);
1846     }
1847     void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) {
1848         functions->ReleasePrimitiveArrayCritical(this,array,carray,mode);
1849     }
1850 
1851     const jchar * GetStringCritical(jstring string, jboolean *isCopy) {
1852         return functions->GetStringCritical(this,string,isCopy);
1853     }
1854     void ReleaseStringCritical(jstring string, const jchar *cstring) {
1855         functions->ReleaseStringCritical(this,string,cstring);
1856     }
1857 
1858     jweak NewWeakGlobalRef(jobject obj) {
1859         return functions->NewWeakGlobalRef(this,obj);
1860     }
1861     void DeleteWeakGlobalRef(jweak ref) {
1862         functions->DeleteWeakGlobalRef(this,ref);
1863     }
1864 
1865     jboolean ExceptionCheck() {
1866         return functions->ExceptionCheck(this);
1867     }
1868 
1869     jobject NewDirectByteBuffer(void* address, jlong capacity) {
1870         return functions->NewDirectByteBuffer(this, address, capacity);
1871     }
1872     void* GetDirectBufferAddress(jobject buf) {
1873         return functions->GetDirectBufferAddress(this, buf);
1874     }
1875     jlong GetDirectBufferCapacity(jobject buf) {
1876         return functions->GetDirectBufferCapacity(this, buf);
1877     }
1878     jobjectRefType GetObjectRefType(jobject obj) {
1879         return functions->GetObjectRefType(this, obj);
1880     }
1881 
1882     /* Module Features */
1883 
1884     jobject GetModule(jclass clazz) {
1885         return functions->GetModule(this, clazz);
1886     }
1887 
1888     /* Flattened arrays Features */
1889     void* GetFlattenedArrayElements(jarray array , jboolean *isCopy) {
1890         return functions->GetFlattenedArrayElements(this, array, isCopy);
1891     }
1892   
1893     void ReleaseFlattenedArrayElements(jarray array, void* elem, jint mode) {
1894         return functions->ReleaseFlattenedArrayElements(this, array, elem, mode);
1895     }
1896 
1897     jclass GetFlattenedArrayElementClass(jarray array) {
1898         return functions->GetFlattenedArrayElementClass(this, array);
1899     }
1900   
1901     jsize GetFlattenedArrayElementSize(jarray array) {
1902         return functions->GetFlattenedArrayElementSize(this, array);
1903     }
1904     
1905     jsize GetFieldOffsetInFlattenedLayout(jclass clazz,  const char *name, const char *signature, jboolean* isFlattened) {
1906         return functions->GetFieldOffsetInFlattenedLayout(this, clazz, name, signature, isFlattened);
1907     }
1908 
1909 #endif /* __cplusplus */
1910 };
1911 
1912 /*
1913  * optionString may be any option accepted by the JVM, or one of the
1914  * following:
1915  *
1916  * -D<name>=<value>          Set a system property.
1917  * -verbose[:class|gc|jni]   Enable verbose output, comma-separated. E.g.
1918  *                           "-verbose:class" or "-verbose:gc,class"
1919  *                           Standard names include: gc, class, and jni.
1920  *                           All nonstandard (VM-specific) names must begin
1921  *                           with "X".
1922  * vfprintf                  extraInfo is a pointer to the vfprintf hook.
1923  * exit                      extraInfo is a pointer to the exit hook.
1924  * abort                     extraInfo is a pointer to the abort hook.
1925  */
1926 typedef struct JavaVMOption {
1927     char *optionString;
1928     void *extraInfo;
1929 } JavaVMOption;
1930 
1931 typedef struct JavaVMInitArgs {
1932     jint version;
1933 
1934     jint nOptions;
1935     JavaVMOption *options;
1936     jboolean ignoreUnrecognized;
1937 } JavaVMInitArgs;
1938 
1939 typedef struct JavaVMAttachArgs {
1940     jint version;
1941 
1942     char *name;
1943     jobject group;
1944 } JavaVMAttachArgs;
1945 
1946 /* These will be VM-specific. */
1947 
1948 #define JDK1_2
1949 #define JDK1_4
1950 
1951 /* End VM-specific. */
1952 
1953 struct JNIInvokeInterface_ {
1954     void *reserved0;
1955     void *reserved1;
1956     void *reserved2;
1957 
1958     jint (JNICALL *DestroyJavaVM)(JavaVM *vm);
1959 
1960     jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args);
1961 
1962     jint (JNICALL *DetachCurrentThread)(JavaVM *vm);
1963 
1964     jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version);
1965 
1966     jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args);
1967 };
1968 
1969 struct JavaVM_ {
1970     const struct JNIInvokeInterface_ *functions;
1971 #ifdef __cplusplus
1972 
1973     jint DestroyJavaVM() {
1974         return functions->DestroyJavaVM(this);
1975     }
1976     jint AttachCurrentThread(void **penv, void *args) {
1977         return functions->AttachCurrentThread(this, penv, args);
1978     }
1979     jint DetachCurrentThread() {
1980         return functions->DetachCurrentThread(this);
1981     }
1982 
1983     jint GetEnv(void **penv, jint version) {
1984         return functions->GetEnv(this, penv, version);
1985     }
1986     jint AttachCurrentThreadAsDaemon(void **penv, void *args) {
1987         return functions->AttachCurrentThreadAsDaemon(this, penv, args);
1988     }
1989 #endif
1990 };
1991 
1992 #ifdef _JNI_IMPLEMENTATION_
1993 #define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT
1994 #else
1995 #define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT
1996 #endif
1997 _JNI_IMPORT_OR_EXPORT_ jint JNICALL
1998 JNI_GetDefaultJavaVMInitArgs(void *args);
1999 
2000 _JNI_IMPORT_OR_EXPORT_ jint JNICALL
2001 JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args);
2002 
2003 _JNI_IMPORT_OR_EXPORT_ jint JNICALL
2004 JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *);
2005 
2006 /* Defined by native libraries. */
2007 JNIEXPORT jint JNICALL
2008 JNI_OnLoad(JavaVM *vm, void *reserved);
2009 
2010 JNIEXPORT void JNICALL
2011 JNI_OnUnload(JavaVM *vm, void *reserved);
2012 
2013 #define JNI_VERSION_1_1 0x00010001
2014 #define JNI_VERSION_1_2 0x00010002
2015 #define JNI_VERSION_1_4 0x00010004
2016 #define JNI_VERSION_1_6 0x00010006
2017 #define JNI_VERSION_1_8 0x00010008
2018 #define JNI_VERSION_9   0x00090000
2019 #define JNI_VERSION_10  0x000a0000
2020 
2021 #ifdef __cplusplus
2022 } /* extern "C" */
2023 #endif /* __cplusplus */
2024 
2025 #endif /* !_JAVASOFT_JNI_H_ */