src/main/c/jnlua.c
static jobject tojavaobject(lua_State *L, int index, jclass class) {
	int result;
	jobject object;

	if (!lua_isuserdata(L, index)) {
		return NULL;
	}
	if (!lua_getmetatable(L, index)) {
		return NULL;
	}
	luaL_getmetatable(L, JNLUA_OBJECT);
	result = lua_rawequal(L, -1, -2);
	lua_pop(L, 2);
	if (!result) {
		return NULL;
	}
	object = *(jobject *)lua_touserdata(L, index);
	if (class) {
		if (!(*thread_env)->IsInstanceOf(thread_env, object, class)) {
			return NULL;
		}
	}
	return object;
}
/* Returns the Java object at the specified index, or NULL if such an object is unobtainable. */
Returns the Java object at the specified index, or NULL if such an object is unobtainable.
Returns the Java object at the specified index or NULL if such an object is unobtainable .
static jobject tojavaobject(lua_State *L, int index, jclass class) {
	int result;
	jobject object;
	if (!lua_isuserdata(L, index)) {
		return NULL;
	}
	if (!lua_getmetatable(L, index)) {
		return NULL;
	}
	luaL_getmetatable(L, JNLUA_OBJECT);
	result = lua_rawequal(L, -1, -2);
	lua_pop(L, 2);
	if (!result) {
		return NULL;
	}
	object = *(jobject *)lua_touserdata(L, index);
	if (class) {
		if (!(*thread_env)->IsInstanceOf(thread_env, object, class)) {
			return NULL;
		}
	}
	return object;
}
static jobject tojavaobject ( lua_State * L , int index , jclass class ) { int result ; jobject object ; if ( ! lua_isuserdata ( L , index ) ) { return NULL ; } if ( ! lua_getmetatable ( L , index ) ) { return NULL ; } luaL_getmetatable ( L , JNLUA_OBJECT ) ; result = lua_rawequal ( L , -1 , -2 ) ; lua_pop ( L , 2 ) ; if ( ! result ) { return NULL ; } object = * ( jobject * ) lua_touserdata ( L , index ) ; if ( class ) { if ( ! ( * thread_env ) -> IsInstanceOf ( thread_env , object , class ) ) { return NULL ; } } return object ; }
Returns the Java object at the specified index, or NULL if such an object is unobtainable.
Returns the Java object at the specified index or NULL if such an object is unobtainable .