1FPUTWC(3)                  Linux Programmer's Manual                 FPUTWC(3)
2
3
4

NAME

6       fputwc, putwc - write a wide character to a FILE stream
7

SYNOPSIS

9       #include <stdio.h>
10       #include <wchar.h>
11
12       wint_t fputwc(wchar_t wc, FILE *stream);
13       wint_t putwc(wchar_t wc, FILE *stream);
14

DESCRIPTION

16       The  fputwc() function is the wide-character equivalent of the fputc(3)
17       function.  It  writes  the  wide  character  wc  to  stream.   If  fer‐
18       ror(stream) becomes true, it returns WEOF.  If a wide-character conver‐
19       sion error occurs, it sets errno to EILSEQ and  returns  WEOF.   Other‐
20       wise, it returns wc.
21
22       The  putwc()  function  or macro functions identically to fputwc().  It
23       may be implemented as a macro, and may evaluate its argument more  than
24       once.  There is no reason ever to use it.
25
26       For nonlocking counterparts, see unlocked_stdio(3).
27

RETURN VALUE

29       On success, fputwc() function returns wc.  Otherwise, WEOF is returned,
30       and errno is set to indicate the error.
31

ERRORS

33       Apart from the usual ones, there is
34
35       EILSEQ Conversion of wc to the stream's encoding fails.
36

ATTRIBUTES

38       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
39       tributes(7).
40
41       ┌────────────────────────────────────────────┬───────────────┬─────────┐
42Interface                                   Attribute     Value   
43       ├────────────────────────────────────────────┼───────────────┼─────────┤
44fputwc(), putwc()                           │ Thread safety │ MT-Safe │
45       └────────────────────────────────────────────┴───────────────┴─────────┘
46

CONFORMING TO

48       POSIX.1-2001, POSIX.1-2008, C99.
49

NOTES

51       The  behavior  of fputwc() depends on the LC_CTYPE category of the cur‐
52       rent locale.
53
54       In the absence of additional information passed to the  fopen(3)  call,
55       it is reasonable to expect that fputwc() will actually write the multi‐
56       byte sequence corresponding to the wide character wc.
57

SEE ALSO

59       fgetwc(3), fputws(3), unlocked_stdio(3)
60

COLOPHON

62       This page is part of release 5.13 of the Linux  man-pages  project.   A
63       description  of  the project, information about reporting bugs, and the
64       latest    version    of    this    page,    can     be     found     at
65       https://www.kernel.org/doc/man-pages/.
66
67
68
69GNU                               2021-03-22                         FPUTWC(3)
Impressum