agssim: break out of vm_run() if a signal was caught
[rofl0r-agsutils.git] / List.h
blob88cc55430e8cf46f162278d5b9f27f886d8806df
1 #ifndef LIST_H
2 #define LIST_H
4 #include "MemGrow.h"
5 #include <stddef.h>
7 typedef struct List {
8 MG mem;
9 size_t count;
10 size_t itemsize;
11 } List;
13 #define List_size(X) ((X)->count)
15 void List_init(List *l, size_t itemsize);
16 void List_free(List *l);
17 int List_add(List *l, void* item);
18 int List_get(List *l, size_t index, void* item);
19 void* List_getptr(List *l, size_t index);
20 void List_sort(List *l, int(*compar)(const void *, const void *));
22 #pragma RcB2 DEP "List.c"
24 #endif