MCPcopy Create free account
hub / github.com/DFHack/dfhack / check_pen_native

Function check_pen_native

library/LuaApi.cpp:643–653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641}
642
643static Pen *check_pen_native(lua_State *L, int index)
644{
645 lua_rawgetp(L, LUA_REGISTRYINDEX, &DFHACK_PEN_TOKEN);
646
647 if (!lua_getmetatable(L, index) || !lua_rawequal(L, -1, -2))
648 luaL_argerror(L, index, "not a pen object");
649
650 lua_pop(L, 2);
651
652 return (Pen*)lua_touserdata(L, index);
653}
654
655void Lua::CheckPen(lua_State *L, Screen::Pen *pen, int index, bool allow_nil, bool allow_color)
656{

Callers 2

CheckPenMethod · 0.85
dfhack_pen_newindexFunction · 0.85

Calls 5

lua_rawgetpFunction · 0.85
lua_getmetatableFunction · 0.85
lua_rawequalFunction · 0.85
luaL_argerrorFunction · 0.85
lua_touserdataFunction · 0.85

Tested by

no test coverage detected