annotate src/mule-wnnfns.c @ 266:18d185df8c54

Added tag r20-5b31 for changeset 8efd647ea9ca
author cvs
date Mon, 13 Aug 2007 10:25:39 +0200
parents e45d5e7c476e
children c5d627a313b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1 /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2 Copyright (C) 1995 Free Software Foundation, Inc.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
3 Copyright (C) 1995 Sun Microsystems, Inc.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
4
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
5 This file is part of XEmacs.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
7 XEmacs is free software; you can redistribute it and/or modify it
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
10 later version.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
11
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
15 for more details.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
16
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
18 along with XEmacs; see the file COPYING. If not, write to
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
21
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
22 /* Synched up with: Mule 2.3. Not in FSF. */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
23
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
24 /* Jserver Interface for Mule
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
25 Coded by Yutaka Ishikawa at ETL (yisikawa@etl.go.jp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
26 Satoru Tomura at ETL (tomura@etl.go.jp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
27 Modified for Wnn4 library by
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
28 Toshiaki Shingu (shingu@cpr.canon.co.jp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
29 Hiroshi Kuribayashi (kuri@nff.ncl.omron.co.jp) */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
30
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
31 /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
32 * Functions defined in this file are
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
33 * (wnn-server-open wnn-host-name login-name)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
34 * wnn-host-name: STRING or NIL
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
35 * login-name: STRING
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
36 * RETURNS: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
37 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
38 * jserver $B$H@\B3$7!"%5!<%P!<FbIt$K@5JQ49!?5UJQ49#2$D$N4D6-$r(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
39 * $B:n$k!#%(%i!<$N;~$O(B nil $B$rJV$9!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
40 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
41 * (wnn-server-close)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
42 * RETURNS: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
43 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
44 * jserver $B$H$N@\B3$r@Z$k!#<-=q!"IQEY$O%;!<%V$5$l$J$$!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
45 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
46 * (wnn-server-dict-add dict-file-name hindo-file-name priority
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
47 * dict-file-mode hindo-file-mode pw1 pw2)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
48 * dict-file-name: STRING
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
49 * hindo-file-name: STRING or NULL-STRING
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
50 * priority: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
51 * dict-file-mode: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
52 * hindo-file-mode: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
53 * pw1: STRING or NIL
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
54 * pw2: STRING or NIL
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
55 * DESCRIPTION:
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
56 * $B<-=q%U%!%$%kL>!"IQEY%U%!%$%kL>!"M%@hEY!"<-=q%U%!%$%k%b!<%I(B
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
57 * $BIQEY%U%!%$%k%b!<%I$G;XDj$7$?<-=q$r%P%C%U%!$KDI2C$9$k!#(B
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
58 * pw1, pw2 $B$O<-=q%U%!%$%k!"IQEY%U%!%$%k$N%Q%9%o!<%I!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
59 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
60 * (wnn-server-dict-delete dic-no)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
61 * dic-no: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
62 * RETURNS: $B%(%i!<$N;~(B nil
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
63 * DESCRIPTION: dic-no $B$N<-=qHV9f$N<-=q$r!"%P%C%U%!$+$i(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
64 * $B:o=|$9$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
65 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
66 * (wnn-server-dict-list)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
67 * RETURNS: ((dic-no1 file-name1 comment1 word-no1 nice1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
68 * (dic-no2 file-name2 comment2 word-no2 nice2)...)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
69 * DESCRIPTION: $B%P%C%U%!>e$N<-=q$N%j%9%H$rF@$k!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
70 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
71 * (wnn-server-dict-comment dic-no comment)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
72 * RETURNS: $B%(%i!<$N;~(B nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
73 * DESCRIPTION: dic-no $B$N<-=q$K%3%a%s%H$r$D$1$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
74 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
75 * (wnn-server-set-rev rev)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
76 * rev: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
77 * rev $B$,(B nil $B$N;~$O@5JQ49!"$=$l0J30$N;~$O5UJQ49(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
78 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
79 * (wnn-server-henkan-begin henkan-string)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
80 * henkan-string: STRING
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
81 * RETURNS: bunsetu-suu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
82 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
83 * $B2>L>4A;zJQ49$r$7!"Bh0l8uJd$NJ8@a?t$rJV$9!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
84 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
85 * (wnn-server-zenkouho bunsetu-no dai)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
86 * bunsetu-no: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
87 * dai: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
88 * RETURNS: offset
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
89 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
90 * $BJ8@aHV9f$G;XDj$5$l$?J8@a$NA48uJd$r$H$j$@$7(B
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
91 * $B!"8=:_$N%*%U%;%C%H$rJV$9!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
92 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
93 * (wnn-server-get-zenkouho offset)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
94 * bunsetu-no: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
95 * dai: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
96 * RETURNS: list of zenkouho
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
97 * DESCRIPTION:
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
98 * $B%*%U%;%C%H$G;XDj$5$l$?8uJd$rF@$k!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
99 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
100 * (wnn-server-zenkouho-bun)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
101 * RETURNS: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
102 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
103 * $BA48uJd$rI=<($7$F$$$kJ8@aHV9f$rF@$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
104 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
105 * (wnn-server-zenkouho-suu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
106 * RETURNS: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
107 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
108 * $BA48uJd$rI=<($7$F$$$kJ8@a$NA48uJd?t$rF@$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
109 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
110 * (wnn-server-dai-top bun-no)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
111 * bun-no: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
112 * RETURNS: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
113 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
114 * $BJ8@a$,BgJ8@a$N@hF,$J$i(B t
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
115 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
116 * (wnn-server-dai-end bun-no)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
117 * bun-no: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
118 * RETURNS: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
119 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
120 * $B<!$NBgJ8@a$NJ8@aHV9f$rF@$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
121 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
122 * (wnn-server-henkan-kakutei kouho-no dai)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
123 * kouho-no: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
124 * dai: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
125 * RETURNS: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
126 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
127 * $B8uJdHV9f$G<($5$l$?8uJd$rA*Br$9$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
128 * (wnn-server-zenkouho) $B$r8F$s$F$+$i$G$J$$$H$$$1$J$$!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
129 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
130 * (wnn-server-bunsetu-henkou bunsetu-no bunsetu-length dai)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
131 * bunsetu-no: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
132 * bunsetu-length: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
133 * dai: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
134 * RETURNS:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
135 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
136 * $BJ8@a$ND9$5$rJQ99$9$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
137 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
138 * (wnn-bunsetu-kouho-inspect bunsetu-no)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
139 * bunsetu-no: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
140 * RETURNS: (kanji yomi jisho-no serial-no hinsi hindo
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
141 * ima hyoka daihyoka kangovect)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
142 * DESCRIPTION:
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
143 * $BJ8@a$N?'!9$J>pJs$rJQ49%P%C%U%!$+$i$H$j=P$9!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
144 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
145 * (wnn-server-henkan-quit)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
146 * RETURNS: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
147 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
148 * $B2?$b$7$J$$!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
149 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
150 * (wnn-server-bunsetu-kanji bun-no)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
151 * RETURNS: (bunsetu-kanji length)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
152 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
153 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
154 * (wnn-server-bunsetu-yomi bun-no)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
155 * RETURNS: (bunsetu-yomi length)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
156 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
157 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
158 * (wnn-server-bunsetu-suu)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
159 * RETURNS: bunsetu-suu
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
160 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
161 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
162 * (wnn-server-hindo-update &optional bunsetu-no)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
163 * bunsetu-no: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
164 * RETURNS: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
165 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
166 * $BIQEY>pJs$r99?7$9$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
167 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
168 * (wnn-server-word-add dic-no tango yomi comment hinsi)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
169 * dic-no: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
170 * tango: STRING
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
171 * yoni: STRING
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
172 * comment: STRING
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
173 * hinsi: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
174 * RETURNS: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
175 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
176 * $B<-=q$KC18l$rEPO?$9$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
177 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
178 * (wnn-server-word-delete dic-no entry)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
179 * dic-no: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
180 * entry: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
181 * RETURNS: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
182 * DESCRIPTION:
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
183 * $B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$r:o=|$9$k!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
184 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
185 * (wnn-server-word-use dic-no entry)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
186 * dic-no: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
187 * entry: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
188 * RETURNS: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
189 * DESCRIPTION:
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
190 * $B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$NM-8z!?L58z$r%H%0%k$9$k!#(B
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
191 *
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
192 * (wnn-server-word-info dic-no entry)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
193 * dic-no: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
194 * entry: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
195 * RETURNS: (yomi kanji comment hindo hinsi)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
196 * DESCRIPTION:
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
197 * $B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$N>pJs$rF@$k!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
198 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
199 * (wnn-server-word-hindo-set dic-no entry hindo)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
200 * dic-no: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
201 * entry: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
202 * hindo: INTEGER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
203 * RETURNS: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
204 * DESCRIPTION:
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
205 * $B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$NIQEY$r@_Dj$9$k!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
206 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
207 * (wnn-server-word-search yomi)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
208 * yomi: STRING
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
209 * RETURNS: a LIST of dict-joho
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
210 * DESCRIPTION:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
211 * $BA4$F$N<-=q$+$iC18l8!:w$r9T$J$&!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
212 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
213 * (wnn-server-dict-save)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
214 * RETURNS: BOOLEAN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
215 * DESCRIPTION:
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
216 * $BA4$F$N<-=q$HIQEY%U%!%$%k$r%;!<%V$9$k!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
217 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
218 * (wnn-server-get-param)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
219 * RETURNS: (n nsho p1 p2 p3 ... p15)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
220 * DESCRIPTION: $BJQ49%Q%i%a!<%?$rF@$k!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
221 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
222 * (wnn-server-set-param n sho p1 ... p15)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
223 * RETURNS: $B%(%i!<$N;~(B nil
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
224 * DESCRIPTION: $BJQ49%Q%i%a!<%?$r@_Dj$9$k!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
225 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
226 * (wnn-server-get-msg error-no)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
227 * RETURNS: $B%(%i!<%a225;!<%8(B
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
228 * DESCRIPTION: $B%(%i!<HV9f$+$i%a%C%;!<%8$rF@$k!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
229 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
230 * (wnn-server-fuzokugo-set fname)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
231 * RETURNS: $B%(%i!<$N;~(B nil
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
232 * DESCRIPTION: $B%P%C%U%!$KImB08l%U%!%$%k$rFI$_9~$`!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
233 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
234 * (wnn-server-fuzokugo-get)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
235 * RETURNS: $B%U%!%$%kL>(B
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
236 * DESCRIPTION: $B%P%C%U%!$NImB08l%U%!%$%kL>$rF@$k!#(B
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
237 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
238 * (wnn-server-isconnect)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
239 * RETURNS: $B%3%M%/%H$7$F$l$P(B t, $B$7$F$J$1$l$P(B nil
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
240 * DESCRIPTION: $B%5!<%P$H7Q$C$F$$$k$+D4$Y$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
241 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
242 * (wnn-server-hinsi-dicts hinsi-no)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
243 * RETURNS: (dic-no1 dic-no2 ...)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
244 * DESCRIPTION: hinsi-no $B$NIJ;l$,EPO?$G$-$k<-=q$N%j%9%H$rF@$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
245 * hinsi-no = -1 $B$N$H$-$K$O!"EPO?2DG=$JA4<-=q$rF@$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
246 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
247 * (wnn-server-hinsi-list dic-no name)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
248 * RETURNS: (name1 name2 ... )
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
249 * DESCRIPTION: dic-no $B$N<-=q$G!"IJ;l%N!<%I$KB0$9$k(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
250 * $BIJ;l%N!<%I!JL>!K$N%j%9%H$rF@$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
251 * $BIJ;lL>$rM?$($?;~$O!"#0$rJV$9!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
252 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
253 * (wnn-server-hinsi-name hinsi-no)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
254 * RETURNS: hinsi-name
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
255 * DESCRIPTION: $BIJ;lHV9f$+$iL>A0$r<h$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
256 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
257 * (wnn-server-hinsi-number hinsi-name)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
258 * RETURNS: hinsi-no
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
259 * DESCRIPTION: $BIJ;lL>$rIJ;lHV9f$KJQ49$9$k!#(B
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
260 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
261 * (wnn-server-version)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
262 * RETURNS: version ID(int)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
263 *
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
264 */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
265
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
266 #include <config.h>
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
267 #include "lisp.h"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
268
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
269 #include "buffer.h"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
270 #include "window.h"
151
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 134
diff changeset
271 #include "sysdep.h"
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
272
151
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 134
diff changeset
273 #include "wnn/commonhd.h"
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
274 #include "mule-charset.h"
151
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 134
diff changeset
275 #include "wnn/jllib.h"
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 134
diff changeset
276 #include "wnn/cplib.h"
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
277
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
278 /* UCHAR $B$,Fs=EDj5A$5$l$k$N$G(B */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
279 #define _UCHAR_T
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
280
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
281 #define EGG_TIMEOUT 5
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
282 #define NSERVER 4
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
283 #define WNNSERVER_J 0
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
284 #define WNNSERVER_C 1
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
285 #define WNNSERVER_T 2
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
286 #define WNNSERVER_K 3
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
287
151
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 134
diff changeset
288 int check_wnn_server_type (void);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
289 void w2m (w_char *wp, unsigned char *mp, unsigned char lb);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
290 void m2w (unsigned char *mp, w_char *wp);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
291 void w2y (w_char *w);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
292 void c2m (unsigned char *cp, unsigned char *mp, unsigned char lb);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
293 static void puts2 (char *s);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
294 static int dai_end (int no, int server);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
295 static int yes_or_no (unsigned char *s);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
296
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
297 /* Why doesn't wnn have a prototype for these? */
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
298 typedef unsigned int letter;
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
299 int cwnn_yincod_pzy(w_char *, w_char, int);
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
300 int cwnn_pzy_yincod(letter *, letter *, int);
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
301
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
302 static struct wnn_buf *wnnfns_buf[NSERVER];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
303 static struct wnn_env *wnnfns_env_norm[NSERVER];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
304 static struct wnn_env *wnnfns_env_rev[NSERVER];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
305 static int wnnfns_norm;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
306 static unsigned char lb_wnn_server_type[NSERVER] =
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
307 {LEADING_BYTE_JAPANESE_JISX0208, LEADING_BYTE_CHINESE_GB2312, LEADING_BYTE_THAI_TIS620, LEADING_BYTE_KOREAN_KSC5601};
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
308
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
309 /* Lisp Variables and Constants Definition */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
310 Lisp_Object Qjserver;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
311 Lisp_Object Qcserver;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
312 /*Lisp_Object Qtserver;*/
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
313 Lisp_Object Qkserver;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
314 Lisp_Object Qwnn_no_uniq;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
315 Lisp_Object Qwnn_uniq;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
316 Lisp_Object Qwnn_uniq_kanji;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
317 Lisp_Object Qwnn_n, Qwnn_nsho, Qwnn_hindo, Qwnn_len, Qwnn_jiri, Qwnn_flag;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
318 Lisp_Object Qwnn_jisho, Qwnn_sbn, Qwnn_dbn_len, Qwnn_sbn_cnt, Qwnn_suuji;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
319 Lisp_Object Qwnn_kana, Qwnn_eisuu, Qwnn_kigou, Qwnn_toji_kakko, Qwnn_fuzokogo, Qwnn_kaikakko;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
320 Lisp_Object Vwnn_server_type;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
321 Lisp_Object Vcwnn_zhuyin;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
322 Lisp_Object Vwnnenv_sticky;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
323 Lisp_Object Vwnn_uniq_level;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
324 int lb_sisheng;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
325
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
326 /* Lisp functions definition */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
327
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
328 DEFUN ("wnn-server-open", Fwnn_open, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
329 Connect to jserver of host HNAME, make an environment with
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
330 login name LNAME in the server.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
331 Return nil if error occurs
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
332 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
333 (hname, lname))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
334 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
335 char envname[32];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
336 char langname[32];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
337 char hostname[32];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
338 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
339 CHECK_STRING (lname);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
340
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
341 snum = check_wnn_server_type ();
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
342 switch (snum)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
343 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
344 case WNNSERVER_J:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
345 strcpy (langname, "ja_JP");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
346 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
347 case WNNSERVER_C:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
348 strcpy (langname, "zh_CN");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
349 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
350 /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
351 case WNNSERVER_T:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
352 strcpy (langname, "zh_TW");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
353 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
354 */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
355 case WNNSERVER_K:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
356 strcpy (langname, "ko_KR");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
357 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
358 }
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
359 strncpy (envname, (char *) XSTRING_DATA (lname), 32);
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
360 if (NILP (hname)) strcpy (hostname, "");
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
361 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
362 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
363 CHECK_STRING (hname);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
364 strncpy (hostname, (char *) XSTRING_DATA (hname), 32);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
365 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
366 CHECK_STRING (lname);
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 102
diff changeset
367 /* 97/4/16 jhod@po.iijnet.or.jp
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 102
diff changeset
368 * libwnn uses SIGALRM, so we need to stop and start interrupts.
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 102
diff changeset
369 */
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 102
diff changeset
370 stop_interrupts();
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
371 if (!(wnnfns_buf[snum] = jl_open_lang (envname, hostname, langname,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
372 0, 0, 0, EGG_TIMEOUT)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
373 {
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 102
diff changeset
374 start_interrupts();
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
375 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
376 }
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 102
diff changeset
377 if (!jl_isconnect (wnnfns_buf[snum]))
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 102
diff changeset
378 {
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 102
diff changeset
379 start_interrupts();
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 102
diff changeset
380 return Qnil;
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 102
diff changeset
381 }
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
382 wnnfns_env_norm[snum] = jl_env_get (wnnfns_buf[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
383 /* if (Vwnnenv_sticky == Qt) jl_env_sticky_e (wnnfns_env_norm[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
384 else jl_env_un_sticky_e (wnnfns_env_norm[snum]);*/
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
385 strcat (envname, "R");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
386 if (!(wnnfns_env_rev[snum] = jl_connect_lang (envname, hostname, langname,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
387 0, 0, 0, EGG_TIMEOUT)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
388 {
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 102
diff changeset
389 start_interrupts();
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
390 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
391 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
392 /* if (Vwnnenv_sticky == Qt) jl_env_sticky_e (wnnfns_env_rev[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
393 else jl_env_un_sticky_e (wnnfns_env_rev[snum]);*/
126
1370575f1259 Import from CVS: tag xemacs-20-1p1
cvs
parents: 102
diff changeset
394 start_interrupts();
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
395 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
396 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
397
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
398
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
399 DEFUN ("wnn-server-close", Fwnn_close, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
400 Close the connection to jserver, Dictionary and friquency files
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
401 are not saved.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
402 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
403 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
404 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
405 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
406 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
407 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
408 if (wnnfns_env_norm[snum])
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
409 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
410 if (EQ(Vwnnenv_sticky, Qnil)) jl_env_un_sticky_e (wnnfns_env_norm[snum]);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
411 else jl_env_sticky_e (wnnfns_env_norm[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
412 jl_disconnect (wnnfns_env_norm[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
413 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
414 if (wnnfns_env_rev[snum])
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
415 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
416 if (EQ(Vwnnenv_sticky, Qnil)) jl_env_un_sticky_e (wnnfns_env_rev[snum]);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
417 else jl_env_sticky_e (wnnfns_env_rev[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
418 jl_disconnect (wnnfns_env_rev[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
419 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
420 jl_env_set (wnnfns_buf[snum], 0);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
421 jl_close (wnnfns_buf[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
422 wnnfns_buf[snum] = (struct wnn_buf *) 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
423 wnnfns_env_norm[snum] = wnnfns_env_rev[snum] = (struct wnn_env *) 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
424 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
425 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
426
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
427 DEFUN ("wnn-server-dict-add", Fwnn_dict_add, 5, MANY, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
428 Add dictionary specified by DICT-FILE-NAME, FREQ-FILE-NAME,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
429 PRIORITY, DICT-FILE-MODE, FREQ-FILE-MODE.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
430 Specify password files of dictionary and frequency, PW1 and PW2, if needed.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
431 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
432 (int nargs, Lisp_Object *args))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
433 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
434 struct gcpro gcpro1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
435 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
436 CHECK_STRING (args[0]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
437 CHECK_STRING (args[1]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
438 CHECK_INT (args[2]);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
439 if (!EQ(args[5], Qnil)) CHECK_STRING (args[5]);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
440 if (!EQ(args[6], Qnil)) CHECK_STRING (args[6]);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
441 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
442 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
443 GCPRO1 (*args);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
444 gcpro1.nvars = nargs;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
445 if (jl_dic_add (wnnfns_buf[snum],
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
446 XSTRING (args[0])->_data,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
447 XSTRING (args[1])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
448 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
449 XINT (args[2]),
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
450 (EQ(args[3], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
451 (EQ(args[4], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
452 (EQ(args[5], Qnil)) ? 0 : XSTRING (args[5])->_data,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
453 (EQ(args[6], Qnil)) ? 0 : XSTRING (args[6])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
454 yes_or_no,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
455 puts2 ) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
456 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
457 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
458 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
459 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
460 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
461 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
462 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
463
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
464 DEFUN ("wnn-server-dict-delete", Fwnn_dict_delete, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
465 Remove dictionary specified by DIC-NUMBER from buffer.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
466 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
467 (dicno))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
468 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
469 int no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
470 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
471 CHECK_INT (dicno);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
472 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
473 no = XINT (dicno);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
474 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
475 if (jl_dic_delete (wnnfns_buf[snum], no) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
476 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
477 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
478
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
479 DEFUN ("wnn-server-dict-list", Fwnn_dict_list, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
480 Return information of dictionaries.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
481 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
482 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
483 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
484 WNN_DIC_INFO *dicinfo;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
485 int cnt, i;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
486 unsigned char comment[1024];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
487 Lisp_Object val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
488 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
489 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
490
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
491 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
492 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
493 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
494 #ifdef WNN6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
495 if((cnt = jl_fi_dic_list (wnnfns_buf[snum], 0x3f, &dicinfo)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
496 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
497 #else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
498 if((cnt = jl_dic_list (wnnfns_buf[snum], &dicinfo)) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
499 #endif
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
500 val = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
501 for (i = 0, dicinfo += cnt; i < cnt; i++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
502 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
503 dicinfo--;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
504 w2m (dicinfo->comment, comment, lb);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
505 /* #### The following has not been Mule-ized!!
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
506 fname and comment must be ASCII strings! */
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
507 val =
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
508 Fcons (Fcons (make_int (dicinfo->dic_no),
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
509 list4 (make_string ((Bufbyte *) (dicinfo->fname),
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
510 strlen (dicinfo->fname)),
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
511 make_string (comment, strlen ((char *) comment)),
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
512 make_int (dicinfo->gosuu),
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
513 make_int (dicinfo->nice))), val);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
514 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
515 return val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
516 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
517
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
518 DEFUN ("wnn-server-dict-comment", Fwnn_dict_comment, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
519 Set comment to dictionary specified by DIC-NUMBER.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
520 Comment string COMMENT
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
521 */
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
522 (dicno, comment))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
523 {
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
524 w_char wbuf[512];
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
525 int snum;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
526 CHECK_INT (dicno);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
527 CHECK_STRING (comment);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
528 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
529 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
530 m2w (XSTRING (comment)->_data, wbuf);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
531 if (jl_dic_comment_set (wnnfns_buf[snum], XINT (dicno), wbuf) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
532 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
533 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
534 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
535
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
536
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
537 DEFUN ("wnn-server-set-rev", Fwnn_set_rev, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
538 Switch the translation mode to normal if T, or reverse if NIL.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
539 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
540 (rev))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
541 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
542 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
543 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
544 if (EQ(rev, Qnil))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
545 {
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
546 if ((!wnnfns_buf[snum]) || (!wnnfns_env_norm[snum])) return Qnil;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
547 jl_env_set (wnnfns_buf[snum], wnnfns_env_norm[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
548 wnnfns_norm = 1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
549 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
550 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
551 {
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
552 if ((!wnnfns_buf[snum]) || (!wnnfns_env_rev[snum])) return Qnil;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
553 jl_env_set (wnnfns_buf[snum], wnnfns_env_rev[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
554 wnnfns_norm = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
555 }
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 129
diff changeset
556 return Qt;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
557 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
558
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
559 DEFUN ("wnn-server-henkan-begin", Fwnn_begin_henkan, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
560 Translate YOMI string to kanji. Retuen the number of bunsetsu.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
561 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
562 (hstring))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
563 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
564 int cnt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
565 w_char wbuf[5000];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
566 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
567 CHECK_STRING (hstring);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
568 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
569 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
570 m2w (XSTRING (hstring)->_data, wbuf);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
571 if (snum == WNNSERVER_C)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
572 w2y (wbuf);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
573
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
574 #ifdef WNN6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
575 if ((cnt = jl_fi_ren_conv (wnnfns_buf[snum], wbuf, 0, -1, WNN_USE_MAE)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
576 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
577 #else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
578 if ((cnt = jl_ren_conv (wnnfns_buf[snum], wbuf, 0, -1, WNN_USE_MAE)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
579 return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
580 #endif
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
581 return make_int (cnt);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
582 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
583
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
584 DEFUN ("wnn-server-zenkouho", Fwnn_zenkouho, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
585 Get zenkouho at BUNSETSU-NUMBER. Second argument DAI is T
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
586 if dai-bunsetsu, NIL if sho-bunsetsu. Return the current offset of zenkouho.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
587 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
588 (bunNo, dai))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
589 {
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
590 int no, offset;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
591 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
592 int uniq_level;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
593 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
594 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
595 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
596 no = XINT (bunNo);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
597 if (EQ(Vwnn_uniq_level, Qwnn_no_uniq)) uniq_level = WNN_NO_UNIQ;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
598 else if (EQ(Vwnn_uniq_level, Qwnn_uniq)) uniq_level = WNN_UNIQ;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
599 else uniq_level = WNN_UNIQ_KNJ;
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
600 if (NILP (dai))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
601 {
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
602 if ((offset = jl_zenkouho (wnnfns_buf[snum],no,WNN_USE_MAE,
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
603 uniq_level)) < 0)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
604 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
605 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
606 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
607 {
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
608 if ((offset = jl_zenkouho_dai (wnnfns_buf[snum], no, dai_end (no, snum),
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
609 WNN_USE_MAE, uniq_level)) < 0)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
610 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
611 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
612 return make_int (offset);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
613 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
614
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
615
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
616 DEFUN ("wnn-server-get-zenkouho", Fwnn_get_zenkouho, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
617 Get kanji string of KOUHO-NUMBER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
618 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
619 (kouhoNo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
620 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
621 unsigned char kanji_buf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
622 w_char wbuf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
623 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
624 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
625 CHECK_INT (kouhoNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
626 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
627 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
628 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
629 jl_get_zenkouho_kanji (wnnfns_buf[snum], XINT (kouhoNo), wbuf);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
630 w2m (wbuf, kanji_buf, lb);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
631 return make_string (kanji_buf, strlen ((char *) kanji_buf));
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
632 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
633
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
634 DEFUN ("wnn-server-zenkouho-bun", Fwnn_zenkouho_bun, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
635 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
636 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
637 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
638 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
639 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
640 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
641 return make_int (jl_zenkouho_bun (wnnfns_buf[snum]));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
642 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
643
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
644 DEFUN ("wnn-server-zenkouho-suu", Fwnn_zenkouho_suu, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
645 Return the number of zen kouho
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
646 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
647 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
648 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
649 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
650 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
651 return make_int (jl_zenkouho_suu (wnnfns_buf[snum]));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
652 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
653
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
654 DEFUN ("wnn-server-dai-top", Fwnn_dai_top, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
655 Return T if bunsetsu BUN-NUMBER is dai-bunsetsu.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
656 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
657 (bunNo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
658 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
659 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
660 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
661 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
662 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
663 if (jl_dai_top (wnnfns_buf[snum], XINT (bunNo)) == 1) return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
664 else return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
665 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
666
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
667 DEFUN ("wnn-server-dai-end", Fwnn_dai_end, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
668 Return the bunsetu number of the next dai-bunsetsu after BUN-NUMBER.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
669 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
670 (bunNo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
671 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
672 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
673 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
674 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
675 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
676 return make_int (dai_end (XINT (bunNo), snum));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
677 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
678
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
679 DEFUN ("wnn-server-henkan-kakutei", Fwnn_kakutei, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
680 Set candidate with OFFSET, DAI. DAI is T if dai-bunsetsu.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
681 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
682 (offset, dai))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
683 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
684 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
685 CHECK_INT (offset);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
686 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
687 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
688 if (EQ(dai, Qnil))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
689 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
690 if (jl_set_jikouho (wnnfns_buf[snum], XINT (offset)) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
691 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
692 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
693 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
694 if (jl_set_jikouho_dai (wnnfns_buf[snum], XINT (offset)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
695 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
696 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
697 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
698 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
699
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
700 DEFUN ("wnn-server-bunsetu-henkou", Fwnn_bunsetu_henkou, 3, 3, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
701 Change length of BUN-NUMBER bunsetu to LEN. DAI is T if dai-bunsetsu.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
702 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
703 (bunNo, len, dai))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
704 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
705 int cnt, no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
706 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
707 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
708 CHECK_INT (len);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
709 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
710 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
711 no = XINT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
712 #ifdef WNN6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
713 if ((cnt = jl_fi_nobi_conv (wnnfns_buf[snum], no, XINT(len), -1, WNN_USE_MAE,
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
714 (EQ(dai, Qnil)) ? WNN_SHO : WNN_DAI)) < 0)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
715 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
716 #else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
717 if ((cnt = jl_nobi_conv (wnnfns_buf[snum], no, XINT(len), -1, WNN_USE_MAE,
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
718 (EQ(dai, Qnil)) ? WNN_SHO : WNN_DAI)) < 0)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
719 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
720 #endif
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
721 return make_int (cnt);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
722 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
723
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
724 DEFUN ("wnn-server-inspect", Fwnn_inspect, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
725 Get bunsetsu information specified by BUN-NUMBER.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
726 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
727 (bunNo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
728 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
729 Lisp_Object val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
730 unsigned char cbuf[512];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
731 w_char wbuf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
732 int bun_no, yomilen, jirilen, i;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
733 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
734 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
735 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
736 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
737 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
738 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
739 bun_no = XINT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
740 val = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
741 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->kangovect), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
742 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->daihyoka), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
743 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->hyoka), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
744 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->ima), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
745 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->hindo), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
746 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->hinsi), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
747 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->entry), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
748 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->dic_no), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
749 yomilen = jl_get_yomi (wnnfns_buf[snum], bun_no, bun_no + 1, wbuf);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
750 jirilen = wnnfns_buf[snum]->bun[bun_no]->jirilen;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
751 for (i = yomilen; i >= jirilen; i--) wbuf[i+1] = wbuf[i];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
752 wbuf[jirilen] = '+';
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
753 w2m (wbuf, cbuf, lb);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
754 val = Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
755 jl_get_kanji (wnnfns_buf[snum], bun_no, bun_no + 1, wbuf);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
756 w2m (wbuf, cbuf, lb);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
757 val = Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
758 return val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
759 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
760
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
761
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
762 DEFUN ("wnn-server-henkan-quit", Fwnn_quit_henkan, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
763 do nothing
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
764 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
765 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
766 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
767 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
768 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
769 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
770 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
771 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
772
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
773 DEFUN ("wnn-server-bunsetu-kanji", Fwnn_bunsetu_kanji, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
774 Get the pair of kanji and length of bunsetsu specified by BUN-NUMBER.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
775 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
776 (bunNo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
777 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
778 int no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
779 unsigned char kanji_buf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
780 w_char wbuf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
781 int kanji_len;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
782 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
783 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
784 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
785 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
786 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
787 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
788 no = XINT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
789 kanji_len = jl_get_kanji (wnnfns_buf[snum], no, no + 1, wbuf);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
790 w2m (wbuf, kanji_buf, lb);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
791 return Fcons (make_string (kanji_buf, strlen ((char *) kanji_buf)),
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
792 make_int (kanji_len));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
793 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
794
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
795 DEFUN ("wnn-server-bunsetu-yomi", Fwnn_bunsetu_yomi, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
796 Get the pair of yomi and length of bunsetsu specified by BUN-NUMBER.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
797 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
798 (bunNo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
799 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
800 int no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
801 unsigned char yomi_buf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
802 w_char wbuf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
803 int yomi_len;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
804 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
805 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
806 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
807 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
808 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
809 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
810 no = XINT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
811 yomi_len = jl_get_yomi (wnnfns_buf[snum], no, no + 1, wbuf);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
812 w2m (wbuf, yomi_buf, lb);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
813 return Fcons (make_string (yomi_buf, strlen ((char *) yomi_buf)),
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
814 make_int (yomi_len));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
815 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
816
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
817 DEFUN ("wnn-server-bunsetu-suu", Fwnn_bunsetu_suu, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
818 Get the number of bunsetsu.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
819 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
820 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
821 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
822 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
823 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
824 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
825 return make_int (jl_bun_suu (wnnfns_buf[snum]));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
826 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
827
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
828 DEFUN ("wnn-server-hindo-update", Fwnn_hindo_update, 0, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
829 Update frequency of bunsetsu specified by NUM-NUMBER.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
830 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
831 (bunNo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
832 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
833 int no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
834 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
835 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
836 if (EQ(bunNo, Qnil)) no = -1;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
837 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
838 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
839 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
840 no = XINT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
841 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
842 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
843 #ifdef WNN6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
844 if (jl_optimize_fi (wnnfns_buf[snum], 0, no) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
845 #else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
846 if (jl_update_hindo (wnnfns_buf[snum], 0, no) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
847 #endif
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
848 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
849 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
850
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
851
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
852 DEFUN ("wnn-server-word-add", Fwnn_word_toroku, 5, 5, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
853 Add a word to dictionary. Arguments are
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
854 DIC-NUMBER, KANJI, YOMI, COMMENT, HINSI-NUMBER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
855 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
856 (dicno, kanji, yomi, comment, hinsi))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
857 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
858 w_char yomi_buf[256], kanji_buf[256], comment_buf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
859 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
860 CHECK_INT (dicno);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
861 CHECK_STRING (kanji);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
862 CHECK_STRING (yomi);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
863 CHECK_STRING (comment);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
864 CHECK_INT (hinsi);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
865 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
866 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
867 m2w (XSTRING (yomi)->_data, yomi_buf);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
868 if (snum == WNNSERVER_C)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
869 w2y (yomi_buf);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
870 m2w (XSTRING (kanji)->_data, kanji_buf);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
871 m2w (XSTRING (comment)->_data, comment_buf);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
872 if (jl_word_add (wnnfns_buf[snum], XINT (dicno), yomi_buf, kanji_buf,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
873 comment_buf, XINT (hinsi), 0) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
874 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
875 else return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
876 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
877
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
878
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
879 DEFUN ("wnn-server-word-delete", Fwnn_word_sakujo, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
880 Delete a word from dictionary, specified by DIC-NUMBER, SERIAL-NUMBER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
881 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
882 (no, serial))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
883 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
884 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
885 CHECK_INT (no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
886 CHECK_INT (serial);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
887 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
888 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
889 if (jl_word_delete (wnnfns_buf[snum], XINT (no), XINT (serial)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
890 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
891 else return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
892 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
893
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
894
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
895 DEFUN ("wnn-server-word-use", Fwnn_word_use, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
896 Toggle on/off word, specified by DIC-NUMBER and SERIAL-NUMBER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
897 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
898 (no, serial))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
899 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
900 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
901 CHECK_INT (no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
902 CHECK_INT (serial);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
903 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
904 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
905 if (jl_word_use (wnnfns_buf[snum], XINT (no), XINT (serial)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
906 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
907 else return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
908 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
909
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
910 DEFUN ("wnn-server-word-info", Fwnn_word_info, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
911 Return list of yomi, kanji, comment, hindo, hinshi.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
912 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
913 (no, serial))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
914 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
915 Lisp_Object val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
916 struct wnn_jdata *info_buf;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
917 unsigned char cbuf[512];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
918 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
919 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
920 CHECK_INT (no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
921 CHECK_INT (serial);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
922 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
923 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
924 if (!wnnfns_buf[snum]) return Qnil;
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 98
diff changeset
925 if ((info_buf = jl_word_info (wnnfns_buf[snum],
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 98
diff changeset
926 XINT (no), XINT (serial))) != NULL)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
927 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
928 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
929 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
930 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
931 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
932 val = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
933 val = Fcons (make_int (info_buf->hinshi), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
934 val = Fcons (make_int (info_buf->hindo), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
935 w2m (info_buf->com, cbuf, lb);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
936 val = Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
937 w2m (info_buf->kanji, cbuf, lb);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
938 val = Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
939 w2m (info_buf->yomi, cbuf, lb);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
940 val = Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
941 return val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
942 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
943 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
944
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
945 DEFUN ("wnn-server-word-hindo-set", Fwnn_hindo_set, 3, 3, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
946 Set frequency to arbitrary value. Specified by DIC-NUMBER,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
947 SERIAL-NUMBER, FREQUENCY
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
948 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
949 (no, serial, hindo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
950 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
951 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
952 CHECK_INT (no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
953 CHECK_INT (serial);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
954 CHECK_INT (hindo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
955 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
956 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
957 if (js_hindo_set (jl_env_get (wnnfns_buf[snum]),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
958 XINT (no),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
959 XINT (serial),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
960 WNN_HINDO_NOP,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
961 XINT (hindo)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
962 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
963 else return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
964 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
965
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
966
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
967 DEFUN ("wnn-server-word-search", Fwnn_dict_search, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
968 Search a word YOMI from buffer.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
969 Return list of (kanji hinshi freq dic_no serial).
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
970 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
971 (yomi))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
972 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
973 Lisp_Object val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
974 struct wnn_jdata *wordinfo;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
975 int i, count;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
976 w_char wbuf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
977 unsigned char kanji_buf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
978 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
979 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
980 CHECK_STRING (yomi);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
981 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
982 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
983 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
984 m2w (XSTRING (yomi)->_data, wbuf);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
985 if (snum == WNNSERVER_C)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
986 w2y (wbuf);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
987 if ((count = jl_word_search_by_env (wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
988 wbuf, &wordinfo)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
989 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
990 val = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
991 for (i = 0, wordinfo += count; i < count; i++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
992 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
993 wordinfo--;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
994 w2m (wordinfo->kanji, kanji_buf, lb);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
995 val = Fcons (Fcons (make_string (kanji_buf, strlen ((char *) kanji_buf)),
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
996 list4 (make_int (wordinfo->hinshi),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
997 make_int (wordinfo->hindo),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
998 make_int (wordinfo->dic_no),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
999 make_int (wordinfo->serial))),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1000 val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1001 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1002 return val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1003 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1004
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1005 DEFUN ("wnn-server-dict-save", Fwnn_dict_save, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1006 Save all dictionaries and frequency files.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1007 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1008 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1009 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1010 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1011 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1012 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1013 if (jl_dic_save_all (wnnfns_buf[snum]) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1014 else return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1015 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1016
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1017 DEFUN ("wnn-server-get-param", Fwnn_get_param, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1018 Returns (n nsho hindo len jiri flag jisho sbn dbn_len sbn_cnt
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1019 suuji kana eisuu kigou toji_kakko fuzokogo kaikakko)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1020 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1021 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1022 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1023 struct wnn_param param;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1024 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1025 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1026 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1027 if (jl_param_get (wnnfns_buf[snum], &param) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1028 return Fcons (make_int (param.n),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1029 Fcons (make_int (param.nsho),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1030 Fcons (make_int (param.p1),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1031 Fcons (make_int (param.p2),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1032 Fcons (make_int (param.p3),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1033 Fcons (make_int (param.p4),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1034 Fcons (make_int (param.p5),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1035 Fcons (make_int (param.p6),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1036 Fcons (make_int (param.p7),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1037 Fcons (make_int (param.p8),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1038 Fcons (make_int (param.p9),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1039 Fcons (make_int (param.p10),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1040 Fcons (make_int (param.p11),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1041 Fcons (make_int (param.p12),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1042 Fcons (make_int (param.p13),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1043 Fcons (make_int (param.p14),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1044 Fcons (make_int (param.p15),Qnil)))))))))))))))));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1045 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1046
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1047 DEFUN ("wnn-server-set-param", Fwnn_set_param, 1, 1, 0, /*
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1048 Set parameters using an alist, where the CAR contains one of
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1049 wnn_n, wnn_nsho, wnn_hindo, wnn_len, wnn_jiri, wnn_flag,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1050 wnn_jisho, wnn_sbn, wnn_dbn_len, wnn_sbn_cnt, wnn_suuji,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1051 wnn_kana, wnn_eisuu, wnn_kigou, wnn_toji_kakko, wnn_fuzokogo,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1052 or wnn_kaikakko and the CDR contains the value.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1053 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1054 (Vsetvalues_alist))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1055 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1056 int rc;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1057 struct wnn_param param;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1058 Lisp_Object tail, key, val;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1059 int snum;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1060
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1061 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1062 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1063 rc = jl_param_get (wnnfns_buf[snum], &param);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1064 if (rc < 0) return Qnil;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1065
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1066 EXTERNAL_PROPERTY_LIST_LOOP (tail, key, val, Vsetvalues_alist)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1067 {
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1068 int setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1069 CHECK_INT (val);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1070 setval = XINT (val);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1071 if (EQ (key, Qwnn_n)) param.n = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1072 else if (EQ (key, Qwnn_nsho)) param.nsho = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1073 else if (EQ (key, Qwnn_hindo)) param.p1 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1074 else if (EQ (key, Qwnn_len)) param.p2 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1075 else if (EQ (key, Qwnn_jiri)) param.p3 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1076 else if (EQ (key, Qwnn_flag)) param.p4 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1077 else if (EQ (key, Qwnn_jisho)) param.p5 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1078 else if (EQ (key, Qwnn_sbn)) param.p6 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1079 else if (EQ (key, Qwnn_dbn_len)) param.p7 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1080 else if (EQ (key, Qwnn_sbn_cnt)) param.p8 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1081 else if (EQ (key, Qwnn_suuji)) param.p9 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1082 else if (EQ (key, Qwnn_kana)) param.p10 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1083 else if (EQ (key, Qwnn_eisuu)) param.p11 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1084 else if (EQ (key, Qwnn_kigou)) param.p12 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1085 else if (EQ (key, Qwnn_toji_kakko)) param.p13 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1086 else if (EQ (key, Qwnn_fuzokogo)) param.p14 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1087 else if (EQ (key, Qwnn_kaikakko)) param.p15 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1088 else
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1089 {
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1090 signal_simple_error ("Invalid wnn keyword", key);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1091 return Qnil;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1092 }
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1093 }
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1094
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1095 #if 0
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1096 printf("wnn_n = %d\n",param.n);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1097 printf("wnn_nsho = %d\n",param.nsho);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1098 printf("wnn_hindo = %d\n",param.p1);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1099 printf("wnn_len = %d\n",param.p2);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1100 printf("wnn_jiri = %d\n",param.p3);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1101 printf("wnn_flag = %d\n",param.p4);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1102 printf("wnn_jisho = %d\n",param.p5);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1103 printf("wnn_sbn = %d\n",param.p6);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1104 printf("wnn_dbn_len = %d\n",param.p7);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1105 printf("wnn_sbn_cnt = %d\n",param.p8);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1106 printf("wnn_suuji = %d\n",param.p9);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1107 printf("wnn_kana = %d\n",param.p10);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1108 printf("wnn_eisuu = %d\n",param.p11);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1109 printf("wnn_kigou = %d\n",param.p12);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1110 printf("wnn_toji_kakko = %d\n",param.p13);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1111 printf("wnn_fuzokogo = %d\n",param.p14);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1112 printf("wnn_kaikakko = %d\n",param.p15);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1113 #endif
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1114
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1115 rc = jl_param_set (wnnfns_buf[snum], &param);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1116 if (rc < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1117 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1118 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1119
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1120 DEFUN ("wnn-server-get-msg", Fwnn_get_msg, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1121 Get message string from wnn_perror.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1122 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1123 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1124 {
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
1125 unsigned char mbuf[256];
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1126 char *msgp;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1127 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1128 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1129 char langname[32];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1130 /* CHECK_INT (errno);*/
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1131 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1132 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1133 switch (snum)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1134 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1135 case WNNSERVER_J:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1136 strcpy (langname, "ja_JP");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1137 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1138 case WNNSERVER_C:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1139 strcpy (langname, "zh_CN");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1140 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1141 /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1142 case WNNSERVER_T:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1143 strcpy (langname, "zh_TW");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1144 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1145 */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1146 case WNNSERVER_K:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1147 strcpy (langname, "ko_KR");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1148 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1149 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1150 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1151 /* msgp = msg_get (wnn_msg_cat, XINT (errno), 0, 0);*/
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1152 msgp = wnn_perror_lang (langname);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
1153 c2m ((unsigned char *) msgp, mbuf, lb);
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
1154 return make_string (mbuf, strlen ((char *) mbuf));
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1155 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1156
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1157
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1158 DEFUN ("wnn-server-fuzokugo-set", Fwnn_fuzokugo_set, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1159 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1160 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1161 (file))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1162 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1163 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1164 CHECK_STRING (file);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1165 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1166 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1167 if (jl_fuzokugo_set (wnnfns_buf[snum], XSTRING (file)->_data) < 0)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1168 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1169 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1170 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1171
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1172 DEFUN ("wnn-server-fuzokugo-get", Fwnn_fuzokugo_get, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1173 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1174 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1175 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1176 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1177 char fname[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1178 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1179 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1180 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1181 if (jl_fuzokugo_get (wnnfns_buf[snum], fname) < 0) return Qnil;
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
1182 return make_string ((Bufbyte *) fname, strlen (fname));
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1183 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1184
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1185
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1186 DEFUN ("wnn-server-isconnect", Fwnn_isconnect, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1187 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1188 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1189 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1190 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1191 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1192 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1193 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1194 if (jl_isconnect (wnnfns_buf[snum])) return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1195 else return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1196 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1197
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1198 DEFUN ("wnn-server-hinsi-dicts", Fwnn_hinsi_dicts, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1199 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1200 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1201 (hinsi))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1202 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1203 int *area;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1204 int cnt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1205 Lisp_Object val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1206 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1207 CHECK_INT (hinsi);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1208 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1209 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1210 if ((cnt = jl_hinsi_dicts (wnnfns_buf[snum], XINT (hinsi), &area)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1211 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1212 val = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1213 for (area += cnt; cnt > 0; cnt--)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1214 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1215 area--;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1216 val = Fcons (make_int (*area), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1217 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1218 return val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1219 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1220
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1221 DEFUN ("wnn-server-hinsi-list", Fwnn_hinsi_list, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1222 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1223 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1224 (dicno, name))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1225 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1226 int cnt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1227 Lisp_Object val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1228 w_char wbuf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1229 w_char **area;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1230 unsigned char cbuf[512];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1231 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1232 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1233 CHECK_INT (dicno);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1234 CHECK_STRING (name);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1235 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1236 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1237 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1238 m2w (XSTRING (name)->_data, wbuf);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1239 if ((cnt = jl_hinsi_list (wnnfns_buf[snum], XINT (dicno), wbuf, &area)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1240 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1241 if (cnt == 0) return make_int (0);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1242 val = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1243 for (area += cnt; cnt > 0; cnt--)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1244 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1245 area--;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1246 w2m (*area, cbuf, lb);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
1247 val = Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1248 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1249 return val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1250 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1251
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1252 DEFUN ("wnn-server-hinsi-name", Fwnn_hinsi_name, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1253 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1254 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1255 (no))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1256 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1257 unsigned char name[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1258 w_char *wname;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1259 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1260 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1261 CHECK_INT (no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1262 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1263 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1264 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1265 if ((wname = jl_hinsi_name (wnnfns_buf[snum], XINT (no))) == 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1266 w2m (wname, name, lb);
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
1267 return make_string (name, strlen ((char *) name));
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1268 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1269 #ifdef WNN6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1270 DEFUN ("wnn-server-fisys-dict-add", Fwnn_fisys_dict_add, 3, MANY, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1271 Add dictionary specified by FISYS-DICT-FILE-NAME, FISYS-FREQ-FILE-NAME,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1272 FISYS-FREQ-FILE-MODE.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1273 Specify password files of dictionary and frequency, PW1 and PW2, if needed.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1274 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1275 (int nargs, Lisp_Object *args))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1276 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1277 struct gcpro gcpro1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1278 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1279 CHECK_STRING (args[0]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1280 CHECK_STRING (args[1]);
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1281 if (!EQ(args[3], Qnil)) CHECK_STRING (args[3]);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1282 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1283 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1284 GCPRO1 (*args);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1285 gcpro1.nvars = nargs;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1286 if(jl_fi_dic_add(wnnfns_buf[snum],
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1287 XSTRING(args[0])->_data,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1288 XSTRING(args[1])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1289 WNN_FI_SYSTEM_DICT,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1290 WNN_DIC_RDONLY,
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1291 (EQ(args[2], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1292 0,
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1293 (EQ(args[3], Qnil)) ? 0 : XSTRING(args[3])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1294 yes_or_no,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1295 puts2 ) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1296 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1297 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1298 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1299 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1300 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1301 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1302
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1303 DEFUN ("wnn-server-fiusr-dict-add", Fwnn_fiusr_dict_add, 4, MANY, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1304 Add dictionary specified by FIUSR-DICT-FILE-NAME, FIUSR-FREQ-FILE-NAME,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1305 FIUSR-DICT-FILE-MODE, FIUSR-FREQ-FILE-MODE.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1306 Specify password files of dictionary and frequency, PW1 and PW2, if needed.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1307 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1308 (int nargs, Lisp_Object *args))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1309 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1310 struct gcpro gcpro1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1311 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1312 CHECK_STRING (args[0]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1313 CHECK_STRING (args[1]);
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1314 if (!EQ(args[4], Qnil)) CHECK_STRING (args[4]);
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1315 if (!EQ(args[5], Qnil)) CHECK_STRING (args[5]);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1316 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1317 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1318 GCPRO1 (*args);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1319 gcpro1.nvars = nargs;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1320 if(jl_fi_dic_add(wnnfns_buf[snum],
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1321 XSTRING(args[0])->_data,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1322 XSTRING(args[1])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1323 WNN_FI_USER_DICT,
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1324 (EQ(args[2], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW,
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1325 (EQ(args[3], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW,
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1326 (EQ(args[4], Qnil)) ? 0 : XSTRING(args[4])->_data,
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1327 (EQ(args[5], Qnil)) ? 0 : XSTRING(args[5])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1328 yes_or_no,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1329 puts2 ) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1330 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1331 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1332 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1333 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1334 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1335 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1336
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1337 DEFUN ("wnn-server-notrans-dict-add", Fwnn_notrans_dict_add, 3, MANY, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1338 Add dictionary specified by NOTRANS-DICT-FILE-NAME, PRIORITY, DICT-FILE-MODE.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1339 Specify password files of dictionary and frequency PW1 if needed.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1340 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1341 (int nargs, Lisp_Object *args))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1342 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1343 struct gcpro gcpro1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1344 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1345 int dic_no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1346 struct wnn_env *cur_env;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1347 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1348 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1349 CHECK_STRING (args[0]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1350 CHECK_INT (args[1]);
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1351 if (!EQ(args[3], Qnil)) CHECK_STRING (args[3]);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1352 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1353 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1354 GCPRO1 (*args);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1355 gcpro1.nvars = nargs;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1356 if(wnnfns_norm)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1357 cur_env = wnnfns_env_norm[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1358 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1359 cur_env = wnnfns_env_rev[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1360 dic_no = js_get_autolearning_dic(cur_env, WNN_MUHENKAN_LEARNING);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1361 if (dic_no == WNN_NO_LEARNING) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1362 if((dic_no = jl_dic_add(wnnfns_buf[snum],
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1363 XSTRING(args[0])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1364 0,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1365 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1366 XINT(args[1]),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1367 WNN_DIC_RW, WNN_DIC_RW,
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1368 (EQ(args[3], Qnil)) ? 0 : XSTRING(args[3])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1369 0,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1370 yes_or_no,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1371 puts2)) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1372 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1373 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1374 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1375 js_set_autolearning_dic(cur_env, WNN_MUHENKAN_LEARNING, dic_no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1376 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1377 if(!js_is_loaded_temporary_dic(cur_env)) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1378 if(js_temporary_dic_add(cur_env,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1379 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1380 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1381 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1382 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1383 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1384 vmask |= WNN_ENV_MUHENKAN_LEARN_MASK;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1385 henv.muhenkan_flag = (EQ(args[2], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1386 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1387 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1388 &henv) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1389 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1390 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1391 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1392 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1393 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1394 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1395
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1396 DEFUN ("wnn-server-bmodify-dict-add", Fwnn_bmodify_dict_add, 3, MANY, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1397 Add dictionary specified by BMODIFY-DICT-FILE-NAME, PRIORITY, DICT-FILE-MODE.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1398 Specify password files of dictionary and frequency PW1 if needed.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1399 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1400 (int nargs, Lisp_Object *args))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1401 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1402 struct gcpro gcpro1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1403 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1404 int dic_no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1405 struct wnn_env *cur_env;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1406 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1407 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1408 CHECK_STRING (args[0]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1409 CHECK_INT (args[1]);
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1410 if (!EQ(args[3], Qnil)) CHECK_STRING (args[3]);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1411 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1412 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1413 GCPRO1 (*args);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1414 gcpro1.nvars = nargs;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1415 if(wnnfns_norm)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1416 cur_env = wnnfns_env_norm[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1417 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1418 cur_env = wnnfns_env_rev[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1419 dic_no = js_get_autolearning_dic(cur_env, WNN_BUNSETSUGIRI_LEARNING);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1420 if (dic_no == WNN_NO_LEARNING) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1421 if((dic_no = jl_dic_add(wnnfns_buf[snum],
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1422 XSTRING(args[0])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1423 0,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1424 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1425 XINT(args[1]),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1426 WNN_DIC_RW, WNN_DIC_RW,
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1427 (EQ(args[3], Qnil)) ? 0 : XSTRING(args[3])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1428 0,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1429 yes_or_no,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1430 puts2)) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1431 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1432 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1433 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1434 js_set_autolearning_dic(cur_env, WNN_BUNSETSUGIRI_LEARNING, dic_no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1435 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1436 if(!js_is_loaded_temporary_dic(cur_env)) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1437 if(js_temporary_dic_add(cur_env,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1438 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1439 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1440 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1441 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1442 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1443 vmask |= WNN_ENV_BUNSETSUGIRI_LEARN_MASK;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1444 henv.bunsetsugiri_flag = (EQ(args[2], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1445 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1446 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1447 &henv) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1448 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1449 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1450 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1451 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1452 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1453 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1454
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1455 DEFUN ("wnn-server-set-last-is-first", Fwnn_last_is_first, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1456 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1457 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1458 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1459 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1460 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1461 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1462 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1463 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1464 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1465 vmask |= WNN_ENV_LAST_IS_FIRST_MASK;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1466 henv.last_is_first_flag = (EQ(mode, Qnil)) ? False : True;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1467 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1468 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1469 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1470 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1471 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1472
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1473 DEFUN ("wnn-server-set-complex-conv-mode", Fwnn_complex_conv, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1474 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1475 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1476 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1477 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1478 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1479 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1480 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1481 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1482 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1483 vmask |= WNN_ENV_COMPLEX_CONV_MASK;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1484 henv.complex_flag = (EQ(mode, Qnil)) ? False : True;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1485 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1486 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1487 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1488 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1489 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1490
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1491 DEFUN ("wnn-server-set-okuri-learn-mode", Fwnn_okuri_learn, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1492 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1493 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1494 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1495 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1496 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1497 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1498 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1499 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1500 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1501 vmask |= WNN_ENV_OKURI_LEARN_MASK;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1502 henv.okuri_learn_flag = (EQ(mode, Qnil)) ? False : True;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1503 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1504 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1505 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1506 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1507 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1508
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1509 DEFUN ("wnn-server-set-okuri-flag", Fwnn_okuri_flag, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1510 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1511 */
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1512 (lmode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1513 {
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1514 int snum, mode;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1515 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1516 struct wnn_henkan_env henv;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1517 CHECK_INT (lmode);
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1518 mode = XINT (lmode);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1519 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1520 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1521 if(mode != WNN_OKURI_REGULATION &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1522 mode != WNN_OKURI_NO &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1523 mode != WNN_OKURI_YES)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1524 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1525 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1526 henv.okuri_flag = mode;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1527 vmask |= WNN_ENV_OKURI_MASK;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1528 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1529 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1530 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1531 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1532 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1533
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1534 DEFUN ("wnn-server-set-prefix-learn-mode", Fwnn_prefix_learn, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1535 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1536 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1537 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1538 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1539 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1540 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1541 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1542 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1543 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1544 vmask |= WNN_ENV_PREFIX_LEARN_MASK;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1545 henv.prefix_learn_flag = (EQ(mode, Qnil)) ? False : True;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1546 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1547 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1548 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1549 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1550 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1551
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1552 DEFUN ("wnn-server-set-prefix-flag", Fwnn_prefix_flag, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1553 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1554 */
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1555 (lmode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1556 {
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1557 int snum, mode;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1558 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1559 struct wnn_henkan_env henv;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1560 CHECK_INT (lmode);
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1561 mode = XINT (lmode);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1562 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1563 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1564 if(mode != WNN_KANA_KOUHO && mode != WNN_KANJI_KOUHO)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1565 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1566 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1567 henv.prefix_flag = mode;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1568 vmask |= WNN_ENV_PREFIX_MASK;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1569 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1570 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1571 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1572 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1573 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1574
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1575 DEFUN ("wnn-server-set-suffix-learn-mode", Fwnn_suffix_learn, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1576 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1577 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1578 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1579 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1580 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1581 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1582 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1583 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1584 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1585 vmask |= WNN_ENV_SUFFIX_LEARN_MASK;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1586 henv.suffix_learn_flag = (EQ(mode, Qnil)) ? False : True;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1587 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1588 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1589 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1590 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1591 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1592
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1593 DEFUN ("wnn-server-set-common-learn-mode", Fwnn_common_learn, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1594 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1595 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1596 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1597 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1598 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1599 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1600 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1601 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1602 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1603 vmask |= WNN_ENV_COMMON_LAERN_MASK;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1604 henv.common_learn_flag = (EQ(mode, Qnil)) ? False : True;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1605 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1606 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1607 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1608 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1609 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1610
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1611 DEFUN ("wnn-server-set-freq-func-mode", Fwnn_freq_func, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1612 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1613 */
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1614 (lmode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1615 {
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1616 int snum, mode;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1617 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1618 struct wnn_henkan_env henv;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1619 CHECK_INT (lmode);
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1620 mode = XINT (lmode);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1621 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1622 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1623 if(mode != 0 && mode != 1 && mode != 2 && mode != 3 && mode != 4)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1624 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1625 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1626 henv.freq_func_flag = mode;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1627 vmask |= WNN_ENV_FREQ_FUNC_MASK;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1628 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1629 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1630 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1631 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1632 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1633
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1634 DEFUN ("wnn-server-set-numeric-mode", Fwnn_numeric, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1635 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1636 */
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1637 (lmode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1638 {
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1639 int snum, mode;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1640 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1641 struct wnn_henkan_env henv;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1642 CHECK_INT (lmode);
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1643 mode = XINT (lmode);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1644 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1645 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1646 if(mode != WNN_NUM_KANSUUJI &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1647 mode != WNN_NUM_KANOLD &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1648 mode != WNN_NUM_HANCAN &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1649 mode != WNN_NUM_ZENCAN &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1650 mode != WNN_NUM_HAN &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1651 mode != WNN_NUM_ZEN &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1652 mode != WNN_NUM_KAN)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1653 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1654 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1655 henv.numeric_flag = mode;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1656 vmask |= WNN_ENV_NUMERIC_MASK;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1657 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1658 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1659 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1660 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1661 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1662
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1663 DEFUN ("wnn-server-set-alphabet-mode", Fwnn_alphabet, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1664 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1665 */
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1666 (lmode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1667 {
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1668 int snum, mode;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1669 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1670 struct wnn_henkan_env henv;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1671 CHECK_INT (lmode);
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1672 mode = XINT (lmode);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1673 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1674 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1675 if(mode != WNN_ALP_HAN && mode != WNN_ALP_ZEN)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1676 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1677 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1678 henv.alphabet_flag = mode;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1679 vmask |= WNN_ENV_ALPHABET_MASK;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1680 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1681 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1682 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1683 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1684 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1685
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1686 DEFUN ("wnn-server-set-symbol-mode", Fwnn_symbol, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1687 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1688 */
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1689 (lmode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1690 {
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1691 int snum, mode;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1692 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1693 struct wnn_henkan_env henv;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1694 CHECK_INT (lmode);
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1695 mode = XINT (lmode);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1696 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1697 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1698 if(mode != WNN_KIG_HAN && mode != WNN_KIG_JIS && mode != WNN_KIG_ASC)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1699 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1700 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1701 henv.symbol_flag = mode;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1702 vmask |= WNN_ENV_SYMBOL_MASK;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1703 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1704 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1705 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1706 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1707 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1708
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1709 DEFUN ("wnn-server-set-yuragi-mode", Fwnn_yuragi, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1710 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1711 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1712 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1713 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1714 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1715 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1716 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1717 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1718 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1719 vmask |= WNN_ENV_YURAGI_MASK;
129
e292c9648bb9 Import from CVS: tag xemacs-20-1p3
cvs
parents: 126
diff changeset
1720 henv.yuragi_flag = (EQ(mode, Qnil)) ? False : True;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1721 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1722 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1723 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1724 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1725 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1726
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1727 DEFUN ("wnn-reset-previous-info", Fwnn_reset_prev, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1728 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1729 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1730 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1731 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1732 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1733 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1734 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1735 if(jl_reset_prev_bun(wnnfns_buf[snum]) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1736 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1737 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1738 #endif /* Wnn6 */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1739
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1740 DEFUN ("wnn-server-version", Fwnn_version, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1741 Returns Wnn server version ID.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1742 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1743 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1744 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1745 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1746 int serv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1747 int libv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1748 struct wnn_env *cur_env;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1749 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1750 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1751 if(wnnfns_norm)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1752 cur_env = wnnfns_env_norm[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1753 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1754 cur_env = wnnfns_env_rev[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1755 if(js_version (cur_env->js_id,&serv,&libv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1756 return make_int (serv);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1757 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1758
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1759 DEFUN ("wnn-server-hinsi-number", Fwnn_hinsi_number, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1760 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1761 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1762 (name))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1763 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1764 w_char w_buf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1765 int no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1766 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1767 CHECK_STRING (name);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1768 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1769 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1770 m2w (XSTRING (name)->_data, w_buf);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1771 if ((no = jl_hinsi_number (wnnfns_buf[snum], w_buf)) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1772 return make_int (no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1773 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1774
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1775 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1776 syms_of_mule_wnn (void)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1777 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1778 DEFSUBR (Fwnn_open);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1779 DEFSUBR (Fwnn_close);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1780 DEFSUBR (Fwnn_dict_add);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1781 DEFSUBR (Fwnn_dict_delete);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1782 DEFSUBR (Fwnn_dict_list);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1783 DEFSUBR (Fwnn_dict_comment);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1784 DEFSUBR (Fwnn_set_rev);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1785 DEFSUBR (Fwnn_begin_henkan);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1786 DEFSUBR (Fwnn_zenkouho);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1787 DEFSUBR (Fwnn_get_zenkouho);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1788 DEFSUBR (Fwnn_zenkouho_bun);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1789 DEFSUBR (Fwnn_zenkouho_suu);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1790 DEFSUBR (Fwnn_dai_top);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1791 DEFSUBR (Fwnn_dai_end);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1792 DEFSUBR (Fwnn_kakutei);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1793 DEFSUBR (Fwnn_bunsetu_henkou);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1794 DEFSUBR (Fwnn_inspect);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1795 DEFSUBR (Fwnn_quit_henkan);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1796 DEFSUBR (Fwnn_bunsetu_kanji);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1797 DEFSUBR (Fwnn_bunsetu_yomi);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1798 DEFSUBR (Fwnn_bunsetu_suu);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1799 DEFSUBR (Fwnn_hindo_update);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1800 DEFSUBR (Fwnn_word_toroku);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1801 DEFSUBR (Fwnn_word_sakujo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1802 DEFSUBR (Fwnn_word_use);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1803 DEFSUBR (Fwnn_word_info);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1804 DEFSUBR (Fwnn_hindo_set);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1805 DEFSUBR (Fwnn_dict_search);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1806 DEFSUBR (Fwnn_dict_save);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1807 DEFSUBR (Fwnn_get_param);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1808 DEFSUBR (Fwnn_set_param);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1809 DEFSUBR (Fwnn_get_msg);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1810 DEFSUBR (Fwnn_fuzokugo_set);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1811 DEFSUBR (Fwnn_fuzokugo_get);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1812 DEFSUBR (Fwnn_isconnect);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1813 DEFSUBR (Fwnn_hinsi_dicts);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1814 DEFSUBR (Fwnn_hinsi_list);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1815 DEFSUBR (Fwnn_hinsi_name);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1816 DEFSUBR (Fwnn_hinsi_number);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1817 #ifdef WNN6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1818 DEFSUBR (Fwnn_fisys_dict_add);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1819 DEFSUBR (Fwnn_fiusr_dict_add);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1820 DEFSUBR (Fwnn_notrans_dict_add);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1821 DEFSUBR (Fwnn_bmodify_dict_add);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1822 DEFSUBR (Fwnn_last_is_first);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1823 DEFSUBR (Fwnn_complex_conv);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1824 DEFSUBR (Fwnn_okuri_learn);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1825 DEFSUBR (Fwnn_okuri_flag);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1826 DEFSUBR (Fwnn_prefix_learn);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1827 DEFSUBR (Fwnn_prefix_flag);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1828 DEFSUBR (Fwnn_suffix_learn);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1829 DEFSUBR (Fwnn_common_learn);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1830 DEFSUBR (Fwnn_freq_func);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1831 DEFSUBR (Fwnn_numeric);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1832 DEFSUBR (Fwnn_alphabet);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1833 DEFSUBR (Fwnn_symbol);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1834 DEFSUBR (Fwnn_yuragi);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1835 DEFSUBR (Fwnn_reset_prev);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1836 #endif /* Wnn6 */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1837 DEFSUBR (Fwnn_version);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1838
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1839 defsymbol (&Qjserver, "jserver");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1840 defsymbol (&Qcserver, "cserver");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1841 /* defsymbol (&Qtserver, "tserver"); */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1842 defsymbol (&Qkserver, "kserver");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1843
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1844 defsymbol (&Qwnn_no_uniq, "wnn-no-uniq");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1845 defsymbol (&Qwnn_uniq, "wnn-uniq");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1846 defsymbol (&Qwnn_uniq_kanji, "wnn-uniq-kanji");
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1847 defsymbol (&Qwnn_n, "wnn_n");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1848 defsymbol (&Qwnn_nsho, "wnn_nsho");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1849 defsymbol (&Qwnn_hindo, "wnn_hindo");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1850 defsymbol (&Qwnn_len, "wnn_len");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1851 defsymbol (&Qwnn_jiri, "wnn_jiri");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1852 defsymbol (&Qwnn_flag, "wnn_flag");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1853 defsymbol (&Qwnn_jisho, "wnn_jisho");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1854 defsymbol (&Qwnn_sbn, "wnn_sbn");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1855 defsymbol (&Qwnn_dbn_len, "wnn_dbn_len");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1856 defsymbol (&Qwnn_sbn_cnt, "wnn_sbn_cnt");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1857 defsymbol (&Qwnn_suuji, "wnn_suuji");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1858 defsymbol (&Qwnn_kana, "wnn_kana");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1859 defsymbol (&Qwnn_eisuu, "wnn_eisuu");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1860 defsymbol (&Qwnn_kigou, "wnn_kigou");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1861 defsymbol (&Qwnn_toji_kakko, "wnn_toji_kakko");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1862 defsymbol (&Qwnn_fuzokogo, "wnn_fuzokogo");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1863 defsymbol (&Qwnn_kaikakko, "wnn_kaikakko");
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1864 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1865
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1866 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1867 vars_of_mule_wnn (void)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1868 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1869 int i;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1870
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1871 DEFVAR_INT ("lb-sisheng", &lb_sisheng /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1872 Leading character for Sisheng.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1873 */ );
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1874 DEFVAR_LISP ("wnn-server-type", &Vwnn_server_type /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1875 *jserver, cserver ..
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1876 */ );
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1877 DEFVAR_LISP ("cwnn-zhuyin", &Vcwnn_zhuyin /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1878 *pinyin or zhuyin
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1879 */ );
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1880 DEFVAR_LISP ("wnnenv-sticky", &Vwnnenv_sticky /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1881 *If non-nil, make environment sticky
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1882 */ );
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1883 DEFVAR_LISP ("wnn-uniq-level", &Vwnn_uniq_level /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1884 *Uniq level
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1885 */ );
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1886
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1887 Vwnn_server_type = Qjserver;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1888 Vcwnn_zhuyin = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1889 Vwnnenv_sticky = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1890
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1891 Vwnn_uniq_level = Qwnn_uniq;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1892
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1893 for (i = 0; i < NSERVER; i++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1894 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1895 wnnfns_buf[i] = (struct wnn_buf *) 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1896 wnnfns_env_norm[i] = (struct wnn_env *) 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1897 wnnfns_env_rev[i] = (struct wnn_env *) 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1898 }
207
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 179
diff changeset
1899
e45d5e7c476e Import from CVS: tag r20-4b2
cvs
parents: 179
diff changeset
1900 Fprovide(intern("wnn"));
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1901 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1902
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1903 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1904 w2m (w_char *wp, unsigned char *mp, unsigned char lb)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1905 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1906 w_char wc;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1907 w_char pzy[10];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1908 int i, len;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1909
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
1910 while ((wc = *wp++) != 0)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1911 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1912 switch (wc & 0x8080)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1913 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1914 case 0x80:
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1915 if (EQ(Vwnn_server_type, Qcserver))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1916 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1917 len = cwnn_yincod_pzy (pzy, wc,
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1918 (EQ(Vcwnn_zhuyin, Qnil))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1919 ? CWNN_PINYIN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1920 : CWNN_ZHUYIN);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1921 for (i = 0; i < len; i++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1922 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1923 if (pzy[i] & 0x80)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1924 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1925 *mp++ = PRE_LEADING_BYTE_PRIVATE_1; /* #### Not sure about this one... */
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1926 *mp++ = lb_sisheng;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1927 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1928 *mp++ = pzy[i];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1929 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1930 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1931 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1932 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1933 *mp++ = LEADING_BYTE_KATAKANA_JISX0201;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1934 *mp++ = (wc & 0xff);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1935 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1936 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1937 case 0x8080:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1938 *mp++ = lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1939 *mp++ = (wc & 0xff00) >> 8;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1940 *mp++ = wc & 0x00ff;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1941 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1942 case 0x8000:
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1943 if (lb == LEADING_BYTE_JAPANESE_JISX0208)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1944 *mp++ = LEADING_BYTE_JAPANESE_JISX0212;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1945 else if (lb == LEADING_BYTE_CHINESE_BIG5_1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1946 *mp++ = LEADING_BYTE_CHINESE_BIG5_2;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1947 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1948 *mp++ = lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1949 *mp++ = (wc & 0xff00) >> 8;
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
1950 *mp++ = (wc & 0x00ff) | 0x80;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1951 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1952 default:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1953 *mp++ = wc & 0x00ff;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1954 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1955 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1956 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1957 *mp = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1958 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1959
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1960 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1961 m2w (unsigned char *mp, w_char *wp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1962 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1963 unsigned int ch;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1964
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
1965 while ((ch = *mp++) != 0)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1966 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1967 if (BUFBYTE_LEADING_BYTE_P (ch))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1968 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1969 switch (ch)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1970 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1971 case LEADING_BYTE_KATAKANA_JISX0201:
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1972 *wp++ = *mp++; break;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1973 case LEADING_BYTE_LATIN_JISX0201:
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1974 *wp++ = *mp++ & 0x7F; break;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1975 case LEADING_BYTE_JAPANESE_JISX0208_1978:
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1976 case LEADING_BYTE_CHINESE_GB2312:
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1977 case LEADING_BYTE_JAPANESE_JISX0208:
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1978 case LEADING_BYTE_KOREAN_KSC5601:
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1979 /* case LEADING_BYTE_TW: */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1980 ch = *mp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1981 *wp++ = (ch << 8) | *mp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1982 break;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1983 case LEADING_BYTE_JAPANESE_JISX0212:
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1984 ch = *mp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1985 *wp++ = (ch << 8) | (*mp++ & 0x7f);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1986 break;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1987 case PRE_LEADING_BYTE_PRIVATE_1: /* #### Not sure about this one... */
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1988 ch = *mp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1989 if (ch == lb_sisheng)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1990 *wp++ = 0x8e80 | *mp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1991 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1992 mp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1993 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1994 default: /* ignore this character */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1995 mp += REP_BYTES_BY_FIRST_BYTE(ch) - 1;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1996 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1997 }
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1998 else
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1999 {
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2000 *wp++ = ch;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2001 }
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2002 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2003 *wp = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2004 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2005
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2006 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2007 w2y (w_char *w)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2008 {
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
2009 letter pbuf[5000], ybuf[5000];
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
2010 unsigned int *pin;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2011 w_char *y;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2012 int len;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2013
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2014 pin = pbuf;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2015 y = w;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2016 while (1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2017 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2018 if (*w == 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2019 {*pin =0; break;}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2020 else *pin = *w;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2021 w++; pin++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2022 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2023 len = cwnn_pzy_yincod (ybuf, pbuf,
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2024 (EQ(Vcwnn_zhuyin, Qnil)) ? CWNN_PINYIN : CWNN_ZHUYIN);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2025 if (len <= 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2026 return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2027
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2028 pin = ybuf;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2029 while (1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2030 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2031 if (*pin == 0 || len == 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2032 {*y = 0;break;}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2033 *y = *pin;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2034 y++; pin++; len--;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2035 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2036 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2037
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2038 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2039 c2m (unsigned char *cp, unsigned char *mp, unsigned char lb)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2040 {
173
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
2041 unsigned char ch;
8eaf7971accc Import from CVS: tag r20-3b13
cvs
parents: 169
diff changeset
2042 while ((ch = *cp) != 0)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2043 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2044 if (ch & 0x80)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2045 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2046 *mp++ = lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2047 *mp++ = *cp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2048 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2049 *mp++ = *cp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2050 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2051 *mp = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2052 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2053
157
6b37e6ddd302 Import from CVS: tag r20-3b5
cvs
parents: 151
diff changeset
2054 static int
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2055 dai_end (int no, int server)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2056 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2057 for (no++; no < jl_bun_suu (wnnfns_buf[server])
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2058 && !jl_dai_top (wnnfns_buf[server], no); no++);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2059 return (no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2060 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2061
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2062 static int
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2063 yes_or_no (unsigned char *s)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2064 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2065 unsigned char mbuf[512];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2066 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2067 int len;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2068 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2069 if ((snum = check_wnn_server_type ()) == -1) return 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2070 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2071 /* if no message found, create file without query */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2072 /* if (wnn_msg_cat->msg_bd == 0) return 1;*/
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2073 if (*s == 0) return 1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2074 c2m (s, mbuf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2075 /* truncate "(Y/N)" */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2076 for (len = 0; (mbuf[len]) && (len < 512); len++);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2077 for (; (mbuf[len] != '(') && (len > 0); len--);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2078 {
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2079 Lisp_Object yes, str;
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 129
diff changeset
2080 struct gcpro gcpro1;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2081
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2082 str = make_string (mbuf, len);
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 129
diff changeset
2083 GCPRO1 (str);
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 98
diff changeset
2084 yes = call1(Qyes_or_no_p, str);
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 129
diff changeset
2085 UNGCPRO;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2086 if (NILP (yes)) return 0;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2087 else return (1);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2088 }
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2089 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2090
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2091 static void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2092 puts2 (char *s)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2093 {
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 129
diff changeset
2094 #if 0 /* jhod: We don't really need this echoed... */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2095 #if 0
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2096 Lisp_Object args[1];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2097 char mbuf[512];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2098 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2099 extern Lisp_Object Fmessage ();
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2100 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2101 if ((snum = check_wnn_server_type ()) == -1) return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2102 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2103 c2m (s, mbuf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2104 args[0] = make_string (mbuf, strlen (mbuf));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2105 Fmessage (1, args);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2106 #else
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2107 message("%s",s);
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 129
diff changeset
2108 #endif
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 129
diff changeset
2109 #endif
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2110 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2111
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2112 int
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2113 check_wnn_server_type (void)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2114 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2115 if (EQ(Vwnn_server_type, Qjserver))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2116 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2117 return WNNSERVER_J;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2118 }
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2119 else if (EQ(Vwnn_server_type, Qcserver))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2120 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2121 return WNNSERVER_C;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2122 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2123 /* else if (Vwnn_server_type == Qtserver)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2124 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2125 return WNNSERVER_T;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2126 } */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2127 else if (EQ(Vwnn_server_type, Qkserver))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2128 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2129 return WNNSERVER_K;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2130 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2131 else return -1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2132 }