summaryrefslogtreecommitdiff
path: root/src/ll.c
diff options
context:
space:
mode:
author@syxhe <https://t.me/syxhe>2025-06-06 13:42:25 -0500
committer@syxhe <https://t.me/syxhe>2025-06-06 13:42:25 -0500
commitec0cfdc492065dcce687797d3a931af105a461c8 (patch)
tree52aa3af71ef6a4ed600b9b7750827fd7521cf2d8 /src/ll.c
parent16528ac295215e788cb226f0cc49f11f82919741 (diff)
Get rid of useless ll-internal files
Diffstat (limited to 'src/ll.c')
-rw-r--r--src/ll.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/ll.c b/src/ll.c
index 6cc2afe..b8d0d4c 100644
--- a/src/ll.c
+++ b/src/ll.c
@@ -1,12 +1,38 @@
1#include "ll.h" 1#include "ll.h"
2#include "ll-internal.h"
3#include "shared.h" 2#include "shared.h"
4 3
5#include <stddef.h>
6#include <stdlib.h> 4#include <stdlib.h>
7#include <errno.h> 5#include <errno.h>
8#include <error.h> 6#include <error.h>
9 7
8typedef struct dln {
9 void *data;
10 dll_freecb freecb;
11
12 struct dln *next;
13 struct dln *prev;
14
15} dllnode;
16typedef struct dlinked {
17 int size;
18 dllnode *start;
19 dllnode *end;
20
21} dlinkedlist;
22
23dllnode * dllnode_init(void *data, dll_freecb fcb) {
24 dllnode *n = VALLOC(1, sizeof(*n));
25 if(!n)
26 return NULL;
27
28 n->data = data;
29 n->freecb = fcb;
30 n->prev = NULL;
31 n->next = NULL;
32
33 return n;
34}
35
10dlinkedlist * dlinkedlist_init(void) { 36dlinkedlist * dlinkedlist_init(void) {
11 dlinkedlist *ll = VALLOC(1, sizeof(*ll)); 37 dlinkedlist *ll = VALLOC(1, sizeof(*ll));
12 if(!ll) 38 if(!ll)