]>
Commit | Line | Data |
---|---|---|
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 | .\" |
4b8c67d9 | 15 | .TH WCWIDTH 3 2017-09-15 "GNU" "Linux Programmer's Manual" |
fea681da MK |
16 | .SH NAME |
17 | wcwidth \- 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 |
26 | The |
27 | .BR wcwidth () | |
28 | function returns the number of columns | |
e4a0d6cb MK |
29 | needed to represent the wide character |
30 | .IR c . | |
31 | If | |
32 | .I c | |
33 | is a printable wide character, the value | |
1c44bd5b | 34 | is at least 0. |
e4a0d6cb MK |
35 | If |
36 | .I c | |
37 | is null wide character (L\(aq\\0\(aq), the value is 0. | |
2b9b829d | 38 | Otherwise, \-1 is returned. |
47297adb | 39 | .SH RETURN VALUE |
60a90ecd MK |
40 | The |
41 | .BR wcwidth () | |
42 | function returns the number of | |
e4a0d6cb MK |
43 | column positions for |
44 | .IR c . | |
b2e49efd | 45 | .SH ATTRIBUTES |
d3f9c010 PH |
46 | For an explanation of the terms used in this section, see |
47 | .BR attributes (7). | |
48 | .TS | |
49 | allbox; | |
50 | lb lb lb | |
51 | l l l. | |
52 | Interface Attribute Value | |
53 | T{ | |
b2e49efd | 54 | .BR wcwidth () |
d3f9c010 PH |
55 | T} Thread safety MT-Safe locale |
56 | .TE | |
47297adb | 57 | .SH CONFORMING TO |
19bf752c | 58 | POSIX.1-2001, POSIX.1-2008. |
847e0d88 | 59 | .PP |
fea681da | 60 | Note 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 | 66 | The behavior of |
60a90ecd | 67 | .BR wcwidth () |
1274071a MK |
68 | depends on the |
69 | .B LC_CTYPE | |
70 | category of the | |
fea681da | 71 | current locale. |
47297adb | 72 | .SH SEE ALSO |
0a90178c | 73 | .BR iswprint (3), |
0a4f8b7b | 74 | .BR wcswidth (3) |