You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

wcstoull.html 7.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <title>wcstoull (The Red Hat newlib C Library)</title>
  7. <meta name="description" content="wcstoull (The Red Hat newlib C Library)">
  8. <meta name="keywords" content="wcstoull (The Red Hat newlib C Library)">
  9. <meta name="resource-type" content="document">
  10. <meta name="distribution" content="global">
  11. <meta name="Generator" content="makeinfo">
  12. <link href="index.html#Top" rel="start" title="Top">
  13. <link href="Document-Index.html#Document-Index" rel="index" title="Document Index">
  14. <link href="Document-Index.html#SEC_Contents" rel="contents" title="Table of Contents">
  15. <link href="Stdlib.html#Stdlib" rel="up" title="Stdlib">
  16. <link href="system.html#system" rel="next" title="system">
  17. <link href="wcstoul.html#wcstoul" rel="prev" title="wcstoul">
  18. <style type="text/css">
  19. <!--
  20. a.summary-letter {text-decoration: none}
  21. blockquote.indentedblock {margin-right: 0em}
  22. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  23. blockquote.smallquotation {font-size: smaller}
  24. div.display {margin-left: 3.2em}
  25. div.example {margin-left: 3.2em}
  26. div.lisp {margin-left: 3.2em}
  27. div.smalldisplay {margin-left: 3.2em}
  28. div.smallexample {margin-left: 3.2em}
  29. div.smalllisp {margin-left: 3.2em}
  30. kbd {font-style: oblique}
  31. pre.display {font-family: inherit}
  32. pre.format {font-family: inherit}
  33. pre.menu-comment {font-family: serif}
  34. pre.menu-preformatted {font-family: serif}
  35. pre.smalldisplay {font-family: inherit; font-size: smaller}
  36. pre.smallexample {font-size: smaller}
  37. pre.smallformat {font-family: inherit; font-size: smaller}
  38. pre.smalllisp {font-size: smaller}
  39. span.nolinebreak {white-space: nowrap}
  40. span.roman {font-family: initial; font-weight: normal}
  41. span.sansserif {font-family: sans-serif; font-weight: normal}
  42. ul.no-bullet {list-style: none}
  43. -->
  44. </style>
  45. </head>
  46. <body lang="en">
  47. <a name="wcstoull"></a>
  48. <div class="header">
  49. <p>
  50. Next: <a href="system.html#system" accesskey="n" rel="next">system</a>, Previous: <a href="wcstoul.html#wcstoul" accesskey="p" rel="prev">wcstoul</a>, Up: <a href="Stdlib.html#Stdlib" accesskey="u" rel="up">Stdlib</a> &nbsp; [<a href="Document-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Document-Index.html#Document-Index" title="Index" rel="index">Index</a>]</p>
  51. </div>
  52. <hr>
  53. <a name="wcstoull_002c-wcstoull_005fl_002d_002d_002dwide-string-to-unsigned-long-long"></a>
  54. <h3 class="section">2.47 <code>wcstoull</code>, <code>wcstoull_l</code>&mdash;wide string to unsigned long long</h3>
  55. <a name="index-wcstoull"></a>
  56. <a name="index-wcstoull_005fl"></a>
  57. <a name="index-_005fwcstoull_005fr"></a>
  58. <p><strong>Synopsis</strong>
  59. </p><div class="example">
  60. <pre class="example">#include &lt;wchar.h&gt;
  61. unsigned long long wcstoull(const wchar_t *__restrict <var>s</var>,
  62. wchar_t **__restrict <var>ptr</var>,
  63. int <var>base</var>);
  64. #include &lt;wchar.h&gt;
  65. unsigned long long wcstoull_l(const wchar_t *__restrict <var>s</var>,
  66. wchar_t **__restrict <var>ptr</var>,
  67. int <var>base</var>,
  68. locale_t <var>locale</var>);
  69. unsigned long long _wcstoull_r(void *<var>reent</var>, const wchar_t *<var>s</var>,
  70. wchar_t **<var>ptr</var>, int <var>base</var>);
  71. </pre></div>
  72. <p><strong>Description</strong><br>
  73. The function <code>wcstoull</code> converts the wide string <code>*<var>s</var></code> to
  74. an <code>unsigned long long</code>. First, it breaks down the string into three parts:
  75. leading whitespace, which is ignored; a subject string consisting
  76. of the digits meaningful in the radix specified by <var>base</var>
  77. (for example, <code>0</code> through <code>7</code> if the value of <var>base</var> is 8);
  78. and a trailing portion consisting of one or more unparseable characters,
  79. which always includes the terminating null character. Then, it attempts
  80. to convert the subject string into an unsigned long long integer, and returns the
  81. result.
  82. </p>
  83. <p>If the value of <var>base</var> is zero, the subject string is expected to look
  84. like a normal C integer constant: an optional sign (<code>+</code> or <code>-</code>),
  85. a possible <code>0x</code> indicating hexadecimal radix or a possible &lt;0&gt; indicating
  86. octal radix, and a number.
  87. If <var>base</var> is between 2 and 36, the expected form of the subject is a
  88. sequence of digits (which may include letters, depending on the
  89. base) representing an integer in the radix specified by <var>base</var>.
  90. The letters <code>a</code>&ndash;<code>z</code> (or <code>A</code>&ndash;<code>Z</code>) are used as digits valued from
  91. 10 to 35. If <var>base</var> is 16, a leading <code>0x</code> is permitted.
  92. </p>
  93. <p>The subject sequence is the longest initial sequence of the input
  94. string that has the expected form, starting with the first
  95. non-whitespace character. If the string is empty or consists entirely
  96. of whitespace, or if the first non-whitespace character is not a
  97. permissible digit, the subject string is empty.
  98. </p>
  99. <p>If the subject string is acceptable, and the value of <var>base</var> is zero,
  100. <code>wcstoull</code> attempts to determine the radix from the input string. A
  101. string with a leading <code>0x</code> is treated as a hexadecimal value; a string with
  102. a leading <code>0</code> and no <code>x</code> is treated as octal; all other strings are
  103. treated as decimal. If <var>base</var> is between 2 and 36, it is used as the
  104. conversion radix, as described above. Finally, a pointer to the first
  105. character past the converted subject string is stored in <var>ptr</var>, if
  106. <var>ptr</var> is not <code>NULL</code>.
  107. </p>
  108. <p>If the subject string is empty (that is, if <code>*</code><var>s</var> does not start
  109. with a substring in acceptable form), no conversion
  110. is performed and the value of <var>s</var> is stored in <var>ptr</var> (if <var>ptr</var> is
  111. not <code>NULL</code>).
  112. </p>
  113. <p>The alternate function <code>_wcstoull_r</code> is a reentrant version. The
  114. extra argument <var>reent</var> is a pointer to a reentrancy structure.
  115. </p>
  116. <p><code>wcstoull_l</code> is like <code>wcstoull</code> but performs the conversion based on the
  117. locale specified by the locale object locale. If <var>locale</var> is
  118. LC_GLOBAL_LOCALE or not a valid locale object, the behaviour is undefined.
  119. </p>
  120. <br>
  121. <p><strong>Returns</strong><br>
  122. <code>wcstoull</code>, <code>wcstoull_l</code> return <code>0</code> and sets <code>errno</code> to <code>EINVAL</code>
  123. if the value of <var>base</var> is not supported.
  124. </p>
  125. <p><code>wcstoull</code>, <code>wcstoull_l</code> return the converted value, if any. If no
  126. conversion was made, <code>0</code> is returned.
  127. </p>
  128. <p><code>wcstoull</code>, <code>wcstoull_l</code> return <code>ULLONG_MAX</code> if the magnitude of
  129. the converted value is too large, and sets <code>errno</code> to <code>ERANGE</code>.
  130. </p>
  131. <br>
  132. <p><strong>Portability</strong><br>
  133. <code>wcstoull</code> is ANSI.
  134. <code>wcstoull_l</code> is a GNU extension.
  135. </p>
  136. <p><code>wcstoull</code> requires no supporting OS subroutines.
  137. </p>
  138. <br>
  139. <hr>
  140. <div class="header">
  141. <p>
  142. Next: <a href="system.html#system" accesskey="n" rel="next">system</a>, Previous: <a href="wcstoul.html#wcstoul" accesskey="p" rel="prev">wcstoul</a>, Up: <a href="Stdlib.html#Stdlib" accesskey="u" rel="up">Stdlib</a> &nbsp; [<a href="Document-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Document-Index.html#Document-Index" title="Index" rel="index">Index</a>]</p>
  143. </div>
  144. </body>
  145. </html>