comparison parray.h @ 147:535f12e0a5af

Add a flag to prevent insertions at out of bounds
author David Demelier <markand@malikania.fr>
date Fri, 11 May 2012 20:06:41 +0200
parents e3cf5ac9a5aa
children 1558251b2cf2
comparison
equal deleted inserted replaced
146:5109083b4794 147:535f12e0a5af
31 31
32 enum { 32 enum {
33 PARRAY_AUTO = 0, /* array grows automatically */ 33 PARRAY_AUTO = 0, /* array grows automatically */
34 PARRAY_FIXED = (1 << 0), /* fixed size length */ 34 PARRAY_FIXED = (1 << 0), /* fixed size length */
35 PARRAY_FASTREMOVE = (1 << 1), /* use last object when removing */ 35 PARRAY_FASTREMOVE = (1 << 1), /* use last object when removing */
36 PARRAY_NULLEND = (1 << 2) /* always has a NULL pointer at end */ 36 PARRAY_NULLEND = (1 << 2), /* always has a NULL pointer at end */
37 PARRAY_INSERTSAFE = (1 << 3) /* insertion must have valid indexes */
37 }; 38 };
38 39
39 struct parray { 40 struct parray {
40 int flags; /* (ro) array flags (default AUTO) */ 41 int flags; /* (ro) array flags (default AUTO) */
41 void **data; /* (rw) array of data */ 42 void **data; /* (rw) array of data */