jclass (*FindClass)(JNIEnv*, const char*);
jfieldID (*GetFieldID)(JNIEnv*, jclass, const char*, const char*);
jobject (*GetObjectField)(JNIEnv*, jobject, jfieldID);
jfieldID (*GetStaticFieldID)(JNIEnv*, jclass, const char*,
const char*);
jobject (*GetStaticObjectField)(JNIEnv*, jclass, jfieldID);
void (*CallVoidMethod)(JNIEnv*, jobject, jmethodID, ...);
void (*CallStaticVoidMethod)(JNIEnv*, jclass, jmethodID, ...);
jstring (*NewStringUTF)(JNIEnv*, const char*);
jstring (*NewString)(JNIEnv*, const jchar*, jsize);
jsize (*GetStringLength)(JNIEnv*, jstring);
jstring (*NewStringUTF)(JNIEnv*, const char*);
const jchar* (*GetStringChars)(JNIEnv*, jstring, jboolean*);
jsize (*GetStringUTFLength)(JNIEnv*, jstring);
jsize (*GetArrayLength)(JNIEnv*, jarray);
jclass FindClass(const char* name)
{ return functions->FindClass(this, name); }
jfieldID GetFieldID(jclass clazz, const char* name, const char* sig)
{ return functions->GetFieldID(this, clazz, name, sig); }
jobject GetObjectField(jobject obj, jfieldID fieldID)
{ return functions->GetObjectField(this, obj, fieldID); }
jfieldID GetStaticFieldID(jclass clazz, const char* name, const char* sig)
{ return functions->GetStaticFieldID(this, clazz, name, sig); }
jobject GetStaticObjectField(jclass clazz, jfieldID fieldID)
{ return functions->GetStaticObjectField(this, clazz, fieldID); }
void CallVoidMethod(jobject obj, jmethodID methodID, ...)
void CallStaticVoidMethod(jclass clazz, jmethodID methodID, ...)
jstring NewStringUTF(const char* bytes)
{ return functions->NewStringUTF(this, bytes); }
jstring NewString(const jchar* unicodeChars, jsize len)
{ return functions->NewString(this, unicodeChars, len); }
jsize GetStringLength(jstring string)
{ return functions->GetStringLength(this, string); }
const char* GetStringUTFChars(jstring string, jboolean* isCopy)
{ return functions->GetStringUTFChars(this, string, isCopy); }
const jchar* GetStringChars(jstring string, jboolean* isCopy)
{ return functions->GetStringChars(this, string, isCopy); }
jsize GetStringUTFLength(jstring string)
{ return functions->GetStringUTFLength(this, string); }
jsize GetArrayLength(jarray array)
{ return functions->GetArrayLength(this, array); }
typedef uint8_t jboolean; /* unsigned 8 bits */
typedef int8_t jbyte; /* signed 8 bits */
typedef uint16_t jchar; /* unsigned 16 bits */
typedef int16_t jshort; /* signed 16 bits */
typedef int32_t jint; /* signed 32 bits */
typedef int64_t jlong; /* signed 64 bits */
typedef float jfloat; /* 32-bit IEEE 754 */
typedef double jdouble; /* 64-bit IEEE 754 */
/* "cardinal indices and sizes" */
typedef jint jsize;
typedef union jvalue {
jboolean z;
jbyte b;
jchar c;
jshort s;
jint i;
jlong j;
jfloat f;
jdouble d;
jobject l;
} jvalue;
jstring Ljava/lang/String;
c++中的宏定义
#define JNI_FALSE 0
#define JNI_TRUE 1
#define JNI_VERSION_1_1 0x00010001
#define JNI_VERSION_1_2 0x00010002
#define JNI_VERSION_1_4 0x00010004
#define JNI_VERSION_1_6 0x00010006
#define JNI_OK (0) /* no error */
#define JNI_ERR (-1) /* generic error */
#define JNI_EDETACHED (-2) /* thread detached from the VM */
#define JNI_EVERSION (-3) /* JNI version error */
#define JNI_ENOMEM (-4) /* Out of memory */
#define JNI_EEXIST (-5) /* VM already created */
#define JNI_EINVAL (-6) /* Invalid argument */
#define JNI_COMMIT 1 /* copy content, do not free buffer */
#define JNI_ABORT 2 /* free buffer w/o copying back */