diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2018-05-29 03:58:54 +0300 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2018-05-29 03:58:54 +0300 |
commit | 205db1ec47aead4a41178c75170eb51cdb876048 (patch) | |
tree | 2aedcd1aa5d5e133f3c343300bcc3d9cbd28bfe0 /src | |
parent | ab8e7d1f19932fdb9b14461f6eb2521421f8f4ce (diff) |
Add libjvm-unity.c
Contains some unity specific java functions
Diffstat (limited to 'src')
-rw-r--r-- | src/libjvm-unity.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/libjvm-unity.c b/src/libjvm-unity.c new file mode 100644 index 0000000..cfed49f --- /dev/null +++ b/src/libjvm-unity.c @@ -0,0 +1,21 @@ +#include <stddef.h> +#include <assert.h> +#include "jvm/jni.h" + +jmethodID +com_unity3d_player_ReflectionHelper_getMethodID(JNIEnv *env, jobject object, jvalue *values) +{ + assert(env && object); + const char *utf1 = (*env)->GetStringUTFChars(env, values[1].l, NULL); + const char *utf2 = (*env)->GetStringUTFChars(env, values[2].l, NULL); + return (*env)->GetMethodID(env, values[0].l, utf1, utf2); +} + +jfieldID +com_unity3d_player_ReflectionHelper_getFieldID(JNIEnv *env, jobject object, jvalue *values) +{ + assert(env && object); + const char *utf1 = (*env)->GetStringUTFChars(env, values[1].l, NULL); + const char *utf2 = (*env)->GetStringUTFChars(env, values[2].l, NULL); + return (*env)->GetFieldID(env, values[0].l, utf1, utf2); +} |