1setlabel(3C) Standard C Library Functions setlabel(3C)
2
3
4
6 setlabel - define the label for pfmt() and lfmt()
7
9 #include <pfmt..h>
10
11 int setlabel(const char *label);
12
13
15 The setlabel() function defines the label for messages produced in
16 standard format by subsequent calls to lfmt(3C) and pfmt(3C).
17
18
19 The label argument is a character string no more than 25 characters in
20 length.
21
22
23 No label is defined before setlabel() is called. The label should be
24 set once at the beginning of a utility and remain constant. A null
25 pointer or an empty string passed as argument will reset the defini‐
26 tion of the label.
27
29 Upon successful completion, setlabel() returns 0; otherwise, it returns
30 a non-zero value.
31
33 The following code (without previous call to setlabel()):
34
35 pfmt(stderr, MM_ERROR, "test:2:Cannot open file\n");
36 setlabel("UX:test");
37 pfmt(stderr, MM_ERROR, "test:2:Cannot open file\n");
38
39
40
41 will produce the following output:
42
43 ERROR: Cannot open file
44 UX:test: ERROR: Cannot open file
45
46
48 See attributes(5) for descriptions of the following attributes:
49
50
51
52
53 ┌─────────────────────────────┬─────────────────────────────┐
54 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
55 ├─────────────────────────────┼─────────────────────────────┤
56 │MT-Level │MT-Safe │
57 └─────────────────────────────┴─────────────────────────────┘
58
60 getopt(3C), lfmt(3C), pfmt(3C), attributes(5)
61
62
63
64SunOS 5.11 29 Dec 1996 setlabel(3C)