0
|
1 /*
|
|
2 * $Id: rk_multi.h,v 1.2 2001/06/14 18:16:10 ura Exp $
|
|
3 */
|
|
4
|
|
5 /*
|
|
6 * FreeWnn is a network-extensible Kana-to-Kanji conversion system.
|
|
7 * This file is part of FreeWnn.
|
|
8 *
|
|
9 * Copyright Kyoto University Research Institute for Mathematical Sciences
|
|
10 * 1987, 1988, 1989, 1990, 1991, 1992
|
|
11 * Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999
|
|
12 * Copyright ASTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992
|
|
13 *
|
|
14 * Author: OMRON SOFTWARE Co., Ltd. <freewnn@rd.kyoto.omronsoft.co.jp>
|
|
15 *
|
|
16 * This program is free software; you can redistribute it and/or modify
|
|
17 * it under the terms of the GNU General Public License as published by
|
|
18 * the Free Software Foundation; either version 2, or (at your option)
|
|
19 * any later version.
|
|
20 *
|
|
21 * This program is distributed in the hope that it will be useful,
|
|
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
24 * GNU General Public License for more details.
|
|
25 *
|
|
26 * You should have received a copy of the GNU General Public License
|
|
27 * along with GNU Emacs; see the file COPYING. If not, write to the
|
|
28 * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
29 *
|
|
30 * Commentary:
|
|
31 *
|
|
32 * Change log:
|
|
33 *
|
|
34 * Last modified date: 8,Feb.1999
|
|
35 *
|
|
36 * Code:
|
|
37 *
|
|
38 */
|
|
39 /***********************************************************************
|
|
40 rk_extvars.h
|
|
41 87.11.12 訂 補
|
|
42
|
|
43 二つ以上のファイルにまたがって使われる変数のextern宣言。
|
|
44 本体はrk_vars.cで定義。
|
|
45 ***********************************************************************/
|
|
46 /* Version 3.1 88/06/13 H.HASHIMOTO
|
|
47 */
|
|
48 #ifdef max
|
|
49 #undef max
|
|
50 #endif
|
|
51
|
|
52 typedef struct _modetable
|
|
53 {
|
|
54 int max;
|
|
55 int count;
|
|
56 char **point;
|
|
57 int size;
|
|
58 char *org;
|
|
59 char *next;
|
|
60 }
|
|
61 modetable;
|
|
62
|
|
63 typedef struct _modeswtable
|
|
64 {
|
|
65 int max;
|
|
66 int count;
|
|
67 int *point;
|
|
68 }
|
|
69 modeswtable;
|
|
70
|
|
71 typedef struct _modenaibutable
|
|
72 {
|
|
73 int size;
|
|
74 int *org;
|
|
75 int *next;
|
|
76 }
|
|
77 modenaibutable;
|
|
78
|
|
79 typedef struct _modebuftable
|
|
80 {
|
|
81 int size;
|
|
82 char *org;
|
|
83 }
|
|
84 modebuftable;
|
|
85
|
|
86 typedef struct _dat
|
|
87 {
|
|
88 letter *code[3];
|
|
89 }
|
|
90 dat;
|
|
91
|
|
92 typedef struct _hyo
|
|
93 {
|
|
94 int hyoshu;
|
|
95 dat *data;
|
|
96 letter **hensudef;
|
|
97 int size;
|
|
98 letter *memory;
|
|
99 }
|
|
100 hyo;
|
|
101
|
|
102 typedef struct _hyotable
|
|
103 {
|
|
104 int size;
|
|
105 hyo *point;
|
|
106 }
|
|
107 hyotable;
|
|
108
|
|
109 typedef struct _usehyotable
|
|
110 {
|
|
111 int size;
|
|
112 int *usemaehyo;
|
|
113 int *usehyo;
|
|
114 int *useatohyo;
|
|
115 }
|
|
116 usehyotable;
|
|
117
|
|
118 typedef struct _hyobuftable
|
|
119 {
|
|
120 int size;
|
|
121 char *org;
|
|
122 char *tmp;
|
|
123 char *next;
|
|
124 }
|
|
125 hyobuftable;
|
|
126
|
|
127 typedef struct _henikitable
|
|
128 {
|
|
129 int size;
|
|
130 letter *org;
|
|
131 letter *next;
|
|
132 }
|
|
133 henikitable;
|
|
134
|
|
135 typedef struct _hensuset
|
|
136 {
|
|
137 unsigned regdflg:1; /* 既登録の変数を表す */
|
|
138 unsigned curlinflg:1; /* 現在行に既出の変数を表す */
|
|
139 letter *name;
|
|
140 letter *range;
|
|
141 }
|
|
142 hensuset;
|
|
143
|
|
144 typedef struct _hensuutable
|
|
145 {
|
|
146 int max;
|
|
147 int count;
|
|
148 hensuset *point;
|
|
149 int size;
|
|
150 letter *org;
|
|
151 letter *next;
|
|
152 }
|
|
153 hensuutable;
|
|
154
|
|
155 typedef struct _hensuudeftable
|
|
156 {
|
|
157 int max;
|
|
158 int count;
|
|
159 letter **point;
|
|
160 }
|
|
161 hensuudeftable;
|
|
162
|
|
163 typedef struct _matchpair
|
|
164 {
|
|
165 int hennum;
|
|
166 letter ltrmch;
|
|
167 }
|
|
168 matchpair;
|
|
169
|
|
170 typedef struct _matchtable
|
|
171 {
|
|
172 int size;
|
|
173 matchpair *point;
|
|
174 }
|
|
175 matchtable;
|
|
176
|
|
177
|
|
178 typedef struct _RomkanTable
|
|
179 {
|
|
180 int flags;
|
|
181 jmp_buf env0;
|
|
182 letter *ltrbufbgn; /* 使用中のletterのバッファの先頭を指す */
|
|
183
|
|
184 FILE **base;
|
|
185
|
|
186 FILE *modefile; /* fp */
|
|
187
|
|
188 /* 88/06/03 V3.1 */
|
|
189 /* エラー処理のためのもの */
|
|
190 char *hcurread;
|
|
191 char *mcurdir; /* モード表のサーチパス */
|
|
192 char *mcurfnm; /* モード表のファイル名 */
|
|
193 char *mcurread; /* モード表の現在行bufへのポインタ */
|
|
194
|
|
195 char *tcurdir; /* 対応表のサーチパス */
|
|
196 char *tcurfnm; /* 対応表のファイル名 */
|
|
197 char *tcurread; /* 対応表の現在行bufへのポインタ */
|
|
198
|
|
199 char modefilename[REALFN + 5];
|
|
200 char pathname[REALFN];
|
|
201
|
|
202 modetable rk_defmode;
|
|
203 modetable rk_dspmode;
|
|
204 modetable rk_taiouhyo;
|
|
205 modetable rk_path;
|
|
206
|
|
207 modeswtable rk_modesw;
|
|
208
|
|
209 modenaibutable rk_modenaibu;
|
|
210
|
|
211 modebuftable rk_modebuf;
|
|
212
|
|
213 hyotable rk_hyo;
|
|
214
|
|
215 usehyotable rk_usehyo;
|
|
216
|
|
217 hyobuftable rk_hyobuf;
|
|
218
|
|
219 henikitable rk_heniki;
|
|
220
|
|
221 hensuutable rk_hensuu;
|
|
222
|
|
223 hensuudeftable rk_hensuudef;
|
|
224
|
|
225 #ifdef KDSP
|
|
226 # ifdef MVUX
|
|
227 letter displine[DSPLIN]; /* デバッグ用 表示の一行分を記憶 */
|
|
228 # endif
|
|
229 #endif
|
|
230
|
|
231 letter (*keyin_method) (); /* キーイン関数のアドレス */
|
|
232 int (*bytcnt_method) (); /* バイトカウント関数のアドレス */
|
|
233 int (*kbytcnt_method) (); /* キー入力解釈用バイトカウント関数のアドレス */
|
|
234
|
|
235 /* モード表名(又はそのパス名)を保存 *//* 初期設定がいい加減! */
|
|
236 char prv_modfnm[REALFN];
|
|
237 }
|
|
238 RomkanTable;
|
|
239
|
|
240 typedef struct _Romkan
|
|
241 {
|
|
242 char rk_errstat;
|
|
243
|
|
244 int flags;
|
|
245 jmp_buf env0;
|
|
246
|
|
247 char *dspmod[2][2];
|
|
248
|
|
249 /* 88/06/02 V3.1 */
|
|
250 letter nil[1];
|
|
251 letter *curdis;
|
|
252 int codein_len;
|
|
253 letter *codeout, *remainkbf;
|
|
254 letter ungetc_buf; /* romkan_ungetcが一文字退避しておくバッファ */
|
|
255 letter unnext_buf; /* romkan_unnextが 〃 */
|
|
256
|
|
257 char eofflg; /* romkan_next()からLTREOFが来たときに、romkan_henkan()内で1
|
|
258 にする。これの値が非0なら変換対応表の(error)を無視して、
|
|
259 本処理バッファ内の未確定コードも、強制的に変換させる。更に
|
|
260 LTREOFが来た時に特別にある出力を出すように指定されていれば
|
|
261 その処理も行う(但し、その処理は急ごしらえで不完全)。その
|
|
262 処理中はeofflgは2。 */
|
|
263
|
|
264 letter evalbuf[2][2][OUTSIZ];
|
|
265 letter delchr, delchr2, nisedl; /* DELのキャラクタは二個まで持てる */
|
|
266
|
|
267 /* 88/05/31 V3.1 */
|
|
268 letter rk_input; /* 入力。3バイトまでは変更なしに対応可 */
|
|
269 letter disout[OUTSIZ]; /* 本処理からの出力のバッファ */
|
|
270 letter rk_output[OUTSIZ]; /* 後処理からの出力(最終出力)のバッファ */
|
|
271 letter keybuf[KBFSIZ], urabuf[KBFSIZ]; /* 本処理バッファとその退避領域 */
|
|
272 int lastoutlen, lastkbflen;
|
|
273 int hyonum;
|
|
274
|
|
275 char ebf_sw;
|
|
276 letter oneletter[2];
|
|
277
|
|
278 modeswtable rk_modesw;
|
|
279
|
|
280 matchtable rk_henmatch;
|
|
281
|
|
282 usehyotable rk_usehyo;
|
|
283
|
|
284 RomkanTable *rk_table;
|
|
285 }
|
|
286 Romkan;
|
|
287
|
|
288 extern Romkan *cur_rk;
|
|
289 extern RomkanTable *cur_rk_table;
|
|
290 extern Romkan *romkan_init3 ();
|