As part of my rewrite of MERS, I'm probably going to make a couple of
other changes to the C interface (this won't affect fortran).
1. Change emsSetc (and by extension msgSetc) so that a NULL pointer
argument will result in something like "(Null)" and not " ". A NULL
pointer is not the same as an empty string (in Fortran there is no
difference) and information is lost if it is treated as such. This is
consistent with printf() behaviour.
2. Add a new variant of msgOut/errRep/emsRep/msgOutif that will act
like sprintf(). This will make simple error reporting in C easier
since there will be no need for the msgSetx call(s) beforehand.
Something like
emsRepf( int *status, const char * err, const char * format, ... );
similarly for msgOutf(), errRepf() and msgOutiff() [the name is
hopefully fine, although those two "ff"s are annoying.
The DRAMA system already made this change, simplifying Ers
considerably relative to EMS since there is no need to support tokens.
Of course, Ers does not need to support fortran.
--
Tim Jenness
Joint Astronomy Centre
|