tzfile.5, tzselect.8: sync from tzdb upstream
[man-pages.git] / man3 / wcsncmp.3
blob670a8ef6830609724b31883a1bba84f32ce74de6
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 .\"   ISO/IEC 9899:1999
11 .\"
12 .TH wcsncmp 3 (date) "Linux man-pages (unreleased)"
13 .SH NAME
14 wcsncmp \- compare two fixed-size wide-character strings
15 .SH LIBRARY
16 Standard C library
17 .RI ( libc ", " \-lc )
18 .SH SYNOPSIS
19 .nf
20 .B #include <wchar.h>
21 .PP
22 .BI "int wcsncmp(const wchar_t " s1 [. n "], const wchar_t " s2 [. n "], \
23 size_t " n );
24 .fi
25 .SH DESCRIPTION
26 The
27 .BR wcsncmp ()
28 function is the wide-character equivalent of the
29 .BR strncmp (3)
30 function.
31 It compares the wide-character string pointed to by
32 .I s1
33 and the
34 wide-character string pointed to by
35 .IR s2 ,
36 but at most
37 .I n
38 wide
39 characters from each string.
40 In each string, the comparison extends only up
41 to the first occurrence of a null wide character (L\[aq]\e0\[aq]), if any.
42 .SH RETURN VALUE
43 The
44 .BR wcsncmp ()
45 function returns zero if the wide-character strings at
46 .I s1
47 and
48 .IR s2 ,
49 truncated to at most length
50 .IR n ,
51 are equal.
52 It returns an integer greater than zero if at the first differing position
53 .I i
54 .RI ( i
56 .IR n ),
57 the corresponding wide-character
58 .I s1[i]
60 greater than
61 .IR s2[i] .
62 It returns an integer less than zero if at the first
63 differing position
64 .I i
65 .RI ( i
67 .IR n ),
68 the corresponding
69 wide-character
70 .I s1[i]
71 is less than
72 .IR s2[i] .
73 .SH ATTRIBUTES
74 For an explanation of the terms used in this section, see
75 .BR attributes (7).
76 .ad l
77 .nh
78 .TS
79 allbox;
80 lbx lb lb
81 l l l.
82 Interface       Attribute       Value
84 .BR wcsncmp ()
85 T}      Thread safety   MT-Safe
86 .TE
87 .hy
88 .ad
89 .sp 1
90 .SH STANDARDS
91 POSIX.1-2001, POSIX.1-2008, C99.
92 .SH SEE ALSO
93 .BR strncmp (3),
94 .BR wcsncasecmp (3)