Debian Codegraph @

upstream/debian-trixie/man3/wcwidth.3

raw
1 '\" t
2 .\" Copyright (c) Bruno Haible <[email protected]>
3 .\"
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\"
6 .\" References consulted:
7 .\" GNU glibc-2 source code and manual
8 .\" Dinkumware C library reference http://www.dinkumware.com/
9 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
10 .\"
11 .TH wcwidth 3 2024-06-15 "Linux man-pages 6.9.1"
12 .SH NAME
13 wcwidth \- determine columns needed for a wide character
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ", " \-lc )
17 .SH SYNOPSIS
18 .nf
19 .BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
20 .B #include <wchar.h>
21 .P
22 .BI "int wcwidth(wchar_t " c );
23 .fi
24 .SH DESCRIPTION
25 The
26 .BR wcwidth ()
27 function returns the number of columns
28 needed to represent the wide character
29 .IR c .
30 If
31 .I c
32 is a printable wide character, the value
33 is at least 0.
34 If
35 .I c
36 is null wide character (L\[aq]\[rs]0\[aq]), the value is 0.
37 Otherwise, \-1 is returned.
38 .SH RETURN VALUE
39 The
40 .BR wcwidth ()
41 function returns the number of
42 column positions for
43 .IR c .
44 .SH ATTRIBUTES
45 For an explanation of the terms used in this section, see
46 .BR attributes (7).
47 .TS
48 allbox;
49 lbx lb lb
50 l l l.
51 Interface Attribute Value
52 T{
53 .na
54 .nh
55 .BR wcwidth ()
56 T} Thread safety MT-Safe locale
57 .TE
58 .SH STANDARDS
59 POSIX.1-2008.
60 .SH HISTORY
61 POSIX.1-2001.
62 .P
63 Note that before glibc 2.2.5, glibc used the prototype
64 .P
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)