EECS678: Project 2: Scheduler
|
void * priqueue_at(priqueue_t *q, unsigned int index)
Returns the element at the specified position in this list, or NULL if the queue does not contain an ...
Definition: libpriqueue.c:157
void * priqueue_poll(priqueue_t *q)
Retrieves and removes the head of this queue, or NULL if this queue is empty.
Definition: libpriqueue.c:113
void priqueue_destroy(priqueue_t *q)
Destroys and frees all the memory associated with q.
Definition: libpriqueue.c:291
unsigned int priqueue_offer(priqueue_t *q, void *ptr)
Insert the specified element into this priority queue.
Definition: libpriqueue.c:48
priqueue_t node structure
Definition: libpriqueue.h:21
int(* comparer)(const void *, const void *)
Definition: libpriqueue.h:39
void * data
Definition: libpriqueue.h:22
struct node_t * next
Definition: libpriqueue.h:23
unsigned int priqueue_remove(priqueue_t *q, void *ptr)
Removes all instances of ptr from the queue.
Definition: libpriqueue.c:184
unsigned int size
Definition: libpriqueue.h:38
void priqueue_init(priqueue_t *q, int(*comparer)(const void *, const void *))
Initializes the priqueue_t data structure.
Definition: libpriqueue.c:34
void * priqueue_remove_at(priqueue_t *q, unsigned int index)
Removes the specified index from the queue, moving later elements up a spot in the queue to fill the ...
Definition: libpriqueue.c:244
node_t * root
Definition: libpriqueue.h:37
unsigned int priqueue_size(priqueue_t *q)
Return the number of elements in the queue.
Definition: libpriqueue.c:281
void * priqueue_peek(priqueue_t *q)
Retrieves, but does not remove, the head of this queue, returning NULL if this queue is empty.
Definition: libpriqueue.c:100
Priority Queue Structure.
Definition: libpriqueue.h:36