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