Mercurial > hg > Applications > mh
view sbr/uprf.c @ 3:f89a9a79e124
utf-8
author | kono |
---|---|
date | Wed, 20 Apr 2005 00:25:01 +0900 |
parents | bce86c4163a3 |
children | 441a2190cfae |
line wrap: on
line source
/* uprf.c - "unsigned" lexical prefix */ #ifndef lint static char ident[] = "@(#)$Id$"; #endif /* lint */ #define TO_LOWER 040 #define NO_MASK 000 #include <ctype.h> uprf (c1, c2) register char *c1, *c2; { register int c, mask; if (c1 == 0 || c2 == 0) return(0); /* XXX */ while (c = *c2++) { #ifdef LOCALE c &= 0xff; mask = *c1 & 0xff; c = (isalpha(c) && isupper(c)) ? tolower(c) : c; mask = (isalpha(mask) && isupper(mask)) ? tolower(mask) : mask; if (c != mask) #else mask = (isalpha(c) && isalpha(*c1)) ? TO_LOWER : NO_MASK; if ((c | mask) != (*c1 | mask)) #endif return 0; else c1++; } return 1; }