MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / luaL_testudata

Function luaL_testudata

extlibs/sol3/include/sol/sol.hpp:2671–2685  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2669}
2670
2671COMPAT53_API void *luaL_testudata(lua_State *L, int i, const char *tname) {
2672 void *p = lua_touserdata(L, i);
2673 luaL_checkstack(L, 2, "not enough stack slots");
2674 if (p == NULL || !lua_getmetatable(L, i))
2675 return NULL;
2676 else {
2677 int res = 0;
2678 luaL_getmetatable(L, tname);
2679 res = lua_rawequal(L, -1, -2);
2680 lua_pop(L, 2);
2681 if (!res)
2682 p = NULL;
2683 }
2684 return p;
2685}
2686
2687static int compat53_countlevels(lua_State *L) {
2688 lua_Debug ar;

Callers

nothing calls this directly

Calls 4

lua_touserdataFunction · 0.85
lua_getmetatableFunction · 0.85
lua_rawequalFunction · 0.85
luaL_checkstackFunction · 0.70

Tested by

no test coverage detected