1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include "luax_cfunctions.h" #include "luax_config.h" namespace Luax { int luax_c_getupvalue(lua_State* L) { lua_pushvalue(L, lua_upvalueindex(1)); return 1; } int luax_c_errfunc(lua_State* L) { cc8* msg = luaL_optstring(L, lua_upvalueindex(1), ""); return luaL_error(L, msg); } }