summaryrefslogtreecommitdiff
path: root/docs/examples/tutorial/clibraries/c-algorithms/src/queue.h
blob: 642bf54aff088159bcd77a9b5a876a209e67df37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* queue.h */

typedef struct _Queue Queue;
typedef void *QueueValue;

Queue *queue_new(void);
void queue_free(Queue *queue);

int queue_push_head(Queue *queue, QueueValue data);
QueueValue queue_pop_head(Queue *queue);
QueueValue queue_peek_head(Queue *queue);

int queue_push_tail(Queue *queue, QueueValue data);
QueueValue queue_pop_tail(Queue *queue);
QueueValue queue_peek_tail(Queue *queue);

int queue_is_empty(Queue *queue);