chiark / gitweb /
first attempt in implementinging execution logic
[elogind.git] / timer.h
diff --git a/timer.h b/timer.h
new file mode 100644 (file)
index 0000000..fcbddc0
--- /dev/null
+++ b/timer.h
@@ -0,0 +1,30 @@
+/*-*- Mode: C; c-basic-offset: 8 -*-*/
+
+#ifndef footimerhfoo
+#define footimerhfoo
+
+typedef struct Timer Timer;
+
+#include "name.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 NameVTable timer_vtable;
+
+#endif