version 1.4.2.1, 2011/08/31 12:29:32
|
version 1.4.2.3, 2011/08/31 13:19:22
|
Line 210 io_arrayGrow(array_t * __restrict arr, int newNumItems
|
Line 210 io_arrayGrow(array_t * __restrict arr, int newNumItems
|
int n = 0; |
int n = 0; |
register int i; |
register int i; |
|
|
assert(arr); |
|
if (!arr) |
if (!arr) |
return -1; |
return -1; |
|
|
Line 254 io_arrayVacuum(array_t * __restrict arr, int fromWhere
|
Line 253 io_arrayVacuum(array_t * __restrict arr, int fromWhere
|
register int i, j, num; |
register int i, j, num; |
int cx = 0; |
int cx = 0; |
|
|
assert(arr); |
|
if (!arr) |
if (!arr) |
return -1; |
return -1; |
else |
else |
Line 307 io_arrayPush(array_t * __restrict arr, void **data)
|
Line 305 io_arrayPush(array_t * __restrict arr, void **data)
|
register int i; |
register int i; |
int ret = -1; |
int ret = -1; |
|
|
assert(arr); |
|
|
|
for (i = 0; i < io_arraySize(arr); i++) |
for (i = 0; i < io_arraySize(arr); i++) |
if (!arr->arr_data[i]) { |
if (!arr->arr_data[i]) { |
if (data) |
if (data) |
Line 333 io_arrayPop(array_t * __restrict arr, void ** __restri
|
Line 329 io_arrayPop(array_t * __restrict arr, void ** __restri
|
register int i; |
register int i; |
int ret = -1; |
int ret = -1; |
|
|
assert(arr); |
|
|
|
for (i = io_arraySize(arr) - 1; i >= 0; i--) |
for (i = io_arraySize(arr) - 1; i >= 0; i--) |
if (arr->arr_data[i]) { |
if (arr->arr_data[i]) { |
if (data) |
if (data) |
Line 370 io_arrayConcat(array_t * __restrict dest, array_t * __
|
Line 364 io_arrayConcat(array_t * __restrict dest, array_t * __
|
memcpy(dest->arr_data + n, src->arr_data, io_arraySize(src) * sizeof(void*)); |
memcpy(dest->arr_data + n, src->arr_data, io_arraySize(src) * sizeof(void*)); |
|
|
return io_arraySize(dest); |
return io_arraySize(dest); |
|
} |
|
|
|
/* |
|
* 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 |
|
*/ |
|
int |
|
io_arrayCopy(array_t ** __restrict dest, array_t * __restrict src) |
|
{ |
|
assert(dest); |
|
assert(src); |
|
if (!dest || !src) |
|
return -1; |
|
|
|
*dest = io_arrayInit(io_arraySize(src)); |
|
if (!*dest) |
|
return -1; |
|
|
|
memcpy((*dest)->arr_data, src->arr_data, io_arraySize(*dest) * sizeof(void*)); |
|
return io_arraySize(*dest); |
} |
} |
|
|
/* |
/* |