version 1.4, 2011/08/29 12:00:57
|
version 1.4.2.2, 2011/08/31 12:58:27
|
Line 90 io_sarrDestroy(sarr_t ** __restrict parr)
|
Line 90 io_sarrDestroy(sarr_t ** __restrict parr)
|
{ |
{ |
register int i; |
register int i; |
|
|
assert(parr && *parr); |
|
if (!parr || !*parr) |
if (!parr || !*parr) |
return; |
return; |
|
|
Line 104 io_sarrDestroy(sarr_t ** __restrict parr)
|
Line 103 io_sarrDestroy(sarr_t ** __restrict parr)
|
free((*parr)->sarr_data); |
free((*parr)->sarr_data); |
free(*parr); |
free(*parr); |
*parr = NULL; |
*parr = NULL; |
|
} |
|
|
|
/* |
|
* io_sarrCopy() Copy source split array to destination split array |
|
* @dest = Destination split array, after use free with io_sarrDestroy() |
|
* @src = Source split array |
|
* return: -1 error; >0 count of destination split array |
|
*/ |
|
int |
|
io_sarrCopy(sarr_t ** __restrict dest, sarr_t * __restrict src) |
|
{ |
|
assert(dest); |
|
assert(src); |
|
if (!dest || !src) |
|
return -1; |
|
|
|
*dest = io_sarrInit(io_sarrSize(src), io_sarrSeg(src)); |
|
if (!*dest) |
|
return -1; |
|
|
|
memcpy((*dest)->sarr_data, src->sarr_data, (*dest)->sarr_siz * sizeof(sarr_seg_t)); |
|
return io_sarrSize(*dest); |
} |
} |
|
|
/* |
/* |