/*
 * Priority Queue 
 */


/* This is an implementation of a priority queue as a sorted linked
   list. If you want a really fast implementation use a fibonacci
   priority queue. */

#ifndef _PQUEUE_H
#define _PQUEUE_H

/* Memory type */
#define MTYPE_PQUEUE      0

/* Priority queue */
struct pqueue 
{
  struct node *head;
  struct node *tail;
  int count;
};

struct pqueue *pqueue_new(void);
void pqueue_init(struct pqueue *pq);
void pqueue_free(struct pqueue *pq);
int pqueue_isempty(struct pqueue *pq);
void pqueue_print(struct pqueue *pq);
void pqueue_insert(struct pqueue *pq, struct node *n);
struct node *pqueue_remove_first(struct pqueue *pq);
void pqueue_remove(struct pqueue *pq, struct node *n);

#endif /* _PQUEUE_H */
