Visit The New, Modern Unix Linux Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #715
Difficulty: Easy
A stored-program computer is a computer that stores program instructions on external hard drives..
True or False?
Linux & Unix Commands - Search Man Pages

setlabel(3c) [opensolaris man page]

setlabel(3C)						   Standard C Library Functions 					      setlabel(3C)

NAME
setlabel - define the label for pfmt() and lfmt() SYNOPSIS
#include <pfmt..h> int setlabel(const char *label); DESCRIPTION
The setlabel() function defines the label for messages produced in standard format by subsequent calls to lfmt(3C) and pfmt(3C). The label argument is a character string no more than 25 characters in length. No label is defined before setlabel() is called. The label should be set once at the beginning of a utility and remain constant. A null pointer or an empty string passed as argument will reset the definition of the label. RETURN VALUE
Upon successful completion, setlabel() returns 0; otherwise, it returns a non-zero value. EXAMPLES
The following code (without previous call to setlabel()): pfmt(stderr, MM_ERROR, "test:2:Cannot open file "); setlabel("UX:test"); pfmt(stderr, MM_ERROR, "test:2:Cannot open file "); will produce the following output: ERROR: Cannot open file UX:test: ERROR: Cannot open file ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
getopt(3C), lfmt(3C), pfmt(3C), attributes(5) SunOS 5.11 29 Dec 1996 setlabel(3C)

Check Out this Related Man Page

addsev(3C)						   Standard C Library Functions 						addsev(3C)

NAME
addsev - define additional severities SYNOPSIS
#include <pfmt.h> int addsev(int int_val, const char *string); DESCRIPTION
The addsev() function defines additional severities for use in subsequent calls to pfmt(3C) or lfmt(3C). It associates an integer value int_val in the range [5-255] with a character string, overwriting any previous string association between int_val and string. If int_val is OR-ed with the flags argument passed to subsequent calls to pfmt() or lfmt(), string will be used as severity. Passing a null string removes the severity. RETURN VALUES
Upon successful completion, addsev() returns 0. Otherwise it returns-1. USAGE
Only the standard severities are automatically displayed for the locale in effect at runtime. An application must provide the means for displaying locale-specific versions of add-on severities. Add-on severities are only effective within the applications defining them. EXAMPLES
Example 1: Example of addsev() function. The following example #define Panic 5 setlabel("APPL"); setcat("my_appl"); addsev(Panic, gettxt(":26", "PANIC")); /* ... */ lfmt(stderr, MM_SOFT|MM_APPL|PANIC, ":12:Cannot locate database "); will display the message to stderr and forward to the logging service APPL: PANIC: Cannot locate database ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-safe | +-----------------------------+-----------------------------+ SEE ALSO
gettxt(3C), lfmt(3C), pfmt(3C), attributes(5) SunOS 5.10 29 Dec 1996 addsev(3C)

Featured Tech Videos