tzfile.5, tzselect.8: sync from tzdb upstream
[man-pages.git] / man3 / wcswidth.3
blob6bf797c2689f08a439ad922d3eb06079c8a0f95d
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 wcswidth 3 (date) "Linux man-pages (unreleased)"
12 .SH NAME
13 wcswidth \- determine columns needed for a fixed-size wide-character string
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 wcswidth(const wchar_t *" s ", size_t " n );
23 .fi
24 .SH DESCRIPTION
25 The
26 .BR wcswidth ()
27 function returns the
28 number of columns needed to represent
29 the wide-character string pointed to by
30 .IR s ,
31 but at most
32 .I n
33 wide
34 characters.
35 If a nonprintable wide character occurs among these characters,
36 \-1 is returned.
37 .SH RETURN VALUE
38 The
39 .BR wcswidth ()
40 function
41 returns the number of column positions for the
42 wide-character string
43 .IR s ,
44 truncated to at most length
45 .IR n .
46 .SH ATTRIBUTES
47 For an explanation of the terms used in this section, see
48 .BR attributes (7).
49 .ad l
50 .nh
51 .TS
52 allbox;
53 lbx lb lb
54 l l l.
55 Interface       Attribute       Value
57 .BR wcswidth ()
58 T}      Thread safety   MT-Safe locale
59 .TE
60 .hy
61 .ad
62 .sp 1
63 .SH STANDARDS
64 POSIX.1-2001, POSIX.1-2008.
65 .SH NOTES
66 The behavior of
67 .BR wcswidth ()
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 wcwidth (3)