feat(ll)!: add new ll function and rename insert

ds_*ll_insert -> ds_*ll_append to better reflect what it does and there
is now ds_*ll_add to add data anywhere in the ll.
This commit is contained in:
Squibid 2025-11-15 21:39:57 -05:00
parent 46b0219ab4
commit 69dc1dcb45
Signed by: squibid
GPG key ID: BECE5684D3C4005D
4 changed files with 104 additions and 16 deletions

View file

@ -8,8 +8,8 @@ Example of working with a singly linked list (sll):
char *a = "one";
char *b = "two";
ds_sll_t *ll = ds_sll_init();
ds_sll_insert(ll, a); // [ "one" ]
ds_sll_insert(ll, b); // [ "one", "two" ]
ds_sll_append(ll, a); // [ "one" ]
ds_sll_append(ll, b); // [ "one", "two" ]
ds_ll_foreach(ds_sll_t, ll) {
puts(cur->data);
// one