]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/wcwidth.3
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man3 / wcwidth.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
4 .\"
5 .\" References consulted:
6 .\" GNU glibc-2 source code and manual
7 .\" Dinkumware C library reference http://www.dinkumware.com/
8 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
9 .\"
10 .TH wcwidth 3 (date) "Linux man-pages (unreleased)"
11 .SH NAME
12 wcwidth \- determine columns needed for a wide character
13 .SH LIBRARY
14 Standard C library
15 .RI ( libc ", " \-lc )
16 .SH SYNOPSIS
17 .nf
18 .BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
19 .B #include <wchar.h>
20 .PP
21 .BI "int wcwidth(wchar_t " c );
22 .fi
23 .SH DESCRIPTION
24 The
25 .BR wcwidth ()
26 function returns the number of columns
27 needed to represent the wide character
28 .IR c .
29 If
30 .I c
31 is a printable wide character, the value
32 is at least 0.
33 If
34 .I c
35 is null wide character (L\(aq\e0\(aq), the value is 0.
36 Otherwise, \-1 is returned.
37 .SH RETURN VALUE
38 The
39 .BR wcwidth ()
40 function returns the number of
41 column positions for
42 .IR c .
43 .SH ATTRIBUTES
44 For an explanation of the terms used in this section, see
45 .BR attributes (7).
46 .ad l
47 .nh
48 .TS
49 allbox;
50 lbx lb lb
51 l l l.
52 Interface Attribute Value
53 T{
54 .BR wcwidth ()
55 T} Thread safety MT-Safe locale
56 .TE
57 .hy
58 .ad
59 .sp 1
60 .SH STANDARDS
61 POSIX.1-2001, POSIX.1-2008.
62 .PP
63 Note that glibc before 2.2.5 used the prototype
64 .PP
65 .nf
66 .BI "int wcwidth(wint_t " c );
67 .fi
68 .SH NOTES
69 The behavior of
70 .BR wcwidth ()
71 depends on the
72 .B LC_CTYPE
73 category of the
74 current locale.
75 .SH SEE ALSO
76 .BR iswprint (3),
77 .BR wcswidth (3)