OSDN Git Service

c4401d10502ba71fd56e10e5e4c4800aa7ec62e6
[linuxjm/LDP_man-pages.git] / original / man3 / wcsnlen.3
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
7 .\"
8 .\" References consulted:
9 .\"   GNU glibc-2 source code and manual
10 .\"   Dinkumware C library reference http://www.dinkumware.com/
11 .\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
12 .\"
13 .TH WCSNLEN 3  2010-09-15 "GNU" "Linux Programmer's Manual"
14 .SH NAME
15 wcsnlen \- determine the length of a fixed-size wide-character string
16 .SH SYNOPSIS
17 .nf
18 .B #include <wchar.h>
19 .sp
20 .BI "size_t wcsnlen(const wchar_t *" s ", size_t " maxlen );
21 .fi
22 .sp
23 .in -4n
24 Feature Test Macro Requirements for glibc (see
25 .BR feature_test_macros (7)):
26 .in
27 .sp
28 .BR wcsnlen ():
29 .PD 0
30 .ad l
31 .RS 4
32 .TP 4
33 Since glibc 2.10:
34 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
35 .TP
36 Before glibc 2.10:
37 _GNU_SOURCE
38 .RE
39 .ad
40 .PD
41 .SH DESCRIPTION
42 The
43 .BR wcsnlen ()
44 function is the wide-character equivalent
45 of the
46 .BR strnlen (3)
47 function.
48 It returns the number of wide-characters in the string pointed to by
49 \fIs\fP, not including the terminating L\(aq\\0\(aq character, but at most
50 \fImaxlen\fP.
51 In doing this,
52 .BR wcsnlen ()
53 looks only at the first \fImaxlen\fP
54 wide-characters at \fIs\fP and never beyond \fIs+maxlen\fP.
55 .SH "RETURN VALUE"
56 The
57 .BR wcsnlen ()
58 function returns \fIwcslen(s)\fP, if that is less than
59 \fImaxlen\fP, or \fImaxlen\fP if there is no L\(aq\\0\(aq character among the
60 first \fImaxlen\fP wide characters pointed to by \fIs\fP.
61 .SH VERSIONS
62 The
63 .BR wcsnlen ()
64 function is provided in glibc since version 2.1.
65 .SH "CONFORMING TO"
66 This function is a GNU extension.
67 .SH "SEE ALSO"
68 .BR strnlen (3),
69 .BR wcslen (3)