MOS Source Code
Loading...
Searching...
No Matches
list.c File Reference
+ Include dependency graph for list.c:

Go to the source code of this file.

Functions

void linked_list_init (list_node_t *node)
 Initialise a circular double linked list.
 
bool list_is_empty (const list_node_t *head)
 
void list_node_remove (list_node_t *node)
 
static void list_node_insert (list_node_t *prev, list_node_t *new_node, list_node_t *next)
 Insert a node into a list.
 
list_node_t * list_node_pop (list_node_t *head)
 
void list_node_prepend (list_node_t *head, list_node_t *item)
 
void list_node_append (list_node_t *head, list_node_t *item)
 
void list_node_insert_before (list_node_t *element, list_node_t *item)
 
void list_node_insert_after (list_node_t *element, list_node_t *item)
 

Function Documentation

◆ list_node_insert()

static void list_node_insert ( list_node_t * prev,
list_node_t * new_node,
list_node_t * next )
static

Insert a node into a list.

Postcondition
node->next == next
node->prev == prev
prev->next == node
next->prev == node
Parameters
prevThe node before the insertion point
new_nodeThe node to insert
nextThe node after the insertion point

Definition at line 48 of file list.c.

Referenced by list_node_append(), list_node_insert_after(), list_node_insert_before(), and list_node_prepend().