The Fortran interface to EMS makes use of the Starlink mixed language programming package, CNF (see SUN/209), which must be available for building EMS and programs which use its Fortran interface.
The correct operation of EMS_FACER
(and emsFacer
) also requires the necessary facility message files to
be installed (see ‘Operating system specific routines’ below).
EMS is coded in ANSI C, according to the Starlink C coding conventions described in SGP/4. However, the following routines have system-specific features and may need re-implementing for new platforms. They may also produce differing results on different platforms.
EMS_FACER
On UNIX this is implemented using the MESSGEN system (see SUN/185) and thus relies on the required Starlink facility message files having been entered into the system.
When EMS_FACER
is called to to obtain the message associated with a given STATUS
value,
it first works out the facility number from the STATUS
value. It then searches for a file with
the name fac_
facnum_err
(where facnum is the facility number). If environment variable
EMS_PATH
is defined, it is taken to be a directory search path for the file; if not, a directory
search path of ../help
relative to each of the directories on the user’s PATH
is used.
If the file cannot be found along the selected search path, or a message cannot be associated for any other reason, a ‘FACERR’ message is substituted giving as much information as possible. For example:
ident, error 147358667 (fac=200,messid=121)
where the given status value is 147358667 and 200 and 121 are the facility number and message number derived from it.
ident may be one of the following:
FACERR__BADARG
FACERR__NOFAC
FACERR__BADFIL
FACERR__NOMSG
EMS_FIOER
This will generally need to be rewritten for each new target platform. Current versions have the appropriate messages hardwired into the code.
EMS_SYSER
This may need to be rewritten for a new target platform. At the moment UNIX platforms use the
same code which accesses sys_errlist
.
emsErrno
On UNIX platforms this accesses sys_errlist
to obtain the message.