version 1.6.2.1, 2012/05/14 16:02:27
|
version 1.8.2.3, 2012/05/23 14:06:08
|
Line 179 io_buffer2vars(u_char *buf, int buflen, int vnum, int
|
Line 179 io_buffer2vars(u_char *buf, int buflen, int vnum, int
|
/* de-marshaling */ |
/* de-marshaling */ |
for (i = 0; i < io_arraySize(vars); i++) { |
for (i = 0; i < io_arraySize(vars); i++) { |
if (!zcpy) { |
if (!zcpy) { |
val = malloc(sizeof(ait_val_t)); | val = io_malloc(sizeof(ait_val_t)); |
if (!val) { |
if (!val) { |
LOGERR; |
LOGERR; |
io_arrayFree(vars); |
io_arrayFree(vars); |
Line 233 io_buffer2vars(u_char *buf, int buflen, int vnum, int
|
Line 233 io_buffer2vars(u_char *buf, int buflen, int vnum, int
|
Limit += AIT_LEN(val); |
Limit += AIT_LEN(val); |
|
|
if (!zcpy) { |
if (!zcpy) { |
val->val.buffer = malloc(AIT_LEN(val)); | val->val.buffer = io_malloc(AIT_LEN(val)); |
if (!val->val.buffer) { |
if (!val->val.buffer) { |
LOGERR; |
LOGERR; |
io_arrayFree(vars); |
io_arrayFree(vars); |
Line 393 io_map2vars(u_char *buf, int buflen, int vnum, int zcp
|
Line 393 io_map2vars(u_char *buf, int buflen, int vnum, int zcp
|
/* de-marshaling */ |
/* de-marshaling */ |
for (i = 0; i < io_arraySize(vars); i++) { |
for (i = 0; i < io_arraySize(vars); i++) { |
if (!zcpy) { |
if (!zcpy) { |
val = malloc(sizeof(ait_val_t)); | val = io_malloc(sizeof(ait_val_t)); |
if (!val) { |
if (!val) { |
LOGERR; |
LOGERR; |
io_arrayFree(vars); |
io_arrayFree(vars); |
Line 438 io_map2vars(u_char *buf, int buflen, int vnum, int zcp
|
Line 438 io_map2vars(u_char *buf, int buflen, int vnum, int zcp
|
Limit += AIT_LEN(val); |
Limit += AIT_LEN(val); |
|
|
if (!zcpy) { |
if (!zcpy) { |
val->val.buffer = malloc(AIT_LEN(val)); | val->val.buffer = io_malloc(AIT_LEN(val)); |
if (!val->val.buffer) { |
if (!val->val.buffer) { |
LOGERR; |
LOGERR; |
io_arrayFree(vars); |
io_arrayFree(vars); |
Line 477 io_allocVars(int varnum)
|
Line 477 io_allocVars(int varnum)
|
register int i; |
register int i; |
ait_val_t *v; |
ait_val_t *v; |
|
|
if (!varnum || !(arr = io_arrayInit(varnum))) | if (!(arr = io_arrayInit(varnum))) |
return NULL; |
return NULL; |
|
|
for (i = 0; i < io_arraySize(arr); i++) { |
for (i = 0; i < io_arraySize(arr); i++) { |
Line 492 io_allocVars(int varnum)
|
Line 492 io_allocVars(int varnum)
|
} |
} |
|
|
/* |
/* |
|
* io_getVars() - Get ait_val_t element from array and if not exists allocate it |
|
* |
|
* @vars = Variable array |
|
* @n = index of variable into array |
|
* return: NULL error or !=NULL ait_val_t element |
|
*/ |
|
inline ait_val_t * |
|
io_getVars(array_t ** __restrict vars, int n) |
|
{ |
|
register int i; |
|
ait_val_t *v; |
|
|
|
if (!vars) |
|
return NULL; |
|
|
|
if (!*vars) { |
|
if (!(*vars = io_allocVars(n + 1))) |
|
return NULL; |
|
} else { |
|
if (n >= (i = io_arraySize(*vars))) { |
|
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 io_array(*vars, n, ait_val_t*); |
|
} |
|
|
|
/* |
* io_clrVars() - Clear ait_val_t elements from array |
* io_clrVars() - Clear ait_val_t elements from array |
* |
* |
* @vars = Variable array |
* @vars = Variable array |
Line 540 io_allocVar(void)
|
Line 576 io_allocVar(void)
|
{ |
{ |
ait_val_t *v = NULL; |
ait_val_t *v = NULL; |
|
|
v = malloc(sizeof(ait_val_t)); | v = io_malloc(sizeof(ait_val_t)); |
if (!v) { |
if (!v) { |
LOGERR; |
LOGERR; |
return NULL; |
return NULL; |
Line 562 io_freeVar(ait_val_t ** __restrict val)
|
Line 598 io_freeVar(ait_val_t ** __restrict val)
|
{ |
{ |
if (val && *val) { |
if (val && *val) { |
AIT_FREE_VAL(*val); |
AIT_FREE_VAL(*val); |
free(*val); | io_free(*val); |
*val = NULL; |
*val = NULL; |
} |
} |
} |
} |