]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/btowc.3
_exit.2, bpf.2, cacheflush.2, capget.2, chdir.2, chmod.2, chroot.2, clock_getres...
[thirdparty/man-pages.git] / man3 / btowc.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.\"
460495ca 16.TH BTOWC 3 2015-08-08 "GNU" "Linux Programmer's Manual"
fea681da
MK
17.SH NAME
18btowc \- convert single byte to wide character
19.SH SYNOPSIS
20.nf
21.B #include <wchar.h>
68e4db0a 22.PP
fea681da
MK
23.BI "wint_t btowc(int " c );
24.fi
25.SH DESCRIPTION
60a90ecd
MK
26The
27.BR btowc ()
28function converts \fIc\fP,
c13182ef 29interpreted as a multibyte sequence
fea681da 30of length 1, starting in the initial shift state, to a wide character and
c13182ef 31returns it.
cab87712
MK
32If \fIc\fP is
33.B EOF
34or not a valid multibyte sequence of length 1,
60a90ecd
MK
35the
36.BR btowc ()
cab87712
MK
37function returns
38.BR WEOF .
47297adb 39.SH RETURN VALUE
60a90ecd
MK
40The
41.BR btowc ()
42function returns the wide character
c13182ef 43converted from the single byte \fIc\fP.
cab87712
MK
44If \fIc\fP is
45.B EOF
46or not a valid multibyte sequence of length 1,
47it returns
48.BR WEOF .
8b35b7c8
MS
49.SH ATTRIBUTES
50For an explanation of the terms used in this section, see
51.BR attributes (7).
52.TS
53allbox;
54lb lb lb
55l l l.
56Interface Attribute Value
57T{
58.BR btowc ()
59T} Thread safety MT-Safe
60.TE
47297adb 61.SH CONFORMING TO
7d746fdb 62POSIX.1-2001, POSIX.1-2008, C99.
fea681da 63.SH NOTES
d9bfdb9c 64The behavior of
60a90ecd 65.BR btowc ()
1274071a
MK
66depends on the
67.B LC_CTYPE
68category of the
fea681da
MK
69current locale.
70.PP
c13182ef
MK
71This function should never be used.
72It does not work for encodings which have
fea681da 73state, and unnecessarily treats single bytes differently from multibyte
c13182ef 74sequences.
da8a154e
MK
75Use either
76.BR mbtowc (3)
77or the thread-safe
78.BR mbrtowc (3)
60a90ecd 79instead.
47297adb 80.SH SEE ALSO
da8a154e 81.BR mbrtowc (3),
2bfa8272 82.BR mbtowc (3),
3e5c319e 83.BR wctob (3)