Merge branch 'ja/i18n-fix'
[gitweb.git] / prio-queue.h
index c766abec3de172b351ad2b43f4f20b6d9c63beee..682e51867a3452bc1106bc63f44d6d6ba5f523b9 100644 (file)
  */
 typedef int (*prio_queue_compare_fn)(const void *one, const void *two, void *cb_data);
 
+struct prio_queue_entry {
+       unsigned ctr;
+       void *data;
+};
+
 struct prio_queue {
        prio_queue_compare_fn compare;
+       unsigned insertion_ctr;
        void *cb_data;
        int alloc, nr;
-       void **array;
+       struct prio_queue_entry *array;
 };
 
 /*
@@ -40,6 +46,15 @@ extern void prio_queue_put(struct prio_queue *, void *thing);
  */
 extern void *prio_queue_get(struct prio_queue *);
 
+/*
+ * Gain access to the "thing" that would be returned by
+ * prio_queue_get, but do not remove it from the queue.
+ */
+extern void *prio_queue_peek(struct prio_queue *);
+
 extern void clear_prio_queue(struct prio_queue *);
 
+/* Reverse the LIFO elements */
+extern void prio_queue_reverse(struct prio_queue *);
+
 #endif /* PRIO_QUEUE_H */