version 1.1, 1997/05/21 20:40:10
|
version 1.3, 1998/12/08 22:03:06
|
Line 1
|
Line 1
|
/* case insensitive memory block comparison |
/* case insensitive memory block comparison |
|
|
Copyright (C) 1996 Free Software Foundation, Inc. |
Copyright (C) 1996,1998 Free Software Foundation, Inc. |
|
|
This file is part of Gforth. |
This file is part of Gforth. |
|
|
Line 24
|
Line 24
|
have to work with strcoll and some hackery */ |
have to work with strcoll and some hackery */ |
|
|
#include <ctype.h> |
#include <ctype.h> |
|
#include "forth.h" |
|
|
int memcasecmp(const char *s1, const char *s2, long n) |
Cell memcasecmp(const Char *s1, const Char *s2, Cell n) |
{ |
{ |
int i; |
Cell i; |
|
|
for (i=0; i<n; i++) { |
for (i=0; i<n; i++) { |
char c1=toupper(s1[i]); |
Char c1=toupper(s1[i]); |
char c2=toupper(s2[i]); |
Char c2=toupper(s2[i]); |
if (c1 != c2) |
if (c1 != c2) |
return c1-c2; |
return c1-c2; |
} |
} |