version 1.4, 2011/08/29 22:37:06
|
version 1.4.2.1, 2011/08/29 23:26:56
|
Line 53 SUCH DAMAGE.
|
Line 53 SUCH DAMAGE.
|
* @varnum = Number of return variables |
* @varnum = Number of return variables |
* return: NULL error, !=NULL array with return values for RPC call with varnum items |
* return: NULL error, !=NULL array with return values for RPC call with varnum items |
*/ |
*/ |
inline rpc_val_t * | inline ait_val_t * |
rpc_srv_returnVars(rpc_func_t * __restrict call, int varnum) |
rpc_srv_returnVars(rpc_func_t * __restrict call, int varnum) |
{ |
{ |
rpc_val_t *v = NULL; | ait_val_t *v = NULL; |
|
|
if (rpc_srv_allocVars(call, varnum) == -1) |
if (rpc_srv_allocVars(call, varnum) == -1) |
return NULL; |
return NULL; |
Line 92 rpc_srv_allocVars(rpc_func_t * __restrict call, int va
|
Line 92 rpc_srv_allocVars(rpc_func_t * __restrict call, int va
|
call->func_vars = NULL; |
call->func_vars = NULL; |
} |
} |
} else { |
} else { |
ptr = realloc(call->func_vars, varnum * sizeof(rpc_val_t)); | ptr = realloc(call->func_vars, varnum * sizeof(ait_val_t)); |
if (!ptr) { |
if (!ptr) { |
LOGERR; |
LOGERR; |
call->func_args = 0; |
call->func_args = 0; |
Line 117 rpc_srv_zeroVars(rpc_func_t * __restrict call)
|
Line 117 rpc_srv_zeroVars(rpc_func_t * __restrict call)
|
return -1; |
return -1; |
} |
} |
|
|
memset(call->func_vars, 0, call->func_args * sizeof(rpc_val_t)); | memset(call->func_vars, 0, call->func_args * sizeof(ait_val_t)); |
return call->func_args; |
return call->func_args; |
} |
} |
|
|
Line 128 rpc_srv_zeroVars(rpc_func_t * __restrict call)
|
Line 128 rpc_srv_zeroVars(rpc_func_t * __restrict call)
|
* return: -1 error, !=-1 Returned number of copied RPC variables |
* return: -1 error, !=-1 Returned number of copied RPC variables |
*/ |
*/ |
inline int |
inline int |
rpc_srv_copyVars(rpc_func_t * __restrict call, rpc_val_t ** __restrict newvars) | rpc_srv_copyVars(rpc_func_t * __restrict call, ait_val_t ** __restrict newvars) |
{ |
{ |
if (!call || !newvars) { |
if (!call || !newvars) { |
rpc_SetErr(EINVAL, "Error:: Invalid parameter can`t copy variables to new array\n"); |
rpc_SetErr(EINVAL, "Error:: Invalid parameter can`t copy variables to new array\n"); |
return -1; |
return -1; |
} |
} |
|
|
*newvars = calloc(call->func_args, sizeof(rpc_val_t)); | *newvars = calloc(call->func_args, sizeof(ait_val_t)); |
if (!*newvars) { |
if (!*newvars) { |
LOGERR; |
LOGERR; |
return -1; |
return -1; |
} else |
} else |
memcpy(*newvars, call->func_vars, call->func_args * sizeof(rpc_val_t)); | memcpy(*newvars, call->func_vars, call->func_args * sizeof(ait_val_t)); |
|
|
return call->func_args; |
return call->func_args; |
} |
} |
Line 152 rpc_srv_copyVars(rpc_func_t * __restrict call, rpc_val
|
Line 152 rpc_srv_copyVars(rpc_func_t * __restrict call, rpc_val
|
* return: -1 error, !=-1 Number of returned variables |
* return: -1 error, !=-1 Number of returned variables |
*/ |
*/ |
inline int |
inline int |
rpc_srv_getVars(rpc_func_t * __restrict call, rpc_val_t ** __restrict vars) | rpc_srv_getVars(rpc_func_t * __restrict call, ait_val_t ** __restrict vars) |
{ |
{ |
if (!call) { |
if (!call) { |
rpc_SetErr(EINVAL, "Error:: Invalid parameter can`t get variables ...\n"); |
rpc_SetErr(EINVAL, "Error:: Invalid parameter can`t get variables ...\n"); |