ref: f5842a711849cdef98b447a553dde0b85b277c5f
parent: 486766a86d96df60cca40f39ffd8cb63b0530112
author: mkf <mkf@cloud9p.org>
date: Mon Nov 20 12:52:00 EST 2023
tidy lladd, add lldel
--- a/libc/lladd.c
+++ b/libc/lladd.c
@@ -11,9 +11,7 @@
temp->next = nil;
if(last->next != nil)
- {
return LL_ERR;
- }
last->next = temp;
return OK;
--- a/libc/lldel.c
+++ b/libc/lldel.c
@@ -1,0 +1,12 @@
+/* deletes the next entry in the list */
+int
+lldel(ll_t *ll)
+{
+ ll_t *temp = ll->next;
+ if(ll->next != nil)
+ return LL_ERR;
+
+ ll->next = ll->next->next;
+ free(temp);
+ return OK;
+}