INTERNATIONAL VERSION
Page 1 (printed 6/20/89)
NL_PRINTF(S) UNIX System V NL_PRINTF(S)
Name
nl_printf, nl_fprintf, nl_sprintf - formats native language
output
Syntax
int nl_printf( format [, arg ...])
char *format;
int nl_fprintf(stream, format [, arg ...])"
FILE *stream;
char *format;
int nl_sprintf(s, format [, arg ...])
char *s, *format;
Description
The functions nl_printf, nl_fprintf and nl_sprintf provide
similar functionality to the standard printf, fprintf and
sprintf routines (see printf(S)), with the difference that
the conversion character % in the format string is replaced
by the sequence %digit$, where digit is a decimal digit n in
the range (1-{ NL_ARGMAX }) (see limits(F)). Conversions
are applied to the nth argument in the argument list, rather
than to the next unused argument.
The format passed to these functions can contain either form
of conversion specification, namely % or %digit$, although
the two forms cannot be mixed within a single format string.
The format string should contain values for all the
arguments specified in the argument list. The asterisk, *,
cannot be used to indicate a field width in the format
string.
See Also
limits(F), nl_init(S), nl_scanf(S), printf(S)
Examples
The following nl_printf statement could be used to print the
language independent date and time format:
nl_printf(format, weekday, month, day, hour, min);
For American usage, format could be a pointer to the string:
"%1$s, %2$s %3$d, $4$d:%5$.2d0
This would produce the following message:
Sunday, July 3, 10:02
For German usage, format could be a pointer to the string:
"%1$s, %3$d. %2$s, $4$d:%5$.2d0
This would produce the message:
Sonntag, 3. Juli, 10:02
Value Added
nl_fprintf, nl_printf and nl_sprintf are extensions of AT&T
System V provided by the Santa Cruz Operation.
(printed 6/20/89)