diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-01-17 22:49:31 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-01-17 22:49:31 +0100 |
| commit | 1a66f5d069e4ccb600186918f716323aa7bae052 (patch) | |
| tree | 9010251014a766f29d1c2fb6c30c9abdb1766962 /lib/list/list.c | |
| parent | b2146cd4d6e6f5fda36d59c054e0634a2098a03c (diff) | |
add tctl and list
Diffstat (limited to 'lib/list/list.c')
| -rw-r--r-- | lib/list/list.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/list/list.c b/lib/list/list.c index 753fdb1..8064da4 100644 --- a/lib/list/list.c +++ b/lib/list/list.c @@ -28,6 +28,20 @@ list_t *from_array(void **array, u64 size) } +void free_list(list_t *list) +{ + list_node_t *node = list->first; + list_node_t *next; + free(list); + + while (node) { + next = node->next; + free(node); + node = next; + } +} + + void list_append(list_t *list, void *value) { list_node_t *node = __new_list_node(value); |