📄 fputwc.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title>fputwc</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="fputwc"></a> <a name="tag_03_183"></a><!-- fputwc --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright © 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_03_183_01"></a>NAME</h4><blockquote>fputwc - put a wide-character code on a stream</blockquote><h4><a name="tag_03_183_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><p><code><tt>#include <<a href="../basedefs/stdio.h.html">stdio.h</a>><br> #include <<a href="../basedefs/wchar.h.html">wchar.h</a>><br><br> wint_t fputwc(wchar_t</tt> <i>wc</i><tt>, FILE *</tt><i>stream</i><tt>);<br></tt></code></p></blockquote><h4><a name="tag_03_183_03"></a>DESCRIPTION</h4><blockquote><div class="box"><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]"border="0"> The functionality described on this reference page is aligned with the ISO C standard. Any conflict between therequirements described here and the ISO C standard is unintentional. This volume of IEEE Std 1003.1-2001 defers tothe ISO C standard. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></div><p>The <i>fputwc</i>() function shall write the character corresponding to the wide-character code <i>wc</i> to the output streampointed to by <i>stream</i>, at the position indicated by the associated file-position indicator for the stream (if defined), andadvances the indicator appropriately. If the file cannot support positioning requests, or if the stream was opened with appendmode, the character is appended to the output stream. If an error occurs while writing the character, the shift state of the outputfile is left in an undefined state.</p><p><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> The<i>st_ctime</i> and <i>st_mtime</i> fields of the file shall be marked for update between the successful execution of<i>fputwc</i>() and the next successful completion of a call to <a href="../functions/fflush.html"><i>fflush</i>()</a> or <a href="../functions/fclose.html"><i>fclose</i>()</a> on the same stream or a call to <a href="../functions/exit.html"><i>exit</i>()</a>or <a href="../functions/abort.html"><i>abort</i>()</a>. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p></blockquote><h4><a name="tag_03_183_04"></a>RETURN VALUE</h4><blockquote><p>Upon successful completion, <i>fputwc</i>() shall return <i>wc</i>. Otherwise, it shall return WEOF, the error indicator for thestream shall be set, <sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> and <i>errno</i> shall be set to indicate the error. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p></blockquote><h4><a name="tag_03_183_05"></a>ERRORS</h4><blockquote><p>The <i>fputwc</i>() function shall fail if either the stream is unbuffered or data in the <i>stream</i>'s buffer needs to bewritten, and:</p><dl compact><dt>[EAGAIN]</dt><dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">The O_NONBLOCK flag is set for the file descriptor underlying <i>stream</i> and the process would be delayed in the writeoperation. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt>[EBADF]</dt><dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">The file descriptor underlying <i>stream</i> is not a valid file descriptor open for writing. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt>[EFBIG]</dt><dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> Anattempt was made to write to a file that exceeds the maximum file size or the process' file size limit. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt>[EFBIG]</dt><dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the correspondingstream. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt>[EILSEQ]</dt><dd>The wide-character code <i>wc</i> does not correspond to a valid character.</dd><dt>[EINTR]</dt><dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">The write operation was terminated due to the receipt of a signal, and no data was transferred. <img src="../images/opt-end.gif"alt="[Option End]" border="0"></dd><dt>[EIO]</dt><dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> Aphysical I/O error has occurred, or the process is a member of a background process group attempting to write to its controllingterminal, TOSTOP is set, the process is neither ignoring nor blocking SIGTTOU, and the process group of the process is orphaned.This error may also be returned under implementation-defined conditions. <img src="../images/opt-end.gif" alt="[Option End]"border="0"></dd><dt>[ENOSPC]</dt><dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">There was no free space remaining on the device containing the file. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt>[EPIPE]</dt><dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> Anattempt is made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal shall also be sent to thethread. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd></dl><p>The <i>fputwc</i>() function may fail if:</p><dl compact><dt>[ENOMEM]</dt><dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Insufficient storage space is available. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt>[ENXIO]</dt><dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> Arequest was made of a nonexistent device, or the request was outside the capabilities of the device. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd></dl></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_03_183_06"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_183_07"></a>APPLICATION USAGE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_183_08"></a>RATIONALE</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_183_09"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_183_10"></a>SEE ALSO</h4><blockquote><p><a href="ferror.html"><i>ferror</i>()</a> , <a href="fopen.html"><i>fopen</i>()</a> , <a href="setbuf.html"><i>setbuf</i>()</a>, <a href="ulimit.html"><i>ulimit</i>()</a> , the Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/stdio.h.html"><i><stdio.h></i></a>, <a href="../basedefs/wchar.h.html"><i><wchar.h></i></a></p></blockquote><h4><a name="tag_03_183_11"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 4. Derived from the MSE working draft.</p></blockquote><h4><a name="tag_03_183_12"></a>Issue 5</h4><blockquote><p>Aligned with ISO/IEC 9899:1990/Amendment 1:1995 (E). Specifically, the type of argument <i>wc</i> is changed from<b>wint_t</b> to <b>wchar_t</b>.</p><p>The Optional Header (OH) marking is removed from <a href="../basedefs/stdio.h.html"><i><stdio.h></i></a>.</p><p>Large File Summit extensions are added.</p></blockquote><h4><a name="tag_03_183_13"></a>Issue 6</h4><blockquote><p>Extensions beyond the ISO C standard are marked.</p><p>The following new requirements on POSIX implementations derive from alignment with the Single UNIX Specification:</p><ul><li><p>The [EFBIG] and [EIO] mandatory error conditions are added.</p></li><li><p>The [ENOMEM] and [ENXIO] optional error conditions are added.</p></li></ul></blockquote><div class="box"><em>End of informative text.</em></div><hr><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX ® is a registered Trademark of The Open Group.<br>POSIX ® is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -