24 RCSIDH(lst_h,
"$Id: 069488816e3639852340bbd2e6c42b96d2887227 $")
30 #include <freeradius-devel/build.h>
31 #include <freeradius-devel/util/talloc.h>
65 #define fr_lst_alloc(_ctx, _cmp, _type, _field, _init) \
66 _fr_lst_alloc(_ctx, _cmp, NULL, (size_t)offsetof(_type, _field), _init)
80 #define fr_lst_talloc_alloc(_ctx, _cmp, _talloc_type, _field, _init) \
81 _fr_lst_alloc(_ctx, _cmp, #_talloc_type, (size_t)offsetof(_talloc_type, _field), _init)
117 #ifndef TALLOC_GET_TYPE_ABORT_NOOP
119 #define FR_LST_VERIFY(_lst) fr_lst_verify(__FILE__, __LINE__, _lst)
120 #elif !defined(NDEBUG)
121 #define FR_LST_VERIFY(_lst) fr_assert(_lst)
123 #define FR_LST_VERIFY(_lst)
140 #define fr_lst_foreach(_lst, _type, _data) \
142 fr_lst_iter_t _iter; \
143 for (_type *_data = fr_lst_iter_init(_lst, &_iter); _data; _data = fr_lst_iter_next(_lst, &_iter))
fr_lst_cmp_t cmp
Comparator function.
size_t offset
Offset of heap index in element structure.
int fr_lst_extract(fr_lst_t *lst, void *data)
Remove an element from an LST.
fr_lst_t * _fr_lst_alloc(TALLOC_CTX *ctx, fr_lst_cmp_t cmp, char const *type, size_t offset, fr_lst_index_t init))
void fr_lst_verify(char const *file, int line, fr_lst_t const *lst)
void * fr_lst_pop(fr_lst_t *lst)
static bool fr_lst_entry_inserted(fr_lst_index_t lst_id)
Check if an entry is inserted into an LST.
fr_lst_index_t fr_lst_iter_t
void * fr_lst_iter_next(fr_lst_t *lst, fr_lst_iter_t *iter)
Get the next entry in an LST.
int8_t(* fr_lst_cmp_t)(void const *a, void const *b)
int fr_lst_insert(fr_lst_t *lst, void *data)
unsigned int fr_lst_num_elements(fr_lst_t *lst)
void * fr_lst_peek(fr_lst_t *lst)
unsigned int fr_lst_index_t
void * fr_lst_iter_init(fr_lst_t *lst, fr_lst_iter_t *iter)
Iterate over entries in LST.
init
Enter the EAP-IDENTITY state.
fr_aka_sim_id_type_t type