diff options
Diffstat (limited to 'libmisc/linkedlist.c')
-rw-r--r-- | libmisc/linkedlist.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libmisc/linkedlist.c b/libmisc/linkedlist.c index 5fe0977..71a0aa9 100644 --- a/libmisc/linkedlist.c +++ b/libmisc/linkedlist.c @@ -6,11 +6,13 @@ #include <stddef.h> /* for NULL */ +#include <libmisc/assert.h> + #include <libmisc/linkedlist.h> /* singly linked list *********************************************************/ -void lm_sll_push_to_rear(lm_sll_root *root, lm_sll_node *node) { +void _slist_push_to_rear(struct _slist_root *root, struct _slist_node *node) { assert(root); node->rear = NULL; if (root->rear) @@ -20,7 +22,7 @@ void lm_sll_push_to_rear(lm_sll_root *root, lm_sll_node *node) { root->rear = node; } -void lm_sll_pop_from_front(lm_sll_root *root) { +void _slist_pop_from_front(struct _slist_root *root) { assert(root); assert(root->front); root->front = root->front->rear; @@ -30,7 +32,7 @@ void lm_sll_pop_from_front(lm_sll_root *root) { /* doubly linked list *********************************************************/ -void lm_dll_push_to_rear(lm_dll_root *root, lm_dll_node *node) { +void _dlist_push_to_rear(struct _dlist_root *root, struct _dlist_node *node) { assert(root); assert(node); node->front = root->rear; @@ -42,7 +44,7 @@ void lm_dll_push_to_rear(lm_dll_root *root, lm_dll_node *node) { root->rear = node; } -void lm_dll_remove(lm_dll_root *root, lm_dll_node *node) { +void _dlist_remove(struct _dlist_root *root, struct _dlist_node *node) { assert(root); assert(node); if (node->front) @@ -55,8 +57,8 @@ void lm_dll_remove(lm_dll_root *root, lm_dll_node *node) { root->rear = node->front; } -void lm_dll_pop_from_front(lm_dll_root *root) { +void _dlist_pop_from_front(struct _dlist_root *root) { assert(root); assert(root->front); - lm_dll_remove(root, root->front); + _dlist_remove(root, root->front); } |