--- libaitio/inc/aitio.h 2011/05/03 08:39:14 1.8.2.1 +++ libaitio/inc/aitio.h 2011/05/03 14:59:01 1.8.2.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitio.h,v 1.8.2.1 2011/05/03 08:39:14 misho Exp $ +* $Id: aitio.h,v 1.8.2.5 2011/05/03 14:59:01 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -324,12 +324,36 @@ inline sarr_t *io_sarrInit(int numItems, int segLen); */ inline void io_sarrDestroy(sarr_t ** __restrict parr); /* + * io_sarrGrow() - Grow/Shrink dynamic split-order array, Use with care when it shrink!!! + * @arr = Array + * @newNumItems = Number of Items + * return: -1 error, 0 ok + */ +int io_sarrGrow(sarr_t * __restrict arr, int newNumItems); +/* * io_sarrVacuum() - Vacuum dynamic split-order array, empty segments will be freed * @arr = Array * return: -1 error, >-1 freed segments */ inline int io_sarrVacuum(sarr_t * __restrict arr); #define io_sarrSize(_arr) ((assert(_arr)), _arr->sarr_num) +/* + * io_sarrGet() - Get element from dynamic split-order array + * @arr = Array + * @idx = Index (warning 1st element is at position 1) + * return: NULL not found, !=NULL element + */ +inline void *io_sarrGet(sarr_t * __restrict arr, unsigned int idx); +/* + * io_sarrSet() - Set element to dynamic split-order array + * @arr = Array + * @idx = Index (warning 1st element is at position 1) + * @data = Value + * return: NULL error or empty, !=NULL old value in element + */ +inline void *io_sarrSet(sarr_t * __restrict arr, unsigned int idx, void *data); +#define io_sarrDel(_arr, _idx) io_sarrSet(_arr, _idx, NULL) +#define io_sarr(_arr, _idx, _type) (_type)io_sarrGet(_arr, _idx) /* * ioURLGet() Parse and get data from input URL