libFirm
Loading...
Searching...
No Matches
pqueue.h
1/*
2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
4 */
5
13#ifndef FIRM_ADT_PQUEUE_H
14#define FIRM_ADT_PQUEUE_H
15
16#include <stddef.h>
17
18#include "../begin.h"
19
29typedef struct pqueue_t pqueue_t;
30
35FIRM_API pqueue_t *new_pqueue(void);
36
41FIRM_API void del_pqueue(pqueue_t *q);
42
49FIRM_API void pqueue_put(pqueue_t *q, void *data, int priority);
50
56FIRM_API void *pqueue_pop_front(pqueue_t *q);
57
63FIRM_API size_t pqueue_length(pqueue_t const *q);
64
70FIRM_API int pqueue_empty(pqueue_t const *q);
71
74#include "../end.h"
75
76#endif
struct pqueue_t pqueue_t
priority queue
Definition pqueue.h:29
void del_pqueue(pqueue_t *q)
Frees all memory allocated by the priority queue.
void pqueue_put(pqueue_t *q, void *data, int priority)
Inserts a new element into a priority queue.
void * pqueue_pop_front(pqueue_t *q)
Returns and removes the first element, i.e.
pqueue_t * new_pqueue(void)
Creates a new priority queue.
int pqueue_empty(pqueue_t const *q)
Returns true if queue is empty.
size_t pqueue_length(pqueue_t const *q)
Get the length of the priority queue.