Debian Codegraph @

upstream/debian-trixie/man3/wcswidth.3

raw
1 '\" t
2 .\" Copyright (c) Bruno Haible <[email protected]>
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 2024-05-02 "Linux man-pages 6.9.1"
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 .P
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 .TS
50 allbox;
51 lbx lb lb
52 l l l.
53 Interface Attribute Value
54 T{
55 .na
56 .nh
57 .BR wcswidth ()
58 T} Thread safety MT-Safe locale
59 .TE
60 .SH STANDARDS
61 POSIX.1-2008.
62 .SH HISTORY
63 POSIX.1-2001.
64 .SH NOTES
65 The behavior of
66 .BR wcswidth ()
67 depends on the
68 .B LC_CTYPE
69 category of the
70 current locale.
71 .SH SEE ALSO
72 .BR iswprint (3),
73 .BR wcwidth (3)