diff --git a/src/db/atdb.c b/src/db/atdb.c index e06999a39..0dec21d01 100644 --- a/src/db/atdb.c +++ b/src/db/atdb.c @@ -1,5 +1,5 @@ /*atodb.c*/ -/* base/src/db $Id$ */ +/* share/src/db @(#)atdb.c 1.7 2/25/94 */ /* * * Author: Marty Kraimer diff --git a/src/db/callback.c b/src/db/callback.c index 6147aa02c..64f690ab8 100644 --- a/src/db/callback.c +++ b/src/db/callback.c @@ -1,5 +1,5 @@ /* callback.c */ -/* base/src/db $Id$ */ +/* share/src/db @(#)callback.c 1.7 9/14/93 */ /* general purpose callback tasks */ /* diff --git a/src/db/dbAccess.c b/src/db/dbAccess.c index a55fce685..1a06f10b5 100644 --- a/src/db/dbAccess.c +++ b/src/db/dbAccess.c @@ -96,6 +96,7 @@ #include extern struct dbBase *pdbBase; +extern long lset_stack_not_empty; static short mapDBFToDBR[DBF_NTYPES] = { DBF_STRING, DBF_CHAR, DBF_UCHAR, DBF_SHORT, DBF_USHORT, DBF_LONG, DBF_ULONG, DBF_FLOAT, DBF_DOUBLE, DBF_ENUM, DBF_ENUM, DBF_ENUM, DBF_ENUM, DBF_ENUM, @@ -293,7 +294,7 @@ long dbScanPassive(struct dbCommon *pfrom, struct dbCommon *pto) } /*KLUDGE: Following needed so that dbPutLink to PROC field works correctly*/ -static long dbScanLink(struct dbCommon *pfrom, struct dbCommon *pto) +long dbScanLink(struct dbCommon *pfrom, struct dbCommon *pto) { long status; @@ -563,7 +564,6 @@ long dbNameToAddr(char *pname,struct dbAddr *paddr) * efficient. */ -extern struct dbBase *pdbBase; /* * Get value through fast input link. @@ -597,7 +597,7 @@ long dbFastLinkGet( if (pdb_link->process_passive) { status = dbScanPassive(precord, pdb_addr->precord); - if (!RTN_SUCCESS(status)) { + if (status) { precord->pact = pact; return(status); } @@ -651,18 +651,18 @@ long dbFastLinkPut( } else { struct db_link *pdb_link = &(plink->value.db_link); - struct dbAddr *pdb_addr = (struct dbAddr *) (pdb_link->pdbAddr); - struct dbCommon *pr_record = (struct dbCommon *) pdb_addr->precord; - struct fldDes *p_fldDes = (struct fldDes *) (pdb_addr->pfldDes); - long special = pdb_addr->special; - unsigned short acks = pr_record->acks; + struct dbAddr *paddr = (struct dbAddr *) (pdb_link->pdbAddr); + struct dbCommon *pdest = (struct dbCommon *) paddr->precord; + struct fldDes *p_fldDes = (struct fldDes *) (paddr->pfldDes); + long special = paddr->special; + unsigned short acks = pdest->acks; long *pfield_name; long int (*pspecial)() = NULL; struct rset *prset; static char val[4] = {'V','A','L',' '}; long *pval = (long *) &val[0]; - prset = GET_PRSET(pdbBase->precSup, pdb_addr->record_type); + prset = GET_PRSET(pdbBase->precSup, paddr->record_type); if (special) { if (special < 100) { @@ -672,20 +672,20 @@ long dbFastLinkPut( } else { if (special == SPC_SCAN) { - scanDelete(pr_record); + scanDelete(pdest); } } } else { if (prset && (pspecial = (prset->special))) { - status = (*pspecial)(pdb_addr, 0); - if (!RTN_SUCCESS(status)) { + status = (*pspecial)(paddr, 0); + if (status) { pl_record->pact = pact; return(status); } } else { - recGblRecSupError(S_db_noSupport, pdb_addr, "dbPut", "special"); + recGblRecSupError(S_db_noSupport, paddr, "dbPut", "special"); pl_record->pact = pact; return(S_db_noSupport); } @@ -695,9 +695,9 @@ long dbFastLinkPut( /* * Call conversion routine */ - status = (*(pdb_link->conversion))(psource, pdb_addr->pfield, pdb_addr); + status = (*(pdb_link->conversion))(psource, paddr->pfield, paddr); - if (!RTN_SUCCESS(status)) { + if (status) { pl_record->pact = pact; return(status); } @@ -708,32 +708,32 @@ long dbFastLinkPut( if (special) { if (special < 100) { /*global processing*/ if (special == SPC_SCAN) { - scanAdd(pr_record); + scanAdd(pdest); } else if (special == SPC_ALARMACK) { - if (pdb_addr->pfield == (void *) &pr_record->acks) { - if (acks > 0 && acks <= pr_record->acks) { - pr_record->acks = 0; - db_post_events(pr_record, &pr_record->acks, DBE_VALUE); + if (paddr->pfield == (void *) &pdest->acks) { + if (acks > 0 && acks <= pdest->acks) { + pdest->acks = 0; + db_post_events(pdest, &pdest->acks, DBE_VALUE); } else { /* Undo change */ - pr_record->acks = acks; + pdest->acks = acks; } } - else if (pdb_addr->pfield == (void *) &pr_record->ackt) { - if (!pr_record->ackt && pr_record->acks > pr_record->sevr) { - pr_record->acks = pr_record->sevr; - db_post_events(pr_record, &pr_record->acks, DBE_VALUE); + else if (paddr->pfield == (void *) &pdest->ackt) { + if (!pdest->ackt && pdest->acks > pdest->sevr) { + pdest->acks = pdest->sevr; + db_post_events(pdest, &pdest->acks, DBE_VALUE); } } } else if (special == SPC_AS) { - asChangeGroup(&pr_record->asp, pr_record->asg); + asChangeGroup(&pdest->asp, pdest->asg); } } else { - status = (*pspecial)(pdb_addr, 1); - if (!RTN_SUCCESS(status)) { + status = (*pspecial)(paddr, 1); + if (status) { pl_record->pact = pact; return(status); } @@ -746,42 +746,39 @@ long dbFastLinkPut( * don't propagate. */ - p_fldDes = (struct fldDes *) (pdb_addr->pfldDes); + p_fldDes = (struct fldDes *) (paddr->pfldDes); pfield_name = (long *) &(p_fldDes->fldname[0]); /* if field is val set udf FALSE */ if (*pval == *pfield_name) - pr_record->udf = FALSE; + pdest->udf = FALSE; - if (pr_record->mlis.count && + if (pdest->mlis.count && ((*pval != *pfield_name) || (!p_fldDes->process_passive))) { - db_post_events(pr_record, pdb_addr->pfield, DBE_VALUE); + db_post_events(pdest, paddr->pfield, DBE_VALUE); } - if (status) - recGblRecordError(status, (void *) pl_record, "Put Link"); - if (pdb_link->maximize_sevr) { - recGblSetSevr(pr_record, LINK_ALARM, pl_record->sevr); + recGblSetSevr(pdest, LINK_ALARM, pl_record->sevr); } - if (!RTN_SUCCESS(status)) { + if (status) { pl_record->pact = pact; return(status); } - if ((paddr->pfield == (void *) &pr_record->proc) || - (pdb_link->process_passive && pr_record->scan == 0)) { + if ((paddr->pfield == (void *) &pdest->proc) || + (pdb_link->process_passive && pdest->scan == 0)) { /* * Note: If ppn then dbNotifyCancel will handle reprocessing * if dbPutField caused asyn record to process ask for reprocessing */ - if (!psource->ppn && pdest->putf) + if (!pl_record->ppn && pdest->putf) pdest->rpro = TRUE; /* otherwise ask for the record to be processed*/ - else status = dbScanLink(pl_record, pr_record); + else status = dbScanLink(pl_record, pdest); } if (status) diff --git a/src/db/dbCaDblink.c b/src/db/dbCaDblink.c index 0577f08f8..fcfb5fbaa 100644 --- a/src/db/dbCaDblink.c +++ b/src/db/dbCaDblink.c @@ -1,6 +1,5 @@ /* dbCaDblink.c */ /* base/src/db $Id$ */ - /**************************************************************** * * Author: Nicholas T. Karonis diff --git a/src/db/dbCaLink.c b/src/db/dbCaLink.c index a1d775254..6399c155a 100644 --- a/src/db/dbCaLink.c +++ b/src/db/dbCaLink.c @@ -1,5 +1,5 @@ /* dbCaLink.c */ -/* base/src/db $Id$ */ +/* share/src/db @(#)dbCaLink.c 1.8 2/3/94 */ /**************************************************************** * diff --git a/src/db/dbEvent.c b/src/db/dbEvent.c index e02cf7e06..f26602e76 100644 --- a/src/db/dbEvent.c +++ b/src/db/dbEvent.c @@ -1,6 +1,5 @@ /* db_event.c */ /* share/src/db $Id$ */ - /* routines for scheduling events to lower priority tasks via the RT kernel */ /* * Author: Jeffrey O. Hill diff --git a/src/db/dbFastLinkConv.c b/src/db/dbFastLinkConv.c index 8c18bcc32..dfa73135e 100644 --- a/src/db/dbFastLinkConv.c +++ b/src/db/dbFastLinkConv.c @@ -824,7 +824,7 @@ static long cvt_f_st( else status = S_db_precision; - if (!RTN_SUCCESS(status)) { + if (status) { recGblRecSupError(status, paddr, "dbGetField", "get_precision"); return(status); } @@ -914,7 +914,7 @@ static long cvt_d_st( else status = S_db_precision; - if (!RTN_SUCCESS(status)) { + if (status) { recGblRecSupError(status, paddr, "dbGetField", "get_precision"); return(status); } diff --git a/src/db/dbLink.c b/src/db/dbLink.c index b43dea59d..dedcc6f5e 100644 --- a/src/db/dbLink.c +++ b/src/db/dbLink.c @@ -1776,7 +1776,7 @@ long offset; status = (*prset->get_precision)(paddr,&precision); else status=S_db_precision; - if(!RTN_SUCCESS(status)) { + if(status) { recGblRecSupError(status,paddr,"dbGet","get_precision"); return(status); } @@ -2016,7 +2016,7 @@ long offset; status = (*prset->get_precision)(paddr,&precision); else status=S_db_precision; - if(!RTN_SUCCESS(status)) { + if(status) { recGblRecSupError(status,paddr,"dbGet","get_precision"); return(status); } @@ -4643,7 +4643,7 @@ long offset; status = (*prset->get_precision)(paddr,&precision); else status=S_db_precision; - if(!RTN_SUCCESS(status)) { + if(status) { recGblRecSupError(status,paddr,"dbPutField","get_precision"); return(status); } @@ -4884,7 +4884,7 @@ long offset; status = (*prset->get_precision)(paddr,&precision); else status=S_db_precision; - if(!RTN_SUCCESS(status)) { + if(status) { recGblRecSupError(status,paddr,"dbPutField","get_precision"); return(status); } @@ -5434,7 +5434,7 @@ long dbPut( else { if( prset && (pspecial = (prset->special))) { status=(*pspecial)(paddr,0); - if(!RTN_SUCCESS(status)) return(status); + if(status) return(status); } else { recGblRecSupError(S_db_noSupport,paddr,"dbPut", "special"); @@ -5458,7 +5458,7 @@ long dbPut( status= (*prset->put_array_info)(paddr,nRequest); } - if(!RTN_SUCCESS(status)) return(status); + if(status) return(status); /* check for special processing is required */ if(special) { @@ -5485,7 +5485,7 @@ long dbPut( } else { status=(*pspecial)(paddr,1); - if(!RTN_SUCCESS(status)) return(status); + if(status) return(status); } } diff --git a/src/db/dbScan.c b/src/db/dbScan.c index 5f86abe71..ebc1afa51 100644 --- a/src/db/dbScan.c +++ b/src/db/dbScan.c @@ -1,6 +1,5 @@ /* dbScan.c */ /* base/src/db $Id$ */ - /* tasks and subroutines to scan the database */ /* * Original Author: Bob Dalesio diff --git a/src/db/dbStaticLib.c b/src/db/dbStaticLib.c index a4b8372a0..333ab9837 100644 --- a/src/db/dbStaticLib.c +++ b/src/db/dbStaticLib.c @@ -1,5 +1,5 @@ /*dbStaticLib.c*/ -/* base/src/db $Id$ */ +/* share/src/db @(#)dbStaticLib.c 1.21 7/11/94 */ /* * * Authors: Marty Kraimer @@ -53,8 +53,11 @@ #include #include #include +#include #define messagesize 100 +#define RPCL_LEN 184 +long postfix(char *pinfix, char *ppostfix,short *perror); static char *ppstring[2]={"NPP","PP"}; static char *msstring[2]={"NMS","MS"}; @@ -1455,6 +1458,13 @@ char *pstring; switch (pflddes->field_type) { case DBF_STRING: strncpy((char *)pfield, pstring,pflddes->size); + if(pflddes->special == SPC_CALC) { + char rpcl[RPCL_LEN]; + short error_number; + + status = postfix(pstring,rpcl,&error_number); + if(status) status = S_dbLib_badField; + } break; case DBF_CHAR : case DBF_SHORT : @@ -1858,6 +1868,17 @@ char *pstring; sprintf(message,"string to big. max=%hd",pflddes->size); return(message); } + if(pflddes->special == SPC_CALC) { + char rpcl[RPCL_LEN]; + short error_number; + long status; + + status = postfix(pstring,rpcl,&error_number); + if(status) { + sprintf(message,"Illegal Calculation String"); + return(message); + } + } } return(NULL); case DBF_CHAR : diff --git a/src/db/dbTest.c b/src/db/dbTest.c index 725e2486f..0b350dc2b 100644 --- a/src/db/dbTest.c +++ b/src/db/dbTest.c @@ -453,7 +453,7 @@ long dbtr(char *pname) return(1); } status=dbProcess(precord); - if(!(RTN_SUCCESS(status))) + if(status) recGblRecordError(status,precord,"dbtr(dbProcess)"); dbpr(pname,3); return(0); @@ -1593,13 +1593,15 @@ static void dbprReportLink( break; case DB_LINK: if(field_type != DBF_FWDLINK) { - sprintf(pmsg,"%4s: DB_LINK pp=%1d ms=%1d %.32s", + struct dbAddr *paddr = (struct dbAddr *)plink->value.db_link.pdbAddr; + struct fldDes *pfldDes = (struct fldDes *)paddr->pfldDes; + + sprintf(pmsg,"%4s: DB_LINK pp=%1d ms=%1d %.32s.%.4s", pfield_name, plink->value.db_link.process_passive, plink->value.db_link.maximize_sevr, - ((struct dbCommon *)( - ((struct dbAddr *)plink->value.db_link.pdbAddr) - ->precord))->name); + paddr->precord->name, + pfldDes->fldname); }else{ sprintf(pmsg,"%4s: DB_LINK %.32s", pfield_name, diff --git a/src/db/db_access.c b/src/db/db_access.c index 435e8cfef..94d5a87a3 100644 --- a/src/db/db_access.c +++ b/src/db/db_access.c @@ -492,7 +492,7 @@ register struct db_addr *pdb_addr; long status; status=dbProcess((void *)pdb_addr->precord); - if(!RTN_SUCCESS(status)) errMessage(status,"db_process failed"); + if(status) errMessage(status,"db_process failed"); return; } @@ -567,7 +567,7 @@ short db_name_to_addr(pname,paddr) short ftype; status=dbNameToAddr(pname,paddr); - if(RTN_SUCCESS(status)) { + if(!status) { ftype = paddr->dbr_field_type; if(INVALID_DB_REQ(ftype)) { recGblDbaddrError(S_db_badDbrtype,paddr,"db_name_to_addr error"); @@ -1366,7 +1366,7 @@ void *pfl; default: return(-1); } - if(!RTN_SUCCESS(status)) return(-1); + if(status) return(-1); return(0); } @@ -1525,7 +1525,7 @@ char *psrc; /* where to get it from */ default: return(-1); } - if(!RTN_SUCCESS(status)) return(-1); + if(status) return(-1); return(0); } diff --git a/src/db/db_test.c b/src/db/db_test.c index af9807bf4..564df1012 100644 --- a/src/db/db_test.c +++ b/src/db/db_test.c @@ -1,4 +1,4 @@ -/* base/src/db $Id$ */ +/* share/src/db @(#)db_test.c 1.10 2/3/94 */ /* database access subroutines */ /* * Author: Bob Dalesio diff --git a/src/db/dbl.c b/src/db/dbl.c index 5de7edef8..5d5778cd8 100644 --- a/src/db/dbl.c +++ b/src/db/dbl.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include diff --git a/src/db/dbls.c b/src/db/dbls.c index affc5fc3b..ea97358f2 100644 --- a/src/db/dbls.c +++ b/src/db/dbls.c @@ -1,5 +1,5 @@ /* dbls.c - structure listing program */ -/* share/src/db $Id$ */ +/* share/src/db @(#)dbls.c 1.21 2/17/94 */ /* * Author: Bob Zieman diff --git a/src/db/dbta.c b/src/db/dbta.c index c5be157dc..817495279 100644 --- a/src/db/dbta.c +++ b/src/db/dbta.c @@ -1,5 +1,5 @@ /*dbta.c*/ -/* base/src/db $Id$ */ +/* share/src/db @(#)dbta.c 1.7 2/25/94 */ /* * * Author: Marty Kraimer diff --git a/src/db/devLib.c b/src/db/devLib.c index 4494ac566..bafd0679f 100644 --- a/src/db/devLib.c +++ b/src/db/devLib.c @@ -1,5 +1,5 @@ /* devLib.c - support for allocation of common device resources */ -/* base/src/db $Id$ */ +/* @(#)devLib.c 1.2 3/30/94 */ /* * Original Author: Marty Kraimer @@ -50,7 +50,7 @@ * .01 06-14-93 joh needs devAllocInterruptVector() routine */ -static char *sccsID = "$Id$\t$Date$"; +static char *sccsID = "@(#)devLib.c 1.2\t3/30/94"; #include diff --git a/src/db/initHooks.c b/src/db/initHooks.c index cd64163f4..081589994 100644 --- a/src/db/initHooks.c +++ b/src/db/initHooks.c @@ -1,5 +1,5 @@ /* initHooks.c ioc initialization hooks */ -/* base/src/db $Id$ */ +/* share/src/db @(#)initHooks.c 1.5 7/11/94 */ /* * Author: Marty Kraimer * Date: 06-01-91 @@ -38,7 +38,6 @@ #include #include -extern void setMasterTimeToSelf(); /* * INITHOOKS @@ -57,9 +56,6 @@ int callNumber; case INITHOOKatBeginning : break; case INITHOOKafterSetEnvParams : - /* Note: EPICS_IOCMCLK_INET enabled in the resource.def file*/ - /* will override this call to setMasterTimeToSelf */ - setMasterTimeToSelf(); break; case INITHOOKafterGetResources : break; diff --git a/src/db/iocInit.c b/src/db/iocInit.c index 12f453132..86f381995 100644 --- a/src/db/iocInit.c +++ b/src/db/iocInit.c @@ -69,7 +69,6 @@ #include #include #include /* for sysSymTbl*/ -#include /* for N_TEXT */ #include #include @@ -157,14 +156,6 @@ int iocInit(char * pResourceFilename) strcat(name, "initHooks"); rtnval = symFindByName(sysSymTbl, name, (void *) &pinitHooks, &type); - /* - * Check to see if initHooks defined, and make sure it is a TEXT symbol (code) - * rather than any other kind of vxWorks symbol type. - */ - if (rtnval == OK && !((type & N_TEXT) != 0)) { - logMsg("iocInit - WARNING symbol initHooks has wrong type - skipping all init hooks\n",0,0,0,0,0,0); - pinitHooks=NULL; - } /* Call the user-defined initialization hook before anything else is done */ if (pinitHooks) (*pinitHooks)(INITHOOKatBeginning); @@ -369,8 +360,7 @@ static long initDrvSup(void) /* Locate all driver support entry tables */ vxstatus = symFindByName(sysSymTbl, name, (void *) &(pdrvSup->papDrvet[i]), &type); - /* Make sure it is program text */ - if (vxstatus != OK || (type & N_TEXT == 0)) { + if (vxstatus != OK) { strcpy(message,"driver entry table not found for "); strcat(message,pname); status = S_drv_noDrvet; @@ -460,7 +450,7 @@ static long initRecSup(void) vxstatus = symFindByName(sysSymTbl, name, (void *) (&precSup->papRset[i]), &type); - if (vxstatus != OK || ((type & N_TEXT) == 0)) { + if (vxstatus != OK) { strcpy(message,"record support entry table not found for "); strcat(message,name); status = S_rec_noRSET; @@ -532,7 +522,7 @@ static long initDevSup(void) vxstatus = (long) symFindByName(sysSymTbl, name, (void *) &(pdevSup->papDset[j]), &type); - if (vxstatus != OK || ((type & N_TEXT) == 0)) { + if (vxstatus != OK) { pdevSup->papDset[j]=NULL; strcpy(message, "device support entry table not found for "); strcat(message, pname); @@ -803,8 +793,8 @@ static long initDatabase(void) strncat(message,pfldDes->fldname,FLDNAME_SZ); strcat(message,": link process variable ="); strcat(message,name); - strcat(message," not found"); - status = S_db_notFound; + strcat(message," PP and/or MS illegal"); + status = S_db_badField; errMessage(status,message); if(rtnval==OK) rtnval=status; } @@ -1122,7 +1112,7 @@ static long getResources(char *fname) strcpy(name, "_"); strcat(name, s1); rtnval = symFindByName(sysSymTbl, name, &pSymAddr, &type); - if (rtnval != OK || (type & N_TEXT == 0)) { + if (rtnval != OK) { sprintf(message, "getResources: Symbol name not found - line=%d", lineNum); errMessage(-1L, message); diff --git a/src/db/recGbl.c b/src/db/recGbl.c index 7339c299e..07d90f597 100644 --- a/src/db/recGbl.c +++ b/src/db/recGbl.c @@ -242,12 +242,12 @@ long recGblGetLinkValue(struct link *plink,void *pdbc,short dbrType, case(DB_LINK): status=dbGetLink(&(plink->value.db_link), precord,dbrType,pdest,poptions,pnRequest); - if(!RTN_SUCCESS(status)) + if(status) recGblSetSevr(precord,LINK_ALARM,INVALID_ALARM); break; case(CA_LINK): status=dbCaGetLink(plink); - if(!RTN_SUCCESS(status)) + if(status) recGblSetSevr(precord,LINK_ALARM,INVALID_ALARM); break; default: @@ -274,12 +274,12 @@ long recGblPutLinkValue(struct link *plink,void *pdbc,short dbrType, case(DB_LINK): status=dbPutLink(&(plink->value.db_link), precord,dbrType,psource,*pnRequest); - if(!RTN_SUCCESS(status)) + if(status) recGblSetSevr(precord,LINK_ALARM,INVALID_ALARM); break; case(CA_LINK): status = dbCaPutLink(plink, &options, pnRequest); - if(!RTN_SUCCESS(status)) + if(status) recGblSetSevr(precord,LINK_ALARM,INVALID_ALARM); break; default: diff --git a/src/db/taskwd.c b/src/db/taskwd.c index 757408672..a663296c5 100644 --- a/src/db/taskwd.c +++ b/src/db/taskwd.c @@ -1,6 +1,5 @@ /* taskwd.c */ -/* base/src/db $Id$ */ - +/* share/src/db @(#)taskwd.c 1.7 7/11/94 */ /* tasks and subroutines for a general purpose task watchdog */ /* * Original Author: Marty Kraimer diff --git a/src/vxWorks/db/devLib.c b/src/vxWorks/db/devLib.c index 4494ac566..bafd0679f 100644 --- a/src/vxWorks/db/devLib.c +++ b/src/vxWorks/db/devLib.c @@ -1,5 +1,5 @@ /* devLib.c - support for allocation of common device resources */ -/* base/src/db $Id$ */ +/* @(#)devLib.c 1.2 3/30/94 */ /* * Original Author: Marty Kraimer @@ -50,7 +50,7 @@ * .01 06-14-93 joh needs devAllocInterruptVector() routine */ -static char *sccsID = "$Id$\t$Date$"; +static char *sccsID = "@(#)devLib.c 1.2\t3/30/94"; #include