OSDN Git Service

(split) LDP_man-pages: update original to v3.34.
[linuxjm/LDP_man-pages.git] / original / man3 / btowc.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" References consulted:
9 .\"   GNU glibc-2 source code and manual
10 .\"   Dinkumware C library reference http://www.dinkumware.com/
11 .\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
12 .\"   ISO/IEC 9899:1999
13 .\"
14 .TH BTOWC 3 2011-09-22 "GNU" "Linux Programmer's Manual"
15 .SH NAME
16 btowc \- convert single byte to wide character
17 .SH SYNOPSIS
18 .nf
19 .B #include <wchar.h>
20 .sp
21 .BI "wint_t btowc(int " c );
22 .fi
23 .SH DESCRIPTION
24 The
25 .BR btowc ()
26 function converts \fIc\fP,
27 interpreted as a multibyte sequence
28 of length 1, starting in the initial shift state, to a wide character and
29 returns it.
30 If \fIc\fP is
31 .B EOF
32 or not a valid multibyte sequence of length 1,
33 the
34 .BR btowc ()
35 function returns
36 .BR WEOF .
37 .SH "RETURN VALUE"
38 The
39 .BR btowc ()
40 function returns the wide character
41 converted from the single byte \fIc\fP.
42 If \fIc\fP is
43 .B EOF
44 or not a valid multibyte sequence of length 1,
45 it returns
46 .BR WEOF .
47 .SH "CONFORMING TO"
48 C99, POSIX.1-2001.
49 .SH NOTES
50 The behavior of
51 .BR btowc ()
52 depends on the
53 .B LC_CTYPE
54 category of the
55 current locale.
56 .PP
57 This function should never be used.
58 It does not work for encodings which have
59 state, and unnecessarily treats single bytes differently from multibyte
60 sequences.
61 Use either
62 .BR mbtowc (3)
63 or the thread-safe
64 .BR mbrtowc (3)
65 instead.
66 .SH "SEE ALSO"
67 .BR mbtowc (3),
68 .BR mbrtowc (3),
69 .BR wctob (3)