Experimental Physics and
| |||||||||||||||||
|
On Friday 08 June 2007 18:19, Carl Lionberger wrote:Here's a perl script 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
| ||||||||||||||||
ANJ, 10 Nov 2011 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |