mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-08 12:18:42 +00:00
Typed list: macro for list length
This commit is contained in:
parent
59304b2f91
commit
76e43b405f
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user