X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fprioq.h;h=ace92f632bafb1be3e50549ab8684023a14b59a8;hb=495a92b93160e3ac1864341ed46d6e81b02f35ea;hp=66510713432b096c4ff33f137868647b529842c3;hpb=c58379bde376cb2298fca14f83a86626f1b76f2f;p=catta diff --git a/avahi-core/prioq.h b/avahi-core/prioq.h index 6651071..ace92f6 100644 --- a/avahi-core/prioq.h +++ b/avahi-core/prioq.h @@ -22,33 +22,28 @@ USA. ***/ -#include +typedef struct AvahiPrioQueue AvahiPrioQueue; +typedef struct AvahiPrioQueueNode AvahiPrioQueueNode; -struct _AvahiPrioQueue; -typedef struct _AvahiPrioQueue AvahiPrioQueue; +typedef int (*AvahiPQCompareFunc)(const void* a, const void* b); -struct _AvahiPrioQueueNode; -typedef struct _AvahiPrioQueueNode AvahiPrioQueueNode; - -struct _AvahiPrioQueue { +struct AvahiPrioQueue { AvahiPrioQueueNode *root, *last; - - guint n_nodes; - gint (*compare) (gconstpointer a, gconstpointer b); + unsigned n_nodes; + AvahiPQCompareFunc compare; }; -struct _AvahiPrioQueueNode { +struct AvahiPrioQueueNode { AvahiPrioQueue *queue; - gpointer data; - guint x, y; - + void* data; + unsigned x, y; AvahiPrioQueueNode *left, *right, *parent, *next, *prev; }; -AvahiPrioQueue* avahi_prio_queue_new(gint (*compare) (gconstpointer a, gconstpointer b)); +AvahiPrioQueue* avahi_prio_queue_new(AvahiPQCompareFunc compare); void avahi_prio_queue_free(AvahiPrioQueue *q); -AvahiPrioQueueNode* avahi_prio_queue_put(AvahiPrioQueue *q, gpointer data); +AvahiPrioQueueNode* avahi_prio_queue_put(AvahiPrioQueue *q, void* data); void avahi_prio_queue_remove(AvahiPrioQueue *q, AvahiPrioQueueNode *n); void avahi_prio_queue_shuffle(AvahiPrioQueue *q, AvahiPrioQueueNode *n);