blob: 90dac41a8957b011c5ed7e2c9c84ec131bc3484a [file]
<html lang="en">
<head>
<title>wcstoll - 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="wcstol.html#wcstol" title="wcstol">
<link rel="next" href="wcstoul.html#wcstoul" title="wcstoul">
<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="wcstoll"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="wcstoul.html#wcstoul">wcstoul</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="wcstol.html#wcstol">wcstol</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Stdlib.html#Stdlib">Stdlib</a>
<hr>
</div>
<h3 class="section">2.42 <code>wcstoll</code>&mdash;wide string to long long</h3>
<p><a name="index-wcstoll-100"></a><a name="index-g_t_005fwcstoll_005fr-101"></a><strong>Synopsis</strong>
<pre class="example"> #include &lt;wchar.h&gt;
long long wcstoll(const wchar_t *<var>s</var>, wchar_t **<var>ptr</var>,int <var>base</var>);
long long _wcstoll_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>wcstoll</code> converts the wide string <code>*</code><var>s</var> to
a <code>long long</code>. First, it breaks down the string into three parts:
leading whitespace, which is ignored; a subject string consisting
of characters resembling an integer in the radix specified by <var>base</var>;
and a trailing portion consisting of zero or more unparseable characters,
and always including the terminating null character. Then, it attempts
to convert the subject string into a <code>long long</code> and returns the
result.
<p>If the value of <var>base</var> is 0, the subject string is expected to look
like a normal C integer constant: an optional sign, a possible `<code>0x</code>'
indicating a hexadecimal base, and a number. If <var>base</var> is between
2 and 36, the expected form of the subject is a sequence of letters
and digits representing an integer in the radix specified by <var>base</var>,
with an optional plus or minus sign. The letters <code>a</code>&ndash;<code>z</code> (or,
equivalently, <code>A</code>&ndash;<code>Z</code>) are used to signify values from 10 to 35;
only letters whose ascribed values are less than <var>base</var> are
permitted. 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 letter or digit, the subject string is empty.
<p>If the subject string is acceptable, and the value of <var>base</var> is zero,
<code>wcstoll</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 0 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. If the subject string begins with
a minus sign, the value is negated. 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 (or not 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>_wcstoll_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>wcstoll</code> returns the converted value, if any. If no conversion was
made, 0 is returned.
<p><code>wcstoll</code> returns <code>LONG_LONG_MAX</code> or <code>LONG_LONG_MIN</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>wcstoll</code> is ANSI.
<p>No supporting OS subroutines are required.
<p><br>
</body></html>