aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-12-07 21:44:00 +0000
committerMatthew Wild <mwild1@gmail.com>2009-12-07 21:44:00 +0000
commitbfd0058b760fb75ae466aa9049e9428645363a65 (patch)
tree8f1f0917aa5c613c9f7ba5514df6b3462dbfa5c5
parentb797f511efc3843cf32d62f907f1cfa08fca3828 (diff)
downloadluaevent-prosody-bfd0058b760fb75ae466aa9049e9428645363a65.tar.gz
luaevent-prosody-bfd0058b760fb75ae466aa9049e9428645363a65.zip
Add base:method() to return string identifying the current libevent backend in use
-rw-r--r--src/luaevent.c7
1 files changed, 7 insertions, 0 deletions
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 }
};