Compare commits
No commits in common. "b82d393de33e2e2c13c8777b7740c813b238f980" and "7935e5e7ea2d96d99385fd315352de1c4b325f6d" have entirely different histories.
b82d393de3
...
7935e5e7ea
66 changed files with 1174 additions and 681 deletions
|
|
@ -34,10 +34,8 @@
|
||||||
#include "sj_yomi.h"
|
#include "sj_yomi.h"
|
||||||
#include "kanakan.h"
|
#include "kanakan.h"
|
||||||
|
|
||||||
int sj2cd_str(unsigned char * euc, unsigned char * yomi, int len);
|
int sj2cd_str();
|
||||||
void mvmemi(unsigned char * src, unsigned char * dest, int len);
|
void mvmemi(), mvmemd(), mkidxtbl();
|
||||||
void mvmemd(unsigned char * src, unsigned char * dest, int len);
|
|
||||||
void mkidxtbl(DICT * dict);
|
|
||||||
|
|
||||||
void set_size(unsigned char* p, int size, int plen, int nlen) {
|
void set_size(unsigned char* p, int size, int plen, int nlen) {
|
||||||
*p = (unsigned char)(size >> 8);
|
*p = (unsigned char)(size >> 8);
|
||||||
|
|
|
||||||
5
cl2knj.c
5
cl2knj.c
|
|
@ -31,9 +31,8 @@
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
#include "kanakan.h"
|
#include "kanakan.h"
|
||||||
|
|
||||||
int sj2cd_chr(unsigned char * euc, unsigned char * yomi);
|
int sj2cd_chr();
|
||||||
void cvtclknj(void);
|
void cvtclknj(), freework();
|
||||||
void freework(void);
|
|
||||||
|
|
||||||
static CLREC* nextrecblk(void);
|
static CLREC* nextrecblk(void);
|
||||||
static CLREC* prevrecblk(void);
|
static CLREC* prevrecblk(void);
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,8 @@
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
#include "kanakan.h"
|
#include "kanakan.h"
|
||||||
|
|
||||||
int sj2cd_str(unsigned char * euc, unsigned char * yomi, int len);
|
int sj2cd_str();
|
||||||
void mvmemd(unsigned char * src, unsigned char * dest, int len);
|
void mvmemd(), mvmemi();
|
||||||
void mvmemi(unsigned char * src, unsigned char * dest, int len);
|
|
||||||
|
|
||||||
static unsigned char* delcldata(unsigned char* ycode);
|
static unsigned char* delcldata(unsigned char* ycode);
|
||||||
static int delclold(void);
|
static int delclold(void);
|
||||||
|
|
|
||||||
5
cmpstr.c
5
cmpstr.c
|
|
@ -30,7 +30,10 @@
|
||||||
#include "sj_rename.h"
|
#include "sj_rename.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
#include "sj_typedef.h"
|
#include "sj_typedef.h"
|
||||||
int cmpstr(unsigned char * src, unsigned char * dst)
|
|
||||||
|
int cmpstr(src, dst)
|
||||||
|
unsigned char* src;
|
||||||
|
unsigned char* dst;
|
||||||
{
|
{
|
||||||
while(*src) {
|
while(*src) {
|
||||||
if(*src != *dst) return FALSE;
|
if(*src != *dst) return FALSE;
|
||||||
|
|
|
||||||
22
code.c
22
code.c
|
|
@ -41,10 +41,13 @@ static unsigned char cbuf[5];
|
||||||
static int cur_code = CODE_EUC;
|
static int cur_code = CODE_EUC;
|
||||||
extern int current_locale;
|
extern int current_locale;
|
||||||
static int ccnt = 0;
|
static int ccnt = 0;
|
||||||
int codeconv(wchar16_t c, unsigned int * rkstr)
|
|
||||||
|
codeconv(c, rkstr)
|
||||||
|
wchar16_t c;
|
||||||
|
unsigned int* rkstr;
|
||||||
{
|
{
|
||||||
unsigned short ccode, i;
|
unsigned short ccode, i;
|
||||||
unsigned short CheckCcode(wchar16_t c);
|
unsigned short CheckCcode();
|
||||||
extern int erase_char;
|
extern int erase_char;
|
||||||
|
|
||||||
if(c == erase_char) {
|
if(c == erase_char) {
|
||||||
|
|
@ -79,7 +82,9 @@ int codeconv(wchar16_t c, unsigned int * rkstr)
|
||||||
*rkstr = RKEND;
|
*rkstr = RKEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned short CheckCcode(wchar16_t c)
|
unsigned short
|
||||||
|
CheckCcode(c)
|
||||||
|
wchar16_t c;
|
||||||
{
|
{
|
||||||
unsigned char c1;
|
unsigned char c1;
|
||||||
unsigned short code;
|
unsigned short code;
|
||||||
|
|
@ -136,8 +141,8 @@ unsigned short CheckCcode(wchar16_t c)
|
||||||
return (code);
|
return (code);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned short strtocode(void)
|
unsigned short
|
||||||
{
|
strtocode() {
|
||||||
int c;
|
int c;
|
||||||
unsigned short code;
|
unsigned short code;
|
||||||
|
|
||||||
|
|
@ -184,11 +189,12 @@ void ChangeCode(void) {
|
||||||
cur_code++;
|
cur_code++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int SetCode(int code)
|
|
||||||
|
SetCode(code) int code;
|
||||||
{
|
{
|
||||||
cur_code = code;
|
cur_code = code;
|
||||||
}
|
}
|
||||||
int GetCcode(void)
|
|
||||||
{
|
GetCcode() {
|
||||||
return (cur_code);
|
return (cur_code);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
25
codecnv.c
25
codecnv.c
|
|
@ -35,8 +35,8 @@
|
||||||
#include "sjtool.h"
|
#include "sjtool.h"
|
||||||
|
|
||||||
static int euc_mode;
|
static int euc_mode;
|
||||||
int init_code(void)
|
|
||||||
{
|
int init_code() {
|
||||||
char* loc;
|
char* loc;
|
||||||
|
|
||||||
#ifdef LACKOF_SETLOCALE
|
#ifdef LACKOF_SETLOCALE
|
||||||
|
|
@ -65,7 +65,8 @@ int init_code(void)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cnvcode(unsigned char * s)
|
void
|
||||||
|
cnvcode(s) unsigned char* s;
|
||||||
{
|
{
|
||||||
if(euc_mode) {
|
if(euc_mode) {
|
||||||
unsigned short i;
|
unsigned short i;
|
||||||
|
|
@ -96,13 +97,19 @@ void cnvcode(unsigned char * s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void printout_mb(FILE * fp, unsigned char * s)
|
void
|
||||||
|
printout_mb(fp, s)
|
||||||
|
FILE* fp;
|
||||||
|
unsigned char* s;
|
||||||
{
|
{
|
||||||
fputs((char*)s, fp);
|
fputs((char*)s, fp);
|
||||||
fflush(fp);
|
fflush(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void printout(FILE * fp, unsigned char * s)
|
void
|
||||||
|
printout(fp, s)
|
||||||
|
FILE* fp;
|
||||||
|
unsigned char* s;
|
||||||
{
|
{
|
||||||
unsigned char buf[BUFSIZ];
|
unsigned char buf[BUFSIZ];
|
||||||
|
|
||||||
|
|
@ -114,7 +121,9 @@ void printout(FILE * fp, unsigned char * s)
|
||||||
fflush(fp);
|
fflush(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void normal_out(char * fmt, int p1, int p2, int p3, int p4, int p5)
|
void
|
||||||
|
normal_out(fmt, p1, p2, p3, p4, p5) char* fmt;
|
||||||
|
int p1, p2, p3, p4, p5;
|
||||||
{
|
{
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
|
|
||||||
|
|
@ -122,7 +131,9 @@ void normal_out(char * fmt, int p1, int p2, int p3, int p4, int p5)
|
||||||
printout(stdout, buf);
|
printout(stdout, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
void error_out(char * fmt, int p1, int p2, int p3, int p4, int p5)
|
void
|
||||||
|
error_out(fmt, p1, p2, p3, p4, p5) char* fmt;
|
||||||
|
int p1, p2, p3, p4, p5;
|
||||||
{
|
{
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
|
|
||||||
|
|
|
||||||
40
common.c
40
common.c
|
|
@ -39,8 +39,8 @@ int flush_conversion;
|
||||||
Conversion* current_conversion;
|
Conversion* current_conversion;
|
||||||
Conversion* default_conversion;
|
Conversion* default_conversion;
|
||||||
|
|
||||||
Conversion* AllocConversion(void)
|
Conversion*
|
||||||
{
|
AllocConversion() {
|
||||||
Conversion* c;
|
Conversion* c;
|
||||||
|
|
||||||
if((c = (Conversion*)malloc(sizeof(Conversion))) == NULL) {
|
if((c = (Conversion*)malloc(sizeof(Conversion))) == NULL) {
|
||||||
|
|
@ -65,45 +65,53 @@ Conversion* AllocConversion(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Conversion* push_conversion;
|
static Conversion* push_conversion;
|
||||||
int FreeConversion(Conversion * c)
|
|
||||||
|
FreeConversion(c)
|
||||||
|
Conversion* c;
|
||||||
{
|
{
|
||||||
if(c == push_conversion)
|
if(c == push_conversion)
|
||||||
push_conversion = 0;
|
push_conversion = 0;
|
||||||
free(c);
|
free(c);
|
||||||
}
|
}
|
||||||
int SetConversion(Conversion * c)
|
|
||||||
|
SetConversion(c)
|
||||||
|
Conversion* c;
|
||||||
{
|
{
|
||||||
PushConversion(current_conversion);
|
PushConversion(current_conversion);
|
||||||
current_conversion = c;
|
current_conversion = c;
|
||||||
}
|
}
|
||||||
int PushConversion(Conversion * c)
|
|
||||||
|
PushConversion(c)
|
||||||
|
Conversion* c;
|
||||||
{
|
{
|
||||||
push_conversion = c;
|
push_conversion = c;
|
||||||
}
|
}
|
||||||
int PopConversion(void)
|
|
||||||
{
|
PopConversion() {
|
||||||
if(push_conversion)
|
if(push_conversion)
|
||||||
current_conversion = push_conversion;
|
current_conversion = push_conversion;
|
||||||
}
|
}
|
||||||
|
|
||||||
Conversion* GetConversion(void)
|
Conversion*
|
||||||
{
|
GetConversion() {
|
||||||
return (current_conversion);
|
return (current_conversion);
|
||||||
}
|
}
|
||||||
int InitConversion(void)
|
|
||||||
{
|
InitConversion() {
|
||||||
default_conversion = AllocConversion();
|
default_conversion = AllocConversion();
|
||||||
DefaultConversion();
|
DefaultConversion();
|
||||||
}
|
}
|
||||||
int DefaultConversion(void)
|
|
||||||
{
|
DefaultConversion() {
|
||||||
current_conversion = default_conversion;
|
current_conversion = default_conversion;
|
||||||
}
|
}
|
||||||
int EndConversion(void)
|
|
||||||
{
|
EndConversion() {
|
||||||
free(default_conversion);
|
free(default_conversion);
|
||||||
}
|
}
|
||||||
int wcbyte(wchar16_t * str)
|
|
||||||
|
int wcbyte(str)
|
||||||
|
wchar16_t* str;
|
||||||
{
|
{
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
||||||
|
|
|
||||||
4
common.h
4
common.h
|
|
@ -39,8 +39,8 @@ extern int Hlevel;
|
||||||
extern int oasys;
|
extern int oasys;
|
||||||
extern int flush_conversion;
|
extern int flush_conversion;
|
||||||
|
|
||||||
Conversion* AllocConversion(void);
|
Conversion* AllocConversion();
|
||||||
Conversion* GetConversion(void);
|
Conversion* GetConversion();
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
FILE* dbfp;
|
FILE* dbfp;
|
||||||
|
|
|
||||||
|
|
@ -1939,8 +1939,11 @@ void* memmem(const void* l, size_t l_len, const void* s, size_t s_len) {
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/* * Reverse memchr(void)
|
/*
|
||||||
{
|
* Reverse memchr()
|
||||||
|
* Find the last occurrence of 'c' in the buffer 's' of size 'n'.
|
||||||
|
*/
|
||||||
|
void* memrchr(const void* s, int c, size_t n) {
|
||||||
const unsigned char* cp;
|
const unsigned char* cp;
|
||||||
|
|
||||||
if(n != 0) {
|
if(n != 0) {
|
||||||
|
|
|
||||||
26
conv.c
26
conv.c
|
|
@ -121,13 +121,13 @@ extern int master;
|
||||||
extern wchar16_t Ukey[UKEYNUM][SEQLEN + 1];
|
extern wchar16_t Ukey[UKEYNUM][SEQLEN + 1];
|
||||||
extern int Uvalue[];
|
extern int Uvalue[];
|
||||||
extern int Unumber;
|
extern int Unumber;
|
||||||
int convert_stat(void)
|
|
||||||
{
|
convert_stat() {
|
||||||
stat_init();
|
stat_init();
|
||||||
stat_conv();
|
stat_conv();
|
||||||
}
|
}
|
||||||
int inputprocess(void)
|
|
||||||
{
|
inputprocess() {
|
||||||
int c;
|
int c;
|
||||||
wchar16_t obuf[2];
|
wchar16_t obuf[2];
|
||||||
|
|
||||||
|
|
@ -164,8 +164,8 @@ wchar16_t pars_seq[KEYBUFSIZ];
|
||||||
int buf_count = 0;
|
int buf_count = 0;
|
||||||
int pars_n;
|
int pars_n;
|
||||||
static int escape = 0;
|
static int escape = 0;
|
||||||
int inkey(void)
|
|
||||||
{
|
inkey() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, j;
|
int i, j;
|
||||||
wchar16_t c;
|
wchar16_t c;
|
||||||
|
|
@ -217,7 +217,10 @@ int inkey(void)
|
||||||
}
|
}
|
||||||
return (c);
|
return (c);
|
||||||
}
|
}
|
||||||
int sequence(wchar16_t * buf, int * count)
|
|
||||||
|
sequence(buf, count)
|
||||||
|
wchar16_t* buf;
|
||||||
|
int* count;
|
||||||
{
|
{
|
||||||
|
|
||||||
int n;
|
int n;
|
||||||
|
|
@ -255,7 +258,11 @@ int sequence(wchar16_t * buf, int * count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int parse_escape(wchar16_t * s, int * count, int more)
|
|
||||||
|
parse_escape(s, count, more)
|
||||||
|
wchar16_t* s;
|
||||||
|
int* count;
|
||||||
|
int more;
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
wchar16_t temp[KEYBUFSIZ];
|
wchar16_t temp[KEYBUFSIZ];
|
||||||
|
|
@ -328,7 +335,8 @@ int parse_escape(wchar16_t * s, int * count, int more)
|
||||||
return (KEY_OTHER);
|
return (KEY_OTHER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int write_pseq(int mod)
|
|
||||||
|
write_pseq(mod) int mod;
|
||||||
{
|
{
|
||||||
|
|
||||||
if(mod == 3) {
|
if(mod == 3) {
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,9 @@
|
||||||
|
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
|
|
||||||
void cvtkouho(KHREC* krec);
|
void cvtkouho(), setstyrec();
|
||||||
void setstyrec(KHREC* krec);
|
|
||||||
void cvtclknj(void)
|
void cvtclknj() {
|
||||||
{
|
|
||||||
KHREC* krec;
|
KHREC* krec;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,9 @@
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
#include "kanakan.h"
|
#include "kanakan.h"
|
||||||
|
|
||||||
void mkknjmax(void);
|
void mkknjmax();
|
||||||
void mvmemi(unsigned char * src, unsigned char * dest, int len);
|
void mvmemi(), free_clall();
|
||||||
void free_clall(CLREC * p);
|
void free_jall();
|
||||||
void free_jall(JREC * p);
|
|
||||||
|
|
||||||
void cvtphknj(void) {
|
void cvtphknj(void) {
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
|
||||||
4
deldic.c
4
deldic.c
|
|
@ -32,8 +32,8 @@
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
#include "kanakan.h"
|
#include "kanakan.h"
|
||||||
|
|
||||||
void mvmemi(unsigned char * src, unsigned char * dest, int len);
|
void mvmemi();
|
||||||
void mkidxtbl(DICT * dict);
|
void mkidxtbl();
|
||||||
|
|
||||||
static int del_douon(TypeDicSeg seg, unsigned char* ptr, TypeDicOfs ofs);
|
static int del_douon(TypeDicSeg seg, unsigned char* ptr, TypeDicOfs ofs);
|
||||||
static int del_segment(TypeDicSeg seg);
|
static int del_segment(TypeDicSeg seg);
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,8 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
void dictdisp(char * output)
|
void
|
||||||
|
dictdisp(output) char* output;
|
||||||
{
|
{
|
||||||
unsigned char buf[BUFSIZ];
|
unsigned char buf[BUFSIZ];
|
||||||
unsigned char* p;
|
unsigned char* p;
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,8 @@
|
||||||
extern int force_flag;
|
extern int force_flag;
|
||||||
extern int verbose_flag;
|
extern int verbose_flag;
|
||||||
extern int _sys_code;
|
extern int _sys_code;
|
||||||
static void touroku(char * y, char * k, char * h)
|
|
||||||
|
static void touroku(y, k, h) char *y, *k, *h;
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
int grm;
|
int grm;
|
||||||
|
|
@ -123,7 +124,8 @@ static void touroku(char * y, char * k, char * h)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dictmake(char * input)
|
void
|
||||||
|
dictmake(input) char* input;
|
||||||
{
|
{
|
||||||
unsigned char buf[BUFSIZ];
|
unsigned char buf[BUFSIZ];
|
||||||
FILE* fp;
|
FILE* fp;
|
||||||
|
|
|
||||||
93
display.c
93
display.c
|
|
@ -45,8 +45,8 @@ int status_line;
|
||||||
char * CM, *US, *UE, *SO, *SE, *CE, *CS, *BEL, *RP, *AP, *TS, *FS, *DS, *I2;
|
char * CM, *US, *UE, *SO, *SE, *CE, *CS, *BEL, *RP, *AP, *TS, *FS, *DS, *I2;
|
||||||
char * SC, *RC, *SR, *DO;
|
char * SC, *RC, *SR, *DO;
|
||||||
static int keyboard = OTHER_KB;
|
static int keyboard = OTHER_KB;
|
||||||
int checkterm(void)
|
|
||||||
{
|
checkterm() {
|
||||||
char * kb, *area, *tgetstr(), *tmp;
|
char * kb, *area, *tgetstr(), *tmp;
|
||||||
int val;
|
int val;
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
@ -142,7 +142,8 @@ int checkterm(void)
|
||||||
|
|
||||||
strcpy(cmove, CM);
|
strcpy(cmove, CM);
|
||||||
}
|
}
|
||||||
void outc(char c)
|
|
||||||
|
void outc(c) char c;
|
||||||
{
|
{
|
||||||
putchar(c);
|
putchar(c);
|
||||||
}
|
}
|
||||||
|
|
@ -150,31 +151,32 @@ void outc(char c)
|
||||||
void erroutc(c) {
|
void erroutc(c) {
|
||||||
fputc(c, stderr);
|
fputc(c, stderr);
|
||||||
}
|
}
|
||||||
int start_guideline(void)
|
|
||||||
{
|
start_guideline() {
|
||||||
if(status_line && I2)
|
if(status_line && I2)
|
||||||
tputs(I2, 1, erroutc);
|
tputs(I2, 1, erroutc);
|
||||||
}
|
}
|
||||||
int end_guideline(void)
|
|
||||||
{
|
end_guideline() {
|
||||||
if(status_line) {
|
if(status_line) {
|
||||||
tputs(DS, 1, outc);
|
tputs(DS, 1, outc);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int put_space(int n)
|
|
||||||
|
put_space(n) int n;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i = 0; i < n; i++)
|
for(i = 0; i < n; i++)
|
||||||
putchar(' ');
|
putchar(' ');
|
||||||
}
|
}
|
||||||
int Backspace(void)
|
|
||||||
{
|
Backspace() {
|
||||||
putchar(BS);
|
putchar(BS);
|
||||||
}
|
}
|
||||||
int master_flush(void)
|
|
||||||
{
|
master_flush() {
|
||||||
SELECT_FD ifds;
|
SELECT_FD ifds;
|
||||||
int nc;
|
int nc;
|
||||||
struct timeval t;
|
struct timeval t;
|
||||||
|
|
@ -201,8 +203,8 @@ int master_flush(void)
|
||||||
} while(nc > 0);
|
} while(nc > 0);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int ThroughIntr(void)
|
|
||||||
{
|
ThroughIntr() {
|
||||||
wchar16_t s[2];
|
wchar16_t s[2];
|
||||||
|
|
||||||
SJ_read(s, 1);
|
SJ_read(s, 1);
|
||||||
|
|
@ -215,33 +217,35 @@ int ThroughIntr(void)
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int under_in(void)
|
|
||||||
{
|
under_in() {
|
||||||
tputs(US, 1, outc);
|
tputs(US, 1, outc);
|
||||||
}
|
}
|
||||||
int under_out(void)
|
|
||||||
{
|
under_out() {
|
||||||
tputs(UE, 1, outc);
|
tputs(UE, 1, outc);
|
||||||
}
|
}
|
||||||
int reverse_in(void)
|
|
||||||
{
|
reverse_in() {
|
||||||
tputs(SO, 1, outc);
|
tputs(SO, 1, outc);
|
||||||
}
|
}
|
||||||
int reverse_out(void)
|
|
||||||
{
|
reverse_out() {
|
||||||
tputs(SE, 1, outc);
|
tputs(SE, 1, outc);
|
||||||
}
|
}
|
||||||
int beep(void)
|
|
||||||
{
|
beep() {
|
||||||
tputs(BEL, 1, outc);
|
tputs(BEL, 1, outc);
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
int CursorSet(unsigned short row, unsigned short col)
|
|
||||||
|
CursorSet(row, col) unsigned short row, col;
|
||||||
{
|
{
|
||||||
tputs(tgoto(CM, col - 1, row - 1), 1, outc);
|
tputs(tgoto(CM, col - 1, row - 1), 1, outc);
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
int RegionSet(int row1, int row2)
|
|
||||||
|
RegionSet(row1, row2) int row1, row2;
|
||||||
{
|
{
|
||||||
|
|
||||||
tputs(SC, 1, outc);
|
tputs(SC, 1, outc);
|
||||||
|
|
@ -260,7 +264,8 @@ int RegionSet(int row1, int row2)
|
||||||
#define CRLIMIT 4
|
#define CRLIMIT 4
|
||||||
|
|
||||||
int master_flush_flag = 1;
|
int master_flush_flag = 1;
|
||||||
int CursorRead(unsigned short * row, unsigned short * col)
|
|
||||||
|
CursorRead(row, col) unsigned short* row, *col;
|
||||||
{
|
{
|
||||||
|
|
||||||
int count;
|
int count;
|
||||||
|
|
@ -293,7 +298,9 @@ int CursorRead(unsigned short * row, unsigned short * col)
|
||||||
#define BACKLIM 16
|
#define BACKLIM 16
|
||||||
#define MARKER '%'
|
#define MARKER '%'
|
||||||
#define SEPARA ';'
|
#define SEPARA ';'
|
||||||
int CRP(int * row, int * col)
|
|
||||||
|
CRP(row, col)
|
||||||
|
int *row, *col;
|
||||||
{
|
{
|
||||||
char * sa, *sd;
|
char * sa, *sd;
|
||||||
int c;
|
int c;
|
||||||
|
|
@ -357,7 +364,10 @@ top:
|
||||||
|
|
||||||
return (SUCC);
|
return (SUCC);
|
||||||
}
|
}
|
||||||
int unget_inkey2(wchar16_t * s, int n)
|
|
||||||
|
unget_inkey2(s, n)
|
||||||
|
wchar16_t* s;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
extern wchar16_t ibuf[];
|
extern wchar16_t ibuf[];
|
||||||
extern int buf_count;
|
extern int buf_count;
|
||||||
|
|
@ -368,26 +378,28 @@ int unget_inkey2(wchar16_t * s, int n)
|
||||||
ibuf[buf_count++] = *(s++);
|
ibuf[buf_count++] = *(s++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int unget_key(int c)
|
|
||||||
|
unget_key(c) int c;
|
||||||
{
|
{
|
||||||
wchar16_t tmp[2];
|
wchar16_t tmp[2];
|
||||||
|
|
||||||
tmp[0] = c;
|
tmp[0] = c;
|
||||||
unget_inkey2(tmp, 1);
|
unget_inkey2(tmp, 1);
|
||||||
}
|
}
|
||||||
int CRI(void)
|
|
||||||
{
|
CRI() {
|
||||||
wchar16_t c;
|
wchar16_t c;
|
||||||
|
|
||||||
SJ_read(&c, 1);
|
SJ_read(&c, 1);
|
||||||
return (c);
|
return (c);
|
||||||
}
|
}
|
||||||
int Clear_EOL(void)
|
|
||||||
{
|
Clear_EOL() {
|
||||||
reverse_out();
|
reverse_out();
|
||||||
tputs(CE, 1, outc);
|
tputs(CE, 1, outc);
|
||||||
}
|
}
|
||||||
int StartGuide(unsigned short * row, unsigned short * col)
|
|
||||||
|
StartGuide(row, col) unsigned short* row, *col;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
|
|
@ -401,7 +413,8 @@ int StartGuide(unsigned short * row, unsigned short * col)
|
||||||
}
|
}
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
int EndGuide(unsigned short row, unsigned short col)
|
|
||||||
|
EndGuide(row, col) unsigned short row, col;
|
||||||
{
|
{
|
||||||
if(status_line) {
|
if(status_line) {
|
||||||
tputs(FS, 1, outc);
|
tputs(FS, 1, outc);
|
||||||
|
|
@ -411,12 +424,12 @@ int EndGuide(unsigned short row, unsigned short col)
|
||||||
Flush();
|
Flush();
|
||||||
master_flush_flag = 1;
|
master_flush_flag = 1;
|
||||||
}
|
}
|
||||||
int Flush(void)
|
|
||||||
{
|
Flush() {
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
int Cscroll(void)
|
|
||||||
{
|
Cscroll() {
|
||||||
|
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
56
douon.c
56
douon.c
|
|
@ -37,8 +37,14 @@ static int Dpoint;
|
||||||
static struct douon_sj3 HenkanDouon[DOUON_N];
|
static struct douon_sj3 HenkanDouon[DOUON_N];
|
||||||
static wchar16_t Dkanji[BUFFLENGTH * 2];
|
static wchar16_t Dkanji[BUFFLENGTH * 2];
|
||||||
|
|
||||||
void go_gakusyuu(int n);
|
void go_gakusyuu();
|
||||||
int SJ_getdouon(wchar16_t * s, struct douon_sj3 * d, int n, int choice, int reconv)
|
|
||||||
|
SJ_getdouon(s, d, n, choice, reconv)
|
||||||
|
wchar16_t* s;
|
||||||
|
struct douon_sj3* d;
|
||||||
|
int n;
|
||||||
|
int choice;
|
||||||
|
int reconv;
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
|
|
@ -57,8 +63,8 @@ int SJ_getdouon(wchar16_t * s, struct douon_sj3 * d, int n, int choice, int reco
|
||||||
} else
|
} else
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
int exec_douon(void)
|
|
||||||
{
|
exec_douon() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int val;
|
int val;
|
||||||
|
|
||||||
|
|
@ -75,7 +81,8 @@ int exec_douon(void)
|
||||||
if(!val)
|
if(!val)
|
||||||
Rdisp();
|
Rdisp();
|
||||||
}
|
}
|
||||||
int wrap_douon(int back)
|
|
||||||
|
wrap_douon(back) int back;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int val;
|
int val;
|
||||||
|
|
@ -95,7 +102,10 @@ int wrap_douon(int back)
|
||||||
if(!val)
|
if(!val)
|
||||||
Rdisp();
|
Rdisp();
|
||||||
}
|
}
|
||||||
int Cdouon(wchar16_t * yomi, int gnum)
|
|
||||||
|
Cdouon(yomi, gnum)
|
||||||
|
wchar16_t* yomi;
|
||||||
|
int gnum;
|
||||||
{
|
{
|
||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
@ -219,7 +229,8 @@ int Cdouon(wchar16_t * yomi, int gnum)
|
||||||
|
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
int Dselect(int lim)
|
|
||||||
|
Dselect(lim) int lim;
|
||||||
{
|
{
|
||||||
extern int keyvalue;
|
extern int keyvalue;
|
||||||
int c, num;
|
int c, num;
|
||||||
|
|
@ -252,7 +263,12 @@ int Dselect(int lim)
|
||||||
}
|
}
|
||||||
return (lim + 1);
|
return (lim + 1);
|
||||||
}
|
}
|
||||||
int Gdouon(wchar16_t * yomi, int num, int choice, int reconv)
|
|
||||||
|
Gdouon(yomi, num, choice, reconv)
|
||||||
|
wchar16_t* yomi;
|
||||||
|
int num;
|
||||||
|
int choice;
|
||||||
|
int reconv;
|
||||||
{
|
{
|
||||||
|
|
||||||
int len;
|
int len;
|
||||||
|
|
@ -268,7 +284,8 @@ int Gdouon(wchar16_t * yomi, int num, int choice, int reconv)
|
||||||
if(HenkanDouon[Dpoint].valid)
|
if(HenkanDouon[Dpoint].valid)
|
||||||
PushGD(num, &HenkanDouon[Dpoint].dcid);
|
PushGD(num, &HenkanDouon[Dpoint].dcid);
|
||||||
}
|
}
|
||||||
int Sdouon(int Choice)
|
|
||||||
|
Sdouon(Choice) int Choice;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
@ -339,7 +356,8 @@ tail:
|
||||||
cv->Bkettei[cv->Bnum] = Bend;
|
cv->Bkettei[cv->Bnum] = Bend;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int Rdouon(int back)
|
|
||||||
|
Rdouon(back) int back;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
@ -370,7 +388,9 @@ int Rdouon(int back)
|
||||||
}
|
}
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
int Bkanji(wchar16_t * kanji)
|
|
||||||
|
Bkanji(kanji)
|
||||||
|
wchar16_t* kanji;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -391,12 +411,14 @@ int Bkanji(wchar16_t * kanji)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct studyrec Gdata[BUFFLENGTH];
|
struct studyrec Gdata[BUFFLENGTH];
|
||||||
int PushGD(int num, struct studyrec * wordid)
|
|
||||||
|
PushGD(num, wordid) int num;
|
||||||
|
struct studyrec* wordid;
|
||||||
{
|
{
|
||||||
Gdata[num] = *wordid;
|
Gdata[num] = *wordid;
|
||||||
}
|
}
|
||||||
int cl_gakusyuu(void)
|
|
||||||
{
|
cl_gakusyuu() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, j;
|
int i, j;
|
||||||
int o_point, n_point;
|
int o_point, n_point;
|
||||||
|
|
@ -419,7 +441,8 @@ int cl_gakusyuu(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int check_and_gakusyuu(int m, int n)
|
|
||||||
|
check_and_gakusyuu(m, n) int m, n;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
@ -435,7 +458,8 @@ int check_and_gakusyuu(int m, int n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void go_gakusyuu(int n)
|
void
|
||||||
|
go_gakusyuu(n) int n;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
|
||||||
73
edit.c
73
edit.c
|
|
@ -30,12 +30,13 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
|
|
||||||
void Chain(int n, int len);
|
void Chain();
|
||||||
|
|
||||||
static wchar16_t* jpoint;
|
static wchar16_t* jpoint;
|
||||||
static int iedit, jedit;
|
static int iedit, jedit;
|
||||||
static int ilen, jlen;
|
static int ilen, jlen;
|
||||||
int push_obj(int i, int j)
|
|
||||||
|
push_obj(i, j) int i, j;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
|
|
@ -46,7 +47,8 @@ int push_obj(int i, int j)
|
||||||
iedit = cv->Bkettei[i];
|
iedit = cv->Bkettei[i];
|
||||||
jedit = cv->Bkettei[j];
|
jedit = cv->Bkettei[j];
|
||||||
}
|
}
|
||||||
int pop_obj(int i, int j)
|
|
||||||
|
pop_obj(i, j) int i, j;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
|
|
@ -57,8 +59,8 @@ int pop_obj(int i, int j)
|
||||||
cv->Bkettei[i] = iedit;
|
cv->Bkettei[i] = iedit;
|
||||||
cv->Bkettei[j] = jedit;
|
cv->Bkettei[j] = jedit;
|
||||||
}
|
}
|
||||||
int Bbig(void)
|
|
||||||
{
|
Bbig() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
int moji, last, val;
|
int moji, last, val;
|
||||||
|
|
@ -114,7 +116,8 @@ int Bbig(void)
|
||||||
pop_obj(i, j);
|
pop_obj(i, j);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int Bsmall(int small)
|
|
||||||
|
Bsmall(small) int small;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, j, k, moji;
|
int i, j, k, moji;
|
||||||
|
|
@ -208,8 +211,8 @@ int Bsmall(int small)
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
void Bdelete(void)
|
|
||||||
{
|
void Bdelete() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, j, deletelen, val;
|
int i, j, deletelen, val;
|
||||||
|
|
||||||
|
|
@ -256,7 +259,9 @@ void Bdelete(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Chain(int n, int len)
|
void
|
||||||
|
Chain(n, len) int n;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -301,8 +306,7 @@ void Chain(int n, int len)
|
||||||
|
|
||||||
static int Elimit;
|
static int Elimit;
|
||||||
static int Ehlimit;
|
static int Ehlimit;
|
||||||
int exec_edit(void)
|
exec_edit() {
|
||||||
{
|
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int edit, inc, i;
|
int edit, inc, i;
|
||||||
wchar16_t* s;
|
wchar16_t* s;
|
||||||
|
|
@ -555,7 +559,10 @@ int exec_edit(void)
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int getnum(wchar16_t number[], int * numpoint)
|
|
||||||
|
getnum(number, numpoint)
|
||||||
|
wchar16_t number[];
|
||||||
|
int* numpoint;
|
||||||
{
|
{
|
||||||
char temp[3];
|
char temp[3];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
@ -570,7 +577,12 @@ int getnum(wchar16_t number[], int * numpoint)
|
||||||
|
|
||||||
return (atoi(temp));
|
return (atoi(temp));
|
||||||
}
|
}
|
||||||
int Replace(wchar16_t * Hs, wchar16_t * Zs, unsigned short * omode, int cur, int num)
|
|
||||||
|
Replace(Hs, Zs, omode, cur, num)
|
||||||
|
wchar16_t* Hs,
|
||||||
|
*Zs;
|
||||||
|
unsigned short* omode;
|
||||||
|
int cur, num;
|
||||||
{
|
{
|
||||||
int i, len, inc;
|
int i, len, inc;
|
||||||
int beep_on, icur1, icur2;
|
int beep_on, icur1, icur2;
|
||||||
|
|
@ -643,7 +655,12 @@ int Replace(wchar16_t * Hs, wchar16_t * Zs, unsigned short * omode, int cur, int
|
||||||
beep();
|
beep();
|
||||||
return (num);
|
return (num);
|
||||||
}
|
}
|
||||||
int Substitute(wchar16_t * Hs, wchar16_t * Zs, unsigned short * omode, int * cur, int num)
|
|
||||||
|
Substitute(Hs, Zs, omode, cur, num)
|
||||||
|
wchar16_t* Hs,
|
||||||
|
*Zs;
|
||||||
|
unsigned short* omode;
|
||||||
|
int * cur, num;
|
||||||
{
|
{
|
||||||
wchar16_t work[DLEN + 1];
|
wchar16_t work[DLEN + 1];
|
||||||
wchar16_t work2[DLEN + 1];
|
wchar16_t work2[DLEN + 1];
|
||||||
|
|
@ -667,7 +684,12 @@ int Substitute(wchar16_t * Hs, wchar16_t * Zs, unsigned short * omode, int * cur
|
||||||
len -= num;
|
len -= num;
|
||||||
return (len);
|
return (len);
|
||||||
}
|
}
|
||||||
int Insert(wchar16_t * Hs, wchar16_t * Zs, unsigned short * omode, int cur)
|
|
||||||
|
Insert(Hs, Zs, omode, cur)
|
||||||
|
wchar16_t* Hs,
|
||||||
|
*Zs;
|
||||||
|
unsigned short* omode;
|
||||||
|
int cur;
|
||||||
{
|
{
|
||||||
int inc, len, i;
|
int inc, len, i;
|
||||||
int limit, hlimit, ylen, res, icur, rlen;
|
int limit, hlimit, ylen, res, icur, rlen;
|
||||||
|
|
@ -732,7 +754,12 @@ int Insert(wchar16_t * Hs, wchar16_t * Zs, unsigned short * omode, int cur)
|
||||||
}
|
}
|
||||||
return (len);
|
return (len);
|
||||||
}
|
}
|
||||||
int EditDel(wchar16_t * Hs, wchar16_t * Zs, unsigned short * omode, int cur, int num)
|
|
||||||
|
EditDel(Hs, Zs, omode, cur, num)
|
||||||
|
wchar16_t* Hs,
|
||||||
|
*Zs;
|
||||||
|
unsigned short* omode;
|
||||||
|
int cur, num;
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
int icur, len, rlen;
|
int icur, len, rlen;
|
||||||
|
|
@ -762,7 +789,12 @@ int EditDel(wchar16_t * Hs, wchar16_t * Zs, unsigned short * omode, int cur, int
|
||||||
}
|
}
|
||||||
return (len);
|
return (len);
|
||||||
}
|
}
|
||||||
int chhstr(wchar16_t * Hs, wchar16_t * Zs, unsigned short * omode, int cur)
|
|
||||||
|
chhstr(Hs, Zs, omode, cur)
|
||||||
|
wchar16_t* Hs,
|
||||||
|
*Zs;
|
||||||
|
unsigned short* omode;
|
||||||
|
int cur;
|
||||||
{
|
{
|
||||||
int i, j, len;
|
int i, j, len;
|
||||||
int prep, nextp;
|
int prep, nextp;
|
||||||
|
|
@ -788,7 +820,9 @@ int chhstr(wchar16_t * Hs, wchar16_t * Zs, unsigned short * omode, int cur)
|
||||||
wscpy(hkp, &Hs[hnextp]);
|
wscpy(hkp, &Hs[hnextp]);
|
||||||
wscpy(&Hs[hprep], hkana);
|
wscpy(&Hs[hprep], hkana);
|
||||||
}
|
}
|
||||||
int Print_EOL(wchar16_t * s)
|
|
||||||
|
Print_EOL(s)
|
||||||
|
wchar16_t* s;
|
||||||
{
|
{
|
||||||
if(*s != '\0')
|
if(*s != '\0')
|
||||||
SJ_print(s);
|
SJ_print(s);
|
||||||
|
|
@ -796,7 +830,8 @@ int Print_EOL(wchar16_t * s)
|
||||||
if(*s != '\0')
|
if(*s != '\0')
|
||||||
backspace(wcbyte(s));
|
backspace(wcbyte(s));
|
||||||
}
|
}
|
||||||
int backspace(int n)
|
|
||||||
|
backspace(n) int n;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
||||||
48
etc.c
48
etc.c
|
|
@ -35,8 +35,9 @@ static char rehname[SHORTLENGTH * 2];
|
||||||
extern char* cur_serv;
|
extern char* cur_serv;
|
||||||
static int dcflag = 0;
|
static int dcflag = 0;
|
||||||
|
|
||||||
void disp_version(int c);
|
void disp_version();
|
||||||
int exec_etc(int key)
|
|
||||||
|
exec_etc(key) int key;
|
||||||
{
|
{
|
||||||
unsigned short row, col;
|
unsigned short row, col;
|
||||||
int inc;
|
int inc;
|
||||||
|
|
@ -147,7 +148,8 @@ int exec_etc(int key)
|
||||||
Ssbun(1);
|
Ssbun(1);
|
||||||
return (KEY_NORMAL);
|
return (KEY_NORMAL);
|
||||||
}
|
}
|
||||||
int Ssbun(int flag)
|
|
||||||
|
Ssbun(flag) int flag;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
static short ScurBun, SpreBun;
|
static short ScurBun, SpreBun;
|
||||||
|
|
@ -164,7 +166,8 @@ int Ssbun(int flag)
|
||||||
SpreBun = cv->PreBun;
|
SpreBun = cv->PreBun;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int etc_map(int key)
|
|
||||||
|
etc_map(key) int key;
|
||||||
{
|
{
|
||||||
extern int u_etckeys;
|
extern int u_etckeys;
|
||||||
extern int Uetckey[], Uetcval[];
|
extern int Uetckey[], Uetcval[];
|
||||||
|
|
@ -201,8 +204,8 @@ int etc_map(int key)
|
||||||
}
|
}
|
||||||
return (val);
|
return (val);
|
||||||
}
|
}
|
||||||
int helplevel(void)
|
|
||||||
{
|
helplevel() {
|
||||||
wchar16_t wtmp[BUFFLENGTH];
|
wchar16_t wtmp[BUFFLENGTH];
|
||||||
unsigned char mtmp[BUFFLENGTH];
|
unsigned char mtmp[BUFFLENGTH];
|
||||||
unsigned char tmp[BUFFLENGTH];
|
unsigned char tmp[BUFFLENGTH];
|
||||||
|
|
@ -226,7 +229,8 @@ int helplevel(void)
|
||||||
guide_print_pause(WCGHelp, wtmp);
|
guide_print_pause(WCGHelp, wtmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void disp_version(int c)
|
void
|
||||||
|
disp_version(c) int c;
|
||||||
{
|
{
|
||||||
extern char *Version, *Copyright, *Date;
|
extern char *Version, *Copyright, *Date;
|
||||||
char tmp[BUFFLENGTH];
|
char tmp[BUFFLENGTH];
|
||||||
|
|
@ -242,8 +246,8 @@ void disp_version(int c)
|
||||||
(void)mbstowcs(wtmp, tmp, BUFFLENGTH);
|
(void)mbstowcs(wtmp, tmp, BUFFLENGTH);
|
||||||
guide_print_pause(0, wtmp);
|
guide_print_pause(0, wtmp);
|
||||||
}
|
}
|
||||||
int exec_sjrc(void)
|
|
||||||
{
|
exec_sjrc() {
|
||||||
extern char RCfile[];
|
extern char RCfile[];
|
||||||
char tmp[BUFFLENGTH];
|
char tmp[BUFFLENGTH];
|
||||||
unsigned char SUCCorFAIL[BUFFLENGTH];
|
unsigned char SUCCorFAIL[BUFFLENGTH];
|
||||||
|
|
@ -274,8 +278,8 @@ int exec_sjrc(void)
|
||||||
|
|
||||||
static int weight = 3;
|
static int weight = 3;
|
||||||
static int seed = 100000;
|
static int seed = 100000;
|
||||||
int change_weight(void)
|
|
||||||
{
|
change_weight() {
|
||||||
int c;
|
int c;
|
||||||
char s[2];
|
char s[2];
|
||||||
char tmp[BUFFLENGTH];
|
char tmp[BUFFLENGTH];
|
||||||
|
|
@ -293,7 +297,8 @@ int change_weight(void)
|
||||||
weight = atoi(s);
|
weight = atoi(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int UsecWeight(int sw)
|
|
||||||
|
UsecWeight(sw) int sw;
|
||||||
{
|
{
|
||||||
|
|
||||||
if(sw)
|
if(sw)
|
||||||
|
|
@ -301,7 +306,8 @@ int UsecWeight(int sw)
|
||||||
else
|
else
|
||||||
return (seed * weight);
|
return (seed * weight);
|
||||||
}
|
}
|
||||||
int dconnect(int aflag)
|
|
||||||
|
dconnect(aflag) int aflag;
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
char tmp[BUFFLENGTH];
|
char tmp[BUFFLENGTH];
|
||||||
|
|
@ -331,16 +337,17 @@ int dconnect(int aflag)
|
||||||
}
|
}
|
||||||
return (dcflag);
|
return (dcflag);
|
||||||
}
|
}
|
||||||
int set_dcflag(int flag)
|
|
||||||
|
set_dcflag(flag) int flag;
|
||||||
{
|
{
|
||||||
dcflag = flag;
|
dcflag = flag;
|
||||||
}
|
}
|
||||||
int IsDcflag(void)
|
|
||||||
{
|
IsDcflag() {
|
||||||
return (dcflag);
|
return (dcflag);
|
||||||
}
|
}
|
||||||
int reconnect(void)
|
|
||||||
{
|
reconnect() {
|
||||||
int inc, err;
|
int inc, err;
|
||||||
char tmp[BUFFLENGTH], *hp;
|
char tmp[BUFFLENGTH], *hp;
|
||||||
char newserv[SHORTLENGTH * 2], *nsp;
|
char newserv[SHORTLENGTH * 2], *nsp;
|
||||||
|
|
@ -427,7 +434,10 @@ int reconnect(void)
|
||||||
}
|
}
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
int guide_print_pause(wchar16_t * s1, wchar16_t * s2)
|
|
||||||
|
guide_print_pause(s1, s2)
|
||||||
|
wchar16_t* s1,
|
||||||
|
*s2;
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
|
|
||||||
54
eucmessage.c
54
eucmessage.c
|
|
@ -249,8 +249,8 @@ wchar16_t* WcMessages[CURMESSAGES];
|
||||||
|
|
||||||
#define CURWCVTKEY 29
|
#define CURWCVTKEY 29
|
||||||
struct wcvtkey wcvtkeytbl[CURWCVTKEY];
|
struct wcvtkey wcvtkeytbl[CURWCVTKEY];
|
||||||
int init_wcvtkey(void)
|
|
||||||
{
|
int init_wcvtkey() {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for(i = 0; i < CURWCVTKEY; i++) {
|
for(i = 0; i < CURWCVTKEY; i++) {
|
||||||
|
|
@ -288,8 +288,8 @@ int init_wcvtkey(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
wchar16_t* comstr[KEY_OTHER];
|
wchar16_t* comstr[KEY_OTHER];
|
||||||
int init_comstr(void)
|
|
||||||
{
|
int init_comstr() {
|
||||||
comstr[0] = WCStart;
|
comstr[0] = WCStart;
|
||||||
comstr[1] = WCHenkan;
|
comstr[1] = WCHenkan;
|
||||||
comstr[2] = WCMuhen;
|
comstr[2] = WCMuhen;
|
||||||
|
|
@ -328,8 +328,8 @@ int init_comstr(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct valtbl hin_val[5];
|
struct valtbl hin_val[5];
|
||||||
int init_hin_val(void)
|
|
||||||
{
|
int init_hin_val() {
|
||||||
hin_val[0].keyword = WCMeishi;
|
hin_val[0].keyword = WCMeishi;
|
||||||
hin_val[0].ivalue = SJ3_H_NRMNOUN;
|
hin_val[0].ivalue = SJ3_H_NRMNOUN;
|
||||||
hin_val[1].keyword = WCMyouji;
|
hin_val[1].keyword = WCMyouji;
|
||||||
|
|
@ -342,30 +342,16 @@ int init_hin_val(void)
|
||||||
hin_val[4].ivalue = SJ3_H_SILVERB;
|
hin_val[4].ivalue = SJ3_H_SILVERB;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int set_func(struct wordent word[]);
|
extern int set_func(), set_etckeys(), set_intr(),
|
||||||
extern int set_etckeys(struct wordent word[]);
|
set_delkey(), set_goto(), set_trap(), set_init_mode(),
|
||||||
extern int set_intr(struct wordent word[]);
|
set_helpmenu(), set_defcode(), set_muhenkan(), set_muedit(),
|
||||||
extern int set_delkey(struct wordent word[]);
|
set_m_toggle(), set_guide(), set_forkshell(), set_bstudy(),
|
||||||
extern int set_goto(struct wordent word[]);
|
set_silent(), set_flush_conversion(), set_rkebell(), set_server(),
|
||||||
extern int set_trap(struct wordent word[]);
|
set_dict();
|
||||||
extern int set_init_mode(struct wordent word[]);
|
|
||||||
extern int set_helpmenu(struct wordent word[]);
|
|
||||||
extern int set_defcode(struct wordent word[]);
|
|
||||||
extern int set_muhenkan(struct wordent word[]);
|
|
||||||
extern int set_muedit(struct wordent word[]);
|
|
||||||
extern int set_m_toggle(struct wordent word[]);
|
|
||||||
extern int set_guide(struct wordent word[]);
|
|
||||||
extern int set_forkshell(struct wordent word[]);
|
|
||||||
extern int set_bstudy(struct wordent word[]);
|
|
||||||
extern int set_silent(struct wordent word[]);
|
|
||||||
extern int set_flush_conversion(struct wordent word[]);
|
|
||||||
extern int set_rkebell(struct wordent word[]);
|
|
||||||
extern int set_server(struct wordent word[]);
|
|
||||||
extern int set_dict(struct wordent word[]);
|
|
||||||
#define CURFUNCS 29
|
#define CURFUNCS 29
|
||||||
struct functbl funcs[CURFUNCS];
|
struct functbl funcs[CURFUNCS];
|
||||||
int init_funcs(void)
|
|
||||||
{
|
int init_funcs() {
|
||||||
funcs[0].keyword = WCKey;
|
funcs[0].keyword = WCKey;
|
||||||
funcs[0].func = set_func;
|
funcs[0].func = set_func;
|
||||||
funcs[1].keyword = WCEscape;
|
funcs[1].keyword = WCEscape;
|
||||||
|
|
@ -415,8 +401,8 @@ int init_funcs(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct valtbl mode_val[5];
|
struct valtbl mode_val[5];
|
||||||
int init_mode_val(void)
|
|
||||||
{
|
int init_mode_val() {
|
||||||
mode_val[0].keyword = WCHalpha;
|
mode_val[0].keyword = WCHalpha;
|
||||||
mode_val[0].ivalue = MODE_HALPHA;
|
mode_val[0].ivalue = MODE_HALPHA;
|
||||||
mode_val[1].keyword = WCZalpha;
|
mode_val[1].keyword = WCZalpha;
|
||||||
|
|
@ -430,8 +416,8 @@ int init_mode_val(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct valtbl code_val[8];
|
struct valtbl code_val[8];
|
||||||
int init_code_val(void)
|
|
||||||
{
|
int init_code_val() {
|
||||||
code_val[0].keyword = WCShiftjis;
|
code_val[0].keyword = WCShiftjis;
|
||||||
code_val[0].ivalue = CODE_SJIS;
|
code_val[0].ivalue = CODE_SJIS;
|
||||||
code_val[1].keyword = WCSjis;
|
code_val[1].keyword = WCSjis;
|
||||||
|
|
@ -449,8 +435,8 @@ int init_code_val(void)
|
||||||
code_val[7].keyword = WCKuten2;
|
code_val[7].keyword = WCKuten2;
|
||||||
code_val[7].ivalue = CODE_KUTEN2;
|
code_val[7].ivalue = CODE_KUTEN2;
|
||||||
}
|
}
|
||||||
int init_messages(void)
|
|
||||||
{
|
int init_messages() {
|
||||||
#define LOCALELEN 20
|
#define LOCALELEN 20
|
||||||
char cur_loc[LOCALELEN];
|
char cur_loc[LOCALELEN];
|
||||||
char* loc;
|
char* loc;
|
||||||
|
|
|
||||||
11
execute.c
11
execute.c
|
|
@ -71,13 +71,12 @@ static Client* cur_cli;
|
||||||
static unsigned char defaultchar[2] = {(unsigned char)0x81, (unsigned char)0x40};
|
static unsigned char defaultchar[2] = {(unsigned char)0x81, (unsigned char)0x40};
|
||||||
static int defuse = 0, defuse2 = 0;
|
static int defuse = 0, defuse2 = 0;
|
||||||
|
|
||||||
DictFile* opendict(char* name, char* passwd);
|
DictFile* opendict();
|
||||||
int closedict(DictFile* dfp);
|
int closedict();
|
||||||
StdyFile* openstdy(char* name, char* passwd);
|
StdyFile* openstdy();
|
||||||
int closestdy(StdyFile* sfp);
|
int closestdy();
|
||||||
|
|
||||||
unsigned char* put_ndata(unsigned char* p, int n);
|
unsigned char *put_ndata(), *put_string();
|
||||||
unsigned char* put_string(unsigned char* p);
|
|
||||||
|
|
||||||
int make_full_path(char* path) {
|
int make_full_path(char* path) {
|
||||||
char tmp[PathNameLen];
|
char tmp[PathNameLen];
|
||||||
|
|
|
||||||
|
|
@ -169,13 +169,13 @@ void clear_ukeys(void) {
|
||||||
Unumber = 0;
|
Unumber = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int set_func(struct wordent word[]) {
|
void set_func(struct wordent word[]) {
|
||||||
int i, num;
|
int i, num;
|
||||||
wchar16_t * p, *s;
|
wchar16_t * p, *s;
|
||||||
struct wcvtkey* ckeyp;
|
struct wcvtkey* ckeyp;
|
||||||
|
|
||||||
if(Unumber >= UKEYNUM)
|
if(Unumber >= UKEYNUM)
|
||||||
return 0;
|
return;
|
||||||
for(i = 0; i < KEY_OTHER && *comstr[i] != '\0'; i++) {
|
for(i = 0; i < KEY_OTHER && *comstr[i] != '\0'; i++) {
|
||||||
if(match(word[1].word_str, comstr[i])) {
|
if(match(word[1].word_str, comstr[i])) {
|
||||||
p = word[2].word_str;
|
p = word[2].word_str;
|
||||||
|
|
@ -185,7 +185,7 @@ int set_func(struct wordent word[]) {
|
||||||
if(wscmp(p, ckeyp->key_word) == 0) {
|
if(wscmp(p, ckeyp->key_word) == 0) {
|
||||||
p = ckeyp->key_seq;
|
p = ckeyp->key_seq;
|
||||||
if(*p == '\0')
|
if(*p == '\0')
|
||||||
return 0;
|
return;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ckeyp++;
|
ckeyp++;
|
||||||
|
|
@ -201,10 +201,9 @@ int set_func(struct wordent word[]) {
|
||||||
comvalue[comnumber++] = comstrvalue[i];
|
comvalue[comnumber++] = comstrvalue[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wchar16_t
|
wchar16_t
|
||||||
|
|
|
||||||
28
fuzoku.c
28
fuzoku.c
|
|
@ -32,9 +32,13 @@
|
||||||
#include "sj_right.h"
|
#include "sj_right.h"
|
||||||
#include "sj_yomi.h"
|
#include "sj_yomi.h"
|
||||||
|
|
||||||
CLREC* argclrec(int len);
|
CLREC* argclrec();
|
||||||
int terminate(TypeCnct right, unsigned char * yomi);
|
int terminate();
|
||||||
static int fzkstrcmp(unsigned char * yptr, unsigned char * fzkp, int * saml)
|
|
||||||
|
static int fzkstrcmp(yptr, fzkp, saml)
|
||||||
|
unsigned char* yptr;
|
||||||
|
unsigned char* fzkp;
|
||||||
|
int* saml;
|
||||||
{
|
{
|
||||||
int asklen, nkrlen;
|
int asklen, nkrlen;
|
||||||
|
|
||||||
|
|
@ -67,7 +71,11 @@ static int fzkstrcmp(unsigned char * yptr, unsigned char * fzkp, int * saml)
|
||||||
|
|
||||||
return MATCH;
|
return MATCH;
|
||||||
}
|
}
|
||||||
void setclrec(JREC * jrec, unsigned char * yptr, TypeCnct right)
|
|
||||||
|
void setclrec(jrec, yptr, right)
|
||||||
|
JREC* jrec;
|
||||||
|
unsigned char* yptr;
|
||||||
|
TypeCnct right;
|
||||||
{
|
{
|
||||||
CLREC* new;
|
CLREC* new;
|
||||||
TypeGram hinsi;
|
TypeGram hinsi;
|
||||||
|
|
@ -143,7 +151,10 @@ void setclrec(JREC * jrec, unsigned char * yptr, TypeCnct right)
|
||||||
} else
|
} else
|
||||||
new->kubun = K_TAIGEN;
|
new->kubun = K_TAIGEN;
|
||||||
}
|
}
|
||||||
static int fzkcnct(TypeCnct right, TypeCnct left)
|
|
||||||
|
static int fzkcnct(right, left)
|
||||||
|
TypeCnct right;
|
||||||
|
TypeCnct left;
|
||||||
{
|
{
|
||||||
unsigned char* cncttbl;
|
unsigned char* cncttbl;
|
||||||
|
|
||||||
|
|
@ -156,7 +167,12 @@ static int fzkcnct(TypeCnct right, TypeCnct left)
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
void srchfzk(JREC * jrec, unsigned char * yptr, TypeCnct right, int level)
|
|
||||||
|
void srchfzk(jrec, yptr, right, level)
|
||||||
|
JREC* jrec;
|
||||||
|
unsigned char* yptr;
|
||||||
|
TypeCnct right;
|
||||||
|
int level;
|
||||||
{
|
{
|
||||||
unsigned char* fzk;
|
unsigned char* fzk;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
|
||||||
77
henkan.c
77
henkan.c
|
|
@ -32,11 +32,11 @@
|
||||||
#include "wchar16.h"
|
#include "wchar16.h"
|
||||||
#include "kctype.h"
|
#include "kctype.h"
|
||||||
|
|
||||||
void Rdisp(void);
|
void Rdisp();
|
||||||
|
|
||||||
int i_point;
|
int i_point;
|
||||||
int exec_henkan(void)
|
|
||||||
{
|
exec_henkan() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, j;
|
int i, j;
|
||||||
wchar16_t * s, *p;
|
wchar16_t * s, *p;
|
||||||
|
|
@ -215,7 +215,8 @@ int exec_henkan(void)
|
||||||
cv->e_point = 0;
|
cv->e_point = 0;
|
||||||
cv->Kanji = 1;
|
cv->Kanji = 1;
|
||||||
}
|
}
|
||||||
int addBun(int cur, int end)
|
|
||||||
|
addBun(cur, end) int cur, end;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
@ -228,7 +229,8 @@ int addBun(int cur, int end)
|
||||||
cv->Bun[i].deststr = cv->Bun[i - 1].deststr;
|
cv->Bun[i].deststr = cv->Bun[i - 1].deststr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int delspan(int cur)
|
|
||||||
|
delspan(cur) int cur;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
@ -240,7 +242,8 @@ int delspan(int cur)
|
||||||
cv->kettei[i] = cv->kettei[i + 1];
|
cv->kettei[i] = cv->kettei[i + 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int delBun(int cur, int end)
|
|
||||||
|
delBun(cur, end) int cur, end;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
@ -255,11 +258,16 @@ int delBun(int cur, int end)
|
||||||
cv->Bun[i].deststr = cv->Bun[i + 1].deststr;
|
cv->Bun[i].deststr = cv->Bun[i + 1].deststr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int IsHex(wchar16_t c)
|
|
||||||
|
IsHex(c)
|
||||||
|
wchar16_t c;
|
||||||
{
|
{
|
||||||
return (iswxdigit(c));
|
return (iswxdigit(c));
|
||||||
}
|
}
|
||||||
int Getcode(wchar16_t * in, wchar16_t * out)
|
|
||||||
|
Getcode(in, out)
|
||||||
|
wchar16_t* in,
|
||||||
|
*out;
|
||||||
{
|
{
|
||||||
int c, i, j;
|
int c, i, j;
|
||||||
unsigned char s[5];
|
unsigned char s[5];
|
||||||
|
|
@ -327,7 +335,10 @@ int Getcode(wchar16_t * in, wchar16_t * out)
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned char load_mode;
|
static unsigned char load_mode;
|
||||||
int load_bun(int num, wchar16_t * s, unsigned char type)
|
|
||||||
|
load_bun(num, s, type) int num;
|
||||||
|
wchar16_t* s;
|
||||||
|
unsigned char type;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int len, ilen;
|
int len, ilen;
|
||||||
|
|
@ -395,7 +406,10 @@ int load_bun(int num, wchar16_t * s, unsigned char type)
|
||||||
}
|
}
|
||||||
return (len);
|
return (len);
|
||||||
}
|
}
|
||||||
int load_bun2(int num, wchar16_t * htmp, wchar16_t * ztmp, unsigned short * omode)
|
|
||||||
|
load_bun2(num, htmp, ztmp, omode) int num;
|
||||||
|
wchar16_t * htmp, *ztmp;
|
||||||
|
unsigned short* omode;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -437,7 +451,11 @@ int load_bun2(int num, wchar16_t * htmp, wchar16_t * ztmp, unsigned short * omod
|
||||||
}
|
}
|
||||||
return (len);
|
return (len);
|
||||||
}
|
}
|
||||||
int getistr(wchar16_t * s, wchar16_t * ostr, int len)
|
|
||||||
|
getistr(s, ostr, len)
|
||||||
|
wchar16_t* s,
|
||||||
|
*ostr;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
int ipos, opos;
|
int ipos, opos;
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
@ -456,7 +474,8 @@ int getistr(wchar16_t * s, wchar16_t * ostr, int len)
|
||||||
*s = (wchar16_t)'\0';
|
*s = (wchar16_t)'\0';
|
||||||
return (rlen);
|
return (rlen);
|
||||||
}
|
}
|
||||||
int exec_muhenkan(int first)
|
|
||||||
|
exec_muhenkan(first) int first;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
|
|
@ -491,7 +510,9 @@ int exec_muhenkan(int first)
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned char Bstr_mode;
|
static unsigned char Bstr_mode;
|
||||||
int Bstr(int bnum, wchar16_t * s)
|
|
||||||
|
Bstr(bnum, s) int bnum;
|
||||||
|
wchar16_t* s;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, len;
|
int i, len;
|
||||||
|
|
@ -535,7 +556,8 @@ int Bstr(int bnum, wchar16_t * s)
|
||||||
len = -1;
|
len = -1;
|
||||||
return (len);
|
return (len);
|
||||||
}
|
}
|
||||||
int mode_muhenkan(int mod, int bkettei)
|
|
||||||
|
mode_muhenkan(mod, bkettei) int mod, bkettei;
|
||||||
{
|
{
|
||||||
int def;
|
int def;
|
||||||
|
|
||||||
|
|
@ -550,7 +572,8 @@ int mode_muhenkan(int mod, int bkettei)
|
||||||
}
|
}
|
||||||
return (KEY_ZHIRA);
|
return (KEY_ZHIRA);
|
||||||
}
|
}
|
||||||
int Bchange(int mod)
|
|
||||||
|
Bchange(mod) int mod;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -644,8 +667,8 @@ Bdisp(redraw) {
|
||||||
}
|
}
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
void Rdisp(void)
|
|
||||||
{
|
void Rdisp() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i;
|
int i;
|
||||||
int Total;
|
int Total;
|
||||||
|
|
@ -691,7 +714,9 @@ void Rdisp(void)
|
||||||
Cgoto(Total);
|
Cgoto(Total);
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
int AfterAllPrint(int from, int Total)
|
|
||||||
|
AfterAllPrint(from, Total) int from;
|
||||||
|
int Total;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -735,8 +760,8 @@ int AfterAllPrint(int from, int Total)
|
||||||
Cgoto(Total);
|
Cgoto(Total);
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
void Bright(void)
|
|
||||||
{
|
void Bright() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int flag;
|
int flag;
|
||||||
|
|
||||||
|
|
@ -755,8 +780,8 @@ void Bright(void)
|
||||||
} while(cv->Plen[cv->CurBun] <= 0);
|
} while(cv->Plen[cv->CurBun] <= 0);
|
||||||
Rdisp();
|
Rdisp();
|
||||||
}
|
}
|
||||||
void Bleft(void)
|
|
||||||
{
|
void Bleft() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int flag;
|
int flag;
|
||||||
|
|
||||||
|
|
@ -775,8 +800,8 @@ void Bleft(void)
|
||||||
} while(cv->Plen[cv->CurBun] <= 0);
|
} while(cv->Plen[cv->CurBun] <= 0);
|
||||||
Rdisp();
|
Rdisp();
|
||||||
}
|
}
|
||||||
void Blast(void)
|
|
||||||
{
|
void Blast() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
|
|
@ -789,8 +814,8 @@ void Blast(void)
|
||||||
}
|
}
|
||||||
Rdisp();
|
Rdisp();
|
||||||
}
|
}
|
||||||
void Btop(void)
|
|
||||||
{
|
void Btop() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
|
|
|
||||||
8
hinsi.c
8
hinsi.c
|
|
@ -221,7 +221,9 @@ static struct hlist {
|
||||||
{TANKANJI, "\303\261\264\301"},
|
{TANKANJI, "\303\261\264\301"},
|
||||||
{IKKATU, "\260\354\263\347"},
|
{IKKATU, "\260\354\263\347"},
|
||||||
{0, 0}};
|
{0, 0}};
|
||||||
char* hns2str(int code)
|
|
||||||
|
char* hns2str(code)
|
||||||
|
int code;
|
||||||
{
|
{
|
||||||
struct hlist* p;
|
struct hlist* p;
|
||||||
|
|
||||||
|
|
@ -232,7 +234,9 @@ char* hns2str(int code)
|
||||||
|
|
||||||
return "ERROR";
|
return "ERROR";
|
||||||
}
|
}
|
||||||
int str2hns(char * str)
|
|
||||||
|
int str2hns(str)
|
||||||
|
char* str;
|
||||||
{
|
{
|
||||||
struct hlist* p;
|
struct hlist* p;
|
||||||
|
|
||||||
|
|
|
||||||
12
init.c
12
init.c
|
|
@ -28,7 +28,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
void seg_count(DICT * dict)
|
|
||||||
|
void seg_count(dict)
|
||||||
|
DICT* dict;
|
||||||
{
|
{
|
||||||
unsigned char* p;
|
unsigned char* p;
|
||||||
unsigned char* q;
|
unsigned char* q;
|
||||||
|
|
@ -47,7 +49,9 @@ void seg_count(DICT * dict)
|
||||||
|
|
||||||
dict->segunit = (segcnt == 0) ? 1 : segcnt;
|
dict->segunit = (segcnt == 0) ? 1 : segcnt;
|
||||||
}
|
}
|
||||||
void mkidxtbl(DICT * dict)
|
|
||||||
|
void mkidxtbl(dict)
|
||||||
|
DICT* dict;
|
||||||
{
|
{
|
||||||
unsigned char* p;
|
unsigned char* p;
|
||||||
TypeDicSeg seg;
|
TypeDicSeg seg;
|
||||||
|
|
@ -65,8 +69,8 @@ void mkidxtbl(DICT * dict)
|
||||||
while(*p++);
|
while(*p++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void initwork(void)
|
|
||||||
{
|
void initwork() {
|
||||||
jrt1st = jrt2nd = maxjptr = (JREC*)0;
|
jrt1st = jrt2nd = maxjptr = (JREC*)0;
|
||||||
clt1st = clt2nd = maxclptr = (CLREC*)0;
|
clt1st = clt2nd = maxclptr = (CLREC*)0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
26
kigou.c
26
kigou.c
|
|
@ -39,15 +39,13 @@ static int lastcode = BEGIN_CODE;
|
||||||
|
|
||||||
static unsigned short row, col;
|
static unsigned short row, col;
|
||||||
|
|
||||||
void input_kigou(int basecode, int code, int increse);
|
void input_kigou();
|
||||||
int kigou(void)
|
|
||||||
{
|
kigou() {
|
||||||
extern int keyvalue;
|
extern int keyvalue;
|
||||||
int increse, code, basecode;
|
int increse, code, basecode;
|
||||||
int inc, ki, low;
|
int inc, ki, low;
|
||||||
unsigned short num;
|
unsigned short num, CheckCcode(), strtocode();
|
||||||
unsigned short CheckCcode(wchar16_t c);
|
|
||||||
unsigned short strtocode(void);
|
|
||||||
int rval;
|
int rval;
|
||||||
|
|
||||||
increse = INCRESE;
|
increse = INCRESE;
|
||||||
|
|
@ -179,14 +177,16 @@ int kigou(void)
|
||||||
disp_mode();
|
disp_mode();
|
||||||
return (rval);
|
return (rval);
|
||||||
}
|
}
|
||||||
int IsRedraw(int c)
|
|
||||||
|
IsRedraw(c) int c;
|
||||||
{
|
{
|
||||||
if(c == 0x0c)
|
if(c == 0x0c)
|
||||||
return (1);
|
return (1);
|
||||||
else
|
else
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int IsCKey(int inc)
|
|
||||||
|
IsCKey(inc) int inc;
|
||||||
{
|
{
|
||||||
switch(inc) {
|
switch(inc) {
|
||||||
case 'l':
|
case 'l':
|
||||||
|
|
@ -201,7 +201,8 @@ int IsCKey(int inc)
|
||||||
return (KEY_NORMAL);
|
return (KEY_NORMAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int guide_kigou(int bcode, int code, int increse)
|
|
||||||
|
guide_kigou(bcode, code, increse) int bcode, code, increse;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
extern wchar16_t Mguide[];
|
extern wchar16_t Mguide[];
|
||||||
|
|
@ -231,7 +232,8 @@ int guide_kigou(int bcode, int code, int increse)
|
||||||
backspace(8 + (bcode + increse - code) * 2);
|
backspace(8 + (bcode + increse - code) * 2);
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
int pkigou(int code)
|
|
||||||
|
pkigou(code) int code;
|
||||||
{
|
{
|
||||||
wchar16_t tmp[3];
|
wchar16_t tmp[3];
|
||||||
unsigned short ccode;
|
unsigned short ccode;
|
||||||
|
|
@ -252,7 +254,9 @@ int pkigou(int code)
|
||||||
SJ_print(tmp);
|
SJ_print(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void input_kigou(int basecode, int code, int increse)
|
void
|
||||||
|
input_kigou(basecode, code, increse) int basecode,
|
||||||
|
code, increse;
|
||||||
{
|
{
|
||||||
wchar16_t s[2];
|
wchar16_t s[2];
|
||||||
unsigned short ccode, svlen;
|
unsigned short ccode, svlen;
|
||||||
|
|
|
||||||
10
level1.c
10
level1.c
|
|
@ -136,12 +136,12 @@ put_ndata(void* p, int n) {
|
||||||
|
|
||||||
static int
|
static int
|
||||||
put_over(int buflen, int n,
|
put_over(int buflen, int n,
|
||||||
unsigned char* (*func1)(void*, int), void* str1, int len1,
|
unsigned char* (*func1)(), void* str1, int len1,
|
||||||
unsigned char* (*func2)(void*, int), void* str2, int len2,
|
unsigned char* (*func2)(), void* str2, int len2,
|
||||||
unsigned char* (*func3)(void*, int), void* str3, int len3,
|
unsigned char* (*func3)(), void* str3, int len3,
|
||||||
unsigned char* (*func4)(void*, int), void* str4, int len4) {
|
unsigned char* (*func4)(), void* str4, int len4) {
|
||||||
#define ARGNUM 4
|
#define ARGNUM 4
|
||||||
unsigned char* (*func[ARGNUM])(void*, int);
|
unsigned char* (*func[ARGNUM])();
|
||||||
unsigned char* data[ARGNUM];
|
unsigned char* data[ARGNUM];
|
||||||
int len[ARGNUM];
|
int len[ARGNUM];
|
||||||
int i;
|
int i;
|
||||||
|
|
|
||||||
69
libif.c
69
libif.c
|
|
@ -33,7 +33,6 @@
|
||||||
#endif
|
#endif
|
||||||
#include "wchar16.h"
|
#include "wchar16.h"
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <string.h>
|
|
||||||
#include "kctype.h"
|
#include "kctype.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
|
@ -41,17 +40,19 @@ extern char user_name[];
|
||||||
extern char * cur_serv, **serv_list;
|
extern char * cur_serv, **serv_list;
|
||||||
extern char** dict_list;
|
extern char** dict_list;
|
||||||
extern int dict_num;
|
extern int dict_num;
|
||||||
char* chmyhname(char* hname);
|
char* chmyhname();
|
||||||
|
|
||||||
extern int current_locale;
|
extern int current_locale;
|
||||||
int sjislen(unsigned char * str, int max);
|
int sjislen(), euclen();
|
||||||
int euclen(unsigned char * str, int max);
|
|
||||||
|
|
||||||
int (*len_func[3])(unsigned char*, int) = {0, sjislen, euclen};
|
int (*len_func[3])() = {0, sjislen, euclen};
|
||||||
|
|
||||||
#define YOMILEN 32
|
#define YOMILEN 32
|
||||||
#define KLEN 64
|
#define KLEN 64
|
||||||
int SJ2_henkan(wchar16_t * yomiout, struct bunsetu_sj3 * bun, wchar16_t * kanjiout, int kanjilen)
|
|
||||||
|
SJ2_henkan(yomiout, bun, kanjiout, kanjilen) struct bunsetu_sj3* bun;
|
||||||
|
wchar16_t *yomiout, *kanjiout;
|
||||||
|
int kanjilen;
|
||||||
{
|
{
|
||||||
int retv;
|
int retv;
|
||||||
SJ3_BUNSETU sbun[BUFFLENGTH];
|
SJ3_BUNSETU sbun[BUFFLENGTH];
|
||||||
|
|
@ -83,7 +84,9 @@ int SJ2_henkan(wchar16_t * yomiout, struct bunsetu_sj3 * bun, wchar16_t * kanjio
|
||||||
|
|
||||||
return (retv);
|
return (retv);
|
||||||
}
|
}
|
||||||
int sjislen(unsigned char * str, int max)
|
int sjislen(str, max)
|
||||||
|
unsigned char* str;
|
||||||
|
int max;
|
||||||
{
|
{
|
||||||
int len = 0, bytes = 1;
|
int len = 0, bytes = 1;
|
||||||
|
|
||||||
|
|
@ -102,7 +105,9 @@ int sjislen(unsigned char * str, int max)
|
||||||
}
|
}
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
int euclen(unsigned char * str, int max)
|
|
||||||
|
euclen(str, max) unsigned char* str;
|
||||||
|
int max;
|
||||||
{
|
{
|
||||||
int len = 0, bytes = 1;
|
int len = 0, bytes = 1;
|
||||||
|
|
||||||
|
|
@ -129,7 +134,13 @@ int euclen(unsigned char * str, int max)
|
||||||
}
|
}
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
int SJ2_getdouon(wchar16_t * s, struct douon_sj3 * d, int n, int choice, int reconv)
|
|
||||||
|
SJ2_getdouon(s, d, n, choice, reconv)
|
||||||
|
wchar16_t* s;
|
||||||
|
struct douon_sj3* d;
|
||||||
|
int n;
|
||||||
|
int choice;
|
||||||
|
int reconv;
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
SJ3_DOUON d_sjis[DOUON_N];
|
SJ3_DOUON d_sjis[DOUON_N];
|
||||||
|
|
@ -162,11 +173,16 @@ int SJ2_getdouon(wchar16_t * s, struct douon_sj3 * d, int n, int choice, int rec
|
||||||
}
|
}
|
||||||
return (ret + 1);
|
return (ret + 1);
|
||||||
}
|
}
|
||||||
int SJ2_study(struct studyrec * dcid)
|
|
||||||
|
SJ2_study(dcid) struct studyrec* dcid;
|
||||||
{
|
{
|
||||||
sj3_gakusyuu(dcid);
|
sj3_gakusyuu(dcid);
|
||||||
}
|
}
|
||||||
int SJ2_clstudy(wchar16_t * yomi1, wchar16_t * yomi2, struct studyrec * dcid)
|
|
||||||
|
SJ2_clstudy(yomi1, yomi2, dcid)
|
||||||
|
wchar16_t* yomi1,
|
||||||
|
*yomi2;
|
||||||
|
struct studyrec* dcid;
|
||||||
{
|
{
|
||||||
unsigned char y1[BUFFLENGTH * 2];
|
unsigned char y1[BUFFLENGTH * 2];
|
||||||
unsigned char y2[BUFFLENGTH * 2];
|
unsigned char y2[BUFFLENGTH * 2];
|
||||||
|
|
@ -180,7 +196,11 @@ int SJ2_clstudy(wchar16_t * yomi1, wchar16_t * yomi2, struct studyrec * dcid)
|
||||||
sj3_gakusyuu2_euc(y1, y2, dcid);
|
sj3_gakusyuu2_euc(y1, y2, dcid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int SJ2_toroku(wchar16_t * yomi, wchar16_t * kanji, int hinshi)
|
|
||||||
|
SJ2_toroku(yomi, kanji, hinshi)
|
||||||
|
wchar16_t* yomi,
|
||||||
|
*kanji;
|
||||||
|
int hinshi;
|
||||||
{
|
{
|
||||||
unsigned char y[(YOMILEN + 1) * 3];
|
unsigned char y[(YOMILEN + 1) * 3];
|
||||||
unsigned char k[(KLEN + 1) * 3];
|
unsigned char k[(KLEN + 1) * 3];
|
||||||
|
|
@ -195,7 +215,11 @@ int SJ2_toroku(wchar16_t * yomi, wchar16_t * kanji, int hinshi)
|
||||||
}
|
}
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
int SJ2_syoukyo(wchar16_t * yomi, wchar16_t * kanji, int hinshi)
|
|
||||||
|
SJ2_syoukyo(yomi, kanji, hinshi)
|
||||||
|
wchar16_t* yomi,
|
||||||
|
*kanji;
|
||||||
|
int hinshi;
|
||||||
{
|
{
|
||||||
unsigned char y[(YOMILEN + 1) * 3];
|
unsigned char y[(YOMILEN + 1) * 3];
|
||||||
unsigned char k[(KLEN + 1) * 3];
|
unsigned char k[(KLEN + 1) * 3];
|
||||||
|
|
@ -210,7 +234,8 @@ int SJ2_syoukyo(wchar16_t * yomi, wchar16_t * kanji, int hinshi)
|
||||||
}
|
}
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
int sj_check_error(int err)
|
|
||||||
|
sj_check_error(err) int err;
|
||||||
{
|
{
|
||||||
if(err & SJ3_SERVER_DEAD)
|
if(err & SJ3_SERVER_DEAD)
|
||||||
SJ_warnning(WCServer_Dead);
|
SJ_warnning(WCServer_Dead);
|
||||||
|
|
@ -231,8 +256,8 @@ int sj_check_error(int err)
|
||||||
if(err & SJ3_CANNOT_OPEN_STUDY)
|
if(err & SJ3_CANNOT_OPEN_STUDY)
|
||||||
SJ_warnning(WCNopen_Study);
|
SJ_warnning(WCNopen_Study);
|
||||||
}
|
}
|
||||||
int SJ2_reconnect(void)
|
|
||||||
{
|
SJ2_reconnect() {
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
sj3_close();
|
sj3_close();
|
||||||
|
|
@ -242,12 +267,12 @@ int SJ2_reconnect(void)
|
||||||
err = sj3_open(chmyhname(cur_serv), user_name);
|
err = sj3_open(chmyhname(cur_serv), user_name);
|
||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
int SJ2_henkan_end(void)
|
|
||||||
{
|
SJ2_henkan_end() {
|
||||||
sj3_close();
|
sj3_close();
|
||||||
}
|
}
|
||||||
int SJ2_henkan_init(void)
|
|
||||||
{
|
SJ2_henkan_init() {
|
||||||
int i, err;
|
int i, err;
|
||||||
int* err_dict = NULL;
|
int* err_dict = NULL;
|
||||||
int err_num = 0;
|
int err_num = 0;
|
||||||
|
|
@ -286,8 +311,8 @@ int SJ2_henkan_init(void)
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int sj3_autocon(void)
|
|
||||||
{
|
sj3_autocon() {
|
||||||
int i, err;
|
int i, err;
|
||||||
|
|
||||||
if(dict_num && dict_list) {
|
if(dict_num && dict_list) {
|
||||||
|
|
|
||||||
|
|
@ -316,7 +316,7 @@ douon_knj(DouonRec* drec) {
|
||||||
int i;
|
int i;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
unsigned char* p;
|
unsigned char* p;
|
||||||
unsigned char* knjofscvt(unsigned char* ptr, int len, int* ret);
|
unsigned char* knjofscvt();
|
||||||
HinsiRec* hrec;
|
HinsiRec* hrec;
|
||||||
KanjiRec* krec;
|
KanjiRec* krec;
|
||||||
|
|
||||||
|
|
|
||||||
24
memory2.c
24
memory2.c
|
|
@ -29,9 +29,10 @@
|
||||||
|
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
|
|
||||||
void free_jrec(JREC* p);
|
void free_jrec(), free_clrec();
|
||||||
void free_clrec(CLREC* p);
|
|
||||||
JREC* free_jlst(JREC * p)
|
JREC* free_jlst(p)
|
||||||
|
JREC* p;
|
||||||
{
|
{
|
||||||
JREC* jpk;
|
JREC* jpk;
|
||||||
JREC* jp;
|
JREC* jp;
|
||||||
|
|
@ -60,7 +61,10 @@ JREC* free_jlst(JREC * p)
|
||||||
|
|
||||||
return jpk;
|
return jpk;
|
||||||
}
|
}
|
||||||
CLREC* free_clst(CLREC * p, int l)
|
|
||||||
|
CLREC* free_clst(p, l)
|
||||||
|
CLREC* p;
|
||||||
|
int l;
|
||||||
{
|
{
|
||||||
CLREC* cpk;
|
CLREC* cpk;
|
||||||
CLREC* cp;
|
CLREC* cp;
|
||||||
|
|
@ -100,7 +104,9 @@ CLREC* free_clst(CLREC * p, int l)
|
||||||
|
|
||||||
return cpk;
|
return cpk;
|
||||||
}
|
}
|
||||||
void free_clall(CLREC * p)
|
|
||||||
|
void free_clall(p)
|
||||||
|
CLREC* p;
|
||||||
{
|
{
|
||||||
CLREC* next;
|
CLREC* next;
|
||||||
|
|
||||||
|
|
@ -111,7 +117,9 @@ void free_clall(CLREC * p)
|
||||||
p = next;
|
p = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void free_jall(JREC * p)
|
|
||||||
|
void free_jall(p)
|
||||||
|
JREC* p;
|
||||||
{
|
{
|
||||||
JREC* next;
|
JREC* next;
|
||||||
|
|
||||||
|
|
@ -121,8 +129,8 @@ void free_jall(JREC * p)
|
||||||
p = next;
|
p = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void freework(void)
|
|
||||||
{
|
void freework() {
|
||||||
free_clall(maxclptr);
|
free_clall(maxclptr);
|
||||||
clt1st = maxclptr = NULL;
|
clt1st = maxclptr = NULL;
|
||||||
|
|
||||||
|
|
|
||||||
19
mk2claus.c
19
mk2claus.c
|
|
@ -30,15 +30,12 @@
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
#include "sj_right.h"
|
#include "sj_right.h"
|
||||||
|
|
||||||
int terminate(TypeCnct right, unsigned char * yomi);
|
int terminate(), priority();
|
||||||
int priority(CLREC * clrec);
|
void mkjiritu(), mkbunsetu(), wakachi(), pritiny();
|
||||||
void mkjiritu(int mode);
|
void free_clall(), free_jall();
|
||||||
void mkbunsetu(void);
|
|
||||||
void wakachi(void);
|
static int set2nd(clrec)
|
||||||
void pritiny(void);
|
CLREC* clrec;
|
||||||
void free_clall(CLREC * p);
|
|
||||||
void free_jall(JREC * p);
|
|
||||||
static int set2nd(CLREC * clrec)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
CLREC* rec2;
|
CLREC* rec2;
|
||||||
|
|
@ -59,8 +56,8 @@ static int set2nd(CLREC * clrec)
|
||||||
|
|
||||||
return rec2 ? (clrec->cllen + rec2->cllen) : (clrec->cllen);
|
return rec2 ? (clrec->cllen + rec2->cllen) : (clrec->cllen);
|
||||||
}
|
}
|
||||||
void mk2claus(void)
|
|
||||||
{
|
void mk2claus() {
|
||||||
unsigned char* keepptr;
|
unsigned char* keepptr;
|
||||||
int keeplen;
|
int keeplen;
|
||||||
CLREC* clrec;
|
CLREC* clrec;
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,8 @@
|
||||||
#include "sj_hinsi.h"
|
#include "sj_hinsi.h"
|
||||||
#include "kanakan.h"
|
#include "kanakan.h"
|
||||||
|
|
||||||
int terminate(TypeCnct right, unsigned char * yomi);
|
int terminate();
|
||||||
void setclrec(JREC * jrec, unsigned char * yptr, TypeCnct right);
|
void setclrec(), srchfzk();
|
||||||
void srchfzk(JREC * jrec, unsigned char * yptr, TypeCnct right, int level);
|
|
||||||
|
|
||||||
void mkbunsetu(void) {
|
void mkbunsetu(void) {
|
||||||
JREC* jrec;
|
JREC* jrec;
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
#include "kanakan.h"
|
#include "kanakan.h"
|
||||||
|
|
||||||
int srchhead(void);
|
int srchhead();
|
||||||
|
|
||||||
static void dic_mu(int mode);
|
static void dic_mu(int mode);
|
||||||
static void dic_cl(void);
|
static void dic_cl(void);
|
||||||
|
|
|
||||||
5
mvmemd.c
5
mvmemd.c
|
|
@ -29,7 +29,10 @@
|
||||||
|
|
||||||
#include "sj_rename.h"
|
#include "sj_rename.h"
|
||||||
#include "sj_typedef.h"
|
#include "sj_typedef.h"
|
||||||
void mvmemd(unsigned char * src, unsigned char * dest, int len)
|
|
||||||
|
void mvmemd(src, dest, len) unsigned char* src;
|
||||||
|
unsigned char* dest;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
while(len-- > 0) *(--dest) = *(--src);
|
while(len-- > 0) *(--dest) = *(--src);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
5
mvmemi.c
5
mvmemi.c
|
|
@ -29,7 +29,10 @@
|
||||||
|
|
||||||
#include "sj_rename.h"
|
#include "sj_rename.h"
|
||||||
#include "sj_typedef.h"
|
#include "sj_typedef.h"
|
||||||
void mvmemi(unsigned char * src, unsigned char * dest, int len)
|
|
||||||
|
void mvmemi(src, dest, len) unsigned char* src;
|
||||||
|
unsigned char* dest;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
while(len-- > 0) *dest++ = *src++;
|
while(len-- > 0) *dest++ = *src++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,12 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
static char* getttys(int f);
|
static char* getttys();
|
||||||
static char* ttys = "/etc/ttys";
|
static char* ttys = "/etc/ttys";
|
||||||
|
|
||||||
#define NULL 0
|
#define NULL 0
|
||||||
int nmttyslot(char * name)
|
|
||||||
|
nmttyslot(name) char* name;
|
||||||
{
|
{
|
||||||
char *tp, *p;
|
char *tp, *p;
|
||||||
int s, tf;
|
int s, tf;
|
||||||
|
|
@ -62,7 +63,9 @@ int nmttyslot(char * name)
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char* getttys(int f)
|
static char*
|
||||||
|
getttys(f)
|
||||||
|
int f;
|
||||||
{
|
{
|
||||||
static char line[LINESIZE];
|
static char line[LINESIZE];
|
||||||
char* lp;
|
char* lp;
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
#include "sj_yomi.h"
|
#include "sj_yomi.h"
|
||||||
#include "kanakan.h"
|
#include "kanakan.h"
|
||||||
|
|
||||||
unsigned char* skiphblk(unsigned char * ptr);
|
unsigned char* skiphblk();
|
||||||
|
|
||||||
static void add_yomi(void);
|
static void add_yomi(void);
|
||||||
static void cd2sjh_chr(unsigned char ch, unsigned char* dst);
|
static void cd2sjh_chr(unsigned char ch, unsigned char* dst);
|
||||||
|
|
|
||||||
12
ph2knj.c
12
ph2knj.c
|
|
@ -32,12 +32,12 @@
|
||||||
#include "sj_yomi.h"
|
#include "sj_yomi.h"
|
||||||
#include "kanakan.h"
|
#include "kanakan.h"
|
||||||
|
|
||||||
int sj2cd_chr(unsigned char * euc, unsigned char * yomi);
|
int sj2cd_chr();
|
||||||
void mk2claus(void);
|
void mk2claus();
|
||||||
void freework(void);
|
void freework();
|
||||||
void selclrec(void);
|
void selclrec();
|
||||||
CLREC* free_clst(CLREC * p, int l);
|
CLREC* free_clst();
|
||||||
JREC* free_jlst(JREC * p);
|
JREC* free_jlst();
|
||||||
|
|
||||||
int ph2knj(unsigned char* zyomi, unsigned char* kanji, int knjlen) {
|
int ph2knj(unsigned char* zyomi, unsigned char* kanji, int knjlen) {
|
||||||
unsigned char* ptr;
|
unsigned char* ptr;
|
||||||
|
|
|
||||||
26
priority.c
26
priority.c
|
|
@ -31,7 +31,9 @@
|
||||||
#include "sj_hinsi.h"
|
#include "sj_hinsi.h"
|
||||||
#include "sj_right.h"
|
#include "sj_right.h"
|
||||||
#include "sj_prty.h"
|
#include "sj_prty.h"
|
||||||
static int isfukusi(TypeGram hinsi)
|
|
||||||
|
static int isfukusi(hinsi)
|
||||||
|
TypeGram hinsi;
|
||||||
{
|
{
|
||||||
if(FUKUSI_1 <= hinsi && hinsi <= FUKUSI_7)
|
if(FUKUSI_1 <= hinsi && hinsi <= FUKUSI_7)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
@ -39,7 +41,9 @@ static int isfukusi(TypeGram hinsi)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
static int istaigen(TypeCnct right)
|
|
||||||
|
static int istaigen(right)
|
||||||
|
TypeCnct right;
|
||||||
{
|
{
|
||||||
if(right == R_MEISI || right == R_DMEISI || right == R_SMEISI1)
|
if(right == R_MEISI || right == R_DMEISI || right == R_SMEISI1)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
@ -49,7 +53,10 @@ static int istaigen(TypeCnct right)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
static int taicnt(TypeGram hinsi1, TypeGram hinsi2)
|
|
||||||
|
static int taicnt(hinsi1, hinsi2)
|
||||||
|
TypeGram hinsi1;
|
||||||
|
TypeGram hinsi2;
|
||||||
{
|
{
|
||||||
if(hinsi2 == TANKANJI) return 0;
|
if(hinsi2 == TANKANJI) return 0;
|
||||||
|
|
||||||
|
|
@ -73,7 +80,10 @@ static int taicnt(TypeGram hinsi1, TypeGram hinsi2)
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static int sttcnt(TypeGram hinsi1, TypeGram hinsi2)
|
|
||||||
|
static int sttcnt(hinsi1, hinsi2)
|
||||||
|
TypeGram hinsi1;
|
||||||
|
TypeGram hinsi2;
|
||||||
{
|
{
|
||||||
if(SETTOU_1 <= hinsi1 && hinsi1 <= SETTOU_5) {
|
if(SETTOU_1 <= hinsi1 && hinsi1 <= SETTOU_5) {
|
||||||
if(MEISI_1 <= hinsi2 && hinsi2 <= SUUSI)
|
if(MEISI_1 <= hinsi2 && hinsi2 <= SUUSI)
|
||||||
|
|
@ -81,7 +91,9 @@ static int sttcnt(TypeGram hinsi1, TypeGram hinsi2)
|
||||||
}
|
}
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
int priority(CLREC * clrec)
|
|
||||||
|
int priority(clrec)
|
||||||
|
CLREC* clrec;
|
||||||
{
|
{
|
||||||
int prty;
|
int prty;
|
||||||
CLREC* cl2rec;
|
CLREC* cl2rec;
|
||||||
|
|
@ -221,8 +233,8 @@ finish:
|
||||||
prty += 20 - clrec->cllen + clrec->jnode->jlen + clrec->gobiln;
|
prty += 20 - clrec->cllen + clrec->jnode->jlen + clrec->gobiln;
|
||||||
return (prty + prev);
|
return (prty + prev);
|
||||||
}
|
}
|
||||||
void pritiny(void)
|
|
||||||
{
|
void pritiny() {
|
||||||
CLREC* clrec;
|
CLREC* clrec;
|
||||||
int keeplen;
|
int keeplen;
|
||||||
int i, prty = 0;
|
int i, prty = 0;
|
||||||
|
|
|
||||||
126
rk_conv.c
126
rk_conv.c
|
|
@ -35,8 +35,9 @@ static char rcsid[] = "$Header: /export/work/contrib/sj3/sj3rkcv/RCS/rk_conv.c,v
|
||||||
#include "wchar16.h"
|
#include "wchar16.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#ifdef SVR4
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifndef SVR4
|
#else
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef __sony_news
|
#ifdef __sony_news
|
||||||
|
|
@ -111,18 +112,21 @@ static StrbufRec strpbuf, *strpp;
|
||||||
static wchar16_t* shp;
|
static wchar16_t* shp;
|
||||||
static YmibufRec ymipbuf, *ymipp;
|
static YmibufRec ymipbuf, *ymipp;
|
||||||
static unsigned short* yhp;
|
static unsigned short* yhp;
|
||||||
int sj3_rkcode(int code)
|
|
||||||
|
sj3_rkcode(code) int code;
|
||||||
{
|
{
|
||||||
if(code)
|
if(code)
|
||||||
file_code = SJ3_NO;
|
file_code = SJ3_NO;
|
||||||
}
|
}
|
||||||
int sj3_rkinit2(char * rkfile, int erase)
|
|
||||||
|
sj3_rkinit2(rkfile, erase) char* rkfile;
|
||||||
|
int erase;
|
||||||
{
|
{
|
||||||
rk_erase = erase;
|
rk_erase = erase;
|
||||||
return (sj3_rkinit_mb(rkfile));
|
return (sj3_rkinit_mb(rkfile));
|
||||||
}
|
}
|
||||||
int rcode_sjis_init(void)
|
|
||||||
{
|
rcode_sjis_init() {
|
||||||
int i, rkeylen = 0, ryomilen = 0, rstrlen = 0;
|
int i, rkeylen = 0, ryomilen = 0, rstrlen = 0;
|
||||||
int klen, ylen, slen, tablnum = 0, tablsize;
|
int klen, ylen, slen, tablnum = 0, tablsize;
|
||||||
unsigned char * mbstr, *mptr, mtmp[BUFSIZ], mtmp2[BUFSIZ];
|
unsigned char * mbstr, *mptr, mtmp[BUFSIZ], mtmp2[BUFSIZ];
|
||||||
|
|
@ -279,8 +283,8 @@ int rcode_sjis_init(void)
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
int rcode_euc_init(void)
|
|
||||||
{
|
rcode_euc_init() {
|
||||||
int i, rkeylen = 0, ryomilen = 0, rstrlen = 0;
|
int i, rkeylen = 0, ryomilen = 0, rstrlen = 0;
|
||||||
int klen, ylen, slen, tablnum = 0, tablsize;
|
int klen, ylen, slen, tablnum = 0, tablsize;
|
||||||
unsigned char * mbstr, *mptr, mtmp[BUFSIZ], mtmp2[BUFSIZ];
|
unsigned char * mbstr, *mptr, mtmp[BUFSIZ], mtmp2[BUFSIZ];
|
||||||
|
|
@ -437,15 +441,18 @@ int rcode_euc_init(void)
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
int sj3_rkinit(char * rkfile)
|
|
||||||
|
sj3_rkinit(rkfile) char* rkfile;
|
||||||
{
|
{
|
||||||
return sj3_rkinit_sub(rkfile, rcode_sjis_init);
|
return sj3_rkinit_sub(rkfile, rcode_sjis_init);
|
||||||
}
|
}
|
||||||
int sj3_rkinit_euc(char * rkfile)
|
|
||||||
|
sj3_rkinit_euc(rkfile) char* rkfile;
|
||||||
{
|
{
|
||||||
return sj3_rkinit_sub(rkfile, rcode_euc_init);
|
return sj3_rkinit_sub(rkfile, rcode_euc_init);
|
||||||
}
|
}
|
||||||
int sj3_rkinit_mb(char * rkfile)
|
|
||||||
|
sj3_rkinit_mb(rkfile) char* rkfile;
|
||||||
{
|
{
|
||||||
if(current_locale == LC_CTYPE_EUC)
|
if(current_locale == LC_CTYPE_EUC)
|
||||||
return sj3_rkinit_sub(rkfile, rcode_euc_init);
|
return sj3_rkinit_sub(rkfile, rcode_euc_init);
|
||||||
|
|
@ -453,18 +460,17 @@ int sj3_rkinit_mb(char * rkfile)
|
||||||
return sj3_rkinit_sub(rkfile, rcode_sjis_init);
|
return sj3_rkinit_sub(rkfile, rcode_sjis_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
int sj3_rkinit_sub(char* rkfile, int (*mbfunc)(void))
|
sj3_rkinit_sub(rkfile, mbfunc) char* rkfile;
|
||||||
|
int (*mbfunc)();
|
||||||
{
|
{
|
||||||
char* p;
|
char* p;
|
||||||
int len, klen, rlen, retv;
|
int len, klen, rlen, retv;
|
||||||
FILE* fp;
|
FILE * fp, *fopen();
|
||||||
char line[MAXLEN + 1];
|
char line[MAXLEN + 1];
|
||||||
wchar16_t rkey[MAXWLEN + 1], rstr[MAXWLEN + 1];
|
wchar16_t rkey[MAXWLEN + 1], rstr[MAXWLEN + 1];
|
||||||
unsigned short kstr[MAXWLEN + 1];
|
unsigned short kstr[MAXWLEN + 1];
|
||||||
char* getkey(char * istr, wchar16_t * ostr, int * len);
|
char * strcpy(), *getkey(), *rkgetyomi();
|
||||||
char* rkgetyomi(char * istr, wchar16_t * ostr, int * len);
|
RkTablW16 * rktp, *mktable();
|
||||||
RkTablW16 * rktp;
|
|
||||||
RkTablW16* mktable(wchar16_t * key, int len);
|
|
||||||
|
|
||||||
if(rkfile == NULL || *rkfile == NSTR)
|
if(rkfile == NULL || *rkfile == NSTR)
|
||||||
fp = stdin;
|
fp = stdin;
|
||||||
|
|
@ -519,7 +525,11 @@ int sj3_rkinit_sub(char* rkfile, int (*mbfunc)(void))
|
||||||
sj3_rkclear();
|
sj3_rkclear();
|
||||||
return (retv);
|
return (retv);
|
||||||
}
|
}
|
||||||
char* getkey(char * istr, wchar16_t * ostr, int * len)
|
|
||||||
|
char* getkey(istr, ostr, len)
|
||||||
|
char* istr;
|
||||||
|
wchar16_t* ostr;
|
||||||
|
int* len;
|
||||||
{
|
{
|
||||||
char c, *p;
|
char c, *p;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -570,7 +580,11 @@ char* getkey(char * istr, wchar16_t * ostr, int * len)
|
||||||
return (p);
|
return (p);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
char* rkgetyomi(char * istr, wchar16_t * ostr, int * len)
|
|
||||||
|
char* rkgetyomi(istr, ostr, len)
|
||||||
|
char* istr;
|
||||||
|
wchar16_t* ostr;
|
||||||
|
int* len;
|
||||||
{
|
{
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
unsigned char* p;
|
unsigned char* p;
|
||||||
|
|
@ -626,8 +640,8 @@ char* rkgetyomi(char * istr, wchar16_t * ostr, int * len)
|
||||||
return ((char*)p);
|
return ((char*)p);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
int cltable(void)
|
|
||||||
{
|
cltable() {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(rkpp != NULL) {
|
if(rkpp != NULL) {
|
||||||
|
|
@ -643,7 +657,11 @@ int cltable(void)
|
||||||
yhp = ymipp->ymibuf;
|
yhp = ymipp->ymibuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int chk_rstr(wchar16_t * rstr, wchar16_t * rkey, int rlen, int klen)
|
|
||||||
|
chk_rstr(rstr, rkey, rlen, klen)
|
||||||
|
wchar16_t* rstr,
|
||||||
|
*rkey;
|
||||||
|
int rlen, klen;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
wchar16_t* p;
|
wchar16_t* p;
|
||||||
|
|
@ -660,8 +678,8 @@ int chk_rstr(wchar16_t * rstr, wchar16_t * rkey, int rlen, int klen)
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
RkTablW16* rkalloc(void)
|
RkTablW16*
|
||||||
{
|
rkalloc() {
|
||||||
RkTablW16* rkp;
|
RkTablW16* rkp;
|
||||||
RkbufRec* rkbrp;
|
RkbufRec* rkbrp;
|
||||||
|
|
||||||
|
|
@ -692,7 +710,11 @@ RkTablW16* rkalloc(void)
|
||||||
rkp->next = NULL;
|
rkp->next = NULL;
|
||||||
return (rkp);
|
return (rkp);
|
||||||
}
|
}
|
||||||
int stradd(wchar16_t ** cp, wchar16_t * str, int len)
|
|
||||||
|
stradd(cp, str, len)
|
||||||
|
wchar16_t** cp;
|
||||||
|
wchar16_t* str;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
wchar16_t* strp;
|
wchar16_t* strp;
|
||||||
StrbufRec* sbrp;
|
StrbufRec* sbrp;
|
||||||
|
|
@ -723,7 +745,11 @@ int stradd(wchar16_t ** cp, wchar16_t * str, int len)
|
||||||
shp += len;
|
shp += len;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int kstradd(wchar16_t ** cp, wchar16_t * kstr, int len)
|
|
||||||
|
kstradd(cp, kstr, len)
|
||||||
|
wchar16_t** cp,
|
||||||
|
*kstr;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
wchar16_t* usp;
|
wchar16_t* usp;
|
||||||
|
|
@ -756,7 +782,10 @@ int kstradd(wchar16_t ** cp, wchar16_t * kstr, int len)
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
RkTablW16* mktable(wchar16_t * key, int len)
|
RkTablW16*
|
||||||
|
mktable(key, len)
|
||||||
|
wchar16_t* key;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
RkTablW16 * nrktp, *orktp;
|
RkTablW16 * nrktp, *orktp;
|
||||||
|
|
@ -799,23 +828,27 @@ RkTablW16* mktable(wchar16_t * key, int len)
|
||||||
}
|
}
|
||||||
return (rktp);
|
return (rktp);
|
||||||
}
|
}
|
||||||
int sj3_rkebell(int err)
|
|
||||||
|
sj3_rkebell(err) int err;
|
||||||
{
|
{
|
||||||
rk_errin = err;
|
rk_errin = err;
|
||||||
}
|
}
|
||||||
int sj3_rkclear(void)
|
|
||||||
{
|
sj3_rkclear() {
|
||||||
rline[0] = NSTR;
|
rline[0] = NSTR;
|
||||||
lstr[0] = NSTR;
|
lstr[0] = NSTR;
|
||||||
rktblp = NULL;
|
rktblp = NULL;
|
||||||
rk_klen = 0;
|
rk_klen = 0;
|
||||||
sj3_rkreset();
|
sj3_rkreset();
|
||||||
}
|
}
|
||||||
int sj3_rkreset(void)
|
|
||||||
{
|
sj3_rkreset() {
|
||||||
rk_cflag = -1;
|
rk_cflag = -1;
|
||||||
}
|
}
|
||||||
int sj3_rkconvc(wchar16_t c, unsigned int * rkstr)
|
|
||||||
|
sj3_rkconvc(c, rkstr)
|
||||||
|
wchar16_t c;
|
||||||
|
unsigned int* rkstr;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
wchar16_t * p, *q;
|
wchar16_t * p, *q;
|
||||||
|
|
@ -883,7 +916,11 @@ int sj3_rkconvc(wchar16_t c, unsigned int * rkstr)
|
||||||
}
|
}
|
||||||
*rkstr = RKEND;
|
*rkstr = RKEND;
|
||||||
}
|
}
|
||||||
int sj3_rkconv2(wchar16_t * wstr, unsigned int * kstr, int wlen)
|
|
||||||
|
sj3_rkconv2(wstr, kstr, wlen)
|
||||||
|
wchar16_t* wstr;
|
||||||
|
unsigned int* kstr;
|
||||||
|
int wlen;
|
||||||
{
|
{
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -977,7 +1014,9 @@ int sj3_rkconv2(wchar16_t * wstr, unsigned int * kstr, int wlen)
|
||||||
}
|
}
|
||||||
|
|
||||||
int sj3_rkconv_w16(wchar16_t*, wchar16_t*);
|
int sj3_rkconv_w16(wchar16_t*, wchar16_t*);
|
||||||
int sj3_rkconv(unsigned char * romaji, unsigned char * kana)
|
|
||||||
|
sj3_rkconv(romaji, kana) unsigned char* romaji;
|
||||||
|
unsigned char* kana;
|
||||||
{
|
{
|
||||||
wchar16_t* wstr;
|
wchar16_t* wstr;
|
||||||
int len, mflag = 0, ret;
|
int len, mflag = 0, ret;
|
||||||
|
|
@ -1020,7 +1059,9 @@ int sj3_rkconv(unsigned char * romaji, unsigned char * kana)
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int sj3_rkconv_euc(unsigned char * romaji, unsigned char * kana)
|
|
||||||
|
sj3_rkconv_euc(romaji, kana) unsigned char* romaji;
|
||||||
|
unsigned char* kana;
|
||||||
{
|
{
|
||||||
wchar16_t* wstr;
|
wchar16_t* wstr;
|
||||||
int len, mflag = 0, ret;
|
int len, mflag = 0, ret;
|
||||||
|
|
@ -1063,14 +1104,19 @@ int sj3_rkconv_euc(unsigned char * romaji, unsigned char * kana)
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int sj3_rkconv_mb(unsigned char * romaji, unsigned char * kana)
|
|
||||||
|
sj3_rkconv_mb(romaji, kana) unsigned char* romaji;
|
||||||
|
unsigned char* kana;
|
||||||
{
|
{
|
||||||
if(current_locale == LC_CTYPE_EUC)
|
if(current_locale == LC_CTYPE_EUC)
|
||||||
return sj3_rkconv_euc(romaji, kana);
|
return sj3_rkconv_euc(romaji, kana);
|
||||||
else
|
else
|
||||||
return sj3_rkconv(romaji, kana);
|
return sj3_rkconv(romaji, kana);
|
||||||
}
|
}
|
||||||
int sj3_rkconv_w16(wchar16_t * wstr, wchar16_t * kstr)
|
|
||||||
|
int sj3_rkconv_w16(wstr, kstr)
|
||||||
|
wchar16_t* wstr;
|
||||||
|
wchar16_t* kstr;
|
||||||
{
|
{
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -1129,7 +1175,11 @@ int sj3_rkconv_w16(wchar16_t * wstr, wchar16_t * kstr)
|
||||||
*kstr = NSTR;
|
*kstr = NSTR;
|
||||||
return (rlen);
|
return (rlen);
|
||||||
}
|
}
|
||||||
int rkmatch(wchar16_t * s1, wchar16_t * s2, int len)
|
|
||||||
|
rkmatch(s1, s2, len)
|
||||||
|
wchar16_t* s1,
|
||||||
|
*s2;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
||||||
37
romaji.c
37
romaji.c
|
|
@ -32,7 +32,9 @@
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
|
|
||||||
extern int rkerrbell;
|
extern int rkerrbell;
|
||||||
int exec_romaji(wchar16_t c)
|
|
||||||
|
exec_romaji(c)
|
||||||
|
wchar16_t c;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
wchar16_t* p;
|
wchar16_t* p;
|
||||||
|
|
@ -194,7 +196,8 @@ int exec_romaji(wchar16_t c)
|
||||||
cv->out_point = op;
|
cv->out_point = op;
|
||||||
return (i);
|
return (i);
|
||||||
}
|
}
|
||||||
int move_cur(int kval)
|
|
||||||
|
move_cur(kval) int kval;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -235,7 +238,8 @@ int move_cur(int kval)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int addten(unsigned short pos, unsigned short c)
|
|
||||||
|
addten(pos, c) unsigned short pos, c;
|
||||||
{
|
{
|
||||||
unsigned short prefix;
|
unsigned short prefix;
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
@ -244,14 +248,17 @@ int addten(unsigned short pos, unsigned short c)
|
||||||
prefix = cv->out_buf[pos];
|
prefix = cv->out_buf[pos];
|
||||||
return (sj_addten(prefix, c));
|
return (sj_addten(prefix, c));
|
||||||
}
|
}
|
||||||
int getipos(unsigned short pos)
|
|
||||||
|
getipos(pos) unsigned short pos;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
return (getipos2(cv->out_mode, pos));
|
return (getipos2(cv->out_mode, pos));
|
||||||
}
|
}
|
||||||
int getipos2(unsigned short * omode, unsigned short pos)
|
|
||||||
|
getipos2(omode, pos) unsigned short* omode;
|
||||||
|
unsigned short pos;
|
||||||
{
|
{
|
||||||
unsigned short ipos;
|
unsigned short ipos;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -262,7 +269,11 @@ int getipos2(unsigned short * omode, unsigned short pos)
|
||||||
}
|
}
|
||||||
return (ipos);
|
return (ipos);
|
||||||
}
|
}
|
||||||
int sj_rkconv(wchar16_t * s1, wchar16_t * s2, int len)
|
|
||||||
|
sj_rkconv(s1, s2, len)
|
||||||
|
wchar16_t* s1,
|
||||||
|
*s2;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
int i, rlen;
|
int i, rlen;
|
||||||
unsigned int* kp;
|
unsigned int* kp;
|
||||||
|
|
@ -315,7 +326,12 @@ int sj_rkconv(wchar16_t * s1, wchar16_t * s2, int len)
|
||||||
sj3_rkebell(rkerrbell);
|
sj3_rkebell(rkerrbell);
|
||||||
return (klen);
|
return (klen);
|
||||||
}
|
}
|
||||||
int sj_rkconv2(wchar16_t * s1, wchar16_t * s2, unsigned short * omode, int len)
|
|
||||||
|
sj_rkconv2(s1, s2, omode, len)
|
||||||
|
wchar16_t* s1,
|
||||||
|
*s2;
|
||||||
|
unsigned short* omode;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
int i, rlen;
|
int i, rlen;
|
||||||
unsigned int* kp;
|
unsigned int* kp;
|
||||||
|
|
@ -426,7 +442,12 @@ int sj_rkconv2(wchar16_t * s1, wchar16_t * s2, unsigned short * omode, int len)
|
||||||
sj3_rkebell(rkerrbell);
|
sj3_rkebell(rkerrbell);
|
||||||
return (klen);
|
return (klen);
|
||||||
}
|
}
|
||||||
int exec_romaji2(wchar16_t c, wchar16_t * hbuf, wchar16_t * kbuf, unsigned short * omode, int cur, int hcur)
|
|
||||||
|
exec_romaji2(c, hbuf, kbuf, omode, cur, hcur)
|
||||||
|
wchar16_t c,
|
||||||
|
*hbuf, *kbuf;
|
||||||
|
unsigned short* omode;
|
||||||
|
int cur, hcur;
|
||||||
{
|
{
|
||||||
unsigned short c1, cc;
|
unsigned short c1, cc;
|
||||||
unsigned int c2;
|
unsigned int c2;
|
||||||
|
|
|
||||||
110
screen.c
110
screen.c
|
|
@ -36,7 +36,8 @@ static wchar16_t* Guide;
|
||||||
static wchar16_t Nguide[LINE_LENGTH + 1];
|
static wchar16_t Nguide[LINE_LENGTH + 1];
|
||||||
static wchar16_t Cguide[LINE_LENGTH + 1];
|
static wchar16_t Cguide[LINE_LENGTH + 1];
|
||||||
wchar16_t Mguide[LINE_LENGTH + 1];
|
wchar16_t Mguide[LINE_LENGTH + 1];
|
||||||
int vbackchar(int n)
|
|
||||||
|
vbackchar(n) int n;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -48,24 +49,24 @@ int vbackchar(int n)
|
||||||
VBackspace();
|
VBackspace();
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
int wrap_off(void)
|
|
||||||
{
|
wrap_off() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
cv->wrap = 0;
|
cv->wrap = 0;
|
||||||
cv->PushCurrentVcol = cv->CurrentVcol;
|
cv->PushCurrentVcol = cv->CurrentVcol;
|
||||||
}
|
}
|
||||||
int wrap_on(void)
|
|
||||||
{
|
wrap_on() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
cv->wrap = 1;
|
cv->wrap = 1;
|
||||||
cv->CurrentVcol = cv->PushCurrentVcol;
|
cv->CurrentVcol = cv->PushCurrentVcol;
|
||||||
}
|
}
|
||||||
int Vput_space(void)
|
|
||||||
{
|
Vput_space() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
|
|
@ -76,8 +77,8 @@ int Vput_space(void)
|
||||||
Backspace();
|
Backspace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int VBackspace(void)
|
|
||||||
{
|
VBackspace() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -102,16 +103,25 @@ int VBackspace(void)
|
||||||
cv->CurrentVcol = cv->Vindex[cv->Vlen];
|
cv->CurrentVcol = cv->Vindex[cv->Vlen];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int master_out(wchar16_t * s, int n)
|
|
||||||
|
master_out(s, n)
|
||||||
|
wchar16_t* s;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
master_write(s, n);
|
master_write(s, n);
|
||||||
master_flush();
|
master_flush();
|
||||||
}
|
}
|
||||||
int master_write(wchar16_t * s, int n)
|
|
||||||
|
master_write(s, n)
|
||||||
|
wchar16_t* s;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
SJ_write(s, n);
|
SJ_write(s, n);
|
||||||
}
|
}
|
||||||
int vprintU(wchar16_t * s, char mod)
|
|
||||||
|
vprintU(s, mod)
|
||||||
|
wchar16_t* s;
|
||||||
|
char mod;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, col, oldcol, len;
|
int i, col, oldcol, len;
|
||||||
|
|
@ -142,7 +152,10 @@ int vprintU(wchar16_t * s, char mod)
|
||||||
cv->MaxVcol = cv->CurrentVcol;
|
cv->MaxVcol = cv->CurrentVcol;
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
int vprintR(wchar16_t * s, char mod)
|
|
||||||
|
vprintR(s, mod)
|
||||||
|
wchar16_t* s;
|
||||||
|
char mod;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, col, oldcol, len;
|
int i, col, oldcol, len;
|
||||||
|
|
@ -173,32 +186,42 @@ int vprintR(wchar16_t * s, char mod)
|
||||||
cv->MaxVcol = cv->CurrentVcol;
|
cv->MaxVcol = cv->CurrentVcol;
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
int IprintU(wchar16_t * s, int index)
|
|
||||||
|
IprintU(s, index)
|
||||||
|
wchar16_t* s;
|
||||||
|
int index;
|
||||||
{
|
{
|
||||||
Cgoto(index);
|
Cgoto(index);
|
||||||
printU(s);
|
printU(s);
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
int IprintR(wchar16_t * s, int index)
|
|
||||||
|
IprintR(s, index)
|
||||||
|
wchar16_t* s;
|
||||||
|
int index;
|
||||||
{
|
{
|
||||||
Cgoto(index);
|
Cgoto(index);
|
||||||
printR(s);
|
printR(s);
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
int printU(wchar16_t * s)
|
|
||||||
|
printU(s)
|
||||||
|
wchar16_t* s;
|
||||||
{
|
{
|
||||||
under_in();
|
under_in();
|
||||||
SJ_print(s);
|
SJ_print(s);
|
||||||
under_out();
|
under_out();
|
||||||
}
|
}
|
||||||
int printR(wchar16_t * s)
|
|
||||||
|
printR(s)
|
||||||
|
wchar16_t* s;
|
||||||
{
|
{
|
||||||
reverse_in();
|
reverse_in();
|
||||||
SJ_print(s);
|
SJ_print(s);
|
||||||
reverse_out();
|
reverse_out();
|
||||||
}
|
}
|
||||||
int Csave(void)
|
|
||||||
{
|
Csave() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
|
|
@ -207,7 +230,8 @@ int Csave(void)
|
||||||
cv->Vlen = 0;
|
cv->Vlen = 0;
|
||||||
cv->Vindex[cv->Vlen] = cv->MaxVcol = cv->CurrentVcol;
|
cv->Vindex[cv->Vlen] = cv->MaxVcol = cv->CurrentVcol;
|
||||||
}
|
}
|
||||||
int SetVcol(int index)
|
|
||||||
|
SetVcol(index) int index;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
|
|
@ -215,14 +239,15 @@ int SetVcol(int index)
|
||||||
cv->Vlen = index;
|
cv->Vlen = index;
|
||||||
cv->CurrentVcol = cv->Vindex[cv->Vlen];
|
cv->CurrentVcol = cv->Vindex[cv->Vlen];
|
||||||
}
|
}
|
||||||
int Cload(void)
|
|
||||||
{
|
Cload() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
CursorSet(cv->SavedRow, cv->SavedCol);
|
CursorSet(cv->SavedRow, cv->SavedCol);
|
||||||
}
|
}
|
||||||
int Cclear(int redraw)
|
|
||||||
|
Cclear(redraw) int redraw;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int spaces;
|
int spaces;
|
||||||
|
|
@ -238,7 +263,8 @@ int Cclear(int redraw)
|
||||||
Cload();
|
Cload();
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
int Cgoto(int index)
|
|
||||||
|
Cgoto(index) int index;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int row, col;
|
int row, col;
|
||||||
|
|
@ -249,8 +275,8 @@ int Cgoto(int index)
|
||||||
col = cv->CurrentVcol % cv->column;
|
col = cv->CurrentVcol % cv->column;
|
||||||
CursorSet(row, col);
|
CursorSet(row, col);
|
||||||
}
|
}
|
||||||
int ClearToMax(void)
|
|
||||||
{
|
ClearToMax() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int space;
|
int space;
|
||||||
|
|
||||||
|
|
@ -258,8 +284,8 @@ int ClearToMax(void)
|
||||||
space = cv->MaxVcol - cv->CurrentVcol;
|
space = cv->MaxVcol - cv->CurrentVcol;
|
||||||
put_space(space);
|
put_space(space);
|
||||||
}
|
}
|
||||||
int Ccheck(void)
|
|
||||||
{
|
Ccheck() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int row, tmp, diff;
|
int row, tmp, diff;
|
||||||
|
|
||||||
|
|
@ -274,7 +300,9 @@ int Ccheck(void)
|
||||||
cv->SavedRow -= (row - cv->line);
|
cv->SavedRow -= (row - cv->line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int spaceR(wchar16_t * s)
|
|
||||||
|
spaceR(s)
|
||||||
|
wchar16_t* s;
|
||||||
{
|
{
|
||||||
wchar16_t* t;
|
wchar16_t* t;
|
||||||
wchar16_t tmp[40];
|
wchar16_t tmp[40];
|
||||||
|
|
@ -293,8 +321,8 @@ int spaceR(wchar16_t * s)
|
||||||
printR(tmp);
|
printR(tmp);
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
int clear_guide_line(void)
|
|
||||||
{
|
clear_guide_line() {
|
||||||
unsigned short row, col;
|
unsigned short row, col;
|
||||||
|
|
||||||
StartGuide(&row, &col);
|
StartGuide(&row, &col);
|
||||||
|
|
@ -302,8 +330,8 @@ int clear_guide_line(void)
|
||||||
EndGuide(row, col);
|
EndGuide(row, col);
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
int print_guide_line(void)
|
|
||||||
{
|
print_guide_line() {
|
||||||
unsigned short row, col;
|
unsigned short row, col;
|
||||||
|
|
||||||
StartGuide(&row, &col);
|
StartGuide(&row, &col);
|
||||||
|
|
@ -312,7 +340,8 @@ int print_guide_line(void)
|
||||||
EndGuide(row, col);
|
EndGuide(row, col);
|
||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
int set_guide_line(int mode)
|
|
||||||
|
set_guide_line(mode) int mode;
|
||||||
{
|
{
|
||||||
|
|
||||||
switch(mode) {
|
switch(mode) {
|
||||||
|
|
@ -327,8 +356,8 @@ int set_guide_line(int mode)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int disp_mode(void)
|
|
||||||
{
|
disp_mode() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int c_code;
|
int c_code;
|
||||||
wchar16_t * Pmode, *Bmode;
|
wchar16_t * Pmode, *Bmode;
|
||||||
|
|
@ -395,13 +424,16 @@ int disp_mode(void)
|
||||||
wscat(Cguide, WCGmode);
|
wscat(Cguide, WCGmode);
|
||||||
print_guide_line();
|
print_guide_line();
|
||||||
}
|
}
|
||||||
int TopGuide(void)
|
|
||||||
{
|
TopGuide() {
|
||||||
unsigned short row, col;
|
unsigned short row, col;
|
||||||
|
|
||||||
StartGuide(&row, &col);
|
StartGuide(&row, &col);
|
||||||
}
|
}
|
||||||
int guide_print(wchar16_t * s1, wchar16_t * s2)
|
|
||||||
|
guide_print(s1, s2)
|
||||||
|
wchar16_t* s1,
|
||||||
|
*s2;
|
||||||
{
|
{
|
||||||
unsigned short row, col;
|
unsigned short row, col;
|
||||||
|
|
||||||
|
|
|
||||||
11
selclrec.c
11
selclrec.c
|
|
@ -29,13 +29,10 @@
|
||||||
|
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
|
|
||||||
void mkjiritu(int mode);
|
void free_clall(), free_jall(), mkjiritu(), mkbunsetu();
|
||||||
void mkbunsetu(void);
|
void wakachi();
|
||||||
void free_clall(CLREC * p);
|
|
||||||
void free_jall(JREC * p);
|
void selclrec() {
|
||||||
void wakachi(void);
|
|
||||||
void selclrec(void)
|
|
||||||
{
|
|
||||||
int len;
|
int len;
|
||||||
CLREC* rec;
|
CLREC* rec;
|
||||||
|
|
||||||
|
|
|
||||||
8
server.h
8
server.h
|
|
@ -66,10 +66,10 @@ void warning_out(char *s, int p1, int p2, int p3, int p4, int p5);
|
||||||
void logging_out(char *s, int p1, int p2, int p3, int p4, int p5);
|
void logging_out(char *s, int p1, int p2, int p3, int p4, int p5);
|
||||||
void debug_out(int lvl, char *s, int p1, int p2, int p3, int p4, int p5);
|
void debug_out(int lvl, char *s, int p1, int p2, int p3, int p4, int p5);
|
||||||
#else /* correct solution is to make the functions take arbitrary parameters... */
|
#else /* correct solution is to make the functions take arbitrary parameters... */
|
||||||
void error_out(char * fmt, int p1, int p2, int p3, int p4, int p5);
|
void error_out();
|
||||||
void warning_out(char* s, int p1, int p2, int p3, int p4, int p5);
|
void warning_out();
|
||||||
void logging_out(char* s, int p1, int p2, int p3, int p4, int p5);
|
void logging_out();
|
||||||
void debug_out(int lvl, char* s, int p1, int p2, int p3, int p4, int p5);
|
void debug_out();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* execute.c */
|
/* execute.c */
|
||||||
|
|
|
||||||
27
setup.c
27
setup.c
|
|
@ -118,7 +118,10 @@ cmpstr(unsigned char* src, unsigned char* dst) {
|
||||||
if(*dst) return -1;
|
if(*dst) return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static unsigned char* get_str(unsigned char * p, void * pv_dst)
|
|
||||||
|
static unsigned char* get_str(p, pv_dst)
|
||||||
|
unsigned char* p;
|
||||||
|
void* pv_dst;
|
||||||
{
|
{
|
||||||
char** dst;
|
char** dst;
|
||||||
|
|
||||||
|
|
@ -131,7 +134,9 @@ static unsigned char* get_str(unsigned char * p, void * pv_dst)
|
||||||
while(*p++);
|
while(*p++);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
static unsigned char* get_int(unsigned char * p, void * pv_dst)
|
static unsigned char* get_int(p, pv_dst)
|
||||||
|
unsigned char* p;
|
||||||
|
void* pv_dst;
|
||||||
{
|
{
|
||||||
char* fmt;
|
char* fmt;
|
||||||
int* dst;
|
int* dst;
|
||||||
|
|
@ -142,7 +147,9 @@ static unsigned char* get_int(unsigned char * p, void * pv_dst)
|
||||||
while(*p++);
|
while(*p++);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
static unsigned char* get_flag(unsigned char * p, void * pv_dst)
|
static unsigned char* get_flag(p, pv_dst)
|
||||||
|
unsigned char* p;
|
||||||
|
void* pv_dst;
|
||||||
{
|
{
|
||||||
int* dst;
|
int* dst;
|
||||||
|
|
||||||
|
|
@ -193,7 +200,7 @@ get_list(unsigned char* p, StrList** dst) {
|
||||||
|
|
||||||
struct optlist {
|
struct optlist {
|
||||||
char* optname;
|
char* optname;
|
||||||
unsigned char* (*optfunc)(unsigned char* p, void* pv_dst);
|
unsigned char* (*optfunc)();
|
||||||
void* optarg;
|
void* optarg;
|
||||||
} option[] = {
|
} option[] = {
|
||||||
/*
|
/*
|
||||||
|
|
@ -245,7 +252,9 @@ struct optlist {
|
||||||
{"AllowUser", get_list, &allow_user},
|
{"AllowUser", get_list, &allow_user},
|
||||||
{"allowuser", get_list, &allow_user},
|
{"allowuser", get_list, &allow_user},
|
||||||
{0, 0, 0}};
|
{0, 0, 0}};
|
||||||
static int skip_blank(FILE * fp)
|
|
||||||
|
static int skip_blank(fp)
|
||||||
|
FILE* fp;
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
|
@ -253,7 +262,8 @@ static int skip_blank(FILE * fp)
|
||||||
while(c == ' ' || c == '\t') c = getc(fp);
|
while(c == ' ' || c == '\t') c = getc(fp);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
static int skip_line(FILE * fp)
|
static int skip_line(fp)
|
||||||
|
FILE* fp;
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
|
@ -261,7 +271,10 @@ static int skip_line(FILE * fp)
|
||||||
while(c != '\n' && c != EOF) c = getc(fp);
|
while(c != '\n' && c != EOF) c = getc(fp);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
static readln(FILE * fp, char * p, int len)
|
static readln(fp, p, len)
|
||||||
|
FILE* fp;
|
||||||
|
char* p;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
int quote = EOF;
|
int quote = EOF;
|
||||||
|
|
|
||||||
11
sj2code.c
11
sj2code.c
|
|
@ -30,7 +30,10 @@
|
||||||
#include "sj_euc.h"
|
#include "sj_euc.h"
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
#include "sj_yomi.h"
|
#include "sj_yomi.h"
|
||||||
int sj2cd_chr(unsigned char * euc, unsigned char * yomi)
|
|
||||||
|
int sj2cd_chr(euc, yomi)
|
||||||
|
unsigned char* euc;
|
||||||
|
unsigned char* yomi;
|
||||||
{
|
{
|
||||||
unsigned char chr;
|
unsigned char chr;
|
||||||
|
|
||||||
|
|
@ -101,7 +104,11 @@ int sj2cd_chr(unsigned char * euc, unsigned char * yomi)
|
||||||
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
int sj2cd_str(unsigned char * euc, unsigned char * yomi, int len)
|
|
||||||
|
int sj2cd_str(euc, yomi, len)
|
||||||
|
unsigned char* euc;
|
||||||
|
unsigned char* yomi;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
|
|
||||||
if(!len--) return FALSE;
|
if(!len--) return FALSE;
|
||||||
|
|
|
||||||
14
sj3.c
14
sj3.c
|
|
@ -31,8 +31,6 @@
|
||||||
#include "wchar16.h"
|
#include "wchar16.h"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) || defined(__DragonFly__)
|
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) || defined(__DragonFly__)
|
||||||
#define USE_OLD_TTY
|
#define USE_OLD_TTY
|
||||||
#if defined(__NetBSD__)
|
#if defined(__NetBSD__)
|
||||||
|
|
@ -130,9 +128,9 @@ struct jtchars jtc;
|
||||||
int erase_char;
|
int erase_char;
|
||||||
wchar16_t erase_str[2];
|
wchar16_t erase_str[2];
|
||||||
#ifdef SIGTYPE_VOID
|
#ifdef SIGTYPE_VOID
|
||||||
void (*sigpipe)(int);
|
void (*sigpipe)();
|
||||||
#else
|
#else
|
||||||
int (*sigpipe)(int);
|
int (*sigpipe)();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int Pid_shell;
|
int Pid_shell;
|
||||||
|
|
@ -194,7 +192,8 @@ void init(char** argv) {
|
||||||
void init_env(void) {
|
void init_env(void) {
|
||||||
char * uname, *hp, *tname;
|
char * uname, *hp, *tname;
|
||||||
int i;
|
int i;
|
||||||
struct passwd* pwd;
|
struct passwd *pwd, *getpwnam(), *getpwuid();
|
||||||
|
char * getlogin(), *getenv();
|
||||||
|
|
||||||
user_name[0] = '\0';
|
user_name[0] = '\0';
|
||||||
home[0] = '\0';
|
home[0] = '\0';
|
||||||
|
|
@ -881,6 +880,7 @@ void getslave(void) {
|
||||||
|
|
||||||
void execcmd(char* cmd, char** ap) {
|
void execcmd(char* cmd, char** ap) {
|
||||||
int c;
|
int c;
|
||||||
|
char* getenv();
|
||||||
char *path, *cp, fullcmd[BUFSIZ];
|
char *path, *cp, fullcmd[BUFSIZ];
|
||||||
|
|
||||||
path = getenv("PATH");
|
path = getenv("PATH");
|
||||||
|
|
@ -980,9 +980,9 @@ void exitprocess(void) {
|
||||||
|
|
||||||
void suspend(void) {
|
void suspend(void) {
|
||||||
#ifdef SIGTYPE_VOID
|
#ifdef SIGTYPE_VOID
|
||||||
void (*old_sigtstp)(int);
|
void (*old_sigtstp)();
|
||||||
#else
|
#else
|
||||||
int (*old_sigtstp)(int);
|
int (*old_sigtstp)();
|
||||||
#endif
|
#endif
|
||||||
SELECT_FD ifds;
|
SELECT_FD ifds;
|
||||||
int nc;
|
int nc;
|
||||||
|
|
|
||||||
2
sj3.h
2
sj3.h
|
|
@ -38,7 +38,7 @@
|
||||||
void mk_cvtkey(char* term);
|
void mk_cvtkey(char* term);
|
||||||
char* getkey2(char* istr, char* ostr);
|
char* getkey2(char* istr, char* ostr);
|
||||||
void clear_ukeys(void);
|
void clear_ukeys(void);
|
||||||
int set_func(struct wordent word[]);
|
void set_func(struct wordent word[]);
|
||||||
wchar16_t eval_keys(wchar16_t* s, wchar16_t* p);
|
wchar16_t eval_keys(wchar16_t* s, wchar16_t* p);
|
||||||
void clear_key(void);
|
void clear_key(void);
|
||||||
void clear_commkeys(void);
|
void clear_commkeys(void);
|
||||||
|
|
|
||||||
78
sj3_rkcv.c
78
sj3_rkcv.c
|
|
@ -155,14 +155,12 @@ static unsigned short HZtbl[95] = {
|
||||||
0xa3f8, 0xa3f9, 0xa3fa, 0xa1d0, 0xa1c3, 0xa1d1, 0xa1b1};
|
0xa3f8, 0xa3f9, 0xa3fa, 0xa1d0, 0xa1c3, 0xa1d1, 0xa1b1};
|
||||||
|
|
||||||
#ifdef ADDHK
|
#ifdef ADDHK
|
||||||
int setl_hktozh(void)
|
setl_hktozh() {
|
||||||
{
|
|
||||||
int i;
|
int i;
|
||||||
unsigned short c, zen1;
|
unsigned short c, zen1;
|
||||||
wchar16_t rstr[2];
|
wchar16_t rstr[2];
|
||||||
wchar16_t kstr[2];
|
wchar16_t kstr[2];
|
||||||
RkTablW16 * rktp;
|
RkTablW16 * rktp, *mktable();
|
||||||
RkTablW16* mktable(wchar16_t * key, int len);
|
|
||||||
|
|
||||||
zen1 = (ZHIRA1 << 8);
|
zen1 = (ZHIRA1 << 8);
|
||||||
rstr[1] = '\0';
|
rstr[1] = '\0';
|
||||||
|
|
@ -192,13 +190,12 @@ int setl_hktozh(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
int mkkigou(void)
|
|
||||||
{
|
mkkigou() {
|
||||||
int i;
|
int i;
|
||||||
wchar16_t rstr[2];
|
wchar16_t rstr[2];
|
||||||
wchar16_t kstr[2];
|
wchar16_t kstr[2];
|
||||||
RkTablW16 *rktp;
|
RkTablW16 *rktp, *mktable();
|
||||||
RkTablW16* mktable(wchar16_t * key, int len);
|
|
||||||
|
|
||||||
rstr[1] = '\0';
|
rstr[1] = '\0';
|
||||||
kstr[1] = 0;
|
kstr[1] = 0;
|
||||||
|
|
@ -213,7 +210,8 @@ int mkkigou(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int sj_addten(unsigned short prefix, unsigned short c)
|
|
||||||
|
sj_addten(prefix, c) unsigned short prefix, c;
|
||||||
{
|
{
|
||||||
unsigned short c1, cc;
|
unsigned short c1, cc;
|
||||||
|
|
||||||
|
|
@ -232,7 +230,8 @@ int sj_addten(unsigned short prefix, unsigned short c)
|
||||||
}
|
}
|
||||||
return (cc);
|
return (cc);
|
||||||
}
|
}
|
||||||
int sj_han2zen(unsigned short c)
|
|
||||||
|
sj_han2zen(c) unsigned short c;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned short cc;
|
unsigned short cc;
|
||||||
|
|
@ -270,7 +269,8 @@ int sj_han2zen(unsigned short c)
|
||||||
}
|
}
|
||||||
|
|
||||||
int sj3_hantozen_w16(wchar16_t*, wchar16_t*);
|
int sj3_hantozen_w16(wchar16_t*, wchar16_t*);
|
||||||
int sj3_hantozen(unsigned char * out, unsigned char * in)
|
|
||||||
|
sj3_hantozen(out, in) unsigned char* out, *in;
|
||||||
{
|
{
|
||||||
wchar16_t * winstr, *woutstr;
|
wchar16_t * winstr, *woutstr;
|
||||||
unsigned char* mstr;
|
unsigned char* mstr;
|
||||||
|
|
@ -361,7 +361,8 @@ int sj3_hantozen(unsigned char * out, unsigned char * in)
|
||||||
return inlen;
|
return inlen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int sj3_hantozen_euc(unsigned char * out, unsigned char * in)
|
|
||||||
|
sj3_hantozen_euc(out, in) unsigned char* out, *in;
|
||||||
{
|
{
|
||||||
wchar16_t * winstr, *woutstr;
|
wchar16_t * winstr, *woutstr;
|
||||||
unsigned char* mstr;
|
unsigned char* mstr;
|
||||||
|
|
@ -452,18 +453,25 @@ int sj3_hantozen_euc(unsigned char * out, unsigned char * in)
|
||||||
return inlen;
|
return inlen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int sj3_hantozen_mb(unsigned char * s1, unsigned char * s2)
|
|
||||||
|
sj3_hantozen_mb(s1, s2) unsigned char* s1, *s2;
|
||||||
{
|
{
|
||||||
if(current_locale == LC_CTYPE_EUC)
|
if(current_locale == LC_CTYPE_EUC)
|
||||||
return sj3_hantozen_euc(s1, s2);
|
return sj3_hantozen_euc(s1, s2);
|
||||||
else
|
else
|
||||||
return sj3_hantozen(s1, s2);
|
return sj3_hantozen(s1, s2);
|
||||||
}
|
}
|
||||||
int sj3_hantozen_w16(wchar16_t * s1, wchar16_t * s2)
|
|
||||||
|
int sj3_hantozen_w16(s1, s2)
|
||||||
|
wchar16_t *s1, *s2;
|
||||||
{
|
{
|
||||||
return sj_hantozen(s1, s2, wslen(s2));
|
return sj_hantozen(s1, s2, wslen(s2));
|
||||||
}
|
}
|
||||||
int sj_hantozen(wchar16_t * s1, wchar16_t * s2, int len)
|
|
||||||
|
sj_hantozen(s1, s2, len)
|
||||||
|
wchar16_t* s1,
|
||||||
|
*s2;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
unsigned short c1, cc, prefix;
|
unsigned short c1, cc, prefix;
|
||||||
wchar16_t c;
|
wchar16_t c;
|
||||||
|
|
@ -494,7 +502,8 @@ int sj_hantozen(wchar16_t * s1, wchar16_t * s2, int len)
|
||||||
*s1 = '\0';
|
*s1 = '\0';
|
||||||
return (rlen);
|
return (rlen);
|
||||||
}
|
}
|
||||||
int sj_zen2han(unsigned short c)
|
|
||||||
|
sj_zen2han(c) unsigned short c;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned short cc;
|
unsigned short cc;
|
||||||
|
|
@ -529,7 +538,8 @@ int sj_zen2han(unsigned short c)
|
||||||
}
|
}
|
||||||
|
|
||||||
int sj3_zentohan_w16(wchar16_t*, wchar16_t*);
|
int sj3_zentohan_w16(wchar16_t*, wchar16_t*);
|
||||||
int sj3_zentohan(unsigned char * out, unsigned char * in)
|
|
||||||
|
sj3_zentohan(out, in) unsigned char* out, *in;
|
||||||
{
|
{
|
||||||
wchar16_t * winstr, *woutstr;
|
wchar16_t * winstr, *woutstr;
|
||||||
unsigned char* mstr;
|
unsigned char* mstr;
|
||||||
|
|
@ -617,7 +627,8 @@ int sj3_zentohan(unsigned char * out, unsigned char * in)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
int sj3_zentohan_euc(unsigned char * out, unsigned char * in)
|
|
||||||
|
sj3_zentohan_euc(out, in) unsigned char* out, *in;
|
||||||
{
|
{
|
||||||
wchar16_t * winstr, *woutstr;
|
wchar16_t * winstr, *woutstr;
|
||||||
unsigned char* mstr;
|
unsigned char* mstr;
|
||||||
|
|
@ -706,18 +717,25 @@ int sj3_zentohan_euc(unsigned char * out, unsigned char * in)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
int sj3_zentohan_mb(unsigned char * s1, unsigned char * s2)
|
|
||||||
|
sj3_zentohan_mb(s1, s2) unsigned char* s1, *s2;
|
||||||
{
|
{
|
||||||
if(current_locale == LC_CTYPE_EUC)
|
if(current_locale == LC_CTYPE_EUC)
|
||||||
return sj3_zentohan_euc(s1, s2);
|
return sj3_zentohan_euc(s1, s2);
|
||||||
else
|
else
|
||||||
return sj3_zentohan(s1, s2);
|
return sj3_zentohan(s1, s2);
|
||||||
}
|
}
|
||||||
int sj3_zentohan_w16(wchar16_t * s1, wchar16_t * s2)
|
|
||||||
|
int sj3_zentohan_w16(s1, s2)
|
||||||
|
wchar16_t *s1, *s2;
|
||||||
{
|
{
|
||||||
return sj_zentohan(s1, s2, wslen(s2));
|
return sj_zentohan(s1, s2, wslen(s2));
|
||||||
}
|
}
|
||||||
int sj_zentohan(wchar16_t * s1, wchar16_t * s2, int len)
|
|
||||||
|
sj_zentohan(s1, s2, len)
|
||||||
|
wchar16_t* s1,
|
||||||
|
*s2;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
unsigned short cc;
|
unsigned short cc;
|
||||||
wchar16_t c;
|
wchar16_t c;
|
||||||
|
|
@ -748,21 +766,28 @@ int sj_zentohan(wchar16_t * s1, wchar16_t * s2, int len)
|
||||||
*s1 = (wchar16_t)'\0';
|
*s1 = (wchar16_t)'\0';
|
||||||
return (rlen);
|
return (rlen);
|
||||||
}
|
}
|
||||||
int sj_tokata(wchar16_t c)
|
|
||||||
|
sj_tokata(c)
|
||||||
|
wchar16_t c;
|
||||||
{
|
{
|
||||||
if(sj_ishira(c)) {
|
if(sj_ishira(c)) {
|
||||||
c += 0x0100;
|
c += 0x0100;
|
||||||
}
|
}
|
||||||
return (c);
|
return (c);
|
||||||
}
|
}
|
||||||
int sj_tohira(wchar16_t c)
|
|
||||||
|
sj_tohira(c)
|
||||||
|
wchar16_t c;
|
||||||
{
|
{
|
||||||
if(sj_iskata(c) && (short)c <= (short)0xa5f3) {
|
if(sj_iskata(c) && (short)c <= (short)0xa5f3) {
|
||||||
c -= 0x0100;
|
c -= 0x0100;
|
||||||
}
|
}
|
||||||
return (c);
|
return (c);
|
||||||
}
|
}
|
||||||
int sj_htok(wchar16_t * s1, wchar16_t * s2)
|
|
||||||
|
sj_htok(s1, s2)
|
||||||
|
wchar16_t* s1,
|
||||||
|
*s2;
|
||||||
{
|
{
|
||||||
wchar16_t cc;
|
wchar16_t cc;
|
||||||
wchar16_t c;
|
wchar16_t c;
|
||||||
|
|
@ -776,7 +801,10 @@ int sj_htok(wchar16_t * s1, wchar16_t * s2)
|
||||||
}
|
}
|
||||||
*s1 = (wchar16_t)'\0';
|
*s1 = (wchar16_t)'\0';
|
||||||
}
|
}
|
||||||
int sj_ktoh(wchar16_t * s1, wchar16_t * s2)
|
|
||||||
|
sj_ktoh(s1, s2)
|
||||||
|
wchar16_t* s1,
|
||||||
|
*s2;
|
||||||
{
|
{
|
||||||
wchar16_t cc;
|
wchar16_t cc;
|
||||||
wchar16_t c;
|
wchar16_t c;
|
||||||
|
|
|
||||||
5
sj3err.c
5
sj3err.c
|
|
@ -30,7 +30,10 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "sj3err.h"
|
#include "sj3err.h"
|
||||||
|
|
||||||
void sj3error(FILE * fp, int code)
|
void
|
||||||
|
sj3error(fp, code)
|
||||||
|
FILE* fp;
|
||||||
|
int code;
|
||||||
{
|
{
|
||||||
unsigned char tmp[BUFSIZ];
|
unsigned char tmp[BUFSIZ];
|
||||||
|
|
||||||
|
|
|
||||||
4
sj3ver.c
4
sj3ver.c
|
|
@ -28,8 +28,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "sj2.h"
|
#include "sj2.h"
|
||||||
int print_version(void)
|
|
||||||
{
|
print_version() {
|
||||||
extern int vflag;
|
extern int vflag;
|
||||||
extern char* version;
|
extern char* version;
|
||||||
extern char* Date;
|
extern char* Date;
|
||||||
|
|
|
||||||
43
sjgetchar.c
43
sjgetchar.c
|
|
@ -62,8 +62,8 @@ static wchar16_t backup = (wchar16_t)0;
|
||||||
|
|
||||||
static int eucmode = 0;
|
static int eucmode = 0;
|
||||||
extern int master;
|
extern int master;
|
||||||
wchar16_t SJ_getchar(void)
|
|
||||||
{
|
wchar16_t SJ_getchar() {
|
||||||
SELECT_FD ifds;
|
SELECT_FD ifds;
|
||||||
wchar16_t c;
|
wchar16_t c;
|
||||||
|
|
||||||
|
|
@ -108,8 +108,8 @@ static char startc = CTRL('q');
|
||||||
static char outbuf[BUFSIZ];
|
static char outbuf[BUFSIZ];
|
||||||
extern int slave;
|
extern int slave;
|
||||||
extern char *slave_name, *ptsname(int);
|
extern char *slave_name, *ptsname(int);
|
||||||
int output_master(void)
|
|
||||||
{
|
output_master() {
|
||||||
struct strbuf ctlbuf;
|
struct strbuf ctlbuf;
|
||||||
struct strbuf databuf;
|
struct strbuf databuf;
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
|
@ -240,8 +240,8 @@ int output_master(void)
|
||||||
#if defined(linux) && defined(__GLIBC__) && (__GLIBC__ >= 2)
|
#if defined(linux) && defined(__GLIBC__) && (__GLIBC__ >= 2)
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#endif
|
#endif
|
||||||
int output_master(void)
|
|
||||||
{
|
output_master() {
|
||||||
int n, m;
|
int n, m;
|
||||||
char outbuf[BUFSIZ];
|
char outbuf[BUFSIZ];
|
||||||
int f;
|
int f;
|
||||||
|
|
@ -303,11 +303,14 @@ int output_master(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
int set_eucmode(void)
|
|
||||||
{
|
set_eucmode() {
|
||||||
eucmode = 1;
|
eucmode = 1;
|
||||||
}
|
}
|
||||||
int SJ_write(wchar16_t * s, int n)
|
|
||||||
|
SJ_write(s, n)
|
||||||
|
wchar16_t* s;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
int val;
|
int val;
|
||||||
wchar16_t wb[BUFFLENGTH];
|
wchar16_t wb[BUFFLENGTH];
|
||||||
|
|
@ -326,7 +329,9 @@ int SJ_write(wchar16_t * s, int n)
|
||||||
val = write(master, buff, val);
|
val = write(master, buff, val);
|
||||||
return (val);
|
return (val);
|
||||||
}
|
}
|
||||||
int write_stdout(unsigned char * s, int n)
|
|
||||||
|
write_stdout(s, n) unsigned char* s;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
static unsigned char knj1st = 0, knj2nd = 0;
|
static unsigned char knj1st = 0, knj2nd = 0;
|
||||||
|
|
||||||
|
|
@ -353,7 +358,10 @@ int write_stdout(unsigned char * s, int n)
|
||||||
putchar(*s++);
|
putchar(*s++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int SJ_read(wchar16_t * s, int n)
|
|
||||||
|
SJ_read(s, n)
|
||||||
|
wchar16_t* s;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
unsigned char buff[BUFFLENGTH];
|
unsigned char buff[BUFFLENGTH];
|
||||||
wchar16_t wcbuff[BUFFLENGTH];
|
wchar16_t wcbuff[BUFFLENGTH];
|
||||||
|
|
@ -431,11 +439,15 @@ int SJ_read(wchar16_t * s, int n)
|
||||||
memcpy((void*)s, (void*)wcbuff, wnum * sizeof(wchar16_t));
|
memcpy((void*)s, (void*)wcbuff, wnum * sizeof(wchar16_t));
|
||||||
return (wnum);
|
return (wnum);
|
||||||
}
|
}
|
||||||
int SJ_warnning(wchar16_t * s)
|
|
||||||
|
SJ_warnning(s)
|
||||||
|
wchar16_t* s;
|
||||||
{
|
{
|
||||||
SJ_print(s);
|
SJ_print(s);
|
||||||
}
|
}
|
||||||
int SJ_print(wchar16_t * s)
|
|
||||||
|
SJ_print(s)
|
||||||
|
wchar16_t* s;
|
||||||
{
|
{
|
||||||
unsigned char buff[BUFFLENGTH * 3];
|
unsigned char buff[BUFFLENGTH * 3];
|
||||||
size_t num;
|
size_t num;
|
||||||
|
|
@ -444,7 +456,10 @@ int SJ_print(wchar16_t * s)
|
||||||
if((int)num > 0)
|
if((int)num > 0)
|
||||||
printf("%s", buff);
|
printf("%s", buff);
|
||||||
}
|
}
|
||||||
int SJ_through(wchar16_t * s, int n)
|
|
||||||
|
SJ_through(s, n)
|
||||||
|
wchar16_t* s;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
SJ_write(s, n);
|
SJ_write(s, n);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
52
sjrc.c
52
sjrc.c
|
|
@ -49,13 +49,12 @@ static char* rcfile = ".sjrc";
|
||||||
static int user_euc = 0;
|
static int user_euc = 0;
|
||||||
static int file_code = SYS_SJIS;
|
static int file_code = SYS_SJIS;
|
||||||
|
|
||||||
int setrc(char * file);
|
void setrc();
|
||||||
int set_dict(struct wordent word[]);
|
int set_dict(), set_server();
|
||||||
int set_server(struct wordent word[]);
|
|
||||||
|
|
||||||
struct functbl {
|
struct functbl {
|
||||||
char* keyword;
|
char* keyword;
|
||||||
int (*func)(struct wordent word[]);
|
int (*func)();
|
||||||
} funcs[] = {
|
} funcs[] = {
|
||||||
{"dictionary", set_dict},
|
{"dictionary", set_dict},
|
||||||
{"userdic", set_dict},
|
{"userdic", set_dict},
|
||||||
|
|
@ -63,8 +62,8 @@ struct functbl {
|
||||||
{NULL, NULL}};
|
{NULL, NULL}};
|
||||||
|
|
||||||
#define TOLOWER(c) (isupper(c) ? tolower(c) : (c))
|
#define TOLOWER(c) (isupper(c) ? tolower(c) : (c))
|
||||||
int sjset_code(void)
|
|
||||||
{
|
int sjset_code() {
|
||||||
char* loc;
|
char* loc;
|
||||||
|
|
||||||
#ifdef LACKOF_SETLOCALE
|
#ifdef LACKOF_SETLOCALE
|
||||||
|
|
@ -94,8 +93,8 @@ int sjset_code(void)
|
||||||
#endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
int getsjrc(void)
|
|
||||||
{
|
int getsjrc() {
|
||||||
FILE* fd;
|
FILE* fd;
|
||||||
char* p;
|
char* p;
|
||||||
|
|
||||||
|
|
@ -127,7 +126,9 @@ int getsjrc(void)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setrc(char * file, FILE * fd)
|
void
|
||||||
|
setrc(file, fd) char* file;
|
||||||
|
FILE* fd;
|
||||||
{
|
{
|
||||||
char line[MAXLINE];
|
char line[MAXLINE];
|
||||||
int w;
|
int w;
|
||||||
|
|
@ -150,7 +151,9 @@ void setrc(char * file, FILE * fd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int much(char * s1, char * s2)
|
|
||||||
|
int much(s1, s2)
|
||||||
|
char *s1, *s2;
|
||||||
{
|
{
|
||||||
char c1, c2;
|
char c1, c2;
|
||||||
|
|
||||||
|
|
@ -164,7 +167,10 @@ int much(char * s1, char * s2)
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
int getword(char * s, struct wordent word[])
|
|
||||||
|
int getword(s, word)
|
||||||
|
char* s;
|
||||||
|
struct wordent word[];
|
||||||
{
|
{
|
||||||
unsigned char c, cc;
|
unsigned char c, cc;
|
||||||
char* p;
|
char* p;
|
||||||
|
|
@ -250,27 +256,39 @@ int getword(char * s, struct wordent word[])
|
||||||
word[++wcount].word_str[0] = '\0';
|
word[++wcount].word_str[0] = '\0';
|
||||||
return wcount;
|
return wcount;
|
||||||
}
|
}
|
||||||
int IsTerminator(unsigned char c)
|
|
||||||
|
int IsTerminator(c)
|
||||||
|
unsigned char c;
|
||||||
{
|
{
|
||||||
return (c == '\n') ? 1 : 0;
|
return (c == '\n') ? 1 : 0;
|
||||||
}
|
}
|
||||||
int isTerminator(unsigned char c)
|
|
||||||
|
int isTerminator(c)
|
||||||
|
unsigned char c;
|
||||||
{
|
{
|
||||||
return (c == '#') ? 1 : 0;
|
return (c == '#') ? 1 : 0;
|
||||||
}
|
}
|
||||||
int IsEscape(unsigned char c)
|
|
||||||
|
int IsEscape(c)
|
||||||
|
unsigned char c;
|
||||||
{
|
{
|
||||||
return (c == '\\') ? 1 : 0;
|
return (c == '\\') ? 1 : 0;
|
||||||
}
|
}
|
||||||
int IsDelimitor(unsigned char c)
|
|
||||||
|
int IsDelimitor(c)
|
||||||
|
unsigned char c;
|
||||||
{
|
{
|
||||||
return (c == ' ' || c == '\t' || c == '.') ? 1 : 0;
|
return (c == ' ' || c == '\t' || c == '.') ? 1 : 0;
|
||||||
}
|
}
|
||||||
int set_dict(struct wordent word[])
|
|
||||||
|
int set_dict(word)
|
||||||
|
struct wordent word[];
|
||||||
{
|
{
|
||||||
setdicname(word[1].word_str);
|
setdicname(word[1].word_str);
|
||||||
}
|
}
|
||||||
int set_server(struct wordent word[])
|
|
||||||
|
int set_server(word)
|
||||||
|
struct wordent word[];
|
||||||
{
|
{
|
||||||
setsjserv(word[1].word_str);
|
setsjserv(word[1].word_str);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
146
sjrc2.c
146
sjrc2.c
|
|
@ -35,8 +35,6 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "Paths.h"
|
#include "Paths.h"
|
||||||
|
|
||||||
int vflag = 1;
|
int vflag = 1;
|
||||||
|
|
@ -101,33 +99,19 @@ extern wchar16_t *Key, *Escape, *Sjxkey, *Etckey, *Intr, *Bskey, *Delkey,
|
||||||
extern wchar16_t *Halpha, *Zalpha, *Hkata, *Zkata, *Hira;
|
extern wchar16_t *Halpha, *Zalpha, *Hkata, *Zkata, *Hira;
|
||||||
extern wchar16_t *Shiftjis, *Sjis, *Euc, *Euc2, *Jis, *Jis2, *Kuten, *Kuten2;
|
extern wchar16_t *Shiftjis, *Sjis, *Euc, *Euc2, *Jis, *Jis2, *Kuten, *Kuten2;
|
||||||
|
|
||||||
int set_func(struct wordent word[]);
|
int set_func(), set_etckeys(), set_intr(),
|
||||||
int set_etckeys(struct wordent word[]);
|
set_delkey(), set_goto(), set_trap(), set_init_mode(),
|
||||||
int set_intr(struct wordent word[]);
|
set_helpmenu(), set_defcode(), set_muhenkan(), set_muedit(),
|
||||||
int set_delkey(struct wordent word[]);
|
set_m_toggle(), set_guide(), set_forkshell(), set_bstudy(),
|
||||||
int set_goto(struct wordent word[]);
|
set_silent(), set_flush_conversion(), set_rkebell(), set_server(),
|
||||||
int set_trap(struct wordent word[]);
|
set_dicts();
|
||||||
int set_init_mode(struct wordent word[]);
|
|
||||||
int set_helpmenu(struct wordent word[]);
|
|
||||||
int set_defcode(struct wordent word[]);
|
|
||||||
int set_muhenkan(struct wordent word[]);
|
|
||||||
int set_muedit(struct wordent word[]);
|
|
||||||
int set_m_toggle(struct wordent word[]);
|
|
||||||
int set_guide(struct wordent word[]);
|
|
||||||
int set_forkshell(struct wordent word[]);
|
|
||||||
int set_bstudy(struct wordent word[]);
|
|
||||||
int set_silent(struct wordent word[]);
|
|
||||||
int set_flush_conversion(struct wordent word[]);
|
|
||||||
int set_rkebell(struct wordent word[]);
|
|
||||||
int set_server(struct wordent word[]);
|
|
||||||
int set_dicts(void);
|
|
||||||
|
|
||||||
extern struct functbl funcs[];
|
extern struct functbl funcs[];
|
||||||
extern struct valtbl mode_val[], code_val[];
|
extern struct valtbl mode_val[], code_val[];
|
||||||
|
|
||||||
#define TOLOWER(c) (isupper(c) ? tolower(c) : (c))
|
#define TOLOWER(c) (isupper(c) ? tolower(c) : (c))
|
||||||
int sjset_code(void)
|
|
||||||
{
|
sjset_code() {
|
||||||
char* loc;
|
char* loc;
|
||||||
|
|
||||||
if(current_locale == LC_CTYPE_EUC) {
|
if(current_locale == LC_CTYPE_EUC) {
|
||||||
|
|
@ -137,8 +121,8 @@ int sjset_code(void)
|
||||||
} else
|
} else
|
||||||
user_euc = 0;
|
user_euc = 0;
|
||||||
}
|
}
|
||||||
int sjrc_init(void)
|
|
||||||
{
|
sjrc_init() {
|
||||||
clear_del();
|
clear_del();
|
||||||
clear_key();
|
clear_key();
|
||||||
intr_code = 0x03;
|
intr_code = 0x03;
|
||||||
|
|
@ -156,9 +140,10 @@ int sjrc_init(void)
|
||||||
}
|
}
|
||||||
dict_num = 0;
|
dict_num = 0;
|
||||||
}
|
}
|
||||||
int getsjrc(void)
|
|
||||||
{
|
getsjrc() {
|
||||||
char* p;
|
char* p;
|
||||||
|
char* getenv();
|
||||||
|
|
||||||
sjset_code();
|
sjset_code();
|
||||||
mk_cvtkey(term_name);
|
mk_cvtkey(term_name);
|
||||||
|
|
@ -185,13 +170,14 @@ int getsjrc(void)
|
||||||
|
|
||||||
RCfile[0] = '\0';
|
RCfile[0] = '\0';
|
||||||
}
|
}
|
||||||
int setrc(char * file)
|
|
||||||
|
setrc(file) char* file;
|
||||||
{
|
{
|
||||||
wchar16_t* p;
|
wchar16_t* p;
|
||||||
char line[MAXLINE];
|
char line[MAXLINE];
|
||||||
struct wordent word[WORDN];
|
struct wordent word[WORDN];
|
||||||
struct functbl* functp;
|
struct functbl* functp;
|
||||||
FILE* fd;
|
FILE * fd, *fopen();
|
||||||
|
|
||||||
if(vflag > 1)
|
if(vflag > 1)
|
||||||
aprintf("sjrc file is %s\n", file);
|
aprintf("sjrc file is %s\n", file);
|
||||||
|
|
@ -216,10 +202,12 @@ int setrc(char * file)
|
||||||
fclose(fd);
|
fclose(fd);
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
int getsjrk(int erase)
|
|
||||||
|
getsjrk(erase) int erase;
|
||||||
{
|
{
|
||||||
char* p;
|
char* p;
|
||||||
int i;
|
int i;
|
||||||
|
char* getenv();
|
||||||
char RKfile[LONGLENGTH];
|
char RKfile[LONGLENGTH];
|
||||||
|
|
||||||
RKfile[0] = '\0';
|
RKfile[0] = '\0';
|
||||||
|
|
@ -262,7 +250,10 @@ int getsjrk(int erase)
|
||||||
if(!oasys)
|
if(!oasys)
|
||||||
mkkigou();
|
mkkigou();
|
||||||
}
|
}
|
||||||
int match(wchar16_t * s1, wchar16_t * s2)
|
|
||||||
|
match(s1, s2)
|
||||||
|
wchar16_t* s1,
|
||||||
|
*s2;
|
||||||
{
|
{
|
||||||
wchar16_t c1, c2;
|
wchar16_t c1, c2;
|
||||||
|
|
||||||
|
|
@ -276,7 +267,9 @@ int match(wchar16_t * s1, wchar16_t * s2)
|
||||||
}
|
}
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
int getword(unsigned char * s, struct wordent word[])
|
|
||||||
|
getword(s, word) unsigned char* s;
|
||||||
|
struct wordent word[];
|
||||||
{
|
{
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
wchar16_t* w;
|
wchar16_t* w;
|
||||||
|
|
@ -384,35 +377,40 @@ int getword(unsigned char * s, struct wordent word[])
|
||||||
word[++wcount].word_str[0] = '\0';
|
word[++wcount].word_str[0] = '\0';
|
||||||
return (wcount);
|
return (wcount);
|
||||||
}
|
}
|
||||||
int IsTerminator(unsigned char c)
|
|
||||||
|
IsTerminator(c) unsigned char c;
|
||||||
{
|
{
|
||||||
if(c == '\n')
|
if(c == '\n')
|
||||||
return (1);
|
return (1);
|
||||||
else
|
else
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int isTerminator(unsigned char c)
|
|
||||||
|
isTerminator(c) unsigned char c;
|
||||||
{
|
{
|
||||||
if(c == '#')
|
if(c == '#')
|
||||||
return (1);
|
return (1);
|
||||||
else
|
else
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int IsEscape(unsigned char c)
|
|
||||||
|
IsEscape(c) unsigned char c;
|
||||||
{
|
{
|
||||||
if(c == '\\')
|
if(c == '\\')
|
||||||
return (1);
|
return (1);
|
||||||
else
|
else
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int IsDelimitor(unsigned char c)
|
|
||||||
|
IsDelimitor(c) unsigned char c;
|
||||||
{
|
{
|
||||||
if(c == ' ' || c == '\t' || c == '.')
|
if(c == ' ' || c == '\t' || c == '.')
|
||||||
return (1);
|
return (1);
|
||||||
else
|
else
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int set_forkshell(struct wordent word[])
|
|
||||||
|
set_forkshell(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
if(word[1].word_str[0] != '\0' && shellprog[0] == '\0') {
|
if(word[1].word_str[0] != '\0' && shellprog[0] == '\0') {
|
||||||
/*
|
/*
|
||||||
|
|
@ -423,7 +421,8 @@ int set_forkshell(struct wordent word[])
|
||||||
shell_flag++;
|
shell_flag++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int set_intr(struct wordent word[])
|
|
||||||
|
set_intr(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
|
@ -431,7 +430,8 @@ int set_intr(struct wordent word[])
|
||||||
if((c = eval_key(word[1].word_str)) != -1)
|
if((c = eval_key(word[1].word_str)) != -1)
|
||||||
intr_code = c;
|
intr_code = c;
|
||||||
}
|
}
|
||||||
int set_delkey(struct wordent word[])
|
|
||||||
|
set_delkey(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
|
@ -439,14 +439,16 @@ int set_delkey(struct wordent word[])
|
||||||
if((c = eval_key(word[1].word_str)) != -1)
|
if((c = eval_key(word[1].word_str)) != -1)
|
||||||
set_del(c);
|
set_del(c);
|
||||||
}
|
}
|
||||||
int isintr(unsigned char c)
|
|
||||||
|
isintr(c) unsigned char c;
|
||||||
{
|
{
|
||||||
if(c == intr_code)
|
if(c == intr_code)
|
||||||
return (1);
|
return (1);
|
||||||
else
|
else
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int set_goto(struct wordent word[])
|
|
||||||
|
set_goto(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
|
@ -454,7 +456,8 @@ int set_goto(struct wordent word[])
|
||||||
if((c = eval_key(word[1].word_str)) != -1)
|
if((c = eval_key(word[1].word_str)) != -1)
|
||||||
goto_code[goto_num++] = c;
|
goto_code[goto_num++] = c;
|
||||||
}
|
}
|
||||||
int IsGoto(unsigned char c)
|
|
||||||
|
IsGoto(c) unsigned char c;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -464,7 +467,8 @@ int IsGoto(unsigned char c)
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int set_trap(struct wordent word[])
|
|
||||||
|
set_trap(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
|
@ -472,7 +476,8 @@ int set_trap(struct wordent word[])
|
||||||
if((c = eval_key(word[1].word_str)) != -1)
|
if((c = eval_key(word[1].word_str)) != -1)
|
||||||
trap_code[trap_num++] = c;
|
trap_code[trap_num++] = c;
|
||||||
}
|
}
|
||||||
int IsTrap(unsigned char c)
|
|
||||||
|
IsTrap(c) unsigned char c;
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -482,7 +487,8 @@ int IsTrap(unsigned char c)
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int mode_key(int mode)
|
|
||||||
|
mode_key(mode) int mode;
|
||||||
{
|
{
|
||||||
switch(mode) {
|
switch(mode) {
|
||||||
case MODE_HALPHA:
|
case MODE_HALPHA:
|
||||||
|
|
@ -505,7 +511,8 @@ int mode_key(int mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
int Direct = 0;
|
int Direct = 0;
|
||||||
int set_init_mode(struct wordent word[])
|
|
||||||
|
set_init_mode(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
@ -532,14 +539,16 @@ int set_init_mode(struct wordent word[])
|
||||||
p = word[++j].word_str;
|
p = word[++j].word_str;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int set_helpmenu(struct wordent word[])
|
|
||||||
|
set_helpmenu(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
if(match(word[1].word_str, WCOff))
|
if(match(word[1].word_str, WCOff))
|
||||||
HHlevel = Hlevel = 1;
|
HHlevel = Hlevel = 1;
|
||||||
else if(match(word[1].word_str, WCOn))
|
else if(match(word[1].word_str, WCOn))
|
||||||
HHlevel = Hlevel = 2;
|
HHlevel = Hlevel = 2;
|
||||||
}
|
}
|
||||||
int set_defcode(struct wordent word[])
|
|
||||||
|
set_defcode(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
wchar16_t* p;
|
wchar16_t* p;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -552,7 +561,8 @@ int set_defcode(struct wordent word[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int set_muhenkan(struct wordent word[])
|
|
||||||
|
set_muhenkan(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
wchar16_t* p;
|
wchar16_t* p;
|
||||||
|
|
@ -565,7 +575,8 @@ int set_muhenkan(struct wordent word[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int set_muedit(struct wordent word[])
|
|
||||||
|
set_muedit(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
wchar16_t* p;
|
wchar16_t* p;
|
||||||
|
|
@ -578,30 +589,33 @@ int set_muedit(struct wordent word[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int set_m_toggle(struct wordent word[])
|
|
||||||
|
set_m_toggle(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
if(match(word[1].word_str, WCOn))
|
if(match(word[1].word_str, WCOn))
|
||||||
muhenkan_toggle = 1;
|
muhenkan_toggle = 1;
|
||||||
if(match(word[1].word_str, WCOff))
|
if(match(word[1].word_str, WCOff))
|
||||||
muhenkan_toggle = 0;
|
muhenkan_toggle = 0;
|
||||||
}
|
}
|
||||||
int set_silent(struct wordent word[])
|
|
||||||
|
set_silent(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
vflag = 0;
|
vflag = 0;
|
||||||
}
|
}
|
||||||
int set_bstudy(struct wordent word[])
|
|
||||||
|
set_bstudy(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
if(match(word[1].word_str, WCOn))
|
if(match(word[1].word_str, WCOn))
|
||||||
bstudy = 1;
|
bstudy = 1;
|
||||||
if(match(word[1].word_str, WCOff))
|
if(match(word[1].word_str, WCOff))
|
||||||
bstudy = 0;
|
bstudy = 0;
|
||||||
}
|
}
|
||||||
int is_bstudy(void)
|
|
||||||
{
|
is_bstudy() {
|
||||||
return (bstudy);
|
return (bstudy);
|
||||||
}
|
}
|
||||||
int eval_muhenkan(void)
|
|
||||||
{
|
eval_muhenkan() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
|
|
@ -610,11 +624,12 @@ int eval_muhenkan(void)
|
||||||
else
|
else
|
||||||
return (def_muhenkan);
|
return (def_muhenkan);
|
||||||
}
|
}
|
||||||
int value_muhenkan(void)
|
|
||||||
{
|
value_muhenkan() {
|
||||||
return (def_muedit);
|
return (def_muedit);
|
||||||
}
|
}
|
||||||
int set_guide(struct wordent word[])
|
|
||||||
|
set_guide(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -694,14 +709,16 @@ int set_guide(struct wordent word[])
|
||||||
WCGmode = guide_function;
|
WCGmode = guide_function;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int set_flush_conversion(struct wordent word[])
|
|
||||||
|
set_flush_conversion(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
if(match(word[1].word_str, WCOn))
|
if(match(word[1].word_str, WCOn))
|
||||||
flush_conversion = 1;
|
flush_conversion = 1;
|
||||||
if(match(word[1].word_str, WCOff))
|
if(match(word[1].word_str, WCOff))
|
||||||
flush_conversion = 0;
|
flush_conversion = 0;
|
||||||
}
|
}
|
||||||
int set_server(struct wordent word[])
|
|
||||||
|
set_server(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
int i, j, size;
|
int i, j, size;
|
||||||
char* p;
|
char* p;
|
||||||
|
|
@ -735,7 +752,8 @@ int set_server(struct wordent word[])
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DICT_SUFFIX ".dic"
|
#define DICT_SUFFIX ".dic"
|
||||||
int set_dict(struct wordent word[])
|
|
||||||
|
set_dict(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
int i, j, size, suffix_len;
|
int i, j, size, suffix_len;
|
||||||
char* p;
|
char* p;
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,10 @@
|
||||||
#include "sj_typedef.h"
|
#include "sj_typedef.h"
|
||||||
#include "sj_dict.h"
|
#include "sj_dict.h"
|
||||||
|
|
||||||
unsigned char* skipkstr(unsigned char* ptr);
|
unsigned char* skipkstr();
|
||||||
unsigned char* skiphblk(unsigned char * ptr)
|
|
||||||
|
unsigned char* skiphblk(ptr)
|
||||||
|
unsigned char* ptr;
|
||||||
{
|
{
|
||||||
ptr++;
|
ptr++;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@
|
||||||
|
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
#include "sj_yomi.h"
|
#include "sj_yomi.h"
|
||||||
int srchhead(void)
|
|
||||||
{
|
int srchhead() {
|
||||||
if(*cnvstart == _O) {
|
if(*cnvstart == _O) {
|
||||||
headcode = SETTOU_O;
|
headcode = SETTOU_O;
|
||||||
headlen = 1;
|
headlen = 1;
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
#include "kanakan.h"
|
#include "kanakan.h"
|
||||||
|
|
||||||
int istrcmp(unsigned char* yomip, unsigned char* idxp, int ylen, int ilen);
|
int istrcmp();
|
||||||
|
|
||||||
TypeDicSeg
|
TypeDicSeg
|
||||||
srchidx(TypeDicSeg low, int len) {
|
srchidx(TypeDicSeg low, int len) {
|
||||||
|
|
|
||||||
163
stat_conv.c
163
stat_conv.c
|
|
@ -39,7 +39,8 @@ static int bskey;
|
||||||
|
|
||||||
#define SPAN_FLUSH 0
|
#define SPAN_FLUSH 0
|
||||||
#define SPAN_END 1
|
#define SPAN_END 1
|
||||||
int save_span(int mode)
|
|
||||||
|
save_span(mode) int mode;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
|
|
@ -62,16 +63,16 @@ int save_span(int mode)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int save_span_p(void)
|
|
||||||
{
|
save_span_p() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
cv->span_p[cv->span_point] = &(cv->out_buf[cv->out_point]);
|
cv->span_p[cv->span_point] = &(cv->out_buf[cv->out_point]);
|
||||||
cv->span_l[cv->span_point] = 0;
|
cv->span_l[cv->span_point] = 0;
|
||||||
}
|
}
|
||||||
int isspaned(void)
|
|
||||||
{
|
isspaned() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
|
|
@ -80,8 +81,8 @@ int isspaned(void)
|
||||||
else
|
else
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int buffers_clear(void)
|
|
||||||
{
|
buffers_clear() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
|
|
@ -91,8 +92,8 @@ int buffers_clear(void)
|
||||||
else
|
else
|
||||||
cv->CurBun = 0;
|
cv->CurBun = 0;
|
||||||
}
|
}
|
||||||
int pointer_clear(void)
|
|
||||||
{
|
pointer_clear() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
|
|
@ -116,8 +117,8 @@ typedef struct _SaveSet {
|
||||||
} SaveSet;
|
} SaveSet;
|
||||||
|
|
||||||
static SaveSet save_set0;
|
static SaveSet save_set0;
|
||||||
int StoreSaveSet(void)
|
|
||||||
{
|
StoreSaveSet() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
SaveSet* sv;
|
SaveSet* sv;
|
||||||
|
|
||||||
|
|
@ -134,8 +135,8 @@ int StoreSaveSet(void)
|
||||||
wscpy(sv->out_buf, cv->out_buf);
|
wscpy(sv->out_buf, cv->out_buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int RestoreSaveSet(void)
|
|
||||||
{
|
RestoreSaveSet() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
SaveSet* sv;
|
SaveSet* sv;
|
||||||
|
|
||||||
|
|
@ -152,8 +153,8 @@ int RestoreSaveSet(void)
|
||||||
wscpy(cv->out_buf, sv->out_buf);
|
wscpy(cv->out_buf, sv->out_buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int history_empty(void)
|
|
||||||
{
|
history_empty() {
|
||||||
SaveSet* sv;
|
SaveSet* sv;
|
||||||
|
|
||||||
sv = &save_set0;
|
sv = &save_set0;
|
||||||
|
|
@ -162,8 +163,8 @@ int history_empty(void)
|
||||||
else
|
else
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
int History(void)
|
|
||||||
{
|
History() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
SaveSet* sv;
|
SaveSet* sv;
|
||||||
|
|
||||||
|
|
@ -177,36 +178,36 @@ int History(void)
|
||||||
cv->CurBun = 0;
|
cv->CurBun = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int ClearBuffer(void)
|
|
||||||
{
|
ClearBuffer() {
|
||||||
Clear_EOL();
|
Clear_EOL();
|
||||||
Ccheck();
|
Ccheck();
|
||||||
Cclear(1);
|
Cclear(1);
|
||||||
all_set_up();
|
all_set_up();
|
||||||
}
|
}
|
||||||
int SetCflag(void)
|
|
||||||
{
|
SetCflag() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
cv->Cflag = 1;
|
cv->Cflag = 1;
|
||||||
}
|
}
|
||||||
int ClearCflag(void)
|
|
||||||
{
|
ClearCflag() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
cv->Cflag = 0;
|
cv->Cflag = 0;
|
||||||
}
|
}
|
||||||
int IsCflag(void)
|
|
||||||
{
|
IsCflag() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
return (cv->Cflag);
|
return (cv->Cflag);
|
||||||
}
|
}
|
||||||
int exec_kettei(void)
|
|
||||||
{
|
exec_kettei() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int len;
|
int len;
|
||||||
wchar16_t kanji[BUFFLENGTH * 2];
|
wchar16_t kanji[BUFFLENGTH * 2];
|
||||||
|
|
@ -243,15 +244,16 @@ int exec_kettei(void)
|
||||||
ResetHenkan();
|
ResetHenkan();
|
||||||
SetCflag();
|
SetCflag();
|
||||||
}
|
}
|
||||||
int set_rkebell(struct wordent word[])
|
|
||||||
|
set_rkebell(word) struct wordent word[];
|
||||||
{
|
{
|
||||||
if(match(word[1].word_str, WCOn))
|
if(match(word[1].word_str, WCOn))
|
||||||
rkerrbell = 1;
|
rkerrbell = 1;
|
||||||
if(match(word[1].word_str, WCOff))
|
if(match(word[1].word_str, WCOff))
|
||||||
rkerrbell = 0;
|
rkerrbell = 0;
|
||||||
}
|
}
|
||||||
int ChangeBuffMode(void)
|
|
||||||
{
|
ChangeBuffMode() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
|
|
@ -263,8 +265,8 @@ int ChangeBuffMode(void)
|
||||||
cv->BuffMode = BUFF;
|
cv->BuffMode = BUFF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int BuffYes(void)
|
|
||||||
{
|
BuffYes() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
|
|
@ -276,43 +278,43 @@ int BuffYes(void)
|
||||||
|
|
||||||
#define STAT_HENKAN 1
|
#define STAT_HENKAN 1
|
||||||
#define STAT_MUHENKAN 2
|
#define STAT_MUHENKAN 2
|
||||||
int IsHenkan(void)
|
|
||||||
{
|
IsHenkan() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
return (cv->henkanflag);
|
return (cv->henkanflag);
|
||||||
}
|
}
|
||||||
int IsMuhenkan(void)
|
|
||||||
{
|
IsMuhenkan() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
return (cv->henkanflag & STAT_MUHENKAN);
|
return (cv->henkanflag & STAT_MUHENKAN);
|
||||||
}
|
}
|
||||||
int SetMuhenkan(void)
|
|
||||||
{
|
SetMuhenkan() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
cv->henkanflag |= STAT_MUHENKAN;
|
cv->henkanflag |= STAT_MUHENKAN;
|
||||||
}
|
}
|
||||||
int SetHenkan(void)
|
|
||||||
{
|
SetHenkan() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
cv->henkanflag = STAT_HENKAN;
|
cv->henkanflag = STAT_HENKAN;
|
||||||
}
|
}
|
||||||
int ResetHenkan(void)
|
|
||||||
{
|
ResetHenkan() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
cv = GetConversion();
|
cv = GetConversion();
|
||||||
cv->henkanflag = 0;
|
cv->henkanflag = 0;
|
||||||
}
|
}
|
||||||
int all_set_up(void)
|
|
||||||
{
|
all_set_up() {
|
||||||
buffers_clear();
|
buffers_clear();
|
||||||
SetCflag();
|
SetCflag();
|
||||||
ResetHenkan();
|
ResetHenkan();
|
||||||
|
|
@ -320,23 +322,23 @@ int all_set_up(void)
|
||||||
|
|
||||||
static int convertflag;
|
static int convertflag;
|
||||||
static int small;
|
static int small;
|
||||||
int stat_conv_on(void)
|
|
||||||
{
|
stat_conv_on() {
|
||||||
convertflag = 1;
|
convertflag = 1;
|
||||||
}
|
}
|
||||||
int stat_init(void)
|
|
||||||
{
|
stat_init() {
|
||||||
stat_conv_on();
|
stat_conv_on();
|
||||||
all_set_up();
|
all_set_up();
|
||||||
disp_mode();
|
disp_mode();
|
||||||
small = 0;
|
small = 0;
|
||||||
}
|
}
|
||||||
int get_pseq(void)
|
|
||||||
{
|
get_pseq() {
|
||||||
return (write_pseq(1));
|
return (write_pseq(1));
|
||||||
}
|
}
|
||||||
int stat_conv(void)
|
|
||||||
{
|
stat_conv() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
extern int allways_buff;
|
extern int allways_buff;
|
||||||
int inc;
|
int inc;
|
||||||
|
|
@ -651,8 +653,8 @@ int stat_conv(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int save_obuf(void)
|
|
||||||
{
|
save_obuf() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i, cur;
|
int i, cur;
|
||||||
|
|
||||||
|
|
@ -681,8 +683,8 @@ int save_obuf(void)
|
||||||
osave_buf[os_point] = '\0';
|
osave_buf[os_point] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int restore_obuf(void)
|
|
||||||
{
|
restore_obuf() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
@ -704,7 +706,8 @@ int restore_obuf(void)
|
||||||
cv->Halpha[cv->ha_epoint] = '\0';
|
cv->Halpha[cv->ha_epoint] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int exec_ctrl(int c)
|
|
||||||
|
exec_ctrl(c) int c;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
wchar16_t s[3];
|
wchar16_t s[3];
|
||||||
|
|
@ -736,7 +739,8 @@ int exec_ctrl(int c)
|
||||||
master_write(s, 1);
|
master_write(s, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int exec_mode(int key)
|
|
||||||
|
exec_mode(key) int key;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
||||||
|
|
@ -751,7 +755,8 @@ int exec_mode(int key)
|
||||||
} else
|
} else
|
||||||
cv->Imode = eval_mode(key);
|
cv->Imode = eval_mode(key);
|
||||||
}
|
}
|
||||||
int toggle_mode(int mod)
|
|
||||||
|
toggle_mode(mod) int mod;
|
||||||
{
|
{
|
||||||
int value;
|
int value;
|
||||||
|
|
||||||
|
|
@ -774,7 +779,8 @@ int toggle_mode(int mod)
|
||||||
}
|
}
|
||||||
return (value);
|
return (value);
|
||||||
}
|
}
|
||||||
int eval_mode(int key)
|
|
||||||
|
eval_mode(key) int key;
|
||||||
{
|
{
|
||||||
int mod;
|
int mod;
|
||||||
|
|
||||||
|
|
@ -797,45 +803,56 @@ int eval_mode(int key)
|
||||||
}
|
}
|
||||||
return (mod);
|
return (mod);
|
||||||
}
|
}
|
||||||
int IsESC(wchar16_t c)
|
|
||||||
|
IsESC(c)
|
||||||
|
wchar16_t c;
|
||||||
{
|
{
|
||||||
if(c == ESC)
|
if(c == ESC)
|
||||||
return (1);
|
return (1);
|
||||||
else
|
else
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int Strncpy(wchar16_t * d, wchar16_t * s, int len)
|
|
||||||
|
Strncpy(d, s, len)
|
||||||
|
wchar16_t* d,
|
||||||
|
*s;
|
||||||
|
int len;
|
||||||
{
|
{
|
||||||
if((len > 0) && (s != (wchar16_t*)NULL))
|
if((len > 0) && (s != (wchar16_t*)NULL))
|
||||||
(void)wsncpy(d, s, len);
|
(void)wsncpy(d, s, len);
|
||||||
}
|
}
|
||||||
int is_bsdel(int c)
|
|
||||||
|
is_bsdel(c) int c;
|
||||||
{
|
{
|
||||||
if(is_bs(c) || is_del(c))
|
if(is_bs(c) || is_del(c))
|
||||||
return (1);
|
return (1);
|
||||||
else
|
else
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int clear_del(void)
|
|
||||||
{
|
clear_del() {
|
||||||
delkey = -1;
|
delkey = -1;
|
||||||
}
|
}
|
||||||
int set_bs(int c)
|
|
||||||
|
set_bs(c) int c;
|
||||||
{
|
{
|
||||||
bskey = c;
|
bskey = c;
|
||||||
}
|
}
|
||||||
int set_del(int c)
|
|
||||||
|
set_del(c) int c;
|
||||||
{
|
{
|
||||||
delkey = c;
|
delkey = c;
|
||||||
}
|
}
|
||||||
int is_bs(int c)
|
|
||||||
|
is_bs(c) int c;
|
||||||
{
|
{
|
||||||
if(c == bskey)
|
if(c == bskey)
|
||||||
return (1);
|
return (1);
|
||||||
else
|
else
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int is_del(int c)
|
|
||||||
|
is_del(c) int c;
|
||||||
{
|
{
|
||||||
if(c == delkey)
|
if(c == delkey)
|
||||||
return (1);
|
return (1);
|
||||||
|
|
@ -844,12 +861,12 @@ int is_del(int c)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Conversion* saved_conversion;
|
static Conversion* saved_conversion;
|
||||||
int SaveConversion(void)
|
|
||||||
{
|
SaveConversion() {
|
||||||
saved_conversion = GetConversion();
|
saved_conversion = GetConversion();
|
||||||
}
|
}
|
||||||
int AnotherConversion(void)
|
|
||||||
{
|
AnotherConversion() {
|
||||||
if(saved_conversion == GetConversion())
|
if(saved_conversion == GetConversion())
|
||||||
return (0);
|
return (0);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
3
study.c
3
study.c
|
|
@ -31,8 +31,7 @@
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
#include "kanakan.h"
|
#include "kanakan.h"
|
||||||
|
|
||||||
void mvmemi(unsigned char * src, unsigned char * dest, int len);
|
void mvmemi(), mvmemd();
|
||||||
void mvmemd(unsigned char * src, unsigned char * dest, int len);
|
|
||||||
|
|
||||||
int study(STDYOUT* stdy) {
|
int study(STDYOUT* stdy) {
|
||||||
STDYOUT outp;
|
STDYOUT outp;
|
||||||
|
|
|
||||||
4
term.c
4
term.c
|
|
@ -34,8 +34,8 @@ char* n_key_set = "\033P%d|%02x;%02x;%02xp";
|
||||||
char* s_key_set = "\033P%d|%02x;%02x;%02xP";
|
char* s_key_set = "\033P%d|%02x;%02x;%02xP";
|
||||||
|
|
||||||
#define ESCAPE '\033'
|
#define ESCAPE '\033'
|
||||||
int set_news(void)
|
|
||||||
{
|
set_news() {
|
||||||
|
|
||||||
aprintf(s_key_set, 24, ESCAPE, 'O', 'H');
|
aprintf(s_key_set, 24, ESCAPE, 'O', 'H');
|
||||||
aprintf(n_key_set, 24, ESCAPE, 'O', 'P');
|
aprintf(n_key_set, 24, ESCAPE, 'O', 'P');
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,10 @@
|
||||||
|
|
||||||
#include "sj_kcnv.h"
|
#include "sj_kcnv.h"
|
||||||
#include "sj_right.h"
|
#include "sj_right.h"
|
||||||
int terminate(TypeCnct right, unsigned char * yomi)
|
|
||||||
|
int terminate(right, yomi)
|
||||||
|
TypeCnct right;
|
||||||
|
unsigned char* yomi;
|
||||||
{
|
{
|
||||||
unsigned char ch;
|
unsigned char ch;
|
||||||
|
|
||||||
|
|
|
||||||
34
toroku.c
34
toroku.c
|
|
@ -36,8 +36,8 @@
|
||||||
extern struct valtbl hin_val[];
|
extern struct valtbl hin_val[];
|
||||||
|
|
||||||
extern int keyvalue;
|
extern int keyvalue;
|
||||||
int exec_toroku(void)
|
|
||||||
{
|
exec_toroku() {
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
wchar16_t yomi[YOMILEN + 1], kanji[KLEN + 1];
|
wchar16_t yomi[YOMILEN + 1], kanji[KLEN + 1];
|
||||||
wchar16_t* hinshi;
|
wchar16_t* hinshi;
|
||||||
|
|
@ -106,7 +106,11 @@ int exec_toroku(void)
|
||||||
}
|
}
|
||||||
return (val);
|
return (val);
|
||||||
}
|
}
|
||||||
int getyomi(wchar16_t * yomi, int lim, wchar16_t * prompt, wchar16_t * kanji)
|
|
||||||
|
getyomi(yomi, lim, prompt, kanji)
|
||||||
|
wchar16_t* yomi,
|
||||||
|
*prompt, *kanji;
|
||||||
|
int lim;
|
||||||
{
|
{
|
||||||
int inc, c;
|
int inc, c;
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
|
|
@ -172,8 +176,8 @@ int getyomi(wchar16_t * yomi, int lim, wchar16_t * prompt, wchar16_t * kanji)
|
||||||
wrap_on();
|
wrap_on();
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int gethinshi(void)
|
|
||||||
{
|
gethinshi() {
|
||||||
int inc, hcode;
|
int inc, hcode;
|
||||||
|
|
||||||
TopGuide();
|
TopGuide();
|
||||||
|
|
@ -190,7 +194,10 @@ int gethinshi(void)
|
||||||
hcode = 1;
|
hcode = 1;
|
||||||
return (hcode);
|
return (hcode);
|
||||||
}
|
}
|
||||||
int getcheck(wchar16_t * yomi, wchar16_t * kanji, wchar16_t * hinshi, wchar16_t * prompt)
|
|
||||||
|
getcheck(yomi, kanji, hinshi, prompt)
|
||||||
|
wchar16_t* yomi,
|
||||||
|
*kanji, *hinshi, *prompt;
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
unsigned char tmp[BUFFLENGTH + KLEN];
|
unsigned char tmp[BUFFLENGTH + KLEN];
|
||||||
|
|
@ -243,7 +250,11 @@ int getcheck(wchar16_t * yomi, wchar16_t * kanji, wchar16_t * hinshi, wchar16_t
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
int getkstr(wchar16_t * s, int lim, wchar16_t * guide)
|
|
||||||
|
getkstr(s, lim, guide)
|
||||||
|
wchar16_t* s,
|
||||||
|
*guide;
|
||||||
|
int lim;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -271,7 +282,10 @@ int getkstr(wchar16_t * s, int lim, wchar16_t * guide)
|
||||||
*s = '\0';
|
*s = '\0';
|
||||||
return (chbun);
|
return (chbun);
|
||||||
}
|
}
|
||||||
int getbunsetu(wchar16_t * kanji, wchar16_t * guide)
|
|
||||||
|
getbunsetu(kanji, guide)
|
||||||
|
wchar16_t* kanji,
|
||||||
|
*guide;
|
||||||
{
|
{
|
||||||
Conversion* cv;
|
Conversion* cv;
|
||||||
int c;
|
int c;
|
||||||
|
|
@ -358,8 +372,8 @@ int getbunsetu(wchar16_t * kanji, wchar16_t * guide)
|
||||||
}
|
}
|
||||||
return (len);
|
return (len);
|
||||||
}
|
}
|
||||||
int exec_syoukyo(void)
|
|
||||||
{
|
exec_syoukyo() {
|
||||||
int i;
|
int i;
|
||||||
wchar16_t yomi[YOMILEN + 1], kanji[KLEN + 1];
|
wchar16_t yomi[YOMILEN + 1], kanji[KLEN + 1];
|
||||||
wchar16_t tmp[BUFFLENGTH], tmp2[BUFFLENGTH * 2];
|
wchar16_t tmp[BUFFLENGTH], tmp2[BUFFLENGTH * 2];
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,8 @@
|
||||||
#include "sj_hinsi.h"
|
#include "sj_hinsi.h"
|
||||||
#include "kanakan.h"
|
#include "kanakan.h"
|
||||||
|
|
||||||
int terminate(TypeCnct right, unsigned char * yomi);
|
int terminate();
|
||||||
void setclrec(JREC * jrec, unsigned char * yptr, TypeCnct right);
|
void setclrec(), srchfzk();
|
||||||
void srchfzk(JREC * jrec, unsigned char * yptr, TypeCnct right, int level);
|
|
||||||
|
|
||||||
void wakachi(void) {
|
void wakachi(void) {
|
||||||
JREC* jrec;
|
JREC* jrec;
|
||||||
|
|
|
||||||
94
wc16_str.c
94
wc16_str.c
|
|
@ -54,27 +54,35 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int current_locale;
|
extern int current_locale;
|
||||||
int sj3_iswcntrl16(wchar16_t wc)
|
|
||||||
|
int sj3_iswcntrl16(wc)
|
||||||
|
wchar16_t wc;
|
||||||
{
|
{
|
||||||
if((wc < 0x20) || (wc == 0x7f)) return TRUE;
|
if((wc < 0x20) || (wc == 0x7f)) return TRUE;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
int sj3_iswupper16(wchar16_t wc)
|
|
||||||
|
int sj3_iswupper16(wc)
|
||||||
|
wchar16_t wc;
|
||||||
{
|
{
|
||||||
if(((0x40 < wc) && (wc < 0x5b)) ||
|
if(((0x40 < wc) && (wc < 0x5b)) ||
|
||||||
((0xa3c0 < wc) && (wc < 0xa3db))) return TRUE;
|
((0xa3c0 < wc) && (wc < 0xa3db))) return TRUE;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
int sj3_iswdigit16(wchar16_t wc)
|
|
||||||
|
int sj3_iswdigit16(wc)
|
||||||
|
wchar16_t wc;
|
||||||
{
|
{
|
||||||
if(((0x29 < wc) && (wc < 0x3a)) ||
|
if(((0x29 < wc) && (wc < 0x3a)) ||
|
||||||
((0xa3af < wc) && (wc < 0xa3ba))) return TRUE;
|
((0xa3af < wc) && (wc < 0xa3ba))) return TRUE;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
int sj3_iswxdigit16(wchar16_t wc)
|
|
||||||
|
int sj3_iswxdigit16(wc)
|
||||||
|
wchar16_t wc;
|
||||||
{
|
{
|
||||||
if(((0x29 < wc) && (wc < 0x3a)) ||
|
if(((0x29 < wc) && (wc < 0x3a)) ||
|
||||||
((0xa3af < wc) && (wc < 0xa3ba))) return TRUE;
|
((0xa3af < wc) && (wc < 0xa3ba))) return TRUE;
|
||||||
|
|
@ -87,7 +95,9 @@ int sj3_iswxdigit16(wchar16_t wc)
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
int sj3_wslen16(wchar16_t * ws)
|
|
||||||
|
int sj3_wslen16(ws)
|
||||||
|
wchar16_t* ws;
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
|
@ -96,7 +106,9 @@ int sj3_wslen16(wchar16_t * ws)
|
||||||
while(*ws++) i++;
|
while(*ws++) i++;
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
int sj3_wscmp16(wchar16_t * ws1, wchar16_t * ws2)
|
|
||||||
|
int sj3_wscmp16(ws1, ws2)
|
||||||
|
wchar16_t *ws1, *ws2;
|
||||||
{
|
{
|
||||||
while((*ws1 && *ws2) && (*ws1 == *ws2)) {
|
while((*ws1 && *ws2) && (*ws1 == *ws2)) {
|
||||||
ws1++;
|
ws1++;
|
||||||
|
|
@ -108,7 +120,10 @@ int sj3_wscmp16(wchar16_t * ws1, wchar16_t * ws2)
|
||||||
if(*ws1 < *ws2) return -1;
|
if(*ws1 < *ws2) return -1;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
int sj3_wsncmp16(wchar16_t * ws1, wchar16_t * ws2, int n)
|
|
||||||
|
int sj3_wsncmp16(ws1, ws2, n)
|
||||||
|
wchar16_t *ws1, *ws2;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
|
@ -125,7 +140,9 @@ int sj3_wsncmp16(wchar16_t * ws1, wchar16_t * ws2, int n)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
wchar16_t* sj3_wscpy16(wchar16_t * ws1, wchar16_t * ws2)
|
wchar16_t*
|
||||||
|
sj3_wscpy16(ws1, ws2)
|
||||||
|
wchar16_t *ws1, *ws2;
|
||||||
{
|
{
|
||||||
wchar16_t* ws;
|
wchar16_t* ws;
|
||||||
|
|
||||||
|
|
@ -139,7 +156,10 @@ wchar16_t* sj3_wscpy16(wchar16_t * ws1, wchar16_t * ws2)
|
||||||
return ws1;
|
return ws1;
|
||||||
}
|
}
|
||||||
|
|
||||||
wchar16_t* sj3_wsncpy16(wchar16_t * ws1, wchar16_t * ws2, int n)
|
wchar16_t*
|
||||||
|
sj3_wsncpy16(ws1, ws2, n)
|
||||||
|
wchar16_t *ws1, *ws2;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
wchar16_t* ws;
|
wchar16_t* ws;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
@ -155,7 +175,9 @@ wchar16_t* sj3_wsncpy16(wchar16_t * ws1, wchar16_t * ws2, int n)
|
||||||
return ws1;
|
return ws1;
|
||||||
}
|
}
|
||||||
|
|
||||||
wchar16_t* sj3_wscat16(wchar16_t * ws1, wchar16_t * ws2)
|
wchar16_t*
|
||||||
|
sj3_wscat16(ws1, ws2)
|
||||||
|
wchar16_t *ws1, *ws2;
|
||||||
{
|
{
|
||||||
wchar16_t* ws;
|
wchar16_t* ws;
|
||||||
|
|
||||||
|
|
@ -173,7 +195,9 @@ wchar16_t* sj3_wscat16(wchar16_t * ws1, wchar16_t * ws2)
|
||||||
return ws1;
|
return ws1;
|
||||||
}
|
}
|
||||||
|
|
||||||
wchar16_t sj3_euc2wc16(unsigned int code)
|
wchar16_t
|
||||||
|
sj3_euc2wc16(code)
|
||||||
|
unsigned int code;
|
||||||
{
|
{
|
||||||
wchar16_t wc = 0;
|
wchar16_t wc = 0;
|
||||||
|
|
||||||
|
|
@ -188,7 +212,9 @@ wchar16_t sj3_euc2wc16(unsigned int code)
|
||||||
return wc;
|
return wc;
|
||||||
}
|
}
|
||||||
|
|
||||||
wchar16_t sj3_sjis2wc16(unsigned int code)
|
wchar16_t
|
||||||
|
sj3_sjis2wc16(code)
|
||||||
|
unsigned int code;
|
||||||
{
|
{
|
||||||
unsigned short ch;
|
unsigned short ch;
|
||||||
|
|
||||||
|
|
@ -202,7 +228,9 @@ wchar16_t sj3_sjis2wc16(unsigned int code)
|
||||||
return (sj3_euc2wc16(ch));
|
return (sj3_euc2wc16(ch));
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int sj3_wc2euc16(wchar16_t wc)
|
unsigned int
|
||||||
|
sj3_wc2euc16(wc)
|
||||||
|
wchar16_t wc;
|
||||||
{
|
{
|
||||||
unsigned int code = 0;
|
unsigned int code = 0;
|
||||||
unsigned char tmp;
|
unsigned char tmp;
|
||||||
|
|
@ -225,7 +253,9 @@ unsigned int sj3_wc2euc16(wchar16_t wc)
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int sj3_wc2sjis16(wchar16_t wc)
|
unsigned int
|
||||||
|
sj3_wc2sjis16(wc)
|
||||||
|
wchar16_t wc;
|
||||||
{
|
{
|
||||||
unsigned int ch;
|
unsigned int ch;
|
||||||
|
|
||||||
|
|
@ -240,7 +270,11 @@ unsigned int sj3_wc2sjis16(wchar16_t wc)
|
||||||
return wc;
|
return wc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int sj3_wcs2eucs16(unsigned char * mb, wchar16_t * ws, int n)
|
|
||||||
|
int sj3_wcs2eucs16(mb, ws, n)
|
||||||
|
unsigned char* mb;
|
||||||
|
wchar16_t* ws;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
unsigned int code;
|
unsigned int code;
|
||||||
|
|
@ -280,7 +314,11 @@ int sj3_wcs2eucs16(unsigned char * mb, wchar16_t * ws, int n)
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
int sj3_wcs2sjiss16(unsigned char * mb, wchar16_t * ws, int n)
|
|
||||||
|
int sj3_wcs2sjiss16(mb, ws, n)
|
||||||
|
unsigned char* mb;
|
||||||
|
wchar16_t* ws;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
unsigned int code;
|
unsigned int code;
|
||||||
|
|
@ -310,7 +348,11 @@ int sj3_wcs2sjiss16(unsigned char * mb, wchar16_t * ws, int n)
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
int sj3_eucs2wcs16(wchar16_t * ws, unsigned char * mb, int n)
|
|
||||||
|
int sj3_eucs2wcs16(ws, mb, n)
|
||||||
|
wchar16_t* ws;
|
||||||
|
unsigned char* mb;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
unsigned int code;
|
unsigned int code;
|
||||||
|
|
@ -337,7 +379,11 @@ int sj3_eucs2wcs16(wchar16_t * ws, unsigned char * mb, int n)
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
int sj3_sjiss2wcs16(wchar16_t * ws, unsigned char * mb, int n)
|
|
||||||
|
int sj3_sjiss2wcs16(ws, mb, n)
|
||||||
|
wchar16_t* ws;
|
||||||
|
unsigned char* mb;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
unsigned int code;
|
unsigned int code;
|
||||||
|
|
@ -360,14 +406,22 @@ int sj3_sjiss2wcs16(wchar16_t * ws, unsigned char * mb, int n)
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
int sj3_mbstowcs16(wchar16_t * ws, unsigned char * mb, int n)
|
|
||||||
|
int sj3_mbstowcs16(ws, mb, n)
|
||||||
|
wchar16_t* ws;
|
||||||
|
unsigned char* mb;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
if(current_locale == LC_CTYPE_EUC)
|
if(current_locale == LC_CTYPE_EUC)
|
||||||
return sj3_eucs2wcs16(ws, mb, n);
|
return sj3_eucs2wcs16(ws, mb, n);
|
||||||
else
|
else
|
||||||
return sj3_sjiss2wcs16(ws, mb, n);
|
return sj3_sjiss2wcs16(ws, mb, n);
|
||||||
}
|
}
|
||||||
int sj3_wcstombs16(unsigned char * mb, wchar16_t * ws, int n)
|
|
||||||
|
int sj3_wcstombs16(mb, ws, n)
|
||||||
|
unsigned char* mb;
|
||||||
|
wchar16_t* ws;
|
||||||
|
int n;
|
||||||
{
|
{
|
||||||
if(current_locale == LC_CTYPE_EUC)
|
if(current_locale == LC_CTYPE_EUC)
|
||||||
return sj3_wcs2eucs16(mb, ws, n);
|
return sj3_wcs2eucs16(mb, ws, n);
|
||||||
|
|
|
||||||
|
|
@ -344,8 +344,6 @@ typedef unsigned short wchar16_t;
|
||||||
|
|
||||||
extern wchar16_t* WcMessages[];
|
extern wchar16_t* WcMessages[];
|
||||||
|
|
||||||
struct wordent;
|
|
||||||
|
|
||||||
struct wcvtkey {
|
struct wcvtkey {
|
||||||
wchar16_t* key_word;
|
wchar16_t* key_word;
|
||||||
wchar16_t key_seq[SEQLEN];
|
wchar16_t key_seq[SEQLEN];
|
||||||
|
|
@ -353,7 +351,7 @@ struct wcvtkey {
|
||||||
|
|
||||||
struct functbl {
|
struct functbl {
|
||||||
wchar16_t* keyword;
|
wchar16_t* keyword;
|
||||||
int (*func)(struct wordent* word);
|
int (*func)();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue