X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Ftimeeventq.c;h=e8782c90d8cd0762edb250f9de7d6d3453d4f230;hb=263515cd1d7b52ce2ad3dc55a93b9d6f730133f1;hp=a259ba612e06b380a5ffcf466c2d9718901780b6;hpb=7ada090e70d25937d27b2e93b0dab4d9d68c5d23;p=catta diff --git a/avahi-core/timeeventq.c b/avahi-core/timeeventq.c index a259ba6..e8782c9 100644 --- a/avahi-core/timeeventq.c +++ b/avahi-core/timeeventq.c @@ -59,11 +59,17 @@ static int compare(const void* _a, const void* _b) { return avahi_timeval_compare(&a->last_run, &b->last_run); } +static AvahiTimeEvent* time_event_queue_root(AvahiTimeEventQueue *q) { + assert(q); + + return q->prioq->root ? q->prioq->root->data : NULL; +} + static void update_timeout(AvahiTimeEventQueue *q) { AvahiTimeEvent *e; assert(q); - if ((e = avahi_time_event_queue_root(q))) + if ((e = time_event_queue_root(q))) q->poll_api->timeout_update(q->timeout, &e->expiry); else q->poll_api->timeout_update(q->timeout, NULL); @@ -73,7 +79,7 @@ static void expiration_event(AvahiTimeout *timeout, void *userdata) { AvahiTimeEventQueue *q = userdata; AvahiTimeEvent *e; - if ((e = avahi_time_event_queue_root(q))) { + if ((e = time_event_queue_root(q))) { struct timeval now; gettimeofday(&now, NULL); @@ -145,7 +151,7 @@ void avahi_time_event_queue_free(AvahiTimeEventQueue *q) { assert(q); - while ((e = avahi_time_event_queue_root(q))) + while ((e = time_event_queue_root(q))) avahi_time_event_free(e); avahi_prio_queue_free(q->prioq); @@ -219,16 +225,3 @@ void avahi_time_event_update(AvahiTimeEvent *e, const struct timeval *timeval) { update_timeout(e->queue); } -AvahiTimeEvent* avahi_time_event_queue_root(AvahiTimeEventQueue *q) { - assert(q); - - return q->prioq->root ? q->prioq->root->data : NULL; -} - -AvahiTimeEvent* avahi_time_event_next(AvahiTimeEvent *e) { - assert(e); - - return e->node->next->data; -} - -