From 4b2b8d3176e84f76510cc69a627dbfa089c1dd35 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 25 Jan 2020 09:48:56 +0100 Subject: Implement almost all instructions --- include/std_gc/list.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 include/std_gc/list.h (limited to 'include/std_gc/list.h') diff --git a/include/std_gc/list.h b/include/std_gc/list.h new file mode 100644 index 0000000..469f585 --- /dev/null +++ b/include/std_gc/list.h @@ -0,0 +1,21 @@ +#ifndef TSL_LIST_H +#define TSL_LIST_H + +#include "../forward_decl.h" +#include + +typedef struct { + void *data; + size_t size; + size_t capacity; +} TslList; + +void tsl_list_init(TslList *self); +int tsl_list_append(TslList *self, const TslValue *data); +int tsl_list_set_capacity_hint(TslList *self, size_t capacity); +TslValue* tsl_list_begin(TslList *self); +TslValue* tsl_list_end(TslList *self); +/* Returns NULL if index is out of bounds of the list */ +TslValue* tsl_list_get(TslList *self, double index); + +#endif /* TSL_LIST_H */ -- cgit v1.2.3