Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

3 lat temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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>fputws (The Red Hat newlib C Library)</title>
  7. <meta name="description" content="fputws (The Red Hat newlib C Library)">
  8. <meta name="keywords" content="fputws (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="Stdio.html#Stdio" rel="up" title="Stdio">
  16. <link href="fread.html#fread" rel="next" title="fread">
  17. <link href="fputwc.html#fputwc" rel="prev" title="fputwc">
  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="fputws"></a>
  48. <div class="header">
  49. <p>
  50. Next: <a href="fread.html#fread" accesskey="n" rel="next">fread</a>, Previous: <a href="fputwc.html#fputwc" accesskey="p" rel="prev">fputwc</a>, Up: <a href="Stdio.html#Stdio" accesskey="u" rel="up">Stdio</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="fputws_002c-fputws_005funlocked_002d_002d_002dwrite-a-wide-character-string-in-a-file-or-stream"></a>
  54. <h3 class="section">4.23 <code>fputws</code>, <code>fputws_unlocked</code>&mdash;write a wide character string in a file or stream</h3>
  55. <a name="index-fputws"></a>
  56. <a name="index-fputws_005funlocked"></a>
  57. <a name="index-_005ffputws_005fr"></a>
  58. <a name="index-_005ffputws_005funlocked_005fr"></a>
  59. <p><strong>Synopsis</strong>
  60. </p><div class="example">
  61. <pre class="example">#include &lt;wchar.h&gt;
  62. int fputws(const wchar_t *__restrict <var>ws</var>, FILE *__restrict <var>fp</var>);
  63. #define _GNU_SOURCE
  64. #include &lt;wchar.h&gt;
  65. int fputws_unlocked(const wchar_t *__restrict <var>ws</var>, FILE *__restrict <var>fp</var>);
  66. #include &lt;wchar.h&gt;
  67. int _fputws_r(struct _reent *<var>ptr</var>, const wchar_t *<var>ws</var>,
  68. FILE *<var>fp</var>);
  69. #include &lt;wchar.h&gt;
  70. int _fputws_unlocked_r(struct _reent *<var>ptr</var>, const wchar_t *<var>ws</var>,
  71. FILE *<var>fp</var>);
  72. </pre></div>
  73. <p><strong>Description</strong><br>
  74. <code>fputws</code> writes the wide character string at <var>ws</var> (but without the
  75. trailing null) to the file or stream identified by <var>fp</var>.
  76. </p>
  77. <p><code>fputws_unlocked</code> is a non-thread-safe version of <code>fputws</code>.
  78. <code>fputws_unlocked</code> may only safely be used within a scope
  79. protected by flockfile() (or ftrylockfile()) and funlockfile(). This
  80. function may safely be used in a multi-threaded program if and only
  81. if they are called while the invoking thread owns the (FILE *)
  82. object, as is the case after a successful call to the flockfile() or
  83. ftrylockfile() functions. If threads are disabled, then
  84. <code>fputws_unlocked</code> is equivalent to <code>fputws</code>.
  85. </p>
  86. <p><code>_fputws_r</code> and <code>_fputws_unlocked_r</code> are simply reentrant versions of the
  87. above that take an additional reentrant struct pointer argument: <var>ptr</var>.
  88. </p>
  89. <br>
  90. <p><strong>Returns</strong><br>
  91. If successful, the result is a non-negative integer; otherwise, the result
  92. is <code>-1</code> to indicate an error.
  93. </p>
  94. <br>
  95. <p><strong>Portability</strong><br>
  96. <code>fputws</code> is required by C99 and POSIX.1-2001.
  97. </p>
  98. <p><code>fputws_unlocked</code> is a GNU extension.
  99. </p>
  100. <br>
  101. </body>
  102. </html>