6 typedef struct myarray
{
12 int (*cmpfunc
)(void *, void *);
15 MArray
myarray_new(int, int, int);
17 #define myarray_append(a,e) _myarray_insert((a), &(e), (a)->len)
19 #define myarray_insert(a,e,i) _myarray_insert((a), &(e), (i))
20 void _myarray_insert(MArray
, void *, int);
22 #define myarray_get(a,t,i) (((t*) ((a)->elements))[(i)])
24 void myarray_remove_index(MArray
, int);
26 void myarray_reset(MArray
);
28 void myarray_free(MArray
);
30 void myarray_set_cmpfunc(MArray array
, int (*cmpfunc
)(void *, void *));
32 #define myarray_insert_sorted(a,e) _myarray_insert_sorted(a, &(e))
33 void _myarray_insert_sorted(MArray array
, void *element
);