MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaL_checkudata

Function luaL_checkudata

Source/Misc/lua/src/lua.c:10336–10349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10334
10335
10336LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) {
10337void *p = lua_touserdata(L, ud);
10338if (p != NULL) { /* value is a userdata? */
10339if (lua_getmetatable(L, ud)) { /* does it have a metatable? */
10340lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get correct metatable */
10341if (lua_rawequal(L, -1, -2)) { /* does it have the correct mt? */
10342lua_pop(L, 2); /* remove both metatables */
10343return p;
10344}
10345}
10346}
10347luaL_typerror(L, ud, tname); /* else error */
10348return NULL; /* to avoid warnings */
10349}
10350
10351
10352LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *mes) {

Callers 10

luausb_check_interfaceFunction · 0.85
luausb_check_deviceFunction · 0.85
luausb_check_transferFunction · 0.85
luausb_check_contextFunction · 0.85
gctmFunction · 0.85

Calls 5

lua_touserdataFunction · 0.85
lua_getmetatableFunction · 0.85
lua_getfieldFunction · 0.85
lua_rawequalFunction · 0.85
luaL_typerrorFunction · 0.85

Tested by

no test coverage detected