Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pfmt(3c) [hpux man page]

pfmt(3C)																  pfmt(3C)

NAME
pfmt(), vpfmt() - display message in standard format SYNOPSIS
DESCRIPTION
The system call can be used to write a message in standard format to stream. It can also be used to write a localized string to stream. The arguments to are formatted using style formatting. is similar to except that the arguments are passed in an argument list (see stdarg(5)). The standard format displayed on stream has the following fields: The label string is defined through setlabel(3C). If no label is defined, this field is not used. The severity string is controlled by the severity group of flags. The text string is the formatted user string. The flags control how formatting is done. The control information is separated into several different groups. Only one flag from each group should be set. Output Format Do not use the standard format. Treat fmt as a format string. In this mode, only flags related to catalog access can be set. Format using the standard format is the default). Catalog Access Do not access the localized message catalog. Use the def_str (a field in fmt) as the format string. Access the localized message catalog is the default). Severity Display a localized string. Display a localized string is the default). Display a localized string. Display a localized string. Besides these reserved severities, additional severity strings may be defined by the user (see addsev(3C)). To specify a user defined severity, flags should be a logical-or of the numeric value of the user defined severity and flags from other control groups. Action This flag generates the localized string of in the severity field of the standard format message. If this flag and flags from the severity control group are set, this flag has precedence and the string will be displayed. The fmt string has the following fields: The catalog is the message catalog created by mkmsgs(1) where the localized message is to be retrieved. The msg_number is a positive index number identifying the string to be retrieved from the message catalog (begins at 1). The def_str is the default string to use if fails to retrieve the message from catalog from either the current locale or the default locale. The failure may occur if the message catalog does not exist or if the msg_number is out of bound. If catalog is not specified, uses the message catalog defined by setcat(3C). If is set in flags, only def_str must be specified. The system call displays under the following conditions: o No message catalog is specified in fmt and no catalog is defined via setcat(3C). o msg_number is not positive. o No message could be retrieved and def_str is not specified. RETURN VALUE
If successful, and return the number of bytes written. Otherwise, they return a negative value. EXAMPLES
Example 1 generates the message: Example 2 generates the message: Example 3 generates the message: Example 4 generates the message: SEE ALSO
mkmsgs(1), addsev(3C), gettxt(3C), printf(3S), setcat(3C), setlabel(3C), setlocale(3C), stdarg(5), thread_safety(5). STANDARDS CONFORMANCE
pfmt(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.11 29 Dec 1996 addsev(3C)
Man Page