aboutsummaryrefslogtreecommitdiff
path: root/include/std_gc/list.h
blob: a97f311594a62949d56c44c1d9e18c4256e054f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef TSL_LIST_H
#define TSL_LIST_H

#include "../forward_decl.h"
#include <stddef.h>

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(const TslList *self, double index);

#endif /* TSL_LIST_H */