#define _CLASSPATH_JNIIMPEXP	JNIEXPORT
#include <jni.h>

static JavaVM* g_java_vm;

_CLASSPATH_JNIIMPEXP jint JNICALL JNI_GetDefaultJavaVMInitArgs(void *vm_args) {
	return JNI_ERR;
}

_CLASSPATH_JNIIMPEXP jint JNICALL JNI_GetCreatedJavaVMs(JavaVM **vmBuf, jsize bufLen, jsize *nVMs) {
	if (bufLen <= 0) {
		return JNI_ERR;
	}
	*vmBuf = g_java_vm;
	*nVMs = 1;
	return JNI_OK;
}

_CLASSPATH_JNIIMPEXP jint JNICALL JNI_CreateJavaVM(JavaVM **p_vm, JNIEnv **p_env, void *vm_args) {
	return JNI_ERR;
}


/**
 * Mysaifu JVM本体から呼び出す関数
 */
jint JNICALL Mysaifu_SetJavaVM(JavaVM* javavm) {
	if (g_java_vm) {
		return JNI_ERR;
	}
	g_java_vm = javavm;
	return JNI_OK;
}