first attempt at proper service/socket logic

This commit is contained in:
Lennart Poettering
2010-01-26 04:18:44 +01:00
parent 9152c76506
commit 034c6ed7da
32 changed files with 2856 additions and 611 deletions
+9 -18
View File
@@ -3,6 +3,12 @@
#include "name.h"
#include "timer.h"
static void timer_done(Name *n) {
Timer *t = TIMER(n);
assert(t);
}
static NameActiveState timer_active_state(Name *n) {
static const NameActiveState table[_TIMER_STATE_MAX] = {
@@ -14,26 +20,11 @@ static NameActiveState timer_active_state(Name *n) {
return table[TIMER(n)->state];
}
static void timer_free_hook(Name *n) {
Timer *t = TIMER(n);
assert(t);
if (t->service)
t->service->timer = NULL;
}
const NameVTable timer_vtable = {
.suffix = ".timer",
.load = name_load_fragment_and_dropin,
.dump = NULL,
.init = name_load_fragment_and_dropin,
.done = timer_done,
.start = NULL,
.stop = NULL,
.reload = NULL,
.active_state = timer_active_state,
.free_hook = timer_free_hook
.active_state = timer_active_state
};