xref: /dflybsd-src/contrib/cvs-1.12/lib/strcase.h (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
1*86d7f5d3SJohn Marino /* Case-insensitive string comparison functions.
2*86d7f5d3SJohn Marino    Copyright (C) 1995-1996, 2001, 2003, 2005 Free Software Foundation, Inc.
3*86d7f5d3SJohn Marino 
4*86d7f5d3SJohn Marino    This program is free software; you can redistribute it and/or modify
5*86d7f5d3SJohn Marino    it under the terms of the GNU General Public License as published by
6*86d7f5d3SJohn Marino    the Free Software Foundation; either version 2, or (at your option)
7*86d7f5d3SJohn Marino    any later version.
8*86d7f5d3SJohn Marino 
9*86d7f5d3SJohn Marino    This program is distributed in the hope that it will be useful,
10*86d7f5d3SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
11*86d7f5d3SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12*86d7f5d3SJohn Marino    GNU General Public License for more details.
13*86d7f5d3SJohn Marino 
14*86d7f5d3SJohn Marino    You should have received a copy of the GNU General Public License
15*86d7f5d3SJohn Marino    along with this program; if not, write to the Free Software Foundation,
16*86d7f5d3SJohn Marino    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
17*86d7f5d3SJohn Marino 
18*86d7f5d3SJohn Marino #ifndef _STRCASE_H
19*86d7f5d3SJohn Marino #define _STRCASE_H
20*86d7f5d3SJohn Marino 
21*86d7f5d3SJohn Marino #include <stddef.h>
22*86d7f5d3SJohn Marino 
23*86d7f5d3SJohn Marino 
24*86d7f5d3SJohn Marino #ifdef __cplusplus
25*86d7f5d3SJohn Marino extern "C" {
26*86d7f5d3SJohn Marino #endif
27*86d7f5d3SJohn Marino 
28*86d7f5d3SJohn Marino 
29*86d7f5d3SJohn Marino /* Compare strings S1 and S2, ignoring case, returning less than, equal to or
30*86d7f5d3SJohn Marino    greater than zero if S1 is lexicographically less than, equal to or greater
31*86d7f5d3SJohn Marino    than S2.
32*86d7f5d3SJohn Marino    Note: This function may, in multibyte locales, return 0 for strings of
33*86d7f5d3SJohn Marino    different lengths!  */
34*86d7f5d3SJohn Marino extern int strcasecmp (const char *s1, const char *s2);
35*86d7f5d3SJohn Marino 
36*86d7f5d3SJohn Marino /* Compare no more than N characters of strings S1 and S2, ignoring case,
37*86d7f5d3SJohn Marino    returning less than, equal to or greater than zero if S1 is
38*86d7f5d3SJohn Marino    lexicographically less than, equal to or greater than S2.
39*86d7f5d3SJohn Marino    Note: This function can not work correctly in multibyte locales.  */
40*86d7f5d3SJohn Marino extern int strncasecmp (const char *s1, const char *s2, size_t n);
41*86d7f5d3SJohn Marino 
42*86d7f5d3SJohn Marino 
43*86d7f5d3SJohn Marino #ifdef __cplusplus
44*86d7f5d3SJohn Marino }
45*86d7f5d3SJohn Marino #endif
46*86d7f5d3SJohn Marino 
47*86d7f5d3SJohn Marino 
48*86d7f5d3SJohn Marino #endif /* _STRCASE_H */
49