summaryrefslogtreecommitdiffstats
path: root/rc.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-01-07 10:57:42 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-01-07 10:57:42 +0000
commitcb086d6a96f84e16e2daea08af5ecc5148e9715e (patch)
tree72db182c049c3b8317a08b5060e93e884cf50ad4 /rc.c
parent9846504866f0e05649b19090e4131b9425ecc7b8 (diff)
downloadlua-openrc-cb086d6a96f84e16e2daea08af5ecc5148e9715e.tar.bz2
lua-openrc-cb086d6a96f84e16e2daea08af5ecc5148e9715e.tar.xz
implement services_scheduled()
Diffstat (limited to 'rc.c')
-rw-r--r--rc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/rc.c b/rc.c
index dcfd7eb..d80fb76 100644
--- a/rc.c
+++ b/rc.c
@@ -198,6 +198,17 @@ static int Pservices_in_state(lua_State *L)
rc_stringlist_free(list);
return 1;
}
+
+/** services_scheduled(service) - List the services shceduled to start when this one does */
+static int Pservices_scheduled(lua_State *L)
+{
+ const char *service = luaL_checkstring(L, 1);
+ RC_STRINGLIST *list = rc_services_scheduled(service);
+ push_stringlist(L, list);
+ rc_stringlist_free(list);
+ return 1;
+}
+
static const luaL_reg R[] =
@@ -217,6 +228,7 @@ static const luaL_reg R[] =
{"services_in_runlevel",Pservices_in_runlevel},
{"services_in_runlevel_stacked",Pservices_in_runlevel_stacked},
{"services_in_state", Pservices_in_state},
+ {"services_scheduled", Pservices_scheduled},
{NULL, NULL}
};