]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/fputwc.3
getopt.3: ffix
[thirdparty/man-pages.git] / man3 / fputwc.3
CommitLineData
fea681da
MK
1.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2.\"
89e3ffe9 3.\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
fea681da
MK
4.\" This is free documentation; you can redistribute it and/or
5.\" modify it under the terms of the GNU General Public License as
6.\" published by the Free Software Foundation; either version 2 of
7.\" the License, or (at your option) any later version.
fe382ebf 8.\" %%%LICENSE_END
fea681da
MK
9.\"
10.\" References consulted:
11.\" GNU glibc-2 source code and manual
12.\" Dinkumware C library reference http://www.dinkumware.com/
008f1ecc 13.\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
fea681da
MK
14.\" ISO/IEC 9899:1999
15.\"
4b8c67d9 16.TH FPUTWC 3 2017-09-15 "GNU" "Linux Programmer's Manual"
fea681da 17.SH NAME
a4c0544d 18fputwc, putwc \- write a wide character to a FILE stream
fea681da
MK
19.SH SYNOPSIS
20.nf
21.B #include <stdio.h>
fea681da 22.B #include <wchar.h>
68e4db0a 23.PP
fea681da
MK
24.BI "wint_t fputwc(wchar_t " wc ", FILE *" stream );
25.BI "wint_t putwc(wchar_t " wc ", FILE *" stream );
26.fi
27.SH DESCRIPTION
60a90ecd
MK
28The
29.BR fputwc ()
30function is the wide-character
31equivalent of the
a4c0544d 32.BR fputc (3)
60a90ecd 33function.
c13182ef
MK
34It writes the wide character \fIwc\fP to \fIstream\fP.
35If
cab87712
MK
36\fIferror(stream)\fP becomes true, it returns
37.BR WEOF .
d0f17b57 38If a wide-character conversion error occurs,
cab87712
MK
39it sets \fIerrno\fP to \fBEILSEQ\fP and returns
40.BR WEOF .
2b9b829d 41Otherwise, it returns \fIwc\fP.
fea681da 42.PP
60a90ecd
MK
43The
44.BR putwc ()
45function or macro functions identically to
46.BR fputwc ().
fea681da 47It may be implemented as a macro, and may evaluate its argument
c13182ef
MK
48more than once.
49There is no reason ever to use it.
fea681da 50.PP
24b74457 51For nonlocking counterparts, see
fea681da 52.BR unlocked_stdio (3).
47297adb 53.SH RETURN VALUE
60a90ecd
MK
54The
55.BR fputwc ()
cab87712
MK
56function returns \fIwc\fP if no error occurred, or
57.B WEOF
58to indicate an error.
1726c2f9
MK
59In the event of an error,
60.I errno
61is set to indicate the cause.
fea681da
MK
62.SH ERRORS
63Apart from the usual ones, there is
64.TP
65.B EILSEQ
66Conversion of \fIwc\fP to the stream's encoding fails.
83613756
MS
67.SH ATTRIBUTES
68For an explanation of the terms used in this section, see
69.BR attributes (7).
70.TS
71allbox;
72lbw17 lb lb
73l l l.
74Interface Attribute Value
75T{
76.BR fputwc (),
77.BR putwc ()
78T} Thread safety MT-Safe
79.TE
847e0d88 80.sp 1
47297adb 81.SH CONFORMING TO
5de8b616 82POSIX.1-2001, POSIX.1-2008, C99.
fea681da 83.SH NOTES
d9bfdb9c 84The behavior of
60a90ecd 85.BR fputwc ()
1274071a
MK
86depends on the
87.B LC_CTYPE
88category of the
fea681da
MK
89current locale.
90.PP
c13182ef 91In the absence of additional information passed to the
fb186734 92.BR fopen (3)
1e321034 93call, it is
60a90ecd
MK
94reasonable to expect that
95.BR fputwc ()
96will actually write the multibyte
fea681da 97sequence corresponding to the wide character \fIwc\fP.
47297adb 98.SH SEE ALSO
fea681da
MK
99.BR fgetwc (3),
100.BR fputws (3),
101.BR unlocked_stdio (3)