The C interface provides variants to the standard msgOut and msgOutif functions that can handle sprintf() style format strings. This can lead to a significant reduction in the number of lines spent setting up tokens by embedding the formatting directly in the required string. The example from the previous section can simply be written as:
msgOutf( "EXAMPLE_RESULT",
"Emission flux is %5.2f %s", status, flux, funits );
msgOutf and msgOutiff act like printf() whereas msgOutifv is a variant of msgOutif that takes a va_list argument rather
than variadic ''
'' arguments. The ``%'' character is special
in this context and the ADAM
definition
is not available. A literal ``%''
is obtained by doubling up the symbol (``%%'') as would be used in
printf() and described in the next section.
MERS (MSG and ERR) Message and Error Reporting Systems