]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man/man3/wcsncmp.3
man/, share/mk/: Move man*/ to man/
[thirdparty/man-pages.git] / man / man3 / wcsncmp.3
CommitLineData
a1eaacb1 1'\" t
fea681da
MK
2.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3.\"
e4a74ca8 4.\" SPDX-License-Identifier: GPL-2.0-or-later
fea681da
MK
5.\"
6.\" References consulted:
7.\" GNU glibc-2 source code and manual
8.\" Dinkumware C library reference http://www.dinkumware.com/
008f1ecc 9.\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
fea681da
MK
10.\" ISO/IEC 9899:1999
11.\"
4c1c5274 12.TH wcsncmp 3 (date) "Linux man-pages (unreleased)"
fea681da
MK
13.SH NAME
14wcsncmp \- compare two fixed-size wide-character strings
92041374
AC
15.SH LIBRARY
16Standard C library
8fc3b2cf 17.RI ( libc ", " \-lc )
fea681da
MK
18.SH SYNOPSIS
19.nf
20.B #include <wchar.h>
c6d039a3 21.P
1eed67e7
AC
22.BI "int wcsncmp(const wchar_t " s1 [. n "], const wchar_t " s2 [. n "], \
23size_t " n );
fea681da
MK
24.fi
25.SH DESCRIPTION
60a90ecd
MK
26The
27.BR wcsncmp ()
28function is the wide-character equivalent of the
29.BR strncmp (3)
30function.
40aa0db0
MK
31It compares the wide-character string pointed to by
32.I s1
33and the
34wide-character string pointed to by
35.IR s2 ,
36but at most
37.I n
38wide
c13182ef
MK
39characters from each string.
40In each string, the comparison extends only up
b957f81f 41to the first occurrence of a null wide character (L\[aq]\e0\[aq]), if any.
47297adb 42.SH RETURN VALUE
60a90ecd
MK
43The
44.BR wcsncmp ()
45function returns zero if the wide-character strings at
40aa0db0
MK
46.I s1
47and
48.IR s2 ,
49truncated to at most length
50.IR n ,
51are equal.
fea681da 52It returns an integer greater than zero if at the first differing position
40aa0db0
MK
53.I i
54.RI ( i
55<
56.IR n ),
57the corresponding wide-character
58.I s1[i]
59is
60greater than
61.IR s2[i] .
c13182ef 62It returns an integer less than zero if at the first
40aa0db0
MK
63differing position
64.I i
2d20cb1b 65.RI ( i
40aa0db0
MK
66<
67.IR n ),
68the corresponding
69wide-character
70.I s1[i]
71is less than
72.IR s2[i] .
c5880ed9 73.SH ATTRIBUTES
a13ca72f
PH
74For an explanation of the terms used in this section, see
75.BR attributes (7).
76.TS
77allbox;
c466875e 78lbx lb lb
a13ca72f
PH
79l l l.
80Interface Attribute Value
81T{
9e54434e
BR
82.na
83.nh
c5880ed9 84.BR wcsncmp ()
a13ca72f
PH
85T} Thread safety MT-Safe
86.TE
3113c7f3 87.SH STANDARDS
4131356c
AC
88C11, POSIX.1-2008.
89.SH HISTORY
90POSIX.1-2001, C99.
47297adb 91.SH SEE ALSO
fea681da
MK
92.BR strncmp (3),
93.BR wcsncasecmp (3)