]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) |
2 | .\" | |
93015253 | 3 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
4 | .\" Permission is granted to make and distribute verbatim copies of this |
5 | .\" manual provided the copyright notice and this permission notice are | |
6 | .\" preserved on all copies. | |
7 | .\" | |
8 | .\" Permission is granted to copy and distribute modified versions of this | |
9 | .\" manual under the conditions for verbatim copying, provided that the | |
10 | .\" entire resulting derived work is distributed under the terms of a | |
11 | .\" permission notice identical to this one. | |
c13182ef | 12 | .\" |
fea681da MK |
13 | .\" Since the Linux kernel and libraries are constantly changing, this |
14 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
15 | .\" responsibility for errors or omissions, or for damages resulting from | |
16 | .\" the use of the information contained herein. The author(s) may not | |
17 | .\" have taken the same level of care in the production of this manual, | |
18 | .\" which is licensed free of charge, as they might when working | |
19 | .\" professionally. | |
c13182ef | 20 | .\" |
fea681da MK |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 23 | .\" %%%LICENSE_END |
fea681da MK |
24 | .\" |
25 | .\" References consulted: | |
26 | .\" Linux libc source code | |
27 | .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) | |
28 | .\" 386BSD man pages | |
29 | .\" Modified Sat Jul 24 18:12:45 1993 by Rik Faith (faith@cs.unc.edu) | |
fe0fefbf | 30 | .TH STRCASECMP 3 2015-03-02 "" "Linux Programmer's Manual" |
fea681da MK |
31 | .SH NAME |
32 | strcasecmp, strncasecmp \- compare two strings ignoring case | |
33 | .SH SYNOPSIS | |
34 | .nf | |
35 | .B #include <strings.h> | |
36 | .sp | |
37 | .BI "int strcasecmp(const char *" s1 ", const char *" s2 ); | |
38 | .sp | |
39 | .BI "int strncasecmp(const char *" s1 ", const char *" s2 ", size_t " n ); | |
40 | .fi | |
41 | .SH DESCRIPTION | |
60a90ecd MK |
42 | The |
43 | .BR strcasecmp () | |
46d8df8e MK |
44 | function compares the two strings |
45 | .I s1 | |
46 | and | |
47 | .IR s2 , | |
48 | ignoring the case of the characters. | |
c13182ef | 49 | It returns an integer |
46d8df8e MK |
50 | less than, equal to, or greater than zero if |
51 | .I s1 | |
52 | is found, | |
53 | respectively, to be less than, to match, or be greater than | |
54 | .IR s2 . | |
fea681da | 55 | .PP |
60a90ecd MK |
56 | The |
57 | .BR strncasecmp () | |
33a0ccb2 | 58 | function is similar, except it compares |
d25d8988 | 59 | only the first |
46d8df8e MK |
60 | .I n |
61 | bytes of | |
62 | .IR s1 . | |
47297adb | 63 | .SH RETURN VALUE |
60a90ecd MK |
64 | The |
65 | .BR strcasecmp () | |
66 | and | |
67 | .BR strncasecmp () | |
68 | functions return | |
46d8df8e MK |
69 | an integer less than, equal to, or greater than zero if |
70 | .I s1 | |
71 | (or the first | |
72 | .I n | |
73 | bytes thereof) is found, respectively, to be | |
74 | less than, to match, or be greater than | |
75 | .IR s2 . | |
8a4afcf3 PH |
76 | .SH ATTRIBUTES |
77 | For an explanation of the terms used in this section, see | |
78 | .BR attributes (7). | |
79 | .TS | |
80 | allbox; | |
81 | lbw27 lb lb | |
82 | l l l. | |
83 | Interface Attribute Value | |
84 | T{ | |
85 | .BR strcasecmp (), | |
86 | .BR strncasecmp () | |
87 | T} Thread safety MT-Safe locale | |
88 | .TE | |
47297adb | 89 | .SH CONFORMING TO |
cad62ef6 | 90 | 4.4BSD, POSIX.1-2001, POSIX.1-2008. |
ca24d850 MK |
91 | .SH NOTES |
92 | The | |
93 | .BR strcasecmp () | |
94 | and | |
95 | .BR strncasecmp () | |
96 | functions first appeared in 4.4BSD, where they were declared in | |
97 | .IR <string.h> . | |
98 | Thus, for reasons of historical compatibility, the glibc | |
99 | .I <string.h> | |
100 | header file also declares these functions, if the | |
101 | .B _DEFAULT_SOURCE | |
102 | (or, in glibc 2.19 and earlier, | |
103 | .BR _BSD_SOURCE ) | |
104 | feature test macro is defined. | |
47297adb | 105 | .SH SEE ALSO |
fea681da MK |
106 | .BR bcmp (3), |
107 | .BR memcmp (3), | |
108 | .BR strcmp (3), | |
109 | .BR strcoll (3), | |
d095200e | 110 | .BR string (3), |
fea681da MK |
111 | .BR strncmp (3), |
112 | .BR wcscasecmp (3), | |
113 | .BR wcsncasecmp (3) |