MOS Source Code
Loading...
Searching...
No Matches
list.h File Reference
#include <mos/types.h>
+ Include dependency graph for list.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  list_node_t
 A node in a linked list. More...
 

Macros

#define as_linked_list   list_node_t list_node
 Embed a list node into a struct.
 
#define LIST_HEAD_INIT(container)
 
#define LIST_NODE_INIT(container)
 
#define list_entry(node, type)
 Get the container struct of a list node.
 
#define list_prev_entry(item, type)
 Get the next element in a list.
 
#define list_next_entry(item, type)
 Get the next element in a list.
 
#define list_node_next_entry(node, type)
 Get the next list node.
 
#define list_node(element)
 Get the ‘list_node’ of a list element. This is exactly the reverse of ‘list_entry’ above.
 
#define list_prepend(element, item)
 
#define list_append(element, item)
 
#define list_insert_before(element, item)
 
#define list_insert_after(element, item)
 
#define list_remove(element)
 
#define list_foreach(t, v, h)
 Iterate over a list.
 
#define list_foreach_reverse(t, v, h)
 
#define list_node_foreach(v, h)
 
#define list_node_foreach_reverse(v, h)
 
#define list_headless_foreach(t, v, h)
 
#define list_headless_foreach_reverse(t, v, h)
 

Typedefs

typedef list_node_t list_head
 A linked list head.
 

Functions

MOSAPI void linked_list_init (list_node_t *head_node)
 Initialise a circular double linked list.
 
MOSAPI bool list_is_empty (const list_node_t *head)
 
MOSAPI void list_node_remove (list_node_t *link)
 
MOSAPI list_node_t * list_node_pop (list_node_t *head)
 
MOSAPI void list_node_prepend (list_node_t *head, list_node_t *item)
 
MOSAPI void list_node_append (list_node_t *head, list_node_t *item)
 
MOSAPI void list_node_insert_before (list_node_t *element, list_node_t *item)
 
MOSAPI void list_node_insert_after (list_node_t *element, list_node_t *item)