bringing SDL 1.2.14 from vendor into the main branch
[AROS-Contrib.git] / rexx / inc / darray.h
blob6ed9205e5561d7d7c9457350043e4450cfb1f3db
1 /*
2 * $Header$
3 * $Log$
4 * Revision 1.1 2001/04/04 05:43:36 wang
5 * First commit: compiles on Linux, Amiga, Windows, Windows CE, generic gcc
7 * Revision 1.1 1998/07/02 17:35:50 bnv
8 * Initial revision
12 #ifndef __DARRAY_H__
13 #define __DARRAY_H__
15 #include <lstring.h>
17 /* ============= type definitions ================= */
18 typedef struct {
19 long increase; /* increase size */
20 long lastitem; /* last item in array */
21 long items; /* number of items */
22 long allocateditems; /* number of allocated items */
23 void **pdata; /* pointer to items space */
24 } DArray;
26 #define DAINIT(a,i) {(a).increase=(i); (a).lastitem=0; \
27 (a).items=0; (a).allocateditems=0; (a).pdata = NULL;}
28 #define DAAT(a,i) ((a).pdata[i])
29 #define DAFREE(a) {if ((a).pdata) free((a).pdata);}
31 /* ============= function prototypes =============== */
32 long DA_Add( DArray *array, void *dat);
33 long DA_AddAtFree( DArray *array, void *dat);
34 void DA_Del( DArray *array, long it );
36 #endif