summaryrefslogtreecommitdiffstats
path: root/prioq.h
diff options
context:
space:
mode:
Diffstat (limited to 'prioq.h')
-rw-r--r--prioq.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/prioq.h b/prioq.h
new file mode 100644
index 0000000..e1b8796
--- /dev/null
+++ b/prioq.h
@@ -0,0 +1,33 @@
+#ifndef fooprioqhfoo
+#define fooprioqhfoo
+
+#include <glib.h>
+
+struct _flxPrioQueue;
+typedef struct _flxPrioQueue flxPrioQueue;
+
+struct _flxPrioQueueNode;
+typedef struct _flxPrioQueueNode flxPrioQueueNode;
+
+struct _flxPrioQueue {
+ flxPrioQueueNode *root, *last;
+
+ guint n_nodes;
+ gint (*compare) (gpointer a, gpointer b);
+};
+
+struct _flxPrioQueueNode {
+ flxPrioQueue *queue;
+ gpointer data;
+ guint x, y;
+
+ flxPrioQueueNode *left, *right, *parent, *next, *prev;
+};
+
+flxPrioQueue* flx_prio_queue_new(gint (*compare) (gpointer a, gpointer b));
+void flx_prio_queue_free(flxPrioQueue *q);
+
+flxPrioQueueNode* flx_prio_queue_put(flxPrioQueue *q, gpointer data);
+void flx_prio_queue_remove(flxPrioQueue *q, flxPrioQueueNode *n);
+
+#endif