Debian Codegraph @

upstream/debian-trixie/man3/wcsnlen.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 wcsnlen 3 2024-06-15 "Linux man-pages 6.9.1"
12 .SH NAME
13 wcsnlen \- determine the length of a fixed-size wide-character string
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ", " \-lc )
17 .SH SYNOPSIS
18 .nf
19 .B #include <wchar.h>
20 .P
21 .BI "size_t wcsnlen(const wchar_t " s [. maxlen "], size_t " maxlen );
22 .fi
23 .P
24 .RS -4
25 Feature Test Macro Requirements for glibc (see
26 .BR feature_test_macros (7)):
27 .RE
28 .P
29 .BR wcsnlen ():
30 .nf
31 Since glibc 2.10:
32 _POSIX_C_SOURCE >= 200809L
33 Before glibc 2.10:
34 _GNU_SOURCE
35 .fi
36 .SH DESCRIPTION
37 The
38 .BR wcsnlen ()
39 function is the wide-character equivalent
40 of the
41 .BR strnlen (3)
42 function.
43 It returns the number of wide-characters in the string pointed to by
44 .IR s ,
45 not including the terminating null wide character (L\[aq]\[rs]0\[aq]),
46 but at most
47 .I maxlen
48 wide characters (note: this parameter is not a byte count).
49 In doing this,
50 .BR wcsnlen ()
51 looks at only the first
52 .I maxlen
53 wide characters at
54 .I s
55 and never beyond
56 .IR s[maxlen\-1] .
57 .SH RETURN VALUE
58 The
59 .BR wcsnlen ()
60 function returns
61 .IR wcslen(s) ,
62 if that is less than
63 .IR maxlen ,
64 or
65 .I maxlen
66 if there is no null wide character among the
67 first
68 .I maxlen
69 wide characters pointed to by
70 .IR s .
71 .SH ATTRIBUTES
72 For an explanation of the terms used in this section, see
73 .BR attributes (7).
74 .TS
75 allbox;
76 lbx lb lb
77 l l l.
78 Interface Attribute Value
79 T{
80 .na
81 .nh
82 .BR wcsnlen ()
83 T} Thread safety MT-Safe
84 .TE
85 .SH STANDARDS
86 POSIX.1-2008.
87 .SH HISTORY
88 glibc 2.1.
89 .SH SEE ALSO
90 .BR strnlen (3),
91 .BR wcslen (3)