Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fprintmsg(3C) — HP-UX 7.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

catgetmsg(3C)

setlocale(3C)

printf(3S)

hpnls(5)

PRINTMSG(3C)

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).  The conversion character % can be 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 printf, fprintf and sprintf is recommended. 

AUTHOR

Printmsg was developed by HP. 

SEE ALSO

catgetmsg(3C), setlocale(3C), printf(3S), hpnls(5). 

EXTERNAL INFLUENCES

Locale

The LC_CTYPE category affects the following features:

• Plain characters within format strings are interpreted as single and/or multi-byte characters. 

• Field width is given in terms of bytes.  As characters are placed on the output stream, they are interpreted as single or multi-byte characters and the field width is decremented by the length of the character. 

• Precision is given in terms of bytes.  As characters are placed on the output stream, they are interpreted as single or multi-byte characters and the precision is decremented by the length of the character. 

• The return value is given in terms of bytes.  As characters are placed on the output stream, they are interpreted as single- or multi-byte characters and the byte count that makes up the return value is incremented by the length of the character. 

The LC_NUMERIC category determines the radix character used to print floating-point numbers. 

International Code Set Support

Single-byte character code sets are supported.  Multi-byte character code sets are also supported as described in the LC_CTYPE category above. 

Hewlett-Packard Company  —  HP-UX Release 7.0: Sept 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026