first attempt at proper service/socket logic
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user