src/main/c/jnlua.c
static void pushjavaobject(lua_State *L, jobject object) {
	jobject *user_data;

	user_data = (jobject *)lua_newuserdata(L, sizeof(jobject));
	*user_data = (*thread_env)->NewGlobalRef(thread_env, object);
	if (!*user_data) {
		lua_pushliteral(L, "JNI error: NewGlobalRef() failed pushing Java object");
		lua_error(L);
	}
	int result = lua_getmetatable(L, -1);
	if (result == 0) {
		luaL_getmetatable(L, JNLUA_OBJECT);
		lua_setmetatable(L, -2);
	}
	else lua_pop(L, 1);
}
/* ---- Java objects and functions ---- */
/* Pushes a Java object on the stack. */
Java objects and functions
Pushes a Java object on the stack.
Java objects and functions Pushes a Java object on the stack .
static void pushjavaobject(lua_State *L, jobject object) {
	jobject *user_data;
	user_data = (jobject *)lua_newuserdata(L, sizeof(jobject));
	*user_data = (*thread_env)->NewGlobalRef(thread_env, object);
	if (!*user_data) {
		lua_pushliteral(L, "JNI error: NewGlobalRef() failed pushing Java object");
		lua_error(L);
	}
	int result = lua_getmetatable(L, -1);
	if (result == 0) {
		luaL_getmetatable(L, JNLUA_OBJECT);
		lua_setmetatable(L, -2);
	}
	else lua_pop(L, 1);
}
static void pushjavaobject ( lua_State * L , jobject object ) { jobject * user_data ; user_data = ( jobject * ) lua_newuserdata ( L , sizeof ( jobject ) ) ; * user_data = ( * thread_env ) -> NewGlobalRef ( thread_env , object ) ; if ( ! * user_data ) { lua_pushliteral ( L , " " ) ; lua_error ( L ) ; } int result = lua_getmetatable ( L , -1 ) ; if ( result == 0 ) { luaL_getmetatable ( L , JNLUA_OBJECT ) ; lua_setmetatable ( L , -2 ) ; } else lua_pop ( L , 1 ) ; }
Java objects and functions 
Pushes a Java object on the stack.
Java objects and functions Pushes a Java object on the stack .