7 struct queue_entry *next;
12 struct queue_entry *front, *back;
16 struct queue* queue_new(void) {
17 struct queue *q = malloc(sizeof(struct queue));
19 q->front = q->back = NULL;
24 void queue_free(struct queue* q, void (*destroy)(void *p, void *userdata), void *userdata) {
25 struct queue_entry *e;
30 struct queue_entry *n = e->next;
33 destroy(e->data, userdata);
42 void queue_push(struct queue *q, void *p) {
43 struct queue_entry *e;
45 e = malloc(sizeof(struct queue_entry));
61 void* queue_pop(struct queue *q) {
63 struct queue_entry *e;