Diff for /libaitio/src/Attic/array.c between versions 1.7 and 1.7.4.1

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

Removed from v.1.7  
changed lines
  Added in v.1.7.4.1


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>