--- libaitio/src/Attic/array.c 2012/02/02 21:32:42 1.7 +++ libaitio/src/Attic/array.c 2012/03/27 21:37:56 1.7.4.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: array.c,v 1.7 2012/02/02 21:32:42 misho Exp $ +* $Id: array.c,v 1.7.4.1 2012/03/27 21:37:56 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 +Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ SUCH DAMAGE. /* * io_arrayInit() - Create and initialize dynamic array + * * @numItems = Number of Items * return: NULL error, != NULL allocated memory for array */ @@ -76,6 +77,7 @@ io_arrayInit(int numItems) /* * io_arrayFrom() - Create and fill array from array with pointers + * * @pargv = Array with pointers * @argc = Number of Items, if 0 walk through argv and stop when reach NULL item * return: NULL error, != NULL allocated new array @@ -116,6 +118,7 @@ io_arrayFrom(const char *** __restrict pargv, int argc /* * io_arrayTo() - Create and fill array with pointers from dynamic array + * * @arr = Array * return: NULL error, != NULL allocated memory for array, NULL terminated */ @@ -142,6 +145,7 @@ io_arrayTo(array_t * __restrict arr) /* * io_arrayFree() - Free all data in dynamic array items * (WARNING! If assign static array dont use this!!!) + * * @arr = Array * return: none */ @@ -162,6 +166,7 @@ io_arrayFree(array_t * __restrict arr) /* * io_arrayDestroy() - Free and destroy dynamic array + * * @parr = Array * return: none */ @@ -179,6 +184,7 @@ io_arrayDestroy(array_t ** __restrict parr) /* * io_arrayLen() - Get last used element in dynamic array (array Length) + * * @arr = Array * return: -1 error, 0 empty or >0 position of last used element */ @@ -198,6 +204,7 @@ io_arrayLen(array_t * __restrict arr) /* * io_arrayGrow() - Grow/Shrink dynamic array, Use with care when it shrink!!! + * * @arr = Array * @newNumItems = Number of Items * @freeShrink = Free elements before shrink array @@ -243,6 +250,7 @@ io_arrayGrow(array_t * __restrict arr, int newNumItems /* * io_arrayVacuum() - Vacuum dynamic array, empty elements will be deleted + * * @arr = Array * @fromWhere = 1 begin, 2 ALL empty elements * return: -1 error, 0 ok @@ -295,6 +303,7 @@ io_arrayVacuum(array_t * __restrict arr, int fromWhere /* * io_arrayElem() - Always GET/PUT element into dynamic array, if not enough elements grow array + * * @arr = Array * @n = Position * @data = Element, if set NULL GET element at position or !=NULL PUT element at position @@ -320,6 +329,7 @@ io_arrayElem(array_t * __restrict arr, int n, void *da /* * io_arrayPush() - Push element into dynamic array like stack manner, place at first empty position + * * @arr = Array * @data = Element, if set NULL return only first empty position * return: -1 not found empty position, array is full!, >-1 return position of stored element into array @@ -346,6 +356,7 @@ io_arrayPush(array_t * __restrict arr, void **data) /* * io_arrayPop() - Pop element from dynamic array like stack manner, last used position + * * @arr = Array * @data = Element, if set NULL return only last used position * @delAfter = Delete after Pop element, !=0 delete element from array after return data @@ -375,6 +386,7 @@ io_arrayPop(array_t * __restrict arr, void ** __restri /* * io_arrayConcat() Concat source array to destination array + * * @dest = Destination array * @src = Source array * return: -1 error; >0 new count of destination array @@ -399,6 +411,7 @@ io_arrayConcat(array_t * __restrict dest, array_t * __ /* * io_arrayCopy() Copy source array to destination array + * * @dest = Destination array, after use free with io_arrayDestroy() * @src = Source array * return: -1 error; >0 count of destination array @@ -421,6 +434,7 @@ io_arrayCopy(array_t ** __restrict dest, array_t * __r /* * io_argsNum() Parse and calculate number of arguments + * * @csArgs = Input arguments line * @csDelim = Delimiter(s) for separate * return: 0 error format; -1 error:: can`t read; >0 ok, number of items @@ -443,6 +457,7 @@ io_argsNum(const char *csArgs, const char *csDelim) /* * io_arrayMake() Parse and make array from arguments ... (input string will be modified!!! * and output array must be free with io_arrayDestroy() after use!) + * * @psArgs = Input arguments line, after execute string is modified!!! * @nargs = Maximum requested count of arguments from input string psArgs, if 0 all psArgs * @csDelim = Delimiter(s) for separate @@ -478,6 +493,7 @@ io_arrayMake(char * __restrict psArgs, int nargs, cons /* * io_MakeAV() Parse and make attribute/value pair + * * @csArgs = Input argument line * @csDelim = Delimiter for separate * @psAttr = Output Attribute