summary refs log tree commit diff
path: root/shared/n-acd/src/util/timer.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2021-10-01 23:05:04 +0200
committerMichael Biebl <biebl@debian.org>2021-10-01 23:05:04 +0200
commite74c568b07b50b97873fb4ee1d776dedefbd54d6 (patch)
tree3469f17ea9af91f7ff169b890633bda68b0cf76e /shared/n-acd/src/util/timer.h
parentbfe522304da217296e2a61040f58e35ec5d6f3f2 (diff)
New upstream version 1.32.12 upstream/1.32.12
Diffstat (limited to 'shared/n-acd/src/util/timer.h')
-rw-r--r--shared/n-acd/src/util/timer.h54
1 files changed, 0 insertions, 54 deletions
diff --git a/shared/n-acd/src/util/timer.h b/shared/n-acd/src/util/timer.h
deleted file mode 100644
index d01b2741..00000000
--- a/shared/n-acd/src/util/timer.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#pragma once
-
-#include <c-rbtree.h>
-#include <c-stdaux.h>
-#include <inttypes.h>
-#include <stdlib.h>
-#include <time.h>
-#include <unistd.h>
-
-typedef struct Timer Timer;
-typedef struct Timeout Timeout;
-
-enum {
-        _TIMER_E_SUCCESS,
-
-        TIMER_E_TRIGGERED,
-
-        _TIMER_E_N,
-};
-
-struct Timer {
-        int fd;
-        clockid_t clock;
-        CRBTree tree;
-        uint64_t scheduled_timeout;
-};
-
-#define TIMER_NULL(_x) {                                                        \
-                .fd = -1,                                                       \
-                .tree = C_RBTREE_INIT,                                          \
-        }
-
-struct Timeout {
-        Timer *timer;
-        CRBNode node;
-        uint64_t timeout;
-};
-
-#define TIMEOUT_INIT(_x) {                                                      \
-                .node = C_RBNODE_INIT((_x).node),                               \
-        }
-
-int timer_init(Timer *timer);
-void timer_deinit(Timer *timer);
-
-void timer_now(Timer *timer, uint64_t *nowp);
-
-int timer_pop_timeout(Timer *timer, uint64_t now, Timeout **timerp);
-void timer_rearm(Timer *timer);
-int timer_read(Timer *timer);
-
-void timeout_schedule(Timeout *timeout, Timer *timer, uint64_t time);
-void timeout_unschedule(Timeout *timeout);
-