tzfile.5, tzselect.8: sync from tzdb upstream
[man-pages.git] / man3 / wcwidth.3
blob31452654fc4d6fef00a3bde9e46cdcf32db8c83b
1 '\" t
2 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
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 (date) "Linux man-pages (unreleased)"
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 .PP
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 .
31 .I c
32 is a printable wide character, the value
33 is at least 0.
35 .I c
36 is null wide character (L\[aq]\e0\[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 .ad l
48 .nh
49 .TS
50 allbox;
51 lbx lb lb
52 l l l.
53 Interface       Attribute       Value
55 .BR wcwidth ()
56 T}      Thread safety   MT-Safe locale
57 .TE
58 .hy
59 .ad
60 .sp 1
61 .SH STANDARDS
62 POSIX.1-2001, POSIX.1-2008.
63 .PP
64 Note that before glibc 2.2.5, glibc used the prototype
65 .PP
66 .nf
67 .BI "int wcwidth(wint_t " c );
68 .fi
69 .SH NOTES
70 The behavior of
71 .BR wcwidth ()
72 depends on the
73 .B LC_CTYPE
74 category of the
75 current locale.
76 .SH SEE ALSO
77 .BR iswprint (3),
78 .BR wcswidth (3)