|
/** |
|
|
|
JNIEnv *e; |
|
jobject method; |
|
// e->FromReflectedMethod(e, mid); // in c |
|
// e->FromReflectedMethod(mid); // in c++ |
|
|
|
// I think it's a nice idea to define INLINE functions with a prefix jni to make |
|
// it unified and simple for c or c++ except all interfaces needing definition. |
|
//jniFromReflectedMethod(e, mid); |
|
|
|
// JavaScript |
|
1. /^[\t ]*(([\w_*]+[\t ]+)+)(\*?)[\t ]*(\w+)\(([^)]*)\)\s*{/gm ==> INLINE \1\3jni\4\(JNIEnv *env, \5\){ |
|
2. functions ==> env |
|
3. to c: /this[\t ]*(,?)/g ==> env\1 to c++ /this[\t ]*(,?)/g ==> |
|
|
|
replace "env->([^(]+)\(" ----with----> "JNI_CALL\(\1, env," |
|
|
|
e.g. |
|
#include "jni.h" |
|
extern "C" { |
|
// native static long FromReflectedConstructor(Constructor<?> ctor); |
|
JNIEXPORT jlong JNICALL Java_JnToy_FromReflectedConstructor(JNIEnv *env, jclass UNUSED(cls), jobject method) { |
|
// cast jmethodID to jlong |
|
return REINTERPRET_CAST(jlong, jniFromReflectedMethod(env, method)); |
|
} |
|
|
|
// native static long FromReflectedMethod(Method method); |
|
JNIEXPORT jlong JNICALL Java_JnToy_FromReflectedMethod(JNIEnv *env, jclass UNUSED(cls), jobject method) { |
|
// cast jmethodID to jlong |
|
return REINTERPRET_CAST(jlong, jniFromReflectedMethod(env, method)); |
|
} |
|
} |
|
*/ |
|
|
|
#ifndef _Included_JNI |
|
#define _Included_JNI |
|
|
|
////////////////////////////////////////////////////////////////// |
|
// instead of include/win32/jni_md.h when you use cygwin on windows. |
|
/* jni_md.h contains the machine-dependent typedefs for jbyte, jint and jlong */ |
|
//==================jni_md.h=================// |
|
// #ifndef _JAVASOFT_JNI_MD_H_ // |
|
// #define _JAVASOFT_JNI_MD_H_ // |
|
// // |
|
// #define JNIEXPORT __declspec(dllexport) // |
|
// #define JNIIMPORT __declspec(dllimport) // |
|
// #define JNICALL __stdcall // |
|
// // |
|
// typedef long jint; // |
|
// typedef __int64 jlong; // |
|
// typedef signed char jbyte; // |
|
// // |
|
// #endif /* !_JAVASOFT_JNI_MD_H_ */ // |
|
//===========================================// |
|
|
|
#ifndef _JAVASOFT_JNI_MD_H_ |
|
#define _JAVASOFT_JNI_MD_H_ |
|
|
|
#define JNIEXPORT __declspec(dllexport) |
|
#define JNIIMPORT __declspec(dllimport) |
|
#define JNICALL __stdcall |
|
|
|
#include <stdint.h> |
|
typedef int32_t jint; /* signed 32 bits */ |
|
#ifdef __GNUC__ |
|
typedef long long jlong; |
|
#else |
|
typedef __int64 jlong; |
|
#endif |
|
typedef signed char jbyte; |
|
|
|
///* [JNI Types and Data Structures](http://docs.oracle.com/javase/6/docs/technotes/guides/jni/spec/types.html#wp9502) */ |
|
///* https://android.googlesource.com/platform/libnativehelper/+/master/include/nativehelper/jni.h */ |
|
// |
|
// #include <stdint.h> |
|
///* Primitive types that match up with Java equivalents. */ |
|
//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 */ |
|
|
|
#endif /* !_JAVASOFT_JNI_MD_H_ */ |
|
|
|
|
|
///////////////////////////////////////////////////////////////////// |
|
|
|
#include <jni.h> |
|
//#include <stdarg.h> |
|
|
|
// Explicitly assert the consistency and correctness of mapping Java Primitive types to native C types. |
|
union __verify_primitive_types_against_java_peer_types |
|
{ |
|
char int8_t_eq_jboolean[1 == sizeof(jboolean) ? 1 : -1]; |
|
char int8_t_eq_jbyte [1 == sizeof(jbyte ) ? 1 : -1]; |
|
char int16_t_eq_jchar [2 == sizeof(jchar ) ? 1 : -1]; |
|
char int16_t_eq_jshort [2 == sizeof(jshort ) ? 1 : -1]; |
|
char int32_t_eq_jint [4 == sizeof(jint ) ? 1 : -1]; |
|
char int64_t_eq_jlong [8 == sizeof(jlong ) ? 1 : -1]; |
|
char float_eq_jfloat [4 == sizeof(jfloat ) ? 1 : -1]; |
|
char double_eq_jdouble [8 == sizeof(jdouble ) ? 1 : -1]; |
|
}; |
|
|
|
|
|
/* |
|
e.g. |
|
JNIEXPORT void JNICALL Java_test_n(JNIEnv *env, jobject obj, jobject o) |
|
{ |
|
jmethodID jmid = JNI_ENV_PTR(env) -> FromReflectedMethod(JNI_ENV_ARG(env, o)); |
|
JNI_ENV_PTR(env) -> CallVoidMethod(JNI_ENV_ARG(env, obj), jmid, 7); |
|
return; |
|
} |
|
*/ |
|
#ifdef __cplusplus |
|
# define JNI_ENV_ARG(x, y) y |
|
# define JNI_ENV_PTR(x) x |
|
# define JNI_CALL(FUNC, ENV, ...) ENV->FUNC(__VA_ARGS__) |
|
#else |
|
# define JNI_ENV_ARG(x,y) x, y |
|
# define JNI_ENV_PTR(x) (*x) |
|
# define JNI_CALL(FUNC, ENV, ...) (*ENV)->FUNC(ENV, ##__VA_ARGS__) |
|
#endif |
|
|
|
|
|
#ifndef INLINE |
|
/* Don't vs2013 12.0.21005.1 REL c compiler support c99 inline? */ |
|
#if defined _MSC_VER && !defined __cplusplus |
|
# define INLINE __inline |
|
#else |
|
# define INLINE inline |
|
#endif |
|
#endif |
|
|
|
typedef jboolean JBoolean; |
|
typedef jbyte JByte; |
|
typedef jchar JChar; |
|
typedef jshort JShort; |
|
typedef jint JInt; |
|
typedef jlong JLong; |
|
typedef jfloat JFloat; |
|
typedef jdouble JDouble; |
|
|
|
/** |
|
* Version Information |
|
* |
|
* Returns the version of the native method interface. |
|
* |
|
* |
|
* LINKAGE: |
|
* Index 4 in the JNIEnv interface function table. |
|
* |
|
* PARAMETERS: |
|
* env: the JNI interface pointer. |
|
* |
|
* RETURNS: |
|
* Returns the major version number in the higher 16 bits and the minor version number in the lower 16 bits. |
|
* |
|
* In JDK/JRE 1.1, GetVersion() returns 0x00010001. |
|
* In JDK/JRE 1.2, GetVersion() returns 0x00010002. |
|
* In JDK/JRE 1.4, GetVersion() returns 0x00010004. |
|
* In JDK/JRE 1.6, GetVersion() returns 0x00010006. |
|
*/ |
|
INLINE jint jniGetVersion(JNIEnv *env) { |
|
return JNI_CALL(GetVersion, env); |
|
} |
|
|
|
INLINE jclass jniDefineClass(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize len) { |
|
return JNI_CALL(DefineClass, env, name, loader, buf, len); |
|
} |
|
|
|
/** |
|
* jclass FindClass(JNIEnv *env, const char *name); |
|
* |
|
* In JDK release 1.1, this function loads a locally-defined class. It searches the directories and zip files specified by the CLASSPATH environment variable for the |
|
* class with the specified name. |
|
* |
|
* Since Java 2 SDK release 1.2, the Java security model allows non-system classes to load and call native methods. FindClass locates the class loader associated with |
|
* the current native method; that is, the class loader of the class that declared the native method. If the native method belongs to a system class, no class loader |
|
* will be involved. Otherwise, the proper class loader will be invoked to load and link the named class. |
|
* |
|
* Since Java 2 SDK release 1.2, when FindClass is called through the Invocation Interface, there is no current native method or its associated class loader. In that |
|
* case, the result of ClassLoader.getSystemClassLoader is used. This is the class loader the virtual machine creates for applications, and is able to locate classes |
|
* listed in the java.class.path property. |
|
* |
|
* The name argument is a fully-qualified class name or an array type signature . For example, the fully-qualified class name for the java.lang.String class is: |
|
* |
|
* "java/lang/String" |
|
* |
|
* The array type signature of the array class java.lang.Object[] is: |
|
* |
|
* "[Ljava/lang/Object;" |
|
* |
|
* |
|
* LINKAGE: |
|
* Index 6 in the JNIEnv interface function table. |
|
* |
|
* PARAMETERS: |
|
* env: the JNI interface pointer. |
|
* name: a fully-qualified class name (that is, a package name, delimited by “/”, followed by the class name). |
|
* If the name begins with “[“ (the array signature character), it returns an array class. The string is encoded in modified UTF-8. |
|
* |
|
* RETURNS: |
|
* Returns a class object from a fully-qualified name, or NULL if the class cannot be found. |
|
* |
|
* THROWS: |
|
* ClassFormatError: if the class data does not specify a valid class. |
|
* ClassCircularityError: if a class or interface would be its own superclass or superinterface. |
|
* NoClassDefFoundError: if no definition for a requested class or interface can be found. |
|
* OutOfMemoryError: if the system runs out of memory. |
|
*/ |
|
INLINE jclass jniFindClass(JNIEnv *env, const char *name) { |
|
return JNI_CALL(FindClass, env, name); |
|
} |
|
|
|
/** |
|
* jmethodID FromReflectedMethod(JNIEnv *env, jobject method); |
|
* |
|
* Converts a `java.lang.reflect.Method` or `java.lang.reflect.Constructor` object to a method ID. |
|
* |
|
* LINKAGE: Index 7 in the JNIEnv interface function table. |
|
* |
|
* SINCE: JDK/JRE 1.2 |
|
*/ |
|
INLINE jmethodID jniFromReflectedMethod(JNIEnv *env, jobject method) { |
|
return JNI_CALL(FromReflectedMethod, env, method); |
|
} |
|
|
|
/** |
|
* jfieldID FromReflectedField(JNIEnv *env, jobject field); |
|
* |
|
* Converts a `java.lang.reflect.Field` to a field ID. |
|
* |
|
* LINKAGE: Index 8 in the JNIEnv interface function table. |
|
* |
|
* SINCE: JDK/JRE 1.2 |
|
*/ |
|
INLINE jfieldID jniFromReflectedField(JNIEnv *env, jobject field) { |
|
return JNI_CALL(FromReflectedField, env, field); |
|
} |
|
|
|
/** |
|
* jobject ToReflectedMethod(JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic); |
|
* |
|
* Converts a method ID derived from `cls` to a `java.lang.reflect.Method` or `java.lang.reflect.Constructor` object. |
|
* `isStatic` must be set to `JNI_TRUE` if the method ID refers to a static field, and `JNI_FALSE` otherwise. |
|
* |
|
* Throws OutOfMemoryError and returns 0 if fails. |
|
* |
|
* LINKAGE: Index 9 in the JNIEnv interface function table. |
|
* |
|
* SINCE: JDK/JRE 1.2 |
|
*/ |
|
INLINE jobject jniToReflectedMethod(JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic) { |
|
return JNI_CALL(ToReflectedMethod, env, cls, methodID, isStatic); |
|
} |
|
|
|
/** |
|
* jclass GetSuperclass(JNIEnv *env, jclass clazz); |
|
* |
|
* If clazz represents any class other than the class Object, then this function returns the object that represents the superclass of the class specified by clazz. |
|
* If clazz specifies the class Object, or clazz represents an interface, this function returns NULL. |
|
* |
|
* |
|
* LINKAGE: Index 10 in the JNIEnv interface function table. |
|
* |
|
* PARAMETERS: |
|
* env: the JNI interface pointer. |
|
* clazz: a Java class object. |
|
* |
|
* RETURNS: |
|
* Returns the superclass of the class represented by clazz, or NULL. |
|
*/ |
|
INLINE jclass jniGetSuperclass(JNIEnv *env, jclass sub) { |
|
return JNI_CALL(GetSuperclass, env, sub); |
|
} |
|
|
|
/** |
|
* jboolean IsAssignableFrom(JNIEnv *env, jclass clazz1, jclass clazz2); |
|
* |
|
* Determines whether an object of clazz1 can be safely cast to clazz2. |
|
* |
|
* LINKAGE: Index 11 in the JNIEnv interface function table. |
|
* |
|
* PARAMETERS: |
|
* env: the JNI interface pointer. |
|
* clazz1: the first class argument. |
|
* clazz2: the second class argument. |
|
* |
|
* RETURNS: |
|
* Returns JNI_TRUE if either of the following is true: |
|
* The first and second class arguments refer to the same Java class. |
|
* The first class is a subclass of the second class. |
|
* The first class has the second class as one of its interfaces. |
|
*/ |
|
INLINE jboolean jniIsAssignableFrom(JNIEnv *env, jclass sub, jclass sup) { |
|
return JNI_CALL(IsAssignableFrom, env, sub, sup); |
|
} |
|
|
|
/** |
|
* jobject ToReflectedField(JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic); |
|
* |
|
* Converts a field ID derived from `cls` to a `java.lang.reflect.Field` object. `isStatic` must be set to `JNI_TRUE` if `fieldID` refers to a static field, and `JNI_FALSE` otherwise. |
|
* |
|
* Throws OutOfMemoryError and returns 0 if fails. |
|
* |
|
* LINKAGE: Index 12 in the JNIEnv interface function table. |
|
* |
|
* SINCE: |
|
* JDK/JRE 1.2 |
|
*/ |
|
INLINE jobject jniToReflectedField(JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic) { |
|
return JNI_CALL(ToReflectedField, env, cls, fieldID, isStatic); |
|
} |
|
|
|
INLINE jint jniThrow(JNIEnv *env, jthrowable obj) { |
|
return JNI_CALL(Throw, env, obj); |
|
} |
|
INLINE jint jniThrowNew(JNIEnv *env, jclass clazz, const char *msg) { |
|
return JNI_CALL(ThrowNew, env, clazz, msg); |
|
} |
|
INLINE jthrowable jniExceptionOccurred(JNIEnv *env) { |
|
return JNI_CALL(ExceptionOccurred, env); |
|
} |
|
|
|
/** |
|
* void ExceptionDescribe(JNIEnv *env); |
|
* |
|
* Prints an exception and a backtrace of the stack to a system error-reporting |
|
* channel, such as stderr. This is a convenience routine provided for debugging. |
|
* |
|
* LINKAGE: Index 16 in the JNIEnv interface function table. |
|
* |
|
* PARAMETERS: |
|
* env: the JNI interface pointer. |
|
*/ |
|
INLINE void jniExceptionDescribe(JNIEnv *env) { |
|
JNI_CALL(ExceptionDescribe, env); |
|
} |
|
|
|
/** |
|
* void ExceptionClear(JNIEnv *env); |
|
* |
|
* Clears any exception that is currently being thrown. If no exception is |
|
* currently being thrown, this routine has no effect. |
|
* |
|
* LINKAGE: Index 17 in the JNIEnv interface function table. |
|
* |
|
* PARAMETERS: |
|
* env: the JNI interface pointer. |
|
*/ |
|
INLINE void jniExceptionClear(JNIEnv *env) { |
|
JNI_CALL(ExceptionClear, env); |
|
} |
|
|
|
/** |
|
* void FatalError(JNIEnv *env, const char *msg); |
|
* |
|
* Raises a fatal error and does not expect the VM to recover. This function does not return. |
|
* |
|
* LINKAGE: Index 18 in the JNIEnv interface function table. |
|
* |
|
* PARAMETERS: |
|
* env: the JNI interface pointer. |
|
* |
|
* msg: an error message. The string is encoded in modified UTF-8. |
|
*/ |
|
INLINE void jniFatalError(JNIEnv *env, const char *msg) { |
|
JNI_CALL(FatalError, env, msg); |
|
} |
|
|
|
INLINE jint jniPushLocalFrame(JNIEnv *env, jint capacity) { |
|
return JNI_CALL(PushLocalFrame, env, capacity); |
|
} |
|
INLINE jobject jniPopLocalFrame(JNIEnv *env, jobject result) { |
|
return JNI_CALL(PopLocalFrame, env, result); |
|
} |
|
|
|
INLINE jobject jniNewGlobalRef(JNIEnv *env, jobject lobj) { |
|
return JNI_CALL(NewGlobalRef, env, lobj); |
|
} |
|
INLINE void jniDeleteGlobalRef(JNIEnv *env, jobject gref) { |
|
JNI_CALL(DeleteGlobalRef, env, gref); |
|
} |
|
INLINE void jniDeleteLocalRef(JNIEnv *env, jobject obj) { |
|
JNI_CALL(DeleteLocalRef, env, obj); |
|
} |
|
|
|
INLINE jboolean jniIsSameObject(JNIEnv *env, jobject obj1, jobject obj2) { |
|
return JNI_CALL(IsSameObject, env, obj1, obj2); |
|
} |
|
|
|
INLINE jobject jniNewLocalRef(JNIEnv *env, jobject ref) { |
|
return JNI_CALL(NewLocalRef, env, ref); |
|
} |
|
INLINE jint jniEnsureLocalCapacity(JNIEnv *env, jint capacity) { |
|
return JNI_CALL(EnsureLocalCapacity, env, capacity); |
|
} |
|
|
|
// |
|
/// Object Operations |
|
// |
|
|
|
/** |
|
* AllocObject |
|
* jobject AllocObject(JNIEnv *env, jclass clazz); |
|
* |
|
* Allocates a new Java object without invoking any of the constructors for the object. Returns a reference to the object. |
|
* |
|
* The clazz argument must not refer to an array class. |
|
* |
|
* |
|
* LINKAGE: |
|
* Index 27 in the JNIEnv interface function table. |
|
* |
|
* PARAMETERS: |
|
* env: the JNI interface pointer. |
|
* clazz: a Java class object. |
|
* |
|
* RETURNS: |
|
* Returns a Java object, or NULL if the object cannot be constructed. |
|
* |
|
* THROWS: |
|
* InstantiationException: if the class is an interface or an abstract class. |
|
* |
|
* OutOfMemoryError: if the system runs out of memory. |
|
*/ |
|
INLINE jobject jniAllocObject(JNIEnv *env, jclass clazz) { |
|
return JNI_CALL(AllocObject, env, clazz); |
|
} |
|
|
|
/** |
|
* jobject NewObject(JNIEnv *env, jclass clazz, jmethodID methodID, ...); |
|
* jobject NewObjectA(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); |
|
* jobject NewObjectV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); |
|
* |
|
* Constructs a new Java object. The method ID indicates which constructor method to invoke. This ID must be obtained by calling GetMethodID() with <init> as the method name and void (V) as the return type. |
|
* |
|
* The clazz argument must not refer to an array class. |
|
* |
|
* NewObject |
|
* Programmers place all arguments that are to be passed to the constructor immediately following the methodID argument. NewObject() accepts these arguments and passes them to the Java method that the programmer wishes to invoke. |
|
* |
|
* LINKAGE: |
|
* Index 28 in the JNIEnv interface function table. |
|
* |
|
* PARAMETERS: |
|
* env: the JNI interface pointer. |
|
* clazz: a Java class object. |
|
* methodID: the method ID of the constructor. |
|
* ...: arguments to the constructor. |
|
* |
|
* RETURNS: |
|
* Returns a Java object, or NULL if the object cannot be constructed. |
|
* |
|
* THROWS: |
|
* InstantiationException: if the class is an interface or an abstract class. |
|
* OutOfMemoryError: if the system runs out of memory. |
|
* Any exceptions thrown by the constructor. |
|
*/ |
|
INLINE jobject jniNewObject(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jobject result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(NewObjectV, env, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
|
|
/** |
|
* @see jniNewObject |
|
* |
|
* NewObjectV |
|
* Programmers place all arguments that are to be passed to the constructor in an args argument of type va_list that immediately follows the methodID argument. NewObjectV() accepts these arguments, and, in turn, passes them to the Java method that the programmer wishes to invoke. |
|
* |
|
* LINKAGE: |
|
* Index 29 in the JNIEnv interface function table. |
|
* |
|
* PARAMETERS: |
|
* env: the JNI interface pointer. |
|
* clazz: a Java class object. |
|
* methodID: the method ID of the constructor. |
|
* args: a va_list of arguments to the constructor. |
|
* |
|
* RETURNS: |
|
* Returns a Java object, or NULL if the object cannot be constructed. |
|
* |
|
* THROWS: |
|
* InstantiationException: if the class is an interface or an abstract class. |
|
* OutOfMemoryError: if the system runs out of memory. |
|
* Any exceptions thrown by the constructor. |
|
*/ |
|
INLINE jobject jniNewObjectV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(NewObjectV, env, clazz, methodID, args); |
|
} |
|
|
|
/** |
|
* @see jniNewObject |
|
* |
|
* NewObjectA |
|
* Programmers place all arguments that are to be passed to the constructor in an args array of jvalues that immediately follows the methodID argument. NewObjectA() accepts the arguments in this array, and, in turn, passes them to the Java method that the programmer wishes to invoke. |
|
* |
|
* LINKAGE: |
|
* Index 30 in the JNIEnv interface function table. |
|
* |
|
* PARAMETERS: |
|
* env: the JNI interface pointer. |
|
* clazz: a Java class object. |
|
* methodID: the method ID of the constructor. |
|
* args: an array of arguments to the constructor. |
|
* |
|
* RETURNS: |
|
* Returns a Java object, or NULL if the object cannot be constructed. |
|
* |
|
* THROWS: |
|
* InstantiationException: if the class is an interface or an abstract class. |
|
* OutOfMemoryError: if the system runs out of memory. |
|
* Any exceptions thrown by the constructor. |
|
*/ |
|
INLINE jobject jniNewObjectA(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args) { |
|
return JNI_CALL(NewObjectA, env, clazz, methodID, args); |
|
} |
|
|
|
INLINE jclass jniGetObjectClass(JNIEnv *env, jobject obj) { |
|
return JNI_CALL(GetObjectClass, env, obj); |
|
} |
|
INLINE jboolean jniIsInstanceOf(JNIEnv *env, jobject obj, jclass clazz) { |
|
return JNI_CALL(IsInstanceOf, env, obj, clazz); |
|
} |
|
|
|
/** |
|
* jmethodID GetMethodID(JNIEnv *env, jclass clazz, const char *name, const char *sig); |
|
* |
|
* Returns the method ID for an instance (nonstatic) method of a class or interface. The method may be defined in one of the clazz’s superclasses and inherited by clazz. The method is determined by its name and signature. |
|
* |
|
* GetMethodID() causes an uninitialized class to be initialized. |
|
* |
|
* To obtain the method ID of a constructor, supply <init> as the method name and void (V) as the return type. |
|
* |
|
* LINKAGE: |
|
* Index 33 in the JNIEnv interface function table. |
|
* |
|
* PARAMETERS: |
|
* env: the JNI interface pointer. |
|
* clazz: a Java class object. |
|
* name: the method name in a 0-terminated modified UTF-8 string. |
|
* sig: the method signature in 0-terminated modified UTF-8 string. |
|
* |
|
* RETURNS: |
|
* Returns a method ID, or NULL if the specified method cannot be found. |
|
* |
|
* THROWS: |
|
* NoSuchMethodError: if the specified method cannot be found. |
|
* ExceptionInInitializerError: if the class initializer fails due to an exception. |
|
* OutOfMemoryError: if the system runs out of memory. |
|
*/ |
|
INLINE jmethodID jniGetMethodID(JNIEnv *env, jclass clazz, const char *name, const char *sig) { |
|
return JNI_CALL(GetMethodID, env, clazz, name, sig); |
|
} |
|
|
|
INLINE jobject jniCallObjectMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { |
|
va_list args; |
|
jobject result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallObjectMethodV, env, obj, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jobject jniCallObjectMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallObjectMethodV, env, obj, methodID, args); |
|
} |
|
INLINE jobject jniCallObjectMethodA(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallObjectMethodA, env, obj, methodID, args); |
|
} |
|
|
|
INLINE jboolean jniCallBooleanMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { |
|
va_list args; |
|
jboolean result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallBooleanMethodV, env, obj, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jboolean jniCallBooleanMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallBooleanMethodV, env, obj, methodID, args); |
|
} |
|
INLINE jboolean jniCallBooleanMethodA(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallBooleanMethodA, env, obj, methodID, args); |
|
} |
|
|
|
INLINE jbyte jniCallByteMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { |
|
va_list args; |
|
jbyte result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallByteMethodV, env, obj, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jbyte jniCallByteMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallByteMethodV, env, obj, methodID, args); |
|
} |
|
INLINE jbyte jniCallByteMethodA(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallByteMethodA, env, obj, methodID, args); |
|
} |
|
|
|
INLINE jchar jniCallCharMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { |
|
va_list args; |
|
jchar result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallCharMethodV, env, obj, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jchar jniCallCharMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallCharMethodV, env, obj, methodID, args); |
|
} |
|
INLINE jchar jniCallCharMethodA(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallCharMethodA, env, obj, methodID, args); |
|
} |
|
|
|
INLINE jshort jniCallShortMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { |
|
va_list args; |
|
jshort result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallShortMethodV, env, obj, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jshort jniCallShortMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallShortMethodV, env, obj, methodID, args); |
|
} |
|
INLINE jshort jniCallShortMethodA(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallShortMethodA, env, obj, methodID, args); |
|
} |
|
|
|
INLINE jint jniCallIntMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { |
|
va_list args; |
|
jint result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallIntMethodV, env, obj, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jint jniCallIntMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallIntMethodV, env, obj, methodID, args); |
|
} |
|
INLINE jint jniCallIntMethodA(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallIntMethodA, env, obj, methodID, args); |
|
} |
|
|
|
INLINE jlong jniCallLongMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { |
|
va_list args; |
|
jlong result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallLongMethodV, env, obj, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jlong jniCallLongMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallLongMethodV, env, obj, methodID, args); |
|
} |
|
INLINE jlong jniCallLongMethodA(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallLongMethodA, env, obj, methodID, args); |
|
} |
|
|
|
INLINE jfloat jniCallFloatMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { |
|
va_list args; |
|
jfloat result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallFloatMethodV, env, obj, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jfloat jniCallFloatMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallFloatMethodV, env, obj, methodID, args); |
|
} |
|
INLINE jfloat jniCallFloatMethodA(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallFloatMethodA, env, obj, methodID, args); |
|
} |
|
|
|
INLINE jdouble jniCallDoubleMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { |
|
va_list args; |
|
jdouble result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallDoubleMethodV, env, obj, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jdouble jniCallDoubleMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallDoubleMethodV, env, obj, methodID, args); |
|
} |
|
INLINE jdouble jniCallDoubleMethodA(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallDoubleMethodA, env, obj, methodID, args); |
|
} |
|
|
|
INLINE void jniCallVoidMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { |
|
va_list args; |
|
va_start(args, methodID); |
|
JNI_CALL(CallVoidMethodV, env, obj, methodID, args); |
|
va_end(args); |
|
} |
|
INLINE void jniCallVoidMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args) { |
|
JNI_CALL(CallVoidMethodV, env, obj, methodID, args); |
|
} |
|
INLINE void jniCallVoidMethodA(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args) { |
|
JNI_CALL(CallVoidMethodA, env, obj, methodID, args); |
|
} |
|
|
|
INLINE jobject jniCallNonvirtualObjectMethod(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jobject result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallNonvirtualObjectMethodV, env, obj, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jobject jniCallNonvirtualObjectMethodV(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallNonvirtualObjectMethodV, env, obj, clazz, methodID, args); |
|
} |
|
INLINE jobject jniCallNonvirtualObjectMethodA(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallNonvirtualObjectMethodA, env, obj, clazz, methodID, args); |
|
} |
|
|
|
INLINE jboolean jniCallNonvirtualBooleanMethod(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jboolean result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallNonvirtualBooleanMethodV, env, obj, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jboolean jniCallNonvirtualBooleanMethodV(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallNonvirtualBooleanMethodV, env, obj, clazz, methodID, args); |
|
} |
|
INLINE jboolean jniCallNonvirtualBooleanMethodA(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, |
|
const jvalue * args) { |
|
return JNI_CALL(CallNonvirtualBooleanMethodA, env, obj, clazz, methodID, args); |
|
} |
|
|
|
INLINE jbyte jniCallNonvirtualByteMethod(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jbyte result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallNonvirtualByteMethodV, env, obj, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jbyte jniCallNonvirtualByteMethodV(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallNonvirtualByteMethodV, env, obj, clazz, methodID, args); |
|
} |
|
INLINE jbyte jniCallNonvirtualByteMethodA(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallNonvirtualByteMethodA, env, obj, clazz, methodID, args); |
|
} |
|
|
|
INLINE jchar jniCallNonvirtualCharMethod(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jchar result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallNonvirtualCharMethodV, env, obj, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jchar jniCallNonvirtualCharMethodV(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallNonvirtualCharMethodV, env, obj, clazz, methodID, args); |
|
} |
|
INLINE jchar jniCallNonvirtualCharMethodA(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallNonvirtualCharMethodA, env, obj, clazz, methodID, args); |
|
} |
|
|
|
INLINE jshort jniCallNonvirtualShortMethod(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jshort result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallNonvirtualShortMethodV, env, obj, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jshort jniCallNonvirtualShortMethodV(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallNonvirtualShortMethodV, env, obj, clazz, methodID, args); |
|
} |
|
INLINE jshort jniCallNonvirtualShortMethodA(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallNonvirtualShortMethodA, env, obj, clazz, methodID, args); |
|
} |
|
|
|
INLINE jint jniCallNonvirtualIntMethod(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jint result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallNonvirtualIntMethodV, env, obj, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jint jniCallNonvirtualIntMethodV(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallNonvirtualIntMethodV, env, obj, clazz, methodID, args); |
|
} |
|
INLINE jint jniCallNonvirtualIntMethodA(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallNonvirtualIntMethodA, env, obj, clazz, methodID, args); |
|
} |
|
|
|
INLINE jlong jniCallNonvirtualLongMethod(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jlong result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallNonvirtualLongMethodV, env, obj, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jlong jniCallNonvirtualLongMethodV(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallNonvirtualLongMethodV, env, obj, clazz, methodID, args); |
|
} |
|
INLINE jlong jniCallNonvirtualLongMethodA(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallNonvirtualLongMethodA, env, obj, clazz, methodID, args); |
|
} |
|
|
|
INLINE jfloat jniCallNonvirtualFloatMethod(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jfloat result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallNonvirtualFloatMethodV, env, obj, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jfloat jniCallNonvirtualFloatMethodV(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallNonvirtualFloatMethodV, env, obj, clazz, methodID, args); |
|
} |
|
INLINE jfloat jniCallNonvirtualFloatMethodA(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallNonvirtualFloatMethodA, env, obj, clazz, methodID, args); |
|
} |
|
|
|
INLINE jdouble jniCallNonvirtualDoubleMethod(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jdouble result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallNonvirtualDoubleMethodV, env, obj, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jdouble jniCallNonvirtualDoubleMethodV(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallNonvirtualDoubleMethodV, env, obj, clazz, methodID, args); |
|
} |
|
INLINE jdouble jniCallNonvirtualDoubleMethodA(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args) { |
|
return JNI_CALL(CallNonvirtualDoubleMethodA, env, obj, clazz, methodID, args); |
|
} |
|
|
|
INLINE void jniCallNonvirtualVoidMethod(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
va_start(args, methodID); |
|
JNI_CALL(CallNonvirtualVoidMethodV, env, obj, clazz, methodID, args); |
|
va_end(args); |
|
} |
|
INLINE void jniCallNonvirtualVoidMethodV(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { |
|
JNI_CALL(CallNonvirtualVoidMethodV, env, obj, clazz, methodID, args); |
|
} |
|
INLINE void jniCallNonvirtualVoidMethodA(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args) { |
|
JNI_CALL(CallNonvirtualVoidMethodA, env, obj, clazz, methodID, args); |
|
} |
|
|
|
INLINE jfieldID jniGetFieldID(JNIEnv *env, jclass clazz, const char *name, const char *sig) { |
|
return JNI_CALL(GetFieldID, env, clazz, name, sig); |
|
} |
|
|
|
INLINE jobject jniGetObjectField(JNIEnv *env, jobject obj, jfieldID fieldID) { |
|
return JNI_CALL(GetObjectField, env, obj, fieldID); |
|
} |
|
INLINE jboolean jniGetBooleanField(JNIEnv *env, jobject obj, jfieldID fieldID) { |
|
return JNI_CALL(GetBooleanField, env, obj, fieldID); |
|
} |
|
INLINE jbyte jniGetByteField(JNIEnv *env, jobject obj, jfieldID fieldID) { |
|
return JNI_CALL(GetByteField, env, obj, fieldID); |
|
} |
|
INLINE jchar jniGetCharField(JNIEnv *env, jobject obj, jfieldID fieldID) { |
|
return JNI_CALL(GetCharField, env, obj, fieldID); |
|
} |
|
INLINE jshort jniGetShortField(JNIEnv *env, jobject obj, jfieldID fieldID) { |
|
return JNI_CALL(GetShortField, env, obj, fieldID); |
|
} |
|
INLINE jint jniGetIntField(JNIEnv *env, jobject obj, jfieldID fieldID) { |
|
return JNI_CALL(GetIntField, env, obj, fieldID); |
|
} |
|
INLINE jlong jniGetLongField(JNIEnv *env, jobject obj, jfieldID fieldID) { |
|
return JNI_CALL(GetLongField, env, obj, fieldID); |
|
} |
|
INLINE jfloat jniGetFloatField(JNIEnv *env, jobject obj, jfieldID fieldID) { |
|
return JNI_CALL(GetFloatField, env, obj, fieldID); |
|
} |
|
INLINE jdouble jniGetDoubleField(JNIEnv *env, jobject obj, jfieldID fieldID) { |
|
return JNI_CALL(GetDoubleField, env, obj, fieldID); |
|
} |
|
|
|
INLINE void jniSetObjectField(JNIEnv *env, jobject obj, jfieldID fieldID, jobject val) { |
|
JNI_CALL(SetObjectField, env, obj, fieldID, val); |
|
} |
|
INLINE void jniSetBooleanField(JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val) { |
|
JNI_CALL(SetBooleanField, env, obj, fieldID, val); |
|
} |
|
INLINE void jniSetByteField(JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val) { |
|
JNI_CALL(SetByteField, env, obj, fieldID, val); |
|
} |
|
INLINE void jniSetCharField(JNIEnv *env, jobject obj, jfieldID fieldID, jchar val) { |
|
JNI_CALL(SetCharField, env, obj, fieldID, val); |
|
} |
|
INLINE void jniSetShortField(JNIEnv *env, jobject obj, jfieldID fieldID, jshort val) { |
|
JNI_CALL(SetShortField, env, obj, fieldID, val); |
|
} |
|
INLINE void jniSetIntField(JNIEnv *env, jobject obj, jfieldID fieldID, jint val) { |
|
JNI_CALL(SetIntField, env, obj, fieldID, val); |
|
} |
|
INLINE void jniSetLongField(JNIEnv *env, jobject obj, jfieldID fieldID, jlong val) { |
|
JNI_CALL(SetLongField, env, obj, fieldID, val); |
|
} |
|
INLINE void jniSetFloatField(JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val) { |
|
JNI_CALL(SetFloatField, env, obj, fieldID, val); |
|
} |
|
INLINE void jniSetDoubleField(JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val) { |
|
JNI_CALL(SetDoubleField, env, obj, fieldID, val); |
|
} |
|
|
|
INLINE jmethodID jniGetStaticMethodID(JNIEnv *env, jclass clazz, const char *name, const char *sig) { |
|
return JNI_CALL(GetStaticMethodID, env, clazz, name, sig); |
|
} |
|
|
|
INLINE jobject jniCallStaticObjectMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jobject result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallStaticObjectMethodV, env, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jobject jniCallStaticObjectMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallStaticObjectMethodV, env, clazz, methodID, args); |
|
} |
|
INLINE jobject jniCallStaticObjectMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args) { |
|
return JNI_CALL(CallStaticObjectMethodA, env, clazz, methodID, args); |
|
} |
|
|
|
INLINE jboolean jniCallStaticBooleanMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jboolean result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallStaticBooleanMethodV, env, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jboolean jniCallStaticBooleanMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallStaticBooleanMethodV, env, clazz, methodID, args); |
|
} |
|
INLINE jboolean jniCallStaticBooleanMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args) { |
|
return JNI_CALL(CallStaticBooleanMethodA, env, clazz, methodID, args); |
|
} |
|
|
|
INLINE jbyte jniCallStaticByteMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jbyte result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallStaticByteMethodV, env, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jbyte jniCallStaticByteMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallStaticByteMethodV, env, clazz, methodID, args); |
|
} |
|
INLINE jbyte jniCallStaticByteMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args) { |
|
return JNI_CALL(CallStaticByteMethodA, env, clazz, methodID, args); |
|
} |
|
|
|
INLINE jchar jniCallStaticCharMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jchar result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallStaticCharMethodV, env, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jchar jniCallStaticCharMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallStaticCharMethodV, env, clazz, methodID, args); |
|
} |
|
INLINE jchar jniCallStaticCharMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args) { |
|
return JNI_CALL(CallStaticCharMethodA, env, clazz, methodID, args); |
|
} |
|
|
|
INLINE jshort jniCallStaticShortMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jshort result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallStaticShortMethodV, env, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jshort jniCallStaticShortMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallStaticShortMethodV, env, clazz, methodID, args); |
|
} |
|
INLINE jshort jniCallStaticShortMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args) { |
|
return JNI_CALL(CallStaticShortMethodA, env, clazz, methodID, args); |
|
} |
|
|
|
INLINE jint jniCallStaticIntMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jint result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallStaticIntMethodV, env, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jint jniCallStaticIntMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallStaticIntMethodV, env, clazz, methodID, args); |
|
} |
|
INLINE jint jniCallStaticIntMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args) { |
|
return JNI_CALL(CallStaticIntMethodA, env, clazz, methodID, args); |
|
} |
|
|
|
INLINE jlong jniCallStaticLongMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jlong result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallStaticLongMethodV, env, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jlong jniCallStaticLongMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallStaticLongMethodV, env, clazz, methodID, args); |
|
} |
|
INLINE jlong jniCallStaticLongMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args) { |
|
return JNI_CALL(CallStaticLongMethodA, env, clazz, methodID, args); |
|
} |
|
|
|
INLINE jfloat jniCallStaticFloatMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jfloat result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallStaticFloatMethodV, env, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jfloat jniCallStaticFloatMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallStaticFloatMethodV, env, clazz, methodID, args); |
|
} |
|
INLINE jfloat jniCallStaticFloatMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args) { |
|
return JNI_CALL(CallStaticFloatMethodA, env, clazz, methodID, args); |
|
} |
|
|
|
INLINE jdouble jniCallStaticDoubleMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { |
|
va_list args; |
|
jdouble result; |
|
va_start(args, methodID); |
|
result = JNI_CALL(CallStaticDoubleMethodV, env, clazz, methodID, args); |
|
va_end(args); |
|
return result; |
|
} |
|
INLINE jdouble jniCallStaticDoubleMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args) { |
|
return JNI_CALL(CallStaticDoubleMethodV, env, clazz, methodID, args); |
|
} |
|
INLINE jdouble jniCallStaticDoubleMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args) { |
|
return JNI_CALL(CallStaticDoubleMethodA, env, clazz, methodID, args); |
|
} |
|
|
|
INLINE void jniCallStaticVoidMethod(JNIEnv *env, jclass cls, jmethodID methodID, ...) { |
|
va_list args; |
|
va_start(args, methodID); |
|
JNI_CALL(CallStaticVoidMethodV, env, cls, methodID, args); |
|
va_end(args); |
|
} |
|
INLINE void jniCallStaticVoidMethodV(JNIEnv *env, jclass cls, jmethodID methodID, va_list args) { |
|
JNI_CALL(CallStaticVoidMethodV, env, cls, methodID, args); |
|
} |
|
INLINE void jniCallStaticVoidMethodA(JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args) { |
|
JNI_CALL(CallStaticVoidMethodA, env, cls, methodID, args); |
|
} |
|
|
|
INLINE jfieldID jniGetStaticFieldID(JNIEnv *env, jclass clazz, const char *name, const char *sig) { |
|
return JNI_CALL(GetStaticFieldID, env, clazz, name, sig); |
|
} |
|
INLINE jobject jniGetStaticObjectField(JNIEnv *env, jclass clazz, jfieldID fieldID) { |
|
return JNI_CALL(GetStaticObjectField, env, clazz, fieldID); |
|
} |
|
INLINE jboolean jniGetStaticBooleanField(JNIEnv *env, jclass clazz, jfieldID fieldID) { |
|
return JNI_CALL(GetStaticBooleanField, env, clazz, fieldID); |
|
} |
|
INLINE jbyte jniGetStaticByteField(JNIEnv *env, jclass clazz, jfieldID fieldID) { |
|
return JNI_CALL(GetStaticByteField, env, clazz, fieldID); |
|
} |
|
INLINE jchar jniGetStaticCharField(JNIEnv *env, jclass clazz, jfieldID fieldID) { |
|
return JNI_CALL(GetStaticCharField, env, clazz, fieldID); |
|
} |
|
INLINE jshort jniGetStaticShortField(JNIEnv *env, jclass clazz, jfieldID fieldID) { |
|
return JNI_CALL(GetStaticShortField, env, clazz, fieldID); |
|
} |
|
INLINE jint jniGetStaticIntField(JNIEnv *env, jclass clazz, jfieldID fieldID) { |
|
return JNI_CALL(GetStaticIntField, env, clazz, fieldID); |
|
} |
|
INLINE jlong jniGetStaticLongField(JNIEnv *env, jclass clazz, jfieldID fieldID) { |
|
return JNI_CALL(GetStaticLongField, env, clazz, fieldID); |
|
} |
|
INLINE jfloat jniGetStaticFloatField(JNIEnv *env, jclass clazz, jfieldID fieldID) { |
|
return JNI_CALL(GetStaticFloatField, env, clazz, fieldID); |
|
} |
|
INLINE jdouble jniGetStaticDoubleField(JNIEnv *env, jclass clazz, jfieldID fieldID) { |
|
return JNI_CALL(GetStaticDoubleField, env, clazz, fieldID); |
|
} |
|
|
|
INLINE void jniSetStaticObjectField(JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value) { |
|
JNI_CALL(SetStaticObjectField, env, clazz, fieldID, value); |
|
} |
|
INLINE void jniSetStaticBooleanField(JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value) { |
|
JNI_CALL(SetStaticBooleanField, env, clazz, fieldID, value); |
|
} |
|
INLINE void jniSetStaticByteField(JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value) { |
|
JNI_CALL(SetStaticByteField, env, clazz, fieldID, value); |
|
} |
|
INLINE void jniSetStaticCharField(JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value) { |
|
JNI_CALL(SetStaticCharField, env, clazz, fieldID, value); |
|
} |
|
INLINE void jniSetStaticShortField(JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value) { |
|
JNI_CALL(SetStaticShortField, env, clazz, fieldID, value); |
|
} |
|
INLINE void jniSetStaticIntField(JNIEnv *env, jclass clazz, jfieldID fieldID, jint value) { |
|
JNI_CALL(SetStaticIntField, env, clazz, fieldID, value); |
|
} |
|
INLINE void jniSetStaticLongField(JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value) { |
|
JNI_CALL(SetStaticLongField, env, clazz, fieldID, value); |
|
} |
|
INLINE void jniSetStaticFloatField(JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value) { |
|
JNI_CALL(SetStaticFloatField, env, clazz, fieldID, value); |
|
} |
|
INLINE void jniSetStaticDoubleField(JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value) { |
|
JNI_CALL(SetStaticDoubleField, env, clazz, fieldID, value); |
|
} |
|
|
|
INLINE jstring jniNewString(JNIEnv *env, const jchar *unicode, jsize len) { |
|
return JNI_CALL(NewString, env, unicode, len); |
|
} |
|
INLINE jsize jniGetStringLength(JNIEnv *env, jstring str) { |
|
return JNI_CALL(GetStringLength, env, str); |
|
} |
|
INLINE const jchar *jniGetStringChars(JNIEnv *env, jstring str, jboolean *isCopy) { |
|
return JNI_CALL(GetStringChars, env, str, isCopy); |
|
} |
|
INLINE void jniReleaseStringChars(JNIEnv *env, jstring str, const jchar *chars) { |
|
JNI_CALL(ReleaseStringChars, env, str, chars); |
|
} |
|
|
|
INLINE jstring jniNewStringUTF(JNIEnv *env, const char *utf) { |
|
return JNI_CALL(NewStringUTF, env, utf); |
|
} |
|
INLINE jsize jniGetStringUTFLength(JNIEnv *env, jstring str) { |
|
return JNI_CALL(GetStringUTFLength, env, str); |
|
} |
|
INLINE const char* jniGetStringUTFChars(JNIEnv *env, jstring str, jboolean *isCopy) { |
|
return JNI_CALL(GetStringUTFChars, env, str, isCopy); |
|
} |
|
INLINE void jniReleaseStringUTFChars(JNIEnv *env, jstring str, const char* chars) { |
|
JNI_CALL(ReleaseStringUTFChars, env, str, chars); |
|
} |
|
|
|
INLINE jsize jniGetArrayLength(JNIEnv *env, jarray array) { |
|
return JNI_CALL(GetArrayLength, env, array); |
|
} |
|
|
|
/* |
|
NewObjectArray |
|
jobjectArray NewObjectArray(JNIEnv *env, jsize length, |
|
jclass elementClass, jobject initialElement); |
|
|
|
Constructs a new array holding objects in class elementClass. All elements are initially set to initialElement. |
|
|
|
|
|
LINKAGE: |
|
Index 172 in the JNIEnv interface function table. |
|
PARAMETERS: |
|
env: the JNI interface pointer. |
|
|
|
length: array size. |
|
|
|
elementClass: array element class. |
|
|
|
initialElement: initialization value. |
|
|
|
RETURNS: |
|
Returns a Java array object, or NULL if the array cannot be constructed. |
|
|
|
THROWS: |
|
OutOfMemoryError: if the system runs out of memory. |
|
*/ |
|
INLINE jobjectArray jniNewObjectArray(JNIEnv *env, jsize len, jclass clazz, jobject init) { |
|
return JNI_CALL(NewObjectArray, env, len, clazz, init); |
|
} |
|
INLINE jobject jniGetObjectArrayElement(JNIEnv *env, jobjectArray array, jsize index) { |
|
return JNI_CALL(GetObjectArrayElement, env, array, index); |
|
} |
|
INLINE void jniSetObjectArrayElement(JNIEnv *env, jobjectArray array, jsize index, jobject val) { |
|
JNI_CALL(SetObjectArrayElement, env, array, index, val); |
|
} |
|
|
|
INLINE jbooleanArray jniNewBooleanArray(JNIEnv *env, jsize len) { |
|
return JNI_CALL(NewBooleanArray, env, len); |
|
} |
|
INLINE jbyteArray jniNewByteArray(JNIEnv *env, jsize len) { |
|
return JNI_CALL(NewByteArray, env, len); |
|
} |
|
INLINE jcharArray jniNewCharArray(JNIEnv *env, jsize len) { |
|
return JNI_CALL(NewCharArray, env, len); |
|
} |
|
INLINE jshortArray jniNewShortArray(JNIEnv *env, jsize len) { |
|
return JNI_CALL(NewShortArray, env, len); |
|
} |
|
INLINE jintArray jniNewIntArray(JNIEnv *env, jsize len) { |
|
return JNI_CALL(NewIntArray, env, len); |
|
} |
|
INLINE jlongArray jniNewLongArray(JNIEnv *env, jsize len) { |
|
return JNI_CALL(NewLongArray, env, len); |
|
} |
|
INLINE jfloatArray jniNewFloatArray(JNIEnv *env, jsize len) { |
|
return JNI_CALL(NewFloatArray, env, len); |
|
} |
|
INLINE jdoubleArray jniNewDoubleArray(JNIEnv *env, jsize len) { |
|
return JNI_CALL(NewDoubleArray, env, len); |
|
} |
|
|
|
INLINE jboolean *jniGetBooleanArrayElements(JNIEnv *env, jbooleanArray array, jboolean *isCopy) { |
|
return JNI_CALL(GetBooleanArrayElements, env, array, isCopy); |
|
} |
|
INLINE jbyte *jniGetByteArrayElements(JNIEnv *env, jbyteArray array, jboolean *isCopy) { |
|
return JNI_CALL(GetByteArrayElements, env, array, isCopy); |
|
} |
|
INLINE jchar *jniGetCharArrayElements(JNIEnv *env, jcharArray array, jboolean *isCopy) { |
|
return JNI_CALL(GetCharArrayElements, env, array, isCopy); |
|
} |
|
INLINE jshort *jniGetShortArrayElements(JNIEnv *env, jshortArray array, jboolean *isCopy) { |
|
return JNI_CALL(GetShortArrayElements, env, array, isCopy); |
|
} |
|
INLINE jint *jniGetIntArrayElements(JNIEnv *env, jintArray array, jboolean *isCopy) { |
|
return JNI_CALL(GetIntArrayElements, env, array, isCopy); |
|
} |
|
INLINE jlong *jniGetLongArrayElements(JNIEnv *env, jlongArray array, jboolean *isCopy) { |
|
return JNI_CALL(GetLongArrayElements, env, array, isCopy); |
|
} |
|
INLINE jfloat *jniGetFloatArrayElements(JNIEnv *env, jfloatArray array, jboolean *isCopy) { |
|
return JNI_CALL(GetFloatArrayElements, env, array, isCopy); |
|
} |
|
INLINE jdouble *jniGetDoubleArrayElements(JNIEnv *env, jdoubleArray array, jboolean *isCopy) { |
|
return JNI_CALL(GetDoubleArrayElements, env, array, isCopy); |
|
} |
|
|
|
INLINE void jniReleaseBooleanArrayElements(JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode) { |
|
JNI_CALL(ReleaseBooleanArrayElements, env, array, elems, mode); |
|
} |
|
INLINE void jniReleaseByteArrayElements(JNIEnv *env, jbyteArray array, jbyte *elems, jint mode) { |
|
JNI_CALL(ReleaseByteArrayElements, env, array, elems, mode); |
|
} |
|
INLINE void jniReleaseCharArrayElements(JNIEnv *env, jcharArray array, jchar *elems, jint mode) { |
|
JNI_CALL(ReleaseCharArrayElements, env, array, elems, mode); |
|
} |
|
INLINE void jniReleaseShortArrayElements(JNIEnv *env, jshortArray array, jshort *elems, jint mode) { |
|
JNI_CALL(ReleaseShortArrayElements, env, array, elems, mode); |
|
} |
|
INLINE void jniReleaseIntArrayElements(JNIEnv *env, jintArray array, jint *elems, jint mode) { |
|
JNI_CALL(ReleaseIntArrayElements, env, array, elems, mode); |
|
} |
|
INLINE void jniReleaseLongArrayElements(JNIEnv *env, jlongArray array, jlong *elems, jint mode) { |
|
JNI_CALL(ReleaseLongArrayElements, env, array, elems, mode); |
|
} |
|
INLINE void jniReleaseFloatArrayElements(JNIEnv *env, jfloatArray array, jfloat *elems, jint mode) { |
|
JNI_CALL(ReleaseFloatArrayElements, env, array, elems, mode); |
|
} |
|
INLINE void jniReleaseDoubleArrayElements(JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode) { |
|
JNI_CALL(ReleaseDoubleArrayElements, env, array, elems, mode); |
|
} |
|
|
|
INLINE void jniGetBooleanArrayRegion(JNIEnv *env, jbooleanArray array, jsize start, jsize len, jboolean *buf) { |
|
JNI_CALL(GetBooleanArrayRegion, env, array, start, len, buf); |
|
} |
|
INLINE void jniGetByteArrayRegion(JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf) { |
|
JNI_CALL(GetByteArrayRegion, env, array, start, len, buf); |
|
} |
|
INLINE void jniGetCharArrayRegion(JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf) { |
|
JNI_CALL(GetCharArrayRegion, env, array, start, len, buf); |
|
} |
|
INLINE void jniGetShortArrayRegion(JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf) { |
|
JNI_CALL(GetShortArrayRegion, env, array, start, len, buf); |
|
} |
|
INLINE void jniGetIntArrayRegion(JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf) { |
|
JNI_CALL(GetIntArrayRegion, env, array, start, len, buf); |
|
} |
|
INLINE void jniGetLongArrayRegion(JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf) { |
|
JNI_CALL(GetLongArrayRegion, env, array, start, len, buf); |
|
} |
|
INLINE void jniGetFloatArrayRegion(JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf) { |
|
JNI_CALL(GetFloatArrayRegion, env, array, start, len, buf); |
|
} |
|
INLINE void jniGetDoubleArrayRegion(JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf) { |
|
JNI_CALL(GetDoubleArrayRegion, env, array, start, len, buf); |
|
} |
|
|
|
INLINE void jniSetBooleanArrayRegion(JNIEnv *env, jbooleanArray array, jsize start, jsize len, const jboolean *buf) { |
|
JNI_CALL(SetBooleanArrayRegion, env, array, start, len, buf); |
|
} |
|
INLINE void jniSetByteArrayRegion(JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf) { |
|
JNI_CALL(SetByteArrayRegion, env, array, start, len, buf); |
|
} |
|
INLINE void jniSetCharArrayRegion(JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf) { |
|
JNI_CALL(SetCharArrayRegion, env, array, start, len, buf); |
|
} |
|
INLINE void jniSetShortArrayRegion(JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf) { |
|
JNI_CALL(SetShortArrayRegion, env, array, start, len, buf); |
|
} |
|
INLINE void jniSetIntArrayRegion(JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf) { |
|
JNI_CALL(SetIntArrayRegion, env, array, start, len, buf); |
|
} |
|
INLINE void jniSetLongArrayRegion(JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf) { |
|
JNI_CALL(SetLongArrayRegion, env, array, start, len, buf); |
|
} |
|
INLINE void jniSetFloatArrayRegion(JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf) { |
|
JNI_CALL(SetFloatArrayRegion, env, array, start, len, buf); |
|
} |
|
INLINE void jniSetDoubleArrayRegion(JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf) { |
|
JNI_CALL(SetDoubleArrayRegion, env, array, start, len, buf); |
|
} |
|
|
|
INLINE jint jniRegisterNatives(JNIEnv *env, jclass clazz, const JNINativeMethod *methods, jint nMethods) { |
|
return JNI_CALL(RegisterNatives, env, clazz, methods, nMethods); |
|
} |
|
INLINE jint jniUnregisterNatives(JNIEnv *env, jclass clazz) { |
|
return JNI_CALL(UnregisterNatives, env, clazz); |
|
} |
|
|
|
/** |
|
* jint MonitorEnter(JNIEnv *env, jobject obj); |
|
* |
|
* Enters the monitor associated with the underlying Java object referred to by obj. |
|
* |
|
* Enters the monitor associated with the object referred to by obj. The obj reference must not be NULL. |
|
* Each Java object has a monitor associated with it. If the current thread already owns the monitor associated with obj, it increments a |
|
* counter in the monitor indicating the number of times this thread has entered the monitor. If the monitor associated with obj is not owned |
|
* by any thread, the current thread becomes the owner of the monitor, setting the entry count of this monitor to 1. If another thread already |
|
* owns the monitor associated with obj, the current thread waits until the monitor is released, then tries again to gain ownership. |
|
* |
|
* A monitor entered through a MonitorEnter JNI function call cannot be exited using the monitorexit Java virtual machine instruction or a |
|
* synchronized method return. A MonitorEnter JNI function call and a monitorenter Java virtual machine instruction may race to enter the |
|
* monitor associated with the same object. |
|
* |
|
* To avoid deadlocks, a monitor entered through a MonitorEnter JNI function call must be exited using the MonitorExit JNI call, unless the |
|
* DetachCurrentThread call is used to implicitly release JNI monitors. |
|
* |
|
* |
|
* LINKAGE: Index 217 in the JNIEnv interface function table. |
|
* |
|
* PARAMETERS: |
|
* env: the JNI interface pointer. |
|
* obj: a normal Java object or class object. |
|
* |
|
* RETURNS: |
|
* Returns “0” on success; returns a negative value on failure. |
|
*/ |
|
INLINE jint jniMonitorEnter(JNIEnv *env, jobject obj) { |
|
return JNI_CALL(MonitorEnter, env, obj); |
|
} |
|
|
|
/** |
|
* jint MonitorExit(JNIEnv *env, jobject obj); |
|
* |
|
* The current thread must be the owner of the monitor associated with the underlying Java object referred to by obj. The thread decrements the counter |
|
* indicating the number of times it has entered this monitor. If the value of the counter becomes zero, the current thread releases the monitor. |
|
* |
|
* Native code must not use MonitorExit to exit a monitor entered through a synchronized method or a monitorenter Java virtual machine instruction. |
|
* |
|
* |
|
* LINKAGE: Index 218 in the JNIEnv interface function table. |
|
* |
|
* PARAMETERS: |
|
* env: the JNI interface pointer. |
|
* obj: a normal Java object or class object. |
|
* |
|
* RETURNS: |
|
* Returns “0” on success; returns a negative value on failure. |
|
* |
|
* EXCEPTIONS: |
|
* IllegalMonitorStateException: if the current thread does not own the monitor. |
|
*/ |
|
INLINE jint jniMonitorExit(JNIEnv *env, jobject obj) { |
|
return JNI_CALL(MonitorExit, env, obj); |
|
} |
|
|
|
INLINE jint jniGetJavaVM(JNIEnv *env, JavaVM **vm) { |
|
return JNI_CALL(GetJavaVM, env, vm); |
|
} |
|
|
|
INLINE void jniGetStringRegion(JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf) { |
|
JNI_CALL(GetStringRegion, env, str, start, len, buf); |
|
} |
|
INLINE void jniGetStringUTFRegion(JNIEnv *env, jstring str, jsize start, jsize len, char *buf) { |
|
JNI_CALL(GetStringUTFRegion, env, str, start, len, buf); |
|
} |
|
|
|
INLINE void *jniGetPrimitiveArrayCritical(JNIEnv *env, jarray array, jboolean *isCopy) { |
|
return JNI_CALL(GetPrimitiveArrayCritical, env, array, isCopy); |
|
} |
|
INLINE void jniReleasePrimitiveArrayCritical(JNIEnv *env, jarray array, void *carray, jint mode) { |
|
JNI_CALL(ReleasePrimitiveArrayCritical, env, array, carray, mode); |
|
} |
|
|
|
INLINE const jchar *jniGetStringCritical(JNIEnv *env, jstring string, jboolean *isCopy) { |
|
return JNI_CALL(GetStringCritical, env, string, isCopy); |
|
} |
|
INLINE void jniReleaseStringCritical(JNIEnv *env, jstring string, const jchar *cstring) { |
|
JNI_CALL(ReleaseStringCritical, env, string, cstring); |
|
} |
|
|
|
INLINE jweak jniNewWeakGlobalRef(JNIEnv *env, jobject obj) { |
|
return JNI_CALL(NewWeakGlobalRef, env, obj); |
|
} |
|
INLINE void jniDeleteWeakGlobalRef(JNIEnv *env, jweak ref) { |
|
JNI_CALL(DeleteWeakGlobalRef, env, ref); |
|
} |
|
|
|
/* |
|
* We introduce a convenience function to check for pending exceptions without creating |
|
* a local reference to the exception object. |
|
* |
|
* jboolean ExceptionCheck(JNIEnv *env); |
|
* |
|
* Returns JNI_TRUE when there is a pending exception; otherwise, returns JNI_FALSE. |
|
* |
|
* LINKAGE: Index 228 in the JNIEnv interface function table. |
|
* SINCE: JDK/JRE 1.2 |
|
*/ |
|
INLINE jboolean jniExceptionCheck(JNIEnv *env) { |
|
return JNI_CALL(ExceptionCheck, env); |
|
} |
|
|
|
INLINE jobject jniNewDirectByteBuffer(JNIEnv *env, void* address, jlong capacity) { |
|
return JNI_CALL(NewDirectByteBuffer, env, address, capacity); |
|
} |
|
INLINE void* jniGetDirectBufferAddress(JNIEnv *env, jobject buf) { |
|
return JNI_CALL(GetDirectBufferAddress, env, buf); |
|
} |
|
|
|
INLINE jlong jniGetDirectBufferCapacity(JNIEnv *env, jobject buf) { |
|
return JNI_CALL(GetDirectBufferCapacity, env, buf); |
|
} |
|
INLINE jobjectRefType jniGetObjectRefType(JNIEnv *env, jobject obj) { |
|
return JNI_CALL(GetObjectRefType, env, obj); |
|
} |
|
|
|
#define MSG_SIZE 1024 |
|
|
|
// Avoid typos in class names |
|
#define EIllegalArgument "java/lang/IllegalArgumentException" |
|
#define EOutOfMemory "java/lang/OutOfMemoryError" |
|
#define EUnsatisfiedLink "java/lang/UnsatisfiedLinkError" |
|
#define EIllegalState "java/lang/IllegalStateException" |
|
#define EUnsupportedOperation "java/lang/UnsupportedOperationException" |
|
#define ERuntime "java/lang/RuntimeException" |
|
#define EError "java/lang/Error" |
|
|
|
#endif /* _Included_JNI */ |