Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
Guardian Native C Library Calls (t - z) wcstoll(3)
converted:
Character 0123456789ABCDEFGHIJ
abcdefghij
Value 012345678910111213141516171819
The subject string can optionally be preceded by a + (plus sign) or - (minus sign), but cannot
include an integer suffix (such as L). If the subject string is preceded by a - (minus sign), the con-
verted integer value has a negative value. If the value of base is 16, the characters 0x or 0X may
optionally precede the sequence of letters or digits, following the sign, if present.
The wide-character string is parsed to skip the initial space characters (as determined by the
iswspace() function). Any nonspace character is the starting of a potential subject string that
may form an integer in the base specified by the base parameter. The subject sequence is defined
to be the longest initial substring that is of the expected form of long long integer. Any character
that does not satisfy this expected form begins the final sequence of unrecognized characters.
The wcstoll() function sets the *endptr parameter to point to this final sequence of unrecognized
characters.
The LC_CTYPE category of the locale controls what wide characters are treated as spaces but
does not effect the interpretation of characters as part of the subject string. The characters in the
subject string are always treated as if the locale was the C locale.
RETURN VALUES
The wcstoll() function returns the converted value of long long integer if the expected form is
found. If no conversion could be performed, a value of 0 (zero) is returned. If the converted
value is outside the range of representable values, LLONG_MAX or LLONG_MIN is returned
(according to the sign of the value).
If the endptr parameter is not a null pointer, wcstoll() stores a pointer to the final sequence of
unrecognized characters in *endptr except when the subject sequence is empty or invalid. In this
case, wcstol() stores the nptr pointer in the *endptr parameter.
Since 0 (zero), LLONG_MIN, and LLONG_MAX are returned in the event of an error and are
also valid returns if the wcstoll() function is successful, applications should set errno to 0 (zero)
before calling the wcstoll() function, and check errno after return from the wcstoll() function.
If errno is nonzero, an error occurred. Additionally, if 0 (zero) is returned, applications should
check if the endptr parameter equals the nptr parameter. In this case, there was no valid subject
string.
ERRORS
If any of the following conditions occur, the wcstoll() function sets errno to the corresponding
value.
[EINVAL] The base parameter has a value less than 0 or greater than 36.
The nptr parameter is a null pointer.
[ERANGE] The converted value is outside the range of representable values.
RELATED INFORMATION
Functions: atoi(3), strtol(3), scanf(3), wcstod(3), iswalnum(3).
527192-018 Hewlett-Packard Company 7−169