Mercurial > hg > nginx-quic
comparison src/core/ngx_rbtree.h @ 1023:68cc5e2e1a5d
make global the rbtree color handling macros
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 12 Jan 2007 19:48:30 +0000 |
parents | 2e3754f37606 |
children | 33c2e3c6f02c |
comparison
equal
deleted
inserted
replaced
1022:7058eb754ef0 | 1023:68cc5e2e1a5d |
---|---|
48 ngx_rbtree_node_t *sentinel); | 48 ngx_rbtree_node_t *sentinel); |
49 void ngx_rbtree_insert_timer_value(ngx_rbtree_node_t *root, | 49 void ngx_rbtree_insert_timer_value(ngx_rbtree_node_t *root, |
50 ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel); | 50 ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel); |
51 | 51 |
52 | 52 |
53 #define ngx_rbt_red(node) ((node)->color = 1) | |
54 #define ngx_rbt_black(node) ((node)->color = 0) | |
55 #define ngx_rbt_is_red(node) ((node)->color) | |
56 #define ngx_rbt_is_black(node) (!ngx_rbt_is_red(node)) | |
57 #define ngx_rbt_copy_color(n1, n2) (n1->color = n2->color) | |
58 | |
59 | |
53 /* a sentinel must be black */ | 60 /* a sentinel must be black */ |
54 | 61 |
55 #define ngx_rbtree_sentinel_init(node) node->color = 0 | 62 #define ngx_rbtree_sentinel_init(node) ngx_rbt_black(node) |
56 | 63 |
57 | 64 |
58 static ngx_inline ngx_rbtree_node_t * | 65 static ngx_inline ngx_rbtree_node_t * |
59 ngx_rbtree_min(ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel) | 66 ngx_rbtree_min(ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel) |
60 { | 67 { |