+#include "timeeventq.h"
+#include "log.h"
+
+struct AvahiTimeEvent {
+ AvahiTimeEventQueue *queue;
+ AvahiPrioQueueNode *node;
+ struct timeval expiry;
+ struct timeval last_run;
+ AvahiTimeEventCallback callback;
+ void* userdata;
+};
+
+struct AvahiTimeEventQueue {
+ const AvahiPoll *poll_api;
+ AvahiPrioQueue *prioq;
+ AvahiTimeout *timeout;
+};
+
+static int compare(const void* _a, const void* _b) {
+ const AvahiTimeEvent *a = _a, *b = _b;
+ int ret;