home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
word2x0a.zip
/
source
/
compat.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-04-12
|
776b
|
59 lines
/* $Id: compat.c,v 1.2 1997/04/13 05:51:35 dps Exp $ */
#include "config.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef HAVE_STRCASECMP
int strcasecmp(const char *s, const char *t)
{
register unsigned char a,b;
while (*s && *t)
{
a=tolower(*s);
b=tolowet(*t);
if (a<b)
return -1;
if (a>b)
return 1;
s++;
t++;
}
if (*s!='\0')
return -1;
if (*t!='\0')
return 1;
return 0;
}
#endif
#ifndef HAVE_STRNCASECMP
int strcasecmp(const char *s, const char *t)
{
register unsigned char a,b;
while (*s && *t)
{
a=tolower(*s);
b=tolowet(*t);
if (a<b)
return -1;
if (a>b)
return 1;
s++;
t++;
}
if (*s!='\0')
return -1;
if (*t!='\0')
return 1;
return 0;
}
#endif
#ifdef __cplusplus
}
#endif