From: Rui Guo Date: Mon, 15 Jun 2009 12:17:15 +0000 (+0800) Subject: Removed the LuaUnReg() func. X-Git-Url: https://repo.or.cz/w/screen-lua.git/commitdiff_plain/23f6a9f54f0babdb804f4bc81852d81f0cf7a5f6 Removed the LuaUnReg() func. --- diff --git a/src/lua.c b/src/lua.c index 8f5a5f4..1be2b69 100644 --- a/src/lua.c +++ b/src/lua.c @@ -81,7 +81,6 @@ extern void AppendWinMsgRend(const char *str, const char *color); static int LuaDispatch(void *handler, const char *params, va_list va); static int LuaRegEvent(lua_State *L); -static int LuaUnRegEvent(lua_State *L); static void LuaShowErr(lua_State *L); struct binding lua_binding; @@ -1254,42 +1253,6 @@ LuaRegEvent(lua_State *L) return 1; } -static int -LuaUnRegEvent(lua_State *L) -{ - /* signature: unhook([obj], ticket) - * returns: true of success, false otherwise */ - int idx = 1; - struct listener *l; - - /* If the param is not as expected */ - if (!lua_islightuserdata(L, idx)) - { - /* Then it should be the userdata to be ignore, but if not ... */ - if (!lua_isuserdata(L, idx)) - luaL_checktype(L, idx, LUA_TLIGHTUSERDATA); - idx++; - luaL_checktype(L, idx, LUA_TLIGHTUSERDATA); - } - - l = (struct listener*)lua_touserdata(L, idx++); - - /* Validate the listener structure */ - if (!l || !l->handler) - { - /* invalid */ - lua_pushboolean(L,0); - } - else - { - LuaFreeHandler(L, ((lua_handler *)&(l->handler))); - unregister_listener(l); - lua_pushboolean(L, 1); - } - - return 1; -} - /** }}} */ struct ScriptFuncs LuaFuncs =