aboutsummaryrefslogtreecommitdiff
path: root/list/src/list.c
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2023-06-12 08:52:15 -0700
committer3gg <3gg@shellblade.net>2023-06-12 08:52:15 -0700
commitbfabb435e5c5bf313005c4636747fce59eb4ca6f (patch)
treea32248966dd2cfa851a1bc731c3b240ebfaf9110 /list/src/list.c
parent0c1eb2535676a6fb2e1def08f9681b2a8b49f6e4 (diff)
Add list library.
Diffstat (limited to 'list/src/list.c')
-rw-r--r--list/src/list.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/list/src/list.c b/list/src/list.c
deleted file mode 100644
index f5b6507..0000000
--- a/list/src/list.c
+++ /dev/null
@@ -1,14 +0,0 @@
1#include "list.h"
2
3#include <assert.h>
4
5void list_make(list* list, size_t size) {
6 if (size == 0) {
7 return;
8 }
9 assert(list);
10 for (size_t i = 0; i < size; ++i) {
11 list[i].prev = (i == 0 ? 0 : &list[i - 1]);
12 list[i].next = (i == size - 1 ? 0 : &list[i + 1]);
13 }
14}