]> jfr.im git - irc/quakenet/newserv.git/blob - lib/array.h
A4STATS: remove E style escapes and switch to createtable for indices
[irc/quakenet/newserv.git] / lib / array.h
1 /* array.h */
2
3 #ifndef _ARRAY_H
4
5 #define _ARRAY_H
6
7 typedef struct array {
8 void *content; /* must be called this */
9 unsigned int cursi; /* must be called this */
10 unsigned int capacity;
11 unsigned int itemsize;
12 unsigned short allocchunksize;
13 unsigned short freechunksize;
14 } array;
15
16 void array_init(array *a, unsigned int itemsize);
17 void array_free(array *a);
18 int array_getfreeslot(array *a);
19 void array_delslot(array *a, unsigned int index);
20
21 #define array_setlim1(a, size) (a)->allocchunksize = size;
22 #define array_setlim2(a, size) (a)->freechunksize = size;
23
24 #endif /* _ARRAY_H */