First merge of db directory to get Build to work...

This commit is contained in:
Matt Needes
1994-07-15 16:44:23 +00:00
parent 583f8e610c
commit b04bf8531c
22 changed files with 102 additions and 101 deletions

View File

@@ -1,5 +1,5 @@
/*atodb.c*/
/* base/src/db $Id$ */
/* share/src/db @(#)atdb.c 1.7 2/25/94 */
/*
*
* Author: Marty Kraimer

View File

@@ -1,5 +1,5 @@
/* callback.c */
/* base/src/db $Id$ */
/* share/src/db @(#)callback.c 1.7 9/14/93 */
/* general purpose callback tasks */
/*

View File

@@ -96,6 +96,7 @@
#include <special.h>
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)

View File

@@ -1,6 +1,5 @@
/* dbCaDblink.c */
/* base/src/db $Id$ */
/****************************************************************
*
* Author: Nicholas T. Karonis

View File

@@ -1,5 +1,5 @@
/* dbCaLink.c */
/* base/src/db $Id$ */
/* share/src/db @(#)dbCaLink.c 1.8 2/3/94 */
/****************************************************************
*

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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);
}
}

View File

@@ -1,6 +1,5 @@
/* dbScan.c */
/* base/src/db $Id$ */
/* tasks and subroutines to scan the database */
/*
* Original Author: Bob Dalesio

View File

@@ -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 <drvSup.h>
#include <cvtTable.h>
#include <choice.h>
#include <special.h>
#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 :

View File

@@ -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,

View File

@@ -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);
}

View File

@@ -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

View File

@@ -35,7 +35,6 @@
#include <string.h>
#include <math.h>
#include <limits.h>
#include <fcntl.h>
#include <cvtFast.h>
#include <dbStaticLib.h>

View File

@@ -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

View File

@@ -1,5 +1,5 @@
/*dbta.c*/
/* base/src/db $Id$ */
/* share/src/db @(#)dbta.c 1.7 2/25/94 */
/*
*
* Author: Marty Kraimer

View File

@@ -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 <vxWorks.h>

View File

@@ -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 <vxWorks.h>
#include <initHooks.h>
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;

View File

@@ -69,7 +69,6 @@
#include <sysLib.h>
#include <symLib.h>
#include <sysSymTbl.h> /* for sysSymTbl*/
#include <a_out.h> /* for N_TEXT */
#include <logLib.h>
#include <taskLib.h>
@@ -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);

View File

@@ -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:

View File

@@ -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

View File

@@ -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 <vxWorks.h>