-
Notifications
You must be signed in to change notification settings - Fork 0
/
cirque.h
23 lines (19 loc) · 633 Bytes
/
cirque.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef CIRQUE_H
#define CIRQUE_H
struct cirque {
unsigned int head; /* First element */
unsigned int tail; /* 1 past the last element */
unsigned int is_full;
void ** entries;
unsigned int size;
};
typedef struct cirque cirque;
typedef void (*cirque_forfn)(void*);
cirque * cirque_create(void);
void cirque_delete(cirque * queue);
unsigned int cirque_insert(cirque * queue, void * data);
void * cirque_remove(cirque * queue);
void *cirque_peek(const cirque * queue);
unsigned int cirque_get_count(const cirque * queue);
void cirque_for_each(const cirque * queue, cirque_forfn fun);
#endif /* CIRQUE_H */