2022/day 1 (C) - save from laptop
This commit is contained in:
@@ -152,6 +152,14 @@ extern void plist_requeue(struct plist_node *node, struct plist_head *head);
|
||||
#define plist_for_each(pos, head) \
|
||||
list_for_each_entry(pos, &(head)->node_list, node_list)
|
||||
|
||||
/**
|
||||
* plist_for_each_reverse - iterate backwards over the plist
|
||||
* @pos: the type * to use as a loop counter
|
||||
* @head: the head for your list
|
||||
*/
|
||||
#define plist_for_each_reverse(pos, head) \
|
||||
list_for_each_entry_reverse(pos, &(head)->node_list, node_list)
|
||||
|
||||
/**
|
||||
* plist_for_each_continue - continue iteration over the plist
|
||||
* @pos: the type * to use as a loop cursor
|
||||
@@ -182,6 +190,15 @@ extern void plist_requeue(struct plist_node *node, struct plist_head *head);
|
||||
#define plist_for_each_entry(pos, head, mem) \
|
||||
list_for_each_entry(pos, &(head)->node_list, mem.node_list)
|
||||
|
||||
/**
|
||||
* plist_for_each_entry_reverse - iterate backwards over list of given type
|
||||
* @pos: the type * to use as a loop counter
|
||||
* @head: the head for your list
|
||||
* @mem: the name of the list_head within the struct
|
||||
*/
|
||||
#define plist_for_each_entry_reverse(pos, head, mem) \
|
||||
list_for_each_entry(pos, &(head)->node_list, mem.node_list)
|
||||
|
||||
/**
|
||||
* plist_for_each_entry_continue - continue iteration over list of given type
|
||||
* @pos: the type * to use as a loop cursor
|
||||
|
Reference in New Issue
Block a user