75 #define SOL_LIST_INIT(name) { &(name), &(name) }
86 #define SOL_LIST_GET_CONTAINER(list, type, member) (type *)((char *)(list) - offsetof(type, member))
97 #define SOL_LIST_FOREACH(list, itr) for (itr = (list)->next; itr != (list); itr = itr->next)
111 #define SOL_LIST_FOREACH_SAFE(list, itr, itr_next) for (itr = (list)->next, itr_next = itr->next; itr != (list); itr = itr_next, itr_next = itr_next->next)
176 return list->
next == list;
struct sol_list sol_list
Structure to add list support to a type.
static void sol_list_prepend(struct sol_list *list, struct sol_list *new_l)
Attach an new node to the beginning of the list.
Definition: sol-list.h:146
struct sol_list * prev
Link to the previous node in the list.
Definition: sol-list.h:62
static bool sol_list_is_empty(struct sol_list *list)
Convenience function to check if the list is empty.
Definition: sol-list.h:174
Structure to add list support to a type.
Definition: sol-list.h:60
static void sol_list_remove(struct sol_list *list)
Remove the node pointed by list from the list.
Definition: sol-list.h:160
static void sol_list_steal(struct sol_list *list, struct sol_list *new_head)
Steals the list nodes from a list.
Definition: sol-list.h:189
static void sol_list_append(struct sol_list *list, struct sol_list *new_l)
Append an new node to the end of the list.
Definition: sol-list.h:131
struct sol_list * next
Link to the next node in the list.
Definition: sol-list.h:61
static void sol_list_init(struct sol_list *list)
Initializes a sol_list struct.
Definition: sol-list.h:119