planarbot/arraylist.h

16 lines
419 B
C
Raw Permalink Normal View History

2022-11-01 22:09:32 +01:00
#ifndef ARRAY_LIST
#define ARRAY_LIST
typedef struct arraylist {
int capacity;
int size;
void **items;
} ArrayList;
ArrayList * list();
void * get_list(ArrayList *this, int index);
void add_list(ArrayList *this, void *item);
2022-11-08 23:31:00 +01:00
void * fold_list(ArrayList *this, void *init, void * (*f)(void *acc, int index, void *item));
void * free_listitem(void *acc, int index, void *item);
2022-11-01 22:09:32 +01:00
void free_list(ArrayList *this);
#endif