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 $ * $SonyDate: 1994/06/03 08:00:57 $
*/ */
#define SJ3SERV_VERSION_NO 2 #define SJ3SERV_VERSION_NO 2
#define SJ3_CONNECT 1 #define SJ3_CONNECT 1
#define SJ3_DISCONNECT 2 #define SJ3_DISCONNECT 2

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -33,16 +33,10 @@
* $SonyDate: 1994/06/03 08:01:19 $ * $SonyDate: 1994/06/03 08:01:19 $
*/ */
#ifndef _SJ_SUUJI #ifndef _SJ_SUUJI
#define _SJ_SUUJI #define _SJ_SUUJI
#define SJTBLRECLEN 6 #define SJTBLRECLEN 6
#define SJTBLRECNUM 34 #define SJTBLRECNUM 34
#define SjTblYPos(p) (p) #define SjTblYPos(p) (p)
@ -113,21 +107,12 @@
#define SELNUM0123 (JFLAG_N01 | JFLAG_N23) #define SELNUM0123 (JFLAG_N01 | JFLAG_N23)
#define SELNUM1_23_10_1 (JFLAG_N_1 | JFLAG_N23 | JFLAG_N10 | JFLAG_NS1) #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 SELNUMMUST (JFLAG_NK2 | JFLAG_NK4 | JFLAG_NN0 | JFLAG_NSN)
#define SELNUMALL (JFLAG_N10 | JFLAG_N_1 | JFLAG_NS1 | JFLAG_N01 \ #define SELNUMALL (JFLAG_N10 | JFLAG_N_1 | JFLAG_NS1 | JFLAG_N01 | JFLAG_N23 | JFLAG_NK2 | JFLAG_NK4 | JFLAG_NN0 | JFLAG_NSN)
| JFLAG_N23 | JFLAG_NK2 | JFLAG_NK4 \
| JFLAG_NN0 | JFLAG_NSN)
#define SelNumFunc(c) ((c) & (~SELNUMALL)) #define SelNumFunc(c) ((c) & (~SELNUMALL))
#define SelNumCond(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 NUMBER0 (1 << _NUM0)
#define NUMBER1 ((1 << _NUM1) | (1 << _NUM1S)) #define NUMBER1 ((1 << _NUM1) | (1 << _NUM1S))
#define NUMBERS1 (1 << _NUM1S) #define NUMBERS1 (1 << _NUM1S)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -33,9 +33,6 @@
* $SonyDate: 1994/06/03 08:01:46 $ * $SonyDate: 1994/06/03 08:01:46 $
*/ */
#include "sj_rename.h" #include "sj_rename.h"
#include "sj_typedef.h" #include "sj_typedef.h"
@ -45,31 +42,25 @@ VFunc cvtnum_func[] = {
num_type00, num_type01, num_type02, num_type03, num_type00, num_type01, num_type02, num_type03,
num_type04, num_type05, num_type06, num_type07, num_type04, num_type05, num_type06, num_type07,
num_type08, num_type09, num_type10, num_type11, num_type08, num_type09, num_type10, num_type11,
num_type12, num_type13, num_type14 num_type12, num_type13, num_type14};
};
UCPFunc getkan_func[] = { UCPFunc getkan_func[] = {
getkan_norm, getkan_norm, getkan_hira, getkan_kata, getkan_norm, getkan_norm, getkan_hira, getkan_kata,
getkan_knj, getkan_ofs, getkan_norm, getkan_none, getkan_knj, getkan_ofs, getkan_norm, getkan_none,
getkan_norm, getkan_norm, getkan_hira, getkan_kata, 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[] = { IFunc setjrec_func[] = {
setj_norm2, setj_norm2, setj_norm1, setj_norm1, setj_norm2, setj_norm2, setj_norm1, setj_norm1,
setj_knj, setj_ofs, setj_norm2, setj_atrb, setj_knj, setj_ofs, setj_norm2, setj_atrb,
setj_norm2, setj_norm2, setj_norm1, setj_norm1, 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[] = { IFunc hiraknj_func[] = {
hiraknj_hira, hiraknj_norm, hiraknj_hask, hiraknj_kask, hiraknj_hira, hiraknj_norm, hiraknj_hask, hiraknj_kask,
hiraknj_knj, hiraknj_ofs, hiraknj_norm, hiraknj_atrb, hiraknj_knj, hiraknj_ofs, hiraknj_norm, hiraknj_atrb,
hiraknj_hira, hiraknj_norm, hiraknj_hask, hiraknj_kask, 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_1byte(), *makekan_knj(), *makekan_ofs();
u_char *makekan_norm(), *makekan_none(); u_char *makekan_norm(), *makekan_none();
@ -77,5 +68,4 @@ UCPFunc makekan_func[] = {
makekan_norm, makekan_norm, makekan_1byte, makekan_1byte, makekan_norm, makekan_norm, makekan_1byte, makekan_1byte,
makekan_knj, makekan_ofs, makekan_norm, makekan_none, makekan_knj, makekan_ofs, makekan_norm, makekan_none,
makekan_norm, makekan_norm, makekan_1byte, makekan_1byte, 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 $ * $SonyDate: 1994/06/03 08:01:47 $
*/ */
#include "sj_kcnv.h" #include "sj_kcnv.h"
#include "sj_hinsi.h" #include "sj_hinsi.h"
#include "sj_right.h" #include "sj_right.h"
@ -45,8 +41,7 @@
#include "sj_kanakan.h" #include "sj_kanakan.h"
static int static int
fzkstrcmp(u_char *yptr, u_char *fzkp, int *saml) fzkstrcmp(u_char* yptr, u_char* fzkp, int* saml) {
{
int asklen, nkrlen; int asklen, nkrlen;
asklen = FzkAskLen(fzkp); asklen = FzkAskLen(fzkp);
@ -79,11 +74,7 @@ fzkstrcmp(u_char *yptr, u_char *fzkp, int *saml)
return MATCH; return MATCH;
} }
void setclrec(JREC* jrec, u_char* yptr, TypeCnct right) {
void
setclrec(JREC *jrec, u_char *yptr, TypeCnct right)
{
CLREC* new; CLREC* new;
TypeGram hinsi; TypeGram hinsi;
int len; int len;
@ -134,7 +125,6 @@ setclrec(JREC *jrec, u_char *yptr, TypeCnct right)
else if(hinsi == SETUBI_7 || hinsi == SETUBI_8) else if(hinsi == SETUBI_7 || hinsi == SETUBI_8)
new->kubun = K_DOUSHI; new->kubun = K_DOUSHI;
else if(hinsi == D_MEISI_5) else if(hinsi == D_MEISI_5)
new->kubun = K_YOUGEN; new->kubun = K_YOUGEN;
@ -142,8 +132,7 @@ setclrec(JREC *jrec, u_char *yptr, TypeCnct right)
new->kubun = K_YOUGEN; new->kubun = K_YOUGEN;
else else
new->kubun = K_TAIGEN; 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) if(right >= R_I && right <= R_ITADAKE)
new->kubun = K_DOUSHI; new->kubun = K_DOUSHI;
@ -157,14 +146,12 @@ setclrec(JREC *jrec, u_char *yptr, TypeCnct right)
new->kubun = K_DOUSHI; new->kubun = K_DOUSHI;
else else
new->kubun = K_TAIGEN; new->kubun = K_TAIGEN;
} } else
else
new->kubun = K_TAIGEN; new->kubun = K_TAIGEN;
} }
static int static int
fzkcnct(TypeCnct right, TypeCnct left) fzkcnct(TypeCnct right, TypeCnct left) {
{
u_char* cncttbl; u_char* cncttbl;
if(right && left) { if(right && left) {
@ -178,9 +165,7 @@ fzkcnct(TypeCnct right, TypeCnct left)
} }
RECURS RECURS
void void srchfzk(JREC* jrec, u_char* yptr, TypeCnct right, int level) {
srchfzk(JREC *jrec, u_char *yptr, TypeCnct right, int level)
{
u_char* fzk; u_char* fzk;
int len = 0; int len = 0;
int cmp; int cmp;
@ -231,7 +216,6 @@ srchfzk(JREC *jrec, u_char *yptr, TypeCnct right, int level)
if(len) return; if(len) return;
if(!(fzk = Fzkadr(*yptr - _XA))) return; if(!(fzk = Fzkadr(*yptr - _XA))) return;
yptr++; yptr++;
@ -252,7 +236,6 @@ srchfzk(JREC *jrec, u_char *yptr, TypeCnct right, int level)
else if((cmp != MATCH) || isdpnd(*(yptr + len))) else if((cmp != MATCH) || isdpnd(*(yptr + len)))
continue; continue;
fzktbl[fzkcount].yomip = yptr - 1; fzktbl[fzkcount].yomip = yptr - 1;
fzktbl[fzkcount].fzkp = fzk; fzktbl[fzkcount].fzkp = fzk;
fzkcount++; fzkcount++;

View file

@ -33,8 +33,6 @@
* $SonyDate: 1994/06/03 08:01:48 $ * $SonyDate: 1994/06/03 08:01:48 $
*/ */
#include "sj_const.h" #include "sj_const.h"
#include "sj_rename.h" #include "sj_rename.h"
#include "sj_typedef.h" #include "sj_typedef.h"
@ -47,8 +45,7 @@
static u_char fzk_wo[] = { static u_char fzk_wo[] = {
(0 << 5) + 0, L_WO, R_WO, (0 << 5) + 0, L_WO, R_WO,
(0 << 5) + 0, L_WO_S, R_WO_S, (0 << 5) + 0, L_WO_S, R_WO_S,
0xff 0xff};
};
static u_char fzk_xtu[] = { static u_char fzk_xtu[] = {
(0 << 5) + 1, _KE, L_KKE, R_SHUUJO, (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, (2 << 5) + 2, _RO, _U, L_PPOI, R_KAROU,
(1 << 5) + 1, _KU, L_PPOI, R_KRENYOU, (1 << 5) + 1, _KU, L_PPOI, R_KRENYOU,
(1 << 5) + 2, _KE, _RE, L_PPOI, R_KATEI1, (1 << 5) + 2, _KE, _RE, L_PPOI, R_KATEI1,
0xff 0xff};
};
static u_char fzk_a[] = { static u_char fzk_a[] = {
(0 << 5) + 1, _GE, L_YOUGEN, R_AGE, (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) + 0, L_ARE2, R_KATEI2,
(1 << 5) + 3, _BA, _KO, _SO, L_ARE1, R_CUT, (1 << 5) + 3, _BA, _KO, _SO, L_ARE1, R_CUT,
(0 << 5) + 2, _RO, _U, L_AROU, R_AROU, (0 << 5) + 2, _RO, _U, L_AROU, R_AROU,
0xff 0xff};
};
static u_char fzk_i[] = { static u_char fzk_i[] = {
(0 << 5) + 0, L_IRU, R_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, _RU, L_IRU, R_SHUUSI,
(0 << 5) + 1, _RE, L_IRU, R_KATEI2, (0 << 5) + 1, _RE, L_IRU, R_KATEI2,
(0 << 5) + 1, _RO, L_IRU, R_MEIREI1, (0 << 5) + 1, _RO, L_IRU, R_MEIREI1,
0xff 0xff};
};
static u_char fzk_u[] = { static u_char fzk_u[] = {
(0 << 5) + 1, _E, L_UE, R_UE, (0 << 5) + 1, _E, L_UE, R_UE,
(0 << 5) + 1, _TI, L_UTI, R_UTI, (0 << 5) + 1, _TI, L_UTI, R_UTI,
(0 << 5) + 1, _RU, L_ERU, R_SHUUSI, (0 << 5) + 1, _RU, L_ERU, R_SHUUSI,
0xff 0xff};
};
static u_char fzk_e[] = { static u_char fzk_e[] = {
(0 << 5) + 0, L_ERU, R_E, (0 << 5) + 0, L_ERU, R_E,
(0 << 5) + 1, _RU, L_ERU, R_SHUUSI, (0 << 5) + 1, _RU, L_ERU, R_SHUUSI,
(0 << 5) + 1, _RE, L_ERU, R_KATEI3, (0 << 5) + 1, _RE, L_ERU, R_KATEI3,
0xff 0xff};
};
static u_char fzk_o[] = { static u_char fzk_o[] = {
(0 << 5) + 1, _I, L_YOUGEN, R_ONBIN8, (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, (0 << 5) + 1, _RI, L_ORI, R_ORI1,
(1 << 5) + 0, L_YOUGEN, R_ORI2, (1 << 5) + 0, L_YOUGEN, R_ORI2,
(0 << 5) + 1, _RE, L_YOUGEN, R_KAMEI, (0 << 5) + 1, _RE, L_YOUGEN, R_KAMEI,
0xff 0xff};
};
static u_char fzk_ka[] = { static u_char fzk_ka[] = {
(0 << 5) + 0 + 8, L_KA1, R_KA1, (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) + 0, L_KARA2, R_KARA2,
(1 << 5) + 1, _ZU, L_KARAZU, R_ZU, (1 << 5) + 1, _ZU, L_KARAZU, R_ZU,
(1 << 5) + 1, _NU, L_KARAZU, R_NU, (1 << 5) + 1, _NU, L_KARAZU, R_NU,
0xff 0xff};
};
static u_char fzk_ga[] = { static u_char fzk_ga[] = {
(0 << 5) + 0, L_GA1, R_GA1, (0 << 5) + 0, L_GA1, R_GA1,
@ -185,14 +175,12 @@ static u_char fzk_ga[] = {
(2 << 5) + 1, _RA, L_GATIDA, R_KATEI1, (2 << 5) + 1, _RA, L_GATIDA, R_KATEI1,
(1 << 5) + 1, _NI, L_GATIDA, R_DRENYOU2, (1 << 5) + 1, _NI, L_GATIDA, R_DRENYOU2,
(0 << 5) + 2, _TE, _RA, L_GATERA, R_GATERA, (0 << 5) + 2, _TE, _RA, L_GATERA, R_GATERA,
0xff 0xff};
};
static u_char fzk_ki[] = { static u_char fzk_ki[] = {
(0 << 5) + 0, L_YOUGEN, R_FZKKI, (0 << 5) + 0, L_YOUGEN, R_FZKKI,
(0 << 5) + 1, _RI, L_KIRI, R_KIRI, (0 << 5) + 1, _RI, L_KIRI, R_KIRI,
0xff 0xff};
};
static u_char fzk_ku[] = { static u_char fzk_ku[] = {
(0 << 5) + 2, _SE, _NI, L_KUSENI, R_KUSENI, (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, (0 << 5) + 1, _RE, L_YOUGEN, R_KURE,
(1 << 5) + 1, _RU, L_YOUGEN, R_SHUUSI, (1 << 5) + 1, _RU, L_YOUGEN, R_SHUUSI,
(1 << 5) + 1, _RE, L_YOUGEN, R_KATEI3, (1 << 5) + 1, _RE, L_YOUGEN, R_KATEI3,
0xff 0xff};
};
static u_char fzk_gu[] = { static u_char fzk_gu[] = {
(0 << 5) + 2, _RA, _I, L_KURAI, R_KURAI, (0 << 5) + 2, _RA, _I, L_KURAI, R_KURAI,
(0 << 5) + 2, _RU, _MI, L_GURUMI, R_GURUMI, (0 << 5) + 2, _RU, _MI, L_GURUMI, R_GURUMI,
0xff 0xff};
};
static u_char fzk_ke[] = { static u_char fzk_ke[] = {
(0 << 5) + 1, _DO, L_KEDO, R_KEDO, (0 << 5) + 1, _DO, L_KEDO, R_KEDO,
(1 << 5) + 1, _MO, L_KEDO, R_KEDO, (1 << 5) + 1, _MO, L_KEDO, R_KEDO,
(0 << 5) + 2, _RE, _DO, L_KEDO, R_KEDO, (0 << 5) + 2, _RE, _DO, L_KEDO, R_KEDO,
(2 << 5) + 1, _MO, L_KEDO, R_KEDO, (2 << 5) + 1, _MO, L_KEDO, R_KEDO,
0xff 0xff};
};
static u_char fzk_ko[] = { static u_char fzk_ko[] = {
(0 << 5) + 0, L_YOUGEN, R_KO, (0 << 5) + 0, L_YOUGEN, R_KO,
(0 << 5) + 1, _I, L_YOUGEN, R_MEIREI1, (0 << 5) + 1, _I, L_YOUGEN, R_MEIREI1,
(0 << 5) + 1, _SO, L_KOSO, R_KOSO, (0 << 5) + 1, _SO, L_KOSO, R_KOSO,
(0 << 5) + 1, _TO, L_KOTO, R_KOTO, (0 << 5) + 1, _TO, L_KOTO, R_KOTO,
0xff 0xff};
};
static u_char fzk_go[] = { static u_char fzk_go[] = {
(0 << 5) + 2, _ZA, _I, L_GOZAI, R_GOZAI, (0 << 5) + 2, _ZA, _I, L_GOZAI, R_GOZAI,
(0 << 5) + 2, _TO, _KI, L_GOTOSI, R_GOTOKI, (0 << 5) + 2, _TO, _KI, L_GOTOSI, R_GOTOKI,
(1 << 5) + 1, _KU, L_GOTOSI, R_GOTOKU, (1 << 5) + 1, _KU, L_GOTOSI, R_GOTOKU,
(1 << 5) + 1, _SI, L_GOTOSI, R_GOTOSI, (1 << 5) + 1, _SI, L_GOTOSI, R_GOTOSI,
0xff 0xff};
};
static u_char fzk_sa[] = { static u_char fzk_sa[] = {
(0 << 5) + 0, L_SA1, R_MIZEN1, (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, _RU, L_SASERU, R_SHUUSI,
(1 << 5) + 1, _RE, L_SASERU, R_KATEI2, (1 << 5) + 1, _RE, L_SASERU, R_KATEI2,
(1 << 5) + 1, _RO, L_SASERU, R_MEIREI1, (1 << 5) + 1, _RO, L_SASERU, R_MEIREI1,
0xff 0xff};
};
static u_char fzk_za[] = { static u_char fzk_za[] = {
(0 << 5) + 1, _RU, L_ZARU, R_ZARU, (0 << 5) + 1, _RU, L_ZARU, R_ZARU,
(0 << 5) + 1, _RE, L_ZARU, R_KATEI2, (0 << 5) + 1, _RE, L_ZARU, R_KATEI2,
0xff 0xff};
};
static u_char fzk_si[] = { static u_char fzk_si[] = {
(0 << 5) + 0, L_SI1, R_SI1, (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, _XTU, L_YOUGEN, R_ONBIN6,
(1 << 5) + 1, _WA, L_YOUGEN, R_MIZEN5, (1 << 5) + 1, _WA, L_YOUGEN, R_MIZEN5,
(0 << 5) + 1, _RO, L_SIRO, R_MEIREI1, (0 << 5) + 1, _RO, L_SIRO, R_MEIREI1,
0xff 0xff};
};
static u_char fzk_ji[] = { static u_char fzk_ji[] = {
(0 << 5) + 2, _MA, _I, L_JIMAU, R_IKI, (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) + 2, _O, _U, L_JYAU, R_AROU,
(1 << 5) + 1, _XTU, L_JYAU, R_ONBIN6, (1 << 5) + 1, _XTU, L_JYAU, R_ONBIN6,
(1 << 5) + 1, _WA, L_JYAU, R_MIZEN5, (1 << 5) + 1, _WA, L_JYAU, R_MIZEN5,
0xff 0xff};
};
static u_char fzk_su[] = { static u_char fzk_su[] = {
(0 << 5) + 1, _GI, L_SUGIRU, R_SUGI, (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, _RA, L_SURA, R_SURA,
(0 << 5) + 1, _RU, L_SURU, R_SHUUSI, (0 << 5) + 1, _RU, L_SURU, R_SHUUSI,
(0 << 5) + 1, _RE, L_SURE, R_KATEI2, (0 << 5) + 1, _RE, L_SURE, R_KATEI2,
0xff 0xff};
};
static u_char fzk_zu[] = { static u_char fzk_zu[] = {
(0 << 5) + 0, L_ZU, R_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, (0 << 5) + 2, _NI, _I, L_ZU, R_I,
(2 << 5) + 1, _RU, L_ZU, R_SHUUSI, (2 << 5) + 1, _RU, L_ZU, R_SHUUSI,
(0 << 5) + 2, _NN, _BA, L_ZUNBA, R_CUT, (0 << 5) + 2, _NN, _BA, L_ZUNBA, R_CUT,
0xff 0xff};
};
static u_char fzk_se[] = { static u_char fzk_se[] = {
(0 << 5) + 0, L_SE, R_MIZEN2, (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, _RU, L_SERU, R_SHUUSI,
(0 << 5) + 1, _RE, L_SERU, R_KATEI2, (0 << 5) + 1, _RE, L_SERU, R_KATEI2,
(0 << 5) + 1, _RO, L_SERU, R_MEIREI1, (0 << 5) + 1, _RO, L_SERU, R_MEIREI1,
0xff 0xff};
};
static u_char fzk_ze[] = { static u_char fzk_ze[] = {
(0 << 5) + 0, L_ZE, R_SHUUJO, (0 << 5) + 0, L_ZE, R_SHUUJO,
0xff 0xff};
};
static u_char fzk_so[] = { static u_char fzk_so[] = {
(0 << 5) + 1, _U, L_SOUDA, R_SOU, (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) + 0, L_YOUTAI, R_SOUNA2,
(2 << 5) + 1, _RA, L_SOUDA, R_KATEI1, (2 << 5) + 1, _RA, L_SOUDA, R_KATEI1,
(1 << 5) + 1, _NI, L_YOUTAI, R_SOUNI, (1 << 5) + 1, _NI, L_YOUTAI, R_SOUNI,
0xff 0xff};
};
static u_char fzk_zo[] = { static u_char fzk_zo[] = {
(0 << 5) + 0, L_ZO, R_SHUUJO, (0 << 5) + 0, L_ZO, R_SHUUJO,
0xff 0xff};
};
static u_char fzk_ta[] = { static u_char fzk_ta[] = {
(0 << 5) + 0, L_TA, R_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, _RI, L_TA, R_TARI,
(0 << 5) + 1, _RU, L_TARU, R_CUT, (0 << 5) + 1, _RU, L_TARU, R_CUT,
(0 << 5) + 2, _RO, _U, L_TA, R_KAROU, (0 << 5) + 2, _RO, _U, L_TA, R_KAROU,
0xff 0xff};
};
static u_char fzk_da[] = { static u_char fzk_da[] = {
(0 << 5) + 0, L_DA1, R_TA, (0 << 5) + 0, L_DA1, R_TA,
@ -388,8 +360,7 @@ static u_char fzk_da[] = {
(1 << 5) + 1, _KE, L_DARAKE, R_DARAKE, (1 << 5) + 1, _KE, L_DARAKE, R_DARAKE,
(0 << 5) + 1, _RI, L_DA1, R_TARI, (0 << 5) + 1, _RI, L_DA1, R_TARI,
(0 << 5) + 2, _RO, _U, L_DAROU, R_DAROU, (0 << 5) + 2, _RO, _U, L_DAROU, R_DAROU,
0xff 0xff};
};
static u_char fzk_ti[] = { static u_char fzk_ti[] = {
(0 << 5) + 2, _MA, _I, L_TIMAU, R_IKI, (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) + 2, _O, _U, L_TYAU, R_AROU,
(1 << 5) + 1, _XTU, L_TYAU, R_ONBIN6, (1 << 5) + 1, _XTU, L_TYAU, R_ONBIN6,
(1 << 5) + 1, _WA, L_TYAU, R_MIZEN5, (1 << 5) + 1, _WA, L_TYAU, R_MIZEN5,
0xff 0xff};
};
static u_char fzk_di[] = { static u_char fzk_di[] = {
(0 << 5) + 1, _XYA, L_JYA, R_JYA, (0 << 5) + 1, _XYA, L_JYA, R_JYA,
0xff 0xff};
};
static u_char fzk_tu[] = { static u_char fzk_tu[] = {
(0 << 5) + 2, _I, _TE, L_TUITE, R_TUITE, (0 << 5) + 2, _I, _TE, L_TUITE, R_TUITE,
(0 << 5) + 1, _KI, L_TUKI, R_TUKI, (0 << 5) + 1, _KI, L_TUKI, R_TUKI,
(0 << 5) + 1, _TU, L_TUTU, R_TUTU, (0 << 5) + 1, _TU, L_TUTU, R_TUTU,
(0 << 5) + 2, _MO, _RI, L_TUMORI, R_TUMORI, (0 << 5) + 2, _MO, _RI, L_TUMORI, R_TUMORI,
0xff 0xff};
};
static u_char fzk_te[] = { static u_char fzk_te[] = {
(0 << 5) + 0, L_TE1, R_TE1, (0 << 5) + 0, L_TE1, R_TE1,
(0 << 5) + 0, L_TE2, R_TE2, (0 << 5) + 0, L_TE2, R_TE2,
(0 << 5) + 1, _RU, L_TERU, R_TERU, (0 << 5) + 1, _RU, L_TERU, R_TERU,
0xff 0xff};
};
static u_char fzk_de[] = { static u_char fzk_de[] = {
(0 << 5) + 0, L_DE, R_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, _SU, L_DESU, R_DESU,
(0 << 5) + 1, _HA, L_DEHA, R_DEHA, (0 << 5) + 1, _HA, L_DEHA, R_DEHA,
(0 << 5) + 1, _RU, L_DERU, R_TERU, (0 << 5) + 1, _RU, L_DERU, R_TERU,
0xff 0xff};
};
static u_char fzk_to[] = { static u_char fzk_to[] = {
(0 << 5) + 0, L_TO1, R_TO1, (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) + 1, _TE, L_TOTE, R_TOTE,
(0 << 5) + 3, _HA, _I, _E, L_TOHAIE, R_TOHAIE, (0 << 5) + 3, _HA, _I, _E, L_TOHAIE, R_TOHAIE,
(0 << 5) + 1, _MO, L_TOMO, R_TOMO, (0 << 5) + 1, _MO, L_TOMO, R_TOMO,
0xff 0xff};
};
static u_char fzk_do[] = { static u_char fzk_do[] = {
(0 << 5) + 0, L_DO, R_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, (1 << 5) + 1, _RO, L_DOKORO, R_DOKORO,
(2 << 5) + 1, _KA, L_DOKOROKA, R_DOKOROKA, (2 << 5) + 1, _KA, L_DOKOROKA, R_DOKOROKA,
(0 << 5) + 1, _MO, L_DOMO, R_DOMO, (0 << 5) + 1, _MO, L_DOMO, R_DOMO,
0xff 0xff};
};
static u_char fzk_na[] = { static u_char fzk_na[] = {
(0 << 5) + 0, L_NA1, R_SHUUJO, (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, (0 << 5) + 2, _NN, _KA, L_NANKA, R_NANKA,
(1 << 5) + 1, _ZO, L_NANZO, R_NANZO, (1 << 5) + 1, _ZO, L_NANZO, R_NANZO,
(1 << 5) + 1, _TE, L_NANTE, R_NANTE, (1 << 5) + 1, _TE, L_NANTE, R_NANTE,
0xff 0xff};
};
static u_char fzk_ni[] = { static u_char fzk_ni[] = {
(0 << 5) + 0, L_NI1, R_NI1, (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) + 1, _TE, L_NITE, R_NITE,
(0 << 5) + 2, _DE, _MO, L_NI1, R_MO1, (0 << 5) + 2, _DE, _MO, L_NI1, R_MO1,
(0 << 5) + 1, _MO, L_NIMO, R_NIMO, (0 << 5) + 1, _MO, L_NIMO, R_NIMO,
0xff 0xff};
};
static u_char fzk_nu[] = { static u_char fzk_nu[] = {
(0 << 5) + 0, L_NU, R_NU, (0 << 5) + 0, L_NU, R_NU,
0xff 0xff};
};
static u_char fzk_ne[] = { static u_char fzk_ne[] = {
(0 << 5) + 0, L_NE1, R_SHUUJO, (0 << 5) + 0, L_NE1, R_SHUUJO,
(0 << 5) + 0, L_NE2, R_KATEI2, (0 << 5) + 0, L_NE2, R_KATEI2,
(0 << 5) + 1, _E, L_NEE, R_SHUUJO, (0 << 5) + 1, _E, L_NEE, R_SHUUJO,
0xff 0xff};
};
static u_char fzk_no[] = { static u_char fzk_no[] = {
(0 << 5) + 0, L_NO1, R_NO1, (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, _NI, L_NONI, R_NONI,
(0 << 5) + 1, _MI, L_NOMI, R_NOMI, (0 << 5) + 1, _MI, L_NOMI, R_NOMI,
(1 << 5) + 3, _NA, _RA, _ZU, L_NOMINRZ, R_NOMINRZ, (1 << 5) + 3, _NA, _RA, _ZU, L_NOMINRZ, R_NOMINRZ,
0xff 0xff};
};
static u_char fzk_ha[] = { static u_char fzk_ha[] = {
(0 << 5) + 0, L_HA, R_HA, (0 << 5) + 0, L_HA, R_HA,
(0 << 5) + 1, _SI, L_HA, R_HASI, (0 << 5) + 1, _SI, L_HA, R_HASI,
(0 << 5) + 1, _ZU, L_HAZU, R_HAZU, (0 << 5) + 1, _ZU, L_HAZU, R_HAZU,
0xff 0xff};
};
static u_char fzk_ba[] = { static u_char fzk_ba[] = {
(0 << 5) + 0, L_BA, R_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, (1 << 5) + 1, _RI, L_BAKARI, R_BAKARI,
(0 << 5) + 3, _XTU, _KA, _SI, L_BAKARI, R_BAKARI, (0 << 5) + 3, _XTU, _KA, _SI, L_BAKARI, R_BAKARI,
(2 << 5) + 1, _RI, L_BAKARI, R_BAKARI, (2 << 5) + 1, _RI, L_BAKARI, R_BAKARI,
0xff 0xff};
};
static u_char fzk_hu[] = { static u_char fzk_hu[] = {
(0 << 5) + 2, _U, _DA, L_FUUDA, R_SOUDA, (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, (1 << 5) + 1, _NA, L_FUUDA, R_SOUNA2,
(2 << 5) + 1, _RA, L_FUUDA, R_KATEI1, (2 << 5) + 1, _RA, L_FUUDA, R_KATEI1,
(1 << 5) + 1, _NI, L_FUUDA, R_FUUNI, (1 << 5) + 1, _NI, L_FUUDA, R_FUUNI,
0xff 0xff};
};
static u_char fzk_he[] = { static u_char fzk_he[] = {
(0 << 5) + 0, L_HE, R_HE, (0 << 5) + 0, L_HE, R_HE,
0xff 0xff};
};
static u_char fzk_be[] = { static u_char fzk_be[] = {
(0 << 5) + 2, _KA, _RA, L_BESI, R_BEKARA, (0 << 5) + 2, _KA, _RA, L_BESI, R_BEKARA,
(0 << 5) + 1, _KI, L_BESI, R_BEKI, (0 << 5) + 1, _KI, L_BESI, R_BEKI,
(0 << 5) + 1, _KU, L_BESI, R_BEKU, (0 << 5) + 1, _KU, L_BESI, R_BEKU,
(0 << 5) + 1, _SI, L_BESI, R_BESI, (0 << 5) + 1, _SI, L_BESI, R_BESI,
0xff 0xff};
};
static u_char fzk_ho[] = { static u_char fzk_ho[] = {
(0 << 5) + 1, _U, L_HOU, R_HOU, (0 << 5) + 1, _U, L_HOU, R_HOU,
(0 << 5) + 1, _KA, L_HOKA, R_HOKA, (0 << 5) + 1, _KA, L_HOKA, R_HOKA,
(0 << 5) + 1, _DO, L_HODO, R_HODO, (0 << 5) + 1, _DO, L_HODO, R_HODO,
0xff 0xff};
};
static u_char fzk_ma[] = { static u_char fzk_ma[] = {
(0 << 5) + 1, _I, L_MAI, R_MAI, (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, (1 << 5) + 1, _NN, L_MASU, R_NN2,
(0 << 5) + 1, _DE, L_MADE, R_MADE, (0 << 5) + 1, _DE, L_MADE, R_MADE,
(0 << 5) + 1, _MA, L_MAMA, R_MAMA, (0 << 5) + 1, _MA, L_MAMA, R_MAMA,
0xff 0xff};
};
static u_char fzk_mi[] = { static u_char fzk_mi[] = {
(0 << 5) + 0, L_YOUGEN, R_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, _RU, L_YOUGEN, R_SHUUSI,
(0 << 5) + 1, _RE, L_YOUGEN, R_KATEI2, (0 << 5) + 1, _RE, L_YOUGEN, R_KATEI2,
(0 << 5) + 1, _RO, L_YOUGEN, R_MEIREI1, (0 << 5) + 1, _RO, L_YOUGEN, R_MEIREI1,
0xff 0xff};
};
static u_char fzk_mo[] = { static u_char fzk_mo[] = {
(0 << 5) + 0, L_MO1, R_MO1, (0 << 5) + 0, L_MO1, R_MO1,
@ -656,8 +607,7 @@ static u_char fzk_mo[] = {
(1 << 5) + 1, _WA, L_YOUGEN, R_MIZEN5, (1 << 5) + 1, _WA, L_YOUGEN, R_MIZEN5,
(0 << 5) + 1, _NN, L_WAYO, R_SHUUJO, (0 << 5) + 1, _NN, L_WAYO, R_SHUUJO,
(1 << 5) + 1, _KA, L_WAYO, R_SHUUJO, (1 << 5) + 1, _KA, L_WAYO, R_SHUUJO,
0xff 0xff};
};
static u_char fzk_ya[] = { static u_char fzk_ya[] = {
(0 << 5) + 0, L_YA1, R_YA1, (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, _RU, L_YOUGEN, R_SHUUSI,
(0 << 5) + 1, _RE, L_YOUGEN, R_KATEI2, (0 << 5) + 1, _RE, L_YOUGEN, R_KATEI2,
(0 << 5) + 2, _RO, _U, L_YOUGEN, R_AROU, (0 << 5) + 2, _RO, _U, L_YOUGEN, R_AROU,
0xff 0xff};
};
static u_char fzk_yu[] = { static u_char fzk_yu[] = {
(0 << 5) + 1, _E, L_YUE, R_YUE, (0 << 5) + 1, _E, L_YUE, R_YUE,
0xff 0xff};
};
static u_char fzk_yo[] = { static u_char fzk_yo[] = {
(0 << 5) + 0, L_YO, R_SHUUJO, (0 << 5) + 0, L_YO, R_SHUUJO,
@ -713,8 +661,7 @@ static u_char fzk_yo[] = {
(1 << 5) + 0, L_YORU, R_YORI2, (1 << 5) + 0, L_YORU, R_YORI2,
(0 << 5) + 1, _RU, L_YORU, R_SHUUSI, (0 << 5) + 1, _RU, L_YORU, R_SHUUSI,
(0 << 5) + 1, _RE, L_YORU, R_KATEI3, (0 << 5) + 1, _RE, L_YORU, R_KATEI3,
0xff 0xff};
};
static u_char fzk_ra[] = { static u_char fzk_ra[] = {
(0 << 5) + 2, _SI, _I, L_RASII, R_RASII, (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, _RU, L_RARERU, R_SHUUSI,
(1 << 5) + 1, _RE, L_RARERU, R_KATEI2, (1 << 5) + 1, _RE, L_RARERU, R_KATEI2,
(1 << 5) + 1, _RO, L_RARERU, R_MEIREI1, (1 << 5) + 1, _RO, L_RARERU, R_MEIREI1,
0xff 0xff};
};
static u_char fzk_re[] = { static u_char fzk_re[] = {
(0 << 5) + 0, L_RERU, R_RARE, (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, _RU, L_RERU, R_SHUUSI,
(0 << 5) + 1, _RE, L_RERU, R_KATEI2, (0 << 5) + 1, _RE, L_RERU, R_KATEI2,
(0 << 5) + 1, _RO, L_RERU, R_MEIREI1, (0 << 5) + 1, _RO, L_RERU, R_MEIREI1,
0xff 0xff};
};
static u_char fzk_wa[] = { static u_char fzk_wa[] = {
(0 << 5) + 0, L_WA, R_SHUUJO, (0 << 5) + 0, L_WA, R_SHUUJO,
(0 << 5) + 1, _KE, L_WAKE, R_WAKE, (0 << 5) + 1, _KE, L_WAKE, R_WAKE,
(0 << 5) + 1, _NE, L_WANE, R_SHUUJO, (0 << 5) + 1, _NE, L_WANE, R_SHUUJO,
(0 << 5) + 1, _YO, L_WAYO, R_SHUUJO, (0 << 5) + 1, _YO, L_WAYO, R_SHUUJO,
0xff 0xff};
};
static u_char fzk_nn[] = { static u_char fzk_nn[] = {
(0 << 5) + 0, L_NN1, R_NN1, (0 << 5) + 0, L_NN1, R_NN1,
(0 << 5) + 0, L_NN2, R_NN2, (0 << 5) + 0, L_NN2, R_NN2,
0xff 0xff};
};
u_char* fzkadr[] = { u_char* fzkadr[] = {
0, fzk_a, 0, fzk_i, 0, 0, fzk_a, 0, fzk_i, 0,
@ -772,5 +713,4 @@ u_char *fzkadr[] = {
fzk_mo, 0, fzk_ya, 0, fzk_yu, fzk_mo, 0, fzk_ya, 0, fzk_yu,
0, fzk_yo, fzk_ra, 0, 0, 0, fzk_yo, fzk_ra, 0, 0,
fzk_re, 0, 0, fzk_wa, 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 $ * $SonyDate: 1994/06/03 08:01:49 $
*/ */
#include "sj_euc.h" #include "sj_euc.h"
#include "sj_kcnv.h" #include "sj_kcnv.h"
@ -44,14 +41,12 @@
static u_char* code2kanji(); static u_char* code2kanji();
u_char* 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; return d;
} }
u_char* 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; int cnt, csize;
csize = codesize(*s); csize = codesize(*s);
@ -67,8 +62,7 @@ getkan_hira(u_char *s, u_char *d, u_char *ym, int yl, int flg)
} }
u_char* 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; int cnt, csize;
u_char ch; u_char ch;
@ -83,14 +77,12 @@ getkan_kata(u_char *s, u_char *d, u_char *ym, int yl, int flg)
ch = *++ym; ch = *++ym;
if(0xa1 <= ch && ch <= 0xf3) { if(0xa1 <= ch && ch <= 0xf3) {
*d++ = 0xa5; *d++ = 0xa5;
} } else {
else {
*d++ = 0xa4; *d++ = 0xa4;
} }
*d++ = ch; *d++ = ch;
ym++; ym++;
} } else {
else {
*d++ = *ym++; *d++ = *ym++;
*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* 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); return code2kanji(askknj[*s & KNJASSYUKUMASK], d, ym, yl, flg);
} }
u_char* 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), return code2kanji(dicbuf + ((*s & KANJICODEMASK) << 8) + *(s + 1),
d, ym, yl, flg); d, ym, yl, flg);
} }
u_char* 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; u_char c;
if(*s != 0) { if(*s != 0) {
@ -132,8 +119,7 @@ getkan_norm(u_char *s, u_char *d, u_char *ym, int yl, int flg)
} }
u_char* 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; u_char c;
c = s[1]; 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* 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; int csize;
for(;;) { for(;;) {
@ -154,47 +139,58 @@ code2kanji(u_char *s, u_char *d, u_char *ym, int yl, int flg)
if(s[csize] == KANJISTREND) { if(s[csize] == KANJISTREND) {
switch(*s & KANJIMODEMASK) { switch(*s & KANJIMODEMASK) {
case ZENHIRAASSYUKU: case ZENHIRAASSYUKU:
d = getkan_hira(s, d, ym, yl, flg); break; d = getkan_hira(s, d, ym, yl, flg);
break;
case ZENKATAASSYUKU: case ZENKATAASSYUKU:
d = getkan_kata(s, d, ym, yl, flg); break; d = getkan_kata(s, d, ym, yl, flg);
break;
case OFFSETASSYUKU: case OFFSETASSYUKU:
d = getkan_ofs(s, d, ym, yl, flg); break; d = getkan_ofs(s, d, ym, yl, flg);
break;
case AIATTRIBUTE: case AIATTRIBUTE:
d = getkan_none(s, d, ym, yl, flg); break; d = getkan_none(s, d, ym, yl, flg);
break;
case LEADINGHANKAKU: case LEADINGHANKAKU:
d = getkan_ascii(s, d, ym, yl, flg); break; d = getkan_ascii(s, d, ym, yl, flg);
break;
case KANJIASSYUKU: case KANJIASSYUKU:
d = getkan_knj(s, d, ym, yl, flg); break; d = getkan_knj(s, d, ym, yl, flg);
break;
default: default:
d = getkan_norm(s, d, ym, yl, flg); d = getkan_norm(s, d, ym, yl, flg);
} }
break; break;
} } else
else
switch(*s & KANJIMODEMASK) { switch(*s & KANJIMODEMASK) {
case ZENHIRAASSYUKU: case ZENHIRAASSYUKU:
d = getkan_hira(s, d, ym, yl, FALSE); break; d = getkan_hira(s, d, ym, yl, FALSE);
break;
case ZENKATAASSYUKU: case ZENKATAASSYUKU:
d = getkan_kata(s, d, ym, yl, FALSE); break; d = getkan_kata(s, d, ym, yl, FALSE);
break;
case OFFSETASSYUKU: case OFFSETASSYUKU:
d = getkan_ofs(s, d, ym, yl, FALSE); break; d = getkan_ofs(s, d, ym, yl, FALSE);
break;
case AIATTRIBUTE: case AIATTRIBUTE:
d = getkan_none(s, d, ym, yl, FALSE); break; d = getkan_none(s, d, ym, yl, FALSE);
break;
case LEADINGHANKAKU: case LEADINGHANKAKU:
d = getkan_ascii(s, d, ym, yl, FALSE); break; d = getkan_ascii(s, d, ym, yl, FALSE);
break;
case KANJIASSYUKU: case KANJIASSYUKU:
d = getkan_knj(s, d, ym, yl, FALSE); break; d = getkan_knj(s, d, ym, yl, FALSE);
break;
default: default:
d = getkan_norm(s, d, ym, yl, FALSE); 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; 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; u_char* q;
q = code2kanji(ptr, buf, ym, yl, TRUE); q = code2kanji(ptr, buf, ym, yl, TRUE);
return q - buf; return q - buf;
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -33,8 +33,6 @@
* $SonyDate: 1994/06/03 08:02:11 $ * $SonyDate: 1994/06/03 08:02:11 $
*/ */
#include "sj_rename.h" #include "sj_rename.h"
#include "sj_typedef.h" #include "sj_typedef.h"
@ -75,30 +73,176 @@ u_char taipri[7][45] = {
{0, 5, 6, 6, 6, 6, 5, 6, 6, 6, {0, 5, 6, 6, 6, 6, 5, 6, 6, 6,
6, 6, 3, 3, 3, 3, 3, 5, 0, 0, 6, 6, 3, 3, 3, 3, 3, 5, 0, 0,
0, 3, 3, 3, 3, 3, 5, 5, 5, 5, 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] = { 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,
0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, }, 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, 4,
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,
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, 4,
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,
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,
0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 15, }, 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,
0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, } 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 $ * $SonyDate: 1995/07/21 05:22:51 $
*/ */
#include "sj_rename.h" #include "sj_rename.h"
#include "sj_typedef.h" #include "sj_typedef.h"
#include "sj_yomi.h" #include "sj_yomi.h"
@ -149,5 +147,4 @@ u_char kigou[] = {
Y_KIGOU, Y_KIGOU,
Y_KIGOU, Y_KIGOU,
Y_KIGOU, Y_KIGOU,
Y_KIGOU Y_KIGOU};
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -33,9 +33,6 @@
* $SonyDate: 1994/06/03 08:02:34 $ * $SonyDate: 1994/06/03 08:02:34 $
*/ */
#include "sj_rename.h" #include "sj_rename.h"
#include "sj_typedef.h" #include "sj_typedef.h"
#include "sj_yomi.h" #include "sj_yomi.h"
@ -56,8 +53,7 @@ static u_char name_stb[] = {
0xa4, 0xc1, 0xa4, 0xe3, 0xa4, 0xf3, 0xa4, 0xc1, 0xa4, 0xe3, 0xa4, 0xf3,
0x22, MEISI_1, _DO, _NO, 0x22, MEISI_1, _DO, _NO,
0xc5, 0xc2, 0xc5, 0xc2,
0x00 0x00};
};
static u_char timei_stb[] = { static u_char timei_stb[] = {
0x22, MEISI_1, _E, _KI, 0x22, MEISI_1, _E, _KI,
@ -78,8 +74,7 @@ static u_char timei_stb[] = {
0xc4, 0xae, 0xc4, 0xae,
0x22, MEISI_1, _MU, _RA, 0x22, MEISI_1, _MU, _RA,
0xc2, 0xbc, 0xc2, 0xbc,
0x00 0x00};
};
static u_char meisi_stb[] = { static u_char meisi_stb[] = {
0x44, MEISI_6, _A, _TU, _KA, _I, 0x44, MEISI_6, _A, _TU, _KA, _I,
@ -94,8 +89,7 @@ static u_char meisi_stb[] = {
0xa4, 0xcb, 0xc8, 0xbc, 0xa4, 0xa6, 0xa4, 0xcb, 0xc8, 0xbc, 0xa4, 0xa6,
0x22, MEISI_8, _HU, _U, 0x22, MEISI_8, _HU, _U,
0xc9, 0xf7, 0xc9, 0xf7,
0x00 0x00};
};
static u_char sahen_stb[] = { static u_char sahen_stb[] = {
0x44, MEISI_6, _A, _TU, _KA, _I, 0x44, MEISI_6, _A, _TU, _KA, _I,
@ -120,28 +114,44 @@ static u_char sahen_stb[] = {
0xc9, 0xf7, 0xc9, 0xf7,
0x22, MEISI_11, _MA, _E, 0x22, MEISI_11, _MA, _E,
0xc1, 0xb0, 0xc1, 0xb0,
0x00 0x00};
};
static u_char human_stb[] = { static u_char human_stb[] = {
0x24, MEISI_1, _SA, _NN, 0x24, MEISI_1, _SA, _NN,
0xa4, 0xb5, 0xa4, 0xf3, 0xa4, 0xb5, 0xa4, 0xf3,
0x00 0x00};
};
static u_char ippan_stb[] = { static u_char ippan_stb[] = {
0x56, FUKUSI_1, _NI, _TO, _MO, _NA, _I, 0x56, FUKUSI_1, _NI, _TO, _MO, _NA, _I,
0xa4, 0xcb, 0xc8, 0xbc, 0xa4, 0xa4, 0xa4, 0xcb, 0xc8, 0xbc, 0xa4, 0xa4,
0x56, FUKUSI_1, _NI, _TO, _MO, _NA, _U, 0x56, FUKUSI_1, _NI, _TO, _MO, _NA, _U,
0xa4, 0xcb, 0xc8, 0xbc, 0xa4, 0xa6, 0xa4, 0xcb, 0xc8, 0xbc, 0xa4, 0xa6,
0x00 0x00};
};
u_char* stbadr[] = { u_char* stbadr[] = {
0, 0,
ippan_stb, ippan_stb, ippan_stb, meisi_stb, sahen_stb, ippan_stb,
sahen_stb, sahen_stb, meisi_stb, meisi_stb, meisi_stb, ippan_stb,
ippan_stb, ippan_stb, human_stb, ippan_stb, ippan_stb, ippan_stb,
ippan_stb, ippan_stb, ippan_stb, 0, 0, meisi_stb,
name_stb, name_stb, 0, timei_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 $ * $SonyDate: 1994/06/03 08:02:37 $
*/ */
#include "sj_rename.h" #include "sj_rename.h"
#include "sj_typedef.h" #include "sj_typedef.h"
#include "sj_kanakan.h" #include "sj_kanakan.h"
static u_char o_settou[] = { static u_char o_settou[] = {
0xA1, 0xb8, 0xe6, 0xa4, 0xaa 0xA1, 0xb8, 0xe6, 0xa4, 0xaa};
};
static u_char go_settou[] = { static u_char go_settou[] = {
0xA1, 0xb8, 0xe6, 0xa4, 0xb4 0xA1, 0xb8, 0xe6, 0xa4, 0xb4};
};
static u_char dai_settou[] = { static u_char dai_settou[] = {
0x22, 0xc2, 0xe8, 0xc2, 0xe8 0x22, 0xc2, 0xe8, 0xc2, 0xe8};
};
static u_char kigou_settou[] = { static u_char kigou_settou[] = {
0x01 0x01};
};
u_char* settou_ptr[] = { 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] = { u_char scncttbl[2][24] = {
{ {
0x48, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x18, 0x18, 0x00, 0x00, 0x1f, 0xf0, 0x00, 0xff, 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, 0x22, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 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" #include "sj_kanakan.h"
int int study(STDYOUT* stdy) {
study(STDYOUT *stdy)
{
STDYOUT outp; STDYOUT outp;
STDYIN* p1; STDYIN* p1;
STDYIN* p2; STDYIN* p2;
@ -76,10 +74,11 @@ study(STDYOUT *stdy)
return STUDYNORMEND; return STUDYNORMEND;
} }
if(STUDYCOUNT >= STUDYMAX) { if(STUDYCOUNT >= STUDYMAX) {
p1 = STUDYDICT; p2 = NULL; wi = 0; p1 = STUDYDICT;
p2 = NULL;
wi = 0;
for(wcnt = STUDYMAX; wcnt--; p1++) { for(wcnt = STUDYMAX; wcnt--; p1++) {
if((nm = p1->styno + 1) > wi) { if((nm = p1->styno + 1) > wi) {
wi = nm; wi = nm;
@ -93,13 +92,11 @@ study(STDYOUT *stdy)
mvmemi((u_char*)(p2 + 1), (u_char*)p2, mvmemi((u_char*)(p2 + 1), (u_char*)p2,
(STUDYTAIL - p2) * STUDYRECSIZE); (STUDYTAIL - p2) * STUDYRECSIZE);
STUDYCOUNT -= 1; STUDYCOUNT -= 1;
} } else
else
return STUDYERROR; return STUDYERROR;
ret = STUDYFULLAREA; ret = STUDYFULLAREA;
} } else {
else {
p1 = STUDYDICT; p1 = STUDYDICT;
for(wcnt = STUDYCOUNT; wcnt--; p1++) p1->styno++; for(wcnt = STUDYCOUNT; wcnt--; p1++) p1->styno++;
@ -109,7 +106,8 @@ study(STDYOUT *stdy)
p1 = STUDYDICT; p1 = STUDYDICT;
seg = outp.stdy1.seg; seg = outp.stdy1.seg;
for(wcnt = STUDYCOUNT; wcnt && (p1->seg < seg);) { for(wcnt = STUDYCOUNT; wcnt && (p1->seg < seg);) {
wcnt--; p1++; wcnt--;
p1++;
} }
ofs = outp.stdy1.offset; ofs = outp.stdy1.offset;
@ -135,14 +133,12 @@ study(STDYOUT *stdy)
} }
STDYIN* STDYIN*
srchstdy(TypeDicSeg seg, TypeDicOfs ofs, TypeDicID dicid) srchstdy(TypeDicSeg seg, TypeDicOfs ofs, TypeDicID dicid) {
{
int high; int high;
int mid; int mid;
int low; int low;
STDYIN* ptr; STDYIN* ptr;
if(!StudyExist()) return NULL; if(!StudyExist()) return NULL;
if(!STUDYCOUNT || !ofs) return NULL; if(!STUDYCOUNT || !ofs) return NULL;
@ -184,4 +180,3 @@ srchstdy(TypeDicSeg seg, TypeDicOfs ofs, TypeDicID dicid)
return NULL; return NULL;
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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