1addsev(3C) Standard C Library Functions addsev(3C)
2
3
4
6 addsev - define additional severities
7
9 #include <pfmt.h>
10
11 int addsev(int int_val, const char *string);
12
13
15 The addsev() function defines additional severities for use in subse‐
16 quent calls to pfmt(3C) or lfmt(3C). It associates an integer value
17 int_val in the range [5-255] with a character string, overwriting any
18 previous string association between int_val and string.
19
20
21 If int_val is OR-ed with the flags argument passed to subsequent calls
22 to pfmt() or lfmt(), string will be used as severity. Passing a null
23 string removes the severity.
24
26 Upon successful completion, addsev() returns 0. Otherwise it
27 returns−1.
28
30 Only the standard severities are automatically displayed for the locale
31 in effect at runtime. An application must provide the means for dis‐
32 playing locale-specific versions of add-on severities. Add-on severi‐
33 ties are only effective within the applications defining them.
34
36 Example 1 Example of addsev() function.
37
38
39 The following example
40
41
42 #define Panic 5
43 setlabel("APPL");
44 setcat("my_appl");
45 addsev(Panic, gettxt(":26", "PANIC"));
46 /* ... */
47 lfmt(stderr, MM_SOFT|MM_APPL|PANIC, ":12:Cannot locate database\n");
48
49
50
51 will display the message to stderr and forward to the logging service
52
53
54 APPL: PANIC: Cannot locate database
55
56
58 See attributes(5) for descriptions of the following attributes:
59
60
61
62
63 ┌─────────────────────────────┬─────────────────────────────┐
64 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
65 ├─────────────────────────────┼─────────────────────────────┤
66 │MT-Level │MT-safe │
67 └─────────────────────────────┴─────────────────────────────┘
68
70 gettxt(3C), lfmt(3C), pfmt(3C), attributes(5)
71
72
73
74SunOS 5.11 29 Dec 1996 addsev(3C)