Sha256: 53aed0e7b3d6b629f2f8160712931080b39f0cb7cac80f829369ce23ddf79e19
Contents?: true
Size: 573 Bytes
Versions: 11
Compression:
Stored size: 573 Bytes
Contents
static bool is_userdata(lua_State *L, int index, const char *tname) { void *p = lua_touserdata(L, index); if (p != NULL) { /* value is a userdata? */ if (lua_getmetatable(L, index)) { /* does it have a metatable? */ lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get correct metatable */ if (lua_rawequal(L, -1, -2)) { /* does it have the correct mt? */ lua_pop(L, 2); /* remove both metatables */ // type match return true; } } } // type does not match return false; } <%= @bindings %> <%= @init_code %>
Version data entries
11 entries across 11 versions & 1 rubygems