mount_setattr.2: Minor tweaks to Christian's patch
[man-pages.git] / man3 / wcwidth.3
blob7e2f11c6b6b86f29e4cf8de7aa44def0a0a42c43
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
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.
8 .\" %%%LICENSE_END
9 .\"
10 .\" References consulted:
11 .\"   GNU glibc-2 source code and manual
12 .\"   Dinkumware C library reference http://www.dinkumware.com/
13 .\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
14 .\"
15 .TH WCWIDTH 3  2021-03-22 "GNU" "Linux Programmer's Manual"
16 .SH NAME
17 wcwidth \- determine columns needed for a wide character
18 .SH SYNOPSIS
19 .nf
20 .BR "#define _XOPEN_SOURCE" "       /* See feature_test_macros(7) */"
21 .B #include <wchar.h>
22 .PP
23 .BI "int wcwidth(wchar_t " c );
24 .fi
25 .SH DESCRIPTION
26 The
27 .BR wcwidth ()
28 function returns the number of columns
29 needed to represent the wide character
30 .IR c .
32 .I c
33 is a printable wide character, the value
34 is at least 0.
36 .I c
37 is null wide character (L\(aq\e0\(aq), the value is 0.
38 Otherwise, \-1 is returned.
39 .SH RETURN VALUE
40 The
41 .BR wcwidth ()
42 function returns the number of
43 column positions for
44 .IR c .
45 .SH ATTRIBUTES
46 For an explanation of the terms used in this section, see
47 .BR attributes (7).
48 .ad l
49 .nh
50 .TS
51 allbox;
52 lbx lb lb
53 l l l.
54 Interface       Attribute       Value
56 .BR wcwidth ()
57 T}      Thread safety   MT-Safe locale
58 .TE
59 .hy
60 .ad
61 .sp 1
62 .SH CONFORMING TO
63 POSIX.1-2001, POSIX.1-2008.
64 .PP
65 Note that glibc before 2.2.5 used the prototype
66 .PP
67 .nf
68 .BI "int wcwidth(wint_t " c );
69 .fi
70 .SH NOTES
71 The behavior of
72 .BR wcwidth ()
73 depends on the
74 .B LC_CTYPE
75 category of the
76 current locale.
77 .SH SEE ALSO
78 .BR iswprint (3),
79 .BR wcswidth (3)