]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) Bruno Haible <haible@clisp.cons.org> |
2 | .\" | |
89e3ffe9 | 3 | .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA) |
fea681da MK |
4 | .\" This is free documentation; you can redistribute it and/or |
5 | .\" modify it under the terms of the GNU General Public License as | |
6 | .\" published by the Free Software Foundation; either version 2 of | |
7 | .\" the License, or (at your option) any later version. | |
fe382ebf | 8 | .\" %%%LICENSE_END |
fea681da MK |
9 | .\" |
10 | .\" References consulted: | |
11 | .\" GNU glibc-2 source code and manual | |
12 | .\" Dinkumware C library reference http://www.dinkumware.com/ | |
008f1ecc | 13 | .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html |
fea681da MK |
14 | .\" ISO/IEC 9899:1999 |
15 | .\" | |
460495ca | 16 | .TH WCSNCMP 3 2015-08-08 "GNU" "Linux Programmer's Manual" |
fea681da MK |
17 | .SH NAME |
18 | wcsncmp \- compare two fixed-size wide-character strings | |
19 | .SH SYNOPSIS | |
20 | .nf | |
21 | .B #include <wchar.h> | |
68e4db0a | 22 | .PP |
fea681da MK |
23 | .BI "int wcsncmp(const wchar_t *" s1 ", const wchar_t *" s2 ", size_t " n ); |
24 | .fi | |
25 | .SH DESCRIPTION | |
60a90ecd MK |
26 | The |
27 | .BR wcsncmp () | |
28 | function is the wide-character equivalent of the | |
29 | .BR strncmp (3) | |
30 | function. | |
40aa0db0 MK |
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 | |
c13182ef MK |
39 | characters from each string. |
40 | In each string, the comparison extends only up | |
a74fcea6 | 41 | to the first occurrence of a null wide character (L\(aq\\0\(aq), if any. |
47297adb | 42 | .SH RETURN VALUE |
60a90ecd MK |
43 | The |
44 | .BR wcsncmp () | |
45 | function returns zero if the wide-character strings at | |
40aa0db0 MK |
46 | .I s1 |
47 | and | |
48 | .IR s2 , | |
49 | truncated to at most length | |
50 | .IR n , | |
51 | are equal. | |
fea681da | 52 | It returns an integer greater than zero if at the first differing position |
40aa0db0 MK |
53 | .I i |
54 | .RI ( i | |
55 | < | |
56 | .IR n ), | |
57 | the corresponding wide-character | |
58 | .I s1[i] | |
59 | is | |
60 | greater than | |
61 | .IR s2[i] . | |
c13182ef | 62 | It returns an integer less than zero if at the first |
40aa0db0 MK |
63 | differing position |
64 | .I i | |
65 | .RI (i | |
66 | < | |
67 | .IR n ), | |
68 | the corresponding | |
69 | wide-character | |
70 | .I s1[i] | |
71 | is less than | |
72 | .IR s2[i] . | |
c5880ed9 | 73 | .SH ATTRIBUTES |
a13ca72f PH |
74 | For an explanation of the terms used in this section, see |
75 | .BR attributes (7). | |
76 | .TS | |
77 | allbox; | |
78 | lb lb lb | |
79 | l l l. | |
80 | Interface Attribute Value | |
81 | T{ | |
c5880ed9 | 82 | .BR wcsncmp () |
a13ca72f PH |
83 | T} Thread safety MT-Safe |
84 | .TE | |
47297adb | 85 | .SH CONFORMING TO |
d6597cb0 | 86 | POSIX.1-2001, POSIX.1-2008, C99. |
47297adb | 87 | .SH SEE ALSO |
fea681da MK |
88 | .BR strncmp (3), |
89 | .BR wcsncasecmp (3) |