|
nfs-ganesha 1.4
|
Go to the source code of this file.
Defines | |
| #define | _RDT_TREE_H |
| #define | RBT_HEAD_INIT(__header) |
| #define | RBT_COUNT(__header) ((__header)->rbt_num_node) |
| #define | RBT_RIGHTMOST(__header) ((__header)->rightmost) |
| #define | RBT_LEFTMOST(__header) ((__header)->leftmost) |
| #define | RBT_VALUE(__node) ((__node)->rbt_value) |
| #define | RBT_OPAQ(__node) ((__node)->rbt_opaq) |
| #define | RBT_INCREMENT(__node) |
| #define | RBT_DECREMENT(__node) |
| #define | RBT_LOOP(__header, __it) for ((__it) = (__header)->leftmost; (__it);) |
| #define | RBT_LOOP_REVERSE(__header, __it) for ((__it) = (__header)->rightmost; (__it);) |
| #define | RBT_ROTATE_LEFT(__xx) |
| #define | RBT_ROTATE_RIGHT(__xx) |
| #define | RBT_INSERT(__header, __node, __par) |
| #define | RBT_UNLINK(__header, __node) |
| #define | RBT_FIND(__header, __node, __val) |
| #define | RBT_FIND_LEFT(__header, __node, __val) |
| #define | RBT_BLACK_COUNT(__node, __sum) |
| #define | RBT_VERIFY(__header, __it, __error) |
| #define _RDT_TREE_H |
Definition at line 99 of file rbt_tree.h.
| #define RBT_BLACK_COUNT | ( | __node, | |
| __sum | |||
| ) |
{ \
for ((__sum) = 0; (__node); (__node) = (__node)->parent) { \
if (!((__node)->rbt_flags & RBT_RED)) \
++(__sum); \
} \
}
Definition at line 577 of file rbt_tree.h.
| #define RBT_COUNT | ( | __header | ) | ((__header)->rbt_num_node) |
Definition at line 111 of file rbt_tree.h.
| #define RBT_DECREMENT | ( | __node | ) |
{ \
if ((__node)->left) { \
__node = (__node)->left; \
while ((__node)->next) \
(__node) = (__node)->next; \
} else { \
struct rbt_node *__x; \
do { \
__x = (__node); \
} while ((((__node) = (__node)->parent)) && ((__node)->left == __x)); \
} \
}
Definition at line 149 of file rbt_tree.h.
| #define RBT_FIND | ( | __header, | |
| __node, | |||
| __val | |||
| ) |
{ \
struct rbt_node *__x; \
(__node) = (__header)->root; \
__x = (__header)->root; \
while (__x) { \
(__node) = __x; \
if (__x->rbt_value > (__val)) { \
__x = __x->left; \
} else if (__x->rbt_value < (__val)) { \
__x = __x->next; \
} else { \
break; \
} \
} \
}
Definition at line 504 of file rbt_tree.h.
| #define RBT_FIND_LEFT | ( | __header, | |
| __node, | |||
| __val | |||
| ) |
{ \
struct rbt_node *__x; \
(__node) = 0; \
__x = (__header)->root; \
while (__x) { \
if (__x->rbt_value > (__val)) { \
__x = __x->left; \
} else if (__x->rbt_value < (__val)) { \
__x = __x->next; \
} else { \
(__node) = __x; \
while (__x) { \
while ((__x = __x->left)) { \
if (__x->rbt_value < (__val)) \
break; \
(__node) = __x; \
} \
if (__x == 0) \
break; \
while ((__x = __x->next)) { \
if (__x->rbt_value == (__val)) { \
(__node) = __x; \
break; \
} \
} \
} \
break; \
} \
} \
}
Definition at line 542 of file rbt_tree.h.
| #define RBT_HEAD_INIT | ( | __header | ) |
((__header)->root = 0, \ (__header)->leftmost = 0, \ (__header)->rightmost = 0, \ (__header)->rbt_num_node = 0)
Definition at line 105 of file rbt_tree.h.
| #define RBT_INCREMENT | ( | __node | ) |
| #define RBT_INSERT | ( | __header, | |
| __node, | |||
| __par | |||
| ) |
Definition at line 241 of file rbt_tree.h.
| #define RBT_LEFTMOST | ( | __header | ) | ((__header)->leftmost) |
Definition at line 115 of file rbt_tree.h.
| #define RBT_LOOP | ( | __header, | |
| __it | |||
| ) | for ((__it) = (__header)->leftmost; (__it);) |
Definition at line 171 of file rbt_tree.h.
| #define RBT_LOOP_REVERSE | ( | __header, | |
| __it | |||
| ) | for ((__it) = (__header)->rightmost; (__it);) |
Definition at line 174 of file rbt_tree.h.
| #define RBT_OPAQ | ( | __node | ) | ((__node)->rbt_opaq) |
Definition at line 127 of file rbt_tree.h.
| #define RBT_RIGHTMOST | ( | __header | ) | ((__header)->rightmost) |
Definition at line 113 of file rbt_tree.h.
| #define RBT_ROTATE_LEFT | ( | __xx | ) |
{ \
struct rbt_node *__yy; \
__yy = (__xx)->next; \
if (((__xx)->next = __yy->left)) { \
__yy->left->parent = (__xx); \
__yy->left->anchor = &(__xx)->next; \
} \
__yy->parent = (__xx)->parent; \
__yy->left = (__xx); \
__yy->anchor = (__xx)->anchor; \
(__xx)->parent = __yy; \
(__xx)->anchor = &__yy->left; \
*__yy->anchor = __yy; \
}
Definition at line 185 of file rbt_tree.h.
| #define RBT_ROTATE_RIGHT | ( | __xx | ) |
{ \
struct rbt_node *__yy; \
__yy = (__xx)->left; \
if (((__xx)->left = __yy->next)) { \
__yy->next->parent = (__xx); \
__yy->next->anchor = &(__xx)->left; \
} \
__yy->parent = (__xx)->parent; \
__yy->next = (__xx); \
__yy->anchor = (__xx)->anchor; \
(__xx)->parent = __yy; \
(__xx)->anchor = &__yy->next; \
*__yy->anchor = __yy; \
}
Definition at line 201 of file rbt_tree.h.
| #define RBT_UNLINK | ( | __header, | |
| __node | |||
| ) |
Definition at line 337 of file rbt_tree.h.
| #define RBT_VALUE | ( | __node | ) | ((__node)->rbt_value) |
Definition at line 121 of file rbt_tree.h.
| #define RBT_VERIFY | ( | __header, | |
| __it, | |||
| __error | |||
| ) |
Definition at line 585 of file rbt_tree.h.
1.7.3