summaryrefslogtreecommitdiffstats
path: root/avahi-core/timeeventq.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-08-13 21:25:09 +0000
committerLennart Poettering <lennart@poettering.net>2005-08-13 21:25:09 +0000
commit4f0a5e7572a4257894b4bfede42c26d65152609e (patch)
tree21e3d5ee20716739590e5931859a4c2052161395 /avahi-core/timeeventq.h
parentd6d7d3769441b73ffb5b7af34fef823b41e66312 (diff)
* strip glib from avahi-core
* implement glib memory allocator * add new documentation file MALLOC * initialize pseudo-RNG from /dev/urandom in avahi-daemon * remove some gcc 4.0 warnings * beef up watch system with real timeouts * move GCC __attribute__ macros into its own header avahi-common/gccmacro.h * make use of GCC's sentinel attribute where it make sense * add malloc() implementations that abort on OOM and enable them by default git-svn-id: file:///home/lennart/svn/public/avahi/trunk@308 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/timeeventq.h')
-rw-r--r--avahi-core/timeeventq.h30
1 files changed, 11 insertions, 19 deletions
diff --git a/avahi-core/timeeventq.h b/avahi-core/timeeventq.h
index 65f1420..b99c81f 100644
--- a/avahi-core/timeeventq.h
+++ b/avahi-core/timeeventq.h
@@ -27,31 +27,23 @@
typedef struct AvahiTimeEventQueue AvahiTimeEventQueue;
typedef struct AvahiTimeEvent AvahiTimeEvent;
-#include "prioq.h"
-
-typedef void (*AvahiTimeEventCallback)(AvahiTimeEvent *e, gpointer userdata);
+#include <avahi-common/watch.h>
-struct AvahiTimeEvent {
- AvahiTimeEventQueue *queue;
- AvahiPrioQueueNode *node;
- struct timeval expiry;
- struct timeval last_run;
- AvahiTimeEventCallback callback;
- gpointer userdata;
-};
+#include "prioq.h"
-struct AvahiTimeEventQueue {
- GSource source;
- AvahiPrioQueue *prioq;
-};
+typedef void (*AvahiTimeEventCallback)(AvahiTimeEvent *e, void* userdata);
-AvahiTimeEventQueue* avahi_time_event_queue_new(GMainContext *context, gint priority);
+AvahiTimeEventQueue* avahi_time_event_queue_new(AvahiPoll *poll_api);
void avahi_time_event_queue_free(AvahiTimeEventQueue *q);
-AvahiTimeEvent* avahi_time_event_queue_add(AvahiTimeEventQueue *q, const struct timeval *timeval, AvahiTimeEventCallback callback, gpointer userdata);
-void avahi_time_event_queue_remove(AvahiTimeEventQueue *q, AvahiTimeEvent *e);
+AvahiTimeEvent* avahi_time_event_new(
+ AvahiTimeEventQueue *q,
+ const struct timeval *timeval,
+ AvahiTimeEventCallback callback,
+ void* userdata);
-void avahi_time_event_queue_update(AvahiTimeEventQueue *q, AvahiTimeEvent *e, const struct timeval *timeval);
+void avahi_time_event_free(AvahiTimeEvent *e);
+void avahi_time_event_update(AvahiTimeEvent *e, const struct timeval *timeval);
AvahiTimeEvent* avahi_time_event_queue_root(AvahiTimeEventQueue *q);
AvahiTimeEvent* avahi_time_event_next(AvahiTimeEvent *e);