]> git.meshlink.io Git - catta/blob - libavahi-core/prioq.h
6b5babbe1729c381928e6c0d19efef1e53ab978f
[catta] / libavahi-core / prioq.h
1 #ifndef fooprioqhfoo
2 #define fooprioqhfoo
3
4 #include <glib.h>
5
6 struct _AvahiPrioQueue;
7 typedef struct _AvahiPrioQueue AvahiPrioQueue;
8
9 struct _AvahiPrioQueueNode;
10 typedef struct _AvahiPrioQueueNode AvahiPrioQueueNode;
11
12 struct _AvahiPrioQueue {
13     AvahiPrioQueueNode *root, *last;
14     
15     guint n_nodes;
16     gint (*compare) (gconstpointer a, gconstpointer b);
17 };
18
19 struct _AvahiPrioQueueNode {
20     AvahiPrioQueue *queue;
21     gpointer data;
22     guint x, y;
23
24     AvahiPrioQueueNode *left, *right, *parent, *next, *prev;
25 };
26
27 AvahiPrioQueue* avahi_prio_queue_new(gint (*compare) (gconstpointer a, gconstpointer b));
28 void avahi_prio_queue_free(AvahiPrioQueue *q);
29
30 AvahiPrioQueueNode* avahi_prio_queue_put(AvahiPrioQueue *q, gpointer data);
31 void avahi_prio_queue_remove(AvahiPrioQueue *q, AvahiPrioQueueNode *n);
32
33 void avahi_prio_queue_shuffle(AvahiPrioQueue *q, AvahiPrioQueueNode *n);
34
35 #endif