blob: 5ad8d35c7dafc1b33c2b41ac0c3d9cb1540663ec [file]
<html lang="en">
<head>
<title>wcstoull - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Stdlib.html#Stdlib" title="Stdlib">
<link rel="prev" href="wcstoul.html#wcstoul" title="wcstoul">
<link rel="next" href="system.html#system" title="system">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="wcstoull"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="system.html#system">system</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="wcstoul.html#wcstoul">wcstoul</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Stdlib.html#Stdlib">Stdlib</a>
<hr>
</div>
<h3 class="section">2.44 <code>wcstoull</code>&mdash;wide string to unsigned long long</h3>
<p><a name="index-wcstoull-104"></a><a name="index-g_t_005fwcstoull_005fr-105"></a><strong>Synopsis</strong>
<pre class="example"> #include &lt;wchar.h&gt;
unsigned long long wcstoull(const wchar_t *<var>s</var>, wchar_t **<var>ptr</var>,
int <var>base</var>);
unsigned long long _wcstoull_r(void *<var>reent</var>, const wchar_t *<var>s</var>,
wchar_t **<var>ptr</var>, int <var>base</var>);
</pre>
<p><strong>Description</strong><br>
The function <code>wcstoull</code> converts the wide string <code>*</code><var>s</var> to
an <code>unsigned long long</code>. First, it breaks down the string into three parts:
leading whitespace, which is ignored; a subject string consisting
of the digits meaningful in the radix specified by <var>base</var>
(for example, <code>0</code> through <code>7</code> if the value of <var>base</var> is 8);
and a trailing portion consisting of one or more unparseable characters,
which always includes the terminating null character. Then, it attempts
to convert the subject string into an unsigned long long integer, and returns the
result.
<p>If the value of <var>base</var> is zero, the subject string is expected to look
like a normal C integer constant: an optional sign (<code>+</code> or <code>-</code>),
a possible <code>0x</code> indicating hexadecimal radix or a possible &lt;0&gt; indicating
octal radix, and a number.
If <var>base</var> is between 2 and 36, the expected form of the subject is a
sequence of digits (which may include letters, depending on the
base) representing an integer in the radix specified by <var>base</var>.
The letters <code>a</code>&ndash;<code>z</code> (or <code>A</code>&ndash;<code>Z</code>) are used as digits valued from
10 to 35. If <var>base</var> is 16, a leading <code>0x</code> is permitted.
<p>The subject sequence is the longest initial sequence of the input
string that has the expected form, starting with the first
non-whitespace character. If the string is empty or consists entirely
of whitespace, or if the first non-whitespace character is not a
permissible digit, the subject string is empty.
<p>If the subject string is acceptable, and the value of <var>base</var> is zero,
<code>wcstoull</code> attempts to determine the radix from the input string. A
string with a leading <code>0x</code> is treated as a hexadecimal value; a string with
a leading <code>0</code> and no <code>x</code> is treated as octal; all other strings are
treated as decimal. If <var>base</var> is between 2 and 36, it is used as the
conversion radix, as described above. Finally, a pointer to the first
character past the converted subject string is stored in <var>ptr</var>, if
<var>ptr</var> is not <code>NULL</code>.
<p>If the subject string is empty (that is, if <code>*</code><var>s</var> does not start
with a substring in acceptable form), no conversion
is performed and the value of <var>s</var> is stored in <var>ptr</var> (if <var>ptr</var> is
not <code>NULL</code>).
<p>The alternate function <code>_wcstoull_r</code> is a reentrant version. The
extra argument <var>reent</var> is a pointer to a reentrancy structure.
<p><br>
<strong>Returns</strong><br>
<code>wcstoull</code> returns <code>0</code> and sets <code>errno</code> to <code>EINVAL</code> if the value of
<var>base</var> is not supported.
<p><code>wcstoull</code> returns the converted value, if any. If no conversion was
made, <code>0</code> is returned.
<p><code>wcstoull</code> returns <code>ULLONG_MAX</code> if the magnitude of the converted
value is too large, and sets <code>errno</code> to <code>ERANGE</code>.
<p><br>
<strong>Portability</strong><br>
<code>wcstoull</code> is ANSI.
<p><code>wcstoull</code> requires no supporting OS subroutines.
<p><br>
</body></html>