📄 fputwc.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>fputwc</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_005_212"> </a>NAME</h4><blockquote>fputwc - put a wide-character code on a stream</blockquote><h4><a name = "tag_000_005_213"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="stdio.h.html">stdio.h</a>>#include <<a href="wchar.h.html">wchar.h</a>>wint_t fputwc(wchar_t <i>wc</i>, FILE *<i>stream</i>);</code></pre></blockquote><h4><a name = "tag_000_005_214"> </a>DESCRIPTION</h4><blockquote>The<i>fputwc()</i>function writes the character corresponding to the wide-character code<i>wc</i>to the output stream pointed to by<i>stream</i>,at the position indicated by the associated file-positionindicator for the stream (if defined), and advances the indicatorappropriately.If the file cannot support positioning requests, or if the streamwas opened with append mode, the character is appended to theoutput stream. If an error occurs whilst writing the character, the shiftstate of the output file is left in an undefined state.<p>The<i>st_ctime</i>and<i>st_mtime</i>fields of the file will be marked for update between the successfulexecution of<i>fputwc()</i>and the next successful completion of a call to<i><a href="fflush.html">fflush()</a></i>or<i><a href="fclose.html">fclose()</a></i>on the same stream or a call to<i><a href="exit.html">exit()</a></i>or<i><a href="abort.html">abort()</a></i>.</blockquote><h4><a name = "tag_000_005_215"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>fputwc()</i>returns<i>wc</i>.Otherwise, it returns WEOF, the error indicator for the stream is set, and<i>errno</i>is set to indicate the error.</blockquote><h4><a name = "tag_000_005_216"> </a>ERRORS</h4><blockquote>The<i>fputwc()</i>function will fail if either the stream is unbuffered or data in the<i>stream</i>'sbuffer needs to be written, and:<dl compact><dt>[EAGAIN]<dd>The O_NONBLOCK flag is set for the file descriptorunderlying<i>stream</i>and the process would be delayed in the write operation.<dt>[EBADF]<dd>The file descriptor underlying<i>stream</i>is not a valid file descriptor open for writing.<dt>[EFBIG]<dd>An attempt was made to write to a file that exceedsthe maximum file size or the process' file size limit.<dt>[EFBIG]<dd>The file is a regular file and an attempt was made to write at or beyondthe offset maximum associated with the corresponding stream.<dt>[EINTR]<dd>The write operation was terminated due to thereceipt of a signal, and no data was transferred.<dt>[EIO]<dd>A physical I/O error has occurred, orthe process is a memberof a background process group attempting to write to itscontrolling terminal, TOSTOP is set, the process is neither ignoring norblocking SIGTTOU and the process group of the process isorphaned.This error may also be returned under implementation-dependent conditions.<dt>[ENOSPC]<dd>There was no free space remaining on the device containingthe file.<dt>[EPIPE]<dd>An attempt is made to write to a pipe or FIFO that is not openfor reading by any process.A SIGPIPE signal will also be sent to the thread.</dl><p>The<i>fputwc()</i>function may fail if:<dl compact><dt>[ENOMEM]<dd>Insufficient storage space is available.<dt>[ENXIO]<dd>A request was made of a non-existent device, or the request wasoutside the capabilities of the device.<dt>[EILSEQ]<dd>The wide-character code<i>wc</i>does not correspond to a valid character.</dl></blockquote><h4><a name = "tag_000_005_217"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_218"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_219"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_005_220"> </a>SEE ALSO</h4><blockquote><i><a href="ferror.html">ferror()</a></i>,<i><a href="fopen.html">fopen()</a></i>,<i><a href="setbuf.html">setbuf()</a></i>,<i><a href="ulimit.html">ulimit()</a></i>,<i><a href="stdio.h.html"><stdio.h></a></i>,<i><a href="wchar.h.html"><wchar.h></a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from the MSE working draft.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -