DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

addsev(S-osr5)


addsev -- define additional severities

Syntax

cc ...-lc

#include <pfmt.h>

int addsev(int int_val, const char *string);

Description

addsev(S-osr5) defines additional severities for use in subsequent calls to pfmt(S-osr5). Those add-on severities are effective only within the applications defining them.

addsev( ) associates an integer value int_val in the range 5 to 255 inclusive with a character string, string. It overwrites any previous association between int_val and string.

If int_val is ORed with the flags passed to subsequent calls to pfmt( ), string is used as the severity.

Passing a null string removes the severity.

Only the standard severities are automatically displayed for the locale in effect at run time. An application must provide the means for displaying locale-specific versions of add-on severities.

Return values

addsev( ) returns 0 in case of success, otherwise -1.

Diagnostics

This function does not set errno.

Examples

The example below displays the message to stderr and forwards it to the logging service:
   #define Panic     5
   setlabel("APPL");
   setcat("my_appl");
   addsev(Panic, gettxt(":26", "PANIC"));
   /* ... */

See also

gettxt(S-osr5), pfmt(S-osr5)

Standards conformance

addsev(S-osr5) is not part of any currently supported standard; it was developed by UNIX System Laboratories, Inc. and is maintained by The SCO Group.
© 2005 System Services (S-osr5)
SCO OpenServer Release 6.0.0 -- 02 June 2005