aboutsummaryrefslogtreecommitdiff
path: root/list.h
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-02-12 13:34:56 +0100
committerGabriel A. Giovanini <g.giovanini@gridx.de>2024-02-14 12:29:25 +0100
commitfc26d6542276e17f3206a00b996162397d875e93 (patch)
tree755683100beb190eb8c5983d77fdbdc041f20647 /list.h
downloaddict-fc26d6542276e17f3206a00b996162397d875e93.tar.gz
dict-fc26d6542276e17f3206a00b996162397d875e93.tar.bz2
dict-fc26d6542276e17f3206a00b996162397d875e93.zip
feat: Initial commit
Add initial code form dealing with sqlite.
Diffstat (limited to 'list.h')
-rw-r--r--list.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/list.h b/list.h
new file mode 100644
index 0000000..e33bf01
--- /dev/null
+++ b/list.h
@@ -0,0 +1,27 @@
+#pragma once
+#include <stdlib.h>
+
+#define LIST_SIZE_FACTOR 1.5
+struct list {
+ unsigned int size;
+ unsigned int allocated_size;
+ void** list;
+};
+
+typedef struct list LIST;
+
+/**
+* Add an item to a list
+* @list: array list structure.
+* @item: item to be added to the list.
+*/
+LIST* list_add(LIST* list, void* item);
+
+/**
+* Remove an item from a given list
+* @list: array list structure.
+* @pos: position of item to be removed.
+*/
+LIST* list_remove(LIST* list, unsigned int pos);
+
+void list_free(LIST* list);