• Home
  • Raw
  • Download

Lines Matching refs:a_field

52 #define rbtn_left_get(a_type, a_field, a_node)				\  argument
53 ((a_node)->a_field.rbn_left)
54 #define rbtn_left_set(a_type, a_field, a_node, a_left) do { \ argument
55 (a_node)->a_field.rbn_left = a_left; \
60 #define rbtn_right_get(a_type, a_field, a_node) \ argument
61 ((a_type *) (((intptr_t) (a_node)->a_field.rbn_right_red) \
63 #define rbtn_right_set(a_type, a_field, a_node, a_right) do { \ argument
64 (a_node)->a_field.rbn_right_red = (a_type *) (((uintptr_t) a_right) \
65 | (((uintptr_t) (a_node)->a_field.rbn_right_red) & ((size_t)1))); \
69 #define rbtn_red_get(a_type, a_field, a_node) \ argument
70 ((bool) (((uintptr_t) (a_node)->a_field.rbn_right_red) \
72 #define rbtn_color_set(a_type, a_field, a_node, a_red) do { \ argument
73 (a_node)->a_field.rbn_right_red = (a_type *) ((((intptr_t) \
74 (a_node)->a_field.rbn_right_red) & ((ssize_t)-2)) \
77 #define rbtn_red_set(a_type, a_field, a_node) do { \ argument
78 (a_node)->a_field.rbn_right_red = (a_type *) (((uintptr_t) \
79 (a_node)->a_field.rbn_right_red) | ((size_t)1)); \
81 #define rbtn_black_set(a_type, a_field, a_node) do { \ argument
82 (a_node)->a_field.rbn_right_red = (a_type *) (((intptr_t) \
83 (a_node)->a_field.rbn_right_red) & ((ssize_t)-2)); \
87 #define rbt_node_new(a_type, a_field, a_rbt, a_node) do { \ argument
90 rbtn_left_set(a_type, a_field, (a_node), NULL); \
91 rbtn_right_set(a_type, a_field, (a_node), NULL); \
92 rbtn_red_set(a_type, a_field, (a_node)); \
96 #define rbtn_right_get(a_type, a_field, a_node) \ argument
97 ((a_node)->a_field.rbn_right)
98 #define rbtn_right_set(a_type, a_field, a_node, a_right) do { \ argument
99 (a_node)->a_field.rbn_right = a_right; \
103 #define rbtn_red_get(a_type, a_field, a_node) \ argument
104 ((a_node)->a_field.rbn_red)
105 #define rbtn_color_set(a_type, a_field, a_node, a_red) do { \ argument
106 (a_node)->a_field.rbn_red = (a_red); \
108 #define rbtn_red_set(a_type, a_field, a_node) do { \ argument
109 (a_node)->a_field.rbn_red = true; \
111 #define rbtn_black_set(a_type, a_field, a_node) do { \ argument
112 (a_node)->a_field.rbn_red = false; \
116 #define rbt_node_new(a_type, a_field, a_rbt, a_node) do { \ argument
117 rbtn_left_set(a_type, a_field, (a_node), NULL); \
118 rbtn_right_set(a_type, a_field, (a_node), NULL); \
119 rbtn_red_set(a_type, a_field, (a_node)); \
124 #define rb_new(a_type, a_field, a_rbt) do { \ argument
129 #define rbtn_first(a_type, a_field, a_rbt, a_root, r_node) do { \ argument
133 rbtn_left_get(a_type, a_field, (r_node)) != NULL; \
134 (r_node) = rbtn_left_get(a_type, a_field, (r_node))) { \
139 #define rbtn_last(a_type, a_field, a_rbt, a_root, r_node) do { \ argument
142 for (; rbtn_right_get(a_type, a_field, (r_node)) != NULL; \
143 (r_node) = rbtn_right_get(a_type, a_field, (r_node))) { \
148 #define rbtn_rotate_left(a_type, a_field, a_node, r_node) do { \ argument
149 (r_node) = rbtn_right_get(a_type, a_field, (a_node)); \
150 rbtn_right_set(a_type, a_field, (a_node), \
151 rbtn_left_get(a_type, a_field, (r_node))); \
152 rbtn_left_set(a_type, a_field, (r_node), (a_node)); \
155 #define rbtn_rotate_right(a_type, a_field, a_node, r_node) do { \ argument
156 (r_node) = rbtn_left_get(a_type, a_field, (a_node)); \
157 rbtn_left_set(a_type, a_field, (a_node), \
158 rbtn_right_get(a_type, a_field, (r_node))); \
159 rbtn_right_set(a_type, a_field, (r_node), (a_node)); \
342 #define rb_gen(a_attr, a_prefix, a_rbt_type, a_type, a_field, a_cmp) \ argument
345 rb_new(a_type, a_field, rbtree); \
354 rbtn_first(a_type, a_field, rbtree, rbtree->rbt_root, ret); \
360 rbtn_last(a_type, a_field, rbtree, rbtree->rbt_root, ret); \
366 if (rbtn_right_get(a_type, a_field, node) != NULL) { \
367 rbtn_first(a_type, a_field, rbtree, rbtn_right_get(a_type, \
368 a_field, node), ret); \
377 tnode = rbtn_left_get(a_type, a_field, tnode); \
379 tnode = rbtn_right_get(a_type, a_field, tnode); \
391 if (rbtn_left_get(a_type, a_field, node) != NULL) { \
392 rbtn_last(a_type, a_field, rbtree, rbtn_left_get(a_type, \
393 a_field, node), ret); \
401 tnode = rbtn_left_get(a_type, a_field, tnode); \
404 tnode = rbtn_right_get(a_type, a_field, tnode); \
421 ret = rbtn_left_get(a_type, a_field, ret); \
423 ret = rbtn_right_get(a_type, a_field, ret); \
437 tnode = rbtn_left_get(a_type, a_field, tnode); \
439 tnode = rbtn_right_get(a_type, a_field, tnode); \
455 tnode = rbtn_left_get(a_type, a_field, tnode); \
458 tnode = rbtn_right_get(a_type, a_field, tnode); \
472 rbt_node_new(a_type, a_field, rbtree, node); \
479 pathp[1].node = rbtn_left_get(a_type, a_field, \
482 pathp[1].node = rbtn_right_get(a_type, a_field, \
492 rbtn_left_set(a_type, a_field, cnode, left); \
493 if (rbtn_red_get(a_type, a_field, left)) { \
494 a_type *leftleft = rbtn_left_get(a_type, a_field, left);\
495 if (leftleft != NULL && rbtn_red_get(a_type, a_field, \
499 rbtn_black_set(a_type, a_field, leftleft); \
500 rbtn_rotate_right(a_type, a_field, cnode, tnode); \
508 rbtn_right_set(a_type, a_field, cnode, right); \
509 if (rbtn_red_get(a_type, a_field, right)) { \
510 a_type *left = rbtn_left_get(a_type, a_field, cnode); \
511 if (left != NULL && rbtn_red_get(a_type, a_field, \
514 rbtn_black_set(a_type, a_field, left); \
515 rbtn_black_set(a_type, a_field, right); \
516 rbtn_red_set(a_type, a_field, cnode); \
520 bool tred = rbtn_red_get(a_type, a_field, cnode); \
521 rbtn_rotate_left(a_type, a_field, cnode, tnode); \
522 rbtn_color_set(a_type, a_field, tnode, tred); \
523 rbtn_red_set(a_type, a_field, cnode); \
534 rbtn_black_set(a_type, a_field, rbtree->rbt_root); \
548 pathp[1].node = rbtn_left_get(a_type, a_field, \
551 pathp[1].node = rbtn_right_get(a_type, a_field, \
559 pathp[1].node = rbtn_left_get(a_type, a_field, \
570 bool tred = rbtn_red_get(a_type, a_field, pathp->node); \
571 rbtn_color_set(a_type, a_field, pathp->node, \
572 rbtn_red_get(a_type, a_field, node)); \
573 rbtn_left_set(a_type, a_field, pathp->node, \
574 rbtn_left_get(a_type, a_field, node)); \
579 rbtn_right_set(a_type, a_field, pathp->node, \
580 rbtn_right_get(a_type, a_field, node)); \
581 rbtn_color_set(a_type, a_field, node, tred); \
590 rbtn_left_set(a_type, a_field, nodep[-1].node, \
593 rbtn_right_set(a_type, a_field, nodep[-1].node, \
598 a_type *left = rbtn_left_get(a_type, a_field, node); \
602 assert(!rbtn_red_get(a_type, a_field, node)); \
603 assert(rbtn_red_get(a_type, a_field, left)); \
604 rbtn_black_set(a_type, a_field, left); \
609 rbtn_left_set(a_type, a_field, pathp[-1].node, \
612 rbtn_right_set(a_type, a_field, pathp[-1].node, \
623 if (rbtn_red_get(a_type, a_field, pathp->node)) { \
626 rbtn_left_set(a_type, a_field, pathp[-1].node, NULL); \
635 rbtn_left_set(a_type, a_field, pathp->node, \
637 if (rbtn_red_get(a_type, a_field, pathp->node)) { \
638 a_type *right = rbtn_right_get(a_type, a_field, \
640 a_type *rightleft = rbtn_left_get(a_type, a_field, \
643 if (rightleft != NULL && rbtn_red_get(a_type, a_field, \
655 rbtn_black_set(a_type, a_field, pathp->node); \
656 rbtn_rotate_right(a_type, a_field, right, tnode); \
657 rbtn_right_set(a_type, a_field, pathp->node, tnode);\
658 rbtn_rotate_left(a_type, a_field, pathp->node, \
668 rbtn_rotate_left(a_type, a_field, pathp->node, \
675 rbtn_left_set(a_type, a_field, pathp[-1].node, \
678 rbtn_right_set(a_type, a_field, pathp[-1].node, \
683 a_type *right = rbtn_right_get(a_type, a_field, \
685 a_type *rightleft = rbtn_left_get(a_type, a_field, \
687 if (rightleft != NULL && rbtn_red_get(a_type, a_field, \
696 rbtn_black_set(a_type, a_field, rightleft); \
697 rbtn_rotate_right(a_type, a_field, right, tnode); \
698 rbtn_right_set(a_type, a_field, pathp->node, tnode);\
699 rbtn_rotate_left(a_type, a_field, pathp->node, \
709 rbtn_left_set(a_type, a_field, \
712 rbtn_right_set(a_type, a_field, \
725 rbtn_red_set(a_type, a_field, pathp->node); \
726 rbtn_rotate_left(a_type, a_field, pathp->node, \
733 rbtn_right_set(a_type, a_field, pathp->node, \
735 left = rbtn_left_get(a_type, a_field, pathp->node); \
736 if (rbtn_red_get(a_type, a_field, left)) { \
738 a_type *leftright = rbtn_right_get(a_type, a_field, \
740 a_type *leftrightleft = rbtn_left_get(a_type, a_field, \
743 a_field, leftrightleft)) { \
753 rbtn_black_set(a_type, a_field, leftrightleft); \
754 rbtn_rotate_right(a_type, a_field, pathp->node, \
756 rbtn_rotate_right(a_type, a_field, pathp->node, \
758 rbtn_right_set(a_type, a_field, unode, tnode); \
759 rbtn_rotate_left(a_type, a_field, unode, tnode); \
770 rbtn_red_set(a_type, a_field, leftright); \
771 rbtn_rotate_right(a_type, a_field, pathp->node, \
773 rbtn_black_set(a_type, a_field, tnode); \
782 rbtn_left_set(a_type, a_field, pathp[-1].node, \
785 rbtn_right_set(a_type, a_field, pathp[-1].node, \
790 } else if (rbtn_red_get(a_type, a_field, pathp->node)) { \
791 a_type *leftleft = rbtn_left_get(a_type, a_field, left);\
792 if (leftleft != NULL && rbtn_red_get(a_type, a_field, \
801 rbtn_black_set(a_type, a_field, pathp->node); \
802 rbtn_red_set(a_type, a_field, left); \
803 rbtn_black_set(a_type, a_field, leftleft); \
804 rbtn_rotate_right(a_type, a_field, pathp->node, \
810 rbtn_left_set(a_type, a_field, pathp[-1].node, \
813 rbtn_right_set(a_type, a_field, pathp[-1].node, \
824 rbtn_red_set(a_type, a_field, left); \
825 rbtn_black_set(a_type, a_field, pathp->node); \
830 a_type *leftleft = rbtn_left_get(a_type, a_field, left);\
831 if (leftleft != NULL && rbtn_red_get(a_type, a_field, \
840 rbtn_black_set(a_type, a_field, leftleft); \
841 rbtn_rotate_right(a_type, a_field, pathp->node, \
851 rbtn_left_set(a_type, a_field, \
854 rbtn_right_set(a_type, a_field, \
866 rbtn_red_set(a_type, a_field, left); \
873 assert(!rbtn_red_get(a_type, a_field, rbtree->rbt_root)); \
883 a_field, node), cb, arg)) != NULL || (ret = cb(rbtree, node, \
888 a_field, node), cb, arg); \
898 rbtn_left_get(a_type, a_field, node), cb, arg)) != NULL || \
903 a_field, node), cb, arg); \
906 rbtn_right_get(a_type, a_field, node), cb, arg); \
913 a_field, node), cb, arg); \
936 rbtn_right_get(a_type, a_field, node), cb, arg)) != NULL || \
941 rbtn_left_get(a_type, a_field, node), cb, arg); \
952 rbtn_right_get(a_type, a_field, node), cb, arg)) != NULL || \
957 rbtn_left_get(a_type, a_field, node), cb, arg); \
960 rbtn_left_get(a_type, a_field, node), cb, arg); \
967 rbtn_left_get(a_type, a_field, node), cb, arg); \
989 a_prefix##destroy_recurse(rbtree, rbtn_left_get(a_type, a_field, \
991 rbtn_left_set(a_type, a_field, (node), NULL); \
992 a_prefix##destroy_recurse(rbtree, rbtn_right_get(a_type, a_field, \
994 rbtn_right_set(a_type, a_field, (node), NULL); \