2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: ansi_c.c /main/1 1996/04/21 19:25:03 drk $
25 * (c) Copyright 1996 Digital Equipment Corporation.
26 * (c) Copyright 1996 Hewlett-Packard Company.
27 * (c) Copyright 1996 International Business Machines Corp.
28 * (c) Copyright 1993-1996 Sun Microsystems, Inc.
29 * (c) Copyright 1996 Novell, Inc.
30 * (c) Copyright 1996 FUJITSU LIMITED.
31 * (c) Copyright 1996 Hitachi.
37 #ifdef NEED_STRCASECMP
39 * In case strcasecmp and strncasecmp are not provided by the system
40 * here are ones which do the trick.
44 strcasecmp(const char *s1,
50 c1 = isupper(*s1) ? tolower(*s1) : *s1;
51 c2 = isupper(*s2) ? tolower(*s2) : *s2;
57 return (int) (*s1 - *s2);
62 strncasecmp(const char *s1,
72 c1 = isupper(*s1) ? tolower(*s1) : *s1;
73 c2 = isupper(*s2) ? tolower(*s2) : *s2;
74 if ((c1 != c2) || (! --count))
79 return (int) (*s1 - *s2);
82 int ansi_c_strcasecmp_not_needed = 0; /* Make the compiler happy. */