From 91500bfe8574bb22dd02c27550c946bab7887029 Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Thu, 24 Oct 1991 17:09:32 +0000 Subject: [PATCH] mrk changes --- src/db/dbTest.c | 39 +++++++++++++++++++++++++++------------ src/db/db_access.c | 2 +- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/db/dbTest.c b/src/db/dbTest.c index 44a452c65..772e4d72e 100644 --- a/src/db/dbTest.c +++ b/src/db/dbTest.c @@ -30,6 +30,7 @@ * Modification Log: * ----------------- * .01 08-13-91 mrk Added extra NULL arg to dbGetField calls + * .02 10-23-91 mrk Changed dbior so it also reports device support */ /* Global Database Test Routines - All can be invoked via vxWorks shell @@ -81,6 +82,7 @@ #include #include #include +#include #include #include #include @@ -549,10 +551,9 @@ long dbior(pdrvName,type) char *pdrvName; int type; { - int i; + int i,j; char *pname; struct drvet *pdrvet; - int printIt; if(!drvSup) { printf("No drivers\n"); @@ -560,25 +561,39 @@ long dbior(pdrvName,type) } for (i=0; inumber; i++) { if((pname=drvSup->drvetName[i])==NULL) continue; - if(pdrvName==NULL) - printIt=TRUE; - else { - printIt = (strcmp(pdrvName,pname)==0 ? TRUE : FALSE); - if(!printIt) continue; - } + if(pdrvName!=NULL && (strcmp(pdrvName,pname)!=0)) continue; if((pdrvet=drvSup->papDrvet[i])==NULL) { printf("No driver entry table is present for %s\n",pname); continue; } - if(pdrvet->report==NULL) { - if(printIt&&(pdrvName!=NULL)) printf("No report available\n"); - } + if(pdrvet->report==NULL) + printf("Driver: %s No report available\n",pname); else { printf("Driver: %s\n",pname); (*pdrvet->report)(stdout,type); } - if(pdrvName!=NULL) break; + } + /* now check devSup reports */ + if(!devSup) { + printf("No device support\n"); + return(0); + } + for (i=0; inumber; i++) { + struct devSup *pdevSup; + + if(!(pdevSup=GET_DEVSUP(i))) continue; + for(j=0; jnumber; j++) { + struct dset *pdset; + + if(!(pdset=GET_PDSET(pdevSup,j))) continue; + if((pname=pdevSup->dsetName[j])==NULL) continue; + if(pdrvName!=NULL && (strcmp(pdrvName,pname)!=0)) continue; + if(pdset->report!=NULL) { + printf("Device Support: %s\n",pname); + (*pdset->report)(stdout,type); + } } + } return(0); } diff --git a/src/db/db_access.c b/src/db/db_access.c index d021cb393..0ff6139a8 100644 --- a/src/db/db_access.c +++ b/src/db/db_access.c @@ -551,7 +551,7 @@ new_alarm(){ /* * DB_NAME_TO_ADDR */ -static short mapNewToOld[]={0,4,4,1,1,5,5,2,6,3}; +static short mapNewToOld[]={0,4,4,1,2,5,6,2,6,3}; db_name_to_addr(pname,paddr) char *pname;