diff options
author | Michael Brown <mcb30@ipxe.org> | 2024-02-14 16:01:43 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2024-02-14 16:25:21 +0000 |
commit | 88b291d647686ac686a5614fdd7be92b48747360 (patch) | |
tree | a480bfc224f2b43b02bd588becaa1ce424987eef /src/include | |
parent | 94b39fbe9298160b034c93ca06deb39a907e3b3f (diff) | |
download | ipxe-88b291d647686ac686a5614fdd7be92b48747360.tar.gz |
[list] Add list_is_head_entry()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/ipxe/list.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/ipxe/list.h b/src/include/ipxe/list.h index 8de254984..53edfc9f7 100644 --- a/src/include/ipxe/list.h +++ b/src/include/ipxe/list.h @@ -399,6 +399,17 @@ extern void extern_list_splice_tail_init ( struct list_head *list, ( (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 * * @v pos Iterator |