diff options
| author | 3gg <3gg@shellblade.net> | 2023-06-12 08:52:15 -0700 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2023-06-12 08:52:15 -0700 |
| commit | bfabb435e5c5bf313005c4636747fce59eb4ca6f (patch) | |
| tree | a32248966dd2cfa851a1bc731c3b240ebfaf9110 /list/src | |
| parent | 0c1eb2535676a6fb2e1def08f9681b2a8b49f6e4 (diff) | |
Add list library.
Diffstat (limited to 'list/src')
| -rw-r--r-- | list/src/list.c | 14 |
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 | |||
| 5 | void 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 | } | ||
