This commit is contained in:
Nishi 2026-06-19 01:49:53 +09:00
commit 73cb09624a
116 changed files with 19741 additions and 21522 deletions

24
.clang-format Normal file
View file

@ -0,0 +1,24 @@
---
UseTab: Always
TabWidth: 8
AlignConsecutiveAssignments:
Enabled: true
AlignConsecutiveDeclarations:
Enabled: true
AccessModifierOffset: -4
NamespaceIndentation: All
IndentWidth: 8
PointerAlignment: Left
ColumnLimit: 0
AllowShortIfStatementsOnASingleLine: Always
AllowShortBlocksOnASingleLine: Never
AllowShortFunctionsOnASingleLine: Empty
AllowShortLoopsOnASingleLine: true
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
SpaceBeforeParens: Never
AlignEscapedNewlines: DontAlign
SortIncludes: false
AllowShortEnumsOnASingleLine: false
#IndentPPDirectives: AfterHash

2
format.sh Executable file
View file

@ -0,0 +1,2 @@
#!/bin/sh
clang-format --verbose -i `find src lib include -name "*.c" -or -name "*.h"`

View file

@ -33,16 +33,8 @@
* $SonyDate: 1994/06/03 08:00:57 $
*/
#define SJ3SERV_VERSION_NO 2
#define SJ3_CONNECT 1
#define SJ3_DISCONNECT 2

View file

@ -33,10 +33,6 @@
* $SonyDate: 1994/06/03 08:00:58 $
*/
#define SJ3_InternalError -1
#define SJ3_NormalEnd 0

View file

@ -105,7 +105,6 @@
#define EUC_a4 (u_char)0xa4
#define EUC_a5 (u_char)0xa5
#define EUC_START (u_char)0xa1
#define EUC_END (u_char)0xfe
#define EUC_END_KIGOU (u_char)0xae
@ -151,5 +150,4 @@
#define NUMKETALENGTH 16
#define NUMWORDBUF ((NUMKETALENGTH + 3) / 4)
#endif

View file

@ -33,10 +33,6 @@
* $SonyDate: 1994/06/03 08:01:07 $
*/
#ifndef _SJ_HINSHI
#define _SJ_HINSHI
@ -95,7 +91,6 @@
#define FUKUSI_9 53
#define JOSUUSI2 54
#define KEIYOUSI_1 60
#define KEIYOUSI_2 61
#define KEIYOUSI_3 62
@ -120,7 +115,6 @@
#define DO_SAHEN 80
#define DO_ZAHEN 81
#define DO_1DAN_1 90
#define DO_KAGO_1 91
#define DO_GAGO_1 92
@ -142,7 +136,6 @@
#define DO_RAGO_2 107
#define DO_WAGO_2 108
#define DO_KAGO_5 111
#define DO_GAGO_5 112
#define DO_SAGO_5 113
@ -152,7 +145,6 @@
#define DO_RAGO_5 117
#define DO_WAGO_5 118
#define DO_KAGO_6 121
#define DO_GAGO_6 122
#define DO_SAGO_6 123
@ -162,7 +154,6 @@
#define DO_RAGO_6 127
#define DO_WAGO_6 128
#define DO_1DAN_3 130
#define DO_KAGO_3 131
#define DO_GAGO_3 132
@ -173,7 +164,6 @@
#define DO_RAGO_3 137
#define DO_WAGO_3 138
#define DO_1DAN_4 140
#define DO_KAGO_4 141
#define DO_GAGO_4 142
@ -184,7 +174,6 @@
#define DO_RAGO_4 147
#define DO_WAGO_4 148
#define DO_KAGO_7 151
#define DO_GAGO_7 152
#define DO_SAGO_7 153
@ -194,7 +183,6 @@
#define DO_RAGO_7 157
#define DO_WAGO_7 158
#define DO_KAGO_8 161
#define DO_GAGO_8 162
#define DO_SAGO_8 163
@ -204,7 +192,6 @@
#define DO_RAGO_8 167
#define DO_WAGO_8 168
#define SP_SA_MI1 171
#define SP_SA_MI2 172
#define SP_SA_YOU 173

View file

@ -33,15 +33,11 @@
* $SonyDate: 1994/06/03 08:00:55 $
*/
#define VERSIONPOS 0
#define PASSWDPOS 16
#define PASSWDLEN 16
#define STDYNORMPOS 32
#define STDYNORMLEN 36
#define STDYNORMNUM 40
@ -54,7 +50,6 @@
#define STDYCLSEGPOS 64
#define STDYCLSEGLEN 68
#define DICTIDXPOS 32
#define DICTIDXLEN 36
@ -69,13 +64,11 @@
#define DICTASEGPOS 80
#define DICTASEGLEN 84
#define HEADERPOS 0
#define HEADERLENGTH 128
#define COMMENTPOS 128
#define COMMENTLENGTH 128
#define Byte2Long(c3, c2, c1, c0) (((c3) << (8 * 3)) | ((c2) << (8 * 2)) | \
((c1) << (8 * 1)) | ((c0) << (8 * 0)))
#define STDYVERSION Byte2Long('S', 2, 0, 0)

View file

