diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-15 08:41:54 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-15 08:41:54 -0600 |
commit | 32a1b710b40ce9d53cd0a7bc0c183da87e07f397 (patch) | |
tree | 70f49ed30f0f9839709a093c6af54661eeaad4ee /libmisc/linkedlist.c | |
parent | 4c7c8889d304251553fcf02a35b2065814b04d92 (diff) |
libmisc: Rework linkedlist to be non-intrusive
Diffstat (limited to 'libmisc/linkedlist.c')
-rw-r--r-- | libmisc/linkedlist.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libmisc/linkedlist.c b/libmisc/linkedlist.c index 941702f..71a0aa9 100644 --- a/libmisc/linkedlist.c +++ b/libmisc/linkedlist.c @@ -1,4 +1,4 @@ -/* libmisc/linkedlist.c - Intrusive singly- and doubly- linked lists +/* libmisc/linkedlist.c - Singly- and doubly- linked lists * * Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com> * SPDX-License-Identifier: AGPL-3.0-or-later @@ -12,7 +12,7 @@ /* 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) @@ -22,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; @@ -32,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; @@ -44,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) @@ -57,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); } |