Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

fmtmsg(3) OSS Library Calls Reference Manual
Status Subclass Identifies whether or not the application will recover from the condition. It can
be one of MM_RECOVER (recoverable) or MM_NRECOV (nonrecoverable).
There is also the MM_NULLMC identifier, which indicates that there is no
classification component for the message.
label Points to a string that gives the source of the message. The format of this param-
eter is two fields separated by a colon. The first of these fields can be up to 10
bytes long, while the second can be up to 14 bytes long.
severity Is the seriousness of the condition. There are five possible identifiers
corresponding to the levels of severity:
MM_HALT Produces the string "HALT." The application is halting because
it encountered a severe fault.
MM_ERROR Produces the string "ERROR." The application has detected a
fault.
MM_WARNING
Produces the string "WARNING." The application encountered
an unusual condition that could be a potential problem and
should be watched.
MM_INFO Produces the string "INFO." The message displays information
about a nonerror condition.
MM_NOSEV There is no severity level for this message.
text Points to a string that describes the error condition that produced the message. If
text points to an empty string, it is undefined what text will be displayed.
action Points to a string containing the first step in the error-recovery process. When
displayed, this string is prefixed with "TO FIX:". The action string is not limited
to a specific size.
tag Points to an identifier that references online documentation for the message.
The fmtmsg( ) function uses the MSGVERB environment variable to determine which com-
ponents of the message to display when writing to standard error. The value of this environment
variable is a string of colon-separated keywords. Valid keywords are label, severity, text,
action, and tag. These keywords may appear in any order. If a given keyword appears in the
value of MSGVERB, the corresponding component is included in the message, unless that
component’s value is its null value. If a keyword does not appear, the corresponding component
is not included. If the value of MSGVERB is not defined, is a null string, contains an invalid
keyword, or is not in the correct format, all components are displayed.
EXAMPLES
The following example produces a complete message in the specified message format:
fmtmsg (MM_PRINT, "XSI:cat", MM_ERROR, "illegal option",
"refer to cat in user’s reference manual", "XSI:cat:001")
XSI:cat: ERROR: illegal option
TO FIX: refer to cat in user’s reference manual XSI:cat:001
298 Hewlett-Packard Company 527187-017