2 Interface Definition Files

 2.1 The Basic IFD
 2.2 Conditional Sections
 2.3 Creating IFDs from Interface files

2.1 The Basic IFD

Suppose a Starlink application package, PKG, contains two monoliths, pkg_exe1, containing actions act1 and act2, and pkg_exe2, containing actions act3 and act4. The IFD would have the basic form:

      package pkg {
      #  Comments
         executable pkg_exe1 {
            action act1 {
               parameter act1par1 {
                 ...
               }
               parameter act1par2 {
                 ...
               }
               ...
            }
            action act2 {
               parameter act2par1 {
                 ...
               }
               ...
            }
            ...
         }
         executable pkg_exe2 {
            action act3 {
               parameter act3par1 {
                 ...
               }
               ...
            }
            action act4 {
               parameter act4par1 {
                 ...
               }
               ...
            }
         }
      }

where ‘...’ represents omitted lines.

This is interpreted by Tcl with the keywords ‘package’, ‘executable’, ‘action’, etc. treated as procedures which are defined appropriately depending upon the software environment for which files are being produced. There are currently three scripts which make these definitions and produce environment-specific files:

ifd2star
Produces files required by the Starlink environment.
ifd2iraf
Produces files required by the IRAF environment.
ifd2irafifl
Produces Starlink interface files for use when running Starlink applications from IRAF.

The following points should be noted:

A ‘full’ IFD will normally contain additional keywords to define absolutely everything required in producing the environment-specific files.

2.2 Conditional Sections

The IFD may contain sections to be included or excluded depending upon the environment for which it is being processed.

environment: { code }
environment! { code }

The separator ‘:’ causes the code to be processed, and ‘!’ causes the code to be ignored only if the environment is environment. In both cases, environment can be a comma-separated list of environment names and the code may consist of multiple lines.

The term ‘environment’ is used loosely here – the environment is set to:

star
when ifd2star is running.
iraf
when ifd2iraf is running.
irafifl
when ifd2irafifl is running.

For example with,

star: { code }

code will only be processed by ifd2star, and with

star,iraf! { code }

code will not be processed by either ifd2star or ifd2iraf.

2.3 Creating IFDs from Interface files

For existing packages a basic IFD can be produced by running the ifl2ifd script on the .ifl file(s) of the package.

  % ifl2ifd kappa_mon

Will produce IFD kappa_mon.ifd from interface file kappa_mon.ifl.

Where the package consists of several monoliths, the resulting IFDs must be combined to produce a single IFD.

This basic IFD will define all the package applications which are in the monoliths. However:

(1)
Some action definitions may not be required for all environments – the conditional inclusion syntax (see Section 2.2) should be used for these.
(2)
Any aliases for the command names should be inserted. This includes the abbreviations allowed in ICL – IRAF has its own system for command abbreviation which does not require any additions to the IFD.
(3)
Some parameter definitions may need tweaking. In particular:
(4)
Commands which form part of the package but are not just simple invocations of the applications must be defined.
(5)
Any Comments or displays required in the package definition files must be defined.

More information on the changes required for IRAF is given in SSN/35.