46#define list_node_entry(ptr, type, member) container_of(ptr, type, member)
51static inline void internal_list_node_add_between(
struct list_node *node_ptr,
struct list_node *before_ptr,
66 assert(node_ptr != NULL);
81 assert(node_ptr != NULL);
82 assert(head_ptr != NULL);
84 return node_ptr->
prev_ptr == head_ptr;
98 assert(node_ptr != NULL);
99 assert(tail_ptr != NULL);
101 return node_ptr->
next_ptr == tail_ptr;
114 assert(node_ptr != NULL);
115 assert(head_ptr != NULL);
117 return node_ptr == head_ptr;
130 assert(node_ptr != NULL);
131 assert(tail_ptr != NULL);
133 return node_ptr == tail_ptr;
146 assert(node_ptr != NULL);
162 assert(node_ptr != NULL);
181 assert(node_ptr != NULL);
182 assert(node_ptr->
prev_ptr != node_ptr);
183 assert(node_ptr->
next_ptr != node_ptr);
203 assert(old_ptr != NULL);
204 assert(new_ptr != NULL);
205 assert(old_ptr != new_ptr);
206 assert(old_ptr->
prev_ptr != old_ptr);
207 assert(old_ptr->
next_ptr != old_ptr);
209 internal_list_node_add_between(new_ptr, old_ptr->
prev_ptr, old_ptr->
next_ptr);
215static inline void internal_list_node_add_between(
struct list_node *node_ptr,
struct list_node *before_ptr,
218 assert(node_ptr != NULL);
219 assert(before_ptr != NULL);
220 assert(after_ptr != NULL);
static void list_node_add_after(struct list_node *node_ptr, struct list_node *prev_ptr)
Add a node after the given node.
Definition list.h:144
static bool list_node_is_head(const struct list_node *node_ptr, const struct list_node *head_ptr)
Check if a given list node is the head of the list.
Definition list.h:112
static bool list_node_is_last(const struct list_node *node_ptr, const struct list_node *tail_ptr)
Check if a given list node is the last of the list (aka before the tail).
Definition list.h:96
static bool list_node_is_first(const struct list_node *node_ptr, const struct list_node *head_ptr)
Check if a given list node is first in the list (aka after the head).
Definition list.h:79
static bool list_node_is_tail(const struct list_node *node_ptr, const struct list_node *tail_ptr)
Check if a given list node is the tail of the list.
Definition list.h:128
static void list_node_add_before(struct list_node *node_ptr, struct list_node *next_ptr)
Add a node before the given node.
Definition list.h:160
static struct list_node * list_node_remove(struct list_node *node_ptr)
Remove a node and deattach it from the list it resides in.
Definition list.h:179
static void list_node_replace(struct list_node *old_ptr, struct list_node *new_ptr)
Replace a given node by a new node.
Definition list.h:201
static void list_node_init(struct list_node *node_ptr)
Initialize a list node.
Definition list.h:64
Intrusive list node structure.
Definition list.h:31
struct list_node * next_ptr
next node pointer.
Definition list.h:33
struct list_node * prev_ptr
prev node pointer.
Definition list.h:32