version 1.16.2.9, 2012/04/05 12:21:14
|
version 1.16.2.10, 2012/04/10 15:27:33
|
Line 74 typedef struct _tagSplitArray {
|
Line 74 typedef struct _tagSplitArray {
|
} sarr_t; |
} sarr_t; |
|
|
typedef struct _tagArray { |
typedef struct _tagArray { |
|
int arr_last; |
int arr_num; |
int arr_num; |
void **arr_data; |
void **arr_data; |
} array_t; |
} array_t; |
Line 558 inline char **io_arrayTo(array_t * __restrict arr);
|
Line 559 inline char **io_arrayTo(array_t * __restrict arr);
|
* 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 empty or >-1 position of last used element |
*/ |
*/ |
inline int io_arrayLen(array_t * __restrict arr); |
inline int io_arrayLen(array_t * __restrict arr); |
/* |
/* |
Line 596 int io_arrayGrow(array_t * __restrict arr, int newNumI
|
Line 597 int io_arrayGrow(array_t * __restrict arr, int newNumI
|
int io_arrayVacuum(array_t * __restrict arr, int fromWhere); |
int io_arrayVacuum(array_t * __restrict arr, int fromWhere); |
|
|
#define io_arraySize(_arr) ((_arr) ? (_arr)->arr_num : 0) |
#define io_arraySize(_arr) ((_arr) ? (_arr)->arr_num : 0) |
|
#define io_arrayLast(_arr) ((_arr) ? (_arr)->arr_last : -1) |
#define io_arrayZero(_arr) (assert((_arr)), memset((_arr)->arr_data, 0, \ |
#define io_arrayZero(_arr) (assert((_arr)), memset((_arr)->arr_data, 0, \ |
io_arraySize((_arr)) * sizeof(void*))) |
io_arraySize((_arr)) * sizeof(void*))) |
|
|
Line 604 int io_arrayVacuum(array_t * __restrict arr, int fromW
|
Line 606 int io_arrayVacuum(array_t * __restrict arr, int fromW
|
((_type) *((_arr)->arr_data + _d))) |
((_type) *((_arr)->arr_data + _d))) |
#define io_arraySet(_arr, _d, _ptr) do { \ |
#define io_arraySet(_arr, _d, _ptr) do { \ |
assert((_arr) && (_arr)->arr_num > _d); \ |
assert((_arr) && (_arr)->arr_num > _d); \ |
|
if ((_arr)->arr_last < _d) \ |
|
(_arr)->arr_last = _d; \ |
*((_arr)->arr_data + _d) = (void*) (_ptr); \ |
*((_arr)->arr_data + _d) = (void*) (_ptr); \ |
} while (0) |
} while (0) |
#define io_arrayDel(_arr, _d, _fri) do { \ |
#define io_arrayDel(_arr, _d, _fri) do { \ |
Line 627 inline void *io_arrayElem(array_t * __restrict arr, in
|
Line 631 inline void *io_arrayElem(array_t * __restrict arr, in
|
* |
* |
* @arr = Array |
* @arr = Array |
* @data = Element, if set NULL return only first empty position |
* @data = Element, if set NULL return only first empty position |
|
* @mayGrow = Array may to grow, if not enough room for new element |
* 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 |
*/ |
*/ |
inline int io_arrayPush(array_t * __restrict arr, void **data); | inline int io_arrayPush(array_t * __restrict arr, void **data, int mayGrow); |
/* |
/* |
* 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 |
* |
* |