These routines implement the Unidata error-messaging mechanism and should be used by all Unidata-
conforming software.
uderrmode() sets the mode of the error-messaging package and returns the previous mode. The mode is the
bitwise or of zero or more of the following bit-set macro-constants. Setting a mode-bit enables the
action and vice versa.
UD_FATALuderror() and udadvise() will abort the program after printing any error message.
UD_VERBOSEuderror() and udadvise() will print all messages.
The default is UD_FATAL|UD_VERBOSE.
uderrname() sets the program name to be used in all messages and returns the previous name. It should be
called once at the beginning of each program using, for example, argv[0] for the argument. (the udres(3)
function udinit() does this for you).
uderror() prints a system error message on stderr if, and only if, the UD_VERBOSE mode-bit is set. This
routine is used in place of perror(3) and should be called when a system function returns an error
status. The error message will consist of the program name, the error message supplied as arguments to
uderror(), the system error message, and the system error number. The argument syntax is the same as for
printf(3). If the error-messaging package has the UD_FATAL mode-bit set, then this routine will abort
after printing the message.
"errno" is cleared before returning.
If "stderr" is not a "tty", then the error message will be prefixed by a time-stamp.
udadvise() prints on stderr an error message consisting of fmt and any other arguments if, and only if,
the UD_VERBOSE mode-bit is set. The syntax is the same as for printf(3). If the error-messaging package
has the UD_FATAL mode-bit set, then this routine will abort after printing the message.
If "stderr" is not a "tty", then the error message will be prefixed by a time-stamp.
udtime_stamp() returns a pointer to a static buffer containing a 0-terminated string of the current time
in the Unidata-standard format.