diff options
Diffstat (limited to 'src/vppinfra/rbtree.h')
-rw-r--r-- | src/vppinfra/rbtree.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vppinfra/rbtree.h b/src/vppinfra/rbtree.h index 79437cdd719..65580584b6d 100644 --- a/src/vppinfra/rbtree.h +++ b/src/vppinfra/rbtree.h @@ -45,15 +45,22 @@ typedef struct rb_tree_ rb_node_index_t root; /**< root index */ } rb_tree_t; +typedef int (*rb_tree_lt_fn) (u32 a, u32 b); + void rb_tree_init (rb_tree_t * rt); rb_node_index_t rb_tree_add (rb_tree_t * rt, u32 key); rb_node_index_t rb_tree_add2 (rb_tree_t * rt, u32 key, uword opaque); +rb_node_index_t rb_tree_add_custom (rb_tree_t * rt, u32 key, uword opaque, + rb_tree_lt_fn ltfn); void rb_tree_del (rb_tree_t * rt, u32 key); +void rb_tree_del_custom (rb_tree_t * rt, u32 key, rb_tree_lt_fn ltfn); void rb_tree_free_nodes (rb_tree_t * rt); u32 rb_tree_n_nodes (rb_tree_t * rt); rb_node_t *rb_tree_min_subtree (rb_tree_t * rt, rb_node_t * x); rb_node_t *rb_tree_max_subtree (rb_tree_t * rt, rb_node_t * x); rb_node_t *rb_tree_search_subtree (rb_tree_t * rt, rb_node_t * x, u32 key); +rb_node_t *rb_tree_search_subtree_custom (rb_tree_t * rt, rb_node_t * x, + u32 key, rb_tree_lt_fn ltfn); rb_node_t *rb_tree_successor (rb_tree_t * rt, rb_node_t * x); rb_node_t *rb_tree_predecessor (rb_tree_t * rt, rb_node_t * x); |