7 static gint compare(gpointer a, gpointer b) {
8 gint i = GPOINTER_TO_INT(a), j = GPOINTER_TO_INT(b);
10 return i < j ? -1 : (i > j ? 1 : 0);
13 static void rec(flxPrioQueueNode *n) {
18 int a = GPOINTER_TO_INT(n->parent->data), b = GPOINTER_TO_INT(n->data);
20 printf("%i <= %i: NO\n", a, b);
29 int main(int argc, char *argv[]) {
33 q = flx_prio_queue_new(compare);
37 flx_prio_queue_put(q, GINT_TO_POINTER(255));
38 flx_prio_queue_put(q, GINT_TO_POINTER(255));
40 for (i = 0; i < 10000; i++)
41 flx_prio_queue_put(q, GINT_TO_POINTER(random() & 0xFFFF));
45 gint v = GPOINTER_TO_INT(q->root->data);
48 flx_prio_queue_remove(q, q->root);
53 flx_prio_queue_free(q);