nl_printf(S) 6 January 1993 nl_printf(S) Name nl_printf, nl_fprintf, nl_sprintf - formats native language output Syntax cc . . . -lintl 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 nlprintf, nlfprintf and nlsprintf provide similar func- tionality 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(FP)). Conver- sions 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 conver- sion 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 aster- isk, *, cannot be used to indicate a field width in the format string. Examples The following nlprintf 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 See also limits(FP), nlinit(S), nlscanf(S), printf(S) Standards conformance nlfprintf, nlprintf and nlsprintf are extensions of AT&T System V pro- vided by the Santa Cruz Operation.