diff options
Diffstat (limited to 'kiten/xjdxgen.c')
-rw-r--r-- | kiten/xjdxgen.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/kiten/xjdxgen.c b/kiten/xjdxgen.c index bf4de028..18afa221 100644 --- a/kiten/xjdxgen.c +++ b/kiten/xjdxgen.c @@ -30,6 +30,7 @@ #include <stdlib.h> #include <ctype.h> #include <string.h> +#include <stdbool.h> #ifdef HAVE_STDINT_H #include <stdint.h> @@ -37,8 +38,6 @@ #include "xjdic.h" -#define TRUE 1 -#define FALSE 0 #define SPTAG '@' #define EXLIM 100 #define TOKENLIM 40 @@ -62,7 +61,7 @@ int stringcomp(unsigned char *s1, unsigned char *s2); void jqsort(int32_t i, int32_t j); int Kstrcmp(uint32_t lhs, uint32_t rhs); void xjdicrc(); -int alphaoreuc(unsigned char x); +bool alphaoreuc(unsigned char x); int stringcomp(unsigned char *s1, unsigned char *s2) { @@ -86,9 +85,10 @@ extern char *getenv(const char *name); /*====function to Load Dictionary and load/create index table=======*/ int main(int argc, char *argv[]) { - FILE *fp,*fopen(); + FILE *fp; uint32_t possav,schi,diclen,indlen; - int i,inwd,cstrp,saving,isc,nodread; + int i,cstrp,isc,nodread; + bool inwd, saving; unsigned char c; unsigned char currstr[TOKENLIM]; @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) JDXname = argv[2]; printf("Commandline request to use files %s and %s \n", Dname, JDXname); - inwd = FALSE; + inwd = false; indptr = 1; llone = 1; if(stat(Dname, &buf) != 0) @@ -153,7 +153,7 @@ int main(int argc, char *argv[]) kana/kanji string and every alphabetic string it finds which is >=3 characters and is not on the "exclude" list */ indptr = 1; - saving = FALSE; + saving = false; cstrp = 0; for (schi =0; schi < dbyte; schi++) /* scan whole dictionary */ { @@ -168,9 +168,9 @@ int main(int argc, char *argv[]) else { currstr[cstrp] = '\0'; - inwd = FALSE; - if ((strlen(currstr) <= 2) && (currstr[0] < 127))saving = FALSE; - if ((strlen(currstr) == 2) && (currstr[1] <= '9'))saving = TRUE; + inwd = false; + if ((strlen(currstr) <= 2) && (currstr[0] < 127))saving = false; + if ((strlen(currstr) == 2) && (currstr[1] <= '9'))saving = true; if (saving && (currstr[0] > 127)) { possav = jindex[indptr]; @@ -237,12 +237,12 @@ int main(int argc, char *argv[]) { if (alphaoreuc(c) || c == SPTAG) { - inwd = TRUE; + inwd = true; jindex[indptr] = schi; cstrp = 1; currstr[0] = c; currstr[1] = '\0'; - saving = TRUE; + saving = true; } } } @@ -326,7 +326,7 @@ void xjdicrc() { unsigned char xjdicdir[PATH_MAX],rcstr[80],*rcwd; int iex; - FILE *fm,*fopen(); + FILE *fm; iex = 0; xjdicdir[0] = '\0'; @@ -374,7 +374,7 @@ void xjdicrc() rcwd = (unsigned char *)strtok(rcstr," \t"); if( stringcomp((unsigned char *)"exlist",rcwd) == 0) { - while (TRUE) + while (true) { rcwd = (unsigned char *)strtok(NULL," \t\f\r\n"); if (rcwd == NULL) break; @@ -401,23 +401,23 @@ void xjdicrc() } */ /*=======function to test a character for alpha or kana/kanji====*/ -int alphaoreuc(unsigned char x) +bool alphaoreuc(unsigned char x) { int c; c = x & 0xff; if(((c >= 65) && (c <= 90)) || ((c >= 97) && (c <= 122))) { - return (TRUE); + return true; } if ((c >= '0') && (c <= '9')) { - return(TRUE); + return true; } if ((c & 0x80) > 0) { - return(TRUE); + return true; } - return (FALSE); + return false; } |