version 1.7.2.1, 2012/05/18 09:19:53
|
version 1.9, 2012/05/19 00:11:58
|
Line 499 io_allocVars(int varnum)
|
Line 499 io_allocVars(int varnum)
|
* return: NULL error or !=NULL ait_val_t element |
* return: NULL error or !=NULL ait_val_t element |
*/ |
*/ |
inline ait_val_t * |
inline ait_val_t * |
io_getVars(array_t * __restrict vars, int n) | io_getVars(array_t ** __restrict vars, int n) |
{ |
{ |
|
register int i; |
ait_val_t *v; |
ait_val_t *v; |
|
|
if (!vars) |
if (!vars) |
return NULL; |
return NULL; |
|
|
if (n >= io_arraySize(vars) && io_arrayGrow(vars, n + 1, 0)) | if (!*vars) { |
return NULL; | if (!(*vars = io_allocVars(n + 1))) |
if ((v = io_allocVar())) | return NULL; |
return NULL; | } else { |
else | if (n >= (i = io_arraySize(*vars))) { |
io_arraySet(vars, n, v); | if (io_arrayGrow(*vars, n + 1, 0)) |
| return NULL; |
| for (; i < io_arraySize(*vars); i++) |
| if (!io_arrayGet(*vars, i)) { |
| if (!(v = io_allocVar())) |
| return NULL; |
| else |
| io_arraySet(*vars, n, v); |
| } |
| } |
| } |
|
|
return v; | return io_array(*vars, n, ait_val_t*); |
} |
} |
|
|
/* |
/* |