OSDN Git Service

9d33cbb901a03f1904420d593ab0d92160e7a2e3
[linuxjm/LDP_man-pages.git] / original / 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  2011-09-28 "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 .sp
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 \fIc\fP.
30 If \fIc\fP is a printable wide character, the value
31 is at least 0.
32 If \fIc\fP is null wide character (L\(aq\\0\(aq), the value is 0.
33 Otherwise \-1 is returned.
34 .SH RETURN VALUE
35 The
36 .BR wcwidth ()
37 function returns the number of
38 column positions for \fIc\fP.
39 .SH CONFORMING TO
40 POSIX.1-2001.
41
42 Note that glibc before 2.2.5 used the prototype
43 .br
44 .nf
45 .BI "int wcwidth(wint_t " c );
46 .fi
47 .SH NOTES
48 The behavior of
49 .BR wcwidth ()
50 depends on the
51 .B LC_CTYPE
52 category of the
53 current locale.
54 .SH SEE ALSO
55 .BR iswprint (3),
56 .BR wcswidth (3)