@ -113,7 +113,6 @@ typedef struct global {
TypeDicSeg Jpeepidx;
} Global;
typedef struct dictfile {
DICT dict;
int refcnt;

View file

@ -36,10 +36,6 @@
#ifndef SJ3LOWLIB_H
#define SJ3LOWLIB_H
typedef struct sj3_client_env {
int fd;
int serv_dead_flg;
@ -49,9 +45,6 @@ typedef struct sj3_client_env {
char default_char[2];
} SJ3_CLIENT_ENV;
#ifndef SJ3_NAME_LENGTH
#define SJ3_NAME_LENGTH 128
#endif
@ -62,7 +55,6 @@ typedef struct sj3_who_struct {
char progname[SJ3_NAME_LENGTH];
} SJ3_WHO_STRUCT;
#define MBCODE_SJIS 1
#define MBCODE_EUC 2

View file

@ -33,10 +33,6 @@
* $SonyDate: 1994/06/03 08:01:00 $
*/
#ifndef _SJ_CONNECT
#define _SJ_CONNECT
@ -279,7 +275,6 @@
#define ttarasii_x 0
#define wo_o 0x80
#define ttatte_o 0x40
#define ttara_o 0x20
@ -419,7 +414,6 @@
#define n_si_o 0x20
#define deha_o 0x10
#define gotosi_o 0x80
#define saseru_o 0x40
#define zaru_o 0x20
@ -520,5 +514,4 @@
#define ttarasii_o 0x10
#endif

View file

@ -105,7 +105,6 @@
#define EUC_a4 (u_char)0xa4
#define EUC_a5 (u_char)0xa5
#define EUC_START (u_char)0xa1
#define EUC_END (u_char)0xfe
#define EUC_END_KIGOU (u_char)0xae
@ -151,5 +150,4 @@
#define NUMKETALENGTH 16
#define NUMWORDBUF ((NUMKETALENGTH + 3) / 4)
#endif

View file

@ -33,16 +33,10 @@
* $SonyDate: 1994/06/03 08:01:03 $
*/
#ifndef _SJ_DICT
#define _SJ_DICT
#define DIC_MAIN 0
#define DIC_USER 1
@ -54,8 +48,6 @@
#define HINSIBLKTERM 0xff
#define MAXSEGMENTNUMBER 0xffff
#define NORMALKANJIMASK 0x7f
#define SS3KANJI 0x0080
#define ZENHIRAASSYUKU 0x80
@ -81,7 +73,6 @@
#define ASSYUKUYOMITOP 0x80
#define NOKORIYOMITOP 0x40
#define getsize(p) (((int)(*(p) & 0x0f) * 0x100) + *((p) + 1))
#define getntag(p) ((*(p) == DICSEGTERM) ? (p) : (p) + getsize(p))
@ -95,4 +86,3 @@
#define segend(p) (*(p) == DICSEGTERM || (p) >= dicbuf + curdict->seglen)
#endif

View file

@ -338,6 +338,4 @@ extern u_char termtbl[];
/* wakachi.c */
void wakachi(void);
#endif /* KANAKAN_H */

View file

@ -33,17 +33,10 @@
* $SonyDate: 1994/06/03 08:01:12 $
*/
#ifndef _SJ_LEFT
#define _SJ_LEFT
#define L_WO 0x01
#define L_TTATTE 0x02
#define L_TTARA 0x03
@ -183,8 +176,6 @@
#define L_N_SI 0x7b
#define L_DEHA 0x7c
#define L_GOTOSI 0x81
#define L_SASERU 0x82
#define L_ZARU 0x83
@ -230,9 +221,6 @@
#define L_RERU 0xa7
#define L_SITE 0xa8
#define L_YOUGEN 0xa9
#define L_ARU 0xaa
#define L_ARA 0xab

View file

@ -33,17 +33,10 @@
* $SonyDate: 1994/06/03 08:01:13 $
*/
#ifndef _SJ_PRIORITY
#define _SJ_PRIORITY
#define RENTAI 0x10
#define GETPRI 0x0f

View file

@ -33,7 +33,6 @@
* $SonyDate: 1994/06/03 08:01:14 $
*/
#ifndef _SJ_RENAME
#define _SJ_RENAME
@ -47,8 +46,6 @@
#define sprt_seg Jsprt_seg
#define apnd_uidx Japnd_uidx
#define set_size Jset_size
#define isvyomi Jisvyomi
#define isvknj Jisvknj
@ -64,8 +61,6 @@
#define count_uidx Jcount_uidx
#define chg_uidx Jchg_uidx
#define cl2knj Jcl2knj
#define nextcl Jnextcl
#define nextrecblk Jnextrecblk
@ -75,8 +70,6 @@
#define selectnum Jselectnum
#define kouhonum Jkouhonum
#define clstudy Jclstudy
#define delcldata Jdelcldata
#define delclsub Jdelclsub
@ -84,47 +77,33 @@
#define srchclpos Jsrchclpos
#define mkclidx Jmkclidx
#define cvtclknj Jcvtclknj
#define cvtdict Jcvtdict
#define cvtminasi Jcvtminasi
#define cvtwakachi Jcvtwakachi
#define cvtphknj Jcvtphknj
#define cvtkouho Jcvtkouho
#define setstyrec Jsetstyrec
#define deldic Jdeldic
#define del_douon Jdel_douon
#define del_segment Jdel_segment
#define del_uidx Jdel_uidx
#define del_stdy Jdel_stdy
#define get_askknj Jget_askknj
#define seldict Jseldict
#define sel_udict Jsel_udict
#define get_idxofs Jget_idxofs
#define get_idxptr Jget_idxptr
#define fzkstrcmp Jfzkstrcmp
#define setclrec Jsetclrec
#define fzkcnct Jfzkcnct
#define srchfzk Jsrchfzk
#define getkan_none Jgetkan_none
#define getkan_hira Jgetkan_hira
#define getkan_kata Jgetkan_kata
@ -134,19 +113,14 @@
#define code2kanji Jcode2kanji
#define getkanji Jgetkanji
#define getrank Jgetrank
#define setstynum Jsetstynum
#define setnspr Jsetnspr
#define regetrank Jregetrank
#define work_base Jwork_base
#define stdy_base Jstdy_base
#define maxjptr (work_base->Jmaxjptr)
#define maxclptr (work_base->Jmaxclptr)
#define jrt1st (work_base->Jjrt1st)
@ -220,14 +194,10 @@
#define peepkptr (work_base->Jpeepkptr)
#define peepidx (work_base->Jpeepidx)
#define seg_count Jseg_count
#define mkidxtbl Jmkidxtbl
#define initwork Jinitwork
#define free_jlst Jfree_jlst
#define free_clst Jfree_clst
#define free_clall Jfree_clall
@ -235,25 +205,17 @@
#define freework Jfreework
#define free_kjall Jfree_kjall
#define set2nd Jset2nd
#define mk2claus Jmk2claus
#define mkbunsetu Jmkbunsetu
#define argclrec Jargclrec
#define mkjiritu Jmkjiritu
#define dic_mu Jdic_mu
#define argjrec Jargjrec
#define dic_cl Jdic_cl
#define mkkouho Jmkkouho
#define getkhtbl Jgetkhtbl
#define cl_kanji Jcl_kanji
@ -264,8 +226,6 @@
#define sel_sjmode Jsel_sjmode
#define cl_numcmn Jcl_numcmn
#define word2char Jword2char
#define words2num Jwords2num
#define num_type00 Jnum_type00
@ -286,8 +246,6 @@
#define num_type13 Jnum_type13
#define num_type14 Jnum_type14
#define getusr Jgetusr
#define nextusr Jnextusr
#define prevusr Jprevusr
@ -302,20 +260,14 @@
#define add_yomi Jadd_yomi
#define cd2sjh_chr Jcd2sjh_chr
#define ph2knj Jph2knj
#define ph_setsty Jph_setsty
#define nextkptr Jnextkptr
#define maxpset Jmaxpset
#define mkknjmax Jmkknjmax
#define ph_khtbl Jph_khtbl
#define isfukusi Jisfukusi
#define istaigen Jistaigen
#define taicnt Jtaicnt
@ -323,12 +275,8 @@
#define priority Jpriority
#define pritiny Jpritiny
#define selclrec Jselclrec
#define initknjall Jinitknjall
#define knjtouroku Jknjtouroku
#define knjitti Jknjitti
@ -341,14 +289,10 @@
#define selectknj Jselectknj
#define selknj Jselknj
#define cnjstrcmp Jcnjstrcmp
#define cnvrow Jcnvrow
#define setconj Jsetconj
#define setj_atrb Jsetj_atrb
#define setj_ofs Jsetj_ofs
#define setj_knj Jsetj_knj
@ -359,8 +303,6 @@
#define setnumrec Jsetnumrec
#define setcrec Jsetcrec
#define setkouho Jsetkouho
#define ph_setkouho Jph_setkouho
#define hiraknj Jhiraknj
@ -372,18 +314,12 @@
#define hiraknj_norm Jhiraknj_norm
#define hiraknj_hira Jhiraknj_hira
#define getstb Jgetstb
#define setubi Jsetubi
#define sj2cd_chr Jsj2cd_chr
#define sj2cd_str Jsj2cd_str
#define retaiofs Jretaiofs
#define srchai2nd Jsrchai2nd
#define srchai1st Jsrchai1st
@ -392,14 +328,10 @@
#define srchai6th Jsrchai6th
#define srchai5th Jsrchai5th
#define yomicmp_sub Jyomicmp_sub
#define yomicmp Jyomicmp
#define srchdict Jsrchdict
#define srchg_atrb Jsrchg_atrb
#define srchg_ofs Jsrchg_ofs
#define srchg_knj Jsrchg_knj
@ -408,16 +340,10 @@
#define srchgrp2nd Jsrchgrp2nd
#define srchgrp1st Jsrchgrp1st
#define srchhead Jsrchhead
#define srchidx Jsrchidx
#define srch_josuu_sub Jsrch_josuu_sub
#define srch_josuu Jsrch_josuu
#define setnrec_sub Jsetnrec_sub
@ -435,115 +361,62 @@
#define setwdnum Jsetwdnum
#define setucnum Jsetucnum
#define study Jstudy
#define srchstdy Jsrchstdy
#define terminate Jterminate
#define wakachi Jwakachi
#define cmpstr Jcmpstr
#define hzstrlen Jhzstrlen
#define istrcmp Jistrcmp
#define mvmemd Jmvmemd
#define mvmemi Jmvmemi
#define skiphblk Jskiphblk
#define skipkstr Jskipkstr
#define sstrcmp Jsstrcmp
#define sstrlen Jsstrlen
#define sstrncmp Jsstrncmp
#define charsize Jcharsize
#define chrtbl Jchrtbl
#define conjadr Jconjadr
#define connadr Jconnadr
#define rigtadr Jrigtadr
#define cvtnum_func Jcvtnum_func
#define getkan_func Jgetkan_func
#define setjrec_func Jsetjrec_func
#define srchg_func Jsrchg_func
#define hiraknj_func Jhiraknj_func
#define fzkadr Jfzkadr
#define taipri Jtaipri
#define sttpri Jsttpri
#define kigou Jkigou
#define selsjadrs Jselsjadrs
#define stbadr Jstbadr
#define settou_ptr Jsettou_ptr
#define scncttbl Jscncttbl
#define suuji_tbl Jsuuji_tbl
#define kurai1_tbl Jkurai1_tbl
#define kurai2_tbl Jkurai2_tbl
@ -554,8 +427,6 @@
#define num5tbl Jnum5tbl
#define num6tbl Jnum6tbl
#define termtbl Jtermtbl
#endif

View file

@ -33,10 +33,6 @@
* $SonyDate: 1994/06/03 08:01:15 $
*/
#ifndef _SJ_RIGHT
#define _SJ_RIGHT
@ -67,19 +63,10 @@
#define R_SASE 23
#define R_RARE 24
#define R_ITADAKE 25
#define R_EXP 26
#define R_RENYOU1 27
#define R_RENYOU5 28
#define R_SA5RENYOU1 29
@ -128,9 +115,6 @@
#define R_YORI2 72
#define R_RASHUU 73
#define R_DSHUUSI1 74
#define R_DSHUUSI2 75
#define R_GOTOSI 76
@ -140,9 +124,6 @@
#define R_MAI 80
#define R_MITAIDA 81
#define R_SHUUSI 82
#define R_KSHUUSI 83
#define R_ZARU 84
@ -156,9 +137,6 @@
#define R_NN2 92
#define R_RASII 93
#define R_DRENTAI1 94
#define R_DRENTAI2 95
#define R_DRENTAI3 96
@ -169,38 +147,19 @@
#define R_SOUNA2 101
#define R_NA2 102
#define R_KATEI1 103
#define R_KATEI2 104
#define R_KATEI3 105
#define R_KAMEI 106
#define R_IKE 107
#define R_KURE 108
#define R_MEIREI1 109
#define R_MEIREI2 110
#define R_DGOKAN 111
#define R_KGOKAN 112
#define R_SGOKAN 113
@ -212,14 +171,8 @@
#define R_YOU2 119
#define R_SHO 120
#define R_FZKMEISI 121
#define R_AISATU 122
#define R_KOSODO 123
@ -239,7 +192,6 @@
#define R_F_FUKUSI 135
#define R_CUT 137
#define R_MIZEN2 140
#define R_MIZEN3 141
#define R_MIZEN4 142
@ -352,8 +304,6 @@
#define R_NN1 240
#define R_SUUSI 241
#define R_SETUZOKU 242
#define R_KANDOU 243

View file

@ -33,16 +33,10 @@
* $SonyDate: 1994/06/03 08:01:16 $
*/
#ifndef _SJ_STRUCT
#define _SJ_STRUCT
typedef struct jiritu {
struct jiritu* jsort;
TypeDicSeg jseg;
@ -59,9 +53,6 @@ typedef struct jiritu {
u_char numlen;
} JREC;
typedef struct bunsetu {
JREC* jnode;
struct bunsetu* clsort;
@ -78,9 +69,6 @@ typedef struct bunsetu {
#endif
} CLREC;
typedef struct kouho {
CLREC* clrec;
TypeDicOfs offs;
@ -101,25 +89,17 @@ typedef struct kouho {
#endif
} KHREC;
typedef struct conj {
u_char len;
TypeCnct right;
} CREC;
typedef struct fuzoku {
u_char* yomip;
u_char* fzkp;
} FREC;
typedef struct study_in {
TypeDicOfs offset;
TypeDicSeg seg;
@ -136,9 +116,6 @@ typedef struct study_in {
#endif
} STDYIN;
typedef struct study_out {
STDYIN stdy1;
TypeGram hinshi;
@ -154,9 +131,6 @@ typedef struct study_out {
#endif
} STDYOUT;
typedef struct dict {
TypeDicID dicid;
@ -174,17 +148,11 @@ typedef struct dict {
IFunc rszdic;
} DICT;
typedef struct dictl {
DICT* dict;
struct dictl* next;
} DICTL;
typedef struct stdy {
short stdycnt;
short stdymax;

View file

@ -74,8 +74,6 @@
#define CL_YDATA 5
#define CL_HDLEN 5
#define iseocl(p) (!ClYomiLen(p) || (u_char*)(p) >= CLSTUDYTAIL)
#define ClGramCode(p) *((p) + CL_GRAM2)

View file

@ -33,16 +33,10 @@
* $SonyDate: 1994/06/03 08:01:19 $
*/
#ifndef _SJ_SUUJI
#define _SJ_SUUJI
#define SJTBLRECLEN 6
#define SJTBLRECNUM 34
#define SjTblYPos(p) (p)
@ -113,21 +107,12 @@
#define SELNUM0123 (JFLAG_N01 | JFLAG_N23)
#define SELNUM1_23_10_1 (JFLAG_N_1 | JFLAG_N23 | JFLAG_N10 | JFLAG_NS1)
#define SELNUMMUST (JFLAG_NK2 | JFLAG_NK4 | JFLAG_NN0 | JFLAG_NSN)
#define SELNUMALL (JFLAG_N10 | JFLAG_N_1 | JFLAG_NS1 | JFLAG_N01 \
| JFLAG_N23 | JFLAG_NK2 | JFLAG_NK4 \
| JFLAG_NN0 | JFLAG_NSN)
#define SELNUMALL (JFLAG_N10 | JFLAG_N_1 | JFLAG_NS1 | JFLAG_N01 | JFLAG_N23 | JFLAG_NK2 | JFLAG_NK4 | JFLAG_NN0 | JFLAG_NSN)
#define SelNumFunc(c) ((c) & (~SELNUMALL))
#define SelNumCond(c) ((c) & SELNUMALL)
#define NUMBER123456789NS ((1<<_NUM1)|(1<<_NUM2)|(1<<_NUM3)|(1<<_NUM4) \
|(1<<_NUM5)|(1<<_NUM6)|(1<<_NUM7)|(1<<_NUM8) \
|(1<<_NUM9)|(1<<_NUM1S)\
|(1<<_NUMN)|(1<<_NUMS))
#define NUMBER123456789NS ((1 << _NUM1) | (1 << _NUM2) | (1 << _NUM3) | (1 << _NUM4) | (1 << _NUM5) | (1 << _NUM6) | (1 << _NUM7) | (1 << _NUM8) | (1 << _NUM9) | (1 << _NUM1S) | (1 << _NUMN) | (1 << _NUMS))
#define NUMBER0 (1 << _NUM0)
#define NUMBER1 ((1 << _NUM1) | (1 << _NUM1S))
#define NUMBERS1 (1 << _NUM1S)

View file

@ -37,58 +37,40 @@
#define _SJ_TABLE
#define isdpnd(c) (Chrtbl[c] & DEPEND)
#define CnjAskLen(p) (((unsigned int)*(p) & 0x70) >> 4)
#define CnjNkrLen(p) (*(p) & 0x0f)
#define CnjRight(p) *(p + CnjNkrLen(p) + 1)
#define CnjRecLen(p) (CnjNkrLen(p) + 2)
#define FzkAskLen(p) ((unsigned int)*(p) >> 5)
#define FzkNkrLen(p) (*(p) & 0x07)
#define FzkStrKa(p) (((unsigned int)*(p) >> 3) & 1)
#define FzkHasCode(p) (*(p) & 0x10)
#define FzkLeft(p) (*((p) + nlen + 1))
#define FzkRight(p) (*((p) + nlen + 2))
#define SttYomiLen(p) (*(p) & 0x0f)
#define SttHiraKnj(p) (*(p) & 0x80)
#define StbKnjLen(p) (*(p) & 0x07)
#define StbYomiLen(p) (*(p) >> 4)
#define StbYomiTop(p) ((p) + 2)
#define StbBakeru(p) (*(p) & 0x08)
#define StbHinsi(p) (*((p) + 1))
#define Charsize charsize

View file

@ -40,14 +40,12 @@
#include <stdlib.h>
#include <sys/types.h>
#define RECURS
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef void (*VFunc)();
typedef u_char* (*UCPFunc)();
typedef int (*IFunc)();
@ -64,4 +62,3 @@ typedef u_char TypeClass;
typedef u_char TypeBunNum;
#endif

View file

@ -33,10 +33,6 @@
* $SonyDate: 1994/06/03 08:01:24 $
*/
#ifndef _SJ_YOMICODE
#define _SJ_YOMICODE

View file

@ -33,9 +33,6 @@
* $SonyDate: 1994/06/03 08:03:45 $
*/
#define ZKATA1 0xa5
#define ZHIRA1 0xa4
#define ZKATAF2 0xa1
@ -47,8 +44,6 @@
#define ZKATAn (ZKATAE2 - ZKATAF2 + 1)
#define ZEN_SPACE 0xa1a1
#define ZEN_KTEN 0xa1a3
#define ZEN_FKAKKO 0xa1d6

View file

@ -33,8 +33,6 @@
* $SonyDate: 1994/06/03 08:03:46 $
*/
#if !defined(__sony_news) || (defined(__sony_news) && !defined(SVR4))
#ifndef __KCTYPE
#define __KCTYPE
@ -112,4 +110,3 @@
#define iskana iskana2
#endif
#endif

View file

@ -33,10 +33,6 @@
* $SonyDate: 1994/06/03 08:03:47 $
*/
#define KEY_NORMAL 0
#define KEY_CONV 1
#define KEY_HENKAN 2
@ -90,9 +86,6 @@
#define KEY_MORE 43
#define UKEYNUM 64
#define SEQLEN 8
#define COMNUM 64

View file

@ -82,4 +82,3 @@ typedef struct rktable {
} RkTabl;
#endif /* RK_H */

View file

@ -124,4 +124,3 @@ int sj3_wcstombs16(unsigned char *, unsigned char *, int);
extern int current_locale;
#endif

View file

@ -33,12 +33,9 @@
* $SonyDate: 1994/06/03 08:03:52 $
*/
#ifndef _WCHARH
#define _WCHARH
#if defined(__sony_news) && defined(SVR4)
#define _WCHAR_T
typedef unsigned short wchar_t;
@ -111,15 +108,11 @@ typedef unsigned short wchar16_t;
#define wcstombs(ws, mb, n) sj3_wcstombs16(ws, mb, n)
#endif
#define LC_CTYPE_SHIFTJIS 1
#define LC_CTYPE_EUC 2
#define IsEUCHojo(x) (((unsigned char)(x)) == SS3)
#define WcX0208MASK 0xffff
#define WcX0212MASK 0xff7f
#define WcJISMASK 0x7f7f
@ -149,7 +142,6 @@ typedef unsigned short wchar16_t;
#define WcJIS2X0212(w) ((w) | WcX0212FLAG)
#define Wc2JIS(w) ((w) & WcJISMASK)
#define WCSJrun WcMessages[0]
#define WCMode_buff WcMessages[1]
@ -168,8 +160,6 @@ typedef unsigned short wchar16_t;
#define WCGHelp WcMessages[11]
#define WCMHelp WcMessages[12]
#define WCGCshift WcMessages[13]
#define WCGCeuc WcMessages[14]
#define WCGCeuc2 WcMessages[15]
@ -178,8 +168,6 @@ typedef unsigned short wchar16_t;
#define WCGCkuten WcMessages[18]
#define WCGCkuten2 WcMessages[19]
#define WCGtoroku WcMessages[20]
#define WCMhani WcMessages[21]
#define WCMyomi WcMessages[22]
@ -199,7 +187,6 @@ typedef unsigned short wchar16_t;
#define WCSystemError WcMessages[36]
#define WCKanma WcMessages[37]
#define WCGsyoukyo WcMessages[38]
#define WCSYOUKYO_SUCC WcMessages[39]
#define WCNotExist WcMessages[40]
@ -208,17 +195,12 @@ typedef unsigned short wchar16_t;
#define WCKanjiShokyo WcMessages[43]
#define WCShokyoError WcMessages[44]
#define WCSUCCsjrc WcMessages[45]
#define WCFAILsjrc WcMessages[46]
#define WCNOTHsjrc WcMessages[47]
#define WCWeight_mes WcMessages[48]
#define WCGrcon WcMessages[49]
#define WCRserv WcMessages[50]
#define WCRserv_OK WcMessages[51]
@ -228,7 +210,6 @@ typedef unsigned short wchar16_t;
#define WCSpace2 WcMessages[54]
#define WCContinue WcMessages[55]
#define WCServer_Dead WcMessages[56]
#define WCConnected WcMessages[57]
#define WCNconnect WcMessages[58]
@ -239,26 +220,20 @@ typedef unsigned short wchar16_t;
#define WCNmake_Study WcMessages[63]
#define WCNopen_Study WcMessages[64]
#define WCGedit WcMessages[65]
#define WCTooLong WcMessages[67]
#define WCDollar WcMessages[68]
#define WCOn WcMessages[69]
#define WCOff WcMessages[70]
#define WCMeishi WcMessages[71]
#define WCMyouji WcMessages[72]
#define WCNamae WcMessages[73]
#define WCTimei WcMessages[74]
#define WCSahen WcMessages[75]
#define WCKara WcMessages[76]
#define WCF1 WcMessages[77]
#define WCF2 WcMessages[78]
@ -324,7 +299,6 @@ typedef unsigned short wchar16_t;
#define WCReconnect WcMessages[137]
#define WCKill WcMessages[138]
#define WCKey WcMessages[139]
#define WCEscape WcMessages[140]
#define WCSjxkey WcMessages[141]
@ -376,14 +350,11 @@ typedef unsigned short wchar16_t;
extern wchar16_t* WcMessages[];
struct wcvtkey {
wchar16_t* key_word;
wchar16_t key_seq[SEQLEN];
};
struct functbl {
wchar16_t* keyword;
int (*func)();

View file

@ -36,7 +36,6 @@
#include <stdlib.h>
#include <string.h>
#include "sj_euc.h"
#include "sj_kcnv.h"
@ -48,11 +47,7 @@ static int cal_nextym(u_char *);
static int usr_freelen();
static u_int checkdict(u_char*, TypeGram);
u_int
adddic(u_char *yomi, u_char *kanji, TypeGram hinsi)
{
u_int adddic(u_char* yomi, u_char* kanji, TypeGram hinsi) {
u_int err;
u_char yptr[MAXWDYOMILEN + 1];
u_char kptr[MAXWDKANJILEN + 1];
@ -126,8 +121,7 @@ adddic(u_char *yomi, u_char *kanji, TypeGram hinsi)
newsiz = DOUONBLKSIZENUMBER + nlen;
nxtask = cal_nextym(p1);
}
else {
} else {
oldsiz = newsiz = getsize(p1);
nxtask = 0;
}
@ -184,8 +178,7 @@ adddic(u_char *yomi, u_char *kanji, TypeGram hinsi)
mkidxtbl(curdict);
segnum++;
}
else {
} else {
nlen = getnlen(p1);
if((unsigned int)freidx < getplen(p1) + nlen + 1)
return AD_OVFLWINDEX;
@ -241,8 +234,7 @@ adddic(u_char *yomi, u_char *kanji, TypeGram hinsi)
*dstptr++ = ((nlen & 0x0f) | ((saml & 0x0f) << 4));
while(saml < cnvlen) *dstptr++ = yptr[saml++];
}
else {
} else {
plen = getplen(douptr);
nlen = getnlen(douptr);
*douptr = (newsiz >> 8);
@ -308,11 +300,8 @@ adddic(u_char *yomi, u_char *kanji, TypeGram hinsi)
return AD_DONE;
}
static int
checksub(u_char *kanji, TypeGram grm)
{
checksub(u_char* kanji, TypeGram grm) {
u_char* tagp;
u_char* ptr;
u_char* endp;
@ -355,11 +344,8 @@ checksub(u_char *kanji, TypeGram grm)
return dounum;
}
static u_int
checkdict(u_char *kanji, TypeGram grm)
{
checkdict(u_char* kanji, TypeGram grm) {
DICTL* dp;
int dounum = 0;
int tmp;
@ -385,11 +371,8 @@ checkdict(u_char *kanji, TypeGram grm)
return 0;
}
static int
cal_nextym(u_char *ptr)
{
cal_nextym(u_char* ptr) {
int count = 0;
u_char* src;
int len;
@ -410,11 +393,8 @@ cal_nextym(u_char *ptr)
return count;
}
static int
usr_freelen()
{
usr_freelen() {
u_char* ptr;
ptr = segtop();
@ -424,11 +404,8 @@ usr_freelen()
return curdict->seglen - (ptr - dicbuf);
}
static void
sprt_seg(TypeDicSeg seg, TypeDicOfs ofs)
{
sprt_seg(TypeDicSeg seg, TypeDicOfs ofs) {
TypeDicSeg s;
u_char* pos;
u_char* p;
@ -501,17 +478,13 @@ sprt_seg(TypeDicSeg seg, TypeDicOfs ofs)
(*curdict->putdic)(curdict, seg);
}
static void
apnd_uidx(TypeDicSeg seg, u_char *yomi, int len)
{
apnd_uidx(TypeDicSeg seg, u_char* yomi, int len) {
u_char* p;
u_char* q;
p = get_idxptr(seg);
while (*p++)
;
while(*p++);
q = idxbuf + curdict->idxlen;
mvmemd(q - (len + 1), q, (int)(q - (len + 1) - p));

View file

@ -33,9 +33,6 @@
* $SonyDate: 1994/06/03 08:01:27 $
*/
#include "sj_euc.h"
#include "sj_kcnv.h"
#include "sj_hinsi.h"
@ -43,10 +40,7 @@
#include "sj_kanakan.h"
void
set_size(u_char *p, int size, int plen, int nlen)
{
void set_size(u_char* p, int size, int plen, int nlen) {
*p = (u_char)(size >> 8);
if(nlen & 0x10) *p |= NOKORIYOMITOP;
if(plen & 0x10) *p |= ASSYUKUYOMITOP;
@ -55,8 +49,7 @@ set_size(u_char *p, int size, int plen, int nlen)
}
static int
isvyomi(u_char *yp)
{
isvyomi(u_char* yp) {
int len;
if(!*yp) return FALSE;
@ -72,11 +65,8 @@ isvyomi(u_char *yp)
return TRUE;
}
static int
isvknj(u_char *kanji)
{
isvknj(u_char* kanji) {
int len;
if(!*kanji) return FALSE;
@ -103,11 +93,8 @@ isvknj(u_char *kanji)
return TRUE;
}
static int
isgrm(TypeGram gram)
{
isgrm(TypeGram gram) {
int grm = gram;
if(MEISI_1 <= grm && grm <= D_MEISI_6) return TRUE;
@ -125,11 +112,7 @@ isgrm(TypeGram gram)
return FALSE;
}
u_int
addel_arg(u_char *yp, u_char *kp, TypeGram grm, u_char *nyp, int len)
{
u_int addel_arg(u_char* yp, u_char* kp, TypeGram grm, u_char* nyp, int len) {
u_short err = 0;
if(!sj2cd_str(yp, nyp, len)) err |= AD_BADYOMI;
@ -143,11 +126,8 @@ addel_arg(u_char *yp, u_char *kp, TypeGram grm, u_char *nyp, int len)
return err;
}
static void
yomi2kata(u_char *src, u_char *dst)
{
yomi2kata(u_char* src, u_char* dst) {
int first;
int second;
@ -168,11 +148,8 @@ yomi2kata(u_char *src, u_char *dst)
*dst = 0;
}
static int
top_strcmp(u_char *src, u_char *dst)
{
top_strcmp(u_char* src, u_char* dst) {
int i;
for(i = 0; *src && (*src == *dst); src++, dst++) i++;
@ -182,11 +159,8 @@ top_strcmp(u_char *src, u_char *dst)
return (i > MAXYOMIASKNUMBER) ? MAXYOMIASKNUMBER : i;
}
static int
last_strcmp(u_char *src, u_char *dst)
{
last_strcmp(u_char* src, u_char* dst) {
int slen;
int dlen;
@ -200,11 +174,7 @@ last_strcmp(u_char *src, u_char *dst)
return (dlen / 2);
}
int
cvtknj(u_char *yomi, u_char *knj, u_char *dst)
{
int cvtknj(u_char* yomi, u_char* knj, u_char* dst) {
u_char kana[MAXWDYOMILEN * 2 + 1];
int len;
u_char* keep;
@ -214,8 +184,7 @@ cvtknj(u_char *yomi, u_char *knj, u_char *dst)
if(len = top_strcmp(yomi, knj)) {
*dst = (u_char)(ZENHIRAASSYUKU | (len - 1));
}
else if (len = top_strcmp(kana, knj)) {
} else if(len = top_strcmp(kana, knj)) {
*dst = (u_char)(ZENKATAASSYUKU | (len - 1));
}
@ -229,24 +198,24 @@ cvtknj(u_char *yomi, u_char *knj, u_char *dst)
if(len = last_strcmp(yomi, knj)) {
*dst++ = (u_char)(ZENHIRAASSYUKU | (len - 1));
break;
}
else if (len = last_strcmp(kana, knj)) {
} else if(len = last_strcmp(kana, knj)) {
*dst++ = (u_char)(ZENKATAASSYUKU | (len - 1));
break;
}
else if (*knj == SS2) {
} else if(*knj == SS2) {
knj++;
*dst++ = (u_char)LEADINGHANKAKU;
*dst++ = *knj++;
} else if(*knj == SS3) {
knj++;
*dst++ = (*knj & NORMALKANJIMASK); knj++;
*dst++ = (*knj & NORMALKANJIMASK);
knj++;
*dst++ = *knj++;
} else if(*knj & 0x80) {
*dst++ = (*knj & NORMALKANJIMASK); knj++;
*dst++ = (*knj & NORMALKANJIMASK); knj++;
}
else {
*dst++ = (*knj & NORMALKANJIMASK);
knj++;
*dst++ = (*knj & NORMALKANJIMASK);
knj++;
} else {
*dst++ = (u_char)LEADINGHANKAKU;
*dst++ = *knj++;
}
@ -260,11 +229,7 @@ cvtknj(u_char *yomi, u_char *knj, u_char *dst)
return (dst - keep);
}
int
srchkana(u_char **ptr, int *saml)
{
int srchkana(u_char** ptr, int* saml) {
u_char* p;
int cmp;
int cnt = 0;
@ -297,11 +262,7 @@ srchkana(u_char **ptr, int *saml)
return 0;
}
int
srchgram(u_char *ptr, u_char **dst, TypeGram hinsi)
{
int srchgram(u_char* ptr, u_char** dst, TypeGram hinsi) {
u_char* endp;
int cnt = 0, nlen;
int flg = FALSE;
@ -329,11 +290,7 @@ srchgram(u_char *ptr, u_char **dst, TypeGram hinsi)
return 0;
}
int
srchkanji(u_char **dst, u_char *knj, int klen)
{
int srchkanji(u_char** dst, u_char* knj, int klen) {
u_char* ptr;
u_char *p, *q;
int len;
@ -363,11 +320,8 @@ srchkanji(u_char **dst, u_char *knj, int klen)
return cnt;
}
TypeIdxOfs
count_uidx()
{
count_uidx() {
u_char* p;
p = get_idxptr(curdict->segunit - 1);
@ -376,11 +330,7 @@ count_uidx()
return (curdict->idxlen - (p - idxbuf));
}
void
chg_uidx(TypeDicSeg seg, u_char *yomi, int len)
{
void chg_uidx(TypeDicSeg seg, u_char* yomi, int len) {
u_char *p, *q;
int olen;
@ -392,8 +342,7 @@ chg_uidx(TypeDicSeg seg, u_char *yomi, int len)
if(len > olen) {
mvmemd(q - (len - olen), q, (int)(q - (len - olen) - p));
}
else {
} else {
mvmemi(p + (olen - len), p, (int)(q - (p + (olen - len))));
}
while(len--) *p++ = *yomi++;

View file

@ -33,7 +33,6 @@
* $SonyDate: 1994/06/03 08:01:28 $
*/
#include <stdlib.h>
#include <sys/types.h>
#include "sj_rename.h"
@ -50,9 +49,7 @@
static JREC* jrec = NULL;
static CLREC* clrec = NULL;
JREC *
alloc_jrec()
{
JREC* alloc_jrec() {
JREC* p;
int i;
@ -69,9 +66,7 @@ alloc_jrec()
return p;
}
void
free_jrec(JREC *p)
{
void free_jrec(JREC* p) {
if(p != NULL) {
p->jsort = jrec;
jrec = p;
@ -79,8 +74,7 @@ free_jrec(JREC *p)
}
CLREC*
alloc_clrec()
{
alloc_clrec() {
CLREC* p;
int i;
@ -97,9 +91,7 @@ alloc_clrec()
return p;
}
void
free_clrec(CLREC *p)
{
void free_clrec(CLREC* p) {
if(p != NULL) {
p->clsort = clrec;
clrec = p;

View file

@ -33,9 +33,6 @@
* $SonyDate: 1994/06/03 08:01:29 $
*/
#include "sj_euc.h"
#include "sj_rename.h"
#include "sj_typedef.h"
@ -43,9 +40,7 @@
#include "sj_kanakan.h"
int
codesize(u_char code)
{
int codesize(u_char code) {
switch(code & KANJIMODEMASK) {
case ZENHIRAASSYUKU:
case ZENKATAASSYUKU:
@ -60,4 +55,3 @@ codesize(u_char code)
return 2;
}
}

View file

@ -33,9 +33,6 @@
* $SonyDate: 1994/06/03 08:01:30 $
*/
#include "sj_const.h"
#include "sj_rename.h"
#include "sj_typedef.h"
@ -299,5 +296,4 @@ u_char chrtbl[256] =
TAI_KGU,
TAI_KGU,
TAI_KGU,
0
};
0};

View file

@ -37,15 +37,11 @@
#include "sj_kanakan.h"
static CLREC *nextrecblk(), *prevrecblk();
static void initkbuf(u_char*);
int
cl2knj(u_char *yomi, int len, u_char *kouho)
{
int cl2knj(u_char* yomi, int len, u_char* kouho) {
u_char* ptr1;
u_char* ptr2;
int i;
@ -56,7 +52,8 @@ cl2knj(u_char *yomi, int len, u_char *kouho)
if(len > MAXCLINPUTLEN * 2) len = MAXCLINPUTLEN * 2;
ptr1 = yomi; ptr2 = hyomi;
ptr1 = yomi;
ptr2 = hyomi;
for(i = 0; i < len; i++) {
if(isknj1(*ptr1)) {
if(++i >= len) break;
@ -95,11 +92,7 @@ cl2knj(u_char *yomi, int len, u_char *kouho)
return hzstrlen(inputyomi, (int)clt1st->cllen);
}
int
nextcl(u_char *kouho, int mode)
{
int nextcl(u_char* kouho, int mode) {
CLREC* clptr;
initkbuf(kouho);
@ -114,8 +107,7 @@ nextcl(u_char *kouho, int mode)
clt1st = clptr;
mkkouho();
getrank();
}
else {
} else {
cvtclknj();
return 0;
}
@ -125,12 +117,8 @@ nextcl(u_char *kouho, int mode)
return hzstrlen(inputyomi, (int)clt1st->cllen);
}
static CLREC*
nextrecblk()
{
nextrecblk() {
CLREC* clptr;
int keeplen;
@ -144,12 +132,7 @@ nextrecblk()
return clptr;
}
int
prevcl(u_char *kouho, int mode)
{
int prevcl(u_char* kouho, int mode) {
CLREC* clptr;
initkbuf(kouho);
@ -164,8 +147,7 @@ prevcl(u_char *kouho, int mode)
mkkouho();
getrank();
selectid = khcount;
}
else {
} else {
cvtclknj();
return 0;
}
@ -175,11 +157,8 @@ prevcl(u_char *kouho, int mode)
return hzstrlen(inputyomi, (int)clt1st->cllen);
}
static CLREC*
prevrecblk()
{
prevrecblk() {
CLREC* clptr;
CLREC* keepptr;
int keeplen;
@ -202,19 +181,12 @@ prevrecblk()
return keepptr;
}
static void
initkbuf(u_char *kouho)
{
initkbuf(u_char* kouho) {
kanjitmp = kouho;
memset(kanjitmp, 0, sizeof(STDYOUT) + 1);
}
int
selectnum()
{
int selectnum() {
return selectid;
}

View file

@ -33,22 +33,14 @@
* $SonyDate: 1994/06/03 08:01:32 $
*/
#include "sj_kcnv.h"
#include "sj_kanakan.h"
static u_char *delcldata(), *srchclpos();
static int delclold();
int
clstudy(u_char *yomi1, u_char *yomi2, STDYOUT *stdy)
{
int clstudy(u_char* yomi1, u_char* yomi2, STDYOUT* stdy) {
u_char ytmp[CLSTDY_TMPLEN];
u_char *dst, *ptr;
int ret;
@ -67,8 +59,7 @@ clstudy(u_char *yomi1, u_char *yomi2, STDYOUT *stdy)
(void)delcldata(ytmp);
ret = CLSTUDYNORMEND;
}
else if (!stdy)
} else if(!stdy)
return CLSTUDYPARAERR;
else {
@ -93,7 +84,6 @@ clstudy(u_char *yomi1, u_char *yomi2, STDYOUT *stdy)
blen += i;
}
if(blen >= alen) {
dst = srchclpos(ytmp);
@ -106,8 +96,7 @@ clstudy(u_char *yomi1, u_char *yomi2, STDYOUT *stdy)
memcpy(ClYomiPos(dst), ytmp, len2);
ret = CLSTUDYNORMEND;
}
else
} else
ret = CLSTUDYNOAREA;
}
mkclidx();
@ -116,11 +105,8 @@ clstudy(u_char *yomi1, u_char *yomi2, STDYOUT *stdy)
return ret;
}
static u_char*
delcldata(u_char *ycode)
{
delcldata(u_char* ycode) {
u_char* tagptr;
u_char* ptr1;
u_char* ptr2;
@ -140,8 +126,7 @@ delcldata(u_char *ycode)
}
if(!*ptr1 || !len1) {
delclsub(tagptr);
}
else {
} else {
tagptr = ClNextTag(tagptr);
}
}
@ -149,11 +134,7 @@ delcldata(u_char *ycode)
return tagptr;
}
void
delclsub(u_char *target)
{
void delclsub(u_char* target) {
u_char* src;
int num;
int tmp;
@ -182,11 +163,8 @@ delclsub(u_char *target)
}
}
static int
delclold()
{
delclold() {
u_char* tagptr;
u_char* target;
int num;
@ -215,11 +193,8 @@ delclold()
return num;
}
static u_char*
srchclpos(u_char *ycode)
{
srchclpos(u_char* ycode) {
u_char* tagptr;
u_char* target;
u_char* ptr1;
@ -259,11 +234,7 @@ srchclpos(u_char *ycode)
return target ? target : tagptr;
}
void
mkclidx()
{
void mkclidx() {
u_char* ptr;
int num;
int st, ed;

View file

@ -33,19 +33,13 @@
* $SonyDate: 1994/06/03 08:01:32 $
*/
#include "sj_rename.h"
#include "sj_const.h"
#include "sj_typedef.h"
#include "sj_kanakan.h"
int
cmpstr(u_char *src, u_char *dst)
{
int cmpstr(u_char* src, u_char* dst) {
while(*src) {
if(*src != *dst) return FALSE;
src++;

View file

@ -33,7 +33,6 @@
* $SonyDate: 1994/06/03 08:01:33 $
*/
#include "sj_rename.h"
#include "sj_typedef.h"
#include "sj_yomi.h"
@ -60,8 +59,7 @@ static u_char sahencnj[] = {
0x31, _RE, R_KATEI2,
0x31, _RO, R_MEIREI1,
0x11, _YO, R_MEIREI2,
0xff
};
0xff};
static u_char zahencnj[] = {
0x00, R_CUT,
@ -74,8 +72,7 @@ static u_char zahencnj[] = {
0x11, _RE, R_KATEI2,
0x01, _ZE, R_MIZEN3,
0x11, _YO, R_MEIREI2,
0xff
};
0xff};
static u_char ka5cnj1[] = {
0x01, _I, R_ONBIN2,
@ -84,8 +81,7 @@ static u_char ka5cnj1[] = {
0x01, _KU, R_SHUUSI,
0x01, _KE, R_KAMEI,
0x02, _KO, _U, R_AROU,
0xff
};
0xff};
static u_char ka5cnj3[] = {
0x01, _I, R_ONBIN2,
@ -94,8 +90,7 @@ static u_char ka5cnj3[] = {
0x01, _KU, R_SHUUSI,
0x01, _KE, R_KAMEI,
0x02, _KO, _U, R_AROU,
0xff
};
0xff};
static u_char ka5cnj5[] = {
0x01, _I, R_ONBIN2,
@ -110,8 +105,7 @@ static u_char ka5cnj5[] = {
0x11, _RU, R_SHUUSI,
0x11, _RE, R_KATEI2,
0x02, _KO, _U, R_AROU,
0xff
};
0xff};
static u_char ka5cnj7[] = {
0x01, _I, R_ONBIN2,
@ -126,8 +120,7 @@ static u_char ka5cnj7[] = {
0x11, _RU, R_SHUUSI,
0x11, _RE, R_KATEI2,
0x02, _KO, _U, R_AROU,
0xff
};
0xff};
static u_char ga5cnj1[] = {
0x01, _I, R_ONBIN3,
@ -136,8 +129,7 @@ static u_char ga5cnj1[] = {
0x01, _GU, R_SHUUSI,
0x01, _GE, R_KAMEI,
0x02, _GO, _U, R_AROU,
0xff
};
0xff};
static u_char ga5cnj3[] = {
0x01, _I, R_ONBIN3,
@ -146,8 +138,7 @@ static u_char ga5cnj3[] = {
0x01, _GU, R_SHUUSI,
0x01, _GE, R_KAMEI,
0x02, _GO, _U, R_AROU,
0xff
};
0xff};
static u_char ga5cnj5[] = {
0x01, _I, R_ONBIN3,
@ -162,8 +153,7 @@ static u_char ga5cnj5[] = {
0x11, _RU, R_SHUUSI,
0x11, _RE, R_KATEI2,
0x02, _GO, _U, R_AROU,
0xff
};
0xff};
static u_char ga5cnj7[] = {
0x01, _I, R_ONBIN3,
@ -178,8 +168,7 @@ static u_char ga5cnj7[] = {
0x11, _RU, R_SHUUSI,
0x11, _RE, R_KATEI2,
0x02, _GO, _U, R_AROU,
0xff
};
0xff};
static u_char sa5cnj1[] = {
0x01, _SA, R_MIZEN5,
@ -187,8 +176,7 @@ static u_char sa5cnj1[] = {
0x01, _SU, R_SHUUSI,
0x01, _SE, R_KAMEI,
0x02, _SO, _U, R_AROU,
0xff
};
0xff};
static u_char sa5cnj3[] = {
0x01, _SA, R_MIZEN5,
@ -196,8 +184,7 @@ static u_char sa5cnj3[] = {
0x01, _SU, R_SHUUSI,
0x01, _SE, R_KAMEI,
0x02, _SO, _U, R_AROU,
0xff
};
0xff};
static u_char sa5cnj5[] = {
0x01, _SA, R_MIZEN5,
@ -207,8 +194,7 @@ static u_char sa5cnj5[] = {
0x11, _RU, R_SHUUSI,
0x11, _RE, R_KATEI2,
0x02, _SO, _U, R_AROU,
0xff
};
0xff};
static u_char sa5cnj7[] = {
0x01, _SA, R_MIZEN5,
@ -218,8 +204,7 @@ static u_char sa5cnj7[] = {
0x11, _RU, R_SHUUSI,
0x11, _RE, R_KATEI2,
0x02, _SO, _U, R_AROU,
0xff
};
0xff};
static u_char ta5cnj1[] = {
0x01, _TA, R_MIZEN5,
@ -228,8 +213,7 @@ static u_char ta5cnj1[] = {
0x01, _TU, R_SHUUSI,
0x01, _TE, R_KAMEI,
0x02, _TO, _U, R_AROU,
0xff
};
0xff};
static u_char ta5cnj3[] = {
0x01, _TA, R_MIZEN5,
@ -238,8 +222,7 @@ static u_char ta5cnj3[] = {
0x01, _TU, R_SHUUSI,
0x01, _TE, R_KAMEI,
0x02, _TO, _U, R_AROU,
0xff
};
0xff};
static u_char ta5cnj5[] = {
0x01, _TA, R_MIZEN5,
@ -254,8 +237,7 @@ static u_char ta5cnj5[] = {
0x11, _RU, R_SHUUSI,
0x11, _RE, R_KATEI2,
0x02, _TO, _U, R_AROU,
0xff
};
0xff};
static u_char ta5cnj7[] = {
0x01, _TA, R_MIZEN5,
@ -270,9 +252,7 @@ static u_char ta5cnj7[] = {
0x11, _RU, R_SHUUSI,
0x11, _RE, R_KATEI2,
0x02, _TO, _U, R_AROU,
0xff
};
0xff};
static u_char na5cnj[] = {
0x01, _NA, R_MIZEN5,
@ -281,8 +261,7 @@ static u_char na5cnj[] = {
0x01, _NE, R_KAMEI,
0x02, _NO, _U, R_AROU,
0x01, _NN, R_ONBIN3,
0xff
};
0xff};
static u_char ba5cnj1[] = {
0x01, _BA, R_MIZEN5,
@ -291,8 +270,7 @@ static u_char ba5cnj1[] = {
0x01, _BE, R_KAMEI,
0x02, _BO, _U, R_AROU,
0x01, _NN, R_ONBIN3,
0xff
};
0xff};
static u_char ba5cnj3[] = {
0x01, _BA, R_MIZEN5,
@ -301,8 +279,7 @@ static u_char ba5cnj3[] = {
0x01, _BE, R_KAMEI,
0x02, _BO, _U, R_AROU,
0x01, _NN, R_ONBIN3,
0xff
};
0xff};
static u_char ba5cnj5[] = {
0x01, _BA, R_MIZEN5,
@ -317,8 +294,7 @@ static u_char ba5cnj5[] = {
0x11, _RE, R_KATEI2,
0x02, _BO, _U, R_AROU,
0x01, _NN, R_ONBIN3,
0xff
};
0xff};
static u_char ba5cnj7[] = {
0x01, _BA, R_MIZEN5,
@ -333,8 +309,7 @@ static u_char ba5cnj7[] = {
0x11, _RE, R_KATEI2,
0x02, _BO, _U, R_AROU,
0x01, _NN, R_ONBIN3,
0xff
};
0xff};
static u_char ma5cnj1[] = {
0x01, _MA, R_MIZEN5,
@ -343,8 +318,7 @@ static u_char ma5cnj1[] = {
0x01, _ME, R_KAMEI,
0x02, _MO, _U, R_AROU,
0x01, _NN, R_ONBIN3,
0xff
};
0xff};
static u_char ma5cnj3[] = {
0x01, _MA, R_MIZEN5,
@ -353,8 +327,7 @@ static u_char ma5cnj3[] = {
0x01, _ME, R_KAMEI,
0x02, _MO, _U, R_AROU,
0x01, _NN, R_ONBIN3,
0xff
};
0xff};
static u_char ma5cnj5[] = {
0x01, _MA, R_MIZEN5,
@ -369,8 +342,7 @@ static u_char ma5cnj5[] = {
0x11, _RE, R_KATEI2,
0x02, _MO, _U, R_AROU,
0x01, _NN, R_ONBIN3,
0xff
};
0xff};
static u_char ma5cnj7[] = {
0x01, _MA, R_MIZEN5,
@ -385,8 +357,7 @@ static u_char ma5cnj7[] = {
0x11, _RE, R_KATEI2,
0x02, _MO, _U, R_AROU,
0x01, _NN, R_ONBIN3,
0xff
};
0xff};
static u_char ra5cnj1[] = {
0x01, _XTU, R_ONBIN2,
@ -395,8 +366,7 @@ static u_char ra5cnj1[] = {
0x01, _RU, R_SHUUSI,
0x01, _RE, R_KAMEI,
0x02, _RO, _U, R_AROU,
0xff
};
0xff};
static u_char ra5cnj3[] = {
0x01, _XTU, R_ONBIN2,
@ -405,8 +375,7 @@ static u_char ra5cnj3[] = {
0x01, _RU, R_SHUUSI,
0x01, _RE, R_KAMEI,
0x02, _RO, _U, R_AROU,
0xff
};
0xff};
static u_char ra5cnj5[] = {
0x01, _XTU, R_ONBIN2,
@ -421,8 +390,7 @@ static u_char ra5cnj5[] = {
0x11, _RU, R_SHUUSI,
0x11, _RE, R_KATEI2,
0x02, _RO, _U, R_AROU,
0xff
};
0xff};
static u_char ra5cnj7[] = {
0x01, _XTU, R_ONBIN2,
@ -437,8 +405,7 @@ static u_char ra5cnj7[] = {
0x11, _RU, R_SHUUSI,
0x11, _RE, R_KATEI2,
0x02, _RO, _U, R_AROU,
0xff
};
0xff};
static u_char wa5cnj1[] = {
0x01, _I, R_RENYOU5,
@ -447,8 +414,7 @@ static u_char wa5cnj1[] = {
0x02, _O, _U, R_AROU,
0x01, _XTU, R_ONBIN2,
0x01, _WA, R_MIZEN5,
0xff
};
0xff};
static u_char wa5cnj3[] = {
0x01, _I, R_RENYOU7,
@ -457,8 +423,7 @@ static u_char wa5cnj3[] = {
0x02, _O, _U, R_AROU,
0x01, _XTU, R_ONBIN2,
0x01, _WA, R_MIZEN5,
0xff
};
0xff};
static u_char wa5cnj5[] = {
0x01, _I, R_RENYOU5,
@ -473,8 +438,7 @@ static u_char wa5cnj5[] = {
0x11, _SI, R_SA5RENYOU3,
0x11, _SU, R_SHUUSI,
0x12, _SO, _U, R_AROU,
0xff
};
0xff};
static u_char wa5cnj7[] = {
0x01, _I, R_RENYOU7,
@ -489,8 +453,7 @@ static u_char wa5cnj7[] = {
0x11, _SI, R_SA5RENYOU3,
0x11, _SU, R_SHUUSI,
0x12, _SO, _U, R_AROU,
0xff
};
0xff};
static u_char ichicnj1[] = {
0x00, R_RENYOU1,
@ -498,8 +461,7 @@ static u_char ichicnj1[] = {
0x01, _RU, R_SHUUSI,
0x01, _RE, R_KATEI2,
0x01, _RO, R_MEIREI1,
0xff
};
0xff};
static u_char ichicnj3[] = {
0x00, R_RENYOU3,
@ -507,8 +469,7 @@ static u_char ichicnj3[] = {
0x01, _RU, R_SHUUSI,
0x01, _RE, R_KATEI2,
0x01, _RO, R_MEIREI1,
0xff
};
0xff};
static u_char keiyou1[] = {
0x80, R_KGOKAN,
@ -518,8 +479,7 @@ static u_char keiyou1[] = {
0x01, _KI, R_KRENTAI,
0x01, _KU, R_KRENYOU,
0x02, _KE, _RE, R_KATEI2,
0xff
};
0xff};
static u_char keiyou2[] = {
0x80, R_KGOKAN,
@ -530,8 +490,7 @@ static u_char keiyou2[] = {
0x01, _KU, R_KRENYOU,
0x02, _KE, _RE, R_KATEI2,
0x01, _SA, R_FZKMEISI,
0xff
};
0xff};
static u_char keiyou3[] = {
0x80, R_KGOKAN,
@ -553,8 +512,7 @@ static u_char keiyou3[] = {
0x21, _RE, R_KAMEI,
0x11, _NI, R_DRENYOU2,
0x01, _SA, R_FZKMEISI,
0xff
};
0xff};
static u_char keiyou4[] = {
0x80, R_KGOKAN,
@ -571,8 +529,7 @@ static u_char keiyou4[] = {
0x01, _KU, R_KRENYOU,
0x02, _KE, _RE, R_KATEI2,
0x01, _SA, R_FZKMEISI,
0xff
};
0xff};
static u_char keiyou5[] = {
0x80, R_KGOKAN,
@ -600,8 +557,7 @@ static u_char keiyou5[] = {
0x21, _RE, R_KAMEI,
0x11, _NI, R_DRENYOU2,
0x01, _SA, R_FZKMEISI,
0xff
};
0xff};
static u_char keiyou6[] = {
0x80, R_KGOKAN,
@ -634,8 +590,7 @@ static u_char keiyou6[] = {
0x21, _RU, R_DRENTAI3,
0x21, _RE, R_KAMEI,
0x11, _NI, R_DRENYOU2,
0xff
};
0xff};
static u_char keiyou7[] = {
0x80, R_KGOKAN,
@ -674,8 +629,7 @@ static u_char keiyou7[] = {
0x21, _RU, R_DRENTAI3,
0x21, _RE, R_KAMEI,
0x11, _NI, R_DRENYOU2,
0xff
};
0xff};
static u_char keiyou8[] = {
0x80, R_KGOKAN,
@ -715,8 +669,7 @@ static u_char keiyou8[] = {
0x21, _RU, R_DRENTAI3,
0x21, _RE, R_KAMEI,
0x11, _NI, R_DRENYOU2,
0xff
};
0xff};
static u_char keiyou9[] = {
0x80, R_KGOKAN,
@ -744,8 +697,7 @@ static u_char keiyou9[] = {
0x21, _RE, R_KAMEI,
0x11, _NI, R_DRENYOU2,
0x01, _SA, R_FZKMEISI,
0xff
};
0xff};
static u_char keiyou10[] = {
0x80, R_KGOKAN,
@ -784,8 +736,7 @@ static u_char keiyou10[] = {
0x21, _RU, R_DRENTAI3,
0x21, _RE, R_KAMEI,
0x11, _NI, R_DRENYOU2,
0xff
};
0xff};
static u_char keiyou11[] = {
0x80, R_KGOKAN,
@ -808,8 +759,7 @@ static u_char keiyou11[] = {
0x21, _RU, R_DRENTAI3,
0x21, _RE, R_KAMEI,
0x11, _NI, R_DRENYOU2,
0xff
};
0xff};
static u_char keidou1[] = {
0x80, R_DGOKAN,
@ -823,16 +773,14 @@ static u_char keidou1[] = {
0x11, _RU, R_DRENTAI3,
0x11, _RE, R_KAMEI,
0x01, _NI, R_DRENYOU2,
0xff
};
0xff};
static u_char keidou2[] = {
0x80, R_DGOKAN,
0x02, _TA, _RU, R_DRENTAI2,
0x11, _RE, R_KATEI2,
0x01, _TO, R_DRENYOU3,
0xff
};
0xff};
static u_char keidou4[] = {
0x80, R_DGOKAN,
@ -847,8 +795,7 @@ static u_char keidou4[] = {
0x11, _RU, R_DRENTAI3,
0x11, _RE, R_KAMEI,
0x01, _NI, R_DRENYOU2,
0xff
};
0xff};
static u_char keidou9[] = {
0x80, R_DGOKAN,
@ -864,8 +811,7 @@ static u_char keidou9[] = {
0x01, _NI, R_DRENYOU2,
0x01, _NO, R_CUT,
0x12, _KO, _TO, R_KOTO,
0xff
};
0xff};
static u_char sahenmeisi1[] = {
0x00, R_SMEISI1,
@ -877,8 +823,7 @@ static u_char sahenmeisi1[] = {
0x11, _RE, R_KATEI2,
0x01, _SE, R_MIZEN2,
0x11, _YO, R_MEIREI2,
0xff
};
0xff};
static u_char sahenmeisi2[] = {
0x00, R_SMEISI1,
@ -890,8 +835,7 @@ static u_char sahenmeisi2[] = {
0x11, _RE, R_KATEI2,
0x01, _SE, R_MIZEN2,
0x11, _YO, R_MEIREI2,
0xff
};
0xff};
static u_char keidoumeisi[] = {
0x00, R_DMEISI,
@ -906,8 +850,7 @@ static u_char keidoumeisi[] = {
0x11, _RU, R_DRENTAI3,
0x11, _RE, R_KAMEI,
0x01, _NI, R_DRENYOU2,
0xff
};
0xff};
static u_char keiyoustb[] = {
0x00, R_KSTB,
@ -917,8 +860,7 @@ static u_char keiyoustb[] = {
0x01, _KI, R_KRENTAI,
0x01, _KU, R_KRENYOU,
0x02, _KE, _RE, R_KATEI2,
0xff
};
0xff};
static u_char ichistb[] = {
0x00, R_ICHISETUBI,
@ -926,16 +868,14 @@ static u_char ichistb[] = {
0x01, _RU, R_SHUUSI,
0x01, _RE, R_KATEI2,
0x01, _RO, R_MEIREI1,
0xff
};
0xff};
static u_char fukusi2[] = {
0x00, R_FUKUSI,
0x01, _TO, R_F_FUKUSI,
0x11, _SI, R_SI1,
0x11, _HA, R_F_FUKUSI,
0xff
};
0xff};
static u_char fukusi3[] = {
0x00, R_FUKUSI,
@ -950,8 +890,7 @@ static u_char fukusi3[] = {
0x01, _TO, R_F_FUKUSI,
0x11, _SI, R_SI1,
0x11, _HA, R_F_FUKUSI,
0xff
};
0xff};
static u_char fukusi4[] = {
0x00, R_FUKUSI,
@ -963,26 +902,22 @@ static u_char fukusi4[] = {
0x11, _RE, R_KATEI2,
0x01, _SE, R_MIZEN2,
0x11, _YO, R_MEIREI2,
0xff
};
0xff};
static u_char fukusi5[] = {
0x00, R_FUKUSI,
0x01, _NI, R_F_FUKUSI,
0xff
};
0xff};
static u_char fukusi6[] = {
0x00, R_FUKUSI,
0x01, _MO, R_F_FUKUSI,
0xff
};
0xff};
static u_char fukusi7[] = {
0x00, R_FUKUSI,
0x01, _NO, R_F_FUKUSI,
0xff
};
0xff};
static u_char fukusi8[] = {
0x00, R_FUKUSI,
@ -995,8 +930,7 @@ static u_char fukusi8[] = {
0x01, _TO, R_F_FUKUSI,
0x11, _SI, R_SI1,
0x11, _HA, R_F_FUKUSI,
0xff
};
0xff};
static u_char fukusi9[] = {
0x00, R_FUKUSI,
@ -1018,8 +952,7 @@ static u_char fukusi9[] = {
0x11, _SI, R_SI1,
0x11, _HA, R_F_FUKUSI,
0x01, _NO, R_F_FUKUSI,
0xff
};
0xff};
u_char* conjadr[] = {
0,
@ -1241,5 +1174,4 @@ u_char *conjadr[] = {
0,
0,
0,
0
};
0};

File diff suppressed because it is too large Load diff

View file

@ -33,23 +33,14 @@
* $SonyDate: 1994/06/03 08:01:38 $
*/
#include "sj_kcnv.h"
#include "sj_kanakan.h"
void
cvtclknj()
{
void cvtclknj() {
KHREC* krec;
int i;
if(!selectid) selectid = khcount;
i = khcount;
@ -60,9 +51,7 @@ cvtclknj()
krec++;
}
setstyrec(krec);
cvtkouho(krec);
}

View file

@ -33,17 +33,12 @@
* $SonyDate: 1994/06/03 08:01:40 $
*/
#include "sj_euc.h"
#include "sj_kcnv.h"
#include "sj_kanakan.h"
void
cvtdict(KHREC *krec, CLREC *clrec, int flg)
{
void cvtdict(KHREC* krec, CLREC* clrec, int flg) {
TypeDicOfs ofs;
u_char* yptr;
int jlen;
@ -54,17 +49,14 @@ cvtdict(KHREC *krec, CLREC *clrec, int flg)
JREC* jrec;
int i, j;
ofs = krec->offs;
jrec = clrec->jnode;
cllen = clrec->cllen;
yptr = inputyomi;
jlen = jrec->jlen;
if(i = jrec->sttofs) {
if(i == SETTOU_KIGOU) {
@ -72,7 +64,6 @@ cvtdict(KHREC *krec, CLREC *clrec, int flg)
fptr = yptr;
}
else {
fptr = Settou_ptr(i);
sttlen = SttYomiLen(fptr);
@ -86,20 +77,16 @@ cvtdict(KHREC *krec, CLREC *clrec, int flg)
yptr += sttlen * 2;
}
else
sttlen = 0;
if(flg) {
(*Cvtnum_func[krec->mode - 1])(ystart + sttlen, yptr, jrec);
yptr += (i = jrec->numlen) * 2;
jlen -= i;
if(jrec->stbofs) {
*kanjitmp++ = *yptr++;
*kanjitmp++ = *yptr++;
@ -109,19 +96,16 @@ cvtdict(KHREC *krec, CLREC *clrec, int flg)
stblen = 0;
}
else if((i = jrec->stbofs) && (fptr = getstb(jrec->hinsi))) {
fptr += i - 1;
stblen = StbYomiLen(fptr);
jlen -= stblen;
}
else {
stblen = 0;
}
if(ofs) {
if(seldict(jrec->dicid)) {
(*curdict->getdic)(curdict, jrec->jseg);
@ -129,8 +113,7 @@ cvtdict(KHREC *krec, CLREC *clrec, int flg)
kanjitmp +=
getkanji(yptr, jlen, dicbuf + ofs, kanjitmp);
yptr += jlen * 2;
}
else {
} else {
while(jlen-- > 0) {
for(i = 0; i < euc_codesize(*yptr); i++)
*kanjitmp++ = yptr[i];
@ -139,7 +122,6 @@ cvtdict(KHREC *krec, CLREC *clrec, int flg)
}
}
if(stblen) {
i = StbKnjLen(fptr);
fptr += stblen + 2;
@ -147,7 +129,6 @@ cvtdict(KHREC *krec, CLREC *clrec, int flg)
yptr += stblen * 2;
}
i = cllen - (jrec->jlen);
while(i-- > 0) {
for(j = 0; j < euc_codesize(*yptr); j++)
@ -156,18 +137,13 @@ cvtdict(KHREC *krec, CLREC *clrec, int flg)
}
}
void
cvtminasi(int len)
{
void cvtminasi(int len) {
u_char* ptr;
ptr = inputyomi;
while(len-- > 0) {
if(isknj1(*ptr)) {
*kanjitmp++ = *ptr++;
*kanjitmp++ = *ptr++;
@ -183,11 +159,7 @@ cvtminasi(int len)
}
}
void
cvtwakachi(CLREC *clrec)
{
void cvtwakachi(CLREC* clrec) {
int jlen;
u_char* ym;
int cnt;
@ -195,7 +167,6 @@ cvtwakachi(CLREC *clrec)
ym = inputyomi;
cnt = jlen = clrec->jnode->jlen;
while(cnt-- > 0) {
if(isknj1(*ym)) {
@ -204,19 +175,16 @@ cvtwakachi(CLREC *clrec)
ch = *++ym;
if(0xa1 <= ch && ch <= 0xf3) {
*kanjitmp++ = 0xa5;
}
else {
} else {
*kanjitmp++ = 0xa4;
}
*kanjitmp++ = ch;
ym++;
}
else {
} else {
*kanjitmp++ = *ym++;
*kanjitmp++ = *ym++;
}
}
else if (*ym == SS3) {
} else if(*ym == SS3) {
*kanjitmp++ = *ym++;
*kanjitmp++ = *ym++;
*kanjitmp++ = *ym++;
@ -225,11 +193,9 @@ cvtwakachi(CLREC *clrec)
}
}
cnt = clrec->cllen - jlen;
while(cnt-- > 0) {
if(isknj1(*ym)) {
*kanjitmp++ = *ym++;
*kanjitmp++ = *ym++;

View file

@ -33,17 +33,11 @@
* $SonyDate: 1994/06/03 08:01:41 $
*/
#include "sj_kcnv.h"
#include "sj_kanakan.h"
void
cvtphknj()
{
void cvtphknj() {
int i, j;
CLREC* clrec;
CLREC* clkp;
@ -60,7 +54,6 @@ cvtphknj()
clrec = clrec->clsort;
}
if(clkp && stdytop) {
if(stdytop->nmflg)
@ -69,54 +62,40 @@ cvtphknj()
kouhotbl[0].rank = 1;
kanjitmp = kanjibuf + 1;
setstyrec(kouhotbl);
cvtkouho(kouhotbl);
i = kanjitmp - kanjibuf;
if(i < kanjilen) {
kanjilen -= i;
ystart += clt1st->cllen;
j = hzstrlen(inputyomi, (int)clt1st->cllen);
kanjibuf[0] = (u_char)j;
inputyomi += j;
memcpy(kanjipos, kanjibuf, i);
kanjipos += i;
}
else
} else
kanjilen = 0;
not_enough_memory:
free_clall(clt1st);
free_jall(jrt1st);
}
void
cvtkouho(KHREC *krec)
{
void cvtkouho(KHREC* krec) {
CLREC* clrec;
clrec = krec->clrec;
switch(clrec->jnode->class) {
case C_DICT:
cvtdict(krec, clrec, FALSE);
@ -145,15 +124,10 @@ cvtkouho(KHREC *krec)
break;
}
*kanjitmp++ = 0;
}
void
setstyrec(KHREC *krec)
{
void setstyrec(KHREC* krec) {
JREC* jrec;
KHREC* kptr;
int ii;
@ -162,13 +136,11 @@ setstyrec(KHREC *krec)
jrec = krec->clrec->jnode;
if(krec->mode && !krec->offs) {
for(ii = khcount, kptr = kouhotbl; ii--; kptr++)
if(kptr->rank == 1) break;
stdy.stdy1.offset = kptr->offs;
stdy.stdy1.seg = kptr->clrec->jnode->jseg;
stdy.stdy1.styno = kptr->styno;
@ -190,17 +162,14 @@ setstyrec(KHREC *krec)
stdy.sttfg = krec->sttfg;
stdy.ka_fg = krec->ka_fg;
if(jrec->stbofs && (fptr = getstb(jrec->hinsi)))
stdy.len -= StbYomiLen(fptr + jrec->stbofs - 1);
if(fptr = Settou_ptr(jrec->sttofs))
stdy.sttlen = SttYomiLen(fptr);
else
stdy.sttlen = 0;
memcpy(kanjitmp, (u_char*)&stdy, sizeof(STDYOUT));
kanjitmp += sizeof(STDYOUT);
}

View file

@ -33,9 +33,6 @@
* $SonyDate: 1994/06/03 08:01:42 $
*/
#include <string.h>
#include "sj_kcnv.h"
@ -46,10 +43,7 @@ static int del_segment(TypeDicSeg);
static void del_uidx(TypeDicSeg);
static void del_stdy(TypeDicSeg, TypeDicOfs, int);
u_int
deldic(u_char *yomi, u_char *kanji, TypeGram hinsi)
{
u_int deldic(u_char* yomi, u_char* kanji, TypeGram hinsi) {
u_char yptr[MAXWDYOMILEN + 1];
u_char kptr[MAXWDKANJILEN + 1];
u_short err;
@ -92,17 +86,14 @@ deldic(u_char *yomi, u_char *kanji, TypeGram hinsi)
if(hblknum == 1) {
if(dblknum == 1) {
return del_segment(useg);
}
else {
} else {
return del_douon(useg, p1, ofs);
}
}
else {
} else {
stp = p2;
edp++;
}
}
else {
} else {
stp = p3;
}
@ -124,11 +115,8 @@ deldic(u_char *yomi, u_char *kanji, TypeGram hinsi)
return AD_DONE;
}
static int
del_douon(TypeDicSeg seg, u_char *ptr, TypeDicOfs ofs)
{
del_douon(TypeDicSeg seg, u_char* ptr, TypeDicOfs ofs) {
u_char *nxt, *p1, *p2;
int size;
int nlen, plen, len;
@ -139,15 +127,13 @@ del_douon(TypeDicSeg seg, u_char *ptr, TypeDicOfs ofs)
size = nxt - ptr;
memset(ptr, DICSEGTERM, dicbuf + curdict->seglen - nxt);
}
else {
} else {
size = getsize(nxt);
nlen = getnlen(nxt);
plen = getplen(nxt);
if(ptr == segtop()) {
if (nlen + plen > (unsigned int) count_uidx()
+ sstrlen(get_idxptr(seg)))
if(nlen + plen > (unsigned int)count_uidx() + sstrlen(get_idxptr(seg)))
return AD_OVFLWINDEX;
}
@ -175,11 +161,8 @@ del_douon(TypeDicSeg seg, u_char *ptr, TypeDicOfs ofs)
return AD_DONE;
}
static int
del_segment(TypeDicSeg seg)
{
del_segment(TypeDicSeg seg) {
int i;
STDYIN* styp;
TypeDicID dicid;
@ -192,8 +175,7 @@ del_segment(TypeDicSeg seg)
(*curdict->putdic)(curdict, sg - 1);
}
curdict->segunit--;
}
else {
} else {
memset(dicbuf, DICSEGTERM, (int)curdict->seglen);
dicbuf[0] = 0;
(*curdict->putdic)(curdict, DICSEGBASE);
@ -232,17 +214,13 @@ del_segment(TypeDicSeg seg)
return AD_DONE;
}
static void
del_uidx(TypeDicSeg seg)
{
del_uidx(TypeDicSeg seg) {
u_char *p, *q;
int len;
p = get_idxptr(seg);
for (q = p ; *q++; )
;
for(q = p; *q++;);
mvmemi(q, p, idxbuf + curdict->idxlen - q);
@ -254,11 +232,8 @@ del_uidx(TypeDicSeg seg)
mkidxtbl(curdict);
}
static void
del_stdy(TypeDicSeg seg, TypeDicOfs ofs, int size)
{
del_stdy(TypeDicSeg seg, TypeDicOfs ofs, int size) {
int i;
TypeStyNum stdynum;
STDYIN* stdy;

View file

@ -33,18 +33,12 @@
* $SonyDate: 1994/06/03 08:01:45 $
*/
#include "sj_euc.h"
#include "sj_kcnv.h"
#include "sj_kanakan.h"
void
get_askknj()
{
void get_askknj() {
u_char* p;
u_char* q;
u_char* r;
@ -74,11 +68,7 @@ get_askknj()
}
}
int
seldict(TypeDicID id)
{
int seldict(TypeDicID id) {
DICTL* dp;
for(dp = dictlist; dp; dp = dp->next) {
@ -90,11 +80,8 @@ seldict(TypeDicID id)
return FALSE;
}
u_char*
get_idxptr(TypeDicSeg seg)
{
get_idxptr(TypeDicSeg seg) {
(*curdict->getofs)(curdict);
(*curdict->getidx)(curdict);

View file

@ -33,9 +33,6 @@
* $SonyDate: 1994/06/03 08:01:46 $
*/
#include "sj_rename.h"
#include "sj_typedef.h"
@ -45,31 +42,25 @@ VFunc cvtnum_func[] = {
num_type00, num_type01, num_type02, num_type03,
num_type04, num_type05, num_type06, num_type07,
num_type08, num_type09, num_type10, num_type11,
num_type12, num_type13, num_type14
};
num_type12, num_type13, num_type14};
UCPFunc getkan_func[] = {
getkan_norm, getkan_norm, getkan_hira, getkan_kata,
getkan_knj, getkan_ofs, getkan_norm, getkan_none,
getkan_norm, getkan_norm, getkan_hira, getkan_kata,
getkan_knj, getkan_ofs, getkan_norm, getkan_none
};
getkan_knj, getkan_ofs, getkan_norm, getkan_none};
IFunc setjrec_func[] = {
setj_norm2, setj_norm2, setj_norm1, setj_norm1,
setj_knj, setj_ofs, setj_norm2, setj_atrb,
setj_norm2, setj_norm2, setj_norm1, setj_norm1,
setj_knj, setj_ofs, setj_norm2, setj_atrb
};
setj_knj, setj_ofs, setj_norm2, setj_atrb};
IFunc hiraknj_func[] = {
hiraknj_hira, hiraknj_norm, hiraknj_hask, hiraknj_kask,
hiraknj_knj, hiraknj_ofs, hiraknj_norm, hiraknj_atrb,
hiraknj_hira, hiraknj_norm, hiraknj_hask, hiraknj_kask,
hiraknj_knj, hiraknj_ofs, hiraknj_norm, hiraknj_atrb
};
hiraknj_knj, hiraknj_ofs, hiraknj_norm, hiraknj_atrb};
u_char *makekan_1byte(), *makekan_knj(), *makekan_ofs();
u_char *makekan_norm(), *makekan_none();
@ -77,5 +68,4 @@ UCPFunc makekan_func[] = {
makekan_norm, makekan_norm, makekan_1byte, makekan_1byte,
makekan_knj, makekan_ofs, makekan_norm, makekan_none,
makekan_norm, makekan_norm, makekan_1byte, makekan_1byte,
makekan_knj, makekan_ofs, makekan_norm, makekan_none
};
makekan_knj, makekan_ofs, makekan_norm, makekan_none};

View file

@ -33,10 +33,6 @@
* $SonyDate: 1994/06/03 08:01:47 $
*/
#include "sj_kcnv.h"
#include "sj_hinsi.h"
#include "sj_right.h"
@ -45,8 +41,7 @@
#include "sj_kanakan.h"
static int
fzkstrcmp(u_char *yptr, u_char *fzkp, int *saml)
{
fzkstrcmp(u_char* yptr, u_char* fzkp, int* saml) {
int asklen, nkrlen;
asklen = FzkAskLen(fzkp);
@ -79,11 +74,7 @@ fzkstrcmp(u_char *yptr, u_char *fzkp, int *saml)
return MATCH;
}
void
setclrec(JREC *jrec, u_char *yptr, TypeCnct right)
{
void setclrec(JREC* jrec, u_char* yptr, TypeCnct right) {
CLREC* new;
TypeGram hinsi;
int len;
@ -134,7 +125,6 @@ setclrec(JREC *jrec, u_char *yptr, TypeCnct right)
else if(hinsi == SETUBI_7 || hinsi == SETUBI_8)
new->kubun = K_DOUSHI;
else if(hinsi == D_MEISI_5)
new->kubun = K_YOUGEN;
@ -142,8 +132,7 @@ setclrec(JREC *jrec, u_char *yptr, TypeCnct right)
new->kubun = K_YOUGEN;
else
new->kubun = K_TAIGEN;
}
else if (hinsi >= MEISI_5 && hinsi <= MEISI_7) {
} else if(hinsi >= MEISI_5 && hinsi <= MEISI_7) {
if(right >= R_I && right <= R_ITADAKE)
new->kubun = K_DOUSHI;
@ -157,14 +146,12 @@ setclrec(JREC *jrec, u_char *yptr, TypeCnct right)
new->kubun = K_DOUSHI;
else
new->kubun = K_TAIGEN;
}
else
} else
new->kubun = K_TAIGEN;
}
static int
fzkcnct(TypeCnct right, TypeCnct left)
{
fzkcnct(TypeCnct right, TypeCnct left) {
u_char* cncttbl;
if(right && left) {
@ -178,9 +165,7 @@ fzkcnct(TypeCnct right, TypeCnct left)
}
RECURS
void
srchfzk(JREC *jrec, u_char *yptr, TypeCnct right, int level)
{
void srchfzk(JREC* jrec, u_char* yptr, TypeCnct right, int level) {
u_char* fzk;
int len = 0;
int cmp;
@ -231,7 +216,6 @@ srchfzk(JREC *jrec, u_char *yptr, TypeCnct right, int level)
if(len) return;
if(!(fzk = Fzkadr(*yptr - _XA))) return;
yptr++;
@ -252,7 +236,6 @@ srchfzk(JREC *jrec, u_char *yptr, TypeCnct right, int level)
else if((cmp != MATCH) || isdpnd(*(yptr + len)))
continue;
fzktbl[fzkcount].yomip = yptr - 1;
fzktbl[fzkcount].fzkp = fzk;
fzkcount++;

View file

@ -33,8 +33,6 @@
* $SonyDate: 1994/06/03 08:01:48 $
*/
#include "sj_const.h"
#include "sj_rename.h"
#include "sj_typedef.h"
@ -47,8 +45,7 @@
static u_char fzk_wo[] = {
(0 << 5) + 0, L_WO, R_WO,
(0 << 5) + 0, L_WO_S, R_WO_S,
0xff
};
0xff};
static u_char fzk_xtu[] = {
(0 << 5) + 1, _KE, L_KKE, R_SHUUJO,
@ -68,8 +65,7 @@ static u_char fzk_xtu[] = {
(2 << 5) + 2, _RO, _U, L_PPOI, R_KAROU,
(1 << 5) + 1, _KU, L_PPOI, R_KRENYOU,
(1 << 5) + 2, _KE, _RE, L_PPOI, R_KATEI1,
0xff
};
0xff};
static u_char fzk_a[] = {
(0 << 5) + 1, _GE, L_YOUGEN, R_AGE,
@ -87,8 +83,7 @@ static u_char fzk_a[] = {
(1 << 5) + 0, L_ARE2, R_KATEI2,
(1 << 5) + 3, _BA, _KO, _SO, L_ARE1, R_CUT,
(0 << 5) + 2, _RO, _U, L_AROU, R_AROU,
0xff
};
0xff};
static u_char fzk_i[] = {
(0 << 5) + 0, L_IRU, R_I,
@ -110,22 +105,19 @@ static u_char fzk_i[] = {
(0 << 5) + 1, _RU, L_IRU, R_SHUUSI,
(0 << 5) + 1, _RE, L_IRU, R_KATEI2,
(0 << 5) + 1, _RO, L_IRU, R_MEIREI1,
0xff
};
0xff};
static u_char fzk_u[] = {
(0 << 5) + 1, _E, L_UE, R_UE,
(0 << 5) + 1, _TI, L_UTI, R_UTI,
(0 << 5) + 1, _RU, L_ERU, R_SHUUSI,
0xff
};
0xff};
static u_char fzk_e[] = {
(0 << 5) + 0, L_ERU, R_E,
(0 << 5) + 1, _RU, L_ERU, R_SHUUSI,
(0 << 5) + 1, _RE, L_ERU, R_KATEI3,
0xff
};
0xff};
static u_char fzk_o[] = {
(0 << 5) + 1, _I, L_YOUGEN, R_ONBIN8,
@ -140,8 +132,7 @@ static u_char fzk_o[] = {
(0 << 5) + 1, _RI, L_ORI, R_ORI1,
(1 << 5) + 0, L_YOUGEN, R_ORI2,
(0 << 5) + 1, _RE, L_YOUGEN, R_KAMEI,
0xff
};
0xff};
static u_char fzk_ka[] = {
(0 << 5) + 0 + 8, L_KA1, R_KA1,
@ -165,8 +156,7 @@ static u_char fzk_ka[] = {
(1 << 5) + 0, L_KARA2, R_KARA2,
(1 << 5) + 1, _ZU, L_KARAZU, R_ZU,
(1 << 5) + 1, _NU, L_KARAZU, R_NU,
0xff
};
0xff};
static u_char fzk_ga[] = {
(0 << 5) + 0, L_GA1, R_GA1,
@ -185,14 +175,12 @@ static u_char fzk_ga[] = {
(2 << 5) + 1, _RA, L_GATIDA, R_KATEI1,
(1 << 5) + 1, _NI, L_GATIDA, R_DRENYOU2,
(0 << 5) + 2, _TE, _RA, L_GATERA, R_GATERA,
0xff
};
0xff};
static u_char fzk_ki[] = {
(0 << 5) + 0, L_YOUGEN, R_FZKKI,
(0 << 5) + 1, _RI, L_KIRI, R_KIRI,
0xff
};
0xff};
static u_char fzk_ku[] = {
(0 << 5) + 2, _SE, _NI, L_KUSENI, R_KUSENI,
@ -207,38 +195,33 @@ static u_char fzk_ku[] = {
(0 << 5) + 1, _RE, L_YOUGEN, R_KURE,
(1 << 5) + 1, _RU, L_YOUGEN, R_SHUUSI,
(1 << 5) + 1, _RE, L_YOUGEN, R_KATEI3,
0xff
};
0xff};
static u_char fzk_gu[] = {
(0 << 5) + 2, _RA, _I, L_KURAI, R_KURAI,
(0 << 5) + 2, _RU, _MI, L_GURUMI, R_GURUMI,
0xff
};
0xff};
static u_char fzk_ke[] = {
(0 << 5) + 1, _DO, L_KEDO, R_KEDO,
(1 << 5) + 1, _MO, L_KEDO, R_KEDO,
(0 << 5) + 2, _RE, _DO, L_KEDO, R_KEDO,
(2 << 5) + 1, _MO, L_KEDO, R_KEDO,
0xff
};
0xff};
static u_char fzk_ko[] = {
(0 << 5) + 0, L_YOUGEN, R_KO,
(0 << 5) + 1, _I, L_YOUGEN, R_MEIREI1,
(0 << 5) + 1, _SO, L_KOSO, R_KOSO,
(0 << 5) + 1, _TO, L_KOTO, R_KOTO,
0xff
};
0xff};
static u_char fzk_go[] = {
(0 << 5) + 2, _ZA, _I, L_GOZAI, R_GOZAI,
(0 << 5) + 2, _TO, _KI, L_GOTOSI, R_GOTOKI,
(1 << 5) + 1, _KU, L_GOTOSI, R_GOTOKU,
(1 << 5) + 1, _SI, L_GOTOSI, R_GOTOSI,
0xff
};
0xff};
static u_char fzk_sa[] = {
(0 << 5) + 0, L_SA1, R_MIZEN1,
@ -249,14 +232,12 @@ static u_char fzk_sa[] = {
(1 << 5) + 1, _RU, L_SASERU, R_SHUUSI,
(1 << 5) + 1, _RE, L_SASERU, R_KATEI2,
(1 << 5) + 1, _RO, L_SASERU, R_MEIREI1,
0xff
};
0xff};
static u_char fzk_za[] = {
(0 << 5) + 1, _RU, L_ZARU, R_ZARU,
(0 << 5) + 1, _RE, L_ZARU, R_KATEI2,
0xff
};
0xff};
static u_char fzk_si[] = {
(0 << 5) + 0, L_SI1, R_SI1,
@ -271,8 +252,7 @@ static u_char fzk_si[] = {
(1 << 5) + 1, _XTU, L_YOUGEN, R_ONBIN6,
(1 << 5) + 1, _WA, L_YOUGEN, R_MIZEN5,
(0 << 5) + 1, _RO, L_SIRO, R_MEIREI1,
0xff
};
0xff};
static u_char fzk_ji[] = {
(0 << 5) + 2, _MA, _I, L_JIMAU, R_IKI,
@ -288,8 +268,7 @@ static u_char fzk_ji[] = {
(1 << 5) + 2, _O, _U, L_JYAU, R_AROU,
(1 << 5) + 1, _XTU, L_JYAU, R_ONBIN6,
(1 << 5) + 1, _WA, L_JYAU, R_MIZEN5,
0xff
};
0xff};
static u_char fzk_su[] = {
(0 << 5) + 1, _GI, L_SUGIRU, R_SUGI,
@ -302,8 +281,7 @@ static u_char fzk_su[] = {
(0 << 5) + 1, _RA, L_SURA, R_SURA,
(0 << 5) + 1, _RU, L_SURU, R_SHUUSI,
(0 << 5) + 1, _RE, L_SURE, R_KATEI2,
0xff
};
0xff};
static u_char fzk_zu[] = {
(0 << 5) + 0, L_ZU, R_ZU,
@ -311,8 +289,7 @@ static u_char fzk_zu[] = {
(0 << 5) + 2, _NI, _I, L_ZU, R_I,
(2 << 5) + 1, _RU, L_ZU, R_SHUUSI,
(0 << 5) + 2, _NN, _BA, L_ZUNBA, R_CUT,
0xff
};
0xff};
static u_char fzk_se[] = {
(0 << 5) + 0, L_SE, R_MIZEN2,
@ -322,13 +299,11 @@ static u_char fzk_se[] = {
(0 << 5) + 1, _RU, L_SERU, R_SHUUSI,
(0 << 5) + 1, _RE, L_SERU, R_KATEI2,
(0 << 5) + 1, _RO, L_SERU, R_MEIREI1,
0xff
};
0xff};
static u_char fzk_ze[] = {
(0 << 5) + 0, L_ZE, R_SHUUJO,
0xff
};
0xff};
static u_char fzk_so[] = {
(0 << 5) + 1, _U, L_SOUDA, R_SOU,
@ -344,13 +319,11 @@ static u_char fzk_so[] = {
(2 << 5) + 0, L_YOUTAI, R_SOUNA2,
(2 << 5) + 1, _RA, L_SOUDA, R_KATEI1,
(1 << 5) + 1, _NI, L_YOUTAI, R_SOUNI,
0xff
};
0xff};
static u_char fzk_zo[] = {
(0 << 5) + 0, L_ZO, R_SHUUJO,
0xff
};
0xff};
static u_char fzk_ta[] = {
(0 << 5) + 0, L_TA, R_TA,
@ -375,8 +348,7 @@ static u_char fzk_ta[] = {
(0 << 5) + 1, _RI, L_TA, R_TARI,
(0 << 5) + 1, _RU, L_TARU, R_CUT,
(0 << 5) + 2, _RO, _U, L_TA, R_KAROU,
0xff
};
0xff};
static u_char fzk_da[] = {
(0 << 5) + 0, L_DA1, R_TA,
@ -388,8 +360,7 @@ static u_char fzk_da[] = {
(1 << 5) + 1, _KE, L_DARAKE, R_DARAKE,
(0 << 5) + 1, _RI, L_DA1, R_TARI,
(0 << 5) + 2, _RO, _U, L_DAROU, R_DAROU,
0xff
};
0xff};
static u_char fzk_ti[] = {
(0 << 5) + 2, _MA, _I, L_TIMAU, R_IKI,
@ -405,28 +376,24 @@ static u_char fzk_ti[] = {
(1 << 5) + 2, _O, _U, L_TYAU, R_AROU,
(1 << 5) + 1, _XTU, L_TYAU, R_ONBIN6,
(1 << 5) + 1, _WA, L_TYAU, R_MIZEN5,
0xff
};
0xff};
static u_char fzk_di[] = {
(0 << 5) + 1, _XYA, L_JYA, R_JYA,
0xff
};
0xff};
static u_char fzk_tu[] = {
(0 << 5) + 2, _I, _TE, L_TUITE, R_TUITE,
(0 << 5) + 1, _KI, L_TUKI, R_TUKI,
(0 << 5) + 1, _TU, L_TUTU, R_TUTU,
(0 << 5) + 2, _MO, _RI, L_TUMORI, R_TUMORI,
0xff
};
0xff};
static u_char fzk_te[] = {
(0 << 5) + 0, L_TE1, R_TE1,
(0 << 5) + 0, L_TE2, R_TE2,
(0 << 5) + 1, _RU, L_TERU, R_TERU,
0xff
};
0xff};
static u_char fzk_de[] = {
(0 << 5) + 0, L_DE, R_DE,
@ -441,8 +408,7 @@ static u_char fzk_de[] = {
(0 << 5) + 1, _SU, L_DESU, R_DESU,
(0 << 5) + 1, _HA, L_DEHA, R_DEHA,
(0 << 5) + 1, _RU, L_DERU, R_TERU,
0xff
};
0xff};
static u_char fzk_to[] = {
(0 << 5) + 0, L_TO1, R_TO1,
@ -462,8 +428,7 @@ static u_char fzk_to[] = {
(0 << 5) + 1, _TE, L_TOTE, R_TOTE,
(0 << 5) + 3, _HA, _I, _E, L_TOHAIE, R_TOHAIE,
(0 << 5) + 1, _MO, L_TOMO, R_TOMO,
0xff
};
0xff};
static u_char fzk_do[] = {
(0 << 5) + 0, L_DO, R_DO,
@ -477,8 +442,7 @@ static u_char fzk_do[] = {
(1 << 5) + 1, _RO, L_DOKORO, R_DOKORO,
(2 << 5) + 1, _KA, L_DOKOROKA, R_DOKOROKA,
(0 << 5) + 1, _MO, L_DOMO, R_DOMO,
0xff
};
0xff};
static u_char fzk_na[] = {
(0 << 5) + 0, L_NA1, R_SHUUJO,
@ -514,8 +478,7 @@ static u_char fzk_na[] = {
(0 << 5) + 2, _NN, _KA, L_NANKA, R_NANKA,
(1 << 5) + 1, _ZO, L_NANZO, R_NANZO,
(1 << 5) + 1, _TE, L_NANTE, R_NANTE,
0xff
};
0xff};
static u_char fzk_ni[] = {
(0 << 5) + 0, L_NI1, R_NI1,
@ -530,20 +493,17 @@ static u_char fzk_ni[] = {
(0 << 5) + 1, _TE, L_NITE, R_NITE,
(0 << 5) + 2, _DE, _MO, L_NI1, R_MO1,
(0 << 5) + 1, _MO, L_NIMO, R_NIMO,
0xff
};
0xff};
static u_char fzk_nu[] = {
(0 << 5) + 0, L_NU, R_NU,
0xff
};
0xff};
static u_char fzk_ne[] = {
(0 << 5) + 0, L_NE1, R_SHUUJO,
(0 << 5) + 0, L_NE2, R_KATEI2,
(0 << 5) + 1, _E, L_NEE, R_SHUUJO,
0xff
};
0xff};
static u_char fzk_no[] = {
(0 << 5) + 0, L_NO1, R_NO1,
@ -552,15 +512,13 @@ static u_char fzk_no[] = {
(0 << 5) + 1, _NI, L_NONI, R_NONI,
(0 << 5) + 1, _MI, L_NOMI, R_NOMI,
(1 << 5) + 3, _NA, _RA, _ZU, L_NOMINRZ, R_NOMINRZ,
0xff
};
0xff};
static u_char fzk_ha[] = {
(0 << 5) + 0, L_HA, R_HA,
(0 << 5) + 1, _SI, L_HA, R_HASI,
(0 << 5) + 1, _ZU, L_HAZU, R_HAZU,
0xff
};
0xff};
static u_char fzk_ba[] = {
(0 << 5) + 0, L_BA, R_BA,
@ -568,8 +526,7 @@ static u_char fzk_ba[] = {
(1 << 5) + 1, _RI, L_BAKARI, R_BAKARI,
(0 << 5) + 3, _XTU, _KA, _SI, L_BAKARI, R_BAKARI,
(2 << 5) + 1, _RI, L_BAKARI, R_BAKARI,
0xff
};
0xff};
static u_char fzk_hu[] = {
(0 << 5) + 2, _U, _DA, L_FUUDA, R_SOUDA,
@ -583,28 +540,24 @@ static u_char fzk_hu[] = {
(1 << 5) + 1, _NA, L_FUUDA, R_SOUNA2,
(2 << 5) + 1, _RA, L_FUUDA, R_KATEI1,
(1 << 5) + 1, _NI, L_FUUDA, R_FUUNI,
0xff
};
0xff};
static u_char fzk_he[] = {
(0 << 5) + 0, L_HE, R_HE,
0xff
};
0xff};
static u_char fzk_be[] = {
(0 << 5) + 2, _KA, _RA, L_BESI, R_BEKARA,
(0 << 5) + 1, _KI, L_BESI, R_BEKI,
(0 << 5) + 1, _KU, L_BESI, R_BEKU,
(0 << 5) + 1, _SI, L_BESI, R_BESI,
0xff
};
0xff};
static u_char fzk_ho[] = {
(0 << 5) + 1, _U, L_HOU, R_HOU,
(0 << 5) + 1, _KA, L_HOKA, R_HOKA,
(0 << 5) + 1, _DO, L_HODO, R_HODO,
0xff
};
0xff};
static u_char fzk_ma[] = {
(0 << 5) + 1, _I, L_MAI, R_MAI,
@ -619,8 +572,7 @@ static u_char fzk_ma[] = {
(1 << 5) + 1, _NN, L_MASU, R_NN2,
(0 << 5) + 1, _DE, L_MADE, R_MADE,
(0 << 5) + 1, _MA, L_MAMA, R_MAMA,
0xff
};
0xff};
static u_char fzk_mi[] = {
(0 << 5) + 0, L_YOUGEN, R_MI,
@ -640,8 +592,7 @@ static u_char fzk_mi[] = {
(0 << 5) + 1, _RU, L_YOUGEN, R_SHUUSI,
(0 << 5) + 1, _RE, L_YOUGEN, R_KATEI2,
(0 << 5) + 1, _RO, L_YOUGEN, R_MEIREI1,
0xff
};
0xff};
static u_char fzk_mo[] = {
(0 << 5) + 0, L_MO1, R_MO1,
@ -656,8 +607,7 @@ static u_char fzk_mo[] = {
(1 << 5) + 1, _WA, L_YOUGEN, R_MIZEN5,
(0 << 5) + 1, _NN, L_WAYO, R_SHUUJO,
(1 << 5) + 1, _KA, L_WAYO, R_SHUUJO,
0xff
};
0xff};
static u_char fzk_ya[] = {
(0 << 5) + 0, L_YA1, R_YA1,
@ -675,13 +625,11 @@ static u_char fzk_ya[] = {
(0 << 5) + 1, _RU, L_YOUGEN, R_SHUUSI,
(0 << 5) + 1, _RE, L_YOUGEN, R_KATEI2,
(0 << 5) + 2, _RO, _U, L_YOUGEN, R_AROU,
0xff
};
0xff};
static u_char fzk_yu[] = {
(0 << 5) + 1, _E, L_YUE, R_YUE,
0xff
};
0xff};
static u_char fzk_yo[] = {
(0 << 5) + 0, L_YO, R_SHUUJO,
@ -713,8 +661,7 @@ static u_char fzk_yo[] = {
(1 << 5) + 0, L_YORU, R_YORI2,
(0 << 5) + 1, _RU, L_YORU, R_SHUUSI,
(0 << 5) + 1, _RE, L_YORU, R_KATEI3,
0xff
};
0xff};
static u_char fzk_ra[] = {
(0 << 5) + 2, _SI, _I, L_RASII, R_RASII,
@ -727,8 +674,7 @@ static u_char fzk_ra[] = {
(1 << 5) + 1, _RU, L_RARERU, R_SHUUSI,
(1 << 5) + 1, _RE, L_RARERU, R_KATEI2,
(1 << 5) + 1, _RO, L_RARERU, R_MEIREI1,
0xff
};
0xff};
static u_char fzk_re[] = {
(0 << 5) + 0, L_RERU, R_RARE,
@ -736,24 +682,19 @@ static u_char fzk_re[] = {
(0 << 5) + 1, _RU, L_RERU, R_SHUUSI,
(0 << 5) + 1, _RE, L_RERU, R_KATEI2,
(0 << 5) + 1, _RO, L_RERU, R_MEIREI1,
0xff
};
0xff};
static u_char fzk_wa[] = {
(0 << 5) + 0, L_WA, R_SHUUJO,
(0 << 5) + 1, _KE, L_WAKE, R_WAKE,
(0 << 5) + 1, _NE, L_WANE, R_SHUUJO,
(0 << 5) + 1, _YO, L_WAYO, R_SHUUJO,
0xff
};
0xff};
static u_char fzk_nn[] = {
(0 << 5) + 0, L_NN1, R_NN1,
(0 << 5) + 0, L_NN2, R_NN2,
0xff
};
0xff};
u_char* fzkadr[] = {
0, fzk_a, 0, fzk_i, 0,
@ -772,5 +713,4 @@ u_char *fzkadr[] = {
fzk_mo, 0, fzk_ya, 0, fzk_yu,
0, fzk_yo, fzk_ra, 0, 0,
fzk_re, 0, 0, fzk_wa, 0,
0, fzk_wo, fzk_nn
};
0, fzk_wo, fzk_nn};

View file

@ -33,9 +33,6 @@
* $SonyDate: 1994/06/03 08:01:49 $
*/
#include "sj_euc.h"
#include "sj_kcnv.h"
@ -44,14 +41,12 @@
static u_char* code2kanji();
u_char*
getkan_none(u_char *s, u_char *d, u_char *ym, int yl, int flg)
{
getkan_none(u_char* s, u_char* d, u_char* ym, int yl, int flg) {
return d;
}
u_char*
getkan_hira(u_char *s, u_char *d, u_char *ym, int yl, int flg)
{
getkan_hira(u_char* s, u_char* d, u_char* ym, int yl, int flg) {
int cnt, csize;
csize = codesize(*s);
@ -67,8 +62,7 @@ getkan_hira(u_char *s, u_char *d, u_char *ym, int yl, int flg)
}
u_char*
getkan_kata(u_char *s, u_char *d, u_char *ym, int yl, int flg)
{
getkan_kata(u_char* s, u_char* d, u_char* ym, int yl, int flg) {
int cnt, csize;
u_char ch;
@ -83,14 +77,12 @@ getkan_kata(u_char *s, u_char *d, u_char *ym, int yl, int flg)
ch = *++ym;
if(0xa1 <= ch && ch <= 0xf3) {
*d++ = 0xa5;
}
else {
} else {
*d++ = 0xa4;
}
*d++ = ch;
ym++;
}
else {
} else {
*d++ = *ym++;
*d++ = *ym++;
}
@ -100,23 +92,18 @@ getkan_kata(u_char *s, u_char *d, u_char *ym, int yl, int flg)
}
u_char*
getkan_knj(u_char *s, u_char *d, u_char *ym, int yl, int flg)
{
getkan_knj(u_char* s, u_char* d, u_char* ym, int yl, int flg) {
return code2kanji(askknj[*s & KNJASSYUKUMASK], d, ym, yl, flg);
}
u_char*
getkan_ofs(u_char *s, u_char *d, u_char *ym, int yl, int flg)
{
getkan_ofs(u_char* s, u_char* d, u_char* ym, int yl, int flg) {
return code2kanji(dicbuf + ((*s & KANJICODEMASK) << 8) + *(s + 1),
d, ym, yl, flg);
}
u_char*
getkan_norm(u_char *s, u_char *d, u_char *ym, int yl, int flg)
{
getkan_norm(u_char* s, u_char* d, u_char* ym, int yl, int flg) {
u_char c;
if(*s != 0) {
@ -132,8 +119,7 @@ getkan_norm(u_char *s, u_char *d, u_char *ym, int yl, int flg)
}
u_char*
getkan_ascii(u_char *s, u_char *d, u_char *ym, int yl, int flg)
{
getkan_ascii(u_char* s, u_char* d, u_char* ym, int yl, int flg) {
u_char c;
c = s[1];
@ -145,8 +131,7 @@ getkan_ascii(u_char *s, u_char *d, u_char *ym, int yl, int flg)
}
static u_char*
code2kanji(u_char *s, u_char *d, u_char *ym, int yl, int flg)
{
code2kanji(u_char* s, u_char* d, u_char* ym, int yl, int flg) {
int csize;
for(;;) {
@ -154,47 +139,58 @@ code2kanji(u_char *s, u_char *d, u_char *ym, int yl, int flg)
if(s[csize] == KANJISTREND) {
switch(*s & KANJIMODEMASK) {
case ZENHIRAASSYUKU:
d = getkan_hira(s, d, ym, yl, flg); break;
d = getkan_hira(s, d, ym, yl, flg);
break;
case ZENKATAASSYUKU:
d = getkan_kata(s, d, ym, yl, flg); break;
d = getkan_kata(s, d, ym, yl, flg);
break;
case OFFSETASSYUKU:
d = getkan_ofs(s, d, ym, yl, flg); break;
d = getkan_ofs(s, d, ym, yl, flg);
break;
case AIATTRIBUTE:
d = getkan_none(s, d, ym, yl, flg); break;
d = getkan_none(s, d, ym, yl, flg);
break;
case LEADINGHANKAKU:
d = getkan_ascii(s, d, ym, yl, flg); break;
d = getkan_ascii(s, d, ym, yl, flg);
break;
case KANJIASSYUKU:
d = getkan_knj(s, d, ym, yl, flg); break;
d = getkan_knj(s, d, ym, yl, flg);
break;
default:
d = getkan_norm(s, d, ym, yl, flg);
}
break;
}
else
} else
switch(*s & KANJIMODEMASK) {
case ZENHIRAASSYUKU:
d = getkan_hira(s, d, ym, yl, FALSE); break;
d = getkan_hira(s, d, ym, yl, FALSE);
break;
case ZENKATAASSYUKU:
d = getkan_kata(s, d, ym, yl, FALSE); break;
d = getkan_kata(s, d, ym, yl, FALSE);
break;
case OFFSETASSYUKU:
d = getkan_ofs(s, d, ym, yl, FALSE); break;
d = getkan_ofs(s, d, ym, yl, FALSE);
break;
case AIATTRIBUTE:
d = getkan_none(s, d, ym, yl, FALSE); break;
d = getkan_none(s, d, ym, yl, FALSE);
break;
case LEADINGHANKAKU:
d = getkan_ascii(s, d, ym, yl, FALSE); break;
d = getkan_ascii(s, d, ym, yl, FALSE);
break;
case KANJIASSYUKU:
d = getkan_knj(s, d, ym, yl, FALSE); break;
d = getkan_knj(s, d, ym, yl, FALSE);
break;
default:
d = getkan_norm(s, d, ym, yl, FALSE);
@ -206,15 +202,10 @@ code2kanji(u_char *s, u_char *d, u_char *ym, int yl, int flg)
return d;
}
int
getkanji(u_char *ym, int yl, u_char *ptr, u_char *buf)
{
int getkanji(u_char* ym, int yl, u_char* ptr, u_char* buf) {
u_char* q;
q = code2kanji(ptr, buf, ym, yl, TRUE);
return q - buf;
}

View file

@ -33,86 +33,61 @@
* $SonyDate: 1994/06/03 08:01:50 $
*/
#include "sj_kcnv.h"
#include "sj_kanakan.h"
static void setstynum(), setnspr(), regetrank();
void
getrank()
{
void getrank() {
trank = nrank = 1;
setstynum();
regetrank();
}
static void
setstynum()
{
setstynum() {
KHREC* kptr;
STDYIN* sptr;
int count;
for(kptr = kouhotbl, count = khcount; count--; kptr++) {
sptr = srchstdy(kptr->clrec->jnode->jseg, kptr->offs,
kptr->clrec->jnode->dicid);
if(!sptr) continue;
setnspr(kptr, sptr);
}
}
static void
setnspr(KHREC *kptr, STDYIN *sptr)
{
setnspr(KHREC* kptr, STDYIN* sptr) {
KHREC* ptr;
int keepnm;
TypeStyNum styno;
styno = kptr->styno = sptr->styno;
keepnm = trank;
for(ptr = kouhotbl; ptr < kptr; ptr++) {
if(styno < ptr->styno) {
ptr->rank++;
keepnm--;
}
else if(styno == ptr->styno) {
if(kptr->sttfg && kptr->ka_fg) {
if((sptr->sttkj == kptr->sttkj) &&
(sptr->ka_kj == kptr->ka_kj)) {
ptr->rank++;
@ -122,7 +97,6 @@ setnspr(KHREC *kptr, STDYIN *sptr)
else if(kptr->sttfg) {
if(sptr->sttkj == kptr->sttkj) {
ptr->rank++;
keepnm--;
@ -131,7 +105,6 @@ setnspr(KHREC *kptr, STDYIN *sptr)
else if(kptr->ka_fg) {
if(sptr->ka_kj == kptr->ka_kj) {
ptr->rank++;
keepnm--;
@ -140,32 +113,24 @@ setnspr(KHREC *kptr, STDYIN *sptr)
}
}
kptr->rank = (u_char)keepnm;
trank++;
if(keepnm <= nrank) nrank++;
if(sptr->nmflg && (nrank > keepnm)) nrank = keepnm;
}
static void
regetrank()
{
regetrank() {
KHREC* kptr;
int count;
int tmp;
if(nrank < trank) {
tmp = nrank;
trank += nkhcount;
}
@ -173,18 +138,15 @@ regetrank()
nkhcount = tmp = 0;
}
for(count = khcount, kptr = kouhotbl; count--; kptr++) {
if(!(kptr->rank)) {
if(tmp && kptr->mode && !(kptr->offs)) {
kptr->rank = (u_char)tmp++;
}
else
} else
kptr->rank = (u_char)trank++;
}
else if((short)kptr->rank >= nrank)
kptr->rank += (u_char)nkhcount;
}

View file

@ -33,8 +33,6 @@
* $SonyDate: 1994/12/09 11:27:06 $
*/
#include <stdio.h>
#include <sys/types.h>
#include "sj_rename.h"
@ -55,4 +53,3 @@ Global *work_base;
STDY* stdy_base;
int serv_errno;

View file

@ -41,9 +41,7 @@
#include "sj_kanakan.h"
int
euc_codesize(u_char c)
{
int euc_codesize(u_char c) {
if((c & KANJIMODEMASK) == 0x90) {
return 1;
} else if(isknj1(c)) {
@ -55,9 +53,7 @@ euc_codesize(u_char c)
}
}
int
hzstrlen(u_char *ptr, int len)
{
int hzstrlen(u_char* ptr, int len) {
u_char* head;
head = ptr;

View file

@ -33,15 +33,11 @@
* $SonyDate: 1994/06/03 08:01:54 $
*/
#include "sj_kcnv.h"
#include "sj_kanakan.h"
void
seg_count(DICT *dict)
{
void seg_count(DICT* dict) {
u_char* p;
u_char* q;
TypeDicSeg segcnt = 0;
@ -60,9 +56,7 @@ seg_count(DICT *dict)
dict->segunit = (segcnt == 0) ? 1 : segcnt;
}
void
mkidxtbl(DICT *dict)
{
void mkidxtbl(DICT* dict) {
u_char* p;
TypeDicSeg seg;
@ -80,10 +74,7 @@ mkidxtbl(DICT *dict)
}
}
void
initwork()
{
void initwork() {
jrt1st = jrt2nd = maxjptr = (JREC*)0;
clt1st = clt2nd = maxclptr = (CLREC*)0;
}

View file

@ -33,17 +33,13 @@
* $SonyDate: 1994/06/03 08:01:55 $
*/
#include "sj_rename.h"
#include "sj_typedef.h"
#include "sj_const.h"
#include "sj_kanakan.h"
int
istrcmp(u_char *yomip, u_char *idxp, int ylen, int ilen)
{
int istrcmp(u_char* yomip, u_char* idxp, int ylen, int ilen) {
for(;;) {
if((ilen | ylen) == 0) return MATCH;
@ -60,4 +56,3 @@ istrcmp(u_char *yomip, u_char *idxp, int ylen, int ilen)
ilen--;
}
}

View file

@ -33,15 +33,11 @@
* $SonyDate: 1994/06/03 08:01:58 $
*/
#include "sj_kcnv.h"
#include "sj_kanakan.h"
JREC *
free_jlst(JREC *p)
{
JREC* free_jlst(JREC* p) {
JREC* jpk;
JREC* jp;
JREC* jn;
@ -71,8 +67,7 @@ free_jlst(JREC *p)
}
CLREC*
free_clst(CLREC *p, int l)
{
free_clst(CLREC* p, int l) {
CLREC* cpk;
CLREC* cp;
CLREC* cn;
@ -88,11 +83,9 @@ free_clst(CLREC *p, int l)
if(cp) {
p->clsort = cpk;
cpk = p;
}
else
} else
cpk = cp = p;
}
else {
} else {
if(cp)
cp->clsort = p;
else
@ -113,9 +106,7 @@ free_clst(CLREC *p, int l)
return cpk;
}
void
free_clall(CLREC *p)
{
void free_clall(CLREC* p) {
CLREC* next;
while(p) {
@ -126,9 +117,7 @@ free_clall(CLREC *p)
}
}
void
free_jall(JREC *p)
{
void free_jall(JREC* p) {
JREC* next;
while(p) {
@ -138,13 +127,10 @@ free_jall(JREC *p)
}
}
void
freework()
{
void freework() {
free_clall(maxclptr);
clt1st = maxclptr = NULL;
free_jall(maxjptr);
jrt1st = maxjptr = NULL;
}

View file

@ -33,16 +33,13 @@
* $SonyDate: 1994/06/03 08:02:00 $
*/
#include "sj_kcnv.h"
#include "sj_right.h"
#include "sj_kanakan.h"
static int
set2nd(CLREC *clrec)
{
set2nd(CLREC* clrec) {
CLREC* rec2;
@ -63,9 +60,7 @@ set2nd(CLREC *clrec)
return rec2 ? (clrec->cllen + rec2->cllen) : (clrec->cllen);
}
void
mk2claus()
{
void mk2claus() {
u_char* keepptr;
int keeplen;
CLREC* clrec;
@ -159,4 +154,3 @@ mk2claus()
cnvstart = keepptr;
cnvlen = keeplen;
}

View file

@ -33,16 +33,12 @@
* $SonyDate: 1994/06/03 08:02:02 $
*/
#include "sj_kcnv.h"
#include "sj_hinsi.h"
#include "sj_kanakan.h"
void
mkbunsetu()
{
void mkbunsetu() {
JREC* jrec;
TypeGram hinsi;
u_char* cnj;
@ -98,10 +94,8 @@ mkbunsetu()
}
}
CLREC*
argclrec(int len)
{
argclrec(int len) {
CLREC* ptr;
CLREC* rec;
CLREC* child;
@ -154,13 +148,10 @@ argclrec(int len)
ptr->clsort = rec;
rec->clsort = child;
return rec;
}
else
} else
ptr = child;
}
ptr->clsort = rec;
return rec;
}

View file

@ -33,7 +33,6 @@
* $SonyDate: 1994/06/03 08:02:03 $
*/
#include <string.h>
#include "sj_kcnv.h"
@ -41,9 +40,7 @@
static void dic_mu(), dic_cl();
void
mkjiritu(int mode)
{
void mkjiritu(int mode) {
u_char chkind1;
u_char chkind2;
JREC* jrec;
@ -88,8 +85,7 @@ mkjiritu(int mode)
}
static void
dic_mu(int mode)
{
dic_mu(int mode) {
u_char* tagp;
DICTL* dp;
@ -103,9 +99,7 @@ dic_mu(int mode)
}
}
JREC *
argjrec(int len, JREC *rec)
{
JREC* argjrec(int len, JREC* rec) {
JREC* ptr;
JREC* jrec;
JREC* child;
@ -162,8 +156,7 @@ argjrec(int len, JREC *rec)
}
static void
dic_cl()
{
dic_cl() {
u_char* p;
u_short pos;
int len;

View file

@ -33,9 +33,6 @@
* $SonyDate: 1994/06/03 08:02:04 $
*/
#include "sj_euc.h"
#include "sj_kcnv.h"
#include "sj_hinsi.h"
@ -49,9 +46,7 @@ static int diffknj();
static void cl_numcmn();
static u_char* makekan();
void
mkkouho()
{
void mkkouho() {
CLREC* clrec;
int keeplen;
@ -67,11 +62,8 @@ mkkouho()
} while(clrec && (keeplen == clrec->cllen));
}
static void
getkhtbl(CLREC *clrec)
{
getkhtbl(CLREC* clrec) {
JREC* jrec;
jrec = clrec->jnode;
@ -101,11 +93,8 @@ getkhtbl(CLREC *clrec)
}
}
static void
cl_kanji(JREC *jrec, CLREC *clrec)
{
cl_kanji(JREC* jrec, CLREC* clrec) {
u_char* ptr;
int kcount = khcount;
@ -121,25 +110,18 @@ cl_kanji(JREC *jrec, CLREC *clrec)
}
ptr = skipkstr(ptr);
}
}
else {
} else {
setkouho(clrec, (TypeDicOfs)1, 0);
}
}
u_char*
makekan_none(u_char *s, u_char *d, int flg)
{
makekan_none(u_char* s, u_char* d, int flg) {
return d;
}
u_char*
makekan_1byte(u_char *s, u_char *d, int flg)
{
makekan_1byte(u_char* s, u_char* d, int flg) {
if((*s & KANJIMODEMASK) == ZENHIRAASSYUKU)
*d++ = 0x10 | (*s & KNJASSYUKUMASK);
else
@ -149,27 +131,18 @@ makekan_1byte(u_char *s, u_char *d, int flg)
return d;
}
u_char*
makekan_knj(u_char *s, u_char *d, int flg)
{
makekan_knj(u_char* s, u_char* d, int flg) {
return makekan(askknj[*s & KNJASSYUKUMASK], d, flg);
}
u_char *makekan_ofs(u_char *s, u_char *d, int flg)
{
u_char* makekan_ofs(u_char* s, u_char* d, int flg) {
return makekan(dicbuf + ((*s & KANJICODEMASK) << 8) + *(s + 1),
d, flg);
}
u_char*
makekan_norm(u_char *s, u_char *d, int flg)
{
makekan_norm(u_char* s, u_char* d, int flg) {
u_char c;
if(*s != 0) {
@ -185,11 +158,8 @@ makekan_norm(u_char *s, u_char *d, int flg)
return d;
}
u_char*
makekan_ascii(u_char *s, u_char *d, int flg)
{
makekan_ascii(u_char* s, u_char* d, int flg) {
u_char c;
c = s[1];
@ -202,11 +172,8 @@ makekan_ascii(u_char *s, u_char *d, int flg)
return d;
}
static u_char*
makekan(u_char *s, u_char *d, int flg)
{
makekan(u_char* s, u_char* d, int flg) {
int csize;
for(;;) {
@ -214,47 +181,58 @@ makekan(u_char *s, u_char *d, int flg)
if(s[csize] == KANJISTREND) {
switch(*s & KANJIMODEMASK) {
case ZENHIRAASSYUKU:
d = makekan_1byte(s, d, flg); break;
d = makekan_1byte(s, d, flg);
break;
case ZENKATAASSYUKU:
d = makekan_1byte(s, d, flg); break;
d = makekan_1byte(s, d, flg);
break;
case OFFSETASSYUKU:
d = makekan_ofs(s, d, flg); break;
d = makekan_ofs(s, d, flg);
break;
case AIATTRIBUTE:
d = makekan_none(s, d, flg); break;
d = makekan_none(s, d, flg);
break;
case LEADINGHANKAKU:
d = makekan_ascii(s, d, flg); break;
d = makekan_ascii(s, d, flg);
break;
case KANJIASSYUKU:
d = makekan_knj(s, d, flg); break;
d = makekan_knj(s, d, flg);
break;
default:
d = makekan_norm(s, d, flg);
}
break;
}
else
} else
switch(*s & KANJIMODEMASK) {
case ZENHIRAASSYUKU:
d = makekan_1byte(s, d, FALSE); break;
d = makekan_1byte(s, d, FALSE);
break;
case ZENKATAASSYUKU:
d = makekan_1byte(s, d, FALSE); break;
d = makekan_1byte(s, d, FALSE);
break;
case OFFSETASSYUKU:
d = makekan_ofs(s, d, FALSE); break;
d = makekan_ofs(s, d, FALSE);
break;
case AIATTRIBUTE:
d = makekan_none(s, d, FALSE); break;
d = makekan_none(s, d, FALSE);
break;
case LEADINGHANKAKU:
d = makekan_ascii(s, d, FALSE); break;
d = makekan_ascii(s, d, FALSE);
break;
case KANJIASSYUKU:
d = makekan_knj(s, d, FALSE); break;
d = makekan_knj(s, d, FALSE);
break;
default:
d = makekan_norm(s, d, FALSE);
@ -265,13 +243,10 @@ makekan(u_char *s, u_char *d, int flg)
return d;
}
#define PEND 2
#define QEND 1
static int
sameknj(u_char *p, u_char plen, u_char *q, u_char qlen)
{
sameknj(u_char* p, u_char plen, u_char* q, u_char qlen) {
int i;
int j;
int endf = 0;
@ -328,11 +303,8 @@ sameknj(u_char *p, u_char plen, u_char *q, u_char qlen)
#undef PEND
#undef QEND
static int
diffknj(JREC *jrec, u_char *ptr, int num)
{
diffknj(JREC* jrec, u_char* ptr, int num) {
KHREC* kptr;
JREC* jptr;
int i;
@ -368,12 +340,8 @@ diffknj(JREC *jrec, u_char *ptr, int num)
return TRUE;
}
static int
chrck_numtbl(u_short flg, u_short cond)
{
chrck_numtbl(u_short flg, u_short cond) {
u_short must;
if(cond = SelNumCond(cond)) {
@ -387,11 +355,7 @@ chrck_numtbl(u_short flg, u_short cond)
return TRUE;
}
int
sel_sjmode(JREC *jrec)
{
int sel_sjmode(JREC* jrec) {
u_short i;
u_short* p;
u_short* q;
@ -423,11 +387,8 @@ sel_sjmode(JREC *jrec)
return SelNumFunc(i);
}
static void
cl_numcmn(JREC *jrec, CLREC *clrec)
{
cl_numcmn(JREC* jrec, CLREC* clrec) {
u_char* p;
int i;
u_short j;
@ -451,12 +412,10 @@ cl_numcmn(JREC *jrec, CLREC *clrec)
setkouho(clrec, (TypeDicOfs)(p - dicbuf), i);
p = skipkstr(p);
}
}
else {
} else {
setkouho(clrec, (TypeDicOfs)1, i);
}
}
else {
} else {
tbl = Selsjadrs(jrec->class - C_N_ARABIA);
while((j = *tbl++) != SELNUMTERM) {
if(!chrck_numtbl(jrec->flags, j)) continue;

View file

@ -33,10 +33,6 @@
* $SonyDate: 1994/06/03 08:02:05 $
*/
#include "sj_kcnv.h"
#include "sj_yomi.h"
#include "sj_suuji.h"
@ -44,8 +40,7 @@
#include "sj_kanakan.h"
static int
word2char(u_short wd, u_char *tbl, int keta, int flg)
{
word2char(u_short wd, u_char* tbl, int keta, int flg) {
int mask;
int num;
u_char* src;
@ -77,8 +72,7 @@ word2char(u_short wd, u_char *tbl, int keta, int flg)
}
static void
words2num(u_short *wd, u_char *tbl, int flgc)
{
words2num(u_short* wd, u_char* tbl, int flgc) {
int i;
int keta;
int flg;
@ -87,8 +81,7 @@ words2num(u_short *wd, u_char *tbl, int flgc)
if(flgc) {
keta = NUMKETALENGTH - 1;
flg = FALSE;
}
else {
} else {
keta = 0;
flg = TRUE;
}
@ -104,9 +97,7 @@ words2num(u_short *wd, u_char *tbl, int flgc)
}
}
void
num_type00(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type00(u_char* s1, u_char* s2, JREC* jrec) {
u_short num[NUMWORDBUF];
setwdnum(s1, (int)jrec->numlen, num);
@ -114,9 +105,7 @@ num_type00(u_char *s1, u_char *s2, JREC *jrec)
words2num(num, Num1tbl, FALSE);
}
void
num_type01(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type01(u_char* s1, u_char* s2, JREC* jrec) {
u_short num[NUMWORDBUF];
setwdnum(s1, (int)jrec->numlen, num);
@ -124,9 +113,7 @@ num_type01(u_char *s1, u_char *s2, JREC *jrec)
words2num(num, Num1tbl, FALSE);
}
void
num_type02(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type02(u_char* s1, u_char* s2, JREC* jrec) {
u_short num[NUMWORDBUF];
setwdnum(s1, (int)jrec->numlen, num);
@ -134,9 +121,7 @@ num_type02(u_char *s1, u_char *s2, JREC *jrec)
words2num(num, Num1tbl, TRUE);
}
void
num_type03(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type03(u_char* s1, u_char* s2, JREC* jrec) {
u_short num[NUMWORDBUF];
setwdnum(s1, (int)jrec->numlen, num);
@ -144,9 +129,7 @@ num_type03(u_char *s1, u_char *s2, JREC *jrec)
words2num(num, Num2tbl, FALSE);
}
void
num_type04(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type04(u_char* s1, u_char* s2, JREC* jrec) {
u_short num[NUMWORDBUF];
setwdnum(s1, (int)jrec->numlen, num);
@ -154,9 +137,7 @@ num_type04(u_char *s1, u_char *s2, JREC *jrec)
words2num(num, Num2tbl, FALSE);
}
void
num_type05(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type05(u_char* s1, u_char* s2, JREC* jrec) {
u_short num[NUMWORDBUF];
setwdnum(s1, (int)jrec->numlen, num);
@ -164,9 +145,7 @@ num_type05(u_char *s1, u_char *s2, JREC *jrec)
words2num(num, Num2tbl, TRUE);
}
void
num_type06(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type06(u_char* s1, u_char* s2, JREC* jrec) {
u_short num[NUMWORDBUF];
setwdnum(s1, (int)jrec->numlen, num);
@ -174,9 +153,7 @@ num_type06(u_char *s1, u_char *s2, JREC *jrec)
words2num(num, Num3tbl, FALSE);
}
void
num_type07(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type07(u_char* s1, u_char* s2, JREC* jrec) {
u_short num[NUMWORDBUF];
setwdnum(s1, (int)jrec->numlen, num);
@ -185,8 +162,7 @@ num_type07(u_char *s1, u_char *s2, JREC *jrec)
}
static void
kan_num(u_short *wd, u_char *tbl1, u_char *tbl2)
{
kan_num(u_short* wd, u_char* tbl1, u_char* tbl2) {
int ii;
u_short tmp;
int mask;
@ -207,8 +183,7 @@ kan_num(u_short *wd, u_char *tbl1, u_char *tbl2)
if(flg) {
*kanjitmp++ = *kurai2++;
*kanjitmp++ = *kurai2++;
}
else
} else
kurai2 += 2;
mask = 0x1000;
@ -229,8 +204,7 @@ kan_num(u_short *wd, u_char *tbl1, u_char *tbl2)
*kanjitmp++ = *kurai1++;
}
flg = TRUE;
}
else
} else
kurai1 += 2;
tmp &= (mask - 1);
@ -243,9 +217,7 @@ kan_num(u_short *wd, u_char *tbl1, u_char *tbl2)
}
}
void
num_type08(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type08(u_char* s1, u_char* s2, JREC* jrec) {
u_short num[NUMWORDBUF];
setwdnum(s1, (int)jrec->numlen, num);
@ -253,9 +225,7 @@ num_type08(u_char *s1, u_char *s2, JREC *jrec)
kan_num(num, Num2tbl, Num4tbl);
}
void
num_type09(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type09(u_char* s1, u_char* s2, JREC* jrec) {
u_short num[NUMWORDBUF];
setwdnum(s1, (int)jrec->numlen, num);
@ -263,28 +233,19 @@ num_type09(u_char *s1, u_char *s2, JREC *jrec)
kan_num(num, Num3tbl, Num5tbl);
}
void
num_type10(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type10(u_char* s1, u_char* s2, JREC* jrec) {
int i;
for(i = jrec->numlen; i > 0; i--) {
if(Chrtbl[*s1++] & NUMBER) {
*kanjitmp++ = *s2++;
*kanjitmp++ = *s2++;
}
else
} else
s2 += euc_codesize(*s2);
}
}
void
num_type11(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type11(u_char* s1, u_char* s2, JREC* jrec) {
int i;
int j;
@ -301,17 +262,12 @@ num_type11(u_char *s1, u_char *s2, JREC *jrec)
*kanjitmp++ = COMMALOW;
}
}
}
else
} else
s2 += euc_codesize(*s2);
}
}
void
num_type12(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type12(u_char* s1, u_char* s2, JREC* jrec) {
int i;
int j;
@ -324,11 +280,8 @@ num_type12(u_char *s1, u_char *s2, JREC *jrec)
}
}
static void
num_kurai(u_char *p, int len, u_char *tbl)
{
num_kurai(u_char* p, int len, u_char* tbl) {
int i;
int j;
u_char tmp;
@ -349,11 +302,7 @@ num_kurai(u_char *p, int len, u_char *tbl)
}
}
void
num_type13(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type13(u_char* s1, u_char* s2, JREC* jrec) {
u_char num[NUMKETALENGTH];
int len;
@ -362,11 +311,7 @@ num_type13(u_char *s1, u_char *s2, JREC *jrec)
num_kurai(num, len, Num1tbl);
}
void
num_type14(u_char *s1, u_char *s2, JREC *jrec)
{
void num_type14(u_char* s1, u_char* s2, JREC* jrec) {
u_char num[NUMKETALENGTH];
int len;

View file

@ -33,16 +33,11 @@
* $SonyDate: 1994/06/03 08:02:05 $
*/
#include "sj_rename.h"
#include "sj_typedef.h"
#include "sj_kanakan.h"
void
mvmemd(u_char *src, u_char *dest, int len)
{
void mvmemd(u_char* src, u_char* dest, int len) {
while(len-- > 0) *(--dest) = *(--src);
}

View file

@ -33,16 +33,11 @@
* $SonyDate: 1994/06/03 08:02:06 $
*/
#include "sj_rename.h"
#include "sj_typedef.h"
#include "sj_kanakan.h"
void
mvmemi(u_char *src, u_char *dest, int len)
{
void mvmemi(u_char* src, u_char* dest, int len) {
while(len-- > 0) *dest++ = *src++;
}

View file

@ -33,9 +33,6 @@
* $SonyDate: 1995/07/21 05:22:51 $
*/
#include "sj_kcnv.h"
#include "sj_yomi.h"
@ -48,9 +45,7 @@ static void set_idxyomi();
static void cd2sjh_chr(u_char ch, u_char* dst);
int
getusr(u_char *buf)
{
int getusr(u_char* buf) {
int nlen;
peepyomi[0] = peepknj[0] = peepgrm = 0;
@ -78,9 +73,7 @@ getusr(u_char *buf)
return -1;
}
int
nextusr(u_char *buf)
{
int nextusr(u_char* buf) {
(*curdict->getdic)(curdict, peepidx);
get_askknj();
@ -95,9 +88,7 @@ nextusr(u_char *buf)
return 0;
}
int
prevusr(u_char *buf)
{
int prevusr(u_char* buf) {
(*curdict->getdic)(curdict, peepidx);
get_askknj();
@ -113,8 +104,7 @@ prevusr(u_char *buf)
}
static void
set_kanji()
{
set_kanji() {
int len;
len = getkanji(peepyomi, getnlen(peepdptr) + getplen(peepdptr),
@ -123,8 +113,7 @@ set_kanji()
}
static void
set_buf(u_char *buf)
{
set_buf(u_char* buf) {
u_char* p;
int i, csize;
@ -142,8 +131,7 @@ set_buf(u_char *buf)
}
static int
prev_kanji()
{
prev_kanji() {
u_char* p1;
u_char* p2;
@ -160,8 +148,7 @@ prev_kanji()
}
static int
prev_hinsi()
{
prev_hinsi() {
u_char* p1;
u_char* p2;
int nlen;
@ -190,8 +177,7 @@ prev_hinsi()
}
static int
prev_douon()
{
prev_douon() {
u_char* p1;
u_char* p2;
int nlen;
@ -212,8 +198,7 @@ prev_douon()
p1 = getntag(p1);
} while(!segend(p1));
}
else {
} else {
set_idxyomi();
p1 = segtop();
@ -249,8 +234,7 @@ prev_douon()
}
static int
next_kanji()
{
next_kanji() {
u_char* p1;
p1 = skipkstr(peepkptr);
@ -263,8 +247,7 @@ next_kanji()
}
static int
next_hinsi()
{
next_hinsi() {
u_char* p1;
p1 = skiphblk(peephptr);
@ -281,8 +264,7 @@ next_hinsi()
}
static int
next_douon()
{
next_douon() {
u_char* p1;
int nlen;
@ -295,11 +277,9 @@ next_douon()
peepdptr = segtop();
set_idxyomi();
}
else
} else
return 0;
}
else {
} else {
peepdptr = p1;
}
@ -316,8 +296,7 @@ next_douon()
}
static void
set_idxyomi()
{
set_idxyomi() {
u_char *p1, *p2;
if(p2 = get_idxptr(peepidx)) {
@ -331,8 +310,7 @@ set_idxyomi()
}
static void
add_yomi()
{
add_yomi() {
int nlen;
u_char *p1, *p2;
@ -351,46 +329,35 @@ add_yomi()
}
static void
cd2sjh_chr(u_char ch, u_char *dst)
{
cd2sjh_chr(u_char ch, u_char* dst) {
if(ch == _TYOUON) {
*dst++ = 0xa1;
*dst++ = 0xbc;
}
else if (ch == _IGETA) {
} else if(ch == _IGETA) {
*dst++ = 0xa1;
*dst++ = 0xf4;
}
else if (ch == _ATTO) {
} else if(ch == _ATTO) {
*dst++ = 0xa1;
*dst++ = 0xf7;
}
else if (ch == _YUUBIN) {
} else if(ch == _YUUBIN) {
*dst++ = 0xa2;
*dst++ = 0xa9;
}
else if (ch < N_0) {
}
else if (ch <= N_9) {
} else if(ch < N_0) {
} else if(ch <= N_9) {
*dst++ = 0xa3;
*dst++ = ch + 0xa0;
}
else if (ch <= A_Z) {
} else if(ch <= A_Z) {
*dst++ = 0xa3;
*dst++ = ch + 0xa7;
}
else if (ch <= A_z) {
} else if(ch <= A_z) {
*dst++ = 0xa3;
*dst++ = ch + 0xad;
}
else if (ch <= _NN) {
} else if(ch <= _NN) {
*dst++ = 0xa4;
*dst++ = ch + 0x53;
}
else if (ch <= _XKE) {
} else if(ch <= _XKE) {
*dst++ = 0xa5;
*dst++ = ch + 0x53;
}
else {
} else {
}
}

View file

@ -33,24 +33,21 @@
* $SonyDate: 1994/06/03 08:02:09 $
*/
#include "sj_kcnv.h"
#include "sj_yomi.h"
#include "sj_kanakan.h"
int
ph2knj(u_char *zyomi, u_char *kanji, int knjlen)
{
int ph2knj(u_char* zyomi, u_char* kanji, int knjlen) {
u_char* ptr;
u_char* dst;
int i;
for(ptr = zyomi, dst = hyomi, i = 0; *ptr;) {
if (i++ >= MAXPHINPUTLEN) { *kanji = 0; return 0; }
if(i++ >= MAXPHINPUTLEN) {
*kanji = 0;
return 0;
}
ptr += sj2cd_chr(ptr, dst++);
}
*dst = 0;
@ -109,5 +106,3 @@ ph2knj(u_char *zyomi, u_char *kanji, int knjlen)
return (inputyomi - zyomi);
}

View file

@ -38,8 +38,7 @@
#include "sj_kanakan.h"
static void
ph_setsty(CLREC *clrec)
{
ph_setsty(CLREC* clrec) {
JREC* jrec;
TypeDicOfs offset;
u_char* ptr;
@ -80,9 +79,7 @@ ph_setsty(CLREC *clrec)
}
}
int
ph_khtbl(CLREC *clrec)
{
int ph_khtbl(CLREC* clrec) {
JREC* jrec;
int flg = FALSE;
@ -104,8 +101,7 @@ ph_khtbl(CLREC *clrec)
if(jrec->jofsst) {
ph_setsty(clrec);
break;
}
else
} else
flg = TRUE;
case C_BUNSETU:
case C_MINASI:
@ -116,4 +112,3 @@ ph_khtbl(CLREC *clrec)
return flg;
}

View file

@ -33,8 +33,6 @@
* $SonyDate: 1994/06/03 08:02:10 $
*/
#include "sj_kcnv.h"
#include "sj_hinsi.h"
#include "sj_right.h"
@ -43,8 +41,7 @@
#include "sj_kanakan.h"
static int
isfukusi(TypeGram hinsi)
{
isfukusi(TypeGram hinsi) {
if(FUKUSI_1 <= hinsi && hinsi <= FUKUSI_7)
return TRUE;
else if(hinsi == MEISI_11 || hinsi == D_MEISI_6)
@ -53,8 +50,7 @@ isfukusi(TypeGram hinsi)
}
static int
istaigen(TypeCnct right)
{
istaigen(TypeCnct right) {
if(right == R_MEISI || right == R_DMEISI || right == R_SMEISI1)
return TRUE;
if(right == R_WO_MEISI || right == R_DAIMEISI || right == R_JOSUUSI)
@ -65,8 +61,7 @@ istaigen(TypeCnct right)
}
static int
taicnt(TypeGram hinsi1, TypeGram hinsi2)
{
taicnt(TypeGram hinsi1, TypeGram hinsi2) {
if(hinsi2 == TANKANJI) return 0;
if(MYOUJI <= hinsi1 && hinsi1 <= KEN_KU) {
@ -74,13 +69,11 @@ taicnt(TypeGram hinsi1, TypeGram hinsi2)
return Taipri(hinsi1 - MYOUJI, hinsi2);
else
return 3;
}
else if ((MEISI_1 <= hinsi1 && hinsi1 <= MEISI_11) ||
} else if((MEISI_1 <= hinsi1 && hinsi1 <= MEISI_11) ||
hinsi1 == D_MEISI_2) {
if(MEISI_1 <= hinsi2 && hinsi2 <= SETUBI_9) {
return Taipri(5, hinsi2);
}
else
} else
return 5;
}
@ -93,8 +86,7 @@ taicnt(TypeGram hinsi1, TypeGram hinsi2)
}
static int
sttcnt(TypeGram hinsi1, TypeGram hinsi2)
{
sttcnt(TypeGram hinsi1, TypeGram hinsi2) {
if(SETTOU_1 <= hinsi1 && hinsi1 <= SETTOU_5) {
if(MEISI_1 <= hinsi2 && hinsi2 <= SUUSI)
return Sttpri(hinsi1 - SETTOU_1, hinsi2);
@ -102,9 +94,7 @@ sttcnt(TypeGram hinsi1, TypeGram hinsi2)
return 4;
}
int
priority(CLREC *clrec)
{
int priority(CLREC* clrec) {
int prty;
CLREC* cl2rec;
int keeplen;
@ -119,7 +109,6 @@ priority(CLREC *clrec)
return (0xf0 + prty);
}
hinsi1 = clrec->jnode->hinsi;
if(prevclrow == R_WO || prevclrow == R_WO_S ||
@ -144,7 +133,6 @@ priority(CLREC *clrec)
prty = sttcnt(prevclgrm, hinsi1);
}
if(hinsi1 >= SETUBI_1 && hinsi1 <= SETUBI_9 && (!prev)) {
prty = 1;
goto finish;
@ -193,10 +181,8 @@ priority(CLREC *clrec)
goto finish;
}
prty = Termtbl[clrec->right];
if(prty & RENTAI) {
while(cl2rec && (int)cl2rec->cllen == keeplen) {
if(cl2rec->kubun == K_TAIGEN) {
@ -217,8 +203,7 @@ priority(CLREC *clrec)
if(cl2rec->kubun == K_DOUSHI) {
prty = 6;
goto finish;
}
else if (cl2rec->jnode->hinsi == SETUBI_1 ||
} else if(cl2rec->jnode->hinsi == SETUBI_1 ||
cl2rec->jnode->hinsi == SETUBI_2) {
prty = 7;
goto finish;
@ -229,7 +214,6 @@ priority(CLREC *clrec)
}
}
finish:
cl2rec = maxclptr;
@ -250,10 +234,7 @@ finish:
return (prty + prev);
}
void
pritiny()
{
void pritiny() {
CLREC* clrec;
int keeplen;
int i, prty = 0;
@ -288,4 +269,3 @@ pritiny()
}
}
}

View file

@ -33,8 +33,6 @@
* $SonyDate: 1994/06/03 08:02:11 $
*/
#include "sj_rename.h"
#include "sj_typedef.h"
@ -75,30 +73,176 @@ u_char taipri[7][45] = {
{0, 5, 6, 6, 6, 6, 5, 6, 6, 6,
6, 6, 3, 3, 3, 3, 3, 5, 0, 0,
0, 3, 3, 3, 3, 3, 5, 5, 5, 5,
4, 5, 5, 5, 5, 5, 5, 6, 6, 5, 5, 5, 5, 5, 5}
};
4, 5, 5, 5, 5, 5, 5, 6, 6, 5, 5, 5, 5, 5, 5}};
u_char sttpri[5][31] = {
{ 0, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 2, 4, 4, 4, 4, 4, 0, 0,
0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, },
{
0,
7,
7,
7,
7,
7,
7,
7,
7,
7,
7,
7,
2,
4,
4,
4,
4,
4,
0,
0,
0,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
},
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 0, 0,
0, 4, 4, 4, 10, 10, 4, 4, 4, 4, 4, },
{
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
0,
0,
0,
4,
4,
4,
10,
10,
4,
4,
4,
4,
4,
},
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 0, 0,
0, 10, 10, 4, 4, 4, 4, 4, 4, 4, 4, },
{
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
0,
0,
0,
10,
10,
4,
4,
4,
4,
4,
4,
4,
4,
},
{ 0, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 0, 0,
0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 15, },
{
0,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
0,
0,
0,
4,
4,
4,
4,
4,
4,
4,
4,
4,
15,
},
{ 0, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 9, 9, 9, 9, 9, 9, 0, 0,
0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, }
};
{
0,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
9,
9,
9,
9,
9,
9,
0,
0,
0,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
}};

View file

@ -33,8 +33,6 @@
* $SonyDate: 1995/07/21 05:22:51 $
*/
#include "sj_rename.h"
#include "sj_typedef.h"
#include "sj_yomi.h"
@ -149,5 +147,4 @@ u_char kigou[] = {
Y_KIGOU,
Y_KIGOU,
Y_KIGOU,
Y_KIGOU
};
Y_KIGOU};

View file

@ -64,8 +64,7 @@ DictFile *dictlink = NULL;
StdyFile* stdylink = NULL;
static long
get4byte(u_char *p)
{
get4byte(u_char* p) {
long i;
i = *p;
@ -74,90 +73,84 @@ get4byte(u_char *p)
return ((i << 8) + *++p);
}
static void
Put4byte(u_char *p, long n)
{
Put4byte(u_char* p, long n) {
p += 3;
*p-- = n; n >>= 8;
*p-- = n; n >>= 8;
*p-- = n; n >>= 8;
*p-- = n;
n >>= 8;
*p-- = n;
n >>= 8;
*p-- = n;
n >>= 8;
*p = n;
}
#define put4byte(p, n) Put4byte((p), (long)(n))
static int
fgetfile(FILE *fp, long pos, long len, u_char *p)
{
fgetfile(FILE* fp, long pos, long len, u_char* p) {
if(fseek(fp, pos, 0) == ERROR) {
serv_errno = SJ3_FileSeekError; return ERROR;
serv_errno = SJ3_FileSeekError;
return ERROR;
}
if(fread(p, len, 1, fp) != 1) {
serv_errno = SJ3_FileReadError; return ERROR;
serv_errno = SJ3_FileReadError;
return ERROR;
}
return SJ3_NormalEnd;
}
static int
fputfile(FILE *fp, long pos, int len, u_char *p)
{
fputfile(FILE* fp, long pos, int len, u_char* p) {
if(fseek(fp, pos, 0) == ERROR) {
serv_errno = SJ3_FileSeekError; return ERROR;
serv_errno = SJ3_FileSeekError;
return ERROR;
}
if(fwrite(p, len, 1, fp) != 1) {
serv_errno = SJ3_FileWriteError; return ERROR;
serv_errno = SJ3_FileWriteError;
return ERROR;
}
return SJ3_NormalEnd;
}
static int
getfile(int fd, int pos, int len, u_char *p)
{
getfile(int fd, int pos, int len, u_char* p) {
if(lseek(fd, pos, L_SET) == ERROR) {
serv_errno = SJ3_FileSeekError; return ERROR;
serv_errno = SJ3_FileSeekError;
return ERROR;
}
if(read(fd, p, len) != len) {
serv_errno = SJ3_FileReadError; return ERROR;
serv_errno = SJ3_FileReadError;
return ERROR;
}
return SJ3_NormalEnd;
}
static int
putfile(int fd, int pos, int len, u_char *p)
{
putfile(int fd, int pos, int len, u_char* p) {
if(lseek(fd, pos, L_SET) == ERROR) {
serv_errno = SJ3_FileSeekError; return ERROR;
serv_errno = SJ3_FileSeekError;
return ERROR;
}
if(write(fd, p, len) != len) {
serv_errno = SJ3_FileWriteError; return ERROR;
serv_errno = SJ3_FileWriteError;
return ERROR;
}
return SJ3_NormalEnd;
}
static int
check_passwd(u_char *buf, char *passwd)
{
check_passwd(u_char* buf, char* passwd) {
buf += PASSWDPOS;
return (*buf && strncmp(passwd, buf, PASSWDLEN)) ? FALSE : TRUE;
}
static void
set_passwd(u_char *buf, char *passwd)
{
set_passwd(u_char* buf, char* passwd) {
strncpy(buf + PASSWDPOS, passwd, PASSWDLEN);
}
static int
check_dictfile(u_char *buf)
{
check_dictfile(u_char* buf) {
return (DICTVERSION != get4byte(buf + VERSIONPOS)) ? FALSE : TRUE;
}
static DictFile*
search_same_dict(ino_t ino)
{
search_same_dict(ino_t ino) {
DictFile* p;
for(p = dictlink; p != NULL; p = p->link)
@ -166,37 +159,30 @@ search_same_dict(ino_t ino)
return NULL;
}
static int
getofs(DictFile *dp)
{
getofs(DictFile* dp) {
idxofs = dp->ofsptr;
return 0;
}
static int
getidx(DictFile *dp)
{
getidx(DictFile* dp) {
idxbuf = dp->buffer + dp->idxstrt;
return 0;
}
/* XXX: not IFunc */
static int
getdic(DictFile *dp, TypeDicSeg seg)
{
getdic(DictFile* dp, TypeDicSeg seg) {
if(seg >= dp->dict.segunit) return -1;
dicbuf = dp->buffer + dp->segstrt + dp->dict.seglen * seg;
return 0;
}
static int
putidx(DictFile *dp)
{
putidx(DictFile* dp) {
return putfile(dp->fd, dp->idxstrt, dp->dict.idxlen, idxbuf);
}
/* XXX: not IFunc */
static int
putdic(DictFile *dp, TypeDicSeg seg)
{
putdic(DictFile* dp, TypeDicSeg seg) {
u_char* p;
long i, j;
@ -224,8 +210,7 @@ putdic(DictFile *dp, TypeDicSeg seg)
}
/* XXX: not IFunc */
static int
rszdic(DictFile *dp, TypeDicSeg seg)
{
rszdic(DictFile* dp, TypeDicSeg seg) {
long i;
u_char* p;
@ -249,11 +234,8 @@ rszdic(DictFile *dp, TypeDicSeg seg)
return putfile(dp->fd, 0, HEADERLENGTH, dp->buffer);
}
DictFile*
opendict(char *name, char *passwd)
{
opendict(char* name, char* passwd) {
FILE* fp;
struct stat sbuf;
DictFile* dfp;
@ -270,33 +252,38 @@ opendict(char *name, char *passwd)
}
if((dfp = search_same_dict(sbuf.st_ino)) != NULL) {
dfp -> refcnt++; return dfp;
dfp->refcnt++;
return dfp;
}
if((fp = fopen(name, "r+")) == NULL) {
if((fp = fopen(name, "r")) == NULL) {
serv_errno = SJ3_CannotOpenFile; return NULL;
serv_errno = SJ3_CannotOpenFile;
return NULL;
}
i = FALSE;
}
else
} else
i = TRUE;
if(fgetfile(fp, 0L, sizeof(tmp), tmp) == ERROR) goto error1;
if(!check_dictfile(tmp)) {
serv_errno = SJ3_IllegalDictFile; goto error1;
serv_errno = SJ3_IllegalDictFile;
goto error1;
}
if(!check_passwd(tmp, passwd)) {
serv_errno = SJ3_IncorrectPasswd; goto error1;
serv_errno = SJ3_IncorrectPasswd;
goto error1;
}
if((dp = (u_char*)malloc((long)sbuf.st_size)) == NULL) {
serv_errno = SJ3_NotEnoughMemory; goto error1;
serv_errno = SJ3_NotEnoughMemory;
goto error1;
}
if((dfp = (DictFile*)malloc(sizeof(*dfp))) == NULL) {
serv_errno = SJ3_NotEnoughMemory; goto error2;
serv_errno = SJ3_NotEnoughMemory;
goto error2;
}
memset(dfp, '\0', sizeof(*dfp));
@ -325,7 +312,8 @@ opendict(char *name, char *passwd)
if(i < dfp->dict.maxunit) i = dfp->dict.maxunit;
i *= sizeof(TypeIdxOfs);
if((dfp->ofsptr = (TypeIdxOfs*)malloc(i)) == NULL) {
serv_errno = SJ3_NotEnoughMemory; goto error3;
serv_errno = SJ3_NotEnoughMemory;
goto error3;
}
mkidxtbl(&(dfp->dict));
@ -334,19 +322,17 @@ opendict(char *name, char *passwd)
return dfp;
error3: free((char *)dfp);
error2: free((char *)dp);
error1: fclose(fp);
error3:
free((char*)dfp);
error2:
free((char*)dp);
error1:
fclose(fp);
return NULL;
}
int
closedict(DictFile *dfp)
{
int closedict(DictFile* dfp) {
DictFile* df;
if(--dfp->refcnt > 0) return 0;
@ -374,24 +360,19 @@ closedict(DictFile *dfp)
static fd_set zero_fd_set; /* XXX */
#endif
void
lock_dict(DictFile *p, int fd)
{
void lock_dict(DictFile* p, int fd) {
#ifdef SJ3_LOCK
FD_SET(fd, &(p->lock));
#endif
}
void
unlock_dict(DictFile *p, int fd)
{
void unlock_dict(DictFile* p, int fd) {
#ifdef SJ3_LOCK
FD_CLR(fd, &(p->lock));
#endif
}
int is_dict_locked(DictFile *p)
{
int is_dict_locked(DictFile* p) {
#ifdef SJ3_LOCK
return memcmp(&(p->lock), &zero_fd_set, sizeof(zero_fd_set));
#else
@ -400,14 +381,12 @@ int is_dict_locked(DictFile *p)
}
static int
check_stdyfile(u_char *buf)
{
check_stdyfile(u_char* buf) {
return (STDYVERSION != get4byte(buf + VERSIONPOS)) ? FALSE : TRUE;
}
static StdyFile*
search_same_stdy(ino_t ino)
{
search_same_stdy(ino_t ino) {
StdyFile* p;
for(p = stdylink; p != NULL; p = p->link)
@ -417,8 +396,7 @@ search_same_stdy(ino_t ino)
}
StdyFile*
openstdy(char *name, char *passwd)
{
openstdy(char* name, char* passwd) {
FILE* fp;
struct stat sbuf;
StdyFile* sfp;
@ -440,26 +418,31 @@ openstdy(char *name, char *passwd)
}
if((sfp = search_same_stdy(sbuf.st_ino)) != NULL) {
sfp -> refcnt++; return sfp;
sfp->refcnt++;
return sfp;
}
if((hd = (u_char*)malloc(HEADERLENGTH + COMMENTLENGTH)) == NULL) {
serv_errno = SJ3_NotEnoughMemory; return NULL;
serv_errno = SJ3_NotEnoughMemory;
return NULL;
}
if((fp = fopen(name, "r+")) == NULL) {
serv_errno = SJ3_CannotOpenFile; goto error0;
serv_errno = SJ3_CannotOpenFile;
goto error0;
}
if(fgetfile(fp, 0L, HEADERLENGTH + COMMENTLENGTH, hd) == ERROR)
goto error1;
if(!check_stdyfile(hd)) {
serv_errno = SJ3_IllegalStdyFile; goto error1;
serv_errno = SJ3_IllegalStdyFile;
goto error1;
}
if(!check_passwd(hd, passwd)) {
serv_errno = SJ3_IncorrectPasswd; goto error1;
serv_errno = SJ3_IncorrectPasswd;
goto error1;
}
stdycnt = get4byte(hd + STDYNORMCNT);
@ -474,17 +457,21 @@ openstdy(char *name, char *passwd)
len = sizeof(STDYIN) * stdymax;
if((sfp = (StdyFile*)malloc(sizeof(*sfp))) == NULL) {
serv_errno = SJ3_NotEnoughMemory; goto error1;
serv_errno = SJ3_NotEnoughMemory;
goto error1;
}
memset(sfp, '\0', sizeof(*sfp));
if((sp = (STDYIN*)malloc(len)) == NULL) {
serv_errno = SJ3_NotEnoughMemory; goto error2;
serv_errno = SJ3_NotEnoughMemory;
goto error2;
}
if((cip = (u_short*)malloc(clidxlen)) == NULL) {
serv_errno = SJ3_NotEnoughMemory; goto error3;
serv_errno = SJ3_NotEnoughMemory;
goto error3;
}
if((clp = (u_char*)malloc(clstdylen)) == NULL) {
serv_errno = SJ3_NotEnoughMemory; goto error4;
serv_errno = SJ3_NotEnoughMemory;
goto error4;
}
if(fgetfile(fp, clidxpos, clidxlen, (u_char*)cip) == ERROR) goto error5; /* XXX */
@ -509,19 +496,23 @@ openstdy(char *name, char *passwd)
return sfp;
error5: free((char *)clp);
error4: free((char *)cip);
error3: free((char *)sp);
error2: free((char *)sfp);
error1: fclose(fp);
error0: free((char *)hd);
error5:
free((char*)clp);
error4:
free((char*)cip);
error3:
free((char*)sp);
error2:
free((char*)sfp);
error1:
fclose(fp);
error0:
free((char*)hd);
return NULL;
}
int
closestdy(StdyFile *sfp)
{
int closestdy(StdyFile* sfp) {
StdyFile* sf;
if(--sfp->refcnt > 0) return 0;
@ -547,11 +538,7 @@ closestdy(StdyFile *sfp)
return 0;
}
int
putstydic()
{
int putstydic() {
int fd;
u_char* hd;
StdyFile* sf;
@ -571,9 +558,7 @@ putstydic()
return putfile(fd, get4byte(hd + STDYNORMPOS), len, (u_char*)sf->stdy.stdydic);
}
int
putcldic()
{
int putcldic() {
int fd;
u_char* hd;
StdyFile* sf;
@ -589,9 +574,7 @@ putcldic()
get4byte(hd + STDYCLSEGLEN), sf->stdy.clstdydic);
}
int
makedict(char *path, int idxlen, int seglen, int segnum)
{
int makedict(char* path, int idxlen, int seglen, int segnum) {
FILE* fp;
u_char tmp[HEADERLENGTH + COMMENTLENGTH];
long pos = HEADERLENGTH + COMMENTLENGTH;
@ -599,11 +582,13 @@ makedict(char *path, int idxlen, int seglen, int segnum)
int i;
if(idxlen < MINIDXLEN || seglen < MINSEGLEN || segnum < MINSEGNUM) {
serv_errno = SJ3_IllegalParameter; return ret;
serv_errno = SJ3_IllegalParameter;
return ret;
}
if(!(fp = fopen(path, "w"))) {
serv_errno = SJ3_CannotCreateFile; return ret;
serv_errno = SJ3_CannotCreateFile;
return ret;
}
memset(tmp, '\0', sizeof(tmp));
put4byte(tmp + VERSIONPOS, DICTVERSION);
@ -611,11 +596,13 @@ makedict(char *path, int idxlen, int seglen, int segnum)
put4byte(tmp + DICTIDXPOS, pos);
put4byte(tmp + DICTIDXLEN, idxlen);
if(fseek(fp, pos, 0) == ERROR) {
serv_errno = SJ3_FileSeekError; goto error;
serv_errno = SJ3_FileSeekError;
goto error;
}
for(i = 0; i < idxlen; i++)
if(putc(0, fp)) {
serv_errno = SJ3_FileWriteError; goto error;
serv_errno = SJ3_FileWriteError;
goto error;
}
pos += idxlen;
@ -624,14 +611,17 @@ makedict(char *path, int idxlen, int seglen, int segnum)
put4byte(tmp + DICTSEGNUM, 1);
put4byte(tmp + DICTSEGMAX, segnum);
if(fseek(fp, pos, 0) == ERROR) {
serv_errno = SJ3_FileSeekError; goto error;
serv_errno = SJ3_FileSeekError;
goto error;
}
if(putc(0, fp)) {
serv_errno = SJ3_FileWriteError; goto error;
serv_errno = SJ3_FileWriteError;
goto error;
}
for(i = 1; i < seglen; i++)
if(putc(0xff, fp) != 0xff) {
serv_errno = SJ3_FileWriteError; goto error;
serv_errno = SJ3_FileWriteError;
goto error;
}
if(fputfile(fp, 0L, sizeof(tmp), tmp) == SJ3_NormalEnd)
@ -642,9 +632,7 @@ error:
return ret;
}
int
makestdy(char *path, int stynum, int clstep, int cllen)
{
int makestdy(char* path, int stynum, int clstep, int cllen) {
FILE* fp;
u_char tmp[HEADERLENGTH + COMMENTLENGTH];
long pos = HEADERLENGTH + COMMENTLENGTH;
@ -656,14 +644,17 @@ makestdy(char *path, int stynum, int clstep, int cllen)
if(cllen == 0) cllen = MINCLLEN;
if(stynum < MINSTYNUM || clstep < MINCLSTEP || cllen < MINCLLEN) {
serv_errno = SJ3_IllegalParameter; return ret;
serv_errno = SJ3_IllegalParameter;
return ret;
}
if(stynum > MAXSTYNUM || clstep > MAXCLSTEP || cllen > MAXCLLEN) {
serv_errno = SJ3_IllegalParameter; return ret;
serv_errno = SJ3_IllegalParameter;
return ret;
}
if(!(fp = fopen(path, "w"))) {
serv_errno = SJ3_CannotCreateFile; return ret;
serv_errno = SJ3_CannotCreateFile;
return ret;
}
memset(tmp, '\0', sizeof(tmp));
put4byte(tmp + VERSIONPOS, STDYVERSION);
@ -673,22 +664,26 @@ makestdy(char *path, int stynum, int clstep, int cllen)
put4byte(tmp + STDYCLIDXLEN, j);
put4byte(tmp + STDYCLIDXSTEP, clstep);
if(fseek(fp, pos, 0) == ERROR) {
serv_errno = SJ3_FileSeekError; goto error;
serv_errno = SJ3_FileSeekError;
goto error;
}
for(i = 0; i < j; i++)
if(putc(0, fp)) {
serv_errno = SJ3_FileWriteError; goto error;
serv_errno = SJ3_FileWriteError;
goto error;
}
pos += j;
put4byte(tmp + STDYCLSEGPOS, pos);
put4byte(tmp + STDYCLSEGLEN, cllen);
if(fseek(fp, pos, 0) == ERROR) {
serv_errno = SJ3_FileSeekError; goto error;
serv_errno = SJ3_FileSeekError;
goto error;
}
for(i = 0; i < cllen; i++)
if(putc(0, fp)) {
serv_errno = SJ3_FileWriteError; goto error;
serv_errno = SJ3_FileWriteError;
goto error;
}
pos += cllen;
@ -698,11 +693,13 @@ makestdy(char *path, int stynum, int clstep, int cllen)
put4byte(tmp + STDYNORMNUM, stynum);
put4byte(tmp + STDYNORMCNT, 0);
if(fseek(fp, pos, 0) == ERROR) {
serv_errno = SJ3_FileSeekError; goto error;
serv_errno = SJ3_FileSeekError;
goto error;
}
for(i = 0; i < j; i++) {
if(putc(0, fp)) {
serv_errno = SJ3_FileWriteError; goto error;
serv_errno = SJ3_FileWriteError;
goto error;
}
}
pos += j;
@ -715,23 +712,17 @@ error:
return ret;
}
void
sj_closeall()
{
void sj_closeall() {
while(dictlink) closedict(dictlink);
while(stdylink) closestdy(stdylink);
}
int
set_dictpass(DictFile *dp, char *pass)
{
int set_dictpass(DictFile* dp, char* pass) {
set_passwd(dp->buffer, pass);
return putfile(dp->fd, 0, HEADERLENGTH + COMMENTLENGTH, dp->buffer);
}
int
set_stdypass(char *pass)
{
int set_stdypass(char* pass) {
StdyFile* sp;
sp = (StdyFile*)stdy_base;
@ -739,23 +730,17 @@ set_stdypass(char *pass)
return putfile(sp->fd, 0, HEADERLENGTH + COMMENTLENGTH, sp->header);
}
static
void
set_comment(u_char *buf, char *comment)
{
static void
set_comment(u_char* buf, char* comment) {
strlcpy(buf + HEADERLENGTH, comment, COMMENTLENGTH);
}
int
set_dictcmnt(DictFile *dp, char *cmnt)
{
int set_dictcmnt(DictFile* dp, char* cmnt) {
set_comment(dp->buffer, cmnt);
return putfile(dp->fd, 0, HEADERLENGTH + COMMENTLENGTH, dp->buffer);
}
int
set_stdycmnt(char *cmnt)
{
int set_stdycmnt(char* cmnt) {
StdyFile* sp;
sp = (StdyFile*)stdy_base;
@ -763,9 +748,7 @@ set_stdycmnt(char *cmnt)
return putfile(sp->fd, 0, HEADERLENGTH + COMMENTLENGTH, sp->header);
}
int
get_stdysize(int *stynum, int *clstep, int *cllen)
{
int get_stdysize(int* stynum, int* clstep, int* cllen) {
*stynum = STUDYMAX;
*clstep = CLSTUDYSTEP;
*cllen = CLSTUDYLEN;

View file

@ -36,9 +36,7 @@
#include "sj_kcnv.h"
#include "sj_kanakan.h"
void
selclrec()
{
void selclrec() {
int len;
CLREC* rec;
@ -99,6 +97,8 @@ selclrec()
*(cnvstart + len) = ch;
}
free_clall(clt2nd); clt2nd = NULL;
free_jall(jrt2nd); jrt2nd = NULL;
free_clall(clt2nd);
clt2nd = NULL;
free_jall(jrt2nd);
jrt2nd = NULL;
}

View file

@ -46,8 +46,7 @@ static u_short selsjAR[] = {
SELKANSJYM | JFLAG_NN0,
SELKANSJYM2 | SELNUM1_23_10_1 | JFLAG_NN0,
SELKANSJ0 | JFLAG_NK2,
SELNUMTERM
};
SELNUMTERM};
static u_short selsjARCM[] = {
SELARBCMA | JFLAG_NK4 | JFLAG_NN0,
@ -55,8 +54,7 @@ static u_short selsjARCM[] = {
SELKANSJYM | JFLAG_NN0,
SELKANSJYM2 | SELNUM1_23_10_1 | JFLAG_NN0,
SELKANSJ0 | JFLAG_NK2,
SELNUMTERM
};
SELNUMTERM};
static u_short selsjKAZU[] = {
SELKANSJYM | JFLAG_NN0,
@ -64,50 +62,41 @@ static u_short selsjKAZU[] = {
SELKANSJ0 | JFLAG_NK2,
SELARB0,
SELARBCMA | JFLAG_NK4 | JFLAG_NN0,
SELNUMTERM
};
SELNUMTERM};
static u_short selsjSUUJI[] = {
SELKANSJ0,
SELARB0,
SELNUMTERM
};
SELNUMTERM};
static u_short selsjNANSUU[] = {
SELKANSJYM,
SELNUMTERM
};
SELNUMTERM};
static u_short selsjAR17[] = {
SELLONGARB,
SELLONGARBCMA,
SELNUMTERM
};
SELNUMTERM};
static u_short selsjAR17CM[] = {
SELLONGARBCMA,
SELLONGARB,
SELNUMTERM
};
SELNUMTERM};
static u_short selsjAR17SJ[] = {
SELLONGARB,
SELLONGSJ,
SELNUMTERM
};
SELNUMTERM};
static u_short selsjKANKURA[] = {
SELKANSJKR,
SELARBKR,
SELNUMTERM
};
SELNUMTERM};
static u_short selsjARAKURA[] = {
SELARBKR,
SELKANSJKR | JFLAG_NSN,
SELNUMTERM
};
SELNUMTERM};
u_short* selsjadrs[] = {
selsjAR,
@ -119,5 +108,4 @@ u_short *selsjadrs[] = {
selsjARAKURA,
selsjAR17,
selsjAR17CM,
selsjAR17SJ
};
selsjAR17SJ};

View file

@ -33,8 +33,6 @@
* $SonyDate: 1994/06/03 08:02:16 $
*/
#include "sj_kcnv.h"
#include "sj_right.h"
#include "sj_hinsi.h"
@ -43,8 +41,7 @@
#include "sj_kanakan.h"
static int
cnjstrcmp(u_char *yptr, u_char *cnjp, int *saml)
{
cnjstrcmp(u_char* yptr, u_char* cnjp, int* saml) {
int asklen;
int nkrlen;
@ -79,8 +76,7 @@ cnjstrcmp(u_char *yptr, u_char *cnjp, int *saml)
}
static TypeCnct
cnvrow(JREC *rec, TypeCnct row)
{
cnvrow(JREC* rec, TypeCnct row) {
TypeGram hinsi;
int stt;
@ -111,9 +107,7 @@ cnvrow(JREC *rec, TypeCnct row)
return row;
}
int
setconj(TypeGram hinsi, JREC *jrec, CREC *crec)
{
int setconj(TypeGram hinsi, JREC* jrec, CREC* crec) {
u_char* yptr;
int cmp;
TypeCnct right;
@ -156,4 +150,3 @@ setconj(TypeGram hinsi, JREC *jrec, CREC *crec)
return count;
}

View file

@ -39,15 +39,11 @@
#include "sj_kanakan.h"
int
setj_atrb(u_char *p)
{
int setj_atrb(u_char* p) {
return 2;
}
int
setj_ofs(u_char *p)
{
int setj_ofs(u_char* p) {
int contf = TRUE;
p = dicbuf + ((*p & KANJICODEMASK) << 8) + *(p + 1);
@ -56,25 +52,32 @@ setj_ofs(u_char *p)
if(p[codesize(*p)] == KANJISTREND) contf = FALSE;
switch(*p & KANJIMODEMASK) {
case ZENHIRAASSYUKU:
p += setj_norm1(p); break;
p += setj_norm1(p);
break;
case ZENKATAASSYUKU:
p += setj_norm1(p); break;
p += setj_norm1(p);
break;
case OFFSETASSYUKU:
p += setj_ofs(p); break;
p += setj_ofs(p);
break;
case AIATTRIBUTE:
p += setj_atrb(p); break;
p += setj_atrb(p);
break;
case LEADINGHANKAKU:
p += setj_norm2(p); break;
p += setj_norm2(p);
break;
case KANJIASSYUKU:
p += setj_knj(p); break;
p += setj_knj(p);
break;
case KANJISTREND:
contf = FALSE; break;
contf = FALSE;
break;
default:
p += setj_norm2(p);
@ -84,9 +87,7 @@ setj_ofs(u_char *p)
return 2;
}
int
setj_knj(u_char *p)
{
int setj_knj(u_char* p) {
int contf = TRUE;
p = askknj[*p & KNJASSYUKUMASK];
@ -95,25 +96,32 @@ setj_knj(u_char *p)
if(p[codesize(*p)] == KANJISTREND) contf = FALSE;
switch(*p & KANJIMODEMASK) {
case ZENHIRAASSYUKU:
p += setj_norm1(p); break;
p += setj_norm1(p);
break;
case ZENKATAASSYUKU:
p += setj_norm1(p); break;
p += setj_norm1(p);
break;
case OFFSETASSYUKU:
p += setj_ofs(p); break;
p += setj_ofs(p);
break;
case AIATTRIBUTE:
p += setj_atrb(p); break;
p += setj_atrb(p);
break;
case LEADINGHANKAKU:
p += setj_norm2(p); break;
p += setj_norm2(p);
break;
case KANJIASSYUKU:
p += setj_knj(p); break;
p += setj_knj(p);
break;
case KANJISTREND:
contf = FALSE; break;
contf = FALSE;
break;
default:
p += setj_norm2(p);
@ -123,33 +131,20 @@ setj_knj(u_char *p)
return 1;
}
int
setj_norm1(u_char *p)
{
int setj_norm1(u_char* p) {
return 1;
}
int
setj_norm2(u_char *p)
{
int setj_norm2(u_char* p) {
return 2;
}
int
setj_norm3(u_char *p)
{
int setj_norm3(u_char* p) {
return 3;
}
static u_char
chkhead(TypeGram gram)
{
chkhead(TypeGram gram) {
if(!headcode) return TRUE;
if(headcode == SETTOU_DAI) {
@ -167,11 +162,7 @@ chkhead(TypeGram gram)
return FALSE;
}
void
setjrec(u_char *tagp, int mode)
{
void setjrec(u_char* tagp, int mode) {
TypeGram gram;
u_char* ptr;
u_char* endp;
@ -196,25 +187,32 @@ setjrec(u_char *tagp, int mode)
for(tmp = ptr + 1; *tmp != HINSIBLKTERM;) {
switch(*tmp & KANJIMODEMASK) {
case ZENHIRAASSYUKU:
tmp += setj_norm1(tmp); break;
tmp += setj_norm1(tmp);
break;
case ZENKATAASSYUKU:
tmp += setj_norm1(tmp); break;
tmp += setj_norm1(tmp);
break;
case OFFSETASSYUKU:
tmp += setj_ofs(tmp); break;
tmp += setj_ofs(tmp);
break;
case AIATTRIBUTE:
tmp += setj_atrb(tmp); break;
tmp += setj_atrb(tmp);
break;
case LEADINGHANKAKU:
tmp += setj_norm2(tmp); break;
tmp += setj_norm2(tmp);
break;
case KANJIASSYUKU:
tmp += setj_knj(tmp); break;
tmp += setj_knj(tmp);
break;
case KANJISTREND:
tmp++; break;
tmp++;
break;
default:
tmp += setj_norm2(tmp);
@ -237,11 +235,7 @@ setjrec(u_char *tagp, int mode)
}
}
void
setnumrec(u_char *tagp, JREC *rec, TypeGram gram)
{
void setnumrec(u_char* tagp, JREC* rec, TypeGram gram) {
u_char* ptr;
u_char* endp;
u_char* tmp;
@ -261,25 +255,32 @@ setnumrec(u_char *tagp, JREC *rec, TypeGram gram)
for(tmp = ptr + 1; *tmp != HINSIBLKTERM;) {
switch(*tmp & KANJIMODEMASK) {
case ZENHIRAASSYUKU:
tmp += setj_norm1(tmp); break;
tmp += setj_norm1(tmp);
break;
case ZENKATAASSYUKU:
tmp += setj_norm1(tmp); break;
tmp += setj_norm1(tmp);
break;
case OFFSETASSYUKU:
tmp += setj_ofs(tmp); break;
tmp += setj_ofs(tmp);
break;
case AIATTRIBUTE:
tmp += setj_atrb(tmp); break;
tmp += setj_atrb(tmp);
break;
case LEADINGHANKAKU:
tmp += setj_norm2(tmp); break;
tmp += setj_norm2(tmp);
break;
case KANJIASSYUKU:
tmp += setj_knj(tmp); break;
tmp += setj_knj(tmp);
break;
case KANJISTREND:
tmp++; break;
tmp++;
break;
default:
tmp += setj_norm2(tmp);
@ -297,11 +298,7 @@ setnumrec(u_char *tagp, JREC *rec, TypeGram gram)
}
}
void
setcrec(u_char *tagp)
{
void setcrec(u_char* tagp) {
JREC* rec;
if(!(rec = argjrec((int)ClYomiLen(tagp), (JREC*)NULL))) return;

View file

@ -41,9 +41,7 @@
static int hiraknj();
void
setkouho(CLREC *clrec, TypeDicOfs offs, int mode)
{
void setkouho(CLREC* clrec, TypeDicOfs offs, int mode) {
JREC* jrec;
KHREC* kptr;
u_char* fptr;
@ -68,13 +66,11 @@ setkouho(CLREC *clrec, TypeDicOfs offs, int mode)
kptr->ka_fg = 1;
kptr->ka_kj = 1;
flg = 1;
}
else if (clrec -> fzk_ka) {
} else if(clrec->fzk_ka) {
kptr->ka_fg = 1;
kptr->ka_kj = 0;
flg = 2;
}
else {
} else {
kptr->ka_fg = 0;
kptr->ka_kj = 0;
flg = 0;
@ -109,17 +105,20 @@ setkouho(CLREC *clrec, TypeDicOfs offs, int mode)
kptr->sttkj = 1;
switch(flg) {
case 1: kptr -> ka_fg = kptr -> ka_kj = 1; break;
case 2: kptr -> ka_fg = 1; kptr -> ka_kj = 0; break;
default: kptr -> ka_fg = kptr -> ka_kj = 0; break;
case 1:
kptr->ka_fg = kptr->ka_kj = 1;
break;
case 2:
kptr->ka_fg = 1;
kptr->ka_kj = 0;
break;
default:
kptr->ka_fg = kptr->ka_kj = 0;
break;
}
}
void
ph_setkouho(CLREC *clrec, TypeDicOfs offs, STDYIN *sptr)
{
void ph_setkouho(CLREC* clrec, TypeDicOfs offs, STDYIN* sptr) {
JREC* jrec;
u_char* p;
@ -127,8 +126,7 @@ ph_setkouho(CLREC *clrec, TypeDicOfs offs, STDYIN *sptr)
stdytop = sptr;
kouhotbl[0].styno = sptr->styno;
kouhotbl[0].sttkj = sptr->sttkj;
}
else {
} else {
kouhotbl[0].styno = -1;
kouhotbl[0].sttkj = 0;
}
@ -139,18 +137,15 @@ ph_setkouho(CLREC *clrec, TypeDicOfs offs, STDYIN *sptr)
kouhotbl[0].mode = sel_sjmode(jrec = clrec->jnode);
kouhotbl[0].sttfg = (u_char)
((p = Settou_ptr(jrec->sttofs)) ? (SttHiraKnj(p)?1:0) : 0);
kouhotbl[0].sttfg = (u_char)((p = Settou_ptr(jrec->sttofs)) ? (SttHiraKnj(p) ? 1 : 0) : 0);
if(jrec->flags & JFLAG_KA) {
kouhotbl[0].ka_fg =
kouhotbl[0].ka_kj = 1;
}
else if (clrec -> fzk_ka) {
} else if(clrec->fzk_ka) {
kouhotbl[0].ka_fg = 1;
kouhotbl[0].ka_kj = 0;
}
else {
} else {
kouhotbl[0].ka_fg =
kouhotbl[0].ka_kj = 0;
}
@ -158,11 +153,8 @@ ph_setkouho(CLREC *clrec, TypeDicOfs offs, STDYIN *sptr)
khcount = 1;
}
static int
hiraknj(u_char *p)
{
hiraknj(u_char* p) {
char flg = TRUE;
int i;
int result;
@ -171,22 +163,28 @@ hiraknj(u_char *p)
if(p[codesize(*p)] == KANJISTREND) flg = FALSE;
switch(*p & KANJIMODEMASK) {
case ZENHIRAASSYUKU:
result = hiraknj_hask(p, &i); break;
result = hiraknj_hask(p, &i);
break;
case ZENKATAASSYUKU:
result = hiraknj_kask(p, &i); break;
result = hiraknj_kask(p, &i);
break;
case OFFSETASSYUKU:
result = hiraknj_ofs(p, &i); break;
result = hiraknj_ofs(p, &i);
break;
case AIATTRIBUTE:
result = hiraknj_atrb(p, &i); break;
result = hiraknj_atrb(p, &i);
break;
case LEADINGHANKAKU:
result = hiraknj_norm(p, &i); break;
result = hiraknj_norm(p, &i);
break;
case KANJIASSYUKU:
result = hiraknj_knj(p, &i); break;
result = hiraknj_knj(p, &i);
break;
default:
result = hiraknj_hira(p, &i);
@ -200,64 +198,37 @@ hiraknj(u_char *p)
return 0;
}
int
hiraknj_atrb(u_char *p, int *len)
{
int hiraknj_atrb(u_char* p, int* len) {
*len = 2;
return 0;
}
int
hiraknj_ofs(u_char *p, int *len)
{
int hiraknj_ofs(u_char* p, int* len) {
*len = 2;
return hiraknj(dicbuf + ((*p & KANJICODEMASK) << 8) + *(p + 1));
}
int
hiraknj_knj(u_char *p, int *len)
{
int hiraknj_knj(u_char* p, int* len) {
*len = 1;
return hiraknj(askknj[*p & KNJASSYUKUMASK]);
}
int
hiraknj_hask(u_char *p, int *len)
{
int hiraknj_hask(u_char* p, int* len) {
*len = 1;
return 2;
}
int
hiraknj_kask(u_char *p, int *len)
{
int hiraknj_kask(u_char* p, int* len) {
*len = 1;
return 3;
}
int hiraknj_norm(u_char *p, int *len)
{
int hiraknj_norm(u_char* p, int* len) {
*len = codesize(*p);
return 1;
}
int
hiraknj_hira(u_char *p, int *len)
{
int hiraknj_hira(u_char* p, int* len) {
u_char ch;
*len = codesize(*p);

View file

@ -33,25 +33,19 @@
* $SonyDate: 1994/06/03 08:02:22 $
*/
#include "sj_kcnv.h"
#include "sj_hinsi.h"
#include "sj_kanakan.h"
u_char*
getstb(TypeGram hinsi)
{
getstb(TypeGram hinsi) {
if(hinsi < MEISI_1 || hinsi > TIMEI) return NULL;
return Stbadr(hinsi);
}
void
setubi(JREC *rec, u_char *stbtbl)
{
void setubi(JREC* rec, u_char* stbtbl) {
u_char* stb;
u_char* yptr;
u_char* sptr;
@ -80,4 +74,3 @@ setubi(JREC *rec, u_char *stbtbl)
new->flags |= StbBakeru(stb) ? JFLAG_KA : 0;
}
}

View file

@ -33,18 +33,13 @@
* $SonyDate: 1995/07/21 05:22:51 $
*/
#include "sj_euc.h"
#include "sj_kcnv.h"
#include "sj_yomi.h"
#include "sj_kanakan.h"
int
sj2cd_chr(u_char *euc, u_char *yomi)
{
int sj2cd_chr(u_char* euc, u_char* yomi) {
u_char chr;
if((chr = *euc++) == EUC_a1) {
@ -98,8 +93,7 @@ sj2cd_chr(u_char *euc, u_char *yomi)
*yomi = _XKE;
else
*yomi = Y_ZENKAKU;
}
else {
} else {
if(!(chr & 0x80)) {
*yomi = Y_HANKAKU;
@ -116,15 +110,10 @@ sj2cd_chr(u_char *euc, u_char *yomi)
return 2;
}
int
sj2cd_str(u_char *euc, u_char *yomi, int len)
{
int sj2cd_str(u_char* euc, u_char* yomi, int len) {
if(!len--) return FALSE;
while(*euc && len--) euc += sj2cd_chr(euc, yomi++);
*yomi = 0;

View file

@ -40,8 +40,7 @@
#include "sj_kanakan.h"
u_char*
skiphblk(u_char *ptr)
{
skiphblk(u_char* ptr) {
ptr++;
while(*ptr != HINSIBLKTERM) ptr = skipkstr(ptr);
@ -50,4 +49,3 @@ skiphblk(u_char *ptr)
return ptr;
}

View file

@ -43,8 +43,7 @@
#include "sj_kanakan.h"
u_char*
skipkstr(u_char *ptr)
{
skipkstr(u_char* ptr) {
int contf = TRUE, csize;
do {

View file

@ -37,9 +37,7 @@
#include "sj_kanakan.h"
int
yomicmp(u_char *ptr1, u_char *ptr2, u_char *saml)
{
int yomicmp(u_char* ptr1, u_char* ptr2, u_char* saml) {
int i, j;
int same;
@ -70,8 +68,7 @@ yomicmp(u_char *ptr1, u_char *ptr2, u_char *saml)
if(*ptr1 > *ptr2) {
*saml = same;
return CONT;
}
else if (*ptr1++ < *ptr2++) {
} else if(*ptr1++ < *ptr2++) {
return OVER;
}
same++;
@ -81,10 +78,8 @@ yomicmp(u_char *ptr1, u_char *ptr2, u_char *saml)
return MATCH;
}
u_char*
srchdict(u_char *tagp)
{
srchdict(u_char* tagp) {
TypeDicSeg segno;
int cmp;
int maxlen;
@ -93,7 +88,6 @@ srchdict(u_char *tagp)
while((int)dicinl <= maxlen) {
segno = srchidx(prevseg, (int)dicinl);
(*curdict->getdic)(curdict, segno);
@ -153,4 +147,3 @@ srchdict(u_char *tagp)
return NULL;
}

View file

@ -33,16 +33,12 @@
* $SonyDate: 1994/06/03 08:02:28 $
*/
#include "sj_kcnv.h"
#include "sj_yomi.h"
#include "sj_kanakan.h"
int
srchhead()
{
int srchhead() {
if(*cnvstart == _O) {
headcode = SETTOU_O;
headlen = 1;
@ -64,4 +60,3 @@ srchhead()
headcode = headlen = 0;
return FALSE;
}

View file

@ -38,8 +38,7 @@
#include "sj_kanakan.h"
TypeDicSeg
srchidx(TypeDicSeg low, int len)
{
srchidx(TypeDicSeg low, int len) {
TypeDicSeg high;
TypeDicSeg mid;
int cmp;
@ -72,4 +71,3 @@ srchidx(TypeDicSeg low, int len)
return (cmp == OVER && mid != DICSEGBASE) ? mid - 1 : mid;
}

View file

@ -44,8 +44,7 @@
static void srch_kurai1(), srch_kurai2();
static void
srch_josuu_sub(JREC *jrec, TypeGram gram)
{
srch_josuu_sub(JREC* jrec, TypeGram gram) {
u_char* tagp;
DICTL* dp;
@ -59,8 +58,7 @@ srch_josuu_sub(JREC *jrec, TypeGram gram)
}
static void
srch_josuu(JREC *jrec)
{
srch_josuu(JREC* jrec) {
u_char* kp;
int klen;
int len;
@ -82,8 +80,7 @@ srch_josuu(JREC *jrec)
}
static void
setnrec_sub(u_char *p, u_short flag, int stb)
{
setnrec_sub(u_char* p, u_short flag, int stb) {
JREC* rec;
int len1;
int len2;
@ -117,8 +114,7 @@ setnrec_sub(u_char *p, u_short flag, int stb)
}
static void
setnrec(u_char *p, u_short flag)
{
setnrec(u_char* p, u_short flag) {
setnrec_sub(p, flag, 0);
if(!headcode && (*p == Y_S_KIGOU2)) {
@ -127,8 +123,7 @@ setnrec(u_char *p, u_short flag)
}
static u_char*
srchtbl(u_char ch, u_char *tbl, int rec, int n)
{
srchtbl(u_char ch, u_char* tbl, int rec, int n) {
int high, low, mid;
u_char* p;
@ -159,14 +154,12 @@ srchtbl(u_char ch, u_char *tbl, int rec, int n)
}
static int
isconnect(u_char *cnct, int num)
{
isconnect(u_char* cnct, int num) {
return (cnct[num / 8] & (0x80 >> (num % 8)));
}
static int
string_cmp(u_char *s, int l, u_char *d)
{
string_cmp(u_char* s, int l, u_char* d) {
u_char* p;
p = s;
@ -181,8 +174,7 @@ string_cmp(u_char *s, int l, u_char *d)
}
static int
check_num(u_char *ptr)
{
check_num(u_char* ptr) {
int i;
int j;
int k;
@ -270,8 +262,7 @@ check_num(u_char *ptr)
}
static void
srch_number1(u_char *ptr)
{
srch_number1(u_char* ptr) {
u_char ch;
u_char mode;
u_char* p;
@ -339,21 +330,18 @@ srch_number1(u_char *ptr)
srch_kurai2(tptr, (u_char*)NULL);
suuji_class = C_N_KAZU;
}
else if (mode & SJTBLNYOMIF) {
} else if(mode & SJTBLNYOMIF) {
if(mode & SJTBLNNANSUUF)
suuji_class = C_N_NANSUU;
else
suuji_class = C_N_KAZU;
check_num(tptr);
}
else if (mode & SJTBLNNARABIF) {
} else if(mode & SJTBLNNARABIF) {
suuji_class = C_N_SUUJI;
check_num(tptr);
srch_number1(tptr);
break;
}
else {
} else {
suuji_class = C_N_SUUJI;
srch_number1(tptr);
@ -370,8 +358,7 @@ srch_number1(u_char *ptr)
}
static void
srch_kurai1(u_char *ptr, u_char *cnct)
{
srch_kurai1(u_char* ptr, u_char* cnct) {
u_char ch;
u_char* p;
int l;
@ -397,8 +384,7 @@ srch_kurai1(u_char *ptr, u_char *cnct)
if(suuji_class != C_N_KAZU && suuji_class != C_N_NANSUU) {
cls = suuji_class;
suuji_class = (suuji_class == C_N_ARABIA) ?
C_N_ARAKURA : C_N_KANKURA;
suuji_class = (suuji_class == C_N_ARABIA) ? C_N_ARAKURA : C_N_KANKURA;
suuji_ubuf[suuji_keta - 1] |= (keta << 4);
check_num(tptr);
suuji_class = cls;
@ -409,8 +395,7 @@ srch_kurai1(u_char *ptr, u_char *cnct)
if(cnct) {
if(!isconnect(cnct, (int)Kr1TblCnct(mode))) continue;
suuji_ubuf[suuji_keta - 1] |= (keta << 4);
}
else {
} else {
if(!Kr1TblTop(mode)) continue;
if(suuji_keta >= NUMKETALENGTH) continue;
suuji_ubuf[suuji_keta++] = (_NUM1 | (keta << 4));
@ -430,8 +415,7 @@ srch_kurai1(u_char *ptr, u_char *cnct)
}
static void
srch_kurai2(u_char *ptr, u_char *cnct)
{
srch_kurai2(u_char* ptr, u_char* cnct) {
u_char ch;
u_char* p;
int l;
@ -460,8 +444,7 @@ srch_kurai2(u_char *ptr, u_char *cnct)
if(suuji_class != C_N_KAZU && suuji_class != C_N_NANSUU) {
suuji_ubuf[suuji_keta - 1] |= (keta << 6);
cls = suuji_class;
suuji_class = (suuji_class == C_N_ARABIA) ?
C_N_ARAKURA : C_N_KANKURA;
suuji_class = (suuji_class == C_N_ARABIA) ? C_N_ARAKURA : C_N_KANKURA;
check_num(tptr);
suuji_class = cls;
suuji_ubuf[suuji_keta - 1] &= 0x3f;
@ -471,8 +454,7 @@ srch_kurai2(u_char *ptr, u_char *cnct)
if(cnct) {
if(!isconnect(cnct, (int)Kr2TblCnct(mode))) continue;
suuji_ubuf[suuji_keta - 1] |= (keta << 6);
}
else {
} else {
if(suuji_keta >= NUMKETALENGTH) continue;
suuji_ubuf[suuji_keta++] = (_NUM1 | (keta << 6));
}
@ -490,8 +472,7 @@ srch_kurai2(u_char *ptr, u_char *cnct)
}
static void
srch_number2(u_char *p)
{
srch_number2(u_char* p) {
u_char ch;
int i;
@ -503,19 +484,16 @@ srch_number2(u_char *p)
if(suuji_keta) {
if(suuji_comma) {
if(suuji_comma != 3) break;
}
else {
} else {
if(suuji_keta >= 4) break;
if(*suuji_yptr == N_0) break;
}
}
else
} else
break;
suuji_comma = 1;
ch = *p++;
}
else if (suuji_comma) {
} else if(suuji_comma) {
suuji_comma++;
}
@ -530,13 +508,11 @@ srch_number2(u_char *p)
if(!suuji_comma && suuji_keta > NUMKETALENGTH) {
setnrec(p, 0);
}
else if (suuji_comma == 3) {
} else if(suuji_comma == 3) {
if(suuji_keta <= NUMKETALENGTH) {
suuji_class = C_N_ARACMA;
check_num(p);
}
else {
} else {
suuji_class = C_N_KAZULCMA;
setnrec(p, 0);
}
@ -545,8 +521,7 @@ srch_number2(u_char *p)
}
static void
srchnum_sub(u_char *p)
{
srchnum_sub(u_char* p) {
suuji_yptr = p;
suuji_comma = suuji_keta = 0;
@ -561,9 +536,7 @@ srchnum_sub(u_char *p)
srch_number2(p);
}
void
srchnum()
{
void srchnum() {
suuji_len = suuji_exit = 0;
srchnum_sub(cnvstart);
@ -578,9 +551,7 @@ srchnum()
}
}
void
setwdnum(u_char *p, int len, u_short *wd)
{
void setwdnum(u_char* p, int len, u_short* wd) {
suuji_len = (u_char)len;
suuji_wkeep = wd;
suuji_ukeep = NULL;
@ -590,9 +561,7 @@ setwdnum(u_char *p, int len, u_short *wd)
srchnum_sub(p);
}
int
setucnum(u_char *p, int len, u_char *ud)
{
int setucnum(u_char* p, int len, u_char* ud) {
suuji_len = (u_char)len;
suuji_wkeep = NULL;
suuji_ukeep = ud;
@ -603,4 +572,3 @@ setucnum(u_char *p, int len, u_char *ud)
return (int)suuji_exit;
}

View file

@ -33,16 +33,12 @@
* $SonyDate: 1994/06/03 08:02:31 $
*/
#include "sj_rename.h"
#include "sj_typedef.h"
#include "sj_kanakan.h"
int
sstrcmp(u_char *src, u_char *dst)
{
int sstrcmp(u_char* src, u_char* dst) {
for(; *src; src++, dst++)
if(*src != *dst) break;

View file

@ -33,16 +33,12 @@
* $SonyDate: 1994/06/03 08:02:32 $
*/
#include "sj_rename.h"
#include "sj_typedef.h"
#include "sj_kanakan.h"
int
sstrlen(u_char *ptr)
{
int sstrlen(u_char* ptr) {
u_char* head;
head = ptr;
@ -51,4 +47,3 @@ sstrlen(u_char *ptr)
return (ptr - head);
}

View file

@ -33,17 +33,13 @@
* $SonyDate: 1994/06/03 08:02:33 $
*/
#include "sj_rename.h"
#include "sj_typedef.h"
#include "sj_const.h"
#include "sj_kanakan.h"
int
sstrncmp(u_char *src, u_char *dst, int len)
{
int sstrncmp(u_char* src, u_char* dst, int len) {
while(len-- > 0) {
@ -60,4 +56,3 @@ sstrncmp(u_char *src, u_char *dst, int len)
return MATCH;
}

View file

@ -33,9 +33,6 @@
* $SonyDate: 1994/06/03 08:02:34 $
*/
#include "sj_rename.h"
#include "sj_typedef.h"
#include "sj_yomi.h"
@ -56,8 +53,7 @@ static u_char name_stb[] = {
0xa4, 0xc1, 0xa4, 0xe3, 0xa4, 0xf3,
0x22, MEISI_1, _DO, _NO,
0xc5, 0xc2,
0x00
};
0x00};
static u_char timei_stb[] = {
0x22, MEISI_1, _E, _KI,
@ -78,8 +74,7 @@ static u_char timei_stb[] = {
0xc4, 0xae,
0x22, MEISI_1, _MU, _RA,
0xc2, 0xbc,
0x00
};
0x00};
static u_char meisi_stb[] = {
0x44, MEISI_6, _A, _TU, _KA, _I,
@ -94,8 +89,7 @@ static u_char meisi_stb[] = {
0xa4, 0xcb, 0xc8, 0xbc, 0xa4, 0xa6,
0x22, MEISI_8, _HU, _U,
0xc9, 0xf7,
0x00
};
0x00};
static u_char sahen_stb[] = {
0x44, MEISI_6, _A, _TU, _KA, _I,
@ -120,28 +114,44 @@ static u_char sahen_stb[] = {
0xc9, 0xf7,
0x22, MEISI_11, _MA, _E,
0xc1, 0xb0,
0x00
};
0x00};
static u_char human_stb[] = {
0x24, MEISI_1, _SA, _NN,
0xa4, 0xb5, 0xa4, 0xf3,
0x00
};
0x00};
static u_char ippan_stb[] = {
0x56, FUKUSI_1, _NI, _TO, _MO, _NA, _I,
0xa4, 0xcb, 0xc8, 0xbc, 0xa4, 0xa4,
0x56, FUKUSI_1, _NI, _TO, _MO, _NA, _U,
0xa4, 0xcb, 0xc8, 0xbc, 0xa4, 0xa6,
0x00
};
0x00};
u_char* stbadr[] = {
0,
ippan_stb, ippan_stb, ippan_stb, meisi_stb, sahen_stb,
sahen_stb, sahen_stb, meisi_stb, meisi_stb, meisi_stb,
ippan_stb, ippan_stb, human_stb, ippan_stb, ippan_stb,
ippan_stb, ippan_stb, ippan_stb, 0, 0,
name_stb, name_stb, 0, timei_stb,
ippan_stb,
ippan_stb,
ippan_stb,
meisi_stb,
sahen_stb,
sahen_stb,
sahen_stb,
meisi_stb,
meisi_stb,
meisi_stb,
ippan_stb,
ippan_stb,
human_stb,
ippan_stb,
ippan_stb,
ippan_stb,
ippan_stb,
ippan_stb,
0,
0,
name_stb,
name_stb,
0,
timei_stb,
};

View file

@ -33,58 +33,39 @@
* $SonyDate: 1994/06/03 08:02:37 $
*/
#include "sj_rename.h"
#include "sj_typedef.h"
#include "sj_kanakan.h"
static u_char o_settou[] = {
0xA1, 0xb8, 0xe6, 0xa4, 0xaa
};
0xA1, 0xb8, 0xe6, 0xa4, 0xaa};
static u_char go_settou[] = {
0xA1, 0xb8, 0xe6, 0xa4, 0xb4
};
0xA1, 0xb8, 0xe6, 0xa4, 0xb4};
static u_char dai_settou[] = {
0x22, 0xc2, 0xe8, 0xc2, 0xe8
};
0x22, 0xc2, 0xe8, 0xc2, 0xe8};
static u_char kigou_settou[] = {
0x01
};
0x01};
u_char* settou_ptr[] = {
NULL, o_settou, go_settou, dai_settou, kigou_settou
};
NULL, o_settou, go_settou, dai_settou, kigou_settou};
u_char scncttbl[2][24] = {
{
0x48, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x18, 0x18, 0x00, 0x00, 0x1f, 0xf0, 0x00, 0xff,
0x00, 0x1f, 0xf0, 0x00, 0xff, 0x00, 0x00, 0x00
},
0x00, 0x1f, 0xf0, 0x00, 0xff, 0x00, 0x00, 0x00},
{
0x22, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
};
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};

View file

@ -37,9 +37,7 @@
#include "sj_kanakan.h"
int
study(STDYOUT *stdy)
{
int study(STDYOUT* stdy) {
STDYOUT outp;
STDYIN* p1;
STDYIN* p2;
@ -76,10 +74,11 @@ study(STDYOUT *stdy)
return STUDYNORMEND;
}
if(STUDYCOUNT >= STUDYMAX) {
p1 = STUDYDICT; p2 = NULL; wi = 0;
p1 = STUDYDICT;
p2 = NULL;
wi = 0;
for(wcnt = STUDYMAX; wcnt--; p1++) {
if((nm = p1->styno + 1) > wi) {
wi = nm;
@ -93,13 +92,11 @@ study(STDYOUT *stdy)
mvmemi((u_char*)(p2 + 1), (u_char*)p2,
(STUDYTAIL - p2) * STUDYRECSIZE);
STUDYCOUNT -= 1;
}
else
} else
return STUDYERROR;
ret = STUDYFULLAREA;
}
else {
} else {
p1 = STUDYDICT;
for(wcnt = STUDYCOUNT; wcnt--; p1++) p1->styno++;
@ -109,7 +106,8 @@ study(STDYOUT *stdy)
p1 = STUDYDICT;
seg = outp.stdy1.seg;
for(wcnt = STUDYCOUNT; wcnt && (p1->seg < seg);) {
wcnt--; p1++;
wcnt--;
p1++;
}
ofs = outp.stdy1.offset;
@ -135,14 +133,12 @@ study(STDYOUT *stdy)
}
STDYIN*
srchstdy(TypeDicSeg seg, TypeDicOfs ofs, TypeDicID dicid)
{
srchstdy(TypeDicSeg seg, TypeDicOfs ofs, TypeDicID dicid) {
int high;
int mid;
int low;
STDYIN* ptr;
if(!StudyExist()) return NULL;
if(!STUDYCOUNT || !ofs) return NULL;
@ -184,4 +180,3 @@ srchstdy(TypeDicSeg seg, TypeDicOfs ofs, TypeDicID dicid)
return NULL;
}

View file

@ -33,9 +33,6 @@
* $SonyDate: 1994/06/03 08:02:39 $
*/
#include "sj_const.h"
#include "sj_rename.h"
#include "sj_typedef.h"
@ -49,8 +46,6 @@
#define NN SJTBLNNARABIF
#define NS SJTBLNNANSUUF
u_char suuji_tbl[] = {
N_0, _NIL, _NIL, _NUM0 | NA, 0x00, 0x00,
N_1, _NIL, _NIL, _NUM1 | NA, 0xec, 0x07,
@ -86,10 +81,7 @@ u_char suuji_tbl[] = {
_RE, _I, _NIL, _NUM0 | NN, 0xec, 0x00,
_RO, _KU, _NIL, _NUM6, 0xe0, 0x07,
_RO, _XTU, _NIL, _NUM6 | NY, 0x00, 0xc2,
0
};
0};
u_char kurai1_tbl[] = {
_ZI, _XYU, _U, (1 << 4) + 0 + KR1TBLTOPF, 0x05,
@ -102,19 +94,13 @@ u_char kurai1_tbl[] = {
_BI, _XYA, _XTU, (2 << 4) + 7, 0x00,
_PI, _XYA, _KU, (2 << 4) + 8, 0x07,
_PI, _XYA, _XTU, (2 << 4) + 9, 0x00,
0
};
0};
u_char kurai2_tbl[] = {
_O, _KU, _NIL, (2 << 4) + 13,
_TI, _XYO, _U, (3 << 4) + 14,
_MA, _NN, _NIL, (1 << 4) + 15,
0
};
0};
u_char num1tbl[] = {
0xa3, 0xb0,
@ -129,10 +115,7 @@ u_char num1tbl[] = {
0xa3, 0xb9,
0xa3, 0xb1,
0xbf, 0xf4,
0xb2, 0xbf
};
0xb2, 0xbf};
u_char num2tbl[] = {
0xa1, 0xbb,
@ -147,10 +130,7 @@ u_char num2tbl[] = {
0xb6, 0xe5,
0xb0, 0xec,
0xbf, 0xf4,
0xb2, 0xbf
};
0xb2, 0xbf};
u_char num3tbl[] = {
0xce, 0xed,
@ -165,32 +145,22 @@ u_char num3tbl[] = {
0xb6, 0xe5,
0xb0, 0xed,
0xbf, 0xf4,
0xb2, 0xbf
};
0xb2, 0xbf};
u_char num4tbl[] = {
0xc0, 0xe9,
0xc9, 0xb4,
0xbd, 0xbd,
0
};
0};
u_char num5tbl[] = {
0xc0, 0xe9,
0xc9, 0xb4,
0xbd, 0xa6,
0
};
0};
u_char num6tbl[] = {
0xc3, 0xfb,
0xb2, 0xaf,
0xcb, 0xfc,
0
};
0};

View file

@ -33,19 +33,14 @@
* $SonyDate: 1994/06/03 08:02:40 $
*/
#include "sj_kcnv.h"
#include "sj_right.h"
#include "sj_kanakan.h"
int
terminate(TypeCnct right, u_char *yomi)
{
int terminate(TypeCnct right, u_char* yomi) {
u_char ch;
if((yomi > cnvstart) && (Chrtbl[*(yomi - 1)] & NUMBER))
return TRUE;
@ -66,7 +61,5 @@ terminate(TypeCnct right, u_char *yomi)
if(!isdpnd(ch)) return TRUE;
}
return FALSE;
}

View file

@ -33,8 +33,6 @@
* $SonyDate: 1994/06/03 08:02:42 $
*/
#include "sj_rename.h"
#include "sj_typedef.h"
#include "sj_const.h"
@ -323,5 +321,4 @@ u_char termtbl[] = {
T_KANOU + P_SETUBI,
T_KANOU + P_JOSUUSI,
T_KANOU + P_RENTAISI,
T_KANOU + P_TANKAN
};
T_KANOU + P_TANKAN};

View file

@ -39,9 +39,7 @@
#include "sj_kanakan.h"
void
wakachi()
{
void wakachi() {
JREC* jrec;
CLREC* clrec;
@ -98,9 +96,7 @@ wakachi()
fzk_ka_flg = 0;
setclrec(jrec, next, right);
}
}
else if ((Chrtbl[*next] & NUMBER)
&& (jrec -> jlen)) {
} else if((Chrtbl[*next] & NUMBER) && (jrec->jlen)) {
fzk_ka_flg = 0;
setclrec(jrec, next, right);
return;
@ -127,4 +123,3 @@ wakachi()
}
}
}

View file

@ -33,7 +33,6 @@
* $SonyDate: 1994/06/03 08:03:59 $
*/
#ifndef lint
static char rcsid[] = "$Header: /export/work/contrib/sj3/sj3rkcv/RCS/rk_conv.c,v 1.14 1994/06/03 07:42:16 notanaka Exp $";
#endif
@ -90,7 +89,6 @@ static int rk_cflag;
static int rk_klen;
static int file_code = SJ3_NO;
static RkbufRec rkpbuf, *rkpp = NULL;
static RkTablW16* rkhp;
static StrbufRec strpbuf, *strpp;
@ -98,27 +96,17 @@ static wchar16_t *shp;
static YmibufRec ymipbuf, *ymipp;
static u_short* yhp;
void
sj3_rkcode(int code)
{
void sj3_rkcode(int code) {
if(code)
file_code = SJ3_NO;
}
int
sj3_rkinit2(char *rkfile, int erase)
{
int sj3_rkinit2(char* rkfile, int erase) {
rk_erase = erase;
return (sj3_rkinit_mb(rkfile));
}
int
rcode_sjis_init()
{
int rcode_sjis_init() {
int i, rkeylen = 0, ryomilen = 0, rstrlen = 0;
int klen, ylen, slen, tablnum = 0, tablsize;
u_char * mbstr, *mptr, mtmp[BUFSIZ], mtmp2[BUFSIZ];
@ -128,7 +116,6 @@ rcode_sjis_init()
tablsize = sizeof(RkTabl);
for(i = 0; i < MAXCODE; i++) {
if(sj3_rcode_w16[i]) {
tabl_w16 = sj3_rcode_w16[i];
@ -277,9 +264,7 @@ rcode_sjis_init()
return 1;
}
int
rcode_euc_init()
{
int rcode_euc_init() {
int i, rkeylen = 0, ryomilen = 0, rstrlen = 0;
int klen, ylen, slen, tablnum = 0, tablsize;
u_char * mbstr, *mptr, mtmp[BUFSIZ], mtmp2[BUFSIZ];
@ -289,7 +274,6 @@ rcode_euc_init()
tablsize = sizeof(RkTabl);
for(i = 0; i < MAXCODE; i++) {
if(sj3_rcode_w16[i]) {
tabl_w16 = sj3_rcode_w16[i];
@ -438,30 +422,22 @@ rcode_euc_init()
return 1;
}
int
sj3_rkinit(char *rkfile)
{
int sj3_rkinit(char* rkfile) {
return sj3_rkinit_sub(rkfile, rcode_sjis_init);
}
int
sj3_rkinit_euc(char *rkfile)
{
int sj3_rkinit_euc(char* rkfile) {
return sj3_rkinit_sub(rkfile, rcode_euc_init);
}
int
sj3_rkinit_mb(char *rkfile)
{
int sj3_rkinit_mb(char* rkfile) {
if(current_locale == LC_CTYPE_EUC)
return sj3_rkinit_sub(rkfile, rcode_euc_init);
else
return sj3_rkinit_sub(rkfile, rcode_sjis_init);
}
int
sj3_rkinit_sub(char *rkfile, int (*mbfunc)())
{
int sj3_rkinit_sub(char* rkfile, int (*mbfunc)()) {
char* p;
int len, klen, rlen, retv;
FILE* fp;
@ -516,7 +492,6 @@ sj3_rkinit_sub(char *rkfile, int (*mbfunc)())
retv = FAIL;
break;
}
}
fclose(fp);
if(!(*mbfunc)())
@ -525,11 +500,7 @@ sj3_rkinit_sub(char *rkfile, int (*mbfunc)())
return (retv);
}
char *
getkey(char *istr, wchar16_t *ostr, int *len)
{
char* getkey(char* istr, wchar16_t* ostr, int* len) {
char c, *p;
int i;
@ -580,11 +551,7 @@ getkey(char *istr, wchar16_t *ostr, int *len)
return (NULL);
}
char *
rkgetyomi(char *istr, wchar16_t *ostr, int *len)
{
char* rkgetyomi(char* istr, wchar16_t* ostr, int* len) {
u_char c;
u_char* p;
int i;
@ -611,8 +578,7 @@ rkgetyomi(char *istr, wchar16_t *ostr, int *len)
p++;
} else if(iseuckana(c) && iskana2(*p)) {
cc = *p++;
}
else if (IsEUCHojo(c) && iseuc(*p) && iseuc(p[1])) {
} else if(IsEUCHojo(c) && iseuc(*p) && iseuc(p[1])) {
cc = WcSetX0212(*p, p[1]);
p += 2;
}
@ -622,9 +588,7 @@ rkgetyomi(char *istr, wchar16_t *ostr, int *len)
p--;
continue;
}
if ((iseuc(c) && iseuc(*p)) || (iseuckana(c) &&
iskana2(*p)) || (IsEUCHojo(c) && iseuc(*p) &&
iseuc(p[1]))) {
if((iseuc(c) && iseuc(*p)) || (iseuckana(c) && iskana2(*p)) || (IsEUCHojo(c) && iseuc(*p) && iseuc(p[1]))) {
file_code = SJ3_EUC;
p--;
continue;
@ -643,11 +607,7 @@ rkgetyomi(char *istr, wchar16_t *ostr, int *len)
return (NULL);
}
void
cltable()
{
void cltable() {
int i;
if(rkpp != NULL) {
@ -664,11 +624,7 @@ cltable()
}
}
int
chk_rstr(wchar16_t *rstr, wchar16_t *rkey, int rlen, int klen)
{
int chk_rstr(wchar16_t* rstr, wchar16_t* rkey, int rlen, int klen) {
int i;
wchar16_t* p;
@ -684,11 +640,8 @@ chk_rstr(wchar16_t *rstr, wchar16_t *rkey, int rlen, int klen)
return (1);
}
RkTablW16*
rkalloc()
{
rkalloc() {
RkTablW16* rkp;
RkbufRec* rkbrp;
@ -720,11 +673,7 @@ rkalloc()
return (rkp);
}
int
stradd(wchar16_t **cp, wchar16_t *str, int len)
{
int stradd(wchar16_t** cp, wchar16_t* str, int len) {
wchar16_t* strp;
StrbufRec* sbrp;
@ -755,11 +704,7 @@ stradd(wchar16_t **cp, wchar16_t *str, int len)
return (0);
}
int
kstradd(wchar16_t **cp, wchar16_t *kstr, int len)
{
int kstradd(wchar16_t** cp, wchar16_t* kstr, int len) {
int i;
wchar16_t* usp;
YmibufRec* ybrp;
@ -791,11 +736,8 @@ kstradd(wchar16_t **cp, wchar16_t *kstr, int len)
return (0);
}
RkTablW16*
mktable(wchar16_t *key, int len)
{
mktable(wchar16_t* key, int len) {
int i;
RkTablW16 *nrktp, *orktp;
RkTablW16* rktp;
@ -838,19 +780,11 @@ mktable(wchar16_t *key, int len)
return (rktp);
}
void
sj3_rkebell(int err)
{
void sj3_rkebell(int err) {
rk_errin = err;
}
void
sj3_rkclear()
{
void sj3_rkclear() {
rline[0] = NSTR;
lstr[0] = NSTR;
rktblp = NULL;
@ -858,17 +792,11 @@ sj3_rkclear()
sj3_rkreset();
}
void
sj3_rkreset()
{
void sj3_rkreset() {
rk_cflag = -1;
}
void
sj3_rkconvc(wchar16_t c, u_int *rkstr)
{
void sj3_rkconvc(wchar16_t c, u_int* rkstr) {
int i;
wchar16_t *p, *q;
int len;
@ -936,11 +864,7 @@ sj3_rkconvc(wchar16_t c, u_int *rkstr)
*rkstr = RKEND;
}
int
sj3_rkconv2(wchar16_t *wstr, u_int *kstr, int wlen)
{
int sj3_rkconv2(wchar16_t* wstr, u_int* kstr, int wlen) {
int i;
wchar16_t *p, *q, *s;
int rlen, len;
@ -1031,12 +955,7 @@ sj3_rkconv2(wchar16_t *wstr, u_int *kstr, int wlen)
return (len);
}
int
sj3_rkconv(u_char *romaji, u_char *kana)
{
int sj3_rkconv(u_char* romaji, u_char* kana) {
wchar16_t* wstr;
int len, mflag = 0, ret;
@ -1079,9 +998,7 @@ sj3_rkconv(u_char *romaji, u_char *kana)
}
}
int
sj3_rkconv_euc(u_char *romaji, u_char *kana)
{
int sj3_rkconv_euc(u_char* romaji, u_char* kana) {
wchar16_t* wstr;
int len, mflag = 0, ret;
@ -1124,18 +1041,14 @@ sj3_rkconv_euc(u_char *romaji, u_char *kana)
}
}
int
sj3_rkconv_mb(u_char *romaji, u_char *kana)
{
int sj3_rkconv_mb(u_char* romaji, u_char* kana) {
if(current_locale == LC_CTYPE_EUC)
return sj3_rkconv_euc(romaji, kana);
else
return sj3_rkconv(romaji, kana);
}
int
sj3_rkconv_w16(wchar16_t *wstr, wchar16_t *kstr)
{
int sj3_rkconv_w16(wchar16_t* wstr, wchar16_t* kstr) {
int i;
wchar16_t *p, *q, *s;
@ -1194,11 +1107,7 @@ sj3_rkconv_w16(wchar16_t *wstr, wchar16_t *kstr)
return (rlen);
}
int
rkmatch(wchar16_t *s1, wchar16_t *s2, int len)
{
int rkmatch(wchar16_t* s1, wchar16_t* s2, int len) {
int i;
i = 1;

View file

@ -33,7 +33,6 @@
* $SonyDate: 1995/02/10 06:02:25 $
*/
#include <stdlib.h>
#include <string.h>
@ -123,8 +122,7 @@ static u_short HKtable[ZKATAn] = {
((KANA_A + 2) << 8) + KANA_DTEN,
KANA_KA,
KANA_KA + 3
};
KANA_KA + 3};
static struct ztohkktbl {
u_short zen;
@ -137,9 +135,7 @@ static struct ztohkktbl {
ZEN_CTEN, KANA_CTEN,
ZEN_CHOUON, KANA_CHOUON,
ZEN_DTEN, KANA_DTEN,
ZEN_HDTEN, KANA_HDTEN
};
ZEN_HDTEN, KANA_HDTEN};
static struct hzkigoutbl {
wchar16_t han;
@ -150,8 +146,7 @@ static struct hzkigoutbl {
'-', ZEN_CHOUON,
'@', ZEN_CTEN,
'[', ZEN_FKAKKO,
']', ZEN_EKAKKO
};
']', ZEN_EKAKKO};
static u_short HZtbl[95] = {
0xa1a1, 0xa1aa, 0xa1c9, 0xa1f4, 0xa1f0, 0xa1f3, 0xa1f5, 0xa1c7,
@ -165,13 +160,10 @@ static u_short HZtbl[95] = {
0xa1c6, 0xa3e1, 0xa3e2, 0xa3e3, 0xa3e4, 0xa3e5, 0xa3e6, 0xa3e7,
0xa3e8, 0xa3e9, 0xa3ea, 0xa3eb, 0xa3ec, 0xa3ed, 0xa3ee, 0xa3ef,
0xa3f0, 0xa3f1, 0xa3f2, 0xa3f3, 0xa3f4, 0xa3f5, 0xa3f6, 0xa3f7,
0xa3f8, 0xa3f9, 0xa3fa, 0xa1d0, 0xa1c3, 0xa1d1, 0xa1b1
};
0xa3f8, 0xa3f9, 0xa3fa, 0xa1d0, 0xa1c3, 0xa1d1, 0xa1b1};
#ifdef ADDHK
void
setl_hktozh()
{
void setl_hktozh() {
int i;
u_short c, zen1;
wchar16_t rstr[2];
@ -207,10 +199,7 @@ setl_hktozh()
}
#endif
void
mkkigou()
{
void mkkigou() {
int i;
wchar16_t rstr[2];
wchar16_t kstr[2];
@ -230,9 +219,7 @@ mkkigou()
}
}
int
sj_addten(u_short prefix, u_short c)
{
int sj_addten(u_short prefix, u_short c) {
u_short c1, cc;
cc = 0;
@ -251,9 +238,7 @@ sj_addten(u_short prefix, u_short c)
return (cc);
}
int
sj_han2zen(u_short c)
{
int sj_han2zen(u_short c) {
int i;
u_short cc;
@ -262,8 +247,7 @@ sj_han2zen(u_short c)
if(c == HKtable[i]) {
if(i >= ZKATAn - 3) {
cc = (ZKATA1 << 8) + (ZKATAF2 + i + 1);
}
else {
} else {
cc = (ZHIRA1 << 8) + (ZHIRAF2 + i);
if(c == KANA_WA)
cc++;
@ -290,10 +274,7 @@ sj_han2zen(u_short c)
return (cc);
}
int
sj3_hantozen(u_char *out, u_char *in)
{
int sj3_hantozen(u_char* out, u_char* in) {
wchar16_t *winstr, *woutstr;
u_char* mstr;
int inlen, outlen, imflag = 0, omflag = 0, mmflag = 0, ret;
@ -384,9 +365,7 @@ sj3_hantozen(u_char *out, u_char *in)
}
}
int
sj3_hantozen_euc(u_char *out, u_char *in)
{
int sj3_hantozen_euc(u_char* out, u_char* in) {
wchar16_t *winstr, *woutstr;
u_char* mstr;
int inlen, outlen, imflag = 0, omflag = 0, mmflag = 0, ret;
@ -477,24 +456,18 @@ sj3_hantozen_euc(u_char *out, u_char *in)
}
}
int
sj3_hantozen_mb(u_char *s1, u_char *s2)
{
int sj3_hantozen_mb(u_char* s1, u_char* s2) {
if(current_locale == LC_CTYPE_EUC)
return sj3_hantozen_euc(s1, s2);
else
return sj3_hantozen(s1, s2);
}
int
sj3_hantozen_w16(wchar16_t *s1, wchar16_t *s2)
{
int sj3_hantozen_w16(wchar16_t* s1, wchar16_t* s2) {
return sj_hantozen(s1, s2, wslen(s2));
}
int
sj_hantozen(wchar16_t *s1, wchar16_t *s2, int len)
{
int sj_hantozen(wchar16_t* s1, wchar16_t* s2, int len) {
u_short c1, cc, prefix;
wchar16_t c;
int i;
@ -525,9 +498,7 @@ sj_hantozen(wchar16_t *s1, wchar16_t *s2, int len)
return (rlen);
}
int
sj_zen2han(u_short c)
{
int sj_zen2han(u_short c) {
int i;
u_short cc;
@ -560,9 +531,7 @@ sj_zen2han(u_short c)
return (cc);
}
int
sj3_zentohan(u_char *out, u_char *in)
{
int sj3_zentohan(u_char* out, u_char* in) {
wchar16_t *winstr, *woutstr;
u_char* mstr;
int inlen, outlen, imflag = 0, omflag = 0, mmflag = 0, ret;
@ -650,9 +619,7 @@ sj3_zentohan(u_char *out, u_char *in)
return ret;
}
int
sj3_zentohan_euc(u_char *out, u_char *in)
{
int sj3_zentohan_euc(u_char* out, u_char* in) {
wchar16_t *winstr, *woutstr;
u_char* mstr;
int inlen, outlen, imflag = 0, omflag = 0, mmflag = 0, ret;
@ -741,24 +708,18 @@ sj3_zentohan_euc(u_char *out, u_char *in)
return ret;
}
int
sj3_zentohan_mb(u_char *s1, u_char *s2)
{
int sj3_zentohan_mb(u_char* s1, u_char* s2) {
if(current_locale == LC_CTYPE_EUC)
return sj3_zentohan_euc(s1, s2);
else
return sj3_zentohan(s1, s2);
}
int
sj3_zentohan_w16(wchar16_t *s1, wchar16_t *s2)
{
int sj3_zentohan_w16(wchar16_t* s1, wchar16_t* s2) {
return sj_zentohan(s1, s2, wslen(s2));
}
int
sj_zentohan(wchar16_t *s1, wchar16_t *s2, int len)
{
int sj_zentohan(wchar16_t* s1, wchar16_t* s2, int len) {
u_short cc;
wchar16_t c;
int i, rlen;
@ -789,27 +750,21 @@ sj_zentohan(wchar16_t *s1, wchar16_t *s2, int len)
return (rlen);
}
int
sj_tokata(wchar16_t c)
{
int sj_tokata(wchar16_t c) {
if(sj_ishira(c)) {
c += 0x0100;
}
return (c);
}
int
sj_tohira(wchar16_t c)
{
int sj_tohira(wchar16_t c) {
if(sj_iskata(c) && (short)c <= (short)0xa5f3) {
c -= 0x0100;
}
return (c);
}
int
sj_htok(wchar16_t *s1, wchar16_t *s2)
{
int sj_htok(wchar16_t* s1, wchar16_t* s2) {
wchar16_t cc;
wchar16_t c;
@ -823,9 +778,7 @@ sj_htok(wchar16_t *s1, wchar16_t *s2)
*s1 = (wchar16_t)'\0';
}
int
sj_ktoh(wchar16_t *s1, wchar16_t *s2)
{
int sj_ktoh(wchar16_t* s1, wchar16_t* s2) {
wchar16_t cc;
wchar16_t c;

View file

@ -33,7 +33,6 @@
* $SonyDate: 1994/11/17 06:49:21 $
*/
#include <stdio.h>
#include <locale.h>
#include "wchar16.h"
@ -57,35 +56,27 @@
extern int current_locale;
int
sj3_iswcntrl16(wchar16_t wc)
{
int sj3_iswcntrl16(wchar16_t wc) {
if((wc < 0x20) || (wc == 0x7f)) return TRUE;
return FALSE;
}
int
sj3_iswupper16(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(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(wchar16_t wc)
{
int sj3_iswxdigit16(wchar16_t wc) {
if(((0x29 < wc) && (wc < 0x3a)) ||
((0xa3af < wc) && (wc < 0xa3ba))) return TRUE;
@ -98,9 +89,7 @@ sj3_iswxdigit16(wchar16_t wc)
return FALSE;
}
int
sj3_wslen16(wchar16_t *ws)
{
int sj3_wslen16(wchar16_t* ws) {
int i = 0;
if(!ws) return 0;
@ -109,9 +98,7 @@ sj3_wslen16(wchar16_t *ws)
return i;
}
int
sj3_wscmp16(wchar16_t *ws1, wchar16_t *ws2)
{
int sj3_wscmp16(wchar16_t* ws1, wchar16_t* ws2) {
while((*ws1 && *ws2) && (*ws1 == *ws2)) {
ws1++;
ws2++;
@ -123,9 +110,7 @@ sj3_wscmp16(wchar16_t *ws1, wchar16_t *ws2)
return 1;
}
int
sj3_wsncmp16(wchar16_t *ws1, wchar16_t *ws2, int n)
{
int sj3_wsncmp16(wchar16_t* ws1, wchar16_t* ws2, int n) {
int i = 0;
while((*ws1 && *ws2) && (*ws1 == *ws2) && (i < n)) {
@ -142,8 +127,7 @@ sj3_wsncmp16(wchar16_t *ws1, wchar16_t *ws2, int n)
}
wchar16_t*
sj3_wscpy16(wchar16_t *ws1, wchar16_t *ws2)
{
sj3_wscpy16(wchar16_t* ws1, wchar16_t* ws2) {
wchar16_t* ws;
if(!ws2) return NULL;
@ -157,8 +141,7 @@ sj3_wscpy16(wchar16_t *ws1, wchar16_t *ws2)
}
wchar16_t*
sj3_wsncpy16(wchar16_t *ws1, wchar16_t *ws2, int n)
{
sj3_wsncpy16(wchar16_t* ws1, wchar16_t* ws2, int n) {
wchar16_t* ws;
int i = 0;
@ -174,8 +157,7 @@ sj3_wsncpy16(wchar16_t *ws1, wchar16_t *ws2, int n)
}
wchar16_t*
sj3_wscat16(wchar16_t *ws1, wchar16_t *ws2)
{
sj3_wscat16(wchar16_t* ws1, wchar16_t* ws2) {
wchar16_t* ws;
if(!ws1) return NULL;
@ -192,10 +174,8 @@ sj3_wscat16(wchar16_t *ws1, wchar16_t *ws2)
return ws1;
}
wchar16_t
sj3_euc2wc16(unsigned int code)
{
sj3_euc2wc16(unsigned int code) {
wchar16_t wc = 0;
if(((code >> 16) & 0xff) == SS3) {
@ -210,8 +190,7 @@ sj3_euc2wc16(unsigned int code)
}
wchar16_t
sj3_sjis2wc16(unsigned int code)
{
sj3_sjis2wc16(unsigned int code) {
unsigned short ch;
if((code >> 8) & 0xff) {
@ -225,8 +204,7 @@ sj3_sjis2wc16(unsigned int code)
}
unsigned int
sj3_wc2euc16(wchar16_t wc)
{
sj3_wc2euc16(wchar16_t wc) {
unsigned int code = 0;
unsigned char tmp;
@ -249,8 +227,7 @@ sj3_wc2euc16(wchar16_t wc)
}
unsigned int
sj3_wc2sjis16(wchar16_t wc)
{
sj3_wc2sjis16(wchar16_t wc) {
unsigned int ch;
ch = sj3_wc2euc16(wc);
@ -265,9 +242,7 @@ sj3_wc2sjis16(wchar16_t wc)
}
}
int
sj3_wcs2eucs16(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;
unsigned char c;
@ -307,9 +282,7 @@ sj3_wcs2eucs16(unsigned char *mb, wchar16_t *ws, int n)
return i;
}
int
sj3_wcs2sjiss16(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;
unsigned char c;
@ -339,9 +312,7 @@ sj3_wcs2sjiss16(unsigned char *mb, wchar16_t *ws, int n)
return i;
}
int
sj3_eucs2wcs16(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;
@ -368,9 +339,7 @@ sj3_eucs2wcs16(wchar16_t *ws, unsigned char *mb, int n)
return i;
}
int
sj3_sjiss2wcs16(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;
@ -393,22 +362,16 @@ sj3_sjiss2wcs16(wchar16_t *ws, unsigned char *mb, int n)
return i;
}
int
sj3_mbstowcs16(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(unsigned char *mb, unsigned char *ws, int n)
{
int sj3_wcstombs16(unsigned char* mb, unsigned char* ws, int n) {
if(current_locale == LC_CTYPE_EUC)
return sj3_wcs2eucs16(mb, ws, n);
else
return sj3_wcs2sjiss16(mb, ws, n);
}

View file

@ -33,15 +33,12 @@
* $SonyDate: 1994/06/03 08:00:32 $
*/
#include "sj_euc.h"
#include "sj3_dict_const.h"
#include "sj3mkdic.h"
int
cnvyomi(int code)
{
int cnvyomi(int code) {
u_short hh;
u_char high;
u_char low;
@ -53,17 +50,19 @@ cnvyomi(int code)
if(!hh) {
if(high == 0xa1) {
switch(low) {
case 0xbc: return 1;
case 0xf4: return 2;
case 0xf7: return 3;
case 0xa7: return 4;
}
}
else if (high == 0xa2) {
if (low == 0xa9)
case 0xbc:
return 1;
case 0xf4:
return 2;
case 0xf7:
return 3;
case 0xa7:
return 4;
}
else if (high == 0xa3) {
} else if(high == 0xa2) {
if(low == 0xa9)
return 4;
} else if(high == 0xa3) {
if(low < 0xb0)
;
else if(low <= 0xb9)
@ -76,18 +75,19 @@ cnvyomi(int code)
;
else if(low <= 0xfa)
return (low - 0xe1 + 0x34);
}
else if (high == 0xa4) {
} else if(high == 0xa4) {
if(low < 0xa1)
;
else if(low <= 0xf3)
return (low - 0xa1 + 0x4e);
}
else if (high == 0xa5) {
} else if(high == 0xa5) {
switch(low) {
case 0xf4: return 0xa1;
case 0xf5: return 0xa2;
case 0xf6: return 0xa3;
case 0xf4:
return 0xa1;
case 0xf5:
return 0xa2;
case 0xf6:
return 0xa3;
}
}
}
@ -95,10 +95,7 @@ cnvyomi(int code)
return 0;
}
int
h2kcode(int code)
{
int h2kcode(int code) {
u_short hh;
u_char high;
u_char low;
@ -116,10 +113,7 @@ h2kcode(int code)
return code; /* XXX */
}
int
codesize(u_char code)
{
int codesize(u_char code) {
switch(code & KANJIMODEMASK) {
case ZENHIRAASSYUKU:
case ZENKATAASSYUKU:
@ -135,10 +129,7 @@ codesize(u_char code)
}
}
void
output_knj(FILE *fp, u_char *p, int l)
{
void output_knj(FILE* fp, u_char* p, int l) {
while(l > 0) {
switch(*p & KANJIMODEMASK) {
case ZENHIRAASSYUKU:
@ -158,86 +149,94 @@ output_knj(FILE *fp, u_char *p, int l)
l = 0;
fprintf(stderr, "\244\252\244\253\244\267\244\244");
#else
fputc(*p++, fp); l--;
fputc(*p++, fp); l--;
fputc(*p++, fp);
l--;
fputc(*p++, fp);
l--;
#endif
break;
case OFFSETASSYUKU:
fprintf(fp, "ofs%1x", (*p++ & 0x0f));
l--;
fprintf(fp, "%02x", *p++); l--;
fprintf(fp, "%02x", *p++);
l--;
break;
case AIATTRIBUTE:
fprintf(fp, "\302\260%1x", (*p++ & 0x0f));
l--;
fprintf(fp, "%02x", *p++); l--;
fprintf(fp, "%02x", *p++);
l--;
break;
case KANJISTREND:
p++; l--;
p++;
l--;
break;
default:
if(p[1] & 0x80)
fputc(SS3, fp);
fputc((*p | 0x80), fp); l--; p++;
fputc((*p | 0x80), fp); l--; p++;
fputc((*p | 0x80), fp);
l--;
p++;
fputc((*p | 0x80), fp);
l--;
p++;
}
}
}
void
output_str(FILE *fp, char *p)
{
while (*p) { fputc(*p, fp); p++; }
void output_str(FILE* fp, char* p) {
while(*p) {
fputc(*p, fp);
p++;
}
}
void
output_int(FILE *fp, int *p)
{
void output_int(FILE* fp, int* p) {
while(*p) {
if(*p < 0x100) {
fputc(*p, fp); p++;
}
else if (*p < 0x10000) {
fputc(*p, fp);
p++;
} else if(*p < 0x10000) {
fputc((*p >> 8) & 0xff, fp);
fputc(*p & 0xff, fp); p++;
}
else if (*p < 0x1000000) {
fputc(*p & 0xff, fp);
p++;
} else if(*p < 0x1000000) {
fputc((*p >> 16) & 0xff, fp);
fputc((*p >> 8) & 0xff, fp);
fputc(*p & 0xff, fp); p++;
}
else {
fputc(*p & 0xff, fp);
p++;
} else {
fputc((*p >> 24) & 0xff, fp);
fputc((*p >> 16) & 0xff, fp);
fputc((*p >> 8) & 0xff, fp);
fputc(*p & 0xff, fp); p++;
fputc(*p & 0xff, fp);
p++;
}
}
}
int
yomi2zen(int code)
{
int yomi2zen(int code) {
static char num[] = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
switch(code) {
case 0x01: return 0xa1bc;
case 0x02: return 0xa1f4;
case 0x03: return 0xa1f7;
case 0x04: return 0xa2a9;
case 0xa1: return 0xa5f4;
case 0xa2: return 0xa5f5;
case 0xa3: return 0xa5f6;
default: break;
case 0x01:
return 0xa1bc;
case 0x02:
return 0xa1f4;
case 0x03:
return 0xa1f7;
case 0x04:
return 0xa2a9;
case 0xa1:
return 0xa5f4;
case 0xa2:
return 0xa5f5;
case 0xa3:
return 0xa5f6;
default:
break;
}
if(code < 0x10)
@ -258,11 +257,7 @@ yomi2zen(int code)
return ((num[(code >> 4) & 0x0f] << 8) | num[code & 0x0f]);
}
void
output_yomi(FILE *fp, u_char *p)
{
void output_yomi(FILE* fp, u_char* p) {
int i;
while(*p) {

View file

@ -33,25 +33,20 @@
* $SonyDate: 1996/05/27 06:59:47 $
*/
#include "sj3mkdic.h"
static struct gram_code {
char* name;
int code;
} gramtbl[] = {
#include "GramTable"
};
#define GramMax (sizeof(gramtbl) / sizeof(struct gram_code) - 1)
int
u_strcmp(u_char *a, u_char *b)
{
int u_strcmp(u_char* a, u_char* b) {
if(!a || !b) return 0;
while(*a && *b) {
@ -65,10 +60,7 @@ u_strcmp(u_char *a, u_char *b)
return 1;
}
int
cnvhinsi(u_char *buf)
{
int cnvhinsi(u_char* buf) {
int min;
int max;
int mid;
@ -80,10 +72,8 @@ cnvhinsi(u_char *buf)
mid = (min + max) / 2;
i = u_strcmp(buf, gramtbl[mid].name);
if(i < 0) {
max = mid - 1;
}
@ -97,15 +87,10 @@ cnvhinsi(u_char *buf)
}
}
return 0;
}
char *
hinsi_str(int code)
{
char* hinsi_str(int code) {
int i;
for(i = 0; i <= GramMax; i++) {

View file

@ -44,8 +44,7 @@ typedef struct filelist {
static FileList* flist = NULL;
static char*
get_fname(FILE *fp)
{
get_fname(FILE* fp) {
FileList* p;
for(p = flist; p; p = p->next)
@ -53,9 +52,7 @@ get_fname(FILE *fp)
return "some file";
}
FILE *
Fopen(char *filename, char *type)
{
FILE* Fopen(char* filename, char* type) {
FILE* fp;
char* p;
FileList* fl;
@ -76,9 +73,7 @@ Fopen(char *filename, char *type)
return fp;
}
void
Fclose(FILE *fp)
{
void Fclose(FILE* fp) {
FileList *p, *q;
if(fclose(fp) == EOF) {
@ -99,24 +94,18 @@ Fclose(FILE *fp)
}
}
int
Fseek(FILE *fp, long ofs, int ptr)
{
int Fseek(FILE* fp, long ofs, int ptr) {
if(fseek(fp, ofs, ptr) == 0) return 0;
fprintf(stderr, "Seek error in %s\n", get_fname(fp));
exit(1);
}
long
Ftell(FILE *fp)
{
long Ftell(FILE* fp) {
return ftell(fp);
}
long
Fsize(char *filename)
{
long Fsize(char* filename) {
struct stat buf;
if(stat(filename, &buf) == 0) return (long)buf.st_size;
@ -126,8 +115,7 @@ Fsize(char *filename)
}
size_t
Fread(char *p, int s, int n, FILE *fp)
{
Fread(char* p, int s, int n, FILE* fp) {
if(fread(p, s, n, fp) == n) return n;
fprintf(stderr, "Read error in %s\n", get_fname(fp));
@ -135,22 +123,17 @@ Fread(char *p, int s, int n, FILE *fp)
}
size_t
Fwrite(char *p, int s, int n, FILE *fp)
{
Fwrite(char* p, int s, int n, FILE* fp) {
if(fwrite(p, s, n, fp) == n) return n;
fprintf(stderr, "Write error in %s\n", get_fname(fp));
exit(1);
}
int
Fgetc(FILE *fp)
{
int Fgetc(FILE* fp) {
return fgetc(fp);
}
int
Fflush(FILE *fp)
{
int Fflush(FILE* fp) {
return fflush(fp);
}

View file

@ -33,7 +33,6 @@
* $SonyDate: 1994/06/03 08:00:35 $
*/
#include "sj3_dict_struct.h"
#include "sj3mkdic.h"

View file

@ -33,23 +33,18 @@
* $SonyDate: 1994/08/17 01:50:26 $
*/
#include "sj3_dict_struct.h"
#include "sj3mkdic.h"
int
check_hindo(u_char *ptr, int len)
{
int check_hindo(u_char* ptr, int len) {
int low, high, mid;
int i;
if(hindo_num <= 0) return 0;
low = 0; high = hindo_num - 1;
low = 0;
high = hindo_num - 1;
while(low <= high) {
mid = (low + high) / 2;
i = string_cmp(hindo[mid]->kptr, hindo[mid]->klen, ptr, len);
@ -64,11 +59,8 @@ check_hindo(u_char *ptr, int len)
return 0;
}
static AssyukuRec*
makeassyuku(int num)
{
makeassyuku(int num) {
AssyukuRec* arec;
arec = (AssyukuRec*)Malloc(sizeof(AssyukuRec));
@ -84,11 +76,8 @@ makeassyuku(int num)
return arec;
}
static int
assyuku_len(HindoRec *hrec)
{
assyuku_len(HindoRec* hrec) {
int org;
int old;
int new;
@ -100,19 +89,15 @@ assyuku_len(HindoRec *hrec)
org = check_hindo(p->kptr, p->klen);
old = p->klen * org + 2 * (hrec->exist + hrec->hindo);
new = p->klen + (hrec->exist + hrec->hindo + org);
}
else {
} else {
old = hrec->klen * (hrec->exist + hrec->hindo);
new = hrec->klen + (hrec->exist + hrec->hindo);
}
return (old - new);
}
static void
set_assyuku(HindoRec *hrec)
{
set_assyuku(HindoRec* hrec) {
AssyukuRec* arec;
AssyukuRec* aprev;
int len;
@ -121,15 +106,15 @@ set_assyuku(HindoRec *hrec)
if(len <= 0) return;
arec = assyuku; aprev = NULL;
arec = assyuku;
aprev = NULL;
while(arec) {
if(arec->len == len) {
hrec->arec = arec;
hrec->anext = arec->nrec;
arec->nrec = hrec;
return;
}
else if (arec -> len < len)
} else if(arec->len < len)
break;
aprev = arec;
@ -145,18 +130,14 @@ set_assyuku(HindoRec *hrec)
if(aprev) {
arec->anext = aprev->anext;
aprev->anext = arec;
}
else {
} else {
arec->anext = assyuku;
assyuku = arec;
}
}
static void
reset_assyuku(HindoRec *hrec)
{
reset_assyuku(HindoRec* hrec) {
AssyukuRec* arec;
AssyukuRec* aptr;
AssyukuRec* aprev;
@ -168,7 +149,8 @@ reset_assyuku(HindoRec *hrec)
if(!arec) return;
hrec->arec = NULL;
hptr = arec -> nrec; hprev = NULL;
hptr = arec->nrec;
hprev = NULL;
while(hptr) {
if(hptr == hrec) break;
hprev = hptr;
@ -190,7 +172,8 @@ reset_assyuku(HindoRec *hrec)
}
if(!assyuku) return;
aptr = assyuku; aprev = NULL;
aptr = assyuku;
aprev = NULL;
while(aptr) {
if(aptr == arec) break;
aprev = aptr;
@ -209,11 +192,8 @@ reset_assyuku(HindoRec *hrec)
hrec->anext = NULL;
}
static HindoRec*
makehindo(u_char *ptr, int len, int alen)
{
makehindo(u_char* ptr, int len, int alen) {
HindoRec* hrec;
u_char* p;
@ -233,8 +213,7 @@ makehindo(u_char *ptr, int len, int alen)
hrec->hindo = 0;
hrec->exist = 1;
hrec->offset = ++kanji_num;
}
else {
} else {
hrec->hindo = 1;
hrec->exist = 0;
hrec->offset = 0;
@ -246,11 +225,8 @@ makehindo(u_char *ptr, int len, int alen)
return hrec;
}
static void
set_hindo(u_char *ptr, int len, int alen)
{
set_hindo(u_char* ptr, int len, int alen) {
HindoRec* hrec;
int low, high, mid;
int i;
@ -265,7 +241,8 @@ set_hindo(u_char *ptr, int len, int alen)
return;
}
low = 0; high = hindo_num - 1;
low = 0;
high = hindo_num - 1;
while(low <= high) {
mid = (low + high) / 2;
i = string_cmp(hindo[mid]->kptr, hindo[mid]->klen, ptr, len);
@ -288,8 +265,7 @@ set_hindo(u_char *ptr, int len, int alen)
for(i = hindo_num; i > mid; i--) hindo[i] = hindo[i - 1];
hindo[mid] = hrec;
hindo_num++;
}
else {
} else {
hrec = hindo[mid];
reset_assyuku(hrec);
@ -300,26 +276,23 @@ set_hindo(u_char *ptr, int len, int alen)
else if(len == alen && len > 2) {
hrec->exist = 1;
hrec->offset = ++kanji_num;
}
else
} else
hrec->hindo += 1;
}
set_assyuku(hrec);
}
static void
reset_hindo(u_char *p, int l)
{
reset_hindo(u_char* p, int l) {
HindoRec* hrec;
int low, high, mid;
int i;
if(hindo_num <= 0) return;
low = 0; high = hindo_num - 1;
low = 0;
high = hindo_num - 1;
while(low <= high) {
mid = (low + high) / 2;
i = string_cmp(hindo[mid]->kptr, hindo[mid]->klen, p, l);
@ -344,8 +317,7 @@ reset_hindo(u_char *p, int l)
hindo_num--;
Free(hrec->kptr);
Free(hrec);
}
else {
} else {
set_assyuku(hrec);
}
@ -355,11 +327,7 @@ reset_hindo(u_char *p, int l)
}
}
void
knjhnd_set(u_char *p, int l)
{
void knjhnd_set(u_char* p, int l) {
u_char* kp1;
u_char* kp2;
int i;
@ -370,8 +338,7 @@ knjhnd_set(u_char *p, int l)
for(i = 0, kp2 = kp1; i < kl1;) {
if(codesize(*kp2) == 1) {
tmp[i++] = *kp2++;
}
else if (codesize(*kp2) == 2) {
} else if(codesize(*kp2) == 2) {
tmp[i++] = *kp2++;
tmp[i++] = *kp2++;
} else {
@ -387,11 +354,7 @@ knjhnd_set(u_char *p, int l)
}
}
void
knjhnd_reset(u_char *p, int l)
{
void knjhnd_reset(u_char* p, int l) {
u_char* kp1;
u_char* kp2;
int i;
@ -402,8 +365,7 @@ knjhnd_reset(u_char *p, int l)
for(i = 0, kp2 = kp1; i < kl1;) {
if(codesize(*kp2) == 1) {
tmp[i++] = *kp2++;
}
else if (codesize(*kp2) == 2) {
} else if(codesize(*kp2) == 2) {
tmp[i++] = *kp2++;
tmp[i++] = *kp2++;
} else {
@ -419,11 +381,8 @@ knjhnd_reset(u_char *p, int l)
}
}
static int
check_assyuku(HindoRec *p, HindoRec *q)
{
check_assyuku(HindoRec* p, HindoRec* q) {
u_char ptmp[128], qtmp[128];
int plen;
int qlen;
@ -442,11 +401,7 @@ check_assyuku(HindoRec *p, HindoRec *q)
return 0;
}
int
decide_knjask()
{
int decide_knjask() {
int i, j;
AssyukuRec* p;
HindoRec* q;
@ -464,8 +419,7 @@ decide_knjask()
r = q->kptr;
if(i > 2) {
while(i > 0) {
if ((*r & KANJIMODEMASK)
== OFFSETASSYUKU) {
if((*r & KANJIMODEMASK) == OFFSETASSYUKU) {
break;
}
j = codesize(*r);
@ -485,8 +439,7 @@ decide_knjask()
if(askknj_num >= MAXKNJASKNUMBER)
goto end;
}
}
else {
} else {
askknj[askknj_num++] = q;
len += p->len;
}
@ -514,11 +467,7 @@ end:
return len;
}
void
clear_hindo()
{
void clear_hindo() {
int i;
for(i = 0; i < hindo_num; i++) {
@ -529,11 +478,7 @@ clear_hindo()
kanji_num = 0;
}
void
clear_assyuku()
{
void clear_assyuku() {
AssyukuRec* p;
while(assyuku) {

View file

@ -45,8 +45,7 @@ typedef struct div_list {
} DivList;
static void
free_divlist(DivList *p)
{
free_divlist(DivList* p) {
DivList* q;
while(p) {
@ -56,11 +55,8 @@ free_divlist(DivList *p)
}
}
static DivList*
make_divrec()
{
make_divrec() {
DivList* p;
p = (DivList*)Malloc(sizeof(DivList));
@ -73,11 +69,8 @@ make_divrec()
return p;
}
static int
make_divlist(DivList *parent, u_char *knj, int len)
{
make_divlist(DivList* parent, u_char* knj, int len) {
int i, j;
int num;
int minlen = 0;
@ -126,8 +119,7 @@ make_divlist(DivList *parent, u_char *knj, int len)
*minrec = tmprec;
minlen = tmplen;
}
else
} else
free_divlist(tmprec.child);
}
for(i = 0; i < askknj_num; i++) {
@ -145,8 +137,7 @@ make_divlist(DivList *parent, u_char *knj, int len)
*minrec = tmprec;
minlen = tmplen;
}
else
} else
free_divlist(tmprec.child);
}
@ -155,11 +146,8 @@ make_divlist(DivList *parent, u_char *knj, int len)
return minlen;
}
u_char*
knjofscvt(u_char *ptr, int len, int *ret)
{
knjofscvt(u_char* ptr, int len, int* ret) {
int i;
u_char *p, *q;
DivList parent, *dl;
@ -190,10 +178,8 @@ knjofscvt(u_char *ptr, int len, int *ret)
return p;
}
u_char*
knjcvt(u_char *ptr, int len, int *ret)
{
knjcvt(u_char* ptr, int len, int* ret) {
int i;
u_char *p, *q;
DivList parent, *dl;

Some files were not shown because too many files have changed in this diff Show more