1
0
Files
irix-657m-src/eoe/man/man3c/setlabel.3c
2022-09-29 17:59:04 +03:00

68 lines
1.7 KiB
Plaintext

'\"macro stdmacro
.if n .pH g3c.setlabel @(#)setlabel 41.5 of 5/26/91
.\" Copyright 1991 UNIX System Laboratories, Inc.
.\" Copyright 1990 AT&T
.nr X
.if \nX=0 .ds x} setlabel 3C "" "\&"
.if \nX=1 .ds x} setlabel 3C ""
.if \nX=2 .ds x} setlabel 3C "" "\&"
.if \nX=3 .ds x} setlabel "" "" "\&"
.TH \*(x}
.SH NAME
\f4setlabel\fP \- define the label for \f4pfmt\f1 and \f4lfmt\f1.
.SH SYNOPSIS
.ft 4
.nf
#include <pfmt.h>
.sp
int setlabel(const char \(**\f2label\f4);
.ft 1
.fi
.SH DESCRIPTION
The routine \f4setlabel\f1 defines the label for messages produced in
standard format by subsequent calls to
\f4lfmt\f1,
\f4vlfmt\f1,
\f4pfmt\f1,
and \f4vpfmt\f1.
.P
\f2label\f1 is a character string no more than 25 characters in length.
.P
No label is defined before \f4setlabel\f1 is called.
A null pointer or an empty string passed as argument will reset the
definition of the label.
.SH EXAMPLE
The following code (without previous call to \f4setlabel\f1):
.PP
.ft CW
.nf
pfmt(stderr, MM_ERROR, "test:2:Cannot open file\\n");
setlabel("UX:test");
pfmt(stderr, MM_ERROR, "test:2:Cannot open file\\n");
.fi
.ft 1
.PP
will produce the following output:
.ft CW
.nf
ERROR: Cannot open file
UX:test: ERROR: Cannot open file
.ft 1
.fi
.SH "SEE ALSO"
.na
\f4getopt\fP(3C),
\f4lfmt\fP(3C),
\f4pfmt\fP(3C)
.ad
.SH DIAGNOSTICS
\f4setlabel\f1 returns 0 in case of success, non-zero otherwise.
.SH NOTES
The label should be set once at the beginning of a utility and remain constant.
.P
\f4getopt\f1(3C) has been modified to report errors using the standard message
format.
If \f4setlabel\f1 is called before \f4getopt\f1, \f4getopt\f1 will
use that label.
Otherwise, \f4getopt\f1 will use the name of the utility.