diff --git a/src/dev/devAiDvx2502.c b/src/dev/devAiDvx2502.c index 48e099075..7934c8fab 100644 --- a/src/dev/devAiDvx2502.c +++ b/src/dev/devAiDvx2502.c @@ -80,7 +80,6 @@ struct { static long init_record(pai) struct aiRecord *pai; { - char message[100]; unsigned short value; struct vmeio *pvmeio; long status; @@ -90,9 +89,8 @@ static long init_record(pai) case (VME_IO) : break; default : - strcpy(message,pai->name); - strcat(message,": devAiDvx2502 (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pai, + "devAiDvx2502 (init_record) Illegal INP field"); return(S_db_badField); } @@ -102,9 +100,8 @@ static long init_record(pai) /* call driver so that it configures card */ pvmeio = (struct vmeio *)&(pai->inp.value); if(status=dvx_driver(pvmeio->card,pvmeio->signal,&value)) { - strcpy(message,pai->name); - strcat(message,": devAiDvx2502 (init_record) dvx_driver error"); - errMessage(status,message); + recGblRecordError(status,pai, + "devAiDvx2502 (init_record) dvx_driver error"); return(status); } return(0); diff --git a/src/dev/devAiSoft.c b/src/dev/devAiSoft.c index 7a1ca84fa..a63e53b4a 100644 --- a/src/dev/devAiSoft.c +++ b/src/dev/devAiSoft.c @@ -78,9 +78,7 @@ struct { static long init_record(pai) struct aiRecord *pai; { - char message[100]; -/* Added for Channel Access Links */ -long status; + long status; /* ai.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ switch (pai->inp.type) { @@ -95,9 +93,8 @@ long status; case (DB_LINK) : break; default : - strcpy(message,pai->name); - strcat(message,": devAiSoft (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pai, + "devAiSoft (init_record) Illegal INP field"); return(S_db_badField); } /* Make sure record processing routine does not perform any conversion*/ @@ -108,7 +105,6 @@ long status; static long read_ai(pai) struct aiRecord *pai; { - char message[100]; long status,options,nRequest; /* ai.inp must be a CONSTANT or a DB_LINK or a CA_LINK*/ @@ -135,9 +131,8 @@ static long read_ai(pai) default : if(recGblSetSevr(pai,SOFT_ALARM,VALID_ALARM)){ if(pai->stat!=SOFT_ALARM) { - strcpy(message,pai->name); - strcat(message,": devAiSoft (read_ai) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pai, + "devAiSoft (read_ai) Illegal INP field"); } } } diff --git a/src/dev/devAiSoftRaw.c b/src/dev/devAiSoftRaw.c index 46e243018..bdb6faca5 100644 --- a/src/dev/devAiSoftRaw.c +++ b/src/dev/devAiSoftRaw.c @@ -79,9 +79,7 @@ struct { static long init_record(pai) struct aiRecord *pai; { - char message[100]; -/* Added for Channel Access Links */ -long status; + long status; /* ai.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ switch (pai->inp.type) { @@ -97,9 +95,8 @@ long status; case (CA_LINK) : break; default : - strcpy(message,pai->name); - strcat(message,": devAiSoftRaw (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pai, + "devAiSoftRaw (init_record) Illegal INP field"); return(S_db_badField); } return(0); @@ -108,7 +105,6 @@ long status; static long read_ai(pai) struct aiRecord *pai; { - char message[100]; long status,options,nRequest; /* ai.inp must be a CONSTANT or a DB_LINK or a CA_LINK*/ @@ -136,9 +132,8 @@ static long read_ai(pai) default : if(recGblSetSevr(pai,SOFT_ALARM,VALID_ALARM)){ if(pai->stat!=SOFT_ALARM) { - strcpy(message,pai->name); - strcat(message,": devAiSoftRaw (read_ai) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pai, + "devAiSoftRaw (read_ai) Illegal INP field"); } } } diff --git a/src/dev/devAiTestAsyn.c b/src/dev/devAiTestAsyn.c index 5537cba16..6751e2ff6 100644 --- a/src/dev/devAiTestAsyn.c +++ b/src/dev/devAiTestAsyn.c @@ -97,7 +97,6 @@ static void myCallback(pcallback) static long init_record(pai) struct aiRecord *pai; { - char message[100]; struct callback *pcallback; /* ai.inp must be a CONSTANT*/ @@ -112,9 +111,8 @@ static long init_record(pai) pai->udf = FALSE; break; default : - strcpy(message,pai->name); - strcat(message,": devAiTestAsyn (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pai, + "devAiTestAsyn (init_record) Illegal INP field"); return(S_db_badField); } return(0); @@ -123,7 +121,6 @@ static long init_record(pai) static long read_ai(pai) struct aiRecord *pai; { - char message[100]; struct callback *pcallback=(struct callback *)(pai->dpvt); int wait_time; @@ -145,9 +142,8 @@ static long read_ai(pai) default : if(recGblSetSevr(pai,SOFT_ALARM,VALID_ALARM)){ if(pai->stat!=SOFT_ALARM) { - strcpy(message,pai->name); - strcat(message,": devAiTestAsyn (read_ai) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pai, + "devAiTestAsyn (read_ai) Illegal INP field"); } } } diff --git a/src/dev/devAiXy566Di.c b/src/dev/devAiXy566Di.c index bab7630e6..00cf346be 100644 --- a/src/dev/devAiXy566Di.c +++ b/src/dev/devAiXy566Di.c @@ -76,7 +76,6 @@ struct { static long init_record(pai) struct aiRecord *pai; { - char message[100]; unsigned short value; struct vmeio *pvmeio; long status; @@ -86,9 +85,8 @@ static long init_record(pai) case (VME_IO) : break; default : - strcpy(message,pai->name); - strcat(message,": devAiXy566Di (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pai, + "devAiXy566Di (init_record) Illegal INP field"); return(S_db_badField); } @@ -98,9 +96,8 @@ static long init_record(pai) /* call driver so that it configures card */ pvmeio = (struct vmeio *)&(pai->inp.value); if(status=ai_xy566_driver(pvmeio->card,pvmeio->signal,XY566DI,&value)) { - strcpy(message,pai->name); - strcat(message,": devAiXy566Di (init_record) ai_xy566_driver error"); - errMessage(status,message); + recGblRecordError(status,pai, + "devAiXy566Di (init_record) ai_xy566_driver error"); return(status); } return(0); diff --git a/src/dev/devAiXy566DiL.c b/src/dev/devAiXy566DiL.c index 2260be418..e579275f4 100644 --- a/src/dev/devAiXy566DiL.c +++ b/src/dev/devAiXy566DiL.c @@ -78,7 +78,6 @@ struct { static long init_record(pai) struct aiRecord *pai; { - char message[100]; unsigned short value; struct vmeio *pvmeio; long status; @@ -88,9 +87,8 @@ static long init_record(pai) case (VME_IO) : break; default : - strcpy(message,pai->name); - strcat(message,": devAiXy566DiL (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pai, + "devAiXy566DiL (init_record) Illegal INP field"); return(S_db_badField); } @@ -100,9 +98,8 @@ static long init_record(pai) /* call driver so that it configures card */ pvmeio = (struct vmeio *)&(pai->inp.value); if(status=ai_xy566_driver(pvmeio->card,pvmeio->signal,XY566DIL,&value)) { - strcpy(message,pai->name); - strcat(message,": devAiXy566DiL (init_record) ai_xy566_driver error"); - errMessage(status,message); + recGblRecordError(status,pai, + "devAiXy566DiL (init_record) ai_xy566_driver error"); return(status); } return(0); diff --git a/src/dev/devAiXy566Se.c b/src/dev/devAiXy566Se.c index 98d691c73..c801b4773 100644 --- a/src/dev/devAiXy566Se.c +++ b/src/dev/devAiXy566Se.c @@ -75,7 +75,6 @@ struct { static long init_record(pai) struct aiRecord *pai; { - char message[100]; unsigned short value; struct vmeio *pvmeio; long status; @@ -85,9 +84,8 @@ static long init_record(pai) case (VME_IO) : break; default : - strcpy(message,pai->name); - strcat(message,": devAiXy566Se (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pai, + "devAiXy566Se (init_record) Illegal INP field"); return(S_db_badField); } @@ -97,9 +95,8 @@ static long init_record(pai) /* call driver so that it configures card */ pvmeio = (struct vmeio *)&(pai->inp.value); if(status=ai_xy566_driver(pvmeio->card,pvmeio->signal,XY566SE,&value)) { - strcpy(message,pai->name); - strcat(message,": devAiXy566Se (init_record) ai_xy566_driver error"); - errMessage(status,message); + recGblRecordError(status,pai, + "devAiXy566Se (init_record) ai_xy566_driver error"); return(status); } return(0); diff --git a/src/dev/devAoSoft.c b/src/dev/devAoSoft.c index 971e4861f..77e74da39 100644 --- a/src/dev/devAoSoft.c +++ b/src/dev/devAoSoft.c @@ -95,7 +95,6 @@ struct aoRecord *pao; static long write_ao(pao) struct aoRecord *pao; { - char message[100]; long status; /* added for Channel Access Links */ long options; @@ -120,9 +119,8 @@ long nrequest; default : if(recGblSetSevr(pao,SOFT_ALARM,VALID_ALARM)){ if(pao->stat!=SOFT_ALARM) { - strcpy(message,pao->name); - strcat(message,": devAoSoft (write_ao) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pao, + "devAoSoft (write_ao) Illegal OUT field"); } } } diff --git a/src/dev/devAoSoftRaw.c b/src/dev/devAoSoftRaw.c index 8986c0899..08ff05237 100644 --- a/src/dev/devAoSoftRaw.c +++ b/src/dev/devAoSoftRaw.c @@ -92,11 +92,9 @@ long status; static long write_ao(pao) struct aoRecord *pao; { - char message[100]; long status; -/* added for Channel Access Links */ -long options; -long nrequest; + long options; + long nrequest; /* ao.out must be a CONSTANT or a DB_LINK or a CA_LINK*/ switch (pao->out.type) { @@ -117,9 +115,8 @@ long nrequest; default : if(recGblSetSevr(pao,SOFT_ALARM,VALID_ALARM)){ if(pao->stat!=SOFT_ALARM) { - strcpy(message,pao->name); - strcat(message,": devAoSoftRaw (write_ao) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pao, + "devAoSoftRaw (write_ao) Illegal OUT field"); } } } diff --git a/src/dev/devAoTestAsyn.c b/src/dev/devAoTestAsyn.c index 9d9703ed0..74e120263 100644 --- a/src/dev/devAoTestAsyn.c +++ b/src/dev/devAoTestAsyn.c @@ -100,7 +100,6 @@ static void myCallback(pcallback) static long init_record(pao) struct aoRecord *pao; { - char message[100]; struct callback *pcallback; /* ao.out must be a CONSTANT*/ @@ -113,9 +112,8 @@ static long init_record(pao) pcallback->wd_id = wdCreate(); break; default : - strcpy(message,pao->name); - strcat(message,": devAoTestAsyn (init_record) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pao, + "devAoTestAsyn (init_record) Illegal OUT field"); return(S_db_badField); } return(2); @@ -124,7 +122,6 @@ static long init_record(pao) static long write_ao(pao) struct aoRecord *pao; { - char message[100]; struct callback *pcallback=(struct callback *)(pao->dpvt); int wait_time; @@ -146,9 +143,8 @@ static long write_ao(pao) default : if(recGblSetSevr(pao,SOFT_ALARM,VALID_ALARM)){ if(pao->stat!=SOFT_ALARM) { - strcpy(message,pao->name); - strcat(message,": devAoTestAsyn (read_ao) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pao, + "devAoTestAsyn (read_ao) Illegal OUT field"); } } } diff --git a/src/dev/devAoVmiVme4100.c b/src/dev/devAoVmiVme4100.c index 0d8973681..65a060e5e 100644 --- a/src/dev/devAoVmiVme4100.c +++ b/src/dev/devAoVmiVme4100.c @@ -81,16 +81,14 @@ struct { static long init_record(pao) struct aoRecord *pao; { - char message[100]; /* ao.out must be an VME_IO */ switch (pao->out.type) { case (VME_IO) : break; default : - strcpy(message,pao->name); - strcat(message,": devAoVmiVme4100 (init_record) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pao, + "devAoVmiVme4100 (init_record) Illegal OUT field"); return(S_db_badField); } diff --git a/src/dev/devBiMpv910.c b/src/dev/devBiMpv910.c index 6381cfecd..cad14ddc1 100644 --- a/src/dev/devBiMpv910.c +++ b/src/dev/devBiMpv910.c @@ -72,7 +72,6 @@ struct { static long init_record(pbi) struct biRecord *pbi; { - char message[100]; struct vmeio *pvmeio; /* bi.inp must be an VME_IO */ @@ -83,9 +82,8 @@ static long init_record(pbi) pbi->mask <<= pvmeio->signal; break; default : - strcpy(message,pbi->name); - strcat(message,": devBiMpv910 (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pbi, + "devBiMpv910 (init_record) Illegal INP field"); return(S_db_badField); } return(0); diff --git a/src/dev/devBiSoft.c b/src/dev/devBiSoft.c index a8fb6b9d4..22a777419 100644 --- a/src/dev/devBiSoft.c +++ b/src/dev/devBiSoft.c @@ -75,9 +75,7 @@ struct { static long init_record(pbi) struct biRecord *pbi; { - char message[100]; -/* Added for Channel Access Links */ -long status; + long status; /* bi.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ switch (pbi->inp.type) { @@ -94,9 +92,8 @@ long status; case (CA_LINK) : break; default : - strcpy(message,pbi->name); - strcat(message,": devBiSoft (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pbi, + "devBiSoft (init_record) Illegal INP field"); return(S_db_badField); } return(0); @@ -105,7 +102,6 @@ long status; static long read_bi(pbi) struct biRecord *pbi; { - char message[100]; long status,options,nRequest; /* bi.inp must be a CONSTANT or a DB_LINK or a CA_LINK*/ @@ -132,9 +128,8 @@ static long read_bi(pbi) default : if(recGblSetSevr(pbi,SOFT_ALARM,VALID_ALARM)){ if(pbi->stat!=SOFT_ALARM) { - strcpy(message,pbi->name); - strcat(message,": devBiSoft (read_bi) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pbi, + "devBiSoft (read_bi) Illegal INP field"); } } } diff --git a/src/dev/devBiSoftRaw.c b/src/dev/devBiSoftRaw.c index 50c31ca2a..3bdccf292 100644 --- a/src/dev/devBiSoftRaw.c +++ b/src/dev/devBiSoftRaw.c @@ -76,9 +76,7 @@ struct { static long init_record(pbi) struct biRecord *pbi; { - char message[100]; -/* Added for Channel Access Links */ -long status; + long status; /* bi.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ switch (pbi->inp.type) { @@ -94,9 +92,8 @@ long status; case (CA_LINK) : break; default : - strcpy(message,pbi->name); - strcat(message,": devBiSoftRaw (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pbi, + "devBiSoftRaw (init_record) Illegal INP field"); return(S_db_badField); } return(0); @@ -105,7 +102,6 @@ long status; static long read_bi(pbi) struct biRecord *pbi; { - char message[100]; long status,options,nRequest; /* bi.inp must be a CONSTANT or a DB_LINK or a CA_LINK*/ @@ -132,9 +128,8 @@ static long read_bi(pbi) default : if(recGblSetSevr(pbi,SOFT_ALARM,VALID_ALARM)){ if(pbi->stat!=SOFT_ALARM) { - strcpy(message,pbi->name); - strcat(message,": devBiSoftRaw (read_bi) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pbi, + "devBiSoftRaw (read_bi) Illegal INP field"); } } } diff --git a/src/dev/devBiTestAsyn.c b/src/dev/devBiTestAsyn.c index 1066113ed..eb79cd92d 100644 --- a/src/dev/devBiTestAsyn.c +++ b/src/dev/devBiTestAsyn.c @@ -99,7 +99,6 @@ static void myCallback(pcallback) static long init_record(pbi) struct biRecord *pbi; { - char message[100]; struct callback *pcallback; /* bi.inp must be a CONSTANT*/ @@ -114,9 +113,8 @@ static long init_record(pbi) pbi->udf = FALSE; break; default : - strcpy(message,pbi->name); - strcat(message,": devBiTestAsyn (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pbi, + "devBiTestAsyn (init_record) Illegal INP field"); return(S_db_badField); } return(0); @@ -125,7 +123,6 @@ static long init_record(pbi) static long read_bi(pbi) struct biRecord *pbi; { - char message[100]; struct callback *pcallback=(struct callback *)(pbi->dpvt); int wait_time; @@ -147,9 +144,8 @@ static long read_bi(pbi) default : if(recGblSetSevr(pbi,SOFT_ALARM,VALID_ALARM)){ if(pbi->stat!=SOFT_ALARM) { - strcpy(message,pbi->name); - strcat(message,": devBiTestAsyn (read_bi) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pbi, + "devBiTestAsyn (read_bi) Illegal INP field"); } } } diff --git a/src/dev/devBiXVme210.c b/src/dev/devBiXVme210.c index 1a56a76c0..d480996b1 100644 --- a/src/dev/devBiXVme210.c +++ b/src/dev/devBiXVme210.c @@ -72,7 +72,6 @@ struct { static long init_record(pbi) struct biRecord *pbi; { - char message[100]; struct vmeio *pvmeio; /* bi.inp must be an VME_IO */ @@ -83,9 +82,8 @@ static long init_record(pbi) pbi->mask <<= pvmeio->signal; break; default : - strcpy(message,pbi->name); - strcat(message,": devBiXVme210 (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pbi, + "devBiXVme210 (init_record) Illegal INP field"); return(S_db_badField); } return(0); diff --git a/src/dev/devBoMpv902.c b/src/dev/devBoMpv902.c index b8c367185..0a47a14f8 100644 --- a/src/dev/devBoMpv902.c +++ b/src/dev/devBoMpv902.c @@ -72,8 +72,7 @@ struct { static long init_record(pbo) struct boRecord *pbo; { - char message[100]; - int value,status; + int value,status=0; struct vmeio *pvmeio; /* bo.out must be an VME_IO */ @@ -84,27 +83,15 @@ static long init_record(pbo) pbo->mask <<= pvmeio->signal; /* read the value via bo driver */ status = bb902_read(pvmeio->card,pbo->mask,&value); - if(status == 0) { - pbo->rval = value; - } else if(status == -1) { - strcpy(message,pbo->name); - strcat(message,": devBoMpv902 (init_record) card does not exist"); - errMessage(S_db_badField,message); - return(S_db_badField); - } else { - strcpy(message,pbo->name); - strcat(message,": devBoMpv902 (init_record) illegal device"); - errMessage(S_db_badField,message); - return(S_db_badField); - } + if(status == 0) pbo->rval = value; + else status = 2; break; default : - strcpy(message,pbo->name); - strcat(message,": devBoMpv902 (init_record) Illegal OUT field"); - errMessage(S_db_badField,message); - return(S_db_badField); + status = S_db_badField; + recGblRecordError(status,pbo, + "devBoMpv902 (init_record) Illegal OUT field"); } - return(0); + return(status); } static long write_bo(pbo) diff --git a/src/dev/devBoSoft.c b/src/dev/devBoSoft.c index 4c57ea44e..013956c34 100644 --- a/src/dev/devBoSoft.c +++ b/src/dev/devBoSoft.c @@ -92,11 +92,7 @@ struct boRecord *pbo; static long write_bo(pbo) struct boRecord *pbo; { - char message[100]; - long status; -/* added for Channel Access Links */ -long options; -long nrequest; + long status,options,nrequest; /* bo.out must be a CONSTANT or a DB_LINK or a CA_LINK*/ switch (pbo->out.type) { @@ -116,9 +112,8 @@ long nrequest; default : if(recGblSetSevr(pbo,SOFT_ALARM,VALID_ALARM)){ if(pbo->stat!=SOFT_ALARM) { - strcpy(message,pbo->name); - strcat(message,": devBoSoft (write_bo) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pbo, + "devBoSoft (write_bo) Illegal OUT field"); } } } diff --git a/src/dev/devBoSoftRaw.c b/src/dev/devBoSoftRaw.c index 54de17152..cbc018288 100644 --- a/src/dev/devBoSoftRaw.c +++ b/src/dev/devBoSoftRaw.c @@ -81,7 +81,7 @@ long status; if (pbo->out.type == PV_LINK) status = dbCaAddOutlink(&(pbo->out), (void *) pbo, "RVAL"); else - status = 0L; + status = 2; return status; @@ -90,11 +90,7 @@ long status; static long write_bo(pbo) struct boRecord *pbo; { - char message[100]; - long status; -/* added for Channel Access Links */ -long options; -long nrequest; + long status,options,nrequest; /* bo.out must be a CONSTANT or a DB_LINK or a CA_LINK*/ switch (pbo->out.type) { @@ -115,9 +111,8 @@ long nrequest; default : if(recGblSetSevr(pbo,SOFT_ALARM,VALID_ALARM)){ if(pbo->stat!=SOFT_ALARM) { - strcpy(message,pbo->name); - strcat(message,": devBoSoftRaw (write_bo) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pbo, + "devBoSoftRaw (write_bo) Illegal OUT field"); } } } diff --git a/src/dev/devBoTestAsyn.c b/src/dev/devBoTestAsyn.c index d132865fa..4589ee9c9 100644 --- a/src/dev/devBoTestAsyn.c +++ b/src/dev/devBoTestAsyn.c @@ -100,7 +100,6 @@ static void myCallback(pcallback) static long init_record(pbo) struct boRecord *pbo; { - char message[100]; struct callback *pcallback; /* bo.out must be a CONSTANT*/ @@ -113,9 +112,8 @@ static long init_record(pbo) pcallback->wd_id = wdCreate(); break; default : - strcpy(message,pbo->name); - strcat(message,": devBoTestAsyn (init_record) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pbo, + "devBoTestAsyn (init_record) Illegal OUT field"); return(S_db_badField); } return(2); @@ -124,7 +122,6 @@ static long init_record(pbo) static long write_bo(pbo) struct boRecord *pbo; { - char message[100]; struct callback *pcallback=(struct callback *)(pbo->dpvt); int wait_time; @@ -146,9 +143,8 @@ static long write_bo(pbo) default : if(recGblSetSevr(pbo,SOFT_ALARM,VALID_ALARM)){ if(pbo->stat!=SOFT_ALARM) { - strcpy(message,pbo->name); - strcat(message,": devBoTestAsyn (read_bo) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pbo, + "devBoTestAsyn (read_bo) Illegal OUT field"); } } } diff --git a/src/dev/devBoXVme220.c b/src/dev/devBoXVme220.c index 2590b34e7..4bace018c 100644 --- a/src/dev/devBoXVme220.c +++ b/src/dev/devBoXVme220.c @@ -72,9 +72,8 @@ struct { static long init_record(pbo) struct boRecord *pbo; { - char message[100]; unsigned int value; - int status; + int status=0; struct vmeio *pvmeio; /* bo.out must be an VME_IO */ @@ -84,27 +83,15 @@ static long init_record(pbo) pbo->mask = 1; pbo->mask <<= pvmeio->signal; status = xy220_read(pvmeio->card,pbo->mask,&value); - if(status == 0) { - pbo->rval = value; - } else if(status == -1) { - strcpy(message,pbo->name); - strcat(message,": devBoXVme220 (init_record) card does not exist"); - errMessage(S_db_badField,message); - return(S_db_badField); - } else { - strcpy(message,pbo->name); - strcat(message,": devBoXVme220 (init_record) illegal device"); - errMessage(S_db_badField,message); - return(S_db_badField); - } + if(status == 0) pbo->rbv = pbo->rval = value; + else status = 2; break; default : - strcpy(message,pbo->name); - strcat(message,": devBoXVme220 (init_record) Illegal OUT field"); - errMessage(S_db_badField,message); - return(S_db_badField); + status = S_db_badField; + recGblRecordError(status,pbo, + "devBoXVme220 (init_record) Illegal OUT field"); } - return(0); + return(status); } static long write_bo(pbo) diff --git a/src/dev/devEventSoft.c b/src/dev/devEventSoft.c index 066657dec..5b33946e8 100644 --- a/src/dev/devEventSoft.c +++ b/src/dev/devEventSoft.c @@ -72,9 +72,7 @@ struct { static long init_record(pevent) struct eventRecord *pevent; { - char message[100]; -/* Added for Channel Access Links */ -long status; + long status; /* event.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ switch (pevent->inp.type) { @@ -93,9 +91,8 @@ long status; case (CA_LINK) : break; default : - strcpy(message,pevent->name); - strcat(message,": devEventSoft (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pevent, + "devEventSoft (init_record) Illegal INP field"); return(S_db_badField); } return(0); @@ -104,7 +101,6 @@ long status; static long read_event(pevent) struct eventRecord *pevent; { - char message[100]; long status=0,options,nRequest; /* event.inp must be a CONSTANT or a DB_LINK or a CA_LINK*/ @@ -131,9 +127,8 @@ static long read_event(pevent) default : if(recGblSetSevr(pevent,SOFT_ALARM,VALID_ALARM)){ if(pevent->stat!=SOFT_ALARM) { - strcpy(message,pevent->name); - strcat(message,": devEventSoft (read_event) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pevent, + "devEventSoft (read_event) Illegal INP field"); } } } diff --git a/src/dev/devEventTestIoEvent.c b/src/dev/devEventTestIoEvent.c index 6982ff43e..f53a0099d 100644 --- a/src/dev/devEventTestIoEvent.c +++ b/src/dev/devEventTestIoEvent.c @@ -57,15 +57,13 @@ struct { DEVSUPFUN init_record; DEVSUPFUN get_ioint_info; DEVSUPFUN read_event; - DEVSUPFUN special_linconv; }devEventTestIoEvent={ - 6, + 5, NULL, init, NULL, get_ioint_info, - read_event, - NULL}; + read_event}; static IOSCANPVT ioscanpvt; WDOG_ID wd_id=NULL; diff --git a/src/dev/devHistogramSoft.c b/src/dev/devHistogramSoft.c index 2fdab404b..66ffa1233 100644 --- a/src/dev/devHistogramSoft.c +++ b/src/dev/devHistogramSoft.c @@ -74,7 +74,6 @@ struct { static long init_record(phistogram) struct histogramRecord *phistogram; { - char message[100]; /* histogram.svl must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ switch (phistogram->svl.type) { @@ -88,9 +87,8 @@ static long init_record(phistogram) case (CA_LINK) : break; default : - strcpy(message,phistogram->name); - strcat(message,": devHistogramSoft (init_record) Illegal SVL field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,phistogram, + "devHistogramSoft (init_record) Illegal SVL field"); return(S_db_badField); } return(0); @@ -99,7 +97,6 @@ static long init_record(phistogram) static long read_histogram(phistogram) struct histogramRecord *phistogram; { - char message[100]; long status,options,nRequest; /* histogram.svl must be a CONSTANT or a DB_LINK or a CA_LINK*/ @@ -125,9 +122,8 @@ static long read_histogram(phistogram) phistogram->nsev = VALID_ALARM; phistogram->nsta = SOFT_ALARM; if(phistogram->stat!=SOFT_ALARM) { - strcpy(message,phistogram->name); - strcat(message,": devHistogramSoft (read_histogram) Illegal SVL field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,phistogram, + "devHistogramSoft (read_histogram) Illegal SVL field"); } } } diff --git a/src/dev/devHistogramTestAsyn.c b/src/dev/devHistogramTestAsyn.c index 153eefad8..53f3b7d78 100644 --- a/src/dev/devHistogramTestAsyn.c +++ b/src/dev/devHistogramTestAsyn.c @@ -96,7 +96,6 @@ static void myCallback(pcallback) static long init_record(phistogram) struct histogramRecord *phistogram; { - char message[100]; struct callback *pcallback; /* histogram.svl must be a CONSTANT*/ @@ -110,9 +109,8 @@ static long init_record(phistogram) phistogram->sgnl = phistogram->svl.value.value; break; default : - strcpy(message,phistogram->name); - strcat(message,": devHistogramTestAsyn (init_record) Illegal SVL field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,phistogram, + "devHistogramTestAsyn (init_record) Illegal SVL field"); return(S_db_badField); } return(0); @@ -121,7 +119,6 @@ static long init_record(phistogram) static long read_histogram(phistogram) struct histogramRecord *phistogram; { - char message[100]; struct callback *pcallback=(struct callback *)(phistogram->dpvt); int wait_time; @@ -143,9 +140,8 @@ static long read_histogram(phistogram) default : if(recGblSetSevr(phistogram,SOFT_ALARM,VALID_ALARM)){ if(phistogram->stat!=SOFT_ALARM) { - strcpy(message,phistogram->name); - strcat(message,": devHistogramTestAsyn (read_histogram) Illegal SVL field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,phistogram, + "devHistogramTestAsyn (read_histogram) Illegal SVL field"); } } } diff --git a/src/dev/devLiSoft.c b/src/dev/devLiSoft.c index e61b5528f..1735dca96 100644 --- a/src/dev/devLiSoft.c +++ b/src/dev/devLiSoft.c @@ -72,9 +72,7 @@ struct { static long init_record(plongin) struct longinRecord *plongin; { - char message[100]; -/* Added for Channel Access Links */ -long status; + long status; /* longin.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ switch (plongin->inp.type) { @@ -91,9 +89,8 @@ long status; case (CA_LINK) : break; default : - strcpy(message,plongin->name); - strcat(message,": devLiSoft (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,plongin, + "devLiSoft (init_record) Illegal INP field"); return(S_db_badField); } return(0); @@ -102,7 +99,6 @@ long status; static long read_longin(plongin) struct longinRecord *plongin; { - char message[100]; long status=0,options,nRequest; /* longin.inp must be a CONSTANT or a DB_LINK or a CA_LINK*/ @@ -129,9 +125,8 @@ static long read_longin(plongin) default : if(recGblSetSevr(plongin,SOFT_ALARM,VALID_ALARM)){ if(plongin->stat!=SOFT_ALARM) { - strcpy(message,plongin->name); - strcat(message,": devLiSoft (read_longin) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,plongin, + "devLiSoft (read_longin) Illegal INP field"); } } } diff --git a/src/dev/devLoSoft.c b/src/dev/devLoSoft.c index 76799e914..afa594a26 100644 --- a/src/dev/devLoSoft.c +++ b/src/dev/devLoSoft.c @@ -88,11 +88,7 @@ long status; static long write_longout(plongout) struct longoutRecord *plongout; { - char message[100]; - long status; -/* added for Channel Access Links */ -long options; -long nrequest; + long status,options,nrequest; /* longout.out must be a CONSTANT or a DB_LINK or a CA_LINK*/ switch (plongout->out.type) { @@ -113,9 +109,8 @@ long nrequest; default : if(recGblSetSevr(plongout,SOFT_ALARM,VALID_ALARM)){ if(plongout->stat!=SOFT_ALARM) { - strcpy(message,plongout->name); - strcat(message,": devLoSoft (write_longout) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,plongout, + "devLoSoft (write_longout) Illegal OUT field"); } } } diff --git a/src/dev/devMbbiMpv910.c b/src/dev/devMbbiMpv910.c index 62178a139..db410c6eb 100644 --- a/src/dev/devMbbiMpv910.c +++ b/src/dev/devMbbiMpv910.c @@ -73,7 +73,6 @@ struct { static long init_record(pmbbi) struct mbbiRecord *pmbbi; { - char message[100]; /* mbbi.inp must be an VME_IO */ switch (pmbbi->inp.type) { @@ -82,9 +81,8 @@ static long init_record(pmbbi) pmbbi->mask <<= pmbbi->shft; break; default : - strcpy(message,pmbbi->name); - strcat(message,": devMbbiMpv910 (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pmbbi, + "devMbbiMpv910 (init_record) Illegal INP field"); return(S_db_badField); } return(0); diff --git a/src/dev/devMbbiSoft.c b/src/dev/devMbbiSoft.c index e72717add..1ac2f506d 100644 --- a/src/dev/devMbbiSoft.c +++ b/src/dev/devMbbiSoft.c @@ -76,9 +76,7 @@ struct { static long init_record(pmbbi) struct mbbiRecord *pmbbi; { - char message[100]; -/* Added for Channel Access Links */ -long status; + long status; /* mbbi.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ switch (pmbbi->inp.type) { @@ -95,9 +93,8 @@ long status; case (CA_LINK) : break; default : - strcpy(message,pmbbi->name); - strcat(message,": devMbbiSoft (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pmbbi, + "devMbbiSoft (init_record) Illegal INP field"); return(S_db_badField); } return(0); @@ -106,7 +103,6 @@ long status; static long read_mbbi(pmbbi) struct mbbiRecord *pmbbi; { - char message[100]; long status,options,nRequest; /* mbbi.inp must be a CONSTANT or a DB_LINK or a CA_LINK*/ @@ -133,9 +129,8 @@ static long read_mbbi(pmbbi) default : if(recGblSetSevr(pmbbi,SOFT_ALARM,VALID_ALARM)){ if(pmbbi->stat!=SOFT_ALARM) { - strcpy(message,pmbbi->name); - strcat(message,": devMbbiSoft (read_mbbi) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pmbbi, + "devMbbiSoft (read_mbbi) Illegal INP field"); } } } diff --git a/src/dev/devMbbiSoftRaw.c b/src/dev/devMbbiSoftRaw.c index 772bcdc28..3ee5a0603 100644 --- a/src/dev/devMbbiSoftRaw.c +++ b/src/dev/devMbbiSoftRaw.c @@ -77,9 +77,7 @@ struct { static long init_record(pmbbi) struct mbbiRecord *pmbbi; { - char message[100]; -/* Added for Channel Access Links */ -long status; + long status; /* mbbi.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ switch (pmbbi->inp.type) { @@ -95,9 +93,8 @@ long status; case (CA_LINK) : break; default : - strcpy(message,pmbbi->name); - strcat(message,": devMbbiSoftRaw (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pmbbi, + "devMbbiSoftRaw (init_record) Illegal INP field"); return(S_db_badField); } return(0); @@ -106,7 +103,6 @@ long status; static long read_mbbi(pmbbi) struct mbbiRecord *pmbbi; { - char message[100]; long status,options,nRequest; /* mbbi.inp must be a CONSTANT or a DB_LINK or a CA_LINK*/ @@ -133,9 +129,8 @@ static long read_mbbi(pmbbi) default : if(recGblSetSevr(pmbbi,SOFT_ALARM,VALID_ALARM)){ if(pmbbi->stat!=SOFT_ALARM) { - strcpy(message,pmbbi->name); - strcat(message,": devMbbiSoftRaw (read_mbbi) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pmbbi, + "devMbbiSoftRaw (read_mbbi) Illegal INP field"); } } } diff --git a/src/dev/devMbbiTestAsyn.c b/src/dev/devMbbiTestAsyn.c index ccb68ab5c..732d95b60 100644 --- a/src/dev/devMbbiTestAsyn.c +++ b/src/dev/devMbbiTestAsyn.c @@ -98,7 +98,6 @@ static void myCallback(pcallback) static long init_record(pmbbi) struct mbbiRecord *pmbbi; { - char message[100]; struct callback *pcallback; /* mbbi.inp must be a CONSTANT*/ @@ -113,9 +112,8 @@ static long init_record(pmbbi) pmbbi->udf = FALSE; break; default : - strcpy(message,pmbbi->name); - strcat(message,": devMbbiTestAsyn (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pmbbi, + "devMbbiTestAsyn (init_record) Illegal INP field"); return(S_db_badField); } return(0); @@ -124,7 +122,6 @@ static long init_record(pmbbi) static long read_mbbi(pmbbi) struct mbbiRecord *pmbbi; { - char message[100]; struct callback *pcallback=(struct callback *)(pmbbi->dpvt); int wait_time; @@ -146,9 +143,8 @@ static long read_mbbi(pmbbi) default : if(recGblSetSevr(pmbbi,SOFT_ALARM,VALID_ALARM)){ if(pmbbi->stat!=SOFT_ALARM) { - strcpy(message,pmbbi->name); - strcat(message,": devMbbiTestAsyn (read_mbbi) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pmbbi, + "devMbbiTestAsyn (read_mbbi) Illegal INP field"); } } } diff --git a/src/dev/devMbbiXVme210.c b/src/dev/devMbbiXVme210.c index 6167324cd..7ff170692 100644 --- a/src/dev/devMbbiXVme210.c +++ b/src/dev/devMbbiXVme210.c @@ -73,7 +73,6 @@ struct { static long init_record(pmbbi) struct mbbiRecord *pmbbi; { - char message[100]; /* mbbi.inp must be an VME_IO */ switch (pmbbi->inp.type) { @@ -82,9 +81,8 @@ static long init_record(pmbbi) pmbbi->mask <<= pmbbi->shft; break; default : - strcpy(message,pmbbi->name); - strcat(message,": devMbbiXVme210 (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pmbbi, + "devMbbiXVme210 (init_record) Illegal INP field"); return(S_db_badField); } return(0); diff --git a/src/dev/devMbboMpv902.c b/src/dev/devMbboMpv902.c index 2d533405c..e57779496 100644 --- a/src/dev/devMbboMpv902.c +++ b/src/dev/devMbboMpv902.c @@ -73,10 +73,9 @@ struct { static long init_record(pmbbo) struct mbboRecord *pmbbo; { - char message[100]; unsigned long value; struct vmeio *pvmeio; - int status; + int status=0; /* mbbo.out must be an VME_IO */ switch (pmbbo->out.type) { @@ -86,14 +85,14 @@ static long init_record(pmbbo) pmbbo->mask <<= pmbbo->shft; status = bb902_read(pvmeio->card,pmbbo->mask,&value); if(status==0) pmbbo->rbv = pmbbo->rval = value; + else status = 2; break; default : - strcpy(message,pmbbo->name); - strcat(message,": devMbboMpv902 (init_record) Illegal OUT field"); - errMessage(S_db_badField,message); - return(S_db_badField); + status = S_db_badField; + recGblRecordError(status,pmbbo, + "devMbboMpv902 (init_record) Illegal OUT field"); } - return(0); + return(status); } static long write_mbbo(pmbbo) diff --git a/src/dev/devMbboSoft.c b/src/dev/devMbboSoft.c index f224d4530..9acb4f0e8 100644 --- a/src/dev/devMbboSoft.c +++ b/src/dev/devMbboSoft.c @@ -94,11 +94,7 @@ struct mbboRecord *pmbbo; static long write_mbbo(pmbbo) struct mbboRecord *pmbbo; { - char message[100]; - long status; -/* added for Channel Access Links */ -long options; -long nrequest; + long status,options,nrequest; /* mbbo.out must be a CONSTANT or a DB_LINK or a CA_LINK*/ switch (pmbbo->out.type) { @@ -119,9 +115,8 @@ long nrequest; default : if(recGblSetSevr(pmbbo,SOFT_ALARM,VALID_ALARM)){ if(pmbbo->stat!=SOFT_ALARM) { - strcpy(message,pmbbo->name); - strcat(message,": devMbboSoft (write_mbbo) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pmbbo, + "devMbboSoft (write_mbbo) Illegal OUT field"); } } } diff --git a/src/dev/devMbboSoftRaw.c b/src/dev/devMbboSoftRaw.c index ba81c4413..d3c1a6bb1 100644 --- a/src/dev/devMbboSoftRaw.c +++ b/src/dev/devMbboSoftRaw.c @@ -81,7 +81,7 @@ long status; if (pmbbo->out.type == PV_LINK) status = dbCaAddOutlink(&(pmbbo->out), (void *) pmbbo, "RVAL"); else - status = 0L; + status = 2; return status; @@ -90,11 +90,7 @@ long status; static long write_mbbo(pmbbo) struct mbboRecord *pmbbo; { - char message[100]; - long status; -/* added for Channel Access Links */ -long options; -long nrequest; + long status,options,nrequest; /* mbbo.out must be a CONSTANT or a DB_LINK or a CA_LINK*/ switch (pmbbo->out.type) { @@ -115,9 +111,8 @@ long nrequest; default : if(recGblSetSevr(pmbbo,SOFT_ALARM,VALID_ALARM)){ if(pmbbo->stat!=SOFT_ALARM) { - strcpy(message,pmbbo->name); - strcat(message,": devMbboSoftRaw (write_mbbo) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pmbbo, + "devMbboSoftRaw (write_mbbo) Illegal OUT field"); } } } diff --git a/src/dev/devMbboTestAsyn.c b/src/dev/devMbboTestAsyn.c index 951cf2c6f..9af0c9d91 100644 --- a/src/dev/devMbboTestAsyn.c +++ b/src/dev/devMbboTestAsyn.c @@ -100,7 +100,6 @@ static void myCallback(pcallback) static long init_record(pmbbo) struct mbboRecord *pmbbo; { - char message[100]; struct callback *pcallback; /* mbbo.out must be a CONSTANT*/ @@ -113,9 +112,8 @@ static long init_record(pmbbo) pcallback->wd_id = wdCreate(); break; default : - strcpy(message,pmbbo->name); - strcat(message,": devMbboTestAsyn (init_record) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pmbbo, + "devMbboTestAsyn (init_record) Illegal OUT field"); return(S_db_badField); } return(2); @@ -124,7 +122,6 @@ static long init_record(pmbbo) static long write_mbbo(pmbbo) struct mbboRecord *pmbbo; { - char message[100]; struct callback *pcallback=(struct callback *)(pmbbo->dpvt); int wait_time; @@ -146,9 +143,8 @@ static long write_mbbo(pmbbo) default : if(recGblSetSevr(pmbbo,SOFT_ALARM,VALID_ALARM)){ if(pmbbo->stat!=SOFT_ALARM) { - strcpy(message,pmbbo->name); - strcat(message,": devMbboTestAsyn (read_mbbo) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pmbbo, + "devMbboTestAsyn (read_mbbo) Illegal OUT field"); } } } diff --git a/src/dev/devMbboXVme220.c b/src/dev/devMbboXVme220.c index 291ab348f..0b782008b 100644 --- a/src/dev/devMbboXVme220.c +++ b/src/dev/devMbboXVme220.c @@ -73,10 +73,9 @@ struct { static long init_record(pmbbo) struct mbboRecord *pmbbo; { - char message[100]; unsigned long value; struct vmeio *pvmeio; - int status; + int status=0; /* mbbo.out must be an VME_IO */ switch (pmbbo->out.type) { @@ -86,14 +85,14 @@ static long init_record(pmbbo) pmbbo->mask = pmbbo->shft; status = xy220_read(pvmeio->card,pmbbo->mask,&value); if(status==0) pmbbo->rbv = pmbbo->rval = value; + else status = 2; break; default : - strcpy(message,pmbbo->name); - strcat(message,": devMbboXVme220 (init_record) Illegal OUT field"); - errMessage(S_db_badField,message); - return(S_db_badField); + status = S_db_badField; + recGblRecordError(status,pmbbo, + "devMbboXVme220 (init_record) Illegal OUT field"); } - return(0); + return(status); } static long write_mbbo(pmbbo) diff --git a/src/dev/devPtSoft.c b/src/dev/devPtSoft.c index a3b274bc3..2935f9650 100644 --- a/src/dev/devPtSoft.c +++ b/src/dev/devPtSoft.c @@ -89,11 +89,7 @@ long status; static long write_pt(ppt) struct pulseTrainRecord *ppt; { - char message[100]; - long status; -/* added for Channel Access Links */ -long options; -long nrequest; + long status,options,nrequest; /* pt.out must be a CONSTANT or a DB_LINK or a CA_LINK*/ switch (ppt->out.type) { @@ -113,9 +109,8 @@ long nrequest; default : if(recGblSetSevr(ppt,WRITE_ALARM,VALID_ALARM)){ if(ppt->stat!=SOFT_ALARM) { - strcpy(message,ppt->name); - strcat(message,": devPtSoft (write_pt) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,ppt, + "devPtSoft (write_pt) Illegal OUT field"); } } } diff --git a/src/dev/devSiSoft.c b/src/dev/devSiSoft.c index fa76dfdfa..9949113d3 100644 --- a/src/dev/devSiSoft.c +++ b/src/dev/devSiSoft.c @@ -73,9 +73,7 @@ struct { static long init_record(pstringin) struct stringinRecord *pstringin; { - char message[100]; -/* Added for Channel Access Links */ -long status; + long status; /* stringin.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ switch (pstringin->inp.type) { @@ -95,9 +93,8 @@ long status; case (CA_LINK) : break; default : - strcpy(message,pstringin->name); - strcat(message,": devSiSoft (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pstringin, + "devSiSoft (init_record) Illegal INP field"); return(S_db_badField); } return(0); @@ -106,7 +103,6 @@ long status; static long read_stringin(pstringin) struct stringinRecord *pstringin; { - char message[100]; long status=0,options,nRequest; /* stringin.inp must be a CONSTANT or a DB_LINK or a CA_LINK*/ @@ -133,9 +129,8 @@ static long read_stringin(pstringin) default : if(recGblSetSevr(pstringin,SOFT_ALARM,VALID_ALARM)){ if(pstringin->stat!=SOFT_ALARM) { - strcpy(message,pstringin->name); - strcat(message,": devSiSoft (read_stringin) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pstringin, + "devSiSoft (read_stringin) Illegal INP field"); } } } diff --git a/src/dev/devSiTestAsyn.c b/src/dev/devSiTestAsyn.c index 8f8702f84..4ec4e6680 100644 --- a/src/dev/devSiTestAsyn.c +++ b/src/dev/devSiTestAsyn.c @@ -97,7 +97,6 @@ static void myCallback(pcallback) static long init_record(pstringin) struct stringinRecord *pstringin; { - char message[100]; struct callback *pcallback; /* stringin.inp must be a CONSTANT*/ @@ -114,9 +113,8 @@ static long init_record(pstringin) } break; default : - strcpy(message,pstringin->name); - strcat(message,": devSiTestAsyn (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pstringin, + "devSiTestAsyn (init_record) Illegal INP field"); return(S_db_badField); } return(0); @@ -125,7 +123,6 @@ static long init_record(pstringin) static long read_stringin(pstringin) struct stringinRecord *pstringin; { - char message[100]; struct callback *pcallback=(struct callback *)(pstringin->dpvt); int wait_time; @@ -147,9 +144,8 @@ static long read_stringin(pstringin) default : if(recGblSetSevr(pstringin,SOFT_ALARM,VALID_ALARM)){ if(pstringin->stat!=SOFT_ALARM) { - strcpy(message,pstringin->name); - strcat(message,": devSiTestAsyn (read_stringin) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pstringin, + "devSiTestAsyn (read_stringin) Illegal INP field"); } } } diff --git a/src/dev/devSoSoft.c b/src/dev/devSoSoft.c index 788300347..0b9afb72e 100644 --- a/src/dev/devSoSoft.c +++ b/src/dev/devSoSoft.c @@ -88,11 +88,7 @@ long status; static long write_stringout(pstringout) struct stringoutRecord *pstringout; { - char message[100]; - long status; -/* added for Channel Access Links */ -long options; -long nrequest; + long status,options,nrequest; /* stringout.out must be a CONSTANT or a DB_LINK or a CA_LINK*/ switch (pstringout->out.type) { @@ -113,9 +109,8 @@ long nrequest; default : if(recGblSetSevr(pstringout,SOFT_ALARM,VALID_ALARM)){ if(pstringout->stat!=SOFT_ALARM) { - strcpy(message,pstringout->name); - strcat(message,": devSoSoft (write_stringout) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pstringout, + "devSoSoft (write_stringout) Illegal OUT field"); } } } diff --git a/src/dev/devSoTestAsyn.c b/src/dev/devSoTestAsyn.c index 8f269f439..81989037c 100644 --- a/src/dev/devSoTestAsyn.c +++ b/src/dev/devSoTestAsyn.c @@ -98,7 +98,6 @@ static void myCallback(pcallback) static long init_record(pstringout) struct stringoutRecord *pstringout; { - char message[100]; struct callback *pcallback; /* stringout.out must be a CONSTANT*/ @@ -111,9 +110,8 @@ static long init_record(pstringout) pcallback->wd_id = wdCreate(); break; default : - strcpy(message,pstringout->name); - strcat(message,": devSoTestAsyn (init_record) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pstringout, + "devSoTestAsyn (init_record) Illegal OUT field"); return(S_db_badField); } return(0); @@ -122,7 +120,6 @@ static long init_record(pstringout) static long write_stringout(pstringout) struct stringoutRecord *pstringout; { - char message[100]; struct callback *pcallback=(struct callback *)(pstringout->dpvt); int wait_time; @@ -144,9 +141,8 @@ static long write_stringout(pstringout) default : if(recGblSetSevr(pstringout,SOFT_ALARM,VALID_ALARM)){ if(pstringout->stat!=SOFT_ALARM) { - strcpy(message,pstringout->name); - strcat(message,": devSoTestAsyn (read_stringout) Illegal OUT field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pstringout, + "devSoTestAsyn (read_stringout) Illegal OUT field"); } } } diff --git a/src/dev/devWfJoergerVtr1.c b/src/dev/devWfJoergerVtr1.c index 57b1be7ba..26b77c9e1 100644 --- a/src/dev/devWfJoergerVtr1.c +++ b/src/dev/devWfJoergerVtr1.c @@ -133,16 +133,14 @@ static long get_ioint_info(cmd,pwf,io_type,card_type,card_number) static long init_record(pwf) struct waveformRecord *pwf; { - char message[100]; /* wf.inp must be an VME_IO */ switch (pwf->inp.type) { case (VME_IO) : break; default : - strcpy(message,pwf->name); - strcat(message,": devWfJoergerVtr1 (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pwf, + "devWfJoergerVtr1 (init_record) Illegal INP field"); return(S_db_badField); } return(0); diff --git a/src/dev/devWfSoft.c b/src/dev/devWfSoft.c index a47885d82..8001889d3 100644 --- a/src/dev/devWfSoft.c +++ b/src/dev/devWfSoft.c @@ -74,9 +74,7 @@ struct { static long init_record(pwf) struct waveformRecord *pwf; { - char message[100]; -/* Added for Channel Access Links */ -long status; + long status; /* wf.inp must be a CONSTANT or a PV_LINK or a DB_LINK or a CA_LINK*/ switch (pwf->inp.type) { @@ -92,9 +90,8 @@ long status; case (CA_LINK) : break; default : - strcpy(message,pwf->name); - strcat(message,": devWfSoft (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pwf, + "devWfSoft (init_record) Illegal INP field"); return(S_db_badField); } return(0); @@ -103,7 +100,6 @@ long status; static long read_wf(pwf) struct waveformRecord *pwf; { - char message[100]; long options,nRequest; /* wf.inp must be a CONSTANT or a DB_LINK or a CA_LINK*/ @@ -130,9 +126,8 @@ static long read_wf(pwf) default : if(recGblSetSevr(pwf,SOFT_ALARM,VALID_ALARM)){ if(pwf->stat!=SOFT_ALARM) { - strcpy(message,pwf->name); - strcat(message,": devWfSoft (read_wf) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pwf, + "devWfSoft (read_wf) Illegal INP field"); } } } diff --git a/src/dev/devWfTestAsyn.c b/src/dev/devWfTestAsyn.c index 9a2335b58..1a04fe7d1 100644 --- a/src/dev/devWfTestAsyn.c +++ b/src/dev/devWfTestAsyn.c @@ -97,7 +97,6 @@ static void myCallback(pcallback) static long init_record(pwf) struct waveformRecord *pwf; { - char message[100]; struct callback *pcallback; /* wf.inp must be a CONSTANT*/ @@ -111,9 +110,8 @@ static long init_record(pwf) pwf->nord = 0; break; default : - strcpy(message,pwf->name); - strcat(message,": devWfTestAsyn (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pwf, + "devWfTestAsyn (init_record) Illegal INP field"); return(S_db_badField); } return(0); @@ -122,7 +120,6 @@ static long init_record(pwf) static long read_wf(pwf) struct waveformRecord *pwf; { - char message[100]; struct callback *pcallback=(struct callback *)(pwf->dpvt); int wait_time; @@ -144,9 +141,8 @@ static long read_wf(pwf) default : if(recGblSetSevr(pwf,SOFT_ALARM,VALID_ALARM)){ if(pwf->stat!=SOFT_ALARM) { - strcpy(message,pwf->name); - strcat(message,": devWfTestAsyn (read_wf) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pwf, + "devWfTestAsyn (read_wf) Illegal INP field"); } } } diff --git a/src/dev/devWfXy566Sc.c b/src/dev/devWfXy566Sc.c index e9ea905a8..22e80819c 100644 --- a/src/dev/devWfXy566Sc.c +++ b/src/dev/devWfXy566Sc.c @@ -100,16 +100,14 @@ static void myCallback(pwf,no_read,pdata) static long init_record(pwf) struct waveformRecord *pwf; { - char message[100]; /* wf.inp must be an VME_IO */ switch (pwf->inp.type) { case (VME_IO) : break; default : - strcpy(message,pwf->name); - strcat(message,": devWfXy566Sc (init_record) Illegal INP field"); - errMessage(S_db_badField,message); + recGblRecordError(S_db_badField,pwf, + "devWfXy566Sc (init_record) Illegal INP field"); return(S_db_badField); } return(0);