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