1502 Remove conversion cruft from manpages
[unleashed.git] / usr / src / man / man3c / addsev.3c
blobb5cdb16a68c79e876234685dea7775d05c4a1484
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH ADDSEV 3C "Dec 29, 1996"
7 .SH NAME
8 addsev \- define additional severities
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <pfmt.h>
14 \fBint\fR \fBaddsev\fR(\fBint\fR \fIint_val\fR, \fBconst char *\fR\fIstring\fR);
15 .fi
17 .SH DESCRIPTION
18 .sp
19 .LP
20 The \fBaddsev()\fR function defines additional severities for use in subsequent
21 calls to \fBpfmt\fR(3C) or \fBlfmt\fR(3C). It associates an integer value
22 \fIint_val\fR in the range [5-255] with a character \fIstring\fR, overwriting
23 any previous string association between \fIint_val\fR and \fIstring\fR.
24 .sp
25 .LP
26 If \fIint_val\fR is OR-ed with the \fIflags\fR argument passed to subsequent
27 calls to \fBpfmt()\fR or \fBlfmt()\fR, \fIstring\fR will be used as severity.
28 Passing a null \fIstring\fR removes the severity.
29 .SH RETURN VALUES
30 .sp
31 .LP
32 Upon successful completion, \fBaddsev()\fR returns \fB0\fR.  Otherwise it
33 returns\fB\(mi1\fR\&.
34 .SH USAGE
35 .sp
36 .LP
37 Only the standard severities are automatically displayed for the locale in
38 effect at runtime. An application must provide the means for displaying
39 locale-specific versions of add-on severities. Add-on severities are only
40 effective within the applications defining them.
41 .SH EXAMPLES
42 .LP
43 \fBExample 1 \fRExample of \fBaddsev()\fR function.
44 .sp
45 .LP
46 The following example
48 .sp
49 .in +2
50 .nf
51 #define Panic 5
52 setlabel("APPL");
53 setcat("my_appl");
54 addsev(Panic, gettxt(":26", "PANIC"));
55 /* .\|.\|. */
56 lfmt(stderr, MM_SOFT|MM_APPL|PANIC, ":12:Cannot locate database\en");
57 .fi
58 .in -2
60 .sp
61 .LP
62 will display the message to \fIstderr\fR and forward to the logging service
64 .sp
65 .in +2
66 .nf
67 APPL: PANIC: Cannot locate database
68 .fi
69 .in -2
71 .SH ATTRIBUTES
72 .sp
73 .LP
74 See \fBattributes\fR(5) for descriptions of the following attributes:
75 .sp
77 .sp
78 .TS
79 box;
80 c | c
81 l | l .
82 ATTRIBUTE TYPE  ATTRIBUTE VALUE
84 MT-Level        MT-safe
85 .TE
87 .SH SEE ALSO
88 .sp
89 .LP
90 \fBgettxt\fR(3C), \fBlfmt\fR(3C), \fBpfmt\fR(3C), \fBattributes\fR(5)