summaryrefslogtreecommitdiffstats
path: root/lib/linkedlist.h
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2024-03-11 21:30:31 -0400
committerJon Santmyer <jon@jonsantmyer.com>2024-03-11 21:30:31 -0400
commitd1ff7bcc91886626dc9060ec5fb67ee102ab7c1d (patch)
tree8f0b5cd8aad31089131785dc6e37b659490f9955 /lib/linkedlist.h
downloadjove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.tar.gz
jove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.tar.bz2
jove-kernel-d1ff7bcc91886626dc9060ec5fb67ee102ab7c1d.zip
usermode capable kernel with logging syscall
Diffstat (limited to 'lib/linkedlist.h')
-rw-r--r--lib/linkedlist.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/linkedlist.h b/lib/linkedlist.h
new file mode 100644
index 0000000..26c148e
--- /dev/null
+++ b/lib/linkedlist.h
@@ -0,0 +1,26 @@
+#ifndef JOVE_LIB_LINKEDLIST_H
+#define JOVE_LIB_LINKEDLIST_H 1
+
+#include <stdint.h>
+#include <stddef.h>
+
+struct SLLNode {
+ struct SLLNode *next;
+ char data[];
+};
+
+/*Singly Linked List*/
+struct SLinkedList
+{
+ struct SLLNode *head;
+ struct SLLNode *tail;
+
+ size_t obj_size;
+ size_t count;
+};
+
+void sll_new(struct SLinkedList *list, size_t obj_size);
+void sll_push(struct SLinkedList *list, void *node);
+void *sll_get(struct SLinkedList *list, size_t index);
+
+#endif