From bfd0058b760fb75ae466aa9049e9428645363a65 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 7 Dec 2009 21:44:00 +0000 Subject: Add base:method() to return string identifying the current libevent backend in use --- src/luaevent.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/luaevent.c b/src/luaevent.c index 550a386..0c5c37b 100644 --- a/src/luaevent.c +++ b/src/luaevent.c @@ -99,10 +99,17 @@ static int luaevent_loopexit(lua_State*L) { return 1; } +static int luaevent_method(lua_State* L) { + le_base *base = event_base_get(L, 1); + lua_pushstring(L, event_base_get_method(base->base)); + return 1; +} + static luaL_Reg base_funcs[] = { { "addevent", luaevent_addevent }, { "loop", luaevent_loop }, { "loopexit", luaevent_loopexit }, + { "method", luaevent_method }, { NULL, NULL } }; -- cgit v1.2.3