summaryrefslogtreecommitdiff
path: root/src/fakejvm/jvm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/fakejvm/jvm.h')
-rw-r--r--src/fakejvm/jvm.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/fakejvm/jvm.h b/src/fakejvm/jvm.h
new file mode 100644
index 0000000..f7e9d6c
--- /dev/null
+++ b/src/fakejvm/jvm.h
@@ -0,0 +1,25 @@
+#pragma once
+
+#include "jni.h"
+
+struct jvm_native_method {
+ char *klass;
+ char *method;
+ void *function;
+};
+
+struct jvm {
+ struct jvm_native_method methods[255];
+
+ struct JNINativeInterface native;
+ struct JNIInvokeInterface invoke;
+
+ // JNI's api is weird.. pointer to a reference of a struct, OK!
+ // Developers have to dereference these pointers to call methods from an ... reference.
+ // NOTE: These are pointers, and JNI interface passes pointers to these pointers!
+ JNIEnv env; // points to native
+ JavaVM vm; // points to invoke
+};
+
+void
+jvm_init(struct jvm *jvm);