12 #ifndef __METAL_LIST__H__
13 #define __METAL_LIST__H__
34 #define METAL_INIT_LIST(name) { .next = &name, .prev = &name }
39 #define METAL_DECLARE_LIST(name) \
40 struct metal_list name = METAL_INIT_LIST(name)
52 new_node->
next = node;
60 new_node->
prev = node;
80 return list->
next == list;
102 #define metal_list_for_each(list, node) \
103 for ((node) = (list)->next; \
105 (node) = (node)->next)
114 #define metal_list_for_each_safe(list, temp, node) \
115 for ((node) = (list)->next, (temp) = (node)->next; \
117 (node) = (temp), (temp) = (node)->next)
static void metal_list_add_tail(struct metal_list *list, struct metal_list *node)
Definition: list.h:72
static void metal_list_add_after(struct metal_list *node, struct metal_list *new_node)
Definition: list.h:57
static int metal_list_is_empty(struct metal_list *list)
Definition: list.h:78
static void metal_list_add_head(struct metal_list *list, struct metal_list *node)
Definition: list.h:66
#define metal_list_for_each(list, node)
Used for iterating over a list.
Definition: list.h:102
static void metal_list_del(struct metal_list *node)
Definition: list.h:83
static void metal_list_add_before(struct metal_list *node, struct metal_list *new_node)
Definition: list.h:48
static struct metal_list * metal_list_first(struct metal_list *list)
Definition: list.h:91
static void metal_list_init(struct metal_list *list)
Definition: list.h:42
static bool metal_list_find_node(struct metal_list *list, struct metal_list *node)
Definition: list.h:119