EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  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: Automatically generate iocsh registrar code?
From: Andrew Johnson <[email protected]>
To: [email protected]
Cc: [email protected]
Date: Tue, 12 Jun 2007 10:13:48 -0500
Benjamin Franksen wrote:
On Friday 08 June 2007 18:19, Carl Lionberger wrote:
Here's a perl script

Susanna Jacobson wrote:
Does anyone have a script or program that will take a set of C
function declarations and generate the C code to register those
functions with the iocsh?

I have 18 functions to register, some with 4 or 5 arguments.

What about integrating this into the EPICS build system? Would be quite convenient and could reduce the likelyhood of errors, e.g. when the type of a registered routine changes.

I haven't tried Carl's script but it seems like an excellent way to do the boring task of generating the appropriate C code from the command functions, and is great for doing this in a one-off manner. However I do think that any final automated solution that goes into Base should not require us to include code that parses C declarations - it's much easier to generate a declaration than it is to reliably parse one.


I have wanted to incorporate something that generates the registration code into the DBD file syntax ever since we added iocsh, but haven't yet worked out what is the best way to do so - just adding the first thing that someone gets to work is unfortunately a recipe for future headaches in maintenance and upgrades, thus careful consideration is needed.

My current thoughts are that the DBD file might be used to generate a C header file which declares the command functions (similar to how we do record types in the current code-base). This header would then be included by the C file that defines those functions, thus the C compiler would do the work of ensuring that the routine implemented actually matches the command that will call it.

Note that the command information in the DBD file will also be useful for future versions of the IRMIS parser for st.cmd scripts, so it can use a device support's hardware configuration commands to map installed components to record addresses. I have been working on replacing the current DBD file parser infrastructure (dbStaticLib, written in C) with a Perl implementation in the R3.15 tree, which will be much easier to modify and extend to do things like this.

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

References:
Automatically generate iocsh registrar code? Susanna Jacobson
Re: Automatically generate iocsh registrar code? Carl Lionberger
Re: Automatically generate iocsh registrar code? Benjamin Franksen

Navigate by Date:
Prev: Re: Automatically generate iocsh registrar code? Benjamin Franksen
Next: RE: EPICS channels via the Internet Jeff Hill
Index: 1994  1995  1996  1997  1998  1999  2000  2001  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: Re: Automatically generate iocsh registrar code? Benjamin Franksen
Next: the first installing jca2.1.2 problem zhaozhuo
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Nov 2011 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·