You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
419 B

#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);
void * fold_list(ArrayList *this, void *init, void * (*f)(void *acc, int index, void *item));
void * free_listitem(void *acc, int index, void *item);
void free_list(ArrayList *this);