#ifndef _PRIORITY_QUEUE_H
#define _PRIORITY_QUEUE_H

/*
** These are mutually exclusive: pick your favourite implementation of a 
** priority queue: Heap or LinkedList.
*/
#define PQ_HEAP 1
#define PQ_LL 0

#if PQ_HEAP

#include "heap.h"

/* this is returned if any errors occur */
#define PRIORITY_QUEUE_ERROR HEAP_ERROR

typedef HEAP PRIORITY_QUEUE;

#define PriorityQueueAlloc HeapAlloc
#define PriorityQueueReset HeapReset
#define PriorityQueueSize HeapSize
#define PriorityQueueFree HeapFree
#define PriorityQueuePeek HeapPeek
#define PriorityQueueNext HeapNext
#define PriorityQueueInsert HeapInsert
#define PriorityQueueDelete HeapDelete
#define PriorityQueueSanityCheck HeapSanityCheck
#define PriorityQueuePrint HeapPrint
#define PriorityQueueTypePrint HeapTypePrint

#elif PQ_LL

#include "linked-list.h"

/* this is returned if any errors occur */
#define PRIORITY_QUEUE_ERROR LINKED_LIST_ERROR

typedef LINKED_LIST PRIORITY_QUEUE;

#define PriorityQueueAlloc LinkedListAlloc
#define PriorityQueueReset LinkedListReset
#define PriorityQueueSize LinkedListSize
#define PriorityQueueFree LinkedListFree
#define PriorityQueuePeek LinkedListPeek
#define PriorityQueueNext LinkedListNext
#define PriorityQueueInsert LinkedListInsert
#define PriorityQueueDelete LinkedListDelete
#define PriorityQueueSanityCheck(p) LinkedListSanityCheck(p,true)
#define PriorityQueuePrint /*LinkedListPrint*/
#define PriorityQueueTypePrint LinkedListTypePrint

#endif /* PQ_HEAP / PQ_LL */
#endif  /* _PRIORITY_QUEUE_H */
