2 .\" Copyright 1989 AT&T Copyright (c) 1998, 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 SETLABEL 3C "Dec 29, 1996"
8 setlabel \- define the label for \fBpfmt()\fR and \fBlfmt()\fR
14 \fBint\fR \fBsetlabel\fR(\fBconst char *\fR\fIlabel\fR);
20 The \fBsetlabel()\fR function defines the label for messages produced in
21 standard format by subsequent calls to \fBlfmt\fR(3C) and \fBpfmt\fR(3C).
24 The \fIlabel\fR argument is a character string no more than 25 characters in
28 No label is defined before \fBsetlabel()\fR is called. The label should be set
29 once at the beginning of a utility and remain constant. A null pointer or an
30 empty string passed as argument will reset the definition of the label.
34 Upon successful completion, \fBsetlabel()\fR returns \fB0\fR; otherwise, it
35 returns a non-zero value.
39 The following code (without previous call to \fBsetlabel()\fR):
43 pfmt(stderr, MM_ERROR, "test:2:Cannot open file\en");
45 pfmt(stderr, MM_ERROR, "test:2:Cannot open file\en");
51 will produce the following output:
55 ERROR: Cannot open file
56 UX:test: ERROR: Cannot open file
63 See \fBattributes\fR(5) for descriptions of the following attributes:
71 ATTRIBUTE TYPE ATTRIBUTE VALUE
79 \fBgetopt\fR(3C), \fBlfmt\fR(3C), \fBpfmt\fR(3C), \fBattributes\fR(5)