version 1.7.2.2, 2012/05/18 12:43:06
|
version 1.8.2.1, 2012/05/19 00:19:57
|
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) |
if (!(vars = io_arrayInit(n + 1))) | return NULL; |
| |
| if (!*vars) { |
| if (!(*vars = io_allocVars(n + 1))) |
return NULL; |
return NULL; |
} else { |
} else { |
if (n >= io_arraySize(vars) && io_arrayGrow(vars, n + 1, 0)) | if (n >= (i = io_arraySize(*vars))) { |
return NULL; | 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); |
| } |
| } |
} |
} |
|
|
if ((v = io_allocVar())) | return io_array(*vars, n, ait_val_t*); |
return NULL; | |
else | |
io_arraySet(vars, n, v); | |
| |
return v; | |
} |
} |
|
|
/* |
/* |