]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/wcswidth.3
intro.1, time.1, accept.2, bind.2, connect.2, execve.2, flock.2, getdents.2, getprior...
[thirdparty/man-pages.git] / man3 / wcswidth.3
CommitLineData
fea681da
MK
1.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2.\"
3.\" This is free documentation; you can redistribute it and/or
4.\" modify it under the terms of the GNU General Public License as
5.\" published by the Free Software Foundation; either version 2 of
6.\" the License, or (at your option) any later version.
7.\"
8.\" References consulted:
9.\" GNU glibc-2 source code and manual
10.\" Dinkumware C library reference http://www.dinkumware.com/
008f1ecc 11.\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
fea681da 12.\"
86b91fdf 13.TH WCSWIDTH 3 2010-09-10 "GNU" "Linux Programmer's Manual"
fea681da 14.SH NAME
d0f17b57 15wcswidth \- determine columns needed for a fixed-size wide-character string
fea681da
MK
16.SH SYNOPSIS
17.nf
86b91fdf 18.BR "#define _XOPEN_SOURCE" " /* See feature_test_macros(7) */"
fea681da
MK
19.B #include <wchar.h>
20.sp
21.BI "int wcswidth(const wchar_t *" s ", size_t " n );
22.fi
23.SH DESCRIPTION
60a90ecd
MK
24The
25.BR wcswidth ()
26function returns the
c13182ef 27number of columns needed to represent
fea681da 28the wide-character string pointed to by \fIs\fP, but at most \fIn\fP wide
c13182ef 29characters.
24b74457 30If a nonprintable wide character occurs among these characters,
00e28710 31\-1 is returned.
fea681da 32.SH "RETURN VALUE"
60a90ecd
MK
33The
34.BR wcswidth ()
35function
c13182ef 36returns the number of column positions for the
fea681da
MK
37wide-character string \fIs\fP, truncated to at most length \fIn\fP.
38.SH "CONFORMING TO"
68e1685c 39POSIX.1-2001.
fea681da 40.SH NOTES
d9bfdb9c 41The behavior of
60a90ecd 42.BR wcswidth ()
1274071a
MK
43depends on the
44.B LC_CTYPE
45category of the
fea681da 46current locale.
e37e3282
MK
47.SH "SEE ALSO"
48.BR iswprint (3),
49.BR wcwidth (3)