summaryrefslogtreecommitdiff
path: root/src/ll.h
diff options
context:
space:
mode:
author@syxhe <https://t.me/syxhe>2025-06-08 17:25:13 -0500
committer@syxhe <https://t.me/syxhe>2025-06-08 17:25:13 -0500
commit08fb644c7d101551edfe8fc2608e0ac501b3df9f (patch)
tree65660431cb77c7f482eb1d7a45fe47c562d49608 /src/ll.h
parent5431fec6726c18234c9c28b014cc6f18a0d79884 (diff)
Trim the fat
Diffstat (limited to 'src/ll.h')
-rw-r--r--src/ll.h31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/ll.h b/src/ll.h
deleted file mode 100644
index f5801e0..0000000
--- a/src/ll.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef __VXGG_REWRITE___LL_H___305861098005___
2#define __VXGG_REWRITE___LL_H___305861098005___
3
4// Notice: dlinked functions are no longer necessarily xalloc, but MAY be IF the `___VXGG___USE_XALLOC_FOR_VALLOC___` is greater than 0
5
6/* TODO: Implement a way to register a set of alloc functions to a linked list so I can give it arenas for memory allocation
7// instead of just xcalloc */
8 // I don't know if I care to do this right now. I might be able to hack it in but it would be a fugly hack, something as bad if not worse than that weird callback thing I was doing with the ALWAYS_CHECK_LIBSODIUM macro
9
10typedef void (*dll_freecb)(void*);
11typedef struct dlinked dlinkedlist;
12
13#ifndef __VXGG_REWRITE___LL_INTERNAL___
14
15dlinkedlist * dlinkedlist_init(void);
16void dlinkedlist_free(void *dll);
17int dlinkedlist_append(dlinkedlist * const ll, void *data, dll_freecb fcb);
18int dlinkedlist_prepend(dlinkedlist * const ll, void *data, dll_freecb fcb);
19int dlinkedlist_insert(dlinkedlist * const ll, void *data, dll_freecb fcb, int index);
20void* dlinkedlist_get(const dlinkedlist * const ll, int index);
21int dlinkedlist_remove(dlinkedlist * const ll, int index);
22void * dlinkedlist_poplast(dlinkedlist *ll);
23
24int dlinkedlist_size(const dlinkedlist * const ll);
25#define dlinkedlist_isempty(ll) (dlinkedlist_size((ll)) == 0)
26
27int dlinkedlist_foreach(dlinkedlist *ll, int (*callback)(void*));
28
29#endif
30
31#endif \ No newline at end of file