Mon, 07 Dec 2009 21:44:00 +0000
Add base:method() to return string identifying the current libevent backend in use
src/luaevent.c | file | annotate | diff | comparison | revisions |
--- a/src/luaevent.c Mon Dec 07 21:36:31 2009 +0000 +++ b/src/luaevent.c Mon Dec 07 21:44:00 2009 +0000 @@ -99,10 +99,17 @@ 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 } };