aboutsummaryrefslogtreecommitdiff
path: root/src/types/larray.h
diff options
context:
space:
mode:
authorame <[email protected]>2024-05-08 10:55:05 -0500
committerame <[email protected]>2024-05-08 10:55:05 -0500
commit34e6285c3d3bdb31eb476d13d4d083757a51bfe6 (patch)
treefe96557b26207bb35b9330d2886eb7ee30f82bfb /src/types/larray.h
parentf98fbf1ab34a8ff17daa5d51cbbdb6185f8065f7 (diff)
work on threads
Diffstat (limited to 'src/types/larray.h')
-rw-r--r--src/types/larray.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/types/larray.h b/src/types/larray.h
new file mode 100644
index 0000000..ff67857
--- /dev/null
+++ b/src/types/larray.h
@@ -0,0 +1,21 @@
+#include <stdint.h>
+
+struct larray_item {
+ uint64_t idx;
+ void* value;
+ int used;
+};
+
+typedef struct {
+ struct larray_item* arr;
+ size_t len, size;
+} larray_t;
+
+larray_t* larray_initl(int len);
+larray_t* larray_init();
+void larray_expand(larray_t** _l);
+void larray_set(larray_t** _l, uint64_t idx, void* value);
+int larray_geti(larray_t* l, uint64_t idx);
+void* larray_get(larray_t* l, uint64_t idx);
+void larray_clear(larray_t* l);
+