libmetal
Loading...
Searching...
No Matches
List Primitives

Data Structures

struct  metal_list

Macros

#define METAL_INIT_LIST(name)
#define METAL_DECLARE_LIST(name)
#define metal_list_for_each(list, node)
 Used for iterating over a list.
#define metal_list_for_each_safe(list, temp, node)
 Used for iterating over a list safely.

Functions

static void metal_list_init (struct metal_list *list)
static void metal_list_add_before (struct metal_list *node, struct metal_list *new_node)
static void metal_list_add_after (struct metal_list *node, struct metal_list *new_node)
static void metal_list_add_head (struct metal_list *list, struct metal_list *node)
static void metal_list_add_tail (struct metal_list *list, struct metal_list *node)
static int metal_list_is_empty (struct metal_list *list)
static void metal_list_del (struct metal_list *node)
static struct metal_listmetal_list_first (struct metal_list *list)
static bool metal_list_find_node (struct metal_list *list, struct metal_list *node)

Detailed Description

Macro Definition Documentation

◆ METAL_DECLARE_LIST

#define METAL_DECLARE_LIST ( name)
Value:
struct metal_list name = METAL_INIT_LIST(name)
#define METAL_INIT_LIST(name)
Definition list.h:34
Definition list.h:26

◆ METAL_INIT_LIST

#define METAL_INIT_LIST ( name)
Value:
{ .next = &name, .prev = &name }

◆ metal_list_for_each

#define metal_list_for_each ( list,
node )
Value:
for ((node) = (list)->next; \
(node) != (list); \
(node) = (node)->next)

Used for iterating over a list.

Parameters
listPointer to the head node of the list
nodePointer to each node in the list during iteration

◆ metal_list_for_each_safe

#define metal_list_for_each_safe ( list,
temp,
node )
Value:
for ((node) = (list)->next, (temp) = (node)->next; \
(node) != (list); \
(node) = (temp), (temp) = (node)->next)

Used for iterating over a list safely.

Parameters
listPointer to the head node of the list
tempPointer to the next node's address during iteration
nodePointer to each node in the list during iteration

Function Documentation

◆ metal_list_add_after()

void metal_list_add_after ( struct metal_list * node,
struct metal_list * new_node )
inlinestatic

◆ metal_list_add_before()

void metal_list_add_before ( struct metal_list * node,
struct metal_list * new_node )
inlinestatic

◆ metal_list_add_head()

void metal_list_add_head ( struct metal_list * list,
struct metal_list * node )
inlinestatic

◆ metal_list_add_tail()

void metal_list_add_tail ( struct metal_list * list,
struct metal_list * node )
inlinestatic

◆ metal_list_del()

void metal_list_del ( struct metal_list * node)
inlinestatic

◆ metal_list_find_node()

bool metal_list_find_node ( struct metal_list * list,
struct metal_list * node )
inlinestatic

◆ metal_list_first()

struct metal_list * metal_list_first ( struct metal_list * list)
inlinestatic

◆ metal_list_init()

void metal_list_init ( struct metal_list * list)
inlinestatic

◆ metal_list_is_empty()

int metal_list_is_empty ( struct metal_list * list)
inlinestatic