summaryrefslogtreecommitdiff
path: root/timer.h
blob: ff9f73cee5c11beb5b8774d2440ae83206d5b5a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*-*- Mode: C; c-basic-offset: 8 -*-*/

#ifndef footimerhfoo
#define footimerhfoo

typedef struct Timer Timer;

#include "unit.h"

typedef enum TimerState {
        TIMER_DEAD,
        TIMER_WAITING,
        TIMER_RUNNING,
        _TIMER_STATE_MAX
} TimerState;

struct Timer {
        Meta meta;

        TimerState state;

        clockid_t clock_id;
        usec_t next_elapse;

        Service *service;
};

const UnitVTable timer_vtable;

#endif