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 difference that the conversion character % is replaced by %digits$. Digits are decimal digits representing a number n in the range (1-{NL_ARGMAX}) (NL_ARGMAX is defined in <limits.h>), 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 %digits$ sequence and the user must ensure correct numbering. All parameters must be used exactly once.
EXAMPLES
To create a language-independent date and time printing routine, write
printmsg(format, weekday, month, day, hour, min);
For American usage format would point to the string:
"%1$s, %2$s %3$d, %4$d:%5$.2d"
resulting in the output:
Sunday, July 3, 10:02
For German usage, the string:
"%1$s, %3$d %2$s %4$d:%5$.2d"
results in the following output:
Sonntag, 3 Juli 10:02
provided that the proper strings have been read.
WARNINGS
These routines are provided for historical reasons only. Use of the printf(3S) equivalent routines nl_printf, nl_fprintf and nl_sprintf is recommended.
AUTHOR
Printmsg was developed by HP.
SEE ALSO
catgetmsg(3C), nl_init(3C), printf(3S), hpnls(5).
INTERNATIONAL SUPPORT
8-bit data.
Hewlett-Packard Company — May 11, 2021