src/main/c/jnlua.c
static jstring tostring(lua_State *L, int index) {
	jstring string;

	if (!luaL_callmeta(L, index, "__tostring")) {
		switch (lua_type(L, index)) {
		case LUA_TNUMBER:
		case LUA_TSTRING:
			lua_pushvalue(L, index);
			break;
		case LUA_TBOOLEAN:
			lua_pushstring(L, lua_toboolean(L, index) ? "true" : "false");
			break;
		case LUA_TNIL:
			lua_pushliteral(L, "nil");
			break;
		default:
			lua_pushfstring(L, "%s: %p", luaL_typename(L, index), lua_topointer(L, index));
		}
	}
	string = (*thread_env)->NewStringUTF(thread_env, lua_tostring(L, -1));
	lua_pop(L, 1);
	return string;
}
/* Returns a Java string for a value on the stack. */
Returns a Java string for a value on the stack.
Returns a Java string for a value on the stack .
static jstring tostring(lua_State *L, int index) {
	jstring string;
	if (!luaL_callmeta(L, index, "__tostring")) {
		switch (lua_type(L, index)) {
		case LUA_TNUMBER:
		case LUA_TSTRING:
			lua_pushvalue(L, index);
			break;
		case LUA_TBOOLEAN:
			lua_pushstring(L, lua_toboolean(L, index) ? "true" : "false");
			break;
		case LUA_TNIL:
			lua_pushliteral(L, "nil");
			break;
		default:
			lua_pushfstring(L, "%s: %p", luaL_typename(L, index), lua_topointer(L, index));
		}
	}
	string = (*thread_env)->NewStringUTF(thread_env, lua_tostring(L, -1));
	lua_pop(L, 1);
	return string;
}
static jstring tostring ( lua_State * L , int index ) { jstring string ; if ( ! luaL_callmeta ( L , index , " " ) ) { switch ( lua_type ( L , index ) ) { case LUA_TNUMBER : case LUA_TSTRING : lua_pushvalue ( L , index ) ; break ; case LUA_TBOOLEAN : lua_pushstring ( L , lua_toboolean ( L , index ) ? " " : " " ) ; break ; case LUA_TNIL : lua_pushliteral ( L , " " ) ; break ; default : lua_pushfstring ( L , " " , luaL_typename ( L , index ) , lua_topointer ( L , index ) ) ; } } string = ( * thread_env ) -> NewStringUTF ( thread_env , lua_tostring ( L , -1 ) ) ; lua_pop ( L , 1 ) ; return string ; }
Returns a Java string for a value on the stack.
Returns a Java string for a value on the stack .