00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <stdio.h>
00017
00018 isKanji(c)
00019 {
00020 c &= 0xff;
00021 return (c > 0x80 && c < 0xa0 || c > 0xdf && c < 0xfd);
00022 }
00023
00024 jstrlen(s) char *s;
00025 {
00026 int i;
00027
00028 for (i = 0; *s; i++, s++)
00029 if (isKanji(*s))
00030 s++;
00031 return i;
00032 }
00033
00034 char *
00035 jStrchr(s, c) char *s;
00036 {
00037 for ( ; *s; s++)
00038 if (isKanji(*s))
00039 s++;
00040 else if (*s == c)
00041 return s;
00042 return NULL;
00043 }