]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/wcsnlen.3
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man3 / wcsnlen.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
4 .\"
5 .\" References consulted:
6 .\" GNU glibc-2 source code and manual
7 .\" Dinkumware C library reference http://www.dinkumware.com/
8 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
9 .\"
10 .TH wcsnlen 3 (date) "Linux man-pages (unreleased)"
11 .SH NAME
12 wcsnlen \- determine the length of a fixed-size wide-character string
13 .SH LIBRARY
14 Standard C library
15 .RI ( libc ", " \-lc )
16 .SH SYNOPSIS
17 .nf
18 .B #include <wchar.h>
19 .PP
20 .BI "size_t wcsnlen(const wchar_t *" s ", size_t " maxlen );
21 .fi
22 .PP
23 .RS -4
24 Feature Test Macro Requirements for glibc (see
25 .BR feature_test_macros (7)):
26 .RE
27 .PP
28 .BR wcsnlen ():
29 .nf
30 Since glibc 2.10:
31 _POSIX_C_SOURCE >= 200809L
32 Before glibc 2.10:
33 _GNU_SOURCE
34 .fi
35 .SH DESCRIPTION
36 The
37 .BR wcsnlen ()
38 function is the wide-character equivalent
39 of the
40 .BR strnlen (3)
41 function.
42 It returns the number of wide-characters in the string pointed to by
43 .IR s ,
44 not including the terminating null wide character (L\(aq\e0\(aq),
45 but at most
46 .I maxlen
47 wide characters (note: this parameter is not a byte count).
48 In doing this,
49 .BR wcsnlen ()
50 looks at only the first
51 .I maxlen
52 wide characters at
53 .I s
54 and never beyond
55 .IR s[maxlen\-1] .
56 .SH RETURN VALUE
57 The
58 .BR wcsnlen ()
59 function returns
60 .IR wcslen(s) ,
61 if that is less than
62 .IR maxlen ,
63 or
64 .I maxlen
65 if there is no null wide character among the
66 first
67 .I maxlen
68 wide characters pointed to by
69 .IR s .
70 .SH VERSIONS
71 The
72 .BR wcsnlen ()
73 function is provided in glibc since version 2.1.
74 .SH ATTRIBUTES
75 For an explanation of the terms used in this section, see
76 .BR attributes (7).
77 .ad l
78 .nh
79 .TS
80 allbox;
81 lbx lb lb
82 l l l.
83 Interface Attribute Value
84 T{
85 .BR wcsnlen ()
86 T} Thread safety MT-Safe
87 .TE
88 .hy
89 .ad
90 .sp 1
91 .SH STANDARDS
92 POSIX.1-2008.
93 .SH SEE ALSO
94 .BR strnlen (3),
95 .BR wcslen (3)