* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* We used part of Netscape's Java Runtime Interface (JRI) as the starting
* point of our design and implementation.
/******************************************************************************
* Copyright (c) 1996 Netscape Communications Corporation. All rights reserved.
*****************************************************************************/
/* jni_md.h contains the machine-dependent typedefs for jbyte, jint
#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H
typedef unsigned char jboolean;
typedef unsigned short jchar;
class _jclass : public _jobject {};
class _jthrowable : public _jobject {};
class _jstring : public _jobject {};
class _jarray : public _jobject {};
class _jbooleanArray : public _jarray {};
class _jbyteArray : public _jarray {};
class _jcharArray : public _jarray {};
class _jshortArray : public _jarray {};
class _jintArray : public _jarray {};
class _jlongArray : public _jarray {};
class _jfloatArray : public _jarray {};
class _jdoubleArray : public _jarray {};
class _jobjectArray : public _jarray {};
typedef _jobject *jobject;
typedef _jthrowable *jthrowable;
typedef _jstring *jstring;
typedef _jbooleanArray *jbooleanArray;
typedef _jbyteArray *jbyteArray;
typedef _jcharArray *jcharArray;
typedef _jshortArray *jshortArray;
typedef _jintArray *jintArray;
typedef _jlongArray *jlongArray;
typedef _jfloatArray *jfloatArray;
typedef _jdoubleArray *jdoubleArray;
typedef _jobjectArray *jobjectArray;
typedef struct _jobject *jobject;
typedef jobject jthrowable;
typedef jarray jbooleanArray;
typedef jarray jbyteArray;
typedef jarray jcharArray;
typedef jarray jshortArray;
typedef jarray jintArray;
typedef jarray jlongArray;
typedef jarray jfloatArray;
typedef jarray jdoubleArray;
typedef jarray jobjectArray;
typedef struct _jfieldID *jfieldID;
typedef struct _jmethodID *jmethodID;
/* Return values from jobjectRefType */
typedef enum _jobjectType {
#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */
* possible return values for JNI functions.
#define JNI_OK 0 /* success */
#define JNI_ERR (-1) /* unknown error */
#define JNI_EDETACHED (-2) /* thread detached from the VM */
#define JNI_EVERSION (-3) /* JNI version error */
#define JNI_ENOMEM (-4) /* not enough memory */
#define JNI_EEXIST (-5) /* VM already created */
#define JNI_EINVAL (-6) /* invalid arguments */
* used in ReleaseScalarArrayElements
* used in RegisterNatives to describe native method name, signature,
* JNI Native Method Interface.
struct JNINativeInterface_;
typedef const struct JNINativeInterface_ *JNIEnv;
* JNI Invocation Interface.
struct JNIInvokeInterface_;
typedef const struct JNIInvokeInterface_ *JavaVM;
struct JNINativeInterface_ {
jint (JNICALL *GetVersion)(JNIEnv *env);
jclass (JNICALL *DefineClass)
(JNIEnv *env, const char *name, jobject loader, const jbyte *buf,
jclass (JNICALL *FindClass)
(JNIEnv *env, const char *name);
jmethodID (JNICALL *FromReflectedMethod)
(JNIEnv *env, jobject method);
jfieldID (JNICALL *FromReflectedField)
(JNIEnv *env, jobject field);
jobject (JNICALL *ToReflectedMethod)
(JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic);
jclass (JNICALL *GetSuperclass)
(JNIEnv *env, jclass sub);
jboolean (JNICALL *IsAssignableFrom)
(JNIEnv *env, jclass sub, jclass sup);
jobject (JNICALL *ToReflectedField)
(JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic);
(JNIEnv *env, jthrowable obj);
(JNIEnv *env, jclass clazz, const char *msg);
jthrowable (JNICALL *ExceptionOccurred)
void (JNICALL *ExceptionDescribe)
void (JNICALL *ExceptionClear)
void (JNICALL *FatalError)
(JNIEnv *env, const char *msg);
jint (JNICALL *PushLocalFrame)
(JNIEnv *env, jint capacity);
jobject (JNICALL *PopLocalFrame)
(JNIEnv *env, jobject result);
jobject (JNICALL *NewGlobalRef)
(JNIEnv *env, jobject lobj);
void (JNICALL *DeleteGlobalRef)
(JNIEnv *env, jobject gref);
void (JNICALL *DeleteLocalRef)
(JNIEnv *env, jobject obj);
jboolean (JNICALL *IsSameObject)
(JNIEnv *env, jobject obj1, jobject obj2);
jobject (JNICALL *NewLocalRef)
(JNIEnv *env, jobject ref);
jint (JNICALL *EnsureLocalCapacity)
(JNIEnv *env, jint capacity);
jobject (JNICALL *AllocObject)
(JNIEnv *env, jclass clazz);
jobject (JNICALL *NewObject)
(JNIEnv *env, jclass clazz, jmethodID methodID, ...);
jobject (JNICALL *NewObjectV)
(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
jobject (JNICALL *NewObjectA)
(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
jclass (JNICALL *GetObjectClass)
(JNIEnv *env, jobject obj);
jboolean (JNICALL *IsInstanceOf)
(JNIEnv *env, jobject obj, jclass clazz);
jmethodID (JNICALL *GetMethodID)
(JNIEnv *env, jclass clazz, const char *name, const char *sig);
jobject (JNICALL *CallObjectMethod)
(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jobject (JNICALL *CallObjectMethodV)
(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jobject (JNICALL *CallObjectMethodA)
(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
jboolean (JNICALL *CallBooleanMethod)
(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jboolean (JNICALL *CallBooleanMethodV)
(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jboolean (JNICALL *CallBooleanMethodA)
(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
jbyte (JNICALL *CallByteMethod)
(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jbyte (JNICALL *CallByteMethodV)
(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jbyte (JNICALL *CallByteMethodA)
(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
jchar (JNICALL *CallCharMethod)
(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jchar (JNICALL *CallCharMethodV)
(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jchar (JNICALL *CallCharMethodA)
(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
jshort (JNICALL *CallShortMethod)
(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jshort (JNICALL *CallShortMethodV)
(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jshort (JNICALL *CallShortMethodA)
(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
jint (JNICALL *CallIntMethod)
(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jint (JNICALL *CallIntMethodV)
(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jint (JNICALL *CallIntMethodA)
(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
jlong (JNICALL *CallLongMethod)
(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jlong (JNICALL *CallLongMethodV)
(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jlong (JNICALL *CallLongMethodA)
(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
jfloat (JNICALL *CallFloatMethod)
(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jfloat (JNICALL *CallFloatMethodV)
(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jfloat (JNICALL *CallFloatMethodA)
(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
jdouble (JNICALL *CallDoubleMethod)
(JNIEnv *env, jobject obj, jmethodID methodID, ...);
jdouble (JNICALL *CallDoubleMethodV)
(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
jdouble (JNICALL *CallDoubleMethodA)
(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
void (JNICALL *CallVoidMethod)
(JNIEnv *env, jobject obj, jmethodID methodID, ...);
void (JNICALL *CallVoidMethodV)
(JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
void (JNICALL *CallVoidMethodA)
(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
jobject (JNICALL *CallNonvirtualObjectMethod)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jobject (JNICALL *CallNonvirtualObjectMethodV)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jobject (JNICALL *CallNonvirtualObjectMethodA)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jboolean (JNICALL *CallNonvirtualBooleanMethod)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jboolean (JNICALL *CallNonvirtualBooleanMethodV)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jboolean (JNICALL *CallNonvirtualBooleanMethodA)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jbyte (JNICALL *CallNonvirtualByteMethod)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jbyte (JNICALL *CallNonvirtualByteMethodV)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jbyte (JNICALL *CallNonvirtualByteMethodA)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jchar (JNICALL *CallNonvirtualCharMethod)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jchar (JNICALL *CallNonvirtualCharMethodV)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jchar (JNICALL *CallNonvirtualCharMethodA)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jshort (JNICALL *CallNonvirtualShortMethod)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jshort (JNICALL *CallNonvirtualShortMethodV)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jshort (JNICALL *CallNonvirtualShortMethodA)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jint (JNICALL *CallNonvirtualIntMethod)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jint (JNICALL *CallNonvirtualIntMethodV)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jint (JNICALL *CallNonvirtualIntMethodA)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jlong (JNICALL *CallNonvirtualLongMethod)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jlong (JNICALL *CallNonvirtualLongMethodV)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jlong (JNICALL *CallNonvirtualLongMethodA)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jfloat (JNICALL *CallNonvirtualFloatMethod)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jfloat (JNICALL *CallNonvirtualFloatMethodV)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jfloat (JNICALL *CallNonvirtualFloatMethodA)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jdouble (JNICALL *CallNonvirtualDoubleMethod)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
jdouble (JNICALL *CallNonvirtualDoubleMethodV)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jdouble (JNICALL *CallNonvirtualDoubleMethodA)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
void (JNICALL *CallNonvirtualVoidMethod)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
void (JNICALL *CallNonvirtualVoidMethodV)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
void (JNICALL *CallNonvirtualVoidMethodA)
(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
jfieldID (JNICALL *GetFieldID)
(JNIEnv *env, jclass clazz, const char *name, const char *sig);
jobject (JNICALL *GetObjectField)
(JNIEnv *env, jobject obj, jfieldID fieldID);
jboolean (JNICALL *GetBooleanField)
(JNIEnv *env, jobject obj, jfieldID fieldID);
jbyte (JNICALL *GetByteField)
(JNIEnv *env, jobject obj, jfieldID fieldID);
jchar (JNICALL *GetCharField)
(JNIEnv *env, jobject obj, jfieldID fieldID);
jshort (JNICALL *GetShortField)
(JNIEnv *env, jobject obj, jfieldID fieldID);
jint (JNICALL *GetIntField)
(JNIEnv *env, jobject obj, jfieldID fieldID);
jlong (JNICALL *GetLongField)
(JNIEnv *env, jobject obj, jfieldID fieldID);
jfloat (JNICALL *GetFloatField)
(JNIEnv *env, jobject obj, jfieldID fieldID);
jdouble (JNICALL *GetDoubleField)
(JNIEnv *env, jobject obj, jfieldID fieldID);
void (JNICALL *SetObjectField)
(JNIEnv *env, jobject obj, jfieldID fieldID, jobject val);
void (JNICALL *SetBooleanField)
(JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val);
void (JNICALL *SetByteField)
(JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val);
void (JNICALL *SetCharField)
(JNIEnv *env, jobject obj, jfieldID fieldID, jchar val);
void (JNICALL *SetShortField)
(JNIEnv *env, jobject obj, jfieldID fieldID, jshort val);
void (JNICALL *SetIntField)
(JNIEnv *env, jobject obj, jfieldID fieldID, jint val);
void (JNICALL *SetLongField)
(JNIEnv *env, jobject obj, jfieldID fieldID, jlong val);
void (JNICALL *SetFloatField)
(JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val);
void (JNICALL *SetDoubleField)
(JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val);
jmethodID (JNICALL *GetStaticMethodID)
(JNIEnv *env, jclass clazz, const char *name, const char *sig);
jobject (JNICALL *CallStaticObjectMethod)
(JNIEnv *env, jclass clazz, jmethodID methodID, ...);
jobject (JNICALL *CallStaticObjectMethodV)
(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
jobject (JNICALL *CallStaticObjectMethodA)