From 51cf4d76b29c4239e32141af60511fa12426c7f6 Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Wed, 16 Sep 1992 16:24:47 +0000 Subject: [PATCH] added stments for unix version --- src/db/dbls.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/src/db/dbls.c b/src/db/dbls.c index 9ac1a4df0..20beebedf 100644 --- a/src/db/dbls.c +++ b/src/db/dbls.c @@ -33,21 +33,40 @@ * .03 05-19-92 mrk Mods for internal database structure changes * .04 07-16-92 jba changes made to remove compile warning msgs * .05 08-05-92 jba Removed all references to dbr_field_type + * .06 09-15-92 jba added stments for unix version */ #define SAME 0 + +#ifndef vxWorks +#include +#include +#include +#include +#include +#else #include #include #include #include +#endif + +#ifndef FOREVER +#define FOREVER for(;;) +#endif + #include #include #include #include #include +#if 1 #include +#endif + +#include #include #include #include @@ -55,7 +74,17 @@ #include #include +#ifndef vxWorks +struct dbBase *pdbBase=NULL; +extern long dbLoad(); +#ifndef MYERRNO +#define MYERRNO (int errno) +#endif + +#else + extern struct dbBase *pdbBase; +#endif /* forward references */ void DbRecType(); @@ -128,6 +157,26 @@ static struct PRTAB { "FFFF", NULL } }; + + +#ifndef vxWorks +main() +{ +/* load the default.dctsdr file */ + long status; + + status=dbRead(&pdbBase, "default.dctsdr"); + if(status!=0) { + printf("dbls aborting because dbRead failed\n"); + return(-1); + } + dbls(); +return(0); +} +#endif + + + /* * LISTSTRUCTURES * @@ -145,7 +194,11 @@ int dbls() char fname[80]; long status; struct recType *precType; - + if (!pdbBase) { + status = S_sdr_notLoaded; + errMessage(status, "dbls: Error - database not loaded"); + return(-1); + } if (!(precType=pdbBase->precType)) { status = S_sdr_notLoaded; errMessage(status, "dbls: Error - precType not loaded");