17 #ifndef included_slist_h 18 #define included_slist_h 29 (
void *key,
u32 elt_pool_index);
63 return elt->
n.
nexts[level];
70 u32 old_level0_value[2];
72 if (level < 2 && (elt->
n.
next0[0] == 0 || elt->
n.
next0[0] & 1))
76 elt->
n.
next0[0] = (index<<1) | 1;
85 old_level0_value[0] = (elt->
n.
next0[0] == (
u32)~0) ?
87 old_level0_value[1] = elt->
n.
next0[1];
93 elt->
n.
nexts[level] = index;
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
word( clib_slist_key_compare_function_t)(void *key, u32 elt_pool_index)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
clib_slist_search_result_t clib_slist_del(clib_slist_t *sp, void *key)
void clib_slist_add(clib_slist_t *sp, void *key, u32 user_pool_index)
clib_slist_key_compare_function_t * compare
clib_slist_search_result_t
format_function_t format_slist
static u32 clib_slist_get_next_at_level(clib_slist_elt_t *elt, int level)
u32 clib_slist_search(clib_slist_t *sp, void *key, u32 *ncompares)
format_function_t * format_user_element
static void clib_slist_set_next_at_level(clib_slist_elt_t *elt, u32 index, int level)
union clib_slist_elt_t::@23 n
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
clib_error_t * clib_slist_init(clib_slist_t *sp, f64 branching_factor, clib_slist_key_compare_function_t compare, format_function_t format_user_element)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".