Warning: That file was not part of the compilation database. It may have many parsing errors.

1/* @title: Deprecated queue */
2#define queue_pop_front(q, var) \
3 typeof(q->head) var = q->head; \
4 if (var) { \
5 q->head = var->next; \
6 if (q->head == NULL) { \
7 q->tail = NULL; \
8 } \
9 var->next = NULL; \
10 }
11
12#define queue_push_back(q, thing) \
13 thing->next = NULL; \
14 if (q->tail) { \
15 q->tail->next = thing; \
16 } else { \
17 q->head = thing; \
18 } \
19 q->tail = thing;
20
21#define queue_remove(q, t, val) \
22 typeof(q->head) prev = NULL; \
23 typeof(q->head) curr = q->head; \
24 \
25 while (curr) { \
26 if (curr == t) { \
27 if (prev) { \
28 prev->next = curr->next; \
29 } else { \
30 q->head = curr->next; \
31 } \
32 \
33 if (q->tail == curr) { \
34 q->tail = prev; \
35 } \
36 val = true; \
37 break; \
38 } \
39 \
40 prev = curr; \
41 curr = curr->next; \
42 }
43

Warning: That file was not part of the compilation database. It may have many parsing errors.