HP-UX Reference (11i v2 07/12) - 3 Library Functions N-Z (vol 7)

p
pfmt(3C) pfmt(3C)
The pfmt() system call displays Message not found!!
under the following conditions:
• No message catalog is specified in fmt and no catalog is defined via setcat(3C).
• msg_number is not positive.
• No message could be retrieved and def_str is not specified.
RETURN VALUE
If successful,
pfmt() and vpfmt() return the number of bytes written. Otherwise they return a nega-
tive value.
EXAMPLES
Example 1
setlabel("UX:my_appl");
pfmt(stderr, MM_INFO,"MY_cat:1:file is writable");
generates the message:
UX:my_appl: INFO: file is writable
Example 2
setlabel("");
setcat("MY_cat");
pfmt(stderr, MM_ERROR,":1:%s is writable", "my_file");
generates the message:
ERROR: my_file is writable
Example 3
setlabel("");
setcat("MY_cat");
pfmt(stderr, MM_NOSTD,":1:%s is writable", "my_file");
generates the message:
my_file is writable
Example 4
#define MM_USER 10
setlabel("");
addsev(MM_USER, "MY_NOTE");
pfmt(stderr, MM_USER|MM_GET,"MY_cat:1:%s is writable", "my_file");
generates the message:
MY_NOTE: my_file is writable
SEE ALSO
mkmsgs(1), addsev(3C), gettxt(3C), setcat(3C), setlabel(3C), setlocale(3C), printf(3S), stdarg(5),
thread_safety(5).
STANDARDS COMPLIANCE
pfmt(): SVID3
vpfmt(): SVID3
HP-UX 11i Version 2: December 2007 Update − 2 − Hewlett-Packard Company 145