mount_setattr.2: Minor tweaks to Christian's patch
[man-pages.git] / man3 / fputwc.3
blob2f947110c45950462e3359a678fdb1104083c09f
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
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.
8 .\" %%%LICENSE_END
9 .\"
10 .\" References consulted:
11 .\"   GNU glibc-2 source code and manual
12 .\"   Dinkumware C library reference http://www.dinkumware.com/
13 .\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
14 .\"   ISO/IEC 9899:1999
15 .\"
16 .TH FPUTWC 3  2021-03-22 "GNU" "Linux Programmer's Manual"
17 .SH NAME
18 fputwc, putwc \- write a wide character to a FILE stream
19 .SH SYNOPSIS
20 .nf
21 .B #include <stdio.h>
22 .B #include <wchar.h>
23 .PP
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
28 The
29 .BR fputwc ()
30 function is the wide-character
31 equivalent of the
32 .BR fputc (3)
33 function.
34 It writes the wide character \fIwc\fP to \fIstream\fP.
36 \fIferror(stream)\fP becomes true, it returns
37 .BR WEOF .
38 If a wide-character conversion error occurs,
39 it sets \fIerrno\fP to \fBEILSEQ\fP and returns
40 .BR WEOF .
41 Otherwise, it returns \fIwc\fP.
42 .PP
43 The
44 .BR putwc ()
45 function or macro functions identically to
46 .BR fputwc ().
47 It may be implemented as a macro, and may evaluate its argument
48 more than once.
49 There is no reason ever to use it.
50 .PP
51 For nonlocking counterparts, see
52 .BR unlocked_stdio (3).
53 .SH RETURN VALUE
54 On success,
55 .BR fputwc ()
56 function returns
57 .IR wc .
58 Otherwise,
59 .B WEOF
60 is returned, and
61 .I errno
62 is set to indicate the error.
63 .SH ERRORS
64 Apart from the usual ones, there is
65 .TP
66 .B EILSEQ
67 Conversion of \fIwc\fP to the stream's encoding fails.
68 .SH ATTRIBUTES
69 For an explanation of the terms used in this section, see
70 .BR attributes (7).
71 .ad l
72 .nh
73 .TS
74 allbox;
75 lbx lb lb
76 l l l.
77 Interface       Attribute       Value
79 .BR fputwc (),
80 .BR putwc ()
81 T}      Thread safety   MT-Safe
82 .TE
83 .hy
84 .ad
85 .sp 1
86 .SH CONFORMING TO
87 POSIX.1-2001, POSIX.1-2008, C99.
88 .SH NOTES
89 The behavior of
90 .BR fputwc ()
91 depends on the
92 .B LC_CTYPE
93 category of the
94 current locale.
95 .PP
96 In the absence of additional information passed to the
97 .BR fopen (3)
98 call, it is
99 reasonable to expect that
100 .BR fputwc ()
101 will actually write the multibyte
102 sequence corresponding to the wide character \fIwc\fP.
103 .SH SEE ALSO
104 .BR fgetwc (3),
105 .BR fputws (3),
106 .BR unlocked_stdio (3)