NAME

printf_unit -- formatted print

PROTOTYPES

unitptr printf_unit( FILE *fp, char *pcFmt, int iMaxLen, unitptr uHost)

unitptr str_printf_unit( char *pcFile, char *pcFmt, int iMaxLen, unitptr uHost)

ARGUMENTS

FILE *fp
output. If fp=NULL, output is sprint'ed into the string X\_out[0].
char *pcFmt
print format; this determines also the layout of input field 0: there is one pin per fmt char.
int iMaxLen
initial length for textfields that have no field width spec
unitptr uHost
host unit
char *pcFile
output file, "-" selects stdout, "" string

INTERFACE OF CREATED UNIT:

X_in[N]:
(input field 0) one pin for each token to be printed. The number and the types of the tokens (and thereby, of the pins of X_in) are determined by the format specification pcFmt. Format specifications follow the same rules as for the printf-function, however, with legal conversion characters restricted to the set c d e f g i s x.
CTL_in[1]:
control field. A value of 0 suppresses any operation of this unit.
X_out[1]:
(output field 0) a single pin of type text string. Only used if fp=NULL or pcFile="". In this case the tokens are sprint'ed into this string, otherwise they are printed to the selected file or to stdout.

EXECUTION OF CREATED UNIT:

Analogous to the printf, sprintf and fprintf functions. Since NST handles variable length strings, this unit also provides a simple way to concatenate two or more strings. The str_printf_unit is similar to the printf_unit, except that an output file can be specified by a name instead of a file pointer. If several units use the same name, they will (internally) share a common file pointer.

SEE ALSO:

sprintf_unit

FILE

/amnt/loge/users/nistaff02/nistaff/rhaschke/nst7/man/../o.linux//../foldersrc/nst_string.c