1
2 /*
3 * Copyright (C) Igor Sysoev
4 */
5
6
7 #include <ngx_config.h>
8 #include <ngx_core.h>
9
10
11 #ifndef _NGX_QUEUE_H_INCLUDED_
12 #define _NGX_QUEUE_H_INCLUDED_
13
14
15 typedef struct ngx_queue_s ngx_queue_t;
16
17 struct ngx_queue_s {
18 ngx_queue_t *prev;
19 ngx_queue_t *next;
20 };
21
22
23 #define ngx_queue_init(q) \
24 (q)->prev = q; \
25 (q)->next = q
26
27
28 #define ngx_queue_empty(h) \
29 (h == (h)->prev)
30
31
32 #define ngx_queue_insert_head(h, x) \
33 (x)->next = (h)->next; \
34 (x)->next->prev = x; \
35 (x)->prev = h; \
36 (h)->next = x
37
38
39 #define ngx_queue_head(h) \
40 (h)->next
41
42
43 #define ngx_queue_last(h) \
44 (h)->prev
45
46
47 #if (NGX_DEBUG)
48
49 #define ngx_queue_remove(x) \
50 (x)->next->prev = (x)->prev; \
51 (x)->prev->next = (x)->next; \
52 (x)->prev = NULL; \
53 (x)->next = NULL
54
55 #else
56
57 #define ngx_queue_remove(x) \
58 (x)->next->prev = (x)->prev; \
59 (x)->prev->next = (x)->next
60
61 #endif
62
63
64 #define ngx_queue_data(q, type, link) \
65 (type *) ((u_char *) q - offsetof(type, link))
66
67
68 #endif /* _NGX_QUEUE_H_INCLUDED_ */
69
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.