Rizin
unix-like reverse engineering framework and cli tools
rb.h File Reference

Go to the source code of this file.

Macros

#define rb_node(a_type)
 
#define rb_tree(a_type)
 
#define rbtn_left_get(a_type, a_field, a_node)    ((a_node)->a_field.rbn_left)
 
#define rbtn_left_set(a_type, a_field, a_node, a_left)
 
#define rbtn_right_get(a_type, a_field, a_node)    ((a_node)->a_field.rbn_right)
 
#define rbtn_right_set(a_type, a_field, a_node, a_right)
 
#define rbtn_red_get(a_type, a_field, a_node)    ((a_node)->a_field.rbn_red)
 
#define rbtn_color_set(a_type, a_field, a_node, a_red)
 
#define rbtn_red_set(a_type, a_field, a_node)
 
#define rbtn_black_set(a_type, a_field, a_node)
 
#define rbt_node_new(a_type, a_field, a_rbt, a_node)
 
#define rb_new(a_type, a_field, a_rbt)
 
#define rbtn_first(a_type, a_field, a_rbt, a_root, rz_node)
 
#define rbtn_last(a_type, a_field, a_rbt, a_root, rz_node)
 
#define rbtn_rotate_left(a_type, a_field, a_node, rz_node)
 
#define rbtn_rotate_right(a_type, a_field, a_node, rz_node)
 
#define rb_proto(a_attr, a_prefix, a_rbt_type, a_type)
 
#define rb_gen(a_attr, a_prefix, a_rbt_type, a_type, a_field, a_cmp)
 

Macro Definition Documentation

◆ rb_gen

#define rb_gen (   a_attr,
  a_prefix,
  a_rbt_type,
  a_type,
  a_field,
  a_cmp 
)

Definition at line 338 of file rb.h.

◆ rb_new

#define rb_new (   a_type,
  a_field,
  a_rbt 
)
Value:
do { \
(a_rbt)->rbt_root = NULL; \
} while (0)
#define NULL
Definition: cris-opc.c:27

Definition at line 120 of file rb.h.

◆ rb_node

#define rb_node (   a_type)
Value:
struct { \
a_type *rbn_left; \
a_type *rbn_right; \
bool rbn_red; \
}

Definition at line 33 of file rb.h.

◆ rb_proto

#define rb_proto (   a_attr,
  a_prefix,
  a_rbt_type,
  a_type 
)

Definition at line 163 of file rb.h.

◆ rb_tree

#define rb_tree (   a_type)
Value:
struct { \
a_type *rbt_root; \
}

Definition at line 42 of file rb.h.

◆ rbt_node_new

#define rbt_node_new (   a_type,
  a_field,
  a_rbt,
  a_node 
)
Value:
do { \
rbtn_left_set(a_type, a_field, (a_node), NULL); \
rbtn_right_set(a_type, a_field, (a_node), NULL); \
rbtn_red_set(a_type, a_field, (a_node)); \
} while (0)

Definition at line 112 of file rb.h.

◆ rbtn_black_set

#define rbtn_black_set (   a_type,
  a_field,
  a_node 
)
Value:
do { \
(a_node)->a_field.rbn_red = false; \
} while (0)

Definition at line 107 of file rb.h.

◆ rbtn_color_set

#define rbtn_color_set (   a_type,
  a_field,
  a_node,
  a_red 
)
Value:
do { \
(a_node)->a_field.rbn_red = (a_red); \
} while (0)

Definition at line 101 of file rb.h.

◆ rbtn_first

#define rbtn_first (   a_type,
  a_field,
  a_rbt,
  a_root,
  rz_node 
)
Value:
do { \
(rz_node) = (a_root); \
if ((rz_node) != NULL) { \
for (; \
rbtn_left_get(a_type, a_field, (rz_node)) != NULL; \
(rz_node) = rbtn_left_get(a_type, a_field, (rz_node))) { \
} \
} \
} while (0)
#define rbtn_left_get(a_type, a_field, a_node)
Definition: rb.h:48

Definition at line 125 of file rb.h.

◆ rbtn_last

#define rbtn_last (   a_type,
  a_field,
  a_rbt,
  a_root,
  rz_node 
)
Value:
do { \
(rz_node) = (a_root); \
if ((rz_node) != NULL) { \
for (; rbtn_right_get(a_type, a_field, (rz_node)) != NULL; \
(rz_node) = rbtn_right_get(a_type, a_field, (rz_node))) { \
} \
} \
} while (0)
#define rbtn_right_get(a_type, a_field, a_node)
Definition: rb.h:92

Definition at line 135 of file rb.h.

◆ rbtn_left_get

#define rbtn_left_get (   a_type,
  a_field,
  a_node 
)     ((a_node)->a_field.rbn_left)

Definition at line 48 of file rb.h.

◆ rbtn_left_set

#define rbtn_left_set (   a_type,
  a_field,
  a_node,
  a_left 
)
Value:
do { \
(a_node)->a_field.rbn_left = a_left; \
} while (0)

Definition at line 50 of file rb.h.

◆ rbtn_red_get

#define rbtn_red_get (   a_type,
  a_field,
  a_node 
)     ((a_node)->a_field.rbn_red)

Definition at line 99 of file rb.h.

◆ rbtn_red_set

#define rbtn_red_set (   a_type,
  a_field,
  a_node 
)
Value:
do { \
(a_node)->a_field.rbn_red = true; \
} while (0)

Definition at line 104 of file rb.h.

◆ rbtn_right_get

#define rbtn_right_get (   a_type,
  a_field,
  a_node 
)     ((a_node)->a_field.rbn_right)

Definition at line 92 of file rb.h.

◆ rbtn_right_set

#define rbtn_right_set (   a_type,
  a_field,
  a_node,
  a_right 
)
Value:
do { \
(a_node)->a_field.rbn_right = a_right; \
} while (0)

Definition at line 94 of file rb.h.

◆ rbtn_rotate_left

#define rbtn_rotate_left (   a_type,
  a_field,
  a_node,
  rz_node 
)
Value:
do { \
(rz_node) = rbtn_right_get(a_type, a_field, (a_node)); \
rbtn_right_set(a_type, a_field, (a_node), \
rbtn_left_get(a_type, a_field, (rz_node))); \
rbtn_left_set(a_type, a_field, (rz_node), (a_node)); \
} while (0)

Definition at line 144 of file rb.h.

◆ rbtn_rotate_right

#define rbtn_rotate_right (   a_type,
  a_field,
  a_node,
  rz_node 
)
Value:
do { \
(rz_node) = rbtn_left_get(a_type, a_field, (a_node)); \
rbtn_left_set(a_type, a_field, (a_node), \
rbtn_right_get(a_type, a_field, (rz_node))); \
rbtn_right_set(a_type, a_field, (rz_node), (a_node)); \
} while (0)

Definition at line 151 of file rb.h.