3 #include "prio-queue.h"
5 static int intcmp(const void *va, const void *vb, void *data)
7 const int *a = va, *b = vb;
11 static void show(int *v)
20 int cmd__prio_queue(int argc, const char **argv)
22 struct prio_queue pq = { intcmp };
25 if (!strcmp(*argv, "get"))
26 show(prio_queue_get(&pq));
27 else if (!strcmp(*argv, "dump")) {
29 while ((v = prio_queue_get(&pq)))
33 int *v = malloc(sizeof(*v));
35 prio_queue_put(&pq, v);