]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/fputwc.3
err.3: EXAMPLES: use EXIT_FAILURE rather than 1 as exit status
[thirdparty/man-pages.git] / man3 / fputwc.3
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 2017-09-15 "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.
35 If
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 The
55 .BR fputwc ()
56 function returns \fIwc\fP if no error occurred, or
57 .B WEOF
58 to indicate an error.
59 In the event of an error,
60 .I errno
61 is set to indicate the cause.
62 .SH ERRORS
63 Apart from the usual ones, there is
64 .TP
65 .B EILSEQ
66 Conversion of \fIwc\fP to the stream's encoding fails.
67 .SH ATTRIBUTES
68 For an explanation of the terms used in this section, see
69 .BR attributes (7).
70 .TS
71 allbox;
72 lbw17 lb lb
73 l l l.
74 Interface Attribute Value
75 T{
76 .BR fputwc (),
77 .BR putwc ()
78 T} Thread safety MT-Safe
79 .TE
80 .sp 1
81 .SH CONFORMING TO
82 POSIX.1-2001, POSIX.1-2008, C99.
83 .SH NOTES
84 The behavior of
85 .BR fputwc ()
86 depends on the
87 .B LC_CTYPE
88 category of the
89 current locale.
90 .PP
91 In the absence of additional information passed to the
92 .BR fopen (3)
93 call, it is
94 reasonable to expect that
95 .BR fputwc ()
96 will actually write the multibyte
97 sequence corresponding to the wide character \fIwc\fP.
98 .SH SEE ALSO
99 .BR fgetwc (3),
100 .BR fputws (3),
101 .BR unlocked_stdio (3)