Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (e - f) fwscanf(3)
You can include the ] (right bracket) as an element of scanset if
it is the first character of scanset. In this case, it is not inter-
preted as the bracket that closes scanset.Ifscanset is an
exclusive scanset, the ] is preceded by the ˆ (circumflex) to make
the ] an element of scanset. The corresponding pointer parame-
ter must point to a character array large enough to contain the
output string with a terminating 0 (zero) appended. The 0 is
added automatically.
The results from the conversion are placed in *pointer unless you specify assignment suppres-
sion with an * (asterisk). Assignment suppression provides a way to describe an input field that
is to be skipped. The input field is a string of non-white-space characters. It extends to the next
inappropriate character or until width, if specified, is reached.
The conversion code convcode indicates how to interpret the input field. The corresponding
pointer must usually be of a restricted type. You should not specify the pointer parameter for a
suppressed field.
fwscanf( ) processing ends at either the end of the input file, at the end of the conversion
specifications, or when an input character conflicts with a conversion specification. If processing
ends with an input character conflict, the conflicting character is not read from the input stream.
Unless there is a match in the conversion specification, trailing white space (including a newline
character) is not read.
The success of literal matches and suppressed assignments cannot be directly determined. The
fwscanf( ) function returns the number of successfully matched and assigned input items.
NOTES
This function supports both IEEE Std 754-1985 floating-point and Tandem floating-point values
in the native environment. IEEE values can include NaN and infinity, and the sign of 0.0 (zero)
can be either positive or negative. Refer to the fp_class(3) reference page for a description of
IEEE value classes.
Guardian functions are available to convert between floating-point formats. Refer to the Guar-
dian Programmer’s Guide for a discussion of floating-point conversions.
RETURN VALUES
The fwscanf( ) function returns the number of successfully matched and assigned input items.
This value can be 0 (zero) if there was an early conflict between an input character and a conver-
sion specification. If the input ends before the first conflict or conversion, EOF (End-of-File) is
returned.
ERRORS
The fwscanf( ) function fails if stream is unbuffered, or if stream’s buffer needed to be flushed
and the function call caused an underlying read() or lseek( ) function to be invoked and that
operation failed. In addition, if any of the following conditions occur, the fwscanf( ) function
sets errno to the corresponding value:
[EAGAIN] The O_NONBLOCK flag is set for the underlying stream and the process would
be delayed by the read operation.
[EBADF] The file descriptor underlying stream is not a valid file descriptor or is not open
for reading.
527187-017 Hewlett-Packard Company 2223