]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) Bruno Haible <haible@clisp.cons.org> |
2 | .\" | |
e4a74ca8 | 3 | .\" SPDX-License-Identifier: GPL-2.0-or-later |
fea681da MK |
4 | .\" |
5 | .\" References consulted: | |
6 | .\" GNU glibc-2 source code and manual | |
7 | .\" Dinkumware C library reference http://www.dinkumware.com/ | |
008f1ecc | 8 | .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html |
fea681da MK |
9 | .\" ISO/IEC 9899:1999 |
10 | .\" | |
4c1c5274 | 11 | .TH fputwc 3 (date) "Linux man-pages (unreleased)" |
fea681da | 12 | .SH NAME |
a4c0544d | 13 | fputwc, putwc \- write a wide character to a FILE stream |
cfba38f4 AC |
14 | .SH LIBRARY |
15 | Standard C library | |
16 | .RI ( libc ", " \-lc ) | |
fea681da MK |
17 | .SH SYNOPSIS |
18 | .nf | |
19 | .B #include <stdio.h> | |
fea681da | 20 | .B #include <wchar.h> |
68e4db0a | 21 | .PP |
fea681da MK |
22 | .BI "wint_t fputwc(wchar_t " wc ", FILE *" stream ); |
23 | .BI "wint_t putwc(wchar_t " wc ", FILE *" stream ); | |
24 | .fi | |
25 | .SH DESCRIPTION | |
60a90ecd MK |
26 | The |
27 | .BR fputwc () | |
28 | function is the wide-character | |
29 | equivalent of the | |
a4c0544d | 30 | .BR fputc (3) |
60a90ecd | 31 | function. |
c13182ef MK |
32 | It writes the wide character \fIwc\fP to \fIstream\fP. |
33 | If | |
cab87712 MK |
34 | \fIferror(stream)\fP becomes true, it returns |
35 | .BR WEOF . | |
d0f17b57 | 36 | If a wide-character conversion error occurs, |
cab87712 MK |
37 | it sets \fIerrno\fP to \fBEILSEQ\fP and returns |
38 | .BR WEOF . | |
2b9b829d | 39 | Otherwise, it returns \fIwc\fP. |
fea681da | 40 | .PP |
60a90ecd MK |
41 | The |
42 | .BR putwc () | |
43 | function or macro functions identically to | |
44 | .BR fputwc (). | |
fea681da | 45 | It may be implemented as a macro, and may evaluate its argument |
c13182ef MK |
46 | more than once. |
47 | There is no reason ever to use it. | |
fea681da | 48 | .PP |
24b74457 | 49 | For nonlocking counterparts, see |
fea681da | 50 | .BR unlocked_stdio (3). |
47297adb | 51 | .SH RETURN VALUE |
cb6a894e | 52 | On success, |
60a90ecd | 53 | .BR fputwc () |
cb6a894e MK |
54 | function returns |
55 | .IR wc . | |
56 | Otherwise, | |
cab87712 | 57 | .B WEOF |
cb6a894e | 58 | is returned, and |
1726c2f9 | 59 | .I errno |
cb6a894e | 60 | is set to indicate the error. |
fea681da MK |
61 | .SH ERRORS |
62 | Apart from the usual ones, there is | |
63 | .TP | |
64 | .B EILSEQ | |
65 | Conversion of \fIwc\fP to the stream's encoding fails. | |
83613756 MS |
66 | .SH ATTRIBUTES |
67 | For an explanation of the terms used in this section, see | |
68 | .BR attributes (7). | |
c466875e MK |
69 | .ad l |
70 | .nh | |
83613756 MS |
71 | .TS |
72 | allbox; | |
c466875e | 73 | lbx lb lb |
83613756 MS |
74 | l l l. |
75 | Interface Attribute Value | |
76 | T{ | |
77 | .BR fputwc (), | |
78 | .BR putwc () | |
79 | T} Thread safety MT-Safe | |
80 | .TE | |
c466875e MK |
81 | .hy |
82 | .ad | |
847e0d88 | 83 | .sp 1 |
3113c7f3 | 84 | .SH STANDARDS |
5de8b616 | 85 | POSIX.1-2001, POSIX.1-2008, C99. |
fea681da | 86 | .SH NOTES |
d9bfdb9c | 87 | The behavior of |
60a90ecd | 88 | .BR fputwc () |
1274071a MK |
89 | depends on the |
90 | .B LC_CTYPE | |
91 | category of the | |
fea681da MK |
92 | current locale. |
93 | .PP | |
c13182ef | 94 | In the absence of additional information passed to the |
fb186734 | 95 | .BR fopen (3) |
1e321034 | 96 | call, it is |
60a90ecd MK |
97 | reasonable to expect that |
98 | .BR fputwc () | |
99 | will actually write the multibyte | |
fea681da | 100 | sequence corresponding to the wide character \fIwc\fP. |
47297adb | 101 | .SH SEE ALSO |
fea681da MK |
102 | .BR fgetwc (3), |
103 | .BR fputws (3), | |
104 | .BR unlocked_stdio (3) |