diff options
Diffstat (limited to 'src/priority-queue.h')
| -rw-r--r-- | src/priority-queue.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/priority-queue.h b/src/priority-queue.h new file mode 100644 index 0000000..fe00975 --- /dev/null +++ b/src/priority-queue.h | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | #ifndef INCLUDED_PRIORITY_QUEUE_H | ||
| 2 | #define INCLUDED_PRIORITY_QUEUE_H | ||
| 3 | |||
| 4 | #include <stdlib.h> | ||
| 5 | |||
| 6 | typedef struct priority_queue_item { | ||
| 7 | int priority; // 0 is max priority | ||
| 8 | void *data; | ||
| 9 | } *PRIORITY_QUEUE_ITEM; | ||
| 10 | |||
| 11 | typedef struct priority_queue { | ||
| 12 | struct priority_queue_item *items; | ||
| 13 | size_t count; | ||
| 14 | size_t capacity; | ||
| 15 | } *PRIORITY_QUEUE; | ||
| 16 | |||
| 17 | extern void priority_queue_push (PRIORITY_QUEUE, struct priority_queue_item); | ||
| 18 | extern void *priority_queue_pop (PRIORITY_QUEUE); | ||
| 19 | |||
| 20 | #endif | ||
