]> jfr.im git - irc/quakenet/newserv.git/blame - lib/array.h
Add jupe support
[irc/quakenet/newserv.git] / lib / array.h
CommitLineData
c86edd1d
Q
1/* array.h */
2
8bf8b2a2 3#ifndef _ARRAY_H
c86edd1d 4
8bf8b2a2
CP
5#define _ARRAY_H
6
7typedef 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;
c86edd1d
Q
14} array;
15
8bf8b2a2 16void array_init(array *a, unsigned int itemsize);
c86edd1d 17void array_free(array *a);
8bf8b2a2
CP
18int array_getfreeslot(array *a);
19void 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;
c86edd1d 23
8bf8b2a2 24#endif /* _ARRAY_H */