Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)

Guardian Native C Library Calls (s) sscanf(3)
The conversion code convcode indicates how to interpret the input eld. The corresponding
pointer must usually be of a restricted type. You should not specify the pointer parameter for a
suppressed eld.
sscanf() processing ends either at the end of the input string, the end of the conversion
specications, or when an input character conicts with the conversion specications. If
sscanf() processing ends with an input character conict, the conicting character is not read
from the input string.
Unless there is a match in the conversion specication, trailing white space (including a newline
character) is not read.
The success of literal matches and suppressed assignments cannot be directly determined. The
sscanf() function returns the number of successfully matched and assigned input items.
NOTES
This function supports both IEEE Std 754-1985 oating-point and Tandem oating-point values
in the native environment. IEEE values can include NaN and innity, 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 oating-point formats. Refer to the Guar-
dian Programmers Guide for a discussion of oating-point conversions.
RETURN VALUES
The sscanf() function returns the number of successfully matched and assigned input items. This
value can be 0 (zero) if there was an early conict between an input character and the conversion
specication. If the input ends before the rst conict or conversion, EOF (End-of-File) is
returned.
ERRORS
If any of the following conditions occur, the sscanf() function sets errno to the corresponding
value:
[EINTR] The read operation was interrupted by a signal that was caught and no data was
transferred.
[EINVAL] The function call contains an invalid argument.
[EIO] The call is attempting to read from the processs controlling terminal and either
the process is ignoring or blocking the SIGTTIN signal or the process group is
orphaned.
[ENOMEM] Insufcient memory is available for the operation.
[ENXIO] A request was made to a nonexistent device, or the request was outside the capa-
bilities of the device.
RELATED INFORMATION
Functions: atof(3), atoi(3), fp_class(3), fscanf(3), getc(3), getwc(3), isnan(3), printf(3),
scanf(3).
STANDARDS CONFORMANCE
The [EINVAL] errno value is an extension to the the XPG4 Version 2 specication.
The POSIX standards leave some features to the implementing vendor to dene. The following
features are affected in the HP implementation:
A - (dash) character that is neither the rst nor last character in a scanset for %[scanset]
conversion indicates a range of values. The value preceding a - (dash) character must be
lexically less than or equal to the value after the - (dash).
527192-005 Hewlett-Packard Company 645