]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/wcwidth.3
tsearch.3: Minor tweak to Florian's patch
[thirdparty/man-pages.git] / man3 / wcwidth.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 14.\"
9ba01802 15.TH WCWIDTH 3 2019-03-06 "GNU" "Linux Programmer's Manual"
fea681da
MK
16.SH NAME
17wcwidth \- determine columns needed for a wide character
18.SH SYNOPSIS
19.nf
b80f966b 20.BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
fea681da 21.B #include <wchar.h>
68e4db0a 22.PP
fea681da
MK
23.BI "int wcwidth(wchar_t " c );
24.fi
25.SH DESCRIPTION
60a90ecd
MK
26The
27.BR wcwidth ()
28function returns the number of columns
e4a0d6cb
MK
29needed to represent the wide character
30.IR c .
31If
32.I c
33is a printable wide character, the value
1c44bd5b 34is at least 0.
e4a0d6cb
MK
35If
36.I c
d1a71985 37is null wide character (L\(aq\e0\(aq), the value is 0.
2b9b829d 38Otherwise, \-1 is returned.
47297adb 39.SH RETURN VALUE
60a90ecd
MK
40The
41.BR wcwidth ()
42function returns the number of
e4a0d6cb
MK
43column positions for
44.IR c .
b2e49efd 45.SH ATTRIBUTES
d3f9c010
PH
46For an explanation of the terms used in this section, see
47.BR attributes (7).
48.TS
49allbox;
50lb lb lb
51l l l.
52Interface Attribute Value
53T{
b2e49efd 54.BR wcwidth ()
d3f9c010
PH
55T} Thread safety MT-Safe locale
56.TE
47297adb 57.SH CONFORMING TO
19bf752c 58POSIX.1-2001, POSIX.1-2008.
847e0d88 59.PP
fea681da 60Note that glibc before 2.2.5 used the prototype
a2b7a144 61.PP
fea681da
MK
62.nf
63.BI "int wcwidth(wint_t " c );
64.fi
fea681da 65.SH NOTES
d9bfdb9c 66The behavior of
60a90ecd 67.BR wcwidth ()
1274071a
MK
68depends on the
69.B LC_CTYPE
70category of the
fea681da 71current locale.
47297adb 72.SH SEE ALSO
0a90178c 73.BR iswprint (3),
0a4f8b7b 74.BR wcswidth (3)