tzfile.5, tzselect.8: sync from tzdb upstream
[man-pages.git] / man3 / wcsnlen.3
blobec1092b5d5d64e6627ca6d40826a38228c9be00b
1 '\" t
2 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
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 (date) "Linux man-pages (unreleased)"
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 .PP
21 .BI "size_t wcsnlen(const wchar_t " s [. maxlen "], size_t " maxlen );
22 .fi
23 .PP
24 .RS -4
25 Feature Test Macro Requirements for glibc (see
26 .BR feature_test_macros (7)):
27 .RE
28 .PP
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]\e0\[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 ,
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 VERSIONS
72 The
73 .BR wcsnlen ()
74 function is provided since glibc 2.1.
75 .SH ATTRIBUTES
76 For an explanation of the terms used in this section, see
77 .BR attributes (7).
78 .ad l
79 .nh
80 .TS
81 allbox;
82 lbx lb lb
83 l l l.
84 Interface       Attribute       Value
86 .BR wcsnlen ()
87 T}      Thread safety   MT-Safe
88 .TE
89 .hy
90 .ad
91 .sp 1
92 .SH STANDARDS
93 POSIX.1-2008.
94 .SH SEE ALSO
95 .BR strnlen (3),
96 .BR wcslen (3)