#include "prioq.h"
-flxPrioQueue* flx_prio_queue_new(gint (*compare) (gpointer a, gpointer b)) {
+flxPrioQueue* flx_prio_queue_new(gint (*compare) (gconstpointer a, gconstpointer b)) {
flxPrioQueue *q;
g_assert(compare);
}
/* Move a node to the correct position */
-static void shuffle_node(flxPrioQueue *q, flxPrioQueueNode *n) {
+void flx_prio_queue_shuffle(flxPrioQueue *q, flxPrioQueueNode *n) {
g_assert(q);
g_assert(n);
q->last = n;
q->n_nodes++;
- shuffle_node(q, n);
+ flx_prio_queue_shuffle(q, n);
return n;
}
flxPrioQueueNode *replacement = q->last;
exchange_nodes(q, replacement, n);
flx_prio_queue_remove(q, q->last);
- shuffle_node(q, replacement);
+ flx_prio_queue_shuffle(q, replacement);
return;
}