EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: calcoutRecord.h
From: Andrew Johnson <[email protected]>
To: Ralph Lange <[email protected]>
Cc: EPICS Core Talk <[email protected]>
Date: Mon, 12 Mar 2007 11:20:41 -0500
Ralph Lange wrote:

just found out (compiling streamDevice that includes a device support for the calcout) that the generated header file calcoutRecord.h uses definitions from postfix.h, but does not include it.
I know this is not illegal, but it's not very nice, too.

The postfix.h requirement is new in R3.14.9 - I did document it in the release notes, but I agree that it's not very nice.

As calcoutRecord.h gets generated from dbd - is there an easy way to add the #include directive or should we live with calcoutRecord.h being not nice?

There was supposed to be -- I added support ("Cdefs") for this kind of thing to dbStaticLib before R3.14.0alpha1 came out, but we've never used it in anger and unfortunately it doesn't work for this particular case. I suspect VDCT doesn't understand the Cdefs syntax either, so it may barf when it sees a Cdefs line. This is the DBD syntax:

Index: calcoutRecord.dbd
===================================================================
RCS file: /net/phoebus/epicsmgr/cvsroot/epics/base/src/rec/calcoutRecord.dbd,v
retrieving revision 1.5.2.2
diff -u -b -r1.5.2.2 calcoutRecord.dbd
--- calcoutRecord.dbd   3 Oct 2006 20:22:23 -0000       1.5.2.2
+++ calcoutRecord.dbd   12 Mar 2007 15:17:07 -0000
@@ -30,6 +30,7 @@
        choice(calcoutINAV_CON,"Constant")
 }
 recordtype(calcout) {
+       %#include "postfix.h"
        include "dbCommon.dbd"
        field(VERS,DBF_DOUBLE) {
                prompt("Code Version")

Any valid C code can follow a % sign (which must be inside a recordtype definition) and will be added to the generated *Record.h file. Unfortunately though the above "#include" statement gets added to the calcoutRecord.h file *below* the struct calcoutRecord definition, which is too late for postfix.h. I can fix that, but obviously not until the next release.

In fact looking at it, I can clean up the dbStaticLib code slightly using this technique - I can move all of the #include statements that get put into the Record.h files from the dbToRecordTypeH.c program into dbCommon.dbd, so this makes sense for the next release (but for now all calcout device support will have to do the #include "postfix.h" itself).

The original idea for Cdefs was to allow each recordtype to define its own DSET structure for the device supports to use, rather than each support defining its own. I eventually concluded though that we're too far gone to try and fix that particular design issue until we re-do the whole devSup interface.

- Andrew
--
The right to be heard does not automatically include
the right to be taken seriously. -- Hubert H. Humphrey

References:
calcoutRecord.h Ralph Lange

Navigate by Date:
Prev: calcoutRecord.h Ralph Lange
Next: Re: EPICS_TIMEZONE, TIMEZONE, vxWorks daylight saving Andrew Johnson
Index: 2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: calcoutRecord.h Ralph Lange
Next: Re: EPICS_TIMEZONE, TIMEZONE, vxWorks daylight saving Andrew Johnson
Index: 2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·