HP-UX Reference (11i v1 05/09) - 3 Library Functions N-Z (vol 7)

p
pfmt(3C) pfmt(3C)
NAME
pfmt(), vpfmt() - display message in standard format
SYNOPSIS
#include <pfmt.h>
int pfmt(FILE *stream, long flags, char *fmt, /* [arg, ] */ ...);
#include <stdarg.h>
#include <pfmt.h>
int vpfmt(FILE *stream, long flags, char *fmt, va_list ap);
DESCRIPTION
The pfmt() 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
pfmt() are formatted using printf() style for-
matting.
vpfmt() is similar to pfmt() except that the arguments are passed in an argument list (see
stdarg(5)).
The standard format displayed to stream has the following fields:
label
:severity:text
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
MM_NOSTD Do not use the standard format. Treat fmt as a printf() format string.
In this mode, only flags related to catalog access can be set.
MM_STD Format using the standard format (MM_STD is the default).
Catalog Access
MM_NOGET Do not access the localized message catalog. Use the def_str (a field in fmt )
as the format string.
MM_GET Access the localized message catalog (MM_GET is the default).
Severity
MM_HALT Display a localized HALT string.
MM_ERROR Display a localized ERROR string (MM_ERROR is the default).
MM_WARNING Display a localized WARNING string.
MM_INFO Display a localized INFO 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
MM_ACTION This flag generates the localized string of TO FIX: in the severity field of
the standard format message. If this flag and flags from the severity con-
trol group are set, this flag has precedence and the TO FIX: string will
be displayed.
The fmt string has the following fields:
catalog:msg_number:def_str
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 pfmt() 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, pfmt() uses the message catalog defined by setcat(3C). If MM_NOGET is set in
flags, only def_str must be specified.
Section 3650 Hewlett-Packard Company 1 HP-UX 11i Version 1: September 2005