diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..d2feb9c --- /dev/null +++ b/.clang-format @@ -0,0 +1,7 @@ +--- +BasedOnStyle: LLVM +--- +Language: Cpp +PointerAlignment: Left +ColumnLimit: 120 +AllowShortCaseLabelsOnASingleLine: true diff --git a/lib/exec/jni.cpp b/lib/exec/jni.cpp index cdc5cd9..6b92eae 100644 --- a/lib/exec/jni.cpp +++ b/lib/exec/jni.cpp @@ -4,1070 +4,498 @@ #include namespace jvmilia { -JVMData *getData(JNIEnv *env) { - Context *context = std::bit_cast(env); -// __builtin_dump_struct(context->data, printf); +JVMData* getData(JNIEnv* env) { + Context* context = std::bit_cast(env); + // __builtin_dump_struct(context->data, printf); return context->data; } -jint GetVersion(JNIEnv *env) { - puts("Unimplemented JNI method GetVersion"); +[[noreturn]] void unimplemented(const char* methodName) { + printf("Unimplemented JNI method %s\n", methodName); std::exit(1); } -jclass DefineClass(JNIEnv *env, const char *name, jobject loader, - const jbyte *buf, jsize len) { - puts("Unimplemented JNI method DefineClass"); - std::exit(1); -} -jclass FindClass(JNIEnv *env, const char *name) { - puts("Unimplemented JNI method FindClass"); - std::exit(1); -} -jmethodID FromReflectedMethod(JNIEnv *env, jobject method) { - puts("Unimplemented JNI method FromReflectedMethod"); - std::exit(1); -} -jfieldID FromReflectedField(JNIEnv *env, jobject field) { - puts("Unimplemented JNI method FromReflectedField"); - std::exit(1); -} -jobject ToReflectedMethod(JNIEnv *env, jclass cls, jmethodID methodID, - jboolean isStatic) { - puts("Unimplemented JNI method ToReflectedMethod"); - std::exit(1); -} -jclass GetSuperclass(JNIEnv *env, jclass sub) { - puts("Unimplemented JNI method GetSuperclass"); - std::exit(1); -} -jboolean IsAssignableFrom(JNIEnv *env, jclass sub, jclass sup) { - puts("Unimplemented JNI method IsAssignableFrom"); - std::exit(1); -} -jobject ToReflectedField(JNIEnv *env, jclass cls, jfieldID fieldID, - jboolean isStatic) { - puts("Unimplemented JNI method ToReflectedField"); - std::exit(1); -} -jint Throw(JNIEnv *env, jthrowable obj) { - puts("Unimplemented JNI method Throw"); - std::exit(1); -} -jint ThrowNew(JNIEnv *env, jclass clazz, const char *msg) { - puts("Unimplemented JNI method ThrowNew"); - std::exit(1); -} -jthrowable ExceptionOccurred(JNIEnv *env) { - puts("Unimplemented JNI method ExceptionOccurred"); - std::exit(1); -} -void ExceptionDescribe(JNIEnv *env) { - puts("Unimplemented JNI method ExceptionDescribe"); - std::exit(1); -} -void ExceptionClear(JNIEnv *env) { - puts("Unimplemented JNI method ExceptionClear"); - std::exit(1); -} -void FatalError(JNIEnv *env, const char *msg) { - puts("Unimplemented JNI method FatalError"); - std::exit(1); -} -jint PushLocalFrame(JNIEnv *env, jint capacity) { - puts("Unimplemented JNI method PushLocalFrame"); - std::exit(1); -} -jobject PopLocalFrame(JNIEnv *env, jobject result) { - puts("Unimplemented JNI method PopLocalFrame"); - std::exit(1); -} -jobject NewGlobalRef(JNIEnv *env, jobject lobj) { - puts("Unimplemented JNI method NewGlobalRef"); - std::exit(1); -} -void DeleteGlobalRef(JNIEnv *env, jobject gref) { - puts("Unimplemented JNI method DeleteGlobalRef"); - std::exit(1); -} -void DeleteLocalRef(JNIEnv *env, jobject obj) { - puts("Unimplemented JNI method DeleteLocalRef"); - std::exit(1); -} -jboolean IsSameObject(JNIEnv *env, jobject obj1, jobject obj2) { - puts("Unimplemented JNI method IsSameObject"); - std::exit(1); -} -jobject NewLocalRef(JNIEnv *env, jobject ref) { - puts("Unimplemented JNI method NewLocalRef"); - std::exit(1); -} -jint EnsureLocalCapacity(JNIEnv *env, jint capacity) { - puts("Unimplemented JNI method EnsureLocalCapacity"); - std::exit(1); -} -jobject AllocObject(JNIEnv *env, jclass clazz) { - puts("Unimplemented JNI method AllocObject"); - std::exit(1); -} -jobject NewObject(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { - puts("Unimplemented JNI method NewObject"); - std::exit(1); -} -jobject NewObjectV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method NewObjectV"); - std::exit(1); -} -jobject NewObjectA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method NewObjectA"); - std::exit(1); -} -jclass GetObjectClass(JNIEnv *env, jobject obj) { - puts("Unimplemented JNI method GetObjectClass"); - std::exit(1); -} -jboolean IsInstanceOf(JNIEnv *env, jobject obj, jclass clazz) { - puts("Unimplemented JNI method IsInstanceOf"); - std::exit(1); -} -jmethodID GetMethodID(JNIEnv *env, jclass clazz, const char *name, - const char *sig) { - puts("Unimplemented JNI method GetMethodID"); - std::exit(1); -} -jobject CallObjectMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallObjectMethod"); - std::exit(1); -} -jobject CallObjectMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallObjectMethodV"); - std::exit(1); -} -jobject CallObjectMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallObjectMethodA"); - std::exit(1); -} -jboolean CallBooleanMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallBooleanMethod"); - std::exit(1); -} -jboolean CallBooleanMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallBooleanMethodV"); - std::exit(1); -} -jboolean CallBooleanMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallBooleanMethodA"); - std::exit(1); -} -jbyte CallByteMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallByteMethod"); - std::exit(1); -} -jbyte CallByteMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallByteMethodV"); - std::exit(1); -} -jbyte CallByteMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallByteMethodA"); - std::exit(1); -} -jchar CallCharMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallCharMethod"); - std::exit(1); -} -jchar CallCharMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallCharMethodV"); - std::exit(1); -} -jchar CallCharMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallCharMethodA"); - std::exit(1); -} -jshort CallShortMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallShortMethod"); - std::exit(1); -} -jshort CallShortMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallShortMethodV"); - std::exit(1); -} -jshort CallShortMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallShortMethodA"); - std::exit(1); -} -jint CallIntMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallIntMethod"); - std::exit(1); -} -jint CallIntMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallIntMethodV"); - std::exit(1); -} -jint CallIntMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallIntMethodA"); - std::exit(1); -} -jlong CallLongMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallLongMethod"); - std::exit(1); -} -jlong CallLongMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallLongMethodV"); - std::exit(1); -} -jlong CallLongMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallLongMethodA"); - std::exit(1); -} -jfloat CallFloatMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallFloatMethod"); - std::exit(1); -} -jfloat CallFloatMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallFloatMethodV"); - std::exit(1); -} -jfloat CallFloatMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallFloatMethodA"); - std::exit(1); -} -jdouble CallDoubleMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallDoubleMethod"); - std::exit(1); -} -jdouble CallDoubleMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallDoubleMethodV"); - std::exit(1); -} -jdouble CallDoubleMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallDoubleMethodA"); - std::exit(1); -} -void CallVoidMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallVoidMethod"); - std::exit(1); -} -void CallVoidMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallVoidMethodV"); - std::exit(1); -} -void CallVoidMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallVoidMethodA"); - std::exit(1); -} -jobject CallNonvirtualObjectMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...) { - puts("Unimplemented JNI method CallNonvirtualObjectMethod"); - std::exit(1); -} -jobject CallNonvirtualObjectMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - puts("Unimplemented JNI method CallNonvirtualObjectMethodV"); - std::exit(1); -} -jobject CallNonvirtualObjectMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args) { - puts("Unimplemented JNI method CallNonvirtualObjectMethodA"); - std::exit(1); -} -jboolean CallNonvirtualBooleanMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...) { - puts("Unimplemented JNI method CallNonvirtualBooleanMethod"); - std::exit(1); -} -jboolean CallNonvirtualBooleanMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - puts("Unimplemented JNI method CallNonvirtualBooleanMethodV"); - std::exit(1); -} -jboolean CallNonvirtualBooleanMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args) { - puts("Unimplemented JNI method CallNonvirtualBooleanMethodA"); - std::exit(1); -} -jbyte CallNonvirtualByteMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...) { - puts("Unimplemented JNI method CallNonvirtualByteMethod"); - std::exit(1); -} -jbyte CallNonvirtualByteMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - puts("Unimplemented JNI method CallNonvirtualByteMethodV"); - std::exit(1); -} -jbyte CallNonvirtualByteMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args) { - puts("Unimplemented JNI method CallNonvirtualByteMethodA"); - std::exit(1); -} -jchar CallNonvirtualCharMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...) { - puts("Unimplemented JNI method CallNonvirtualCharMethod"); - std::exit(1); -} -jchar CallNonvirtualCharMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - puts("Unimplemented JNI method CallNonvirtualCharMethodV"); - std::exit(1); -} -jchar CallNonvirtualCharMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args) { - puts("Unimplemented JNI method CallNonvirtualCharMethodA"); - std::exit(1); -} -jshort CallNonvirtualShortMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...) { - puts("Unimplemented JNI method CallNonvirtualShortMethod"); - std::exit(1); -} -jshort CallNonvirtualShortMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - puts("Unimplemented JNI method CallNonvirtualShortMethodV"); - std::exit(1); -} -jshort CallNonvirtualShortMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args) { - puts("Unimplemented JNI method CallNonvirtualShortMethodA"); - std::exit(1); -} -jint CallNonvirtualIntMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...) { - puts("Unimplemented JNI method CallNonvirtualIntMethod"); - std::exit(1); -} -jint CallNonvirtualIntMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - puts("Unimplemented JNI method CallNonvirtualIntMethodV"); - std::exit(1); -} -jint CallNonvirtualIntMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args) { - puts("Unimplemented JNI method CallNonvirtualIntMethodA"); - std::exit(1); -} -jlong CallNonvirtualLongMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...) { - puts("Unimplemented JNI method CallNonvirtualLongMethod"); - std::exit(1); -} -jlong CallNonvirtualLongMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - puts("Unimplemented JNI method CallNonvirtualLongMethodV"); - std::exit(1); -} -jlong CallNonvirtualLongMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args) { - puts("Unimplemented JNI method CallNonvirtualLongMethodA"); - std::exit(1); -} -jfloat CallNonvirtualFloatMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...) { - puts("Unimplemented JNI method CallNonvirtualFloatMethod"); - std::exit(1); -} -jfloat CallNonvirtualFloatMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - puts("Unimplemented JNI method CallNonvirtualFloatMethodV"); - std::exit(1); -} -jfloat CallNonvirtualFloatMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args) { - puts("Unimplemented JNI method CallNonvirtualFloatMethodA"); - std::exit(1); -} -jdouble CallNonvirtualDoubleMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...) { - puts("Unimplemented JNI method CallNonvirtualDoubleMethod"); - std::exit(1); -} -jdouble CallNonvirtualDoubleMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - puts("Unimplemented JNI method CallNonvirtualDoubleMethodV"); - std::exit(1); -} -jdouble CallNonvirtualDoubleMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args) { - puts("Unimplemented JNI method CallNonvirtualDoubleMethodA"); - std::exit(1); -} -void CallNonvirtualVoidMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...) { - puts("Unimplemented JNI method CallNonvirtualVoidMethod"); - std::exit(1); -} -void CallNonvirtualVoidMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args) { - puts("Unimplemented JNI method CallNonvirtualVoidMethodV"); - std::exit(1); -} -void CallNonvirtualVoidMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args) { - puts("Unimplemented JNI method CallNonvirtualVoidMethodA"); - std::exit(1); -} -jfieldID GetFieldID(JNIEnv *env, jclass clazz, const char *name, - const char *sig) { - puts("Unimplemented JNI method GetFieldID"); - std::exit(1); -} -jobject GetObjectField(JNIEnv *env, jobject obj, jfieldID fieldID) { - puts("Unimplemented JNI method GetObjectField"); - std::exit(1); -} -jboolean GetBooleanField(JNIEnv *env, jobject obj, jfieldID fieldID) { - puts("Unimplemented JNI method GetBooleanField"); - std::exit(1); -} -jbyte GetByteField(JNIEnv *env, jobject obj, jfieldID fieldID) { - puts("Unimplemented JNI method GetByteField"); - std::exit(1); -} -jchar GetCharField(JNIEnv *env, jobject obj, jfieldID fieldID) { - puts("Unimplemented JNI method GetCharField"); - std::exit(1); -} -jshort GetShortField(JNIEnv *env, jobject obj, jfieldID fieldID) { - puts("Unimplemented JNI method GetShortField"); - std::exit(1); -} -jint GetIntField(JNIEnv *env, jobject obj, jfieldID fieldID) { - puts("Unimplemented JNI method GetIntField"); - std::exit(1); -} -jlong GetLongField(JNIEnv *env, jobject obj, jfieldID fieldID) { - puts("Unimplemented JNI method GetLongField"); - std::exit(1); -} -jfloat GetFloatField(JNIEnv *env, jobject obj, jfieldID fieldID) { - puts("Unimplemented JNI method GetFloatField"); - std::exit(1); -} -jdouble GetDoubleField(JNIEnv *env, jobject obj, jfieldID fieldID) { - puts("Unimplemented JNI method GetDoubleField"); - std::exit(1); + +jint RegisterNatives(JNIEnv* env, jclass clazz, const JNINativeMethod* methods, jint nMethods) { + auto* data = getData(env); + for (int i = 0; i < nMethods; i++) { + auto method = methods[i]; + auto key = std::string(method.name) + ";" + method.signature; + data->registered_natives.insert_or_assign(key, method.fnPtr); + } + + for (auto [k, v] : data->registered_natives) { + printf("%s -> %p\n", k.data(), v); + } + + return 0; } -void SetObjectField(JNIEnv *env, jobject obj, jfieldID fieldID, jobject val) { - puts("Unimplemented JNI method SetObjectField"); - std::exit(1); + +jint GetVersion(JNIEnv* env) { unimplemented("GetVersion"); } +jclass DefineClass(JNIEnv* env, const char* name, jobject loader, const jbyte* buf, jsize len) { + unimplemented("DefineClass"); +} +jclass FindClass(JNIEnv* env, const char* name) { unimplemented("FindClass"); } +jmethodID FromReflectedMethod(JNIEnv* env, jobject method) { unimplemented("FromReflectedMethod"); } +jfieldID FromReflectedField(JNIEnv* env, jobject field) { unimplemented("FromReflectedField"); } +jobject ToReflectedMethod(JNIEnv* env, jclass cls, jmethodID methodID, jboolean isStatic) { + unimplemented("ToReflectedMethod"); +} +jclass GetSuperclass(JNIEnv* env, jclass sub) { unimplemented("GetSuperclass"); } +jboolean IsAssignableFrom(JNIEnv* env, jclass sub, jclass sup) { unimplemented("IsAssignableFrom"); } +jobject ToReflectedField(JNIEnv* env, jclass cls, jfieldID fieldID, jboolean isStatic) { + unimplemented("ToReflectedField"); +} +jint Throw(JNIEnv* env, jthrowable obj) { unimplemented("Throw"); } +jint ThrowNew(JNIEnv* env, jclass clazz, const char* msg) { unimplemented("ThrowNew"); } +jthrowable ExceptionOccurred(JNIEnv* env) { unimplemented("ExceptionOccurred"); } +void ExceptionDescribe(JNIEnv* env) { unimplemented("ExceptionDescribe"); } +void ExceptionClear(JNIEnv* env) { unimplemented("ExceptionClear"); } +void FatalError(JNIEnv* env, const char* msg) { unimplemented("FatalError"); } +jint PushLocalFrame(JNIEnv* env, jint capacity) { unimplemented("PushLocalFrame"); } +jobject PopLocalFrame(JNIEnv* env, jobject result) { unimplemented("PopLocalFrame"); } +jobject NewGlobalRef(JNIEnv* env, jobject lobj) { unimplemented("NewGlobalRef"); } +void DeleteGlobalRef(JNIEnv* env, jobject gref) { unimplemented("DeleteGlobalRef"); } +void DeleteLocalRef(JNIEnv* env, jobject obj) { unimplemented("DeleteLocalRef"); } +jboolean IsSameObject(JNIEnv* env, jobject obj1, jobject obj2) { unimplemented("IsSameObject"); } +jobject NewLocalRef(JNIEnv* env, jobject ref) { unimplemented("NewLocalRef"); } +jint EnsureLocalCapacity(JNIEnv* env, jint capacity) { unimplemented("EnsureLocalCapacity"); } +jobject AllocObject(JNIEnv* env, jclass clazz) { unimplemented("AllocObject"); } +jobject NewObject(JNIEnv* env, jclass clazz, jmethodID methodID, ...) { unimplemented("NewObject"); } +jobject NewObjectV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args) { unimplemented("NewObjectV"); } +jobject NewObjectA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args) { unimplemented("NewObjectA"); } +jclass GetObjectClass(JNIEnv* env, jobject obj) { unimplemented("GetObjectClass"); } +jboolean IsInstanceOf(JNIEnv* env, jobject obj, jclass clazz) { unimplemented("IsInstanceOf"); } +jmethodID GetMethodID(JNIEnv* env, jclass clazz, const char* name, const char* sig) { unimplemented("GetMethodID"); } +jobject CallObjectMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...) { unimplemented("CallObjectMethod"); } +jobject CallObjectMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args) { + unimplemented("CallObjectMethodV"); +} +jobject CallObjectMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args) { + unimplemented("CallObjectMethodA"); +} +jboolean CallBooleanMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...) { unimplemented("CallBooleanMethod"); } +jboolean CallBooleanMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args) { + unimplemented("CallBooleanMethodV"); +} +jboolean CallBooleanMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args) { + unimplemented("CallBooleanMethodA"); +} +jbyte CallByteMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...) { unimplemented("CallByteMethod"); } +jbyte CallByteMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args) { unimplemented("CallByteMethodV"); } +jbyte CallByteMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args) { + unimplemented("CallByteMethodA"); +} +jchar CallCharMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...) { unimplemented("CallCharMethod"); } +jchar CallCharMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args) { unimplemented("CallCharMethodV"); } +jchar CallCharMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args) { + unimplemented("CallCharMethodA"); +} +jshort CallShortMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...) { unimplemented("CallShortMethod"); } +jshort CallShortMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args) { + unimplemented("CallShortMethodV"); +} +jshort CallShortMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args) { + unimplemented("CallShortMethodA"); } -void SetBooleanField(JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val) { - puts("Unimplemented JNI method SetBooleanField"); - std::exit(1); +jint CallIntMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...) { unimplemented("CallIntMethod"); } +jint CallIntMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args) { unimplemented("CallIntMethodV"); } +jint CallIntMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args) { + unimplemented("CallIntMethodA"); } -void SetByteField(JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val) { - puts("Unimplemented JNI method SetByteField"); - std::exit(1); +jlong CallLongMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...) { unimplemented("CallLongMethod"); } +jlong CallLongMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args) { unimplemented("CallLongMethodV"); } +jlong CallLongMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args) { + unimplemented("CallLongMethodA"); } -void SetCharField(JNIEnv *env, jobject obj, jfieldID fieldID, jchar val) { - puts("Unimplemented JNI method SetCharField"); - std::exit(1); +jfloat CallFloatMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...) { unimplemented("CallFloatMethod"); } +jfloat CallFloatMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args) { + unimplemented("CallFloatMethodV"); } -void SetShortField(JNIEnv *env, jobject obj, jfieldID fieldID, jshort val) { - puts("Unimplemented JNI method SetShortField"); - std::exit(1); +jfloat CallFloatMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args) { + unimplemented("CallFloatMethodA"); } -void SetIntField(JNIEnv *env, jobject obj, jfieldID fieldID, jint val) { - puts("Unimplemented JNI method SetIntField"); - std::exit(1); +jdouble CallDoubleMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...) { unimplemented("CallDoubleMethod"); } +jdouble CallDoubleMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args) { + unimplemented("CallDoubleMethodV"); } -void SetLongField(JNIEnv *env, jobject obj, jfieldID fieldID, jlong val) { - puts("Unimplemented JNI method SetLongField"); - std::exit(1); +jdouble CallDoubleMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args) { + unimplemented("CallDoubleMethodA"); } -void SetFloatField(JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val) { - puts("Unimplemented JNI method SetFloatField"); - std::exit(1); +void CallVoidMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...) { unimplemented("CallVoidMethod"); } +void CallVoidMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args) { unimplemented("CallVoidMethodV"); } +void CallVoidMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args) { + unimplemented("CallVoidMethodA"); +} +jobject CallNonvirtualObjectMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallNonvirtualObjectMethod"); +} +jobject CallNonvirtualObjectMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallNonvirtualObjectMethodV"); +} +jobject CallNonvirtualObjectMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallNonvirtualObjectMethodA"); +} +jboolean CallNonvirtualBooleanMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallNonvirtualBooleanMethod"); +} +jboolean CallNonvirtualBooleanMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallNonvirtualBooleanMethodV"); +} +jboolean CallNonvirtualBooleanMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallNonvirtualBooleanMethodA"); +} +jbyte CallNonvirtualByteMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallNonvirtualByteMethod"); +} +jbyte CallNonvirtualByteMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallNonvirtualByteMethodV"); } -void SetDoubleField(JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val) { - puts("Unimplemented JNI method SetDoubleField"); - std::exit(1); +jbyte CallNonvirtualByteMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallNonvirtualByteMethodA"); } -jmethodID GetStaticMethodID(JNIEnv *env, jclass clazz, const char *name, - const char *sig) { - puts("Unimplemented JNI method GetStaticMethodID"); - std::exit(1); +jchar CallNonvirtualCharMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallNonvirtualCharMethod"); } -jobject CallStaticObjectMethod(JNIEnv *env, jclass clazz, jmethodID methodID, - ...) { - puts("Unimplemented JNI method CallStaticObjectMethod"); - std::exit(1); +jchar CallNonvirtualCharMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallNonvirtualCharMethodV"); } -jobject CallStaticObjectMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallStaticObjectMethodV"); - std::exit(1); +jchar CallNonvirtualCharMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallNonvirtualCharMethodA"); } -jobject CallStaticObjectMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallStaticObjectMethodA"); - std::exit(1); +jshort CallNonvirtualShortMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallNonvirtualShortMethod"); } -jboolean CallStaticBooleanMethod(JNIEnv *env, jclass clazz, jmethodID methodID, - ...) { - puts("Unimplemented JNI method CallStaticBooleanMethod"); - std::exit(1); +jshort CallNonvirtualShortMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallNonvirtualShortMethodV"); } -jboolean CallStaticBooleanMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallStaticBooleanMethodV"); - std::exit(1); +jshort CallNonvirtualShortMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallNonvirtualShortMethodA"); } -jboolean CallStaticBooleanMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallStaticBooleanMethodA"); - std::exit(1); +jint CallNonvirtualIntMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallNonvirtualIntMethod"); } -jbyte CallStaticByteMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallStaticByteMethod"); - std::exit(1); +jint CallNonvirtualIntMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallNonvirtualIntMethodV"); } -jbyte CallStaticByteMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallStaticByteMethodV"); - std::exit(1); +jint CallNonvirtualIntMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallNonvirtualIntMethodA"); } -jbyte CallStaticByteMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallStaticByteMethodA"); - std::exit(1); +jlong CallNonvirtualLongMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallNonvirtualLongMethod"); } -jchar CallStaticCharMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallStaticCharMethod"); - std::exit(1); +jlong CallNonvirtualLongMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallNonvirtualLongMethodV"); } -jchar CallStaticCharMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallStaticCharMethodV"); - std::exit(1); +jlong CallNonvirtualLongMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallNonvirtualLongMethodA"); } -jchar CallStaticCharMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallStaticCharMethodA"); - std::exit(1); +jfloat CallNonvirtualFloatMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallNonvirtualFloatMethod"); } -jshort CallStaticShortMethod(JNIEnv *env, jclass clazz, jmethodID methodID, - ...) { - puts("Unimplemented JNI method CallStaticShortMethod"); - std::exit(1); +jfloat CallNonvirtualFloatMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallNonvirtualFloatMethodV"); } -jshort CallStaticShortMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallStaticShortMethodV"); - std::exit(1); +jfloat CallNonvirtualFloatMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallNonvirtualFloatMethodA"); } -jshort CallStaticShortMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallStaticShortMethodA"); - std::exit(1); +jdouble CallNonvirtualDoubleMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallNonvirtualDoubleMethod"); } -jint CallStaticIntMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallStaticIntMethod"); - std::exit(1); +jdouble CallNonvirtualDoubleMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallNonvirtualDoubleMethodV"); } -jint CallStaticIntMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallStaticIntMethodV"); - std::exit(1); +jdouble CallNonvirtualDoubleMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallNonvirtualDoubleMethodA"); } -jint CallStaticIntMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallStaticIntMethodA"); - std::exit(1); +void CallNonvirtualVoidMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallNonvirtualVoidMethod"); } -jlong CallStaticLongMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallStaticLongMethod"); - std::exit(1); +void CallNonvirtualVoidMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallNonvirtualVoidMethodV"); } -jlong CallStaticLongMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallStaticLongMethodV"); - std::exit(1); +void CallNonvirtualVoidMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallNonvirtualVoidMethodA"); } -jlong CallStaticLongMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallStaticLongMethodA"); - std::exit(1); +jfieldID GetFieldID(JNIEnv* env, jclass clazz, const char* name, const char* sig) { unimplemented("GetFieldID"); } +jobject GetObjectField(JNIEnv* env, jobject obj, jfieldID fieldID) { unimplemented("GetObjectField"); } +jboolean GetBooleanField(JNIEnv* env, jobject obj, jfieldID fieldID) { unimplemented("GetBooleanField"); } +jbyte GetByteField(JNIEnv* env, jobject obj, jfieldID fieldID) { unimplemented("GetByteField"); } +jchar GetCharField(JNIEnv* env, jobject obj, jfieldID fieldID) { unimplemented("GetCharField"); } +jshort GetShortField(JNIEnv* env, jobject obj, jfieldID fieldID) { unimplemented("GetShortField"); } +jint GetIntField(JNIEnv* env, jobject obj, jfieldID fieldID) { unimplemented("GetIntField"); } +jlong GetLongField(JNIEnv* env, jobject obj, jfieldID fieldID) { unimplemented("GetLongField"); } +jfloat GetFloatField(JNIEnv* env, jobject obj, jfieldID fieldID) { unimplemented("GetFloatField"); } +jdouble GetDoubleField(JNIEnv* env, jobject obj, jfieldID fieldID) { unimplemented("GetDoubleField"); } +void SetObjectField(JNIEnv* env, jobject obj, jfieldID fieldID, jobject val) { unimplemented("SetObjectField"); } +void SetBooleanField(JNIEnv* env, jobject obj, jfieldID fieldID, jboolean val) { unimplemented("SetBooleanField"); } +void SetByteField(JNIEnv* env, jobject obj, jfieldID fieldID, jbyte val) { unimplemented("SetByteField"); } +void SetCharField(JNIEnv* env, jobject obj, jfieldID fieldID, jchar val) { unimplemented("SetCharField"); } +void SetShortField(JNIEnv* env, jobject obj, jfieldID fieldID, jshort val) { unimplemented("SetShortField"); } +void SetIntField(JNIEnv* env, jobject obj, jfieldID fieldID, jint val) { unimplemented("SetIntField"); } +void SetLongField(JNIEnv* env, jobject obj, jfieldID fieldID, jlong val) { unimplemented("SetLongField"); } +void SetFloatField(JNIEnv* env, jobject obj, jfieldID fieldID, jfloat val) { unimplemented("SetFloatField"); } +void SetDoubleField(JNIEnv* env, jobject obj, jfieldID fieldID, jdouble val) { unimplemented("SetDoubleField"); } +jmethodID GetStaticMethodID(JNIEnv* env, jclass clazz, const char* name, const char* sig) { + unimplemented("GetStaticMethodID"); } -jfloat CallStaticFloatMethod(JNIEnv *env, jclass clazz, jmethodID methodID, - ...) { - puts("Unimplemented JNI method CallStaticFloatMethod"); - std::exit(1); +jobject CallStaticObjectMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallStaticObjectMethod"); } -jfloat CallStaticFloatMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallStaticFloatMethodV"); - std::exit(1); +jobject CallStaticObjectMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallStaticObjectMethodV"); } -jfloat CallStaticFloatMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallStaticFloatMethodA"); - std::exit(1); +jobject CallStaticObjectMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallStaticObjectMethodA"); } -jdouble CallStaticDoubleMethod(JNIEnv *env, jclass clazz, jmethodID methodID, - ...) { - puts("Unimplemented JNI method CallStaticDoubleMethod"); - std::exit(1); +jboolean CallStaticBooleanMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallStaticBooleanMethod"); } -jdouble CallStaticDoubleMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallStaticDoubleMethodV"); - std::exit(1); +jboolean CallStaticBooleanMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallStaticBooleanMethodV"); } -jdouble CallStaticDoubleMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallStaticDoubleMethodA"); - std::exit(1); +jboolean CallStaticBooleanMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallStaticBooleanMethodA"); } -void CallStaticVoidMethod(JNIEnv *env, jclass cls, jmethodID methodID, ...) { - puts("Unimplemented JNI method CallStaticVoidMethod"); - std::exit(1); +jbyte CallStaticByteMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallStaticByteMethod"); } -void CallStaticVoidMethodV(JNIEnv *env, jclass cls, jmethodID methodID, - va_list args) { - puts("Unimplemented JNI method CallStaticVoidMethodV"); - std::exit(1); +jbyte CallStaticByteMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallStaticByteMethodV"); } -void CallStaticVoidMethodA(JNIEnv *env, jclass cls, jmethodID methodID, - const jvalue *args) { - puts("Unimplemented JNI method CallStaticVoidMethodA"); - std::exit(1); +jbyte CallStaticByteMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallStaticByteMethodA"); } -jfieldID GetStaticFieldID(JNIEnv *env, jclass clazz, const char *name, - const char *sig) { - puts("Unimplemented JNI method GetStaticFieldID"); - std::exit(1); +jchar CallStaticCharMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallStaticCharMethod"); } -jobject GetStaticObjectField(JNIEnv *env, jclass clazz, jfieldID fieldID) { - puts("Unimplemented JNI method GetStaticObjectField"); - std::exit(1); +jchar CallStaticCharMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallStaticCharMethodV"); } -jboolean GetStaticBooleanField(JNIEnv *env, jclass clazz, jfieldID fieldID) { - puts("Unimplemented JNI method GetStaticBooleanField"); - std::exit(1); +jchar CallStaticCharMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallStaticCharMethodA"); } -jbyte GetStaticByteField(JNIEnv *env, jclass clazz, jfieldID fieldID) { - puts("Unimplemented JNI method GetStaticByteField"); - std::exit(1); +jshort CallStaticShortMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallStaticShortMethod"); } -jchar GetStaticCharField(JNIEnv *env, jclass clazz, jfieldID fieldID) { - puts("Unimplemented JNI method GetStaticCharField"); - std::exit(1); +jshort CallStaticShortMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallStaticShortMethodV"); } -jshort GetStaticShortField(JNIEnv *env, jclass clazz, jfieldID fieldID) { - puts("Unimplemented JNI method GetStaticShortField"); - std::exit(1); +jshort CallStaticShortMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallStaticShortMethodA"); } -jint GetStaticIntField(JNIEnv *env, jclass clazz, jfieldID fieldID) { - puts("Unimplemented JNI method GetStaticIntField"); - std::exit(1); +jint CallStaticIntMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...) { unimplemented("CallStaticIntMethod"); } +jint CallStaticIntMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallStaticIntMethodV"); } -jlong GetStaticLongField(JNIEnv *env, jclass clazz, jfieldID fieldID) { - puts("Unimplemented JNI method GetStaticLongField"); - std::exit(1); +jint CallStaticIntMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallStaticIntMethodA"); +} +jlong CallStaticLongMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallStaticLongMethod"); +} +jlong CallStaticLongMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallStaticLongMethodV"); +} +jlong CallStaticLongMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallStaticLongMethodA"); +} +jfloat CallStaticFloatMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallStaticFloatMethod"); +} +jfloat CallStaticFloatMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallStaticFloatMethodV"); +} +jfloat CallStaticFloatMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallStaticFloatMethodA"); +} +jdouble CallStaticDoubleMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...) { + unimplemented("CallStaticDoubleMethod"); +} +jdouble CallStaticDoubleMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args) { + unimplemented("CallStaticDoubleMethodV"); +} +jdouble CallStaticDoubleMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args) { + unimplemented("CallStaticDoubleMethodA"); +} +void CallStaticVoidMethod(JNIEnv* env, jclass cls, jmethodID methodID, ...) { unimplemented("CallStaticVoidMethod"); } +void CallStaticVoidMethodV(JNIEnv* env, jclass cls, jmethodID methodID, va_list args) { + unimplemented("CallStaticVoidMethodV"); } -jfloat GetStaticFloatField(JNIEnv *env, jclass clazz, jfieldID fieldID) { - puts("Unimplemented JNI method GetStaticFloatField"); - std::exit(1); +void CallStaticVoidMethodA(JNIEnv* env, jclass cls, jmethodID methodID, const jvalue* args) { + unimplemented("CallStaticVoidMethodA"); } -jdouble GetStaticDoubleField(JNIEnv *env, jclass clazz, jfieldID fieldID) { - puts("Unimplemented JNI method GetStaticDoubleField"); - std::exit(1); +jfieldID GetStaticFieldID(JNIEnv* env, jclass clazz, const char* name, const char* sig) { + unimplemented("GetStaticFieldID"); } -void SetStaticObjectField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jobject value) { - puts("Unimplemented JNI method SetStaticObjectField"); - std::exit(1); +jobject GetStaticObjectField(JNIEnv* env, jclass clazz, jfieldID fieldID) { unimplemented("GetStaticObjectField"); } +jboolean GetStaticBooleanField(JNIEnv* env, jclass clazz, jfieldID fieldID) { unimplemented("GetStaticBooleanField"); } +jbyte GetStaticByteField(JNIEnv* env, jclass clazz, jfieldID fieldID) { unimplemented("GetStaticByteField"); } +jchar GetStaticCharField(JNIEnv* env, jclass clazz, jfieldID fieldID) { unimplemented("GetStaticCharField"); } +jshort GetStaticShortField(JNIEnv* env, jclass clazz, jfieldID fieldID) { unimplemented("GetStaticShortField"); } +jint GetStaticIntField(JNIEnv* env, jclass clazz, jfieldID fieldID) { unimplemented("GetStaticIntField"); } +jlong GetStaticLongField(JNIEnv* env, jclass clazz, jfieldID fieldID) { unimplemented("GetStaticLongField"); } +jfloat GetStaticFloatField(JNIEnv* env, jclass clazz, jfieldID fieldID) { unimplemented("GetStaticFloatField"); } +jdouble GetStaticDoubleField(JNIEnv* env, jclass clazz, jfieldID fieldID) { unimplemented("GetStaticDoubleField"); } +void SetStaticObjectField(JNIEnv* env, jclass clazz, jfieldID fieldID, jobject value) { + unimplemented("SetStaticObjectField"); } -void SetStaticBooleanField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jboolean value) { - puts("Unimplemented JNI method SetStaticBooleanField"); - std::exit(1); +void SetStaticBooleanField(JNIEnv* env, jclass clazz, jfieldID fieldID, jboolean value) { + unimplemented("SetStaticBooleanField"); } -void SetStaticByteField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jbyte value) { - puts("Unimplemented JNI method SetStaticByteField"); - std::exit(1); +void SetStaticByteField(JNIEnv* env, jclass clazz, jfieldID fieldID, jbyte value) { + unimplemented("SetStaticByteField"); } -void SetStaticCharField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jchar value) { - puts("Unimplemented JNI method SetStaticCharField"); - std::exit(1); +void SetStaticCharField(JNIEnv* env, jclass clazz, jfieldID fieldID, jchar value) { + unimplemented("SetStaticCharField"); } -void SetStaticShortField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jshort value) { - puts("Unimplemented JNI method SetStaticShortField"); - std::exit(1); +void SetStaticShortField(JNIEnv* env, jclass clazz, jfieldID fieldID, jshort value) { + unimplemented("SetStaticShortField"); } -void SetStaticIntField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jint value) { - puts("Unimplemented JNI method SetStaticIntField"); - std::exit(1); +void SetStaticIntField(JNIEnv* env, jclass clazz, jfieldID fieldID, jint value) { unimplemented("SetStaticIntField"); } +void SetStaticLongField(JNIEnv* env, jclass clazz, jfieldID fieldID, jlong value) { + unimplemented("SetStaticLongField"); } -void SetStaticLongField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jlong value) { - puts("Unimplemented JNI method SetStaticLongField"); - std::exit(1); +void SetStaticFloatField(JNIEnv* env, jclass clazz, jfieldID fieldID, jfloat value) { + unimplemented("SetStaticFloatField"); } -void SetStaticFloatField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jfloat value) { - puts("Unimplemented JNI method SetStaticFloatField"); - std::exit(1); +void SetStaticDoubleField(JNIEnv* env, jclass clazz, jfieldID fieldID, jdouble value) { + unimplemented("SetStaticDoubleField"); } -void SetStaticDoubleField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jdouble value) { - puts("Unimplemented JNI method SetStaticDoubleField"); - std::exit(1); +jstring NewString(JNIEnv* env, const jchar* unicode, jsize len) { unimplemented("NewString"); } +jsize GetStringLength(JNIEnv* env, jstring str) { unimplemented("GetStringLength"); } +const jchar* GetStringChars(JNIEnv* env, jstring str, jboolean* isCopy) { unimplemented("GetStringChars"); } +void ReleaseStringChars(JNIEnv* env, jstring str, const jchar* chars) { unimplemented("ReleaseStringChars"); } +jstring NewStringUTF(JNIEnv* env, const char* utf) { unimplemented("NewStringUTF"); } +jsize GetStringUTFLength(JNIEnv* env, jstring str) { unimplemented("GetStringUTFLength"); } +const char* GetStringUTFChars(JNIEnv* env, jstring str, jboolean* isCopy) { unimplemented("GetStringUTFChars"); } +void ReleaseStringUTFChars(JNIEnv* env, jstring str, const char* chars) { unimplemented("ReleaseStringUTFChars"); } +jsize GetArrayLength(JNIEnv* env, jarray array) { unimplemented("GetArrayLength"); } +jobjectArray NewObjectArray(JNIEnv* env, jsize len, jclass clazz, jobject init) { unimplemented("NewObjectArray"); } +jobject GetObjectArrayElement(JNIEnv* env, jobjectArray array, jsize index) { unimplemented("GetObjectArrayElement"); } +void SetObjectArrayElement(JNIEnv* env, jobjectArray array, jsize index, jobject val) { + unimplemented("SetObjectArrayElement"); } -jstring NewString(JNIEnv *env, const jchar *unicode, jsize len) { - puts("Unimplemented JNI method NewString"); - std::exit(1); +jbooleanArray NewBooleanArray(JNIEnv* env, jsize len) { unimplemented("NewBooleanArray"); } +jbyteArray NewByteArray(JNIEnv* env, jsize len) { unimplemented("NewByteArray"); } +jcharArray NewCharArray(JNIEnv* env, jsize len) { unimplemented("NewCharArray"); } +jshortArray NewShortArray(JNIEnv* env, jsize len) { unimplemented("NewShortArray"); } +jintArray NewIntArray(JNIEnv* env, jsize len) { unimplemented("NewIntArray"); } +jlongArray NewLongArray(JNIEnv* env, jsize len) { unimplemented("NewLongArray"); } +jfloatArray NewFloatArray(JNIEnv* env, jsize len) { unimplemented("NewFloatArray"); } +jdoubleArray NewDoubleArray(JNIEnv* env, jsize len) { unimplemented("NewDoubleArray"); } +jboolean* GetBooleanArrayElements(JNIEnv* env, jbooleanArray array, jboolean* isCopy) { + unimplemented("GetBooleanArrayElements"); } -jsize GetStringLength(JNIEnv *env, jstring str) { - puts("Unimplemented JNI method GetStringLength"); - std::exit(1); +jbyte* GetByteArrayElements(JNIEnv* env, jbyteArray array, jboolean* isCopy) { unimplemented("GetByteArrayElements"); } +jchar* GetCharArrayElements(JNIEnv* env, jcharArray array, jboolean* isCopy) { unimplemented("GetCharArrayElements"); } +jshort* GetShortArrayElements(JNIEnv* env, jshortArray array, jboolean* isCopy) { + unimplemented("GetShortArrayElements"); } -const jchar *GetStringChars(JNIEnv *env, jstring str, jboolean *isCopy) { - puts("Unimplemented JNI method GetStringChars"); - std::exit(1); +jint* GetIntArrayElements(JNIEnv* env, jintArray array, jboolean* isCopy) { unimplemented("GetIntArrayElements"); } +jlong* GetLongArrayElements(JNIEnv* env, jlongArray array, jboolean* isCopy) { unimplemented("GetLongArrayElements"); } +jfloat* GetFloatArrayElements(JNIEnv* env, jfloatArray array, jboolean* isCopy) { + unimplemented("GetFloatArrayElements"); } -void ReleaseStringChars(JNIEnv *env, jstring str, const jchar *chars) { - puts("Unimplemented JNI method ReleaseStringChars"); - std::exit(1); +jdouble* GetDoubleArrayElements(JNIEnv* env, jdoubleArray array, jboolean* isCopy) { + unimplemented("GetDoubleArrayElements"); } -jstring NewStringUTF(JNIEnv *env, const char *utf) { - puts("Unimplemented JNI method NewStringUTF"); - std::exit(1); +void ReleaseBooleanArrayElements(JNIEnv* env, jbooleanArray array, jboolean* elems, jint mode) { + unimplemented("ReleaseBooleanArrayElements"); } -jsize GetStringUTFLength(JNIEnv *env, jstring str) { - puts("Unimplemented JNI method GetStringUTFLength"); - std::exit(1); +void ReleaseByteArrayElements(JNIEnv* env, jbyteArray array, jbyte* elems, jint mode) { + unimplemented("ReleaseByteArrayElements"); } -const char *GetStringUTFChars(JNIEnv *env, jstring str, jboolean *isCopy) { - puts("Unimplemented JNI method GetStringUTFChars"); - std::exit(1); +void ReleaseCharArrayElements(JNIEnv* env, jcharArray array, jchar* elems, jint mode) { + unimplemented("ReleaseCharArrayElements"); } -void ReleaseStringUTFChars(JNIEnv *env, jstring str, const char *chars) { - puts("Unimplemented JNI method ReleaseStringUTFChars"); - std::exit(1); +void ReleaseShortArrayElements(JNIEnv* env, jshortArray array, jshort* elems, jint mode) { + unimplemented("ReleaseShortArrayElements"); } -jsize GetArrayLength(JNIEnv *env, jarray array) { - puts("Unimplemented JNI method GetArrayLength"); - std::exit(1); +void ReleaseIntArrayElements(JNIEnv* env, jintArray array, jint* elems, jint mode) { + unimplemented("ReleaseIntArrayElements"); } -jobjectArray NewObjectArray(JNIEnv *env, jsize len, jclass clazz, - jobject init) { - puts("Unimplemented JNI method NewObjectArray"); - std::exit(1); +void ReleaseLongArrayElements(JNIEnv* env, jlongArray array, jlong* elems, jint mode) { + unimplemented("ReleaseLongArrayElements"); } -jobject GetObjectArrayElement(JNIEnv *env, jobjectArray array, jsize index) { - puts("Unimplemented JNI method GetObjectArrayElement"); - std::exit(1); +void ReleaseFloatArrayElements(JNIEnv* env, jfloatArray array, jfloat* elems, jint mode) { + unimplemented("ReleaseFloatArrayElements"); } -void SetObjectArrayElement(JNIEnv *env, jobjectArray array, jsize index, - jobject val) { - puts("Unimplemented JNI method SetObjectArrayElement"); - std::exit(1); +void ReleaseDoubleArrayElements(JNIEnv* env, jdoubleArray array, jdouble* elems, jint mode) { + unimplemented("ReleaseDoubleArrayElements"); } -jbooleanArray NewBooleanArray(JNIEnv *env, jsize len) { - puts("Unimplemented JNI method NewBooleanArray"); - std::exit(1); +void GetBooleanArrayRegion(JNIEnv* env, jbooleanArray array, jsize start, jsize l, jboolean* buf) { + unimplemented("GetBooleanArrayRegion"); } -jbyteArray NewByteArray(JNIEnv *env, jsize len) { - puts("Unimplemented JNI method NewByteArray"); - std::exit(1); +void GetByteArrayRegion(JNIEnv* env, jbyteArray array, jsize start, jsize len, jbyte* buf) { + unimplemented("GetByteArrayRegion"); } -jcharArray NewCharArray(JNIEnv *env, jsize len) { - puts("Unimplemented JNI method NewCharArray"); - std::exit(1); +void GetCharArrayRegion(JNIEnv* env, jcharArray array, jsize start, jsize len, jchar* buf) { + unimplemented("GetCharArrayRegion"); } -jshortArray NewShortArray(JNIEnv *env, jsize len) { - puts("Unimplemented JNI method NewShortArray"); - std::exit(1); +void GetShortArrayRegion(JNIEnv* env, jshortArray array, jsize start, jsize len, jshort* buf) { + unimplemented("GetShortArrayRegion"); } -jintArray NewIntArray(JNIEnv *env, jsize len) { - puts("Unimplemented JNI method NewIntArray"); - std::exit(1); +void GetIntArrayRegion(JNIEnv* env, jintArray array, jsize start, jsize len, jint* buf) { + unimplemented("GetIntArrayRegion"); } -jlongArray NewLongArray(JNIEnv *env, jsize len) { - puts("Unimplemented JNI method NewLongArray"); - std::exit(1); +void GetLongArrayRegion(JNIEnv* env, jlongArray array, jsize start, jsize len, jlong* buf) { + unimplemented("GetLongArrayRegion"); } -jfloatArray NewFloatArray(JNIEnv *env, jsize len) { - puts("Unimplemented JNI method NewFloatArray"); - std::exit(1); +void GetFloatArrayRegion(JNIEnv* env, jfloatArray array, jsize start, jsize len, jfloat* buf) { + unimplemented("GetFloatArrayRegion"); } -jdoubleArray NewDoubleArray(JNIEnv *env, jsize len) { - puts("Unimplemented JNI method NewDoubleArray"); - std::exit(1); +void GetDoubleArrayRegion(JNIEnv* env, jdoubleArray array, jsize start, jsize len, jdouble* buf) { + unimplemented("GetDoubleArrayRegion"); } -jboolean *GetBooleanArrayElements(JNIEnv *env, jbooleanArray array, - jboolean *isCopy) { - puts("Unimplemented JNI method GetBooleanArrayElements"); - std::exit(1); +void SetBooleanArrayRegion(JNIEnv* env, jbooleanArray array, jsize start, jsize l, const jboolean* buf) { + unimplemented("SetBooleanArrayRegion"); } -jbyte *GetByteArrayElements(JNIEnv *env, jbyteArray array, jboolean *isCopy) { - puts("Unimplemented JNI method GetByteArrayElements"); - std::exit(1); +void SetByteArrayRegion(JNIEnv* env, jbyteArray array, jsize start, jsize len, const jbyte* buf) { + unimplemented("SetByteArrayRegion"); } -jchar *GetCharArrayElements(JNIEnv *env, jcharArray array, jboolean *isCopy) { - puts("Unimplemented JNI method GetCharArrayElements"); - std::exit(1); +void SetCharArrayRegion(JNIEnv* env, jcharArray array, jsize start, jsize len, const jchar* buf) { + unimplemented("SetCharArrayRegion"); } -jshort *GetShortArrayElements(JNIEnv *env, jshortArray array, - jboolean *isCopy) { - puts("Unimplemented JNI method GetShortArrayElements"); - std::exit(1); +void SetShortArrayRegion(JNIEnv* env, jshortArray array, jsize start, jsize len, const jshort* buf) { + unimplemented("SetShortArrayRegion"); } -jint *GetIntArrayElements(JNIEnv *env, jintArray array, jboolean *isCopy) { - puts("Unimplemented JNI method GetIntArrayElements"); - std::exit(1); +void SetIntArrayRegion(JNIEnv* env, jintArray array, jsize start, jsize len, const jint* buf) { + unimplemented("SetIntArrayRegion"); } -jlong *GetLongArrayElements(JNIEnv *env, jlongArray array, jboolean *isCopy) { - puts("Unimplemented JNI method GetLongArrayElements"); - std::exit(1); +void SetLongArrayRegion(JNIEnv* env, jlongArray array, jsize start, jsize len, const jlong* buf) { + unimplemented("SetLongArrayRegion"); } -jfloat *GetFloatArrayElements(JNIEnv *env, jfloatArray array, - jboolean *isCopy) { - puts("Unimplemented JNI method GetFloatArrayElements"); - std::exit(1); +void SetFloatArrayRegion(JNIEnv* env, jfloatArray array, jsize start, jsize len, const jfloat* buf) { + unimplemented("SetFloatArrayRegion"); } -jdouble *GetDoubleArrayElements(JNIEnv *env, jdoubleArray array, - jboolean *isCopy) { - puts("Unimplemented JNI method GetDoubleArrayElements"); - std::exit(1); -} -void ReleaseBooleanArrayElements(JNIEnv *env, jbooleanArray array, - jboolean *elems, jint mode) { - puts("Unimplemented JNI method ReleaseBooleanArrayElements"); - std::exit(1); -} -void ReleaseByteArrayElements(JNIEnv *env, jbyteArray array, jbyte *elems, - jint mode) { - puts("Unimplemented JNI method ReleaseByteArrayElements"); - std::exit(1); -} -void ReleaseCharArrayElements(JNIEnv *env, jcharArray array, jchar *elems, - jint mode) { - puts("Unimplemented JNI method ReleaseCharArrayElements"); - std::exit(1); -} -void ReleaseShortArrayElements(JNIEnv *env, jshortArray array, jshort *elems, - jint mode) { - puts("Unimplemented JNI method ReleaseShortArrayElements"); - std::exit(1); -} -void ReleaseIntArrayElements(JNIEnv *env, jintArray array, jint *elems, - jint mode) { - puts("Unimplemented JNI method ReleaseIntArrayElements"); - std::exit(1); -} -void ReleaseLongArrayElements(JNIEnv *env, jlongArray array, jlong *elems, - jint mode) { - puts("Unimplemented JNI method ReleaseLongArrayElements"); - std::exit(1); -} -void ReleaseFloatArrayElements(JNIEnv *env, jfloatArray array, jfloat *elems, - jint mode) { - puts("Unimplemented JNI method ReleaseFloatArrayElements"); - std::exit(1); -} -void ReleaseDoubleArrayElements(JNIEnv *env, jdoubleArray array, jdouble *elems, - jint mode) { - puts("Unimplemented JNI method ReleaseDoubleArrayElements"); - std::exit(1); -} -void GetBooleanArrayRegion(JNIEnv *env, jbooleanArray array, jsize start, - jsize l, jboolean *buf) { - puts("Unimplemented JNI method GetBooleanArrayRegion"); - std::exit(1); -} -void GetByteArrayRegion(JNIEnv *env, jbyteArray array, jsize start, jsize len, - jbyte *buf) { - puts("Unimplemented JNI method GetByteArrayRegion"); - std::exit(1); -} -void GetCharArrayRegion(JNIEnv *env, jcharArray array, jsize start, jsize len, - jchar *buf) { - puts("Unimplemented JNI method GetCharArrayRegion"); - std::exit(1); -} -void GetShortArrayRegion(JNIEnv *env, jshortArray array, jsize start, jsize len, - jshort *buf) { - puts("Unimplemented JNI method GetShortArrayRegion"); - std::exit(1); -} -void GetIntArrayRegion(JNIEnv *env, jintArray array, jsize start, jsize len, - jint *buf) { - puts("Unimplemented JNI method GetIntArrayRegion"); - std::exit(1); -} -void GetLongArrayRegion(JNIEnv *env, jlongArray array, jsize start, jsize len, - jlong *buf) { - puts("Unimplemented JNI method GetLongArrayRegion"); - std::exit(1); -} -void GetFloatArrayRegion(JNIEnv *env, jfloatArray array, jsize start, jsize len, - jfloat *buf) { - puts("Unimplemented JNI method GetFloatArrayRegion"); - std::exit(1); -} -void GetDoubleArrayRegion(JNIEnv *env, jdoubleArray array, jsize start, - jsize len, jdouble *buf) { - puts("Unimplemented JNI method GetDoubleArrayRegion"); - std::exit(1); -} -void SetBooleanArrayRegion(JNIEnv *env, jbooleanArray array, jsize start, - jsize l, const jboolean *buf) { - puts("Unimplemented JNI method SetBooleanArrayRegion"); - std::exit(1); -} -void SetByteArrayRegion(JNIEnv *env, jbyteArray array, jsize start, jsize len, - const jbyte *buf) { - puts("Unimplemented JNI method SetByteArrayRegion"); - std::exit(1); -} -void SetCharArrayRegion(JNIEnv *env, jcharArray array, jsize start, jsize len, - const jchar *buf) { - puts("Unimplemented JNI method SetCharArrayRegion"); - std::exit(1); -} -void SetShortArrayRegion(JNIEnv *env, jshortArray array, jsize start, jsize len, - const jshort *buf) { - puts("Unimplemented JNI method SetShortArrayRegion"); - std::exit(1); -} -void SetIntArrayRegion(JNIEnv *env, jintArray array, jsize start, jsize len, - const jint *buf) { - puts("Unimplemented JNI method SetIntArrayRegion"); - std::exit(1); -} -void SetLongArrayRegion(JNIEnv *env, jlongArray array, jsize start, jsize len, - const jlong *buf) { - puts("Unimplemented JNI method SetLongArrayRegion"); - std::exit(1); -} -void SetFloatArrayRegion(JNIEnv *env, jfloatArray array, jsize start, jsize len, - const jfloat *buf) { - puts("Unimplemented JNI method SetFloatArrayRegion"); - std::exit(1); -} -void SetDoubleArrayRegion(JNIEnv *env, jdoubleArray array, jsize start, - jsize len, const jdouble *buf) { - puts("Unimplemented JNI method SetDoubleArrayRegion"); - std::exit(1); +void SetDoubleArrayRegion(JNIEnv* env, jdoubleArray array, jsize start, jsize len, const jdouble* buf) { + unimplemented("SetDoubleArrayRegion"); } -jint RegisterNatives(JNIEnv *env, jclass clazz, const JNINativeMethod *methods, - jint nMethods) { - auto *data = getData(env); - for (int i = 0; i < nMethods; i++) { - auto method = methods[i]; - auto key = std::string(method.name) + ";" + method.signature; - data->registered_natives.insert_or_assign(key, method.fnPtr); - } - for (auto [k, v] : data->registered_natives) { - printf("%s -> %p\n", k.data(), v); - } - - return 0; -} -jint UnregisterNatives(JNIEnv *env, jclass clazz) { - puts("Unimplemented JNI method UnregisterNatives"); - std::exit(1); -} -jint MonitorEnter(JNIEnv *env, jobject obj) { - puts("Unimplemented JNI method MonitorEnter"); - std::exit(1); -} -jint MonitorExit(JNIEnv *env, jobject obj) { - puts("Unimplemented JNI method MonitorExit"); - std::exit(1); -} -jint GetJavaVM(JNIEnv *env, JavaVM **vm) { - puts("Unimplemented JNI method GetJavaVM"); - std::exit(1); -} -void GetStringRegion(JNIEnv *env, jstring str, jsize start, jsize len, - jchar *buf) { - puts("Unimplemented JNI method GetStringRegion"); - std::exit(1); -} -void GetStringUTFRegion(JNIEnv *env, jstring str, jsize start, jsize len, - char *buf) { - puts("Unimplemented JNI method GetStringUTFRegion"); - std::exit(1); -} -void *GetPrimitiveArrayCritical(JNIEnv *env, jarray array, jboolean *isCopy) { - puts("Unimplemented JNI method GetPrimitiveArrayCritical"); - std::exit(1); -} -void ReleasePrimitiveArrayCritical(JNIEnv *env, jarray array, void *carray, - jint mode) { - puts("Unimplemented JNI method ReleasePrimitiveArrayCritical"); - std::exit(1); -} -const jchar *GetStringCritical(JNIEnv *env, jstring string, jboolean *isCopy) { - puts("Unimplemented JNI method GetStringCritical"); - std::exit(1); -} -void ReleaseStringCritical(JNIEnv *env, jstring string, const jchar *cstring) { - puts("Unimplemented JNI method ReleaseStringCritical"); - std::exit(1); -} -jweak NewWeakGlobalRef(JNIEnv *env, jobject obj) { - puts("Unimplemented JNI method NewWeakGlobalRef"); - std::exit(1); -} -void DeleteWeakGlobalRef(JNIEnv *env, jweak ref) { - puts("Unimplemented JNI method DeleteWeakGlobalRef"); - std::exit(1); -} -jboolean ExceptionCheck(JNIEnv *env) { - puts("Unimplemented JNI method ExceptionCheck"); - std::exit(1); -} -jobject NewDirectByteBuffer(JNIEnv *env, void *address, jlong capacity) { - puts("Unimplemented JNI method NewDirectByteBuffer"); - std::exit(1); -} -void *GetDirectBufferAddress(JNIEnv *env, jobject buf) { - puts("Unimplemented JNI method GetDirectBufferAddress"); - std::exit(1); -} -jlong GetDirectBufferCapacity(JNIEnv *env, jobject buf) { - puts("Unimplemented JNI method GetDirectBufferCapacity"); - std::exit(1); -} -jobjectRefType GetObjectRefType(JNIEnv *env, jobject obj) { - puts("Unimplemented JNI method GetObjectRefType"); - std::exit(1); -} -jobject GetModule(JNIEnv *env, jclass clazz) { - puts("Unimplemented JNI method GetModule"); - std::exit(1); -} -jboolean IsVirtualThread(JNIEnv *env, jobject obj) { - puts("Unimplemented JNI method IsVirtualThread"); - std::exit(1); -} +jint UnregisterNatives(JNIEnv* env, jclass clazz) { unimplemented("UnregisterNatives"); } +jint MonitorEnter(JNIEnv* env, jobject obj) { unimplemented("MonitorEnter"); } +jint MonitorExit(JNIEnv* env, jobject obj) { unimplemented("MonitorExit"); } +jint GetJavaVM(JNIEnv* env, JavaVM** vm) { unimplemented("GetJavaVM"); } +void GetStringRegion(JNIEnv* env, jstring str, jsize start, jsize len, jchar* buf) { unimplemented("GetStringRegion"); } +void GetStringUTFRegion(JNIEnv* env, jstring str, jsize start, jsize len, char* buf) { + unimplemented("GetStringUTFRegion"); +} +void* GetPrimitiveArrayCritical(JNIEnv* env, jarray array, jboolean* isCopy) { + unimplemented("GetPrimitiveArrayCritical"); +} +void ReleasePrimitiveArrayCritical(JNIEnv* env, jarray array, void* carray, jint mode) { + unimplemented("ReleasePrimitiveArrayCritical"); +} +const jchar* GetStringCritical(JNIEnv* env, jstring string, jboolean* isCopy) { unimplemented("GetStringCritical"); } +void ReleaseStringCritical(JNIEnv* env, jstring string, const jchar* cstring) { + unimplemented("ReleaseStringCritical"); +} +jweak NewWeakGlobalRef(JNIEnv* env, jobject obj) { unimplemented("NewWeakGlobalRef"); } +void DeleteWeakGlobalRef(JNIEnv* env, jweak ref) { unimplemented("DeleteWeakGlobalRef"); } +jboolean ExceptionCheck(JNIEnv* env) { unimplemented("ExceptionCheck"); } +jobject NewDirectByteBuffer(JNIEnv* env, void* address, jlong capacity) { unimplemented("NewDirectByteBuffer"); } +void* GetDirectBufferAddress(JNIEnv* env, jobject buf) { unimplemented("GetDirectBufferAddress"); } +jlong GetDirectBufferCapacity(JNIEnv* env, jobject buf) { unimplemented("GetDirectBufferCapacity"); } +jobjectRefType GetObjectRefType(JNIEnv* env, jobject obj) { unimplemented("GetObjectRefType"); } +jobject GetModule(JNIEnv* env, jclass clazz) { unimplemented("GetModule"); } +jboolean IsVirtualThread(JNIEnv* env, jobject obj) { unimplemented("IsVirtualThread"); } } // namespace jvmilia \ No newline at end of file diff --git a/lib/exec/jni.h b/lib/exec/jni.h index 19e215c..9bb2d4a 100644 --- a/lib/exec/jni.h +++ b/lib/exec/jni.h @@ -5,7 +5,7 @@ #include extern "C" { -using JNIEnv = const struct JNINativeInterface *; +using JNIEnv = const struct JNINativeInterface*; using jint = int; using jlong = long; using jboolean = unsigned char; @@ -31,27 +31,27 @@ class _jfloatArray : public _jarray {}; class _jdoubleArray : public _jarray {}; class _jobjectArray : public _jarray {}; -using jobject = _jobject *; -using jclass = _jclass *; -using jthrowable = _jthrowable *; -using jstring = _jstring *; -using jarray = _jarray *; -using jbooleanArray = _jbooleanArray *; -using jbyteArray = _jbyteArray *; -using jcharArray = _jcharArray *; -using jshortArray = _jshortArray *; -using jintArray = _jintArray *; -using jlongArray = _jlongArray *; -using jfloatArray = _jfloatArray *; -using jdoubleArray = _jdoubleArray *; -using jobjectArray = _jobjectArray *; +using jobject = _jobject*; +using jclass = _jclass*; +using jthrowable = _jthrowable*; +using jstring = _jstring*; +using jarray = _jarray*; +using jbooleanArray = _jbooleanArray*; +using jbyteArray = _jbyteArray*; +using jcharArray = _jcharArray*; +using jshortArray = _jshortArray*; +using jintArray = _jintArray*; +using jlongArray = _jlongArray*; +using jfloatArray = _jfloatArray*; +using jdoubleArray = _jdoubleArray*; +using jobjectArray = _jobjectArray*; using jweak = jobject; struct _jmethodID; -using jmethodID = _jmethodID *; +using jmethodID = _jmethodID*; struct _jfieldID; -using jfieldID = _jfieldID *; +using jfieldID = _jfieldID*; union jvalue { jboolean z; @@ -66,846 +66,572 @@ union jvalue { }; struct JNINativeMethod { - char *name; - char *signature; - void *fnPtr; + char* name; + char* signature; + void* fnPtr; }; struct JavaVM_; -using JavaVM = JavaVM_ *; +using JavaVM = JavaVM_*; -enum jobjectRefType { - JNIInvalidRefType = 0, - JNILocalRefType = 1, - JNIGlobalRefType = 2, - JNIWeakGlobalRefType = 3 -}; +enum jobjectRefType { JNIInvalidRefType = 0, JNILocalRefType = 1, JNIGlobalRefType = 2, JNIWeakGlobalRefType = 3 }; struct JNINativeInterface { - void *reserved0; - void *reserved1; - void *reserved2; - - void *reserved3; - jint (*GetVersion)(JNIEnv *env); - - jclass (*DefineClass)(JNIEnv *env, const char *name, jobject loader, - const jbyte *buf, jsize len); - jclass (*FindClass)(JNIEnv *env, const char *name); - - jmethodID (*FromReflectedMethod)(JNIEnv *env, jobject method); - jfieldID (*FromReflectedField)(JNIEnv *env, jobject field); - - jobject (*ToReflectedMethod)(JNIEnv *env, jclass cls, jmethodID methodID, - jboolean isStatic); - - jclass (*GetSuperclass)(JNIEnv *env, jclass sub); - jboolean (*IsAssignableFrom)(JNIEnv *env, jclass sub, jclass sup); - - jobject (*ToReflectedField)(JNIEnv *env, jclass cls, jfieldID fieldID, - jboolean isStatic); - - jint (*Throw)(JNIEnv *env, jthrowable obj); - jint (*ThrowNew)(JNIEnv *env, jclass clazz, const char *msg); - jthrowable (*ExceptionOccurred)(JNIEnv *env); - void (*ExceptionDescribe)(JNIEnv *env); - void (*ExceptionClear)(JNIEnv *env); - void (*FatalError)(JNIEnv *env, const char *msg); - - jint (*PushLocalFrame)(JNIEnv *env, jint capacity); - jobject (*PopLocalFrame)(JNIEnv *env, jobject result); - - jobject (*NewGlobalRef)(JNIEnv *env, jobject lobj); - void (*DeleteGlobalRef)(JNIEnv *env, jobject gref); - void (*DeleteLocalRef)(JNIEnv *env, jobject obj); - jboolean (*IsSameObject)(JNIEnv *env, jobject obj1, jobject obj2); - jobject (*NewLocalRef)(JNIEnv *env, jobject ref); - jint (*EnsureLocalCapacity)(JNIEnv *env, jint capacity); - - jobject (*AllocObject)(JNIEnv *env, jclass clazz); - jobject (*NewObject)(JNIEnv *env, jclass clazz, jmethodID methodID, ...); - jobject (*NewObjectV)(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args); - jobject (*NewObjectA)(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); - - jclass (*GetObjectClass)(JNIEnv *env, jobject obj); - jboolean (*IsInstanceOf)(JNIEnv *env, jobject obj, jclass clazz); - - jmethodID (*GetMethodID)(JNIEnv *env, jclass clazz, const char *name, - const char *sig); - - jobject (*CallObjectMethod)(JNIEnv *env, jobject obj, jmethodID methodID, - ...); - jobject (*CallObjectMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); - jobject (*CallObjectMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); - - jboolean (*CallBooleanMethod)(JNIEnv *env, jobject obj, jmethodID methodID, - ...); - jboolean (*CallBooleanMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); - jboolean (*CallBooleanMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); - - jbyte (*CallByteMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); - jbyte (*CallByteMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); - jbyte (*CallByteMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); - - jchar (*CallCharMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); - jchar (*CallCharMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); - jchar (*CallCharMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); - - jshort (*CallShortMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); - jshort (*CallShortMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); - jshort (*CallShortMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); - - jint (*CallIntMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); - jint (*CallIntMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); - jint (*CallIntMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); - - jlong (*CallLongMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); - jlong (*CallLongMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); - jlong (*CallLongMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); - - jfloat (*CallFloatMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); - jfloat (*CallFloatMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); - jfloat (*CallFloatMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); - - jdouble (*CallDoubleMethod)(JNIEnv *env, jobject obj, jmethodID methodID, - ...); - jdouble (*CallDoubleMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); - jdouble (*CallDoubleMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); - - void (*CallVoidMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); - void (*CallVoidMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); - void (*CallVoidMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); - - jobject (*CallNonvirtualObjectMethod)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); - jobject (*CallNonvirtualObjectMethodV)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); - jobject (*CallNonvirtualObjectMethodA)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, - const jvalue *args); - - jboolean (*CallNonvirtualBooleanMethod)(JNIEnv *env, jobject obj, - jclass clazz, jmethodID methodID, - ...); - jboolean (*CallNonvirtualBooleanMethodV)(JNIEnv *env, jobject obj, - jclass clazz, jmethodID methodID, - va_list args); - jboolean (*CallNonvirtualBooleanMethodA)(JNIEnv *env, jobject obj, - jclass clazz, jmethodID methodID, - const jvalue *args); - - jbyte (*CallNonvirtualByteMethod)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); - jbyte (*CallNonvirtualByteMethodV)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); - jbyte (*CallNonvirtualByteMethodA)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); - - jchar (*CallNonvirtualCharMethod)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); - jchar (*CallNonvirtualCharMethodV)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); - jchar (*CallNonvirtualCharMethodA)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); - - jshort (*CallNonvirtualShortMethod)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); - jshort (*CallNonvirtualShortMethodV)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); - jshort (*CallNonvirtualShortMethodA)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); - - jint (*CallNonvirtualIntMethod)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); - jint (*CallNonvirtualIntMethodV)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); - jint (*CallNonvirtualIntMethodA)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); - - jlong (*CallNonvirtualLongMethod)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); - jlong (*CallNonvirtualLongMethodV)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); - jlong (*CallNonvirtualLongMethodA)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); - - jfloat (*CallNonvirtualFloatMethod)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); - jfloat (*CallNonvirtualFloatMethodV)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); - jfloat (*CallNonvirtualFloatMethodA)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); - - jdouble (*CallNonvirtualDoubleMethod)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); - jdouble (*CallNonvirtualDoubleMethodV)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); - jdouble (*CallNonvirtualDoubleMethodA)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, - const jvalue *args); - - void (*CallNonvirtualVoidMethod)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); - void (*CallNonvirtualVoidMethodV)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); - void (*CallNonvirtualVoidMethodA)(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); - - jfieldID (*GetFieldID)(JNIEnv *env, jclass clazz, const char *name, - const char *sig); - - jobject (*GetObjectField)(JNIEnv *env, jobject obj, jfieldID fieldID); - jboolean (*GetBooleanField)(JNIEnv *env, jobject obj, jfieldID fieldID); - jbyte (*GetByteField)(JNIEnv *env, jobject obj, jfieldID fieldID); - jchar (*GetCharField)(JNIEnv *env, jobject obj, jfieldID fieldID); - jshort (*GetShortField)(JNIEnv *env, jobject obj, jfieldID fieldID); - jint (*GetIntField)(JNIEnv *env, jobject obj, jfieldID fieldID); - jlong (*GetLongField)(JNIEnv *env, jobject obj, jfieldID fieldID); - jfloat (*GetFloatField)(JNIEnv *env, jobject obj, jfieldID fieldID); - jdouble (*GetDoubleField)(JNIEnv *env, jobject obj, jfieldID fieldID); - - void (*SetObjectField)(JNIEnv *env, jobject obj, jfieldID fieldID, - jobject val); - void (*SetBooleanField)(JNIEnv *env, jobject obj, jfieldID fieldID, - jboolean val); - void (*SetByteField)(JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val); - void (*SetCharField)(JNIEnv *env, jobject obj, jfieldID fieldID, jchar val); - void (*SetShortField)(JNIEnv *env, jobject obj, jfieldID fieldID, jshort val); - void (*SetIntField)(JNIEnv *env, jobject obj, jfieldID fieldID, jint val); - void (*SetLongField)(JNIEnv *env, jobject obj, jfieldID fieldID, jlong val); - void (*SetFloatField)(JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val); - void (*SetDoubleField)(JNIEnv *env, jobject obj, jfieldID fieldID, - jdouble val); - - jmethodID (*GetStaticMethodID)(JNIEnv *env, jclass clazz, const char *name, - const char *sig); - - jobject (*CallStaticObjectMethod)(JNIEnv *env, jclass clazz, - jmethodID methodID, ...); - jobject (*CallStaticObjectMethodV)(JNIEnv *env, jclass clazz, - jmethodID methodID, va_list args); - jobject (*CallStaticObjectMethodA)(JNIEnv *env, jclass clazz, - jmethodID methodID, const jvalue *args); - - jboolean (*CallStaticBooleanMethod)(JNIEnv *env, jclass clazz, - jmethodID methodID, ...); - jboolean (*CallStaticBooleanMethodV)(JNIEnv *env, jclass clazz, - jmethodID methodID, va_list args); - jboolean (*CallStaticBooleanMethodA)(JNIEnv *env, jclass clazz, - jmethodID methodID, const jvalue *args); - - jbyte (*CallStaticByteMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, - ...); - jbyte (*CallStaticByteMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args); - jbyte (*CallStaticByteMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); - - jchar (*CallStaticCharMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, - ...); - jchar (*CallStaticCharMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args); - jchar (*CallStaticCharMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); - - jshort (*CallStaticShortMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, - ...); - jshort (*CallStaticShortMethodV)(JNIEnv *env, jclass clazz, - jmethodID methodID, va_list args); - jshort (*CallStaticShortMethodA)(JNIEnv *env, jclass clazz, - jmethodID methodID, const jvalue *args); - - jint (*CallStaticIntMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, - ...); - jint (*CallStaticIntMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args); - jint (*CallStaticIntMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); - - jlong (*CallStaticLongMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, - ...); - jlong (*CallStaticLongMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args); - jlong (*CallStaticLongMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); - - jfloat (*CallStaticFloatMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, - ...); - jfloat (*CallStaticFloatMethodV)(JNIEnv *env, jclass clazz, - jmethodID methodID, va_list args); - jfloat (*CallStaticFloatMethodA)(JNIEnv *env, jclass clazz, - jmethodID methodID, const jvalue *args); - - jdouble (*CallStaticDoubleMethod)(JNIEnv *env, jclass clazz, - jmethodID methodID, ...); - jdouble (*CallStaticDoubleMethodV)(JNIEnv *env, jclass clazz, - jmethodID methodID, va_list args); - jdouble (*CallStaticDoubleMethodA)(JNIEnv *env, jclass clazz, - jmethodID methodID, const jvalue *args); - - void (*CallStaticVoidMethod)(JNIEnv *env, jclass cls, jmethodID methodID, - ...); - void (*CallStaticVoidMethodV)(JNIEnv *env, jclass cls, jmethodID methodID, - va_list args); - void (*CallStaticVoidMethodA)(JNIEnv *env, jclass cls, jmethodID methodID, - const jvalue *args); - - jfieldID (*GetStaticFieldID)(JNIEnv *env, jclass clazz, const char *name, - const char *sig); - jobject (*GetStaticObjectField)(JNIEnv *env, jclass clazz, jfieldID fieldID); - jboolean (*GetStaticBooleanField)(JNIEnv *env, jclass clazz, - jfieldID fieldID); - jbyte (*GetStaticByteField)(JNIEnv *env, jclass clazz, jfieldID fieldID); - jchar (*GetStaticCharField)(JNIEnv *env, jclass clazz, jfieldID fieldID); - jshort (*GetStaticShortField)(JNIEnv *env, jclass clazz, jfieldID fieldID); - jint (*GetStaticIntField)(JNIEnv *env, jclass clazz, jfieldID fieldID); - jlong (*GetStaticLongField)(JNIEnv *env, jclass clazz, jfieldID fieldID); - jfloat (*GetStaticFloatField)(JNIEnv *env, jclass clazz, jfieldID fieldID); - jdouble (*GetStaticDoubleField)(JNIEnv *env, jclass clazz, jfieldID fieldID); - - void (*SetStaticObjectField)(JNIEnv *env, jclass clazz, jfieldID fieldID, - jobject value); - void (*SetStaticBooleanField)(JNIEnv *env, jclass clazz, jfieldID fieldID, - jboolean value); - void (*SetStaticByteField)(JNIEnv *env, jclass clazz, jfieldID fieldID, - jbyte value); - void (*SetStaticCharField)(JNIEnv *env, jclass clazz, jfieldID fieldID, - jchar value); - void (*SetStaticShortField)(JNIEnv *env, jclass clazz, jfieldID fieldID, - jshort value); - void (*SetStaticIntField)(JNIEnv *env, jclass clazz, jfieldID fieldID, - jint value); - void (*SetStaticLongField)(JNIEnv *env, jclass clazz, jfieldID fieldID, - jlong value); - void (*SetStaticFloatField)(JNIEnv *env, jclass clazz, jfieldID fieldID, - jfloat value); - void (*SetStaticDoubleField)(JNIEnv *env, jclass clazz, jfieldID fieldID, - jdouble value); - - jstring (*NewString)(JNIEnv *env, const jchar *unicode, jsize len); - jsize (*GetStringLength)(JNIEnv *env, jstring str); - const jchar *(*GetStringChars)(JNIEnv *env, jstring str, jboolean *isCopy); - void (*ReleaseStringChars)(JNIEnv *env, jstring str, const jchar *chars); - - jstring (*NewStringUTF)(JNIEnv *env, const char *utf); - jsize (*GetStringUTFLength)(JNIEnv *env, jstring str); - const char *(*GetStringUTFChars)(JNIEnv *env, jstring str, jboolean *isCopy); - void (*ReleaseStringUTFChars)(JNIEnv *env, jstring str, const char *chars); - - jsize (*GetArrayLength)(JNIEnv *env, jarray array); - - jobjectArray (*NewObjectArray)(JNIEnv *env, jsize len, jclass clazz, - jobject init); - jobject (*GetObjectArrayElement)(JNIEnv *env, jobjectArray array, - jsize index); - void (*SetObjectArrayElement)(JNIEnv *env, jobjectArray array, jsize index, - jobject val); - - jbooleanArray (*NewBooleanArray)(JNIEnv *env, jsize len); - jbyteArray (*NewByteArray)(JNIEnv *env, jsize len); - jcharArray (*NewCharArray)(JNIEnv *env, jsize len); - jshortArray (*NewShortArray)(JNIEnv *env, jsize len); - jintArray (*NewIntArray)(JNIEnv *env, jsize len); - jlongArray (*NewLongArray)(JNIEnv *env, jsize len); - jfloatArray (*NewFloatArray)(JNIEnv *env, jsize len); - jdoubleArray (*NewDoubleArray)(JNIEnv *env, jsize len); - - jboolean *(*GetBooleanArrayElements)(JNIEnv *env, jbooleanArray array, - jboolean *isCopy); - jbyte *(*GetByteArrayElements)(JNIEnv *env, jbyteArray array, - jboolean *isCopy); - jchar *(*GetCharArrayElements)(JNIEnv *env, jcharArray array, - jboolean *isCopy); - jshort *(*GetShortArrayElements)(JNIEnv *env, jshortArray array, - jboolean *isCopy); - jint *(*GetIntArrayElements)(JNIEnv *env, jintArray array, jboolean *isCopy); - jlong *(*GetLongArrayElements)(JNIEnv *env, jlongArray array, - jboolean *isCopy); - jfloat *(*GetFloatArrayElements)(JNIEnv *env, jfloatArray array, - jboolean *isCopy); - jdouble *(*GetDoubleArrayElements)(JNIEnv *env, jdoubleArray array, - jboolean *isCopy); - - void (*ReleaseBooleanArrayElements)(JNIEnv *env, jbooleanArray array, - jboolean *elems, jint mode); - void (*ReleaseByteArrayElements)(JNIEnv *env, jbyteArray array, jbyte *elems, - jint mode); - void (*ReleaseCharArrayElements)(JNIEnv *env, jcharArray array, jchar *elems, - jint mode); - void (*ReleaseShortArrayElements)(JNIEnv *env, jshortArray array, - jshort *elems, jint mode); - void (*ReleaseIntArrayElements)(JNIEnv *env, jintArray array, jint *elems, - jint mode); - void (*ReleaseLongArrayElements)(JNIEnv *env, jlongArray array, jlong *elems, - jint mode); - void (*ReleaseFloatArrayElements)(JNIEnv *env, jfloatArray array, - jfloat *elems, jint mode); - void (*ReleaseDoubleArrayElements)(JNIEnv *env, jdoubleArray array, - jdouble *elems, jint mode); - - void (*GetBooleanArrayRegion)(JNIEnv *env, jbooleanArray array, jsize start, - jsize l, jboolean *buf); - void (*GetByteArrayRegion)(JNIEnv *env, jbyteArray array, jsize start, - jsize len, jbyte *buf); - void (*GetCharArrayRegion)(JNIEnv *env, jcharArray array, jsize start, - jsize len, jchar *buf); - void (*GetShortArrayRegion)(JNIEnv *env, jshortArray array, jsize start, - jsize len, jshort *buf); - void (*GetIntArrayRegion)(JNIEnv *env, jintArray array, jsize start, - jsize len, jint *buf); - void (*GetLongArrayRegion)(JNIEnv *env, jlongArray array, jsize start, - jsize len, jlong *buf); - void (*GetFloatArrayRegion)(JNIEnv *env, jfloatArray array, jsize start, - jsize len, jfloat *buf); - void (*GetDoubleArrayRegion)(JNIEnv *env, jdoubleArray array, jsize start, - jsize len, jdouble *buf); - - void (*SetBooleanArrayRegion)(JNIEnv *env, jbooleanArray array, jsize start, - jsize l, const jboolean *buf); - void (*SetByteArrayRegion)(JNIEnv *env, jbyteArray array, jsize start, - jsize len, const jbyte *buf); - void (*SetCharArrayRegion)(JNIEnv *env, jcharArray array, jsize start, - jsize len, const jchar *buf); - void (*SetShortArrayRegion)(JNIEnv *env, jshortArray array, jsize start, - jsize len, const jshort *buf); - void (*SetIntArrayRegion)(JNIEnv *env, jintArray array, jsize start, - jsize len, const jint *buf); - void (*SetLongArrayRegion)(JNIEnv *env, jlongArray array, jsize start, - jsize len, const jlong *buf); - void (*SetFloatArrayRegion)(JNIEnv *env, jfloatArray array, jsize start, - jsize len, const jfloat *buf); - void (*SetDoubleArrayRegion)(JNIEnv *env, jdoubleArray array, jsize start, - jsize len, const jdouble *buf); - - jint (*RegisterNatives)(JNIEnv *env, jclass clazz, - const JNINativeMethod *methods, jint nMethods); - jint (*UnregisterNatives)(JNIEnv *env, jclass clazz); - - jint (*MonitorEnter)(JNIEnv *env, jobject obj); - jint (*MonitorExit)(JNIEnv *env, jobject obj); - - jint (*GetJavaVM)(JNIEnv *env, JavaVM **vm); - - void (*GetStringRegion)(JNIEnv *env, jstring str, jsize start, jsize len, - jchar *buf); - void (*GetStringUTFRegion)(JNIEnv *env, jstring str, jsize start, jsize len, - char *buf); - - void *(*GetPrimitiveArrayCritical)(JNIEnv *env, jarray array, - jboolean *isCopy); - void (*ReleasePrimitiveArrayCritical)(JNIEnv *env, jarray array, void *carray, - jint mode); - - const jchar *(*GetStringCritical)(JNIEnv *env, jstring string, - jboolean *isCopy); - void (*ReleaseStringCritical)(JNIEnv *env, jstring string, - const jchar *cstring); - - jweak (*NewWeakGlobalRef)(JNIEnv *env, jobject obj); - void (*DeleteWeakGlobalRef)(JNIEnv *env, jweak ref); - - jboolean (*ExceptionCheck)(JNIEnv *env); - - jobject (*NewDirectByteBuffer)(JNIEnv *env, void *address, jlong capacity); - void *(*GetDirectBufferAddress)(JNIEnv *env, jobject buf); - jlong (*GetDirectBufferCapacity)(JNIEnv *env, jobject buf); + void* reserved0; + void* reserved1; + void* reserved2; + + void* reserved3; + jint (*GetVersion)(JNIEnv* env); + + jclass (*DefineClass)(JNIEnv* env, const char* name, jobject loader, const jbyte* buf, jsize len); + jclass (*FindClass)(JNIEnv* env, const char* name); + + jmethodID (*FromReflectedMethod)(JNIEnv* env, jobject method); + jfieldID (*FromReflectedField)(JNIEnv* env, jobject field); + + jobject (*ToReflectedMethod)(JNIEnv* env, jclass cls, jmethodID methodID, jboolean isStatic); + + jclass (*GetSuperclass)(JNIEnv* env, jclass sub); + jboolean (*IsAssignableFrom)(JNIEnv* env, jclass sub, jclass sup); + + jobject (*ToReflectedField)(JNIEnv* env, jclass cls, jfieldID fieldID, jboolean isStatic); + + jint (*Throw)(JNIEnv* env, jthrowable obj); + jint (*ThrowNew)(JNIEnv* env, jclass clazz, const char* msg); + jthrowable (*ExceptionOccurred)(JNIEnv* env); + void (*ExceptionDescribe)(JNIEnv* env); + void (*ExceptionClear)(JNIEnv* env); + void (*FatalError)(JNIEnv* env, const char* msg); + + jint (*PushLocalFrame)(JNIEnv* env, jint capacity); + jobject (*PopLocalFrame)(JNIEnv* env, jobject result); + + jobject (*NewGlobalRef)(JNIEnv* env, jobject lobj); + void (*DeleteGlobalRef)(JNIEnv* env, jobject gref); + void (*DeleteLocalRef)(JNIEnv* env, jobject obj); + jboolean (*IsSameObject)(JNIEnv* env, jobject obj1, jobject obj2); + jobject (*NewLocalRef)(JNIEnv* env, jobject ref); + jint (*EnsureLocalCapacity)(JNIEnv* env, jint capacity); + + jobject (*AllocObject)(JNIEnv* env, jclass clazz); + jobject (*NewObject)(JNIEnv* env, jclass clazz, jmethodID methodID, ...); + jobject (*NewObjectV)(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); + jobject (*NewObjectA)(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); + + jclass (*GetObjectClass)(JNIEnv* env, jobject obj); + jboolean (*IsInstanceOf)(JNIEnv* env, jobject obj, jclass clazz); + + jmethodID (*GetMethodID)(JNIEnv* env, jclass clazz, const char* name, const char* sig); + + jobject (*CallObjectMethod)(JNIEnv* env, jobject obj, jmethodID methodID, ...); + jobject (*CallObjectMethodV)(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); + jobject (*CallObjectMethodA)(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); + + jboolean (*CallBooleanMethod)(JNIEnv* env, jobject obj, jmethodID methodID, ...); + jboolean (*CallBooleanMethodV)(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); + jboolean (*CallBooleanMethodA)(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); + + jbyte (*CallByteMethod)(JNIEnv* env, jobject obj, jmethodID methodID, ...); + jbyte (*CallByteMethodV)(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); + jbyte (*CallByteMethodA)(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); + + jchar (*CallCharMethod)(JNIEnv* env, jobject obj, jmethodID methodID, ...); + jchar (*CallCharMethodV)(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); + jchar (*CallCharMethodA)(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); + + jshort (*CallShortMethod)(JNIEnv* env, jobject obj, jmethodID methodID, ...); + jshort (*CallShortMethodV)(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); + jshort (*CallShortMethodA)(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); + + jint (*CallIntMethod)(JNIEnv* env, jobject obj, jmethodID methodID, ...); + jint (*CallIntMethodV)(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); + jint (*CallIntMethodA)(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); + + jlong (*CallLongMethod)(JNIEnv* env, jobject obj, jmethodID methodID, ...); + jlong (*CallLongMethodV)(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); + jlong (*CallLongMethodA)(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); + + jfloat (*CallFloatMethod)(JNIEnv* env, jobject obj, jmethodID methodID, ...); + jfloat (*CallFloatMethodV)(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); + jfloat (*CallFloatMethodA)(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); + + jdouble (*CallDoubleMethod)(JNIEnv* env, jobject obj, jmethodID methodID, ...); + jdouble (*CallDoubleMethodV)(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); + jdouble (*CallDoubleMethodA)(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); + + void (*CallVoidMethod)(JNIEnv* env, jobject obj, jmethodID methodID, ...); + void (*CallVoidMethodV)(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); + void (*CallVoidMethodA)(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); + + jobject (*CallNonvirtualObjectMethod)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); + jobject (*CallNonvirtualObjectMethodV)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); + jobject (*CallNonvirtualObjectMethodA)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue* args); + + jboolean (*CallNonvirtualBooleanMethod)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); + jboolean (*CallNonvirtualBooleanMethodV)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); + jboolean (*CallNonvirtualBooleanMethodA)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue* args); + + jbyte (*CallNonvirtualByteMethod)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); + jbyte (*CallNonvirtualByteMethodV)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); + jbyte (*CallNonvirtualByteMethodA)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); + + jchar (*CallNonvirtualCharMethod)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); + jchar (*CallNonvirtualCharMethodV)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); + jchar (*CallNonvirtualCharMethodA)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); + + jshort (*CallNonvirtualShortMethod)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); + jshort (*CallNonvirtualShortMethodV)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); + jshort (*CallNonvirtualShortMethodA)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); + + jint (*CallNonvirtualIntMethod)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); + jint (*CallNonvirtualIntMethodV)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); + jint (*CallNonvirtualIntMethodA)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); + + jlong (*CallNonvirtualLongMethod)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); + jlong (*CallNonvirtualLongMethodV)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); + jlong (*CallNonvirtualLongMethodA)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); + + jfloat (*CallNonvirtualFloatMethod)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); + jfloat (*CallNonvirtualFloatMethodV)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); + jfloat (*CallNonvirtualFloatMethodA)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); + + jdouble (*CallNonvirtualDoubleMethod)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); + jdouble (*CallNonvirtualDoubleMethodV)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); + jdouble (*CallNonvirtualDoubleMethodA)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, + const jvalue* args); + + void (*CallNonvirtualVoidMethod)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); + void (*CallNonvirtualVoidMethodV)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); + void (*CallNonvirtualVoidMethodA)(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); + + jfieldID (*GetFieldID)(JNIEnv* env, jclass clazz, const char* name, const char* sig); + + jobject (*GetObjectField)(JNIEnv* env, jobject obj, jfieldID fieldID); + jboolean (*GetBooleanField)(JNIEnv* env, jobject obj, jfieldID fieldID); + jbyte (*GetByteField)(JNIEnv* env, jobject obj, jfieldID fieldID); + jchar (*GetCharField)(JNIEnv* env, jobject obj, jfieldID fieldID); + jshort (*GetShortField)(JNIEnv* env, jobject obj, jfieldID fieldID); + jint (*GetIntField)(JNIEnv* env, jobject obj, jfieldID fieldID); + jlong (*GetLongField)(JNIEnv* env, jobject obj, jfieldID fieldID); + jfloat (*GetFloatField)(JNIEnv* env, jobject obj, jfieldID fieldID); + jdouble (*GetDoubleField)(JNIEnv* env, jobject obj, jfieldID fieldID); + + void (*SetObjectField)(JNIEnv* env, jobject obj, jfieldID fieldID, jobject val); + void (*SetBooleanField)(JNIEnv* env, jobject obj, jfieldID fieldID, jboolean val); + void (*SetByteField)(JNIEnv* env, jobject obj, jfieldID fieldID, jbyte val); + void (*SetCharField)(JNIEnv* env, jobject obj, jfieldID fieldID, jchar val); + void (*SetShortField)(JNIEnv* env, jobject obj, jfieldID fieldID, jshort val); + void (*SetIntField)(JNIEnv* env, jobject obj, jfieldID fieldID, jint val); + void (*SetLongField)(JNIEnv* env, jobject obj, jfieldID fieldID, jlong val); + void (*SetFloatField)(JNIEnv* env, jobject obj, jfieldID fieldID, jfloat val); + void (*SetDoubleField)(JNIEnv* env, jobject obj, jfieldID fieldID, jdouble val); + + jmethodID (*GetStaticMethodID)(JNIEnv* env, jclass clazz, const char* name, const char* sig); + + jobject (*CallStaticObjectMethod)(JNIEnv* env, jclass clazz, jmethodID methodID, ...); + jobject (*CallStaticObjectMethodV)(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); + jobject (*CallStaticObjectMethodA)(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); + + jboolean (*CallStaticBooleanMethod)(JNIEnv* env, jclass clazz, jmethodID methodID, ...); + jboolean (*CallStaticBooleanMethodV)(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); + jboolean (*CallStaticBooleanMethodA)(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); + + jbyte (*CallStaticByteMethod)(JNIEnv* env, jclass clazz, jmethodID methodID, ...); + jbyte (*CallStaticByteMethodV)(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); + jbyte (*CallStaticByteMethodA)(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); + + jchar (*CallStaticCharMethod)(JNIEnv* env, jclass clazz, jmethodID methodID, ...); + jchar (*CallStaticCharMethodV)(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); + jchar (*CallStaticCharMethodA)(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); + + jshort (*CallStaticShortMethod)(JNIEnv* env, jclass clazz, jmethodID methodID, ...); + jshort (*CallStaticShortMethodV)(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); + jshort (*CallStaticShortMethodA)(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); + + jint (*CallStaticIntMethod)(JNIEnv* env, jclass clazz, jmethodID methodID, ...); + jint (*CallStaticIntMethodV)(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); + jint (*CallStaticIntMethodA)(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); + + jlong (*CallStaticLongMethod)(JNIEnv* env, jclass clazz, jmethodID methodID, ...); + jlong (*CallStaticLongMethodV)(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); + jlong (*CallStaticLongMethodA)(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); + + jfloat (*CallStaticFloatMethod)(JNIEnv* env, jclass clazz, jmethodID methodID, ...); + jfloat (*CallStaticFloatMethodV)(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); + jfloat (*CallStaticFloatMethodA)(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); + + jdouble (*CallStaticDoubleMethod)(JNIEnv* env, jclass clazz, jmethodID methodID, ...); + jdouble (*CallStaticDoubleMethodV)(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); + jdouble (*CallStaticDoubleMethodA)(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); + + void (*CallStaticVoidMethod)(JNIEnv* env, jclass cls, jmethodID methodID, ...); + void (*CallStaticVoidMethodV)(JNIEnv* env, jclass cls, jmethodID methodID, va_list args); + void (*CallStaticVoidMethodA)(JNIEnv* env, jclass cls, jmethodID methodID, const jvalue* args); + + jfieldID (*GetStaticFieldID)(JNIEnv* env, jclass clazz, const char* name, const char* sig); + jobject (*GetStaticObjectField)(JNIEnv* env, jclass clazz, jfieldID fieldID); + jboolean (*GetStaticBooleanField)(JNIEnv* env, jclass clazz, jfieldID fieldID); + jbyte (*GetStaticByteField)(JNIEnv* env, jclass clazz, jfieldID fieldID); + jchar (*GetStaticCharField)(JNIEnv* env, jclass clazz, jfieldID fieldID); + jshort (*GetStaticShortField)(JNIEnv* env, jclass clazz, jfieldID fieldID); + jint (*GetStaticIntField)(JNIEnv* env, jclass clazz, jfieldID fieldID); + jlong (*GetStaticLongField)(JNIEnv* env, jclass clazz, jfieldID fieldID); + jfloat (*GetStaticFloatField)(JNIEnv* env, jclass clazz, jfieldID fieldID); + jdouble (*GetStaticDoubleField)(JNIEnv* env, jclass clazz, jfieldID fieldID); + + void (*SetStaticObjectField)(JNIEnv* env, jclass clazz, jfieldID fieldID, jobject value); + void (*SetStaticBooleanField)(JNIEnv* env, jclass clazz, jfieldID fieldID, jboolean value); + void (*SetStaticByteField)(JNIEnv* env, jclass clazz, jfieldID fieldID, jbyte value); + void (*SetStaticCharField)(JNIEnv* env, jclass clazz, jfieldID fieldID, jchar value); + void (*SetStaticShortField)(JNIEnv* env, jclass clazz, jfieldID fieldID, jshort value); + void (*SetStaticIntField)(JNIEnv* env, jclass clazz, jfieldID fieldID, jint value); + void (*SetStaticLongField)(JNIEnv* env, jclass clazz, jfieldID fieldID, jlong value); + void (*SetStaticFloatField)(JNIEnv* env, jclass clazz, jfieldID fieldID, jfloat value); + void (*SetStaticDoubleField)(JNIEnv* env, jclass clazz, jfieldID fieldID, jdouble value); + + jstring (*NewString)(JNIEnv* env, const jchar* unicode, jsize len); + jsize (*GetStringLength)(JNIEnv* env, jstring str); + const jchar* (*GetStringChars)(JNIEnv* env, jstring str, jboolean* isCopy); + void (*ReleaseStringChars)(JNIEnv* env, jstring str, const jchar* chars); + + jstring (*NewStringUTF)(JNIEnv* env, const char* utf); + jsize (*GetStringUTFLength)(JNIEnv* env, jstring str); + const char* (*GetStringUTFChars)(JNIEnv* env, jstring str, jboolean* isCopy); + void (*ReleaseStringUTFChars)(JNIEnv* env, jstring str, const char* chars); + + jsize (*GetArrayLength)(JNIEnv* env, jarray array); + + jobjectArray (*NewObjectArray)(JNIEnv* env, jsize len, jclass clazz, jobject init); + jobject (*GetObjectArrayElement)(JNIEnv* env, jobjectArray array, jsize index); + void (*SetObjectArrayElement)(JNIEnv* env, jobjectArray array, jsize index, jobject val); + + jbooleanArray (*NewBooleanArray)(JNIEnv* env, jsize len); + jbyteArray (*NewByteArray)(JNIEnv* env, jsize len); + jcharArray (*NewCharArray)(JNIEnv* env, jsize len); + jshortArray (*NewShortArray)(JNIEnv* env, jsize len); + jintArray (*NewIntArray)(JNIEnv* env, jsize len); + jlongArray (*NewLongArray)(JNIEnv* env, jsize len); + jfloatArray (*NewFloatArray)(JNIEnv* env, jsize len); + jdoubleArray (*NewDoubleArray)(JNIEnv* env, jsize len); + + jboolean* (*GetBooleanArrayElements)(JNIEnv* env, jbooleanArray array, jboolean* isCopy); + jbyte* (*GetByteArrayElements)(JNIEnv* env, jbyteArray array, jboolean* isCopy); + jchar* (*GetCharArrayElements)(JNIEnv* env, jcharArray array, jboolean* isCopy); + jshort* (*GetShortArrayElements)(JNIEnv* env, jshortArray array, jboolean* isCopy); + jint* (*GetIntArrayElements)(JNIEnv* env, jintArray array, jboolean* isCopy); + jlong* (*GetLongArrayElements)(JNIEnv* env, jlongArray array, jboolean* isCopy); + jfloat* (*GetFloatArrayElements)(JNIEnv* env, jfloatArray array, jboolean* isCopy); + jdouble* (*GetDoubleArrayElements)(JNIEnv* env, jdoubleArray array, jboolean* isCopy); + + void (*ReleaseBooleanArrayElements)(JNIEnv* env, jbooleanArray array, jboolean* elems, jint mode); + void (*ReleaseByteArrayElements)(JNIEnv* env, jbyteArray array, jbyte* elems, jint mode); + void (*ReleaseCharArrayElements)(JNIEnv* env, jcharArray array, jchar* elems, jint mode); + void (*ReleaseShortArrayElements)(JNIEnv* env, jshortArray array, jshort* elems, jint mode); + void (*ReleaseIntArrayElements)(JNIEnv* env, jintArray array, jint* elems, jint mode); + void (*ReleaseLongArrayElements)(JNIEnv* env, jlongArray array, jlong* elems, jint mode); + void (*ReleaseFloatArrayElements)(JNIEnv* env, jfloatArray array, jfloat* elems, jint mode); + void (*ReleaseDoubleArrayElements)(JNIEnv* env, jdoubleArray array, jdouble* elems, jint mode); + + void (*GetBooleanArrayRegion)(JNIEnv* env, jbooleanArray array, jsize start, jsize l, jboolean* buf); + void (*GetByteArrayRegion)(JNIEnv* env, jbyteArray array, jsize start, jsize len, jbyte* buf); + void (*GetCharArrayRegion)(JNIEnv* env, jcharArray array, jsize start, jsize len, jchar* buf); + void (*GetShortArrayRegion)(JNIEnv* env, jshortArray array, jsize start, jsize len, jshort* buf); + void (*GetIntArrayRegion)(JNIEnv* env, jintArray array, jsize start, jsize len, jint* buf); + void (*GetLongArrayRegion)(JNIEnv* env, jlongArray array, jsize start, jsize len, jlong* buf); + void (*GetFloatArrayRegion)(JNIEnv* env, jfloatArray array, jsize start, jsize len, jfloat* buf); + void (*GetDoubleArrayRegion)(JNIEnv* env, jdoubleArray array, jsize start, jsize len, jdouble* buf); + + void (*SetBooleanArrayRegion)(JNIEnv* env, jbooleanArray array, jsize start, jsize l, const jboolean* buf); + void (*SetByteArrayRegion)(JNIEnv* env, jbyteArray array, jsize start, jsize len, const jbyte* buf); + void (*SetCharArrayRegion)(JNIEnv* env, jcharArray array, jsize start, jsize len, const jchar* buf); + void (*SetShortArrayRegion)(JNIEnv* env, jshortArray array, jsize start, jsize len, const jshort* buf); + void (*SetIntArrayRegion)(JNIEnv* env, jintArray array, jsize start, jsize len, const jint* buf); + void (*SetLongArrayRegion)(JNIEnv* env, jlongArray array, jsize start, jsize len, const jlong* buf); + void (*SetFloatArrayRegion)(JNIEnv* env, jfloatArray array, jsize start, jsize len, const jfloat* buf); + void (*SetDoubleArrayRegion)(JNIEnv* env, jdoubleArray array, jsize start, jsize len, const jdouble* buf); + + jint (*RegisterNatives)(JNIEnv* env, jclass clazz, const JNINativeMethod* methods, jint nMethods); + jint (*UnregisterNatives)(JNIEnv* env, jclass clazz); + + jint (*MonitorEnter)(JNIEnv* env, jobject obj); + jint (*MonitorExit)(JNIEnv* env, jobject obj); + + jint (*GetJavaVM)(JNIEnv* env, JavaVM** vm); + + void (*GetStringRegion)(JNIEnv* env, jstring str, jsize start, jsize len, jchar* buf); + void (*GetStringUTFRegion)(JNIEnv* env, jstring str, jsize start, jsize len, char* buf); + + void* (*GetPrimitiveArrayCritical)(JNIEnv* env, jarray array, jboolean* isCopy); + void (*ReleasePrimitiveArrayCritical)(JNIEnv* env, jarray array, void* carray, jint mode); + + const jchar* (*GetStringCritical)(JNIEnv* env, jstring string, jboolean* isCopy); + void (*ReleaseStringCritical)(JNIEnv* env, jstring string, const jchar* cstring); + + jweak (*NewWeakGlobalRef)(JNIEnv* env, jobject obj); + void (*DeleteWeakGlobalRef)(JNIEnv* env, jweak ref); + + jboolean (*ExceptionCheck)(JNIEnv* env); + + jobject (*NewDirectByteBuffer)(JNIEnv* env, void* address, jlong capacity); + void* (*GetDirectBufferAddress)(JNIEnv* env, jobject buf); + jlong (*GetDirectBufferCapacity)(JNIEnv* env, jobject buf); /* New JNI 1.6 Features */ - jobjectRefType (*GetObjectRefType)(JNIEnv *env, jobject obj); + jobjectRefType (*GetObjectRefType)(JNIEnv* env, jobject obj); /* Module Features */ - jobject (*GetModule)(JNIEnv *env, jclass clazz); + jobject (*GetModule)(JNIEnv* env, jclass clazz); /* Virtual threads */ - jboolean (*IsVirtualThread)(JNIEnv *env, jobject obj); + jboolean (*IsVirtualThread)(JNIEnv* env, jobject obj); }; } namespace jvmilia { struct JVMData { - std::unordered_map registered_natives; + std::unordered_map registered_natives; }; struct Context { - const JNINativeInterface *interface; - JVMData *data; + const JNINativeInterface* interface; + JVMData* data; }; -jint GetVersion(JNIEnv *env); -jclass DefineClass(JNIEnv *env, const char *name, jobject loader, - const jbyte *buf, jsize len); -jclass FindClass(JNIEnv *env, const char *name); -jmethodID FromReflectedMethod(JNIEnv *env, jobject method); -jfieldID FromReflectedField(JNIEnv *env, jobject field); -jobject ToReflectedMethod(JNIEnv *env, jclass cls, jmethodID methodID, - jboolean isStatic); -jclass GetSuperclass(JNIEnv *env, jclass sub); -jboolean IsAssignableFrom(JNIEnv *env, jclass sub, jclass sup); -jobject ToReflectedField(JNIEnv *env, jclass cls, jfieldID fieldID, - jboolean isStatic); -jint Throw(JNIEnv *env, jthrowable obj); -jint ThrowNew(JNIEnv *env, jclass clazz, const char *msg); -jthrowable ExceptionOccurred(JNIEnv *env); -void ExceptionDescribe(JNIEnv *env); -void ExceptionClear(JNIEnv *env); -void FatalError(JNIEnv *env, const char *msg); -jint PushLocalFrame(JNIEnv *env, jint capacity); -jobject PopLocalFrame(JNIEnv *env, jobject result); -jobject NewGlobalRef(JNIEnv *env, jobject lobj); -void DeleteGlobalRef(JNIEnv *env, jobject gref); -void DeleteLocalRef(JNIEnv *env, jobject obj); -jboolean IsSameObject(JNIEnv *env, jobject obj1, jobject obj2); -jobject NewLocalRef(JNIEnv *env, jobject ref); -jint EnsureLocalCapacity(JNIEnv *env, jint capacity); -jobject AllocObject(JNIEnv *env, jclass clazz); -jobject NewObject(JNIEnv *env, jclass clazz, jmethodID methodID, ...); -jobject NewObjectV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); -jobject NewObjectA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); -jclass GetObjectClass(JNIEnv *env, jobject obj); -jboolean IsInstanceOf(JNIEnv *env, jobject obj, jclass clazz); -jmethodID GetMethodID(JNIEnv *env, jclass clazz, const char *name, - const char *sig); -jobject CallObjectMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...); -jobject CallObjectMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); -jobject CallObjectMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); -jboolean CallBooleanMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...); -jboolean CallBooleanMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); -jboolean CallBooleanMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); -jbyte CallByteMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...); -jbyte CallByteMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); -jbyte CallByteMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); -jchar CallCharMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...); -jchar CallCharMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); -jchar CallCharMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); -jshort CallShortMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...); -jshort CallShortMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); -jshort CallShortMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); -jint CallIntMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...); -jint CallIntMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args); -jint CallIntMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); -jlong CallLongMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...); -jlong CallLongMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); -jlong CallLongMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); -jfloat CallFloatMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...); -jfloat CallFloatMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); -jfloat CallFloatMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); -jdouble CallDoubleMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...); -jdouble CallDoubleMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); -jdouble CallDoubleMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); -void CallVoidMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...); -void CallVoidMethodV(JNIEnv *env, jobject obj, jmethodID methodID, - va_list args); -void CallVoidMethodA(JNIEnv *env, jobject obj, jmethodID methodID, - const jvalue *args); -jobject CallNonvirtualObjectMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); -jobject CallNonvirtualObjectMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); -jobject CallNonvirtualObjectMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); -jboolean CallNonvirtualBooleanMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); -jboolean CallNonvirtualBooleanMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); -jboolean CallNonvirtualBooleanMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); -jbyte CallNonvirtualByteMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); -jbyte CallNonvirtualByteMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); -jbyte CallNonvirtualByteMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); -jchar CallNonvirtualCharMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); -jchar CallNonvirtualCharMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); -jchar CallNonvirtualCharMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); -jshort CallNonvirtualShortMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); -jshort CallNonvirtualShortMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); -jshort CallNonvirtualShortMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); -jint CallNonvirtualIntMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); -jint CallNonvirtualIntMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); -jint CallNonvirtualIntMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); -jlong CallNonvirtualLongMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); -jlong CallNonvirtualLongMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); -jlong CallNonvirtualLongMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); -jfloat CallNonvirtualFloatMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); -jfloat CallNonvirtualFloatMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); -jfloat CallNonvirtualFloatMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); -jdouble CallNonvirtualDoubleMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); -jdouble CallNonvirtualDoubleMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); -jdouble CallNonvirtualDoubleMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); -void CallNonvirtualVoidMethod(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, ...); -void CallNonvirtualVoidMethodV(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, va_list args); -void CallNonvirtualVoidMethodA(JNIEnv *env, jobject obj, jclass clazz, - jmethodID methodID, const jvalue *args); -jfieldID GetFieldID(JNIEnv *env, jclass clazz, const char *name, - const char *sig); -jobject GetObjectField(JNIEnv *env, jobject obj, jfieldID fieldID); -jboolean GetBooleanField(JNIEnv *env, jobject obj, jfieldID fieldID); -jbyte GetByteField(JNIEnv *env, jobject obj, jfieldID fieldID); -jchar GetCharField(JNIEnv *env, jobject obj, jfieldID fieldID); -jshort GetShortField(JNIEnv *env, jobject obj, jfieldID fieldID); -jint GetIntField(JNIEnv *env, jobject obj, jfieldID fieldID); -jlong GetLongField(JNIEnv *env, jobject obj, jfieldID fieldID); -jfloat GetFloatField(JNIEnv *env, jobject obj, jfieldID fieldID); -jdouble GetDoubleField(JNIEnv *env, jobject obj, jfieldID fieldID); -void SetObjectField(JNIEnv *env, jobject obj, jfieldID fieldID, jobject val); -void SetBooleanField(JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val); -void SetByteField(JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val); -void SetCharField(JNIEnv *env, jobject obj, jfieldID fieldID, jchar val); -void SetShortField(JNIEnv *env, jobject obj, jfieldID fieldID, jshort val); -void SetIntField(JNIEnv *env, jobject obj, jfieldID fieldID, jint val); -void SetLongField(JNIEnv *env, jobject obj, jfieldID fieldID, jlong val); -void SetFloatField(JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val); -void SetDoubleField(JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val); -jmethodID GetStaticMethodID(JNIEnv *env, jclass clazz, const char *name, - const char *sig); -jobject CallStaticObjectMethod(JNIEnv *env, jclass clazz, jmethodID methodID, - ...); -jobject CallStaticObjectMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args); -jobject CallStaticObjectMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); -jboolean CallStaticBooleanMethod(JNIEnv *env, jclass clazz, jmethodID methodID, - ...); -jboolean CallStaticBooleanMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args); -jboolean CallStaticBooleanMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); -jbyte CallStaticByteMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...); -jbyte CallStaticByteMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args); -jbyte CallStaticByteMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); -jchar CallStaticCharMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...); -jchar CallStaticCharMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args); -jchar CallStaticCharMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); -jshort CallStaticShortMethod(JNIEnv *env, jclass clazz, jmethodID methodID, - ...); -jshort CallStaticShortMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args); -jshort CallStaticShortMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); -jint CallStaticIntMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...); -jint CallStaticIntMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args); -jint CallStaticIntMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); -jlong CallStaticLongMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...); -jlong CallStaticLongMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args); -jlong CallStaticLongMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); -jfloat CallStaticFloatMethod(JNIEnv *env, jclass clazz, jmethodID methodID, - ...); -jfloat CallStaticFloatMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args); -jfloat CallStaticFloatMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); -jdouble CallStaticDoubleMethod(JNIEnv *env, jclass clazz, jmethodID methodID, - ...); -jdouble CallStaticDoubleMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, - va_list args); -jdouble CallStaticDoubleMethodA(JNIEnv *env, jclass clazz, jmethodID methodID, - const jvalue *args); -void CallStaticVoidMethod(JNIEnv *env, jclass cls, jmethodID methodID, ...); -void CallStaticVoidMethodV(JNIEnv *env, jclass cls, jmethodID methodID, - va_list args); -void CallStaticVoidMethodA(JNIEnv *env, jclass cls, jmethodID methodID, - const jvalue *args); -jfieldID GetStaticFieldID(JNIEnv *env, jclass clazz, const char *name, - const char *sig); -jobject GetStaticObjectField(JNIEnv *env, jclass clazz, jfieldID fieldID); -jboolean GetStaticBooleanField(JNIEnv *env, jclass clazz, jfieldID fieldID); -jbyte GetStaticByteField(JNIEnv *env, jclass clazz, jfieldID fieldID); -jchar GetStaticCharField(JNIEnv *env, jclass clazz, jfieldID fieldID); -jshort GetStaticShortField(JNIEnv *env, jclass clazz, jfieldID fieldID); -jint GetStaticIntField(JNIEnv *env, jclass clazz, jfieldID fieldID); -jlong GetStaticLongField(JNIEnv *env, jclass clazz, jfieldID fieldID); -jfloat GetStaticFloatField(JNIEnv *env, jclass clazz, jfieldID fieldID); -jdouble GetStaticDoubleField(JNIEnv *env, jclass clazz, jfieldID fieldID); -void SetStaticObjectField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jobject value); -void SetStaticBooleanField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jboolean value); -void SetStaticByteField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jbyte value); -void SetStaticCharField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jchar value); -void SetStaticShortField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jshort value); -void SetStaticIntField(JNIEnv *env, jclass clazz, jfieldID fieldID, jint value); -void SetStaticLongField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jlong value); -void SetStaticFloatField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jfloat value); -void SetStaticDoubleField(JNIEnv *env, jclass clazz, jfieldID fieldID, - jdouble value); -jstring NewString(JNIEnv *env, const jchar *unicode, jsize len); -jsize GetStringLength(JNIEnv *env, jstring str); -const jchar *GetStringChars(JNIEnv *env, jstring str, jboolean *isCopy); -void ReleaseStringChars(JNIEnv *env, jstring str, const jchar *chars); -jstring NewStringUTF(JNIEnv *env, const char *utf); -jsize GetStringUTFLength(JNIEnv *env, jstring str); -const char *GetStringUTFChars(JNIEnv *env, jstring str, jboolean *isCopy); -void ReleaseStringUTFChars(JNIEnv *env, jstring str, const char *chars); -jsize GetArrayLength(JNIEnv *env, jarray array); -jobjectArray NewObjectArray(JNIEnv *env, jsize len, jclass clazz, jobject init); -jobject GetObjectArrayElement(JNIEnv *env, jobjectArray array, jsize index); -void SetObjectArrayElement(JNIEnv *env, jobjectArray array, jsize index, - jobject val); -jbooleanArray NewBooleanArray(JNIEnv *env, jsize len); -jbyteArray NewByteArray(JNIEnv *env, jsize len); -jcharArray NewCharArray(JNIEnv *env, jsize len); -jshortArray NewShortArray(JNIEnv *env, jsize len); -jintArray NewIntArray(JNIEnv *env, jsize len); -jlongArray NewLongArray(JNIEnv *env, jsize len); -jfloatArray NewFloatArray(JNIEnv *env, jsize len); -jdoubleArray NewDoubleArray(JNIEnv *env, jsize len); -jboolean *GetBooleanArrayElements(JNIEnv *env, jbooleanArray array, - jboolean *isCopy); -jbyte *GetByteArrayElements(JNIEnv *env, jbyteArray array, jboolean *isCopy); -jchar *GetCharArrayElements(JNIEnv *env, jcharArray array, jboolean *isCopy); -jshort *GetShortArrayElements(JNIEnv *env, jshortArray array, jboolean *isCopy); -jint *GetIntArrayElements(JNIEnv *env, jintArray array, jboolean *isCopy); -jlong *GetLongArrayElements(JNIEnv *env, jlongArray array, jboolean *isCopy); -jfloat *GetFloatArrayElements(JNIEnv *env, jfloatArray array, jboolean *isCopy); -jdouble *GetDoubleArrayElements(JNIEnv *env, jdoubleArray array, - jboolean *isCopy); -void ReleaseBooleanArrayElements(JNIEnv *env, jbooleanArray array, - jboolean *elems, jint mode); -void ReleaseByteArrayElements(JNIEnv *env, jbyteArray array, jbyte *elems, - jint mode); -void ReleaseCharArrayElements(JNIEnv *env, jcharArray array, jchar *elems, - jint mode); -void ReleaseShortArrayElements(JNIEnv *env, jshortArray array, jshort *elems, - jint mode); -void ReleaseIntArrayElements(JNIEnv *env, jintArray array, jint *elems, - jint mode); -void ReleaseLongArrayElements(JNIEnv *env, jlongArray array, jlong *elems, - jint mode); -void ReleaseFloatArrayElements(JNIEnv *env, jfloatArray array, jfloat *elems, - jint mode); -void ReleaseDoubleArrayElements(JNIEnv *env, jdoubleArray array, jdouble *elems, - jint mode); -void GetBooleanArrayRegion(JNIEnv *env, jbooleanArray array, jsize start, - jsize l, jboolean *buf); -void GetByteArrayRegion(JNIEnv *env, jbyteArray array, jsize start, jsize len, - jbyte *buf); -void GetCharArrayRegion(JNIEnv *env, jcharArray array, jsize start, jsize len, - jchar *buf); -void GetShortArrayRegion(JNIEnv *env, jshortArray array, jsize start, jsize len, - jshort *buf); -void GetIntArrayRegion(JNIEnv *env, jintArray array, jsize start, jsize len, - jint *buf); -void GetLongArrayRegion(JNIEnv *env, jlongArray array, jsize start, jsize len, - jlong *buf); -void GetFloatArrayRegion(JNIEnv *env, jfloatArray array, jsize start, jsize len, - jfloat *buf); -void GetDoubleArrayRegion(JNIEnv *env, jdoubleArray array, jsize start, - jsize len, jdouble *buf); -void SetBooleanArrayRegion(JNIEnv *env, jbooleanArray array, jsize start, - jsize l, const jboolean *buf); -void SetByteArrayRegion(JNIEnv *env, jbyteArray array, jsize start, jsize len, - const jbyte *buf); -void SetCharArrayRegion(JNIEnv *env, jcharArray array, jsize start, jsize len, - const jchar *buf); -void SetShortArrayRegion(JNIEnv *env, jshortArray array, jsize start, jsize len, - const jshort *buf); -void SetIntArrayRegion(JNIEnv *env, jintArray array, jsize start, jsize len, - const jint *buf); -void SetLongArrayRegion(JNIEnv *env, jlongArray array, jsize start, jsize len, - const jlong *buf); -void SetFloatArrayRegion(JNIEnv *env, jfloatArray array, jsize start, jsize len, - const jfloat *buf); -void SetDoubleArrayRegion(JNIEnv *env, jdoubleArray array, jsize start, - jsize len, const jdouble *buf); -jint RegisterNatives(JNIEnv *env, jclass clazz, const JNINativeMethod *methods, - jint nMethods); -jint UnregisterNatives(JNIEnv *env, jclass clazz); -jint MonitorEnter(JNIEnv *env, jobject obj); -jint MonitorExit(JNIEnv *env, jobject obj); -jint GetJavaVM(JNIEnv *env, JavaVM **vm); -void GetStringRegion(JNIEnv *env, jstring str, jsize start, jsize len, - jchar *buf); -void GetStringUTFRegion(JNIEnv *env, jstring str, jsize start, jsize len, - char *buf); -void *GetPrimitiveArrayCritical(JNIEnv *env, jarray array, jboolean *isCopy); -void ReleasePrimitiveArrayCritical(JNIEnv *env, jarray array, void *carray, - jint mode); -const jchar *GetStringCritical(JNIEnv *env, jstring string, jboolean *isCopy); -void ReleaseStringCritical(JNIEnv *env, jstring string, const jchar *cstring); -jweak NewWeakGlobalRef(JNIEnv *env, jobject obj); -void DeleteWeakGlobalRef(JNIEnv *env, jweak ref); -jboolean ExceptionCheck(JNIEnv *env); -jobject NewDirectByteBuffer(JNIEnv *env, void *address, jlong capacity); -void *GetDirectBufferAddress(JNIEnv *env, jobject buf); -jlong GetDirectBufferCapacity(JNIEnv *env, jobject buf); -jobjectRefType GetObjectRefType(JNIEnv *env, jobject obj); -jobject GetModule(JNIEnv *env, jclass clazz); -jboolean IsVirtualThread(JNIEnv *env, jobject obj); +jint GetVersion(JNIEnv* env); +jclass DefineClass(JNIEnv* env, const char* name, jobject loader, const jbyte* buf, jsize len); +jclass FindClass(JNIEnv* env, const char* name); +jmethodID FromReflectedMethod(JNIEnv* env, jobject method); +jfieldID FromReflectedField(JNIEnv* env, jobject field); +jobject ToReflectedMethod(JNIEnv* env, jclass cls, jmethodID methodID, jboolean isStatic); +jclass GetSuperclass(JNIEnv* env, jclass sub); +jboolean IsAssignableFrom(JNIEnv* env, jclass sub, jclass sup); +jobject ToReflectedField(JNIEnv* env, jclass cls, jfieldID fieldID, jboolean isStatic); +jint Throw(JNIEnv* env, jthrowable obj); +jint ThrowNew(JNIEnv* env, jclass clazz, const char* msg); +jthrowable ExceptionOccurred(JNIEnv* env); +void ExceptionDescribe(JNIEnv* env); +void ExceptionClear(JNIEnv* env); +void FatalError(JNIEnv* env, const char* msg); +jint PushLocalFrame(JNIEnv* env, jint capacity); +jobject PopLocalFrame(JNIEnv* env, jobject result); +jobject NewGlobalRef(JNIEnv* env, jobject lobj); +void DeleteGlobalRef(JNIEnv* env, jobject gref); +void DeleteLocalRef(JNIEnv* env, jobject obj); +jboolean IsSameObject(JNIEnv* env, jobject obj1, jobject obj2); +jobject NewLocalRef(JNIEnv* env, jobject ref); +jint EnsureLocalCapacity(JNIEnv* env, jint capacity); +jobject AllocObject(JNIEnv* env, jclass clazz); +jobject NewObject(JNIEnv* env, jclass clazz, jmethodID methodID, ...); +jobject NewObjectV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); +jobject NewObjectA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); +jclass GetObjectClass(JNIEnv* env, jobject obj); +jboolean IsInstanceOf(JNIEnv* env, jobject obj, jclass clazz); +jmethodID GetMethodID(JNIEnv* env, jclass clazz, const char* name, const char* sig); +jobject CallObjectMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...); +jobject CallObjectMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); +jobject CallObjectMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); +jboolean CallBooleanMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...); +jboolean CallBooleanMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); +jboolean CallBooleanMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); +jbyte CallByteMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...); +jbyte CallByteMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); +jbyte CallByteMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); +jchar CallCharMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...); +jchar CallCharMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); +jchar CallCharMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); +jshort CallShortMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...); +jshort CallShortMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); +jshort CallShortMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); +jint CallIntMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...); +jint CallIntMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); +jint CallIntMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); +jlong CallLongMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...); +jlong CallLongMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); +jlong CallLongMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); +jfloat CallFloatMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...); +jfloat CallFloatMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); +jfloat CallFloatMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); +jdouble CallDoubleMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...); +jdouble CallDoubleMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); +jdouble CallDoubleMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); +void CallVoidMethod(JNIEnv* env, jobject obj, jmethodID methodID, ...); +void CallVoidMethodV(JNIEnv* env, jobject obj, jmethodID methodID, va_list args); +void CallVoidMethodA(JNIEnv* env, jobject obj, jmethodID methodID, const jvalue* args); +jobject CallNonvirtualObjectMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); +jobject CallNonvirtualObjectMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); +jobject CallNonvirtualObjectMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); +jboolean CallNonvirtualBooleanMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); +jboolean CallNonvirtualBooleanMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); +jboolean CallNonvirtualBooleanMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); +jbyte CallNonvirtualByteMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); +jbyte CallNonvirtualByteMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); +jbyte CallNonvirtualByteMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); +jchar CallNonvirtualCharMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); +jchar CallNonvirtualCharMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); +jchar CallNonvirtualCharMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); +jshort CallNonvirtualShortMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); +jshort CallNonvirtualShortMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); +jshort CallNonvirtualShortMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); +jint CallNonvirtualIntMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); +jint CallNonvirtualIntMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); +jint CallNonvirtualIntMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); +jlong CallNonvirtualLongMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); +jlong CallNonvirtualLongMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); +jlong CallNonvirtualLongMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); +jfloat CallNonvirtualFloatMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); +jfloat CallNonvirtualFloatMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); +jfloat CallNonvirtualFloatMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); +jdouble CallNonvirtualDoubleMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); +jdouble CallNonvirtualDoubleMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); +jdouble CallNonvirtualDoubleMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); +void CallNonvirtualVoidMethod(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, ...); +void CallNonvirtualVoidMethodV(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, va_list args); +void CallNonvirtualVoidMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, const jvalue* args); +jfieldID GetFieldID(JNIEnv* env, jclass clazz, const char* name, const char* sig); +jobject GetObjectField(JNIEnv* env, jobject obj, jfieldID fieldID); +jboolean GetBooleanField(JNIEnv* env, jobject obj, jfieldID fieldID); +jbyte GetByteField(JNIEnv* env, jobject obj, jfieldID fieldID); +jchar GetCharField(JNIEnv* env, jobject obj, jfieldID fieldID); +jshort GetShortField(JNIEnv* env, jobject obj, jfieldID fieldID); +jint GetIntField(JNIEnv* env, jobject obj, jfieldID fieldID); +jlong GetLongField(JNIEnv* env, jobject obj, jfieldID fieldID); +jfloat GetFloatField(JNIEnv* env, jobject obj, jfieldID fieldID); +jdouble GetDoubleField(JNIEnv* env, jobject obj, jfieldID fieldID); +void SetObjectField(JNIEnv* env, jobject obj, jfieldID fieldID, jobject val); +void SetBooleanField(JNIEnv* env, jobject obj, jfieldID fieldID, jboolean val); +void SetByteField(JNIEnv* env, jobject obj, jfieldID fieldID, jbyte val); +void SetCharField(JNIEnv* env, jobject obj, jfieldID fieldID, jchar val); +void SetShortField(JNIEnv* env, jobject obj, jfieldID fieldID, jshort val); +void SetIntField(JNIEnv* env, jobject obj, jfieldID fieldID, jint val); +void SetLongField(JNIEnv* env, jobject obj, jfieldID fieldID, jlong val); +void SetFloatField(JNIEnv* env, jobject obj, jfieldID fieldID, jfloat val); +void SetDoubleField(JNIEnv* env, jobject obj, jfieldID fieldID, jdouble val); +jmethodID GetStaticMethodID(JNIEnv* env, jclass clazz, const char* name, const char* sig); +jobject CallStaticObjectMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...); +jobject CallStaticObjectMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); +jobject CallStaticObjectMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); +jboolean CallStaticBooleanMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...); +jboolean CallStaticBooleanMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); +jboolean CallStaticBooleanMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); +jbyte CallStaticByteMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...); +jbyte CallStaticByteMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); +jbyte CallStaticByteMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); +jchar CallStaticCharMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...); +jchar CallStaticCharMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); +jchar CallStaticCharMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); +jshort CallStaticShortMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...); +jshort CallStaticShortMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); +jshort CallStaticShortMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); +jint CallStaticIntMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...); +jint CallStaticIntMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); +jint CallStaticIntMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); +jlong CallStaticLongMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...); +jlong CallStaticLongMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); +jlong CallStaticLongMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); +jfloat CallStaticFloatMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...); +jfloat CallStaticFloatMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); +jfloat CallStaticFloatMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); +jdouble CallStaticDoubleMethod(JNIEnv* env, jclass clazz, jmethodID methodID, ...); +jdouble CallStaticDoubleMethodV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args); +jdouble CallStaticDoubleMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, const jvalue* args); +void CallStaticVoidMethod(JNIEnv* env, jclass cls, jmethodID methodID, ...); +void CallStaticVoidMethodV(JNIEnv* env, jclass cls, jmethodID methodID, va_list args); +void CallStaticVoidMethodA(JNIEnv* env, jclass cls, jmethodID methodID, const jvalue* args); +jfieldID GetStaticFieldID(JNIEnv* env, jclass clazz, const char* name, const char* sig); +jobject GetStaticObjectField(JNIEnv* env, jclass clazz, jfieldID fieldID); +jboolean GetStaticBooleanField(JNIEnv* env, jclass clazz, jfieldID fieldID); +jbyte GetStaticByteField(JNIEnv* env, jclass clazz, jfieldID fieldID); +jchar GetStaticCharField(JNIEnv* env, jclass clazz, jfieldID fieldID); +jshort GetStaticShortField(JNIEnv* env, jclass clazz, jfieldID fieldID); +jint GetStaticIntField(JNIEnv* env, jclass clazz, jfieldID fieldID); +jlong GetStaticLongField(JNIEnv* env, jclass clazz, jfieldID fieldID); +jfloat GetStaticFloatField(JNIEnv* env, jclass clazz, jfieldID fieldID); +jdouble GetStaticDoubleField(JNIEnv* env, jclass clazz, jfieldID fieldID); +void SetStaticObjectField(JNIEnv* env, jclass clazz, jfieldID fieldID, jobject value); +void SetStaticBooleanField(JNIEnv* env, jclass clazz, jfieldID fieldID, jboolean value); +void SetStaticByteField(JNIEnv* env, jclass clazz, jfieldID fieldID, jbyte value); +void SetStaticCharField(JNIEnv* env, jclass clazz, jfieldID fieldID, jchar value); +void SetStaticShortField(JNIEnv* env, jclass clazz, jfieldID fieldID, jshort value); +void SetStaticIntField(JNIEnv* env, jclass clazz, jfieldID fieldID, jint value); +void SetStaticLongField(JNIEnv* env, jclass clazz, jfieldID fieldID, jlong value); +void SetStaticFloatField(JNIEnv* env, jclass clazz, jfieldID fieldID, jfloat value); +void SetStaticDoubleField(JNIEnv* env, jclass clazz, jfieldID fieldID, jdouble value); +jstring NewString(JNIEnv* env, const jchar* unicode, jsize len); +jsize GetStringLength(JNIEnv* env, jstring str); +const jchar* GetStringChars(JNIEnv* env, jstring str, jboolean* isCopy); +void ReleaseStringChars(JNIEnv* env, jstring str, const jchar* chars); +jstring NewStringUTF(JNIEnv* env, const char* utf); +jsize GetStringUTFLength(JNIEnv* env, jstring str); +const char* GetStringUTFChars(JNIEnv* env, jstring str, jboolean* isCopy); +void ReleaseStringUTFChars(JNIEnv* env, jstring str, const char* chars); +jsize GetArrayLength(JNIEnv* env, jarray array); +jobjectArray NewObjectArray(JNIEnv* env, jsize len, jclass clazz, jobject init); +jobject GetObjectArrayElement(JNIEnv* env, jobjectArray array, jsize index); +void SetObjectArrayElement(JNIEnv* env, jobjectArray array, jsize index, jobject val); +jbooleanArray NewBooleanArray(JNIEnv* env, jsize len); +jbyteArray NewByteArray(JNIEnv* env, jsize len); +jcharArray NewCharArray(JNIEnv* env, jsize len); +jshortArray NewShortArray(JNIEnv* env, jsize len); +jintArray NewIntArray(JNIEnv* env, jsize len); +jlongArray NewLongArray(JNIEnv* env, jsize len); +jfloatArray NewFloatArray(JNIEnv* env, jsize len); +jdoubleArray NewDoubleArray(JNIEnv* env, jsize len); +jboolean* GetBooleanArrayElements(JNIEnv* env, jbooleanArray array, jboolean* isCopy); +jbyte* GetByteArrayElements(JNIEnv* env, jbyteArray array, jboolean* isCopy); +jchar* GetCharArrayElements(JNIEnv* env, jcharArray array, jboolean* isCopy); +jshort* GetShortArrayElements(JNIEnv* env, jshortArray array, jboolean* isCopy); +jint* GetIntArrayElements(JNIEnv* env, jintArray array, jboolean* isCopy); +jlong* GetLongArrayElements(JNIEnv* env, jlongArray array, jboolean* isCopy); +jfloat* GetFloatArrayElements(JNIEnv* env, jfloatArray array, jboolean* isCopy); +jdouble* GetDoubleArrayElements(JNIEnv* env, jdoubleArray array, jboolean* isCopy); +void ReleaseBooleanArrayElements(JNIEnv* env, jbooleanArray array, jboolean* elems, jint mode); +void ReleaseByteArrayElements(JNIEnv* env, jbyteArray array, jbyte* elems, jint mode); +void ReleaseCharArrayElements(JNIEnv* env, jcharArray array, jchar* elems, jint mode); +void ReleaseShortArrayElements(JNIEnv* env, jshortArray array, jshort* elems, jint mode); +void ReleaseIntArrayElements(JNIEnv* env, jintArray array, jint* elems, jint mode); +void ReleaseLongArrayElements(JNIEnv* env, jlongArray array, jlong* elems, jint mode); +void ReleaseFloatArrayElements(JNIEnv* env, jfloatArray array, jfloat* elems, jint mode); +void ReleaseDoubleArrayElements(JNIEnv* env, jdoubleArray array, jdouble* elems, jint mode); +void GetBooleanArrayRegion(JNIEnv* env, jbooleanArray array, jsize start, jsize l, jboolean* buf); +void GetByteArrayRegion(JNIEnv* env, jbyteArray array, jsize start, jsize len, jbyte* buf); +void GetCharArrayRegion(JNIEnv* env, jcharArray array, jsize start, jsize len, jchar* buf); +void GetShortArrayRegion(JNIEnv* env, jshortArray array, jsize start, jsize len, jshort* buf); +void GetIntArrayRegion(JNIEnv* env, jintArray array, jsize start, jsize len, jint* buf); +void GetLongArrayRegion(JNIEnv* env, jlongArray array, jsize start, jsize len, jlong* buf); +void GetFloatArrayRegion(JNIEnv* env, jfloatArray array, jsize start, jsize len, jfloat* buf); +void GetDoubleArrayRegion(JNIEnv* env, jdoubleArray array, jsize start, jsize len, jdouble* buf); +void SetBooleanArrayRegion(JNIEnv* env, jbooleanArray array, jsize start, jsize l, const jboolean* buf); +void SetByteArrayRegion(JNIEnv* env, jbyteArray array, jsize start, jsize len, const jbyte* buf); +void SetCharArrayRegion(JNIEnv* env, jcharArray array, jsize start, jsize len, const jchar* buf); +void SetShortArrayRegion(JNIEnv* env, jshortArray array, jsize start, jsize len, const jshort* buf); +void SetIntArrayRegion(JNIEnv* env, jintArray array, jsize start, jsize len, const jint* buf); +void SetLongArrayRegion(JNIEnv* env, jlongArray array, jsize start, jsize len, const jlong* buf); +void SetFloatArrayRegion(JNIEnv* env, jfloatArray array, jsize start, jsize len, const jfloat* buf); +void SetDoubleArrayRegion(JNIEnv* env, jdoubleArray array, jsize start, jsize len, const jdouble* buf); +jint RegisterNatives(JNIEnv* env, jclass clazz, const JNINativeMethod* methods, jint nMethods); +jint UnregisterNatives(JNIEnv* env, jclass clazz); +jint MonitorEnter(JNIEnv* env, jobject obj); +jint MonitorExit(JNIEnv* env, jobject obj); +jint GetJavaVM(JNIEnv* env, JavaVM** vm); +void GetStringRegion(JNIEnv* env, jstring str, jsize start, jsize len, jchar* buf); +void GetStringUTFRegion(JNIEnv* env, jstring str, jsize start, jsize len, char* buf); +void* GetPrimitiveArrayCritical(JNIEnv* env, jarray array, jboolean* isCopy); +void ReleasePrimitiveArrayCritical(JNIEnv* env, jarray array, void* carray, jint mode); +const jchar* GetStringCritical(JNIEnv* env, jstring string, jboolean* isCopy); +void ReleaseStringCritical(JNIEnv* env, jstring string, const jchar* cstring); +jweak NewWeakGlobalRef(JNIEnv* env, jobject obj); +void DeleteWeakGlobalRef(JNIEnv* env, jweak ref); +jboolean ExceptionCheck(JNIEnv* env); +jobject NewDirectByteBuffer(JNIEnv* env, void* address, jlong capacity); +void* GetDirectBufferAddress(JNIEnv* env, jobject buf); +jlong GetDirectBufferCapacity(JNIEnv* env, jobject buf); +jobjectRefType GetObjectRefType(JNIEnv* env, jobject obj); +jobject GetModule(JNIEnv* env, jclass clazz); +jboolean IsVirtualThread(JNIEnv* env, jobject obj); } // namespace jvmilia diff --git a/lib/exec/native.cpp b/lib/exec/native.cpp index 5865488..994d1a7 100644 --- a/lib/exec/native.cpp +++ b/lib/exec/native.cpp @@ -10,13 +10,9 @@ using jvmilia::JVMData, jvmilia::Context; -value handle_to_value(void *handle) { - return caml_copy_int64(std::bit_cast(handle)); -} +value handle_to_value(void* handle) { return caml_copy_int64(std::bit_cast(handle)); } -template T *value_to_handle(value val) { - return std::bit_cast(Int64_val(val)); -} +template T* value_to_handle(value val) { return std::bit_cast(Int64_val(val)); } int fib(int n) { if (n < 2) @@ -28,12 +24,12 @@ int fib(int n) { CAMLprim value fib_native(value n) { return Val_int(fib(Int_val(n))); } CAMLprim value load_library_native(value path) { - const char *path_str = String_val(path); - char *current_path = get_current_dir_name(); + const char* path_str = String_val(path); + char* current_path = get_current_dir_name(); printf("We are in: %s\n", current_path); free(current_path); printf("Loading library: %s\n", path_str); - void *library = dlopen(path_str, RTLD_LAZY | RTLD_GLOBAL); + void* library = dlopen(path_str, RTLD_LAZY | RTLD_GLOBAL); printf("Library: %p\n", library); // link_map *map = nullptr; // dlinfo(library, RTLD_DI_LINKMAP, &map); @@ -69,10 +65,10 @@ CAMLprim value load_library_native(value path) { } CAMLprim value load_method_native(value lib_val, value name_val) { - void *lib = value_to_handle(lib_val); - const char *name = String_val(name_val); + void* lib = value_to_handle(lib_val); + const char* name = String_val(name_val); - void *method = dlsym(lib, name); + void* method = dlsym(lib, name); return handle_to_value(method); } @@ -80,7 +76,7 @@ CAMLprim value load_method_native(value lib_val, value name_val) { CAMLprim value make_native_interface_native(value unit) { (void)unit; - JNINativeInterface *interface = new JNINativeInterface; + JNINativeInterface* interface = new JNINativeInterface; *interface = { nullptr, nullptr, @@ -147,18 +143,12 @@ CAMLprim value make_native_interface_native(value unit) { /* CallVoidMethod= */ &jvmilia::CallVoidMethod, /* CallVoidMethodV= */ &jvmilia::CallVoidMethodV, /* CallVoidMethodA= */ &jvmilia::CallVoidMethodA, - /* CallNonvirtualObjectMethod= */ - &jvmilia::CallNonvirtualObjectMethod, - /* CallNonvirtualObjectMethodV= */ - &jvmilia::CallNonvirtualObjectMethodV, - /* CallNonvirtualObjectMethodA= */ - &jvmilia::CallNonvirtualObjectMethodA, - /* CallNonvirtualBooleanMethod= */ - &jvmilia::CallNonvirtualBooleanMethod, - /* CallNonvirtualBooleanMethodV= */ - &jvmilia::CallNonvirtualBooleanMethodV, - /* CallNonvirtualBooleanMethodA= */ - &jvmilia::CallNonvirtualBooleanMethodA, + /* CallNonvirtualObjectMethod= */ &jvmilia::CallNonvirtualObjectMethod, + /* CallNonvirtualObjectMethodV= */ &jvmilia::CallNonvirtualObjectMethodV, + /* CallNonvirtualObjectMethodA= */ &jvmilia::CallNonvirtualObjectMethodA, + /* CallNonvirtualBooleanMethod= */ &jvmilia::CallNonvirtualBooleanMethod, + /* CallNonvirtualBooleanMethodV= */ &jvmilia::CallNonvirtualBooleanMethodV, + /* CallNonvirtualBooleanMethodA= */ &jvmilia::CallNonvirtualBooleanMethodA, /* CallNonvirtualByteMethod= */ &jvmilia::CallNonvirtualByteMethod, /* CallNonvirtualByteMethodV= */ &jvmilia::CallNonvirtualByteMethodV, /* CallNonvirtualByteMethodA= */ &jvmilia::CallNonvirtualByteMethodA, @@ -166,10 +156,8 @@ CAMLprim value make_native_interface_native(value unit) { /* CallNonvirtualCharMethodV= */ &jvmilia::CallNonvirtualCharMethodV, /* CallNonvirtualCharMethodA= */ &jvmilia::CallNonvirtualCharMethodA, /* CallNonvirtualShortMethod= */ &jvmilia::CallNonvirtualShortMethod, - /* CallNonvirtualShortMethodV= */ - &jvmilia::CallNonvirtualShortMethodV, - /* CallNonvirtualShortMethodA= */ - &jvmilia::CallNonvirtualShortMethodA, + /* CallNonvirtualShortMethodV= */ &jvmilia::CallNonvirtualShortMethodV, + /* CallNonvirtualShortMethodA= */ &jvmilia::CallNonvirtualShortMethodA, /* CallNonvirtualIntMethod= */ &jvmilia::CallNonvirtualIntMethod, /* CallNonvirtualIntMethodV= */ &jvmilia::CallNonvirtualIntMethodV, /* CallNonvirtualIntMethodA= */ &jvmilia::CallNonvirtualIntMethodA, @@ -177,16 +165,11 @@ CAMLprim value make_native_interface_native(value unit) { /* CallNonvirtualLongMethodV= */ &jvmilia::CallNonvirtualLongMethodV, /* CallNonvirtualLongMethodA= */ &jvmilia::CallNonvirtualLongMethodA, /* CallNonvirtualFloatMethod= */ &jvmilia::CallNonvirtualFloatMethod, - /* CallNonvirtualFloatMethodV= */ - &jvmilia::CallNonvirtualFloatMethodV, - /* CallNonvirtualFloatMethodA= */ - &jvmilia::CallNonvirtualFloatMethodA, - /* CallNonvirtualDoubleMethod= */ - &jvmilia::CallNonvirtualDoubleMethod, - /* CallNonvirtualDoubleMethodV= */ - &jvmilia::CallNonvirtualDoubleMethodV, - /* CallNonvirtualDoubleMethodA= */ - &jvmilia::CallNonvirtualDoubleMethodA, + /* CallNonvirtualFloatMethodV= */ &jvmilia::CallNonvirtualFloatMethodV, + /* CallNonvirtualFloatMethodA= */ &jvmilia::CallNonvirtualFloatMethodA, + /* CallNonvirtualDoubleMethod= */ &jvmilia::CallNonvirtualDoubleMethod, + /* CallNonvirtualDoubleMethodV= */ &jvmilia::CallNonvirtualDoubleMethodV, + /* CallNonvirtualDoubleMethodA= */ &jvmilia::CallNonvirtualDoubleMethodA, /* CallNonvirtualVoidMethod= */ &jvmilia::CallNonvirtualVoidMethod, /* CallNonvirtualVoidMethodV= */ &jvmilia::CallNonvirtualVoidMethodV, /* CallNonvirtualVoidMethodA= */ &jvmilia::CallNonvirtualVoidMethodA, @@ -287,16 +270,14 @@ CAMLprim value make_native_interface_native(value unit) { /* GetLongArrayElements= */ &jvmilia::GetLongArrayElements, /* GetFloatArrayElements= */ &jvmilia::GetFloatArrayElements, /* GetDoubleArrayElements= */ &jvmilia::GetDoubleArrayElements, - /* ReleaseBooleanArrayElements= */ - &jvmilia::ReleaseBooleanArrayElements, + /* ReleaseBooleanArrayElements= */ &jvmilia::ReleaseBooleanArrayElements, /* ReleaseByteArrayElements= */ &jvmilia::ReleaseByteArrayElements, /* ReleaseCharArrayElements= */ &jvmilia::ReleaseCharArrayElements, /* ReleaseShortArrayElements= */ &jvmilia::ReleaseShortArrayElements, /* ReleaseIntArrayElements= */ &jvmilia::ReleaseIntArrayElements, /* ReleaseLongArrayElements= */ &jvmilia::ReleaseLongArrayElements, /* ReleaseFloatArrayElements= */ &jvmilia::ReleaseFloatArrayElements, - /* ReleaseDoubleArrayElements= */ - &jvmilia::ReleaseDoubleArrayElements, + /* ReleaseDoubleArrayElements= */ &jvmilia::ReleaseDoubleArrayElements, /* GetBooleanArrayRegion= */ &jvmilia::GetBooleanArrayRegion, /* GetByteArrayRegion= */ &jvmilia::GetByteArrayRegion, /* GetCharArrayRegion= */ &jvmilia::GetCharArrayRegion, @@ -321,8 +302,7 @@ CAMLprim value make_native_interface_native(value unit) { /* GetStringRegion= */ &jvmilia::GetStringRegion, /* GetStringUTFRegion= */ &jvmilia::GetStringUTFRegion, /* GetPrimitiveArrayCritical= */ &jvmilia::GetPrimitiveArrayCritical, - /* ReleasePrimitiveArrayCritical= */ - &jvmilia::ReleasePrimitiveArrayCritical, + /* ReleasePrimitiveArrayCritical= */ &jvmilia::ReleasePrimitiveArrayCritical, /* GetStringCritical= */ &jvmilia::GetStringCritical, /* ReleaseStringCritical= */ &jvmilia::ReleaseStringCritical, /* NewWeakGlobalRef= */ &jvmilia::NewWeakGlobalRef, @@ -335,9 +315,9 @@ CAMLprim value make_native_interface_native(value unit) { /* GetModule= */ &jvmilia::GetModule, /* IsVirtualThread= */ &jvmilia::IsVirtualThread, }; - JVMData *data = new JVMData; + JVMData* data = new JVMData; - Context *context = new Context; + Context* context = new Context; context->interface = interface; context->data = data; @@ -348,17 +328,15 @@ CAMLprim value make_native_interface_native(value unit) { } CAMLprim value free_native_interface_native(value handle) { - auto *context = value_to_handle(handle); + auto* context = value_to_handle(handle); delete context; return Val_unit; } -using noargs_void = void(JNIEnv *, jclass); -CAMLprim value execute_native_noargs_void_native(value interface_int, - value cls_value, - value fn_int) { +using noargs_void = void(JNIEnv*, jclass); +CAMLprim value execute_native_noargs_void_native(value interface_int, value cls_value, value fn_int) { auto context = value_to_handle(interface_int); auto cls_string = String_val(cls_value); auto cls = std::bit_cast(cls_string); diff --git a/lib/exec/native.h b/lib/exec/native.h index c7f1262..3dace05 100644 --- a/lib/exec/native.h +++ b/lib/exec/native.h @@ -12,16 +12,12 @@ CAMLprim value load_library_native(value name); // external load_method : int64 -> string -> int64 = "load_method_native" CAMLprim value load_method_native(value library, value name); -// external make_native_interface : unit -> int64 = -// "make_native_interface_native" +// external make_native_interface : unit -> int64 = "make_native_interface_native" CAMLprim value make_native_interface_native(value unit); -// external free_native_interface : int64 -> unit = -// "free_native_interface_native" +// external free_native_interface : int64 -> unit = "free_native_interface_native" CAMLprim value free_native_interface_native(value handle); -// external execute_native_noargs_void : int64 -> string -> int64 -> unit = -// "execute_native_noargs_void_native" -CAMLprim value execute_native_noargs_void_native(value interface, value cls, - value handle); +// external execute_native_noargs_void : int64 -> string -> int64 -> unit = "execute_native_noargs_void_native" +CAMLprim value execute_native_noargs_void_native(value interface, value cls, value handle); }