diff options
Diffstat (limited to 'src/types/larray.h')
| -rw-r--r-- | src/types/larray.h | 21 |
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);
+
|
