Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
Guardian Native C Library Calls (t - z) wcstoimax(3)
NAME
wcstoimax - Converts a wide-character string to intmax_t integer
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <wchar.h>
intmax_t wcstoimax(
const wchar_t *nptr,
wchar_t **endptr,
int base);
PARAMETERS
nptr Contains a pointer to the wide-character string to be converted to intmax_t
integer representation.
endptr Points to a pointer in which the wcstoimax() function stores the position in the
string specified by the nptr parameter where a wide character is found that is not
a valid character for the purpose of this conversion.
base Specifies the radix in which the characters are interpreted.
DESCRIPTION
The wcstoimax() function converts the initial portion of the wide-character string pointed to by
the nptr parameter to a intmax_t integer representation. The input wide-character string is first
broken down into three parts:
• White space -- an initial (possibly empty) sequence of wide-character spaces (as
specified by the iswspace() function)
• Subject sequence -- a sequence of wide characters that are valid in an integer constant of
the radix determined by the base parameter
• Unrecognized characters -- final sequence of unrecognized wide-character codes, includ-
ing the terminating null wide character
If possible, the subject is then converted to an intmax_t integer and the result is returned.
The base parameter can take values between 0 and 36.
• If the base value is 0 (zero), the subject string can be a decimal, octal, or hexadecimal
integer constant. A decimal constant begins with a nonzero digit, and consists of a
sequence of decimal digits. An octal constant consists of the prefix 0 (zero) optionally
followed by a sequence of digits in the range 0 through 7. A hexadecimal constant con-
sists of the prefix 0x or oX followed by a sequence consisting of decimal digits and the
letters in the range a (or A) to f (or F).
• If the base value is between 2 and 36, the subject string can be a sequence of digits and
letters a (or A) to z ( or Z ) that are used to represent an integer in the specified base.
Alphabetic characters represent digits with an equivalent decimal value from 10 (for the
letter A) to 35 (for the letter Z). The subject string can only have digits with a value less
than base and alphabetic characters with equivalent values less than base. For example,
when the value of the base parameter is 20, only the following value assignments are
527192-018 Hewlett-Packard Company 7−159