0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 17:51:53 +00:00

Typed list: macro for list length

This commit is contained in:
Maria Matejka 2024-03-21 23:37:04 +01:00 committed by Katerina Kubecova
parent 24d2259dc8
commit 6af2a7e606

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