]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/wcwidth.3
isatty.3: Most non-tty files nowadays result in the error ENOTTY
[thirdparty/man-pages.git] / man3 / wcwidth.3
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 2017-09-15 "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 .
31 If
32 .I c
33 is a printable wide character, the value
34 is at least 0.
35 If
36 .I c
37 is null wide character (L\(aq\\0\(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 .TS
49 allbox;
50 lb 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 .SH CONFORMING TO
58 POSIX.1-2001, POSIX.1-2008.
59 .PP
60 Note that glibc before 2.2.5 used the prototype
61 .PP
62 .nf
63 .BI "int wcwidth(wint_t " c );
64 .fi
65 .SH NOTES
66 The behavior of
67 .BR wcwidth ()
68 depends on the
69 .B LC_CTYPE
70 category of the
71 current locale.
72 .SH SEE ALSO
73 .BR iswprint (3),
74 .BR wcswidth (3)