/* DO NOT EDIT THIS FILE - it is machine generated */
#include "jri.h"

/* Stubs for class Simple */

#ifdef IMPLEMENT_Simple
#define _implementing_Simple
#endif /* IMPLEMENT_Simple */
#define IMPLEMENT_Simple
#include "Simple.h"

#ifndef UNUSED_Simple_count
JRIFieldID FAR fieldID_Simple_count = JRIUninitialized;
#ifdef DEBUG
JRI_PUBLIC_API(jint)
get_Simple_count(JRIEnv* env, struct Simple* obj) {
	if (fieldID_Simple_count == JRIUninitialized) {
		assert(!"Forgot to call use_Simple(env) before accessing field count I");
	}
	return JRI_GetFieldInt(env, obj, fieldID_Simple_count);
}
JRI_PUBLIC_API(void)
set_Simple_count(JRIEnv* env, struct Simple* obj, jint v) {
	if (fieldID_Simple_count == JRIUninitialized) {
		assert(!"Forgot to call use_Simple(env) before accessing field count I");
	}
	JRI_SetFieldInt(env, obj, fieldID_Simple_count, v);
}
#endif /* DEBUG */
#endif /* UNUSED_Simple_count */

#ifndef UNUSED_Simple_fact
JRIMethodID FAR methodID_Simple_fact = JRIUninitialized;
#ifdef DEBUG
JRI_PUBLIC_API(jint)
Simple_fact(JRIEnv* env, struct java_lang_Class* clazz, jint a) {
	if (methodID_Simple_fact == JRIUninitialized) {
		assert(!"Forgot to call use_Simple(env) before calling method fact (I)I");
	}
	return (jint)JRI_CallStaticMethodInt(env)(env, JRI_CallStaticMethod_op, clazz, methodID_Simple_fact, a);
}
#endif /* DEBUG */
#endif /* UNUSED_Simple_fact */

#ifndef UNUSED_Simple_printToStdout
JRIMethodID FAR methodID_Simple_printToStdout = JRIUninitialized;
#ifdef DEBUG
JRI_PUBLIC_API(void)
Simple_printToStdout(JRIEnv* env, struct Simple* self, struct java_lang_String *a) {
	if (methodID_Simple_printToStdout == JRIUninitialized) {
		assert(!"Forgot to call use_Simple(env) before calling method printToStdout (Ljava/lang/String;)V");
	}
	(void)JRI_CallMethod(env)(env, JRI_CallMethod_op, self, methodID_Simple_printToStdout, a);
}
#endif /* DEBUG */
#endif /* UNUSED_Simple_printToStdout */

#ifndef UNUSED_Simple_doit
JRIMethodID FAR methodID_Simple_doit = JRIUninitialized;
#ifdef DEBUG
JRI_PUBLIC_API(void)
Simple_doit(JRIEnv* env, struct Simple* self, struct java_lang_String *a) {
	if (methodID_Simple_doit == JRIUninitialized) {
		assert(!"Forgot to call use_Simple(env) before calling method doit (Ljava/lang/String;)V");
	}
	(void)JRI_CallMethod(env)(env, JRI_CallMethod_op, self, methodID_Simple_doit, a);
}
#endif /* DEBUG */
#endif /* UNUSED_Simple_doit */

#ifndef UNUSED_Simple_new
JRIMethodID FAR methodID_Simple_new = JRIUninitialized;
#ifdef DEBUG
JRI_PUBLIC_API(struct Simple*)
Simple_new(JRIEnv* env, struct java_lang_Class* clazz) {
	if (methodID_Simple_new == JRIUninitialized) {
		assert(!"Forgot to call use_Simple(env) before calling method <init> ()V");
	}
	return (struct Simple*)JRI_NewObject(env)(env, JRI_NewObject_op, clazz, methodID_Simple_new);
}
#endif /* DEBUG */
#endif /* UNUSED_Simple_new */

#ifndef UNUSED_use_Simple

static jglobal _globalclass_Simple = NULL;

JRI_PUBLIC_API(struct java_lang_Class*)
use_Simple(JRIEnv* env)
{
	if (_globalclass_Simple == NULL) {
		struct java_lang_Class* clazz = JRI_FindClass(env, classname_Simple);
		if (clazz == NULL) return NULL;
		use_Simple_count(env, clazz);
		use_Simple_fact(env, clazz);
		use_Simple_printToStdout(env, clazz);
		use_Simple_doit(env, clazz);
		use_Simple_new(env, clazz);
		_globalclass_Simple = JRI_NewGlobalRef(env, clazz);
		return clazz;
	}
	else {
		return JRI_GetGlobalRef(env, _globalclass_Simple);
	}
}

JRI_PUBLIC_API(void)
unuse_Simple(JRIEnv* env)
{
	if (_globalclass_Simple != NULL) {
		struct java_lang_Class* clazz = JRI_GetGlobalRef(env, _globalclass_Simple);
		unuse_Simple_count(env, clazz);
		unuse_Simple_fact(env, clazz);
		unuse_Simple_printToStdout(env, clazz);
		unuse_Simple_doit(env, clazz);
		unuse_Simple_new(env, clazz);
		JRI_DisposeGlobalRef(env, _globalclass_Simple);
		_globalclass_Simple = NULL;
		clazz = NULL;	/* prevent unused variable 'clazz' warning */
	}
}

#endif /* UNUSED_use_Simple */

#ifdef _implementing_Simple

JRI_PUBLIC_API(struct java_lang_Class*)
register_Simple(JRIEnv* env)
{
	char* nativeNamesAndSigs[] = {
		"printToStdout(Ljava/lang/String;)V",
		NULL
	};
	void* nativeProcs[] = {
		native_Simple_printToStdout,
		NULL
	};
	struct java_lang_Class* clazz = JRI_FindClass(env, classname_Simple);
	if (clazz != NULL) {
		JRI_RegisterNatives(env, clazz, nativeNamesAndSigs, nativeProcs);
		use_Simple(env);
	}
	return clazz;
}

JRI_PUBLIC_API(void)
unregister_Simple(JRIEnv* env)
{
	struct java_lang_Class* clazz = JRI_FindClass(env, classname_Simple);
	JRI_UnregisterNatives(env, clazz);
	unuse_Simple(env);
}

/* These stub routines are generated for compatibility with the JDK: */

#ifndef NO_JDK

/* SYMBOL: "Simple/printToStdout(Ljava/lang/String;)V", Java_Simple_printToStdout_stub */
JRI_PUBLIC_API(JRI_JDK_stack_item*)
Java_Simple_printToStdout_stub(JRI_JDK_stack_item* _P_, JRIEnv* _EE_) {
	(void) native_Simple_printToStdout(_EE_,_P_[0].p,((_P_[1].p)));
	return _P_;
}

#endif /* NO_JDK */

#endif /* _implementing_Simple */

