From 3105663933c1df5b11da2e47e93b453f4f34d936 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 18 Aug 2009 18:11:27 +0200 Subject: [PATCH] global signals use signal_object_emit Signed-off-by: Julien Danjou --- luaa.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/luaa.c b/luaa.c index 62a730c7..b96ff7a4 100644 --- a/luaa.c +++ b/luaa.c @@ -650,20 +650,7 @@ luaA_awesome_remove_signal(lua_State *L) static int luaA_awesome_emit_signal(lua_State *L) { - const char *name = luaL_checkstring(L, 1); - signal_t *sigfound = signal_array_getbyid(&global_signals, - a_strhash((const unsigned char *) name)); - if(sigfound) - { - int nargs = lua_gettop(L) - 1; - foreach(ref, sigfound->sigfuncs) - { - for(int i = 0; i < nargs; i++) - lua_pushvalue(L, - nargs); - luaA_object_push(L, (void *) *ref); - luaA_dofunction(L, nargs, 0); - } - } + signal_object_emit(L, &global_signals, luaL_checkstring(L, 1), lua_gettop(L) - 1); return 0; }