]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) Bruno Haible <haible@clisp.cons.org> |
2 | .\" | |
e4a74ca8 | 3 | .\" SPDX-License-Identifier: GPL-2.0-or-later |
fea681da MK |
4 | .\" |
5 | .\" References consulted: | |
6 | .\" GNU glibc-2 source code and manual | |
7 | .\" Dinkumware C library reference http://www.dinkumware.com/ | |
008f1ecc | 8 | .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html |
fea681da | 9 | .\" |
45186a5d | 10 | .TH WCWIDTH 3 2021-03-22 "Linux "Linux man-pages (unreleased)" |
fea681da MK |
11 | .SH NAME |
12 | wcwidth \- determine columns needed for a wide character | |
e37caa91 AC |
13 | .SH LIBRARY |
14 | Standard C library | |
8fc3b2cf | 15 | .RI ( libc ", " \-lc ) |
fea681da MK |
16 | .SH SYNOPSIS |
17 | .nf | |
b80f966b | 18 | .BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */" |
fea681da | 19 | .B #include <wchar.h> |
68e4db0a | 20 | .PP |
fea681da MK |
21 | .BI "int wcwidth(wchar_t " c ); |
22 | .fi | |
23 | .SH DESCRIPTION | |
60a90ecd MK |
24 | The |
25 | .BR wcwidth () | |
26 | function returns the number of columns | |
e4a0d6cb MK |
27 | needed to represent the wide character |
28 | .IR c . | |
29 | If | |
30 | .I c | |
31 | is a printable wide character, the value | |
1c44bd5b | 32 | is at least 0. |
e4a0d6cb MK |
33 | If |
34 | .I c | |
d1a71985 | 35 | is null wide character (L\(aq\e0\(aq), the value is 0. |
2b9b829d | 36 | Otherwise, \-1 is returned. |
47297adb | 37 | .SH RETURN VALUE |
60a90ecd MK |
38 | The |
39 | .BR wcwidth () | |
40 | function returns the number of | |
e4a0d6cb MK |
41 | column positions for |
42 | .IR c . | |
b2e49efd | 43 | .SH ATTRIBUTES |
d3f9c010 PH |
44 | For an explanation of the terms used in this section, see |
45 | .BR attributes (7). | |
c466875e MK |
46 | .ad l |
47 | .nh | |
d3f9c010 PH |
48 | .TS |
49 | allbox; | |
c466875e | 50 | lbx lb lb |
d3f9c010 PH |
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 | |
c466875e MK |
57 | .hy |
58 | .ad | |
59 | .sp 1 | |
3113c7f3 | 60 | .SH STANDARDS |
19bf752c | 61 | POSIX.1-2001, POSIX.1-2008. |
847e0d88 | 62 | .PP |
fea681da | 63 | Note that glibc before 2.2.5 used the prototype |
a2b7a144 | 64 | .PP |
fea681da MK |
65 | .nf |
66 | .BI "int wcwidth(wint_t " c ); | |
67 | .fi | |
fea681da | 68 | .SH NOTES |
d9bfdb9c | 69 | The behavior of |
60a90ecd | 70 | .BR wcwidth () |
1274071a MK |
71 | depends on the |
72 | .B LC_CTYPE | |
73 | category of the | |
fea681da | 74 | current locale. |
47297adb | 75 | .SH SEE ALSO |
0a90178c | 76 | .BR iswprint (3), |
0a4f8b7b | 77 | .BR wcswidth (3) |