static int luaB_gettagmethod (lua_State *L) { int tag = luaL_check_int(L, 1); const char *event = luaL_check_string(L, 2); if (strcmp(event, "gc") == 0) lua_error(L, "deprecated use: cannot get the `gc' tag method from Lua"); lua_gettagmethod(L, tag, event); return 1; }
static int luaB_settagmethod (lua_State *L) { int tag = luaL_check_int(L, 1); const char *event = luaL_check_string(L, 2); luaL_arg_check(L, lua_isfunction(L, 3) || lua_isnil(L, 3), 3, "function or nil expected"); if (strcmp(event, "gc") == 0) lua_error(L, "deprecated use: cannot set the `gc' tag method from Lua"); lua_gettagmethod(L, tag, event); lua_pushvalue(L, 3); lua_settagmethod(L, tag, event); return 1; }
int luaCompat_checkTagToCom(lua_State *L, int luaval) { /* lua4 */ int tag; if((tag = lua_tag(L, luaval)) == LUA_NOTAG) return 0; lua_gettagmethod(L, tag, "tocom"); if(lua_isnil(L,-1)) { lua_pop(L,1); return 0; } return 1; }
static void gettagmethod() { lua_pushobject(lua_gettagmethod((int32)luaL_check_number(1), luaL_check_string(2))); }
static void luaB_gettagmethod (void) { lua_pushobject(lua_gettagmethod(luaL_check_int(1), luaL_check_string(2))); }