xref: /freebsd/lib/libc/string/wcswidth.3 (revision c8e804757d8c1fb0325316ae575189a5f8010abb)
1c8e80475STim J. Robbins.\" Copyright (c) 2002 Tim J. Robbins
2c8e80475STim J. Robbins.\" All rights reserved.
3c8e80475STim J. Robbins.\"
4c8e80475STim J. Robbins.\" Redistribution and use in source and binary forms, with or without
5c8e80475STim J. Robbins.\" modification, are permitted provided that the following conditions
6c8e80475STim J. Robbins.\" are met:
7c8e80475STim J. Robbins.\" 1. Redistributions of source code must retain the above copyright
8c8e80475STim J. Robbins.\"    notice, this list of conditions and the following disclaimer.
9c8e80475STim J. Robbins.\" 2. Redistributions in binary form must reproduce the above copyright
10c8e80475STim J. Robbins.\"    notice, this list of conditions and the following disclaimer in the
11c8e80475STim J. Robbins.\"    documentation and/or other materials provided with the distribution.
12c8e80475STim J. Robbins.\"
13c8e80475STim J. Robbins.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14c8e80475STim J. Robbins.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15c8e80475STim J. Robbins.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16c8e80475STim J. Robbins.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17c8e80475STim J. Robbins.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18c8e80475STim J. Robbins.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19c8e80475STim J. Robbins.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20c8e80475STim J. Robbins.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21c8e80475STim J. Robbins.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22c8e80475STim J. Robbins.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23c8e80475STim J. Robbins.\" SUCH DAMAGE.
24c8e80475STim J. Robbins.\"
25c8e80475STim J. Robbins.\" $FreeBSD$
26c8e80475STim J. Robbins.Dd August 8, 1999
27c8e80475STim J. Robbins.Dt WCSWIDTH 3
28c8e80475STim J. Robbins.Os
29c8e80475STim J. Robbins.Sh NAME
30c8e80475STim J. Robbins.Nm wcswidth
31c8e80475STim J. Robbins.Nd "number of column positions in wide-character string"
32c8e80475STim J. Robbins.Sh LIBRARY
33c8e80475STim J. Robbins.Lb libc
34c8e80475STim J. Robbins.Sh SYNOPSIS
35c8e80475STim J. Robbins.In wchar.h
36c8e80475STim J. Robbins.Ft int
37c8e80475STim J. Robbins.Fn wcswidth "const wchar_t *pwcs" "size_t n"
38c8e80475STim J. Robbins.Sh DESCRIPTION
39c8e80475STim J. RobbinsThe
40c8e80475STim J. Robbins.Fn wcswidth
41c8e80475STim J. Robbinsfunction determines the number of column positions required for the first
42c8e80475STim J. Robbins.Fa n
43c8e80475STim J. Robbinscharacters of
44c8e80475STim J. Robbins.Fa pwcs ,
45c8e80475STim J. Robbinsor until a null wide character (L'\e0') is encountered.
46c8e80475STim J. Robbins.Sh RETURN VALUES
47c8e80475STim J. RobbinsThe
48c8e80475STim J. Robbins.Fn wcswidth
49c8e80475STim J. Robbinsfunction returns 0 if
50c8e80475STim J. Robbins.Fa pwcs
51c8e80475STim J. Robbinsis an empty string (L""),
52c8e80475STim J. Robbins-1 if a non-printing wide character is encountered,
53c8e80475STim J. Robbinsotherwise it returns the number of column positions occupied.
54c8e80475STim J. Robbins.Sh SEE ALSO
55c8e80475STim J. Robbins.Xr iswprint 3 ,
56c8e80475STim J. Robbins.Xr wcwidth 3
57c8e80475STim J. Robbins.Sh STANDARDS
58c8e80475STim J. RobbinsThe
59c8e80475STim J. Robbins.Fn wcswidth
60c8e80475STim J. Robbinsfunction conforms to
61c8e80475STim J. Robbins.St -p1003.1-2001 .
62