xref: /titanic_50/usr/src/man/man3c/wcslen.3c (revision eab227978ccdaa5a7cc9fd92ace768915dae3a2b)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
13.\"
14.Dd "Nov 4, 2014"
15.Dt WCSLEN 3C
16.Os
17.Sh NAME
18.Nm wcslen ,
19.Nm wcsnlen
20.Nd get length of wide-character string
21.Sh SYNOPSIS
22.In wchar.h
23.
24.Ft size_t
25.Fo wcslen
26.Fa "const wchar_t *string"
27.Fc
28.
29.Ft size_t
30.Fo wcsnlen
31.Fa "const wchar_t *string"
32.Fa "size_t maxlen"
33.Fc
34.
35.Sh DESCRIPTION
36The
37.Fn wcslen
38and
39.Fn wcsnlen
40functions count the number of wide-characters that are present in
41.Fa string .
42They stop counting when they encounter a null wide-character.
43The terminating null wide-character is not included in the count.
44.Lp
45Additionally,
46.Fn wcsnlen
47stops counting after it has counted
48.Fa maxlen
49wide-characters.
50.Lp
51The
52.Fn wcslen
53and
54.Fn wcsnlen
55functions are the wide-character equivalents of
56.Xr strlen 3C
57and
58.Xr strnlen 3C ,
59respectively.
60.Sh RETURN VALUES
61The
62.Fn wcslen
63function returns the length of
64.Fa string .
65The
66.Fn wcsnlen
67function returns the smaller of the length of
68.Fa string
69and
70.Fa maxlen .
71.Sh ERRORS
72None.
73.Sh INTERFACE STABILITY
74.Sy Standard .
75.Sh MT-LEVEL
76.Sy MT-Safe .
77.Sh SEE ALSO
78.Xr free 3C ,
79.Xr strlen 3C ,
80.Xr strnlen 3C ,
81.Xr wchar.h 3HEAD ,
82.Xr locale 5 ,
83.Xr standards 5
84.Sh STANDARDS
85The
86.Fn wcslen
87function was introduced in
88.St -xpg4
89and standardized in
90.St -isoC-99 .
91The
92.Fn wcsnlen
93function was introduced in
94.St -p1003.1-2008 .
95