[list] Add list_is_head_entry()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2024-02-14 16:01:43 +00:00
parent 94b39fbe92
commit 88b291d647
2 changed files with 27 additions and 0 deletions

View File

@@ -398,6 +398,17 @@ extern void extern_list_splice_tail_init ( struct list_head *list,
#define list_is_last_entry( entry, head, member ) \
( (head)->prev == &(entry)->member )
/**
* Test if entry is the list head
*
* @v entry List entry
* @v head List head
* @v member Name of list field within iterator's type
* @ret is_head Entry is the list head
*/
#define list_is_head_entry( entry, head, member ) \
( (head) == &(entry)->member )
/**
* Iterate over a list
*