ADDSEV(3C-SysV) RISC/os Reference Manual ADDSEV(3C-SysV)
NAME
addsev - define additional severities
SYNOPSIS
int addsev(int int_val, const char *string);
DESCRIPTION
The function addsev() defines additional severities for use
in subsequent calls to pfmt() or lfmt(). addsev() associ-
ates an integer value int_val in the range [5-255] with a
character string. It overwrites any previous string associ-
ation with int_val and string.
If int_val is OR-ed with the flags passed to subsequent
calls pfmt() or lfmt(), string will be used as severity.
Passing a NULL string removes the severity.
Add-on severities are only effective within the applications
defining them.
RETURN VALUE
addsev() returns 0 in case of success, -1 otherwise.
USAGE
Only the standard severities are automatically displayed per
the locale in effect at runtime. An application must pro-
vide the means for displaying locale-specific versions of
add-on severities.
EXAMPLE
#define Panic 5
setlabel("APPL");
setcat("my_appl");
addsev(Panic, gettxt(":26", "PANIC"));
/* ... */
lfmt(stderr, MM_SOFT|MM_APPL| Panic, ":12:Cannot locate database\n");
will display the message to stderr and forward to the log-
ging service:
APPL: PANIC: Cannot locate database
SEE ALSO
gettxt(3C-SVR4), lfmt(3C-SVR4), pfmt(3C-SVR4).
Printed 11/19/92 Page 1