PRINTMSG(3C) — HP-UX
NAME
printmsg, fprintmsg, sprintmsg − print formatted output with numbered arguments
SYNOPSIS
#include <stdio.h>
int printmsg (format [ , arg ] ... )
char ∗format;
int fprintmsg (stream, format [ , arg ] ... )
FILE ∗stream;
char ∗format;
int sprintmsg (s, format [ , arg ] ... )
char ∗s, format;
DESCRIPTION
Printmsg , fprintmsg , and sprintmsg are derived from their counterparts in printf(3S), with the amplification that the conversion character % is replaced by the sequence %digit$ . Digit is a decimal digit n in the range 1-9, and indicates that this conversion should be applied to the nth argument, rather than to the next unused one. All other aspects of formatting are unchanged. All conversion specifications must contain the %digit$ sequence, and it is the user’s responsibility to make sure the numbering is correct. All parameters must be used exactly once.
EXAMPLE
To create a language independent date and time printing routine we would write
printmsg(format, weekday, month, day, hour, min);
For American usage format would be a pointer to the string
"%1$s, %2$s %3$d, %4$d:%5$.2d"
and for German usage to a string
"%1$s, %3$d %2$s %4$d:%5$.2d"
the resulting outputs will be "Sunday, July 3, 10:02", and "Sonntag, 3 Juli 10:02" , assuming that the proper strings have been passed in.
AUTHOR
Printmsg was developed by the Hewlett-Packard Company.
SEE ALSO
getmsg(3C), printf(3S), hpnls(5).
INTERNATIONAL SUPPORT
8-bit data, messages.
Hewlett-Packard Company — Version B.1, April 12, 1993