0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 01:31:55 +00:00

Typed list: macro for list length

This commit is contained in:
Maria Matejka 2024-03-21 23:37:04 +01:00
parent a6f65d99b4
commit 6806aacf74

View File

@ -231,5 +231,8 @@ static inline void TLIST_NAME(rem_node)(TLIST_LIST_STRUCT *list, TLIST_TYPE *nod
/* Empty check */
#define EMPTY_TLIST(_name, _list) (!(_list)->first)
/* List length */
#define TLIST_LENGTH(_name, _list) ({ uint _len = 0; WALK_TLIST(_name, _, _list) _len++; _len; })
#endif