From 96e5733c7f7108f46a2df2c389d71fdeb520d184 Mon Sep 17 00:00:00 2001 From: muench Date: Wed, 7 Apr 2004 08:43:55 +0000 Subject: [PATCH] status save --- allParam/rpc/rpcParam.c | 48 +++++++++++++++++++++++------------------ allParam/rpc/rpcpas.c | 2 -- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/allParam/rpc/rpcParam.c b/allParam/rpc/rpcParam.c index b9e2025..6097d56 100644 --- a/allParam/rpc/rpcParam.c +++ b/allParam/rpc/rpcParam.c @@ -1,5 +1,5 @@ static const char rcsId[] = - "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/allParam/rpc/rpcParam.c,v 1.1 2004-04-07 07:46:36 muench Exp $"; + "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/allParam/rpc/rpcParam.c,v 1.2 2004-04-07 08:43:55 muench Exp $"; #define _POSIX_C_SOURCE 199509L #if HAVE_CONFIG_H @@ -31,6 +31,7 @@ typedef struct RpcParamS { int conSetupParam(Param *my, const char *setup) { int retVal = 0; + RpcParam *rpcParam; my->strerror = NULL; @@ -41,20 +42,22 @@ int conSetupParam(Param *my, const char *setup) my->setup = NULL; } - my->specParam = malloc(sizeof(RpcParam)); - ((RpcParam *)my->specParam)->cl = clnt_create("localhost", RPCPARAMPROG, RPCPARAMVERS, "tcp"); - if (((RpcParam *)my->specParam)->cl == NULL) { + rpcParam = malloc(sizeof(RpcParam)); + rpcParam->cl = clnt_create("localhost", RPCPARAMPROG, RPCPARAMVERS, "tcp"); + if (rpcParam->cl == NULL) { clnt_pcreateerror("localhost"); retVal = -1; } else { char *arg; - arg = setup == NULL ? "" : setup; - ((RpcParam *)my->specParam)->remParam = *con_1(&arg, ((RpcParam *)my->specParam)->cl); - printf("%p\n", ((RpcParam *)my->specParam)->remParam); + arg = my->setup == NULL ? "" : my->setup; + rpcParam->remParam = *con_1(&arg, rpcParam->cl); } + my->specParam = rpcParam; + return retVal; + } int conParam(Param *my) @@ -64,29 +67,32 @@ int conParam(Param *my) void desParam(Param *my) { - printf("%p\n", ((RpcParam *)my->specParam)->remParam); - des_1(&((RpcParam *)my->specParam)->remParam, ((RpcParam *)my->specParam)->cl); - if (((RpcParam *)my->specParam)->cl != NULL) { - clnt_destroy(((RpcParam *)my->specParam)->cl); + RpcParam *rpcParam = my->specParam; + + if (rpcParam->cl != NULL) { + des_1(&rpcParam->remParam, rpcParam->cl); + clnt_destroy(rpcParam->cl); } - free((RpcParam *) (my->specParam)); + free(rpcParam); free(my->setup); } int Param_getInt(const Param *my, const char *name, const char *idx, int *row, unsigned long int *val) { - Args argsS, *args = &argsS; - Res *res; + RpcParam *rpcParam = my->specParam; + + Args args; + Res res; - args->param = ((RpcParam *)my->specParam)->remParam; - args->name = name; - args->idx = idx; - res = getint_1(args, ((RpcParam *)my->specParam)->cl); - *row = res->rows; - *val = res->value; + args.param = rpcParam->remParam; + args.name = name; + args.idx = idx; + res = *getint_1(&args, rpcParam->cl); + *row = res.rows; + *val = res.value; - return res->ret; + return res.ret; } int Param_getString(const Param *my, const char *name, const char *idx, diff --git a/allParam/rpc/rpcpas.c b/allParam/rpc/rpcpas.c index 99f9e84..2d12bda 100644 --- a/allParam/rpc/rpcpas.c +++ b/allParam/rpc/rpcpas.c @@ -14,7 +14,6 @@ unsigned long *con_1_svc(char **setup, struct svc_req *svcReq) { free(p); p = NULL; } - printf("%p\n", p); res = p; return &res; @@ -23,7 +22,6 @@ unsigned long *con_1_svc(char **setup, struct svc_req *svcReq) { void *des_1_svc(unsigned long *arg, struct svc_req *svcReq) { Param *p = *arg; - printf("%p\n", p); desParam(p); free(p); -- 2.43.0