annotate Wnn/jserver/do_dic_env.c @ 19:e48bf9927b1c

added make rule for build_stamp.h to cWnn and kWnn so that they will be built correctly.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Mon, 14 Apr 2008 17:55:44 +0900
parents bbc77ca4def5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
1 /*
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
2 * $Id: do_dic_env.c,v 1.5 2001/06/14 18:28:53 ura Exp $
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
3 */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
4
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
5 /*
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
6 * FreeWnn is a network-extensible Kana-to-Kanji conversion system.
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
7 * This file is part of FreeWnn.
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
8 *
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
9 * Copyright Kyoto University Research Institute for Mathematical Sciences
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
10 * 1987, 1988, 1989, 1990, 1991, 1992
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
11 * Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
12 * Copyright ASTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
13 * Copyright FreeWnn Project 1999, 2000
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
14 *
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
15 * Maintainer: FreeWnn Project <freewnn@tomo.gr.jp>
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
16 *
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
17 * This program is free software; you can redistribute it and/or modify
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
18 * it under the terms of the GNU General Public License as published by
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
19 * the Free Software Foundation; either version 2 of the License, or
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
20 * (at your option) any later version.
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
21 *
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
22 * This program is distributed in the hope that it will be useful,
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
25 * GNU General Public License for more details.
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
26 *
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
27 * You should have received a copy of the GNU General Public License
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
28 * along with this program; if not, write to the Free Software
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
30 */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
31
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
32 /*
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
33 * Do Dic operation for Env
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
34 */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
35
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
36 #include <stdio.h>
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
37
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
38 #include "commonhd.h"
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
39 #include "demcom.h"
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
40 #include "de_header.h"
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
41 #include "jdata.h"
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
42
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
43
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
44 static void del_dic_from_env (), dic_delete ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
45
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
46 /*
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
47 Dic. OPE for Env
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
48 */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
49
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
50 /* js_dic_add */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
51 void
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
52 js_dic_add ()
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
53 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
54 int eid, fid, hfid, nice, rw, hrw, dic_no, d, rev;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
55 char pw[WNN_PASSWD_LEN], pw1[WNN_PASSWD_LEN];
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
56 eid = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
57 fid = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
58 hfid = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
59 nice = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
60 rw = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
61 hrw = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
62 gets_cur (pw, WNN_PASSWD_LEN);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
63 gets_cur (pw1, WNN_PASSWD_LEN);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
64 rev = get4_cur (); /* rev is to add it as reverse dict */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
65
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
66 error1 ("dic_add: eid=%d,fid=%d,hfid=%d", eid, fid, hfid);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
67 c_env = env[eid];
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
68 if (find_fid_in_env (eid, fid) == -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
69 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
70 wnn_errorno = WNN_FID_ERROR;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
71 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
72 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
73 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
74 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
75 if (files[fid].file_type != WNN_FT_DICT_FILE)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
76 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
77 wnn_errorno = WNN_NOT_A_DICT;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
78 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
79 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
80 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
81 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
82 if (rev &&
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
83 #ifdef CONVERT_by_STROKE
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
84 ((struct JT *) (files[fid].area))->syurui != BWNN_REV_DICT &&
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
85 #endif /* CONVERT_by_STROKE */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
86 #ifdef CONVERT_with_SiSheng
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
87 ((struct JT *) (files[fid].area))->syurui != CWNN_REV_DICT &&
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
88 #endif /* CONVERT_with_SiSheng */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
89 ((struct JT *) (files[fid].area))->syurui != WNN_REV_DICT)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
90 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
91 wnn_errorno = WNN_NOT_A_REV;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
92 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
93 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
94 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
95 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
96
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
97 if (rw == WNN_DIC_RW && ((struct JT *) (files[fid].area))->syurui != WNN_UD_DICT &&
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
98 #ifdef CONVERT_by_STROKE
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
99 ((struct JT *) (files[fid].area))->syurui != BWNN_REV_DICT &&
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
100 #endif /* CONVERT_by_STROKE */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
101 #ifdef CONVERT_with_SiSheng
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
102 ((struct JT *) (files[fid].area))->syurui != CWNN_REV_DICT &&
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
103 #endif /* CONVERT_with_SiSheng */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
104 ((struct JT *) (files[fid].area))->syurui != WNN_REV_DICT)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
105 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
106 wnn_errorno = WNN_NOT_A_UD;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
107 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
108 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
109 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
110 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
111 if (hfid != -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
112 { /* hindo file selected */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
113 if (find_fid_in_env (eid, hfid) == -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
114 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
115 wnn_errorno = WNN_FID_ERROR;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
116 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
117 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
118 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
119 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
120 if (files[hfid].file_type != WNN_FT_HINDO_FILE)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
121 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
122 wnn_errorno = WNN_NOT_A_HINDO_FILE;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
123 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
124 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
125 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
126 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
127 if (!match_dic_and_hindo_p (&files[fid], &files[hfid]))
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
128 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
129 wnn_errorno = WNN_HINDO_NO_MATCH;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
130 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
131 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
132 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
133 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
134 if (hrw == WNN_DIC_RW && !check_pwd (pw1, files[hfid].passwd))
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
135 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
136 wnn_errorno = WNN_INCORRECT_PASSWD;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
137 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
138 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
139 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
140 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
141 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
142
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
143 if (rw == WNN_DIC_RW && !check_pwd (pw, files[fid].passwd))
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
144 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
145 wnn_errorno = WNN_INCORRECT_PASSWD;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
146 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
147 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
148 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
149 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
150 if (hfid == -1 && hrw == WNN_DIC_RW && !check_pwd (pw1, ((struct JT *) (files[fid].area))->hpasswd))
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
151 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
152 wnn_errorno = WNN_INCORRECT_PASSWD;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
153 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
154 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
155 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
156 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
157 if ((d = chk_dic (eid, fid)) != -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
158 { /* already added that file */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
159 dic_table[d].enablef = 1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
160 dic_table[d].rw = rw;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
161
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
162 if (hfid != -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
163 { /* change hindo file */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
164 dic_table[d].hindo = hfid;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
165 hindo_file_size_justify (&files[fid], &files[hfid]);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
166 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
167 else
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
168 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
169 dic_table[d].hindo = -1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
170 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
171 dic_table[d].hindo_rw = hrw;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
172 dic_table[d].nice = nice;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
173 dic_table[d].rev = rev;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
174 put4_cur (d);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
175 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
176 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
177 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
178
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
179 /* add new dic */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
180 if ((dic_no = get_new_dic ()) == -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
181 { /* no more dic */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
182 wnn_errorno = WNN_JISHOTABLE_FULL;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
183 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
184 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
185 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
186 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
187 if (add_dic_to_env (eid, dic_no))
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
188 { /* no more jisho */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
189 wnn_errorno = WNN_JISHOTABLE_FULL;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
190 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
191 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
192 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
193 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
194 if (hfid != -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
195 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
196 hindo_file_size_justify (&files[fid], &files[hfid]);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
197 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
198 dic_table[dic_no].body = fid;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
199 dic_table[dic_no].hindo = hfid;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
200 dic_table[dic_no].rw = rw;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
201 dic_table[dic_no].hindo_rw = hrw;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
202 dic_table[dic_no].enablef = 1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
203 dic_table[dic_no].nice = nice;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
204 dic_table[dic_no].rev = rev;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
205 put4_cur (dic_no);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
206 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
207 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
208
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
209 int
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
210 add_dic_to_env (eid, dic_no)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
211 int eid, dic_no;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
212 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
213 int off_env;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
214 struct cnv_env *cenv;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
215 cenv = env[eid];
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
216 off_env = cenv->jishomax;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
217 if (off_env >= WNN_MAX_JISHO_OF_AN_ENV)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
218 { /* no more jisho */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
219 wnn_errorno = WNN_JISHOTABLE_FULL;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
220 return -1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
221 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
222 (cenv->jisho)[off_env] = dic_no;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
223 cenv->jishomax = off_env + 1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
224 return 0;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
225 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
226
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
227 int
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
228 chk_dic (eid, fid)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
229 int eid, fid;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
230 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
231 int i, dic, max;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
232 max = env[eid]->jishomax;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
233 for (i = 0; i < max; i++)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
234 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
235 dic = (env[eid]->jisho)[i];
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
236 if (dic_table[dic].body == fid)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
237 return dic;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
238 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
239 return -1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
240 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
241
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
242 int
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
243 chk_hindo (eid, fid)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
244 int eid, fid;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
245 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
246 int i, dic, max;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
247 max = env[eid]->jishomax;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
248 for (i = 0; i < max; i++)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
249 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
250 dic = (env[eid]->jisho)[i];
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
251 if (dic_table[dic].hindo == fid)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
252 return dic;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
253 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
254 return -1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
255 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
256
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
257 int
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
258 get_new_dic ()
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
259 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
260 int i;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
261 for (i = 0; i < MAX_DIC; i++)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
262 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
263 if (dic_table[i].body == -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
264 return i;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
265 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
266 return -1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
267 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
268
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
269 /* search jisho of an env (dic_no == -1 then new dic) */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
270 int
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
271 find_dic_in_env (eid, dic_no)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
272 int eid, dic_no;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
273 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
274 int i, max;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
275 max = env[eid]->jishomax;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
276 for (i = 0; i < max; i++)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
277 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
278 if ((env[eid]->jisho)[i] == dic_no)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
279 return i;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
280 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
281 return -1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
282 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
283
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
284 /* js_dic_delete */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
285 void
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
286 js_dic_delete ()
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
287 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
288 int eid, off_env, dic_no;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
289 eid = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
290 c_env = env[eid];
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
291 dic_no = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
292 if ((off_env = find_dic_in_env (eid, dic_no)) == -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
293 { /* no such dic */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
294 wnn_errorno = WNN_DICT_NOT_USED;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
295 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
296 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
297 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
298 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
299 dic_table[dic_no].body = -1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
300 dic_table[dic_no].hindo = -1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
301
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
302 del_dic_from_env (eid, off_env);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
303 put4_cur (0);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
304 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
305 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
306
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
307
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
308 static void
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
309 del_dic_from_env (eid, off_env)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
310 int eid, off_env;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
311 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
312 int *jisho, max, i;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
313 struct cnv_env *cenv;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
314
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
315 cenv = env[eid];
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
316 jisho = cenv->jisho;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
317 max = --(cenv->jishomax);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
318 for (i = off_env; i < max; i++)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
319 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
320 jisho[i] = jisho[i + 1];
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
321 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
322 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
323
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
324 /* delete all Dic. in an Env , when disconnect */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
325 void
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
326 del_all_dic_in_env (eid)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
327 int eid;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
328 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
329 int *jisho, max, i;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
330
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
331 jisho = env[eid]->jisho;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
332 max = env[eid]->jishomax;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
333 for (i = 0; i < max; i++)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
334 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
335 dic_table[jisho[i]].body = -1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
336 dic_table[jisho[i]].hindo = -1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
337 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
338 env[eid]->jishomax = 0;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
339 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
340
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
341
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
342 /* js_dic_list_all */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
343 void
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
344 js_dic_list_all ()
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
345 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
346 int c, i, dic_no;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
347
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
348 for (c = i = 0; i < MAX_DIC; i++)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
349 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
350 if (dic_table[i].body == -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
351 continue;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
352 c++;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
353 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
354 put4_cur (c);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
355
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
356 for (dic_no = 0; dic_no < MAX_DIC; dic_no++)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
357 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
358 if (dic_table[dic_no].body == -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
359 continue;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
360 put_dic_info (dic_no);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
361 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
362 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
363 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
364
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
365 /* js_dic_list */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
366 void
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
367 js_dic_list ()
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
368 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
369 int eid, i, dic_no, max;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
370 eid = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
371 c_env = env[eid];
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
372 max = env[eid]->jishomax;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
373 put4_cur (max);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
374 for (i = 0; i < max; i++)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
375 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
376 dic_no = (env[eid]->jisho)[i];
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
377 put_dic_info (dic_no);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
378 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
379 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
380 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
381
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
382 /* js_dic_use */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
383 void
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
384 js_dic_use ()
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
385 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
386 int eid, dic_no, enable;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
387 eid = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
388 c_env = env[eid];
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
389 dic_no = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
390 enable = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
391 if (find_dic_in_env (eid, dic_no) == -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
392 { /* no such dic */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
393 wnn_errorno = WNN_DICT_NOT_USED;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
394 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
395 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
396 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
397 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
398 if (enable < 0 || enable > 1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
399 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
400 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
401 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
402 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
403 dic_table[dic_no].enablef = enable;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
404 put4_cur (0);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
405 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
406 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
407
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
408 /* js_fuzokugo_set */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
409 void
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
410 js_fuzokugo_set ()
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
411 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
412 int eid, fid;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
413
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
414 eid = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
415 c_env = env[eid];
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
416 fid = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
417 if (find_fid_in_env (eid, fid) == -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
418 { /* valid */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
419 wnn_errorno = WNN_FID_ERROR;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
420 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
421 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
422 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
423 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
424 if (files[fid].file_type != WNN_FT_FUZOKUGO_FILE)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
425 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
426 wnn_errorno = WNN_NOT_A_FUZOKUGO_FILE;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
427 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
428 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
429 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
430 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
431 if (find_fid_in_env (eid, fid) == -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
432 { /* H.T. */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
433 wnn_errorno = WNN_FID_ERROR;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
434 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
435 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
436 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
437 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
438 env[eid]->fzk_fid = fid;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
439 put4_cur (0);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
440 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
441 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
442
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
443 /* js_fuzokugo_get */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
444 void
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
445 js_fuzokugo_get ()
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
446 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
447 int eid;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
448
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
449 eid = get4_cur ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
450 c_env = env[eid];
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
451
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
452 if (env[eid]->fzk_fid == -1)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
453 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
454 wnn_errorno = WNN_FZK_FILE_NO_LOAD;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
455 error_ret ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
456 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
457 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
458 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
459 put4_cur (env[eid]->fzk_fid);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
460 putc_purge ();
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
461 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
462
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
463
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
464 /* Delete Used Dicts and Fuzokugo's H. T. */
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
465 void
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
466 used_dic_fuzoku_delete (eid, fid)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
467 int eid;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
468 int fid;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
469 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
470 int i, max;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
471 register int dic_no;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
472 max = env[eid]->jishomax;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
473 if (env[eid]->fzk_fid == fid)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
474 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
475 env[eid]->fzk_fid = -1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
476 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
477 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
478 for (i = 0; i < max; i++)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
479 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
480 dic_no = (env[eid]->jisho)[i];
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
481 if (dic_table[dic_no].body == fid || dic_table[dic_no].hindo == fid)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
482 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
483 dic_delete (eid, dic_no, i);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
484 return;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
485 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
486 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
487 }
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
488
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
489
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
490 static void
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
491 dic_delete (eid, dic_no, off_env)
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
492 int eid;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
493 int dic_no;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
494 int off_env;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
495 {
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
496 dic_table[dic_no].body = -1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
497 dic_table[dic_no].hindo = -1;
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
498 del_dic_from_env (eid, off_env);
bbc77ca4def5 initial import
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
diff changeset
499 }