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 ();
291