Normalize romanized identifiers to Hepburn

This commit is contained in:
Nishi 2026-06-18 13:53:25 +09:00
commit 787febbd07
72 changed files with 871 additions and 871 deletions

76
hindo.c
View file

@ -35,7 +35,7 @@
extern HindoRec* hindo[];
extern int hindo_num;
extern AssyukuRec* assyuku;
extern AsshukuRec* asshuku;
extern HindoRec* askknj[];
extern int askknj_num;
extern int kanji_num;
@ -62,11 +62,11 @@ int check_hindo(unsigned char* ptr, int len) {
return 0;
}
static AssyukuRec*
makeassyuku(int num) {
AssyukuRec* arec;
static AsshukuRec*
makeasshuku(int num) {
AsshukuRec* arec;
arec = (AssyukuRec*)Malloc(sizeof(AssyukuRec));
arec = (AsshukuRec*)Malloc(sizeof(AsshukuRec));
if(!arec) {
fprintf(stderr, "\245\341\245\342\245\352\244\254\302\255\244\352\244\336\244\273\244\363\n");
exit(1);
@ -80,13 +80,13 @@ makeassyuku(int num) {
}
static int
assyuku_len(HindoRec* hrec) {
asshuku_len(HindoRec* hrec) {
int org;
int old;
int new;
OffsetRec* p;
if(((*(hrec->kptr) & KanjiModeMask) == OffsetAssyuku) &&
if(((*(hrec->kptr) & KanjiModeMask) == OffsetAsshuku) &&
(hrec->klen == 2)) {
p = real_ofsrec(hrec->kptr);
@ -109,16 +109,16 @@ assyuku_len(HindoRec* hrec) {
}
static void
set_assyuku(HindoRec* hrec) {
AssyukuRec* arec;
AssyukuRec* aprev;
set_asshuku(HindoRec* hrec) {
AsshukuRec* arec;
AsshukuRec* aprev;
int len;
len = assyuku_len(hrec);
len = asshuku_len(hrec);
if(len <= 0) return;
arec = assyuku;
arec = asshuku;
aprev = NULL;
while(arec) {
@ -137,7 +137,7 @@ set_assyuku(HindoRec* hrec) {
arec = arec->anext;
}
arec = makeassyuku(len);
arec = makeasshuku(len);
hrec->anext = NULL;
hrec->arec = arec;
@ -147,16 +147,16 @@ set_assyuku(HindoRec* hrec) {
arec->anext = aprev->anext;
aprev->anext = arec;
} else {
arec->anext = assyuku;
assyuku = arec;
arec->anext = asshuku;
asshuku = arec;
}
}
static void
reset_assyuku(HindoRec* hrec) {
AssyukuRec* arec;
AssyukuRec* aptr;
AssyukuRec* aprev;
reset_asshuku(HindoRec* hrec) {
AsshukuRec* arec;
AsshukuRec* aptr;
AsshukuRec* aprev;
HindoRec* hptr;
HindoRec* hprev;
@ -187,8 +187,8 @@ reset_assyuku(HindoRec* hrec) {
return;
}
if(!assyuku) return;
aptr = assyuku;
if(!asshuku) return;
aptr = asshuku;
aprev = NULL;
while(aptr) {
if(aptr == arec) break;
@ -202,7 +202,7 @@ reset_assyuku(HindoRec* hrec) {
aprev->anext = arec->anext;
else
assyuku = arec->anext;
asshuku = arec->anext;
Free(arec);
@ -254,7 +254,7 @@ set_hindo(unsigned char* ptr, int len, int alen) {
hindo[0] = hrec;
hindo_num = 1;
set_assyuku(hrec);
set_asshuku(hrec);
return;
}
@ -288,7 +288,7 @@ set_hindo(unsigned char* ptr, int len, int alen) {
else {
hrec = hindo[mid];
reset_assyuku(hrec);
reset_asshuku(hrec);
if(hrec->exist > 0)
hrec->exist += 1;
@ -302,7 +302,7 @@ set_hindo(unsigned char* ptr, int len, int alen) {
hrec->hindo += 1;
}
set_assyuku(hrec);
set_asshuku(hrec);
}
static void
@ -326,7 +326,7 @@ reset_hindo(unsigned char* p, int l) {
else {
hrec = hindo[mid];
reset_assyuku(hrec);
reset_asshuku(hrec);
if(hrec->exist > 0)
hrec->exist -= 1;
@ -342,7 +342,7 @@ reset_hindo(unsigned char* p, int l) {
Free(hrec);
} else {
set_assyuku(hrec);
set_asshuku(hrec);
}
return;
@ -408,7 +408,7 @@ void knjhnd_reset(unsigned char* p, int l) {
}
static int
check_assyuku(HindoRec* p, HindoRec* q) {
check_asshuku(HindoRec* p, HindoRec* q) {
unsigned char ptmp[128], qtmp[128];
int plen;
int qlen;
@ -429,14 +429,14 @@ check_assyuku(HindoRec* p, HindoRec* q) {
int decide_knjask(void) {
int i, j;
AssyukuRec* p;
AsshukuRec* p;
HindoRec* q;
unsigned char* r;
int len = 0;
askknj_num = 0;
for(p = assyuku; p; p = p->anext) {
for(p = asshuku; p; p = p->anext) {
if(p->len <= 0) break;
@ -446,7 +446,7 @@ int decide_knjask(void) {
r = q->kptr;
if(i > 2) {
while(i > 0) {
if((*r & KanjiModeMask) == OffsetAssyuku) {
if((*r & KanjiModeMask) == OffsetAsshuku) {
break;
}
j = codesize(*r);
@ -459,7 +459,7 @@ int decide_knjask(void) {
if(askknj_num) {
for(i = 0; i < askknj_num; i++) {
if(check_assyuku(askknj[i], q))
if(check_asshuku(askknj[i], q))
break;
}
@ -485,7 +485,7 @@ end:
p = askknj[i]->kptr;
if(len <= 2) continue;
while(len > 0) {
if((*p & KanjiModeMask) == OffsetAssyuku) {
if((*p & KanjiModeMask) == OffsetAsshuku) {
printf("\245\252\245\325\245\273\245\303\245\310\260\265\275\314\244\362\264\336\244\340 %d\n", i);
}
j = codesize(*p);
@ -508,12 +508,12 @@ void clear_hindo(void) {
kanji_num = 0;
}
void clear_assyuku(void) {
AssyukuRec* p;
void clear_asshuku(void) {
AsshukuRec* p;
while(assyuku) {
p = assyuku;
assyuku = assyuku->anext;
while(asshuku) {
p = asshuku;
asshuku = asshuku->anext;
Free(p);
}
}