MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / luaL_checkudata

Function luaL_checkudata

lua/lauxlib.c:156–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154
155
156LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) {
157 void *p = lua_touserdata(L, ud);
158 if (p != NULL) { /* value is a userdata? */
159 if (lua_getmetatable(L, ud)) { /* does it have a metatable? */
160 lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get correct metatable */
161 if (lua_rawequal(L, -1, -2)) { /* does it have the correct mt? */
162 lua_pop(L, 2); /* remove both metatables */
163 return p;
164 }
165 }
166 }
167 luaL_typerror(L, ud, tname); /* else error */
168 return NULL; /* to avoid warnings */
169}
170
171
172LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *mes) {

Callers 15

l_decimal_addFunction · 0.85
l_decimal_subFunction · 0.85
l_decimal_mulFunction · 0.85
l_decimal_divFunction · 0.85
l_cstring_tostringFunction · 0.85
l_datetime_tostring_intFunction · 0.85
l_datetime_to_tableFunction · 0.85
l_datetime_indexFunction · 0.85
l_intervalym_yearsFunction · 0.85
l_intervalym_monthsFunction · 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