annotate src/mule-wnnfns.c @ 98:0d2f883870bc r20-1b1

Import from CVS: tag r20-1b1
author cvs
date Mon, 13 Aug 2007 09:13:56 +0200
parents 1ce6082ce73f
children a145efe76779
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"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
271
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
272 #include "commonhd.h"
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
273 #include "mule-charset.h"
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
274 #include "jllib.h"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
275 #include "cplib.h"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
276
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
277 /* UCHAR $B$,Fs=EDj5A$5$l$k$N$G(B */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
278 #define _UCHAR_T
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
279
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
280 #define EGG_TIMEOUT 5
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
281 #define NSERVER 4
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
282 #define WNNSERVER_J 0
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
283 #define WNNSERVER_C 1
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
284 #define WNNSERVER_T 2
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
285 #define WNNSERVER_K 3
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
286
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
287 void w2m (w_char *wp, unsigned char *mp, unsigned char lb);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
288 void m2w (unsigned char *mp, w_char *wp);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
289 void w2y (w_char *w);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
290 void c2m (unsigned char *cp, unsigned char *mp, unsigned char lb);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
291 static void puts2 (char *s);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
292 static int yes_or_no (unsigned char *s);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
293
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
294 static struct wnn_buf *wnnfns_buf[NSERVER];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
295 static struct wnn_env *wnnfns_env_norm[NSERVER];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
296 static struct wnn_env *wnnfns_env_rev[NSERVER];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
297 static int wnnfns_norm;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
298 static unsigned char lb_wnn_server_type[NSERVER] =
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
299 {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
300
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
301 /* Lisp Variables and Constants Definition */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
302 Lisp_Object Qjserver;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
303 Lisp_Object Qcserver;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
304 /*Lisp_Object Qtserver;*/
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
305 Lisp_Object Qkserver;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
306 Lisp_Object Qwnn_no_uniq;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
307 Lisp_Object Qwnn_uniq;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
308 Lisp_Object Qwnn_uniq_kanji;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
309 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
310 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
311 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
312 Lisp_Object Vwnn_server_type;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
313 Lisp_Object Vcwnn_zhuyin;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
314 Lisp_Object Vwnnenv_sticky;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
315 Lisp_Object Vwnn_uniq_level;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
316 int lb_sisheng;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
317
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
318 /* Lisp functions definition */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
319
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
320
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
321
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
322 DEFUN ("wnn-server-open", Fwnn_open, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
323 Connect to jserver of host HNAME, make an environment with
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
324 login name LNAME in the server.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
325 Return nil if error occurs
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
326 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
327 (hname, lname))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
328 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
329 char envname[32];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
330 char langname[32];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
331 char hostname[32];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
332 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
333 CHECK_STRING (lname);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
334
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
335 snum = check_wnn_server_type ();
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
336 switch (snum)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
337 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
338 case WNNSERVER_J:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
339 strcpy (langname, "ja_JP");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
340 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
341 case WNNSERVER_C:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
342 strcpy (langname, "zh_CN");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
343 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
344 /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
345 case WNNSERVER_T:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
346 strcpy (langname, "zh_TW");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
347 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
348 */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
349 case WNNSERVER_K:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
350 strcpy (langname, "ko_KR");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
351 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
352 }
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
353 strncpy (envname, XSTRING (lname)->_data, 32);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
354 if (EQ(hname, Qnil)) strcpy (hostname, "");
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
355 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
356 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
357 CHECK_STRING (hname);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
358 strncpy (hostname, XSTRING (hname)->_data, 32);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
359 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
360 CHECK_STRING (lname);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
361 if (!(wnnfns_buf[snum] = jl_open_lang (envname, hostname, langname,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
362 0, 0, 0, EGG_TIMEOUT)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
363 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
364 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
365 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
366 if (!jl_isconnect (wnnfns_buf[snum])) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
367 wnnfns_env_norm[snum] = jl_env_get (wnnfns_buf[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
368 /* if (Vwnnenv_sticky == Qt) jl_env_sticky_e (wnnfns_env_norm[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
369 else jl_env_un_sticky_e (wnnfns_env_norm[snum]);*/
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
370 strcat (envname, "R");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
371 if (!(wnnfns_env_rev[snum] = jl_connect_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 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
374 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
375 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
376 /* if (Vwnnenv_sticky == Qt) jl_env_sticky_e (wnnfns_env_rev[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
377 else jl_env_un_sticky_e (wnnfns_env_rev[snum]);*/
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
378 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
379 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
380
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
381
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
382 DEFUN ("wnn-server-close", Fwnn_close, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
383 Close the connection to jserver, Dictionary and friquency files
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
384 are not saved.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
385 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
386 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
387 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
388 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
389 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
390 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
391 if (wnnfns_env_norm[snum])
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
392 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
393 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
394 else jl_env_sticky_e (wnnfns_env_norm[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
395 jl_disconnect (wnnfns_env_norm[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
396 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
397 if (wnnfns_env_rev[snum])
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
398 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
399 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
400 else jl_env_sticky_e (wnnfns_env_rev[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
401 jl_disconnect (wnnfns_env_rev[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
402 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
403 jl_env_set (wnnfns_buf[snum], 0);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
404 jl_close (wnnfns_buf[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
405 wnnfns_buf[snum] = (struct wnn_buf *) 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
406 wnnfns_env_norm[snum] = wnnfns_env_rev[snum] = (struct wnn_env *) 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
407 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
408 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
409
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
410 DEFUN ("wnn-server-dict-add", Fwnn_dict_add, 5, MANY, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
411 Add dictionary specified by DICT-FILE-NAME, FREQ-FILE-NAME,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
412 PRIORITY, DICT-FILE-MODE, FREQ-FILE-MODE.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
413 Specify password files of dictionary and frequency, PW1 and PW2, if needed.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
414 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
415 (int nargs, Lisp_Object *args))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
416 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
417 struct gcpro gcpro1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
418 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
419 CHECK_STRING (args[0]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
420 CHECK_STRING (args[1]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
421 CHECK_INT (args[2]);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
422 if (!EQ(args[5], Qnil)) CHECK_STRING (args[5]);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
423 if (!EQ(args[6], Qnil)) CHECK_STRING (args[6]);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
424 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
425 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
426 GCPRO1 (*args);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
427 gcpro1.nvars = nargs;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
428 if (jl_dic_add (wnnfns_buf[snum],
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
429 XSTRING (args[0])->_data,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
430 XSTRING (args[1])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
431 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
432 XINT (args[2]),
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
433 (EQ(args[3], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
434 (EQ(args[4], Qnil)) ? WNN_DIC_RDONLY : WNN_DIC_RW,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
435 (EQ(args[5], Qnil)) ? 0 : XSTRING (args[5])->_data,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
436 (EQ(args[6], Qnil)) ? 0 : XSTRING (args[6])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
437 yes_or_no,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
438 puts2 ) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
439 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
440 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
441 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
442 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
443 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
444 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
445 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
446
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
447 DEFUN ("wnn-server-dict-delete", Fwnn_dict_delete, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
448 Remove dictionary specified by DIC-NUMBER from buffer.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
449 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
450 (dicno))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
451 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
452 int no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
453 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
454 CHECK_INT (dicno);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
455 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
456 no = XINT (dicno);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
457 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
458 if (jl_dic_delete (wnnfns_buf[snum], no) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
459 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
460 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
461
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
462 DEFUN ("wnn-server-dict-list", Fwnn_dict_list, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
463 Return information of dictionaries.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
464 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
465 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
466 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
467 WNN_DIC_INFO *dicinfo;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
468 int cnt, i;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
469 unsigned char comment[1024];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
470 Lisp_Object val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
471 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
472 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
473
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
474 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
475 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
476 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
477 #ifdef WNN6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
478 if((cnt = jl_fi_dic_list (wnnfns_buf[snum], 0x3f, &dicinfo)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
479 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
480 #else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
481 if((cnt = jl_dic_list (wnnfns_buf[snum], &dicinfo)) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
482 #endif
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
483 val = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
484 for (i = 0, dicinfo += cnt; i < cnt; i++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
485 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
486 dicinfo--;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
487 w2m (dicinfo->comment, comment, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
488 val = Fcons (Fcons (make_int (dicinfo->dic_no),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
489 list4 (make_string (dicinfo->fname, strlen
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
490 (dicinfo->fname)),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
491 make_string (comment, strlen (comment)),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
492 make_int (dicinfo->gosuu),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
493 make_int (dicinfo->nice))), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
494 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
495 return val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
496 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
497
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
498 DEFUN ("wnn-server-dict-comment", Fwnn_dict_comment, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
499 Set comment to dictionary specified by DIC-NUMBER.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
500 Comment string COMMENT
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
501 */
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
502 (dicno, comment))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
503 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
504 w_char wbuf[512];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
505 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
506 CHECK_INT (dicno);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
507 CHECK_STRING (comment);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
508 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
509 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
510 m2w (XSTRING (comment)->_data, wbuf);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
511 if (jl_dic_comment_set (wnnfns_buf[snum], XINT (dicno), wbuf) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
512 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
513 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
514 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
515
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
516
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
517 DEFUN ("wnn-server-set-rev", Fwnn_set_rev, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
518 Switch the translation mode to normal if T, or reverse if NIL.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
519 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
520 (rev))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
521 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
522 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
523 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
524 if (EQ(rev, Qnil))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
525 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
526 if ((!wnnfns_buf[snum]) || (!wnnfns_env_norm[snum])) return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
527 jl_env_set (wnnfns_buf[snum], wnnfns_env_norm[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
528 wnnfns_norm = 1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
529 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
530 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
531 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
532 if ((!wnnfns_buf[snum]) || (!wnnfns_env_rev[snum])) return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
533 jl_env_set (wnnfns_buf[snum], wnnfns_env_rev[snum]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
534 wnnfns_norm = 0;
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
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
538 DEFUN ("wnn-server-henkan-begin", Fwnn_begin_henkan, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
539 Translate YOMI string to kanji. Retuen the number of bunsetsu.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
540 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
541 (hstring))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
542 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
543 int cnt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
544 w_char wbuf[5000];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
545 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
546 CHECK_STRING (hstring);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
547 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
548 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
549 m2w (XSTRING (hstring)->_data, wbuf);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
550 if (snum == WNNSERVER_C)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
551 w2y (wbuf);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
552
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
553 #ifdef WNN6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
554 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
555 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
556 #else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
557 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
558 return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
559 #endif
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
560 return make_int (cnt);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
561 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
562
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
563 DEFUN ("wnn-server-zenkouho", Fwnn_zenkouho, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
564 Get zenkouho at BUNSETSU-NUMBER. Second argument DAI is T
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
565 if dai-bunsetsu, NIL if sho-bunsetsu. Return the current offset of zenkouho.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
566 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
567 (bunNo, dai))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
568 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
569 int no, offset;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
570 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
571 int uniq_level;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
572 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
573 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
574 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
575 no = XINT (bunNo);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
576 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
577 else if (EQ(Vwnn_uniq_level, Qwnn_uniq)) uniq_level = WNN_UNIQ;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
578 else uniq_level = WNN_UNIQ_KNJ;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
579 if (EQ(dai, Qnil))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
580 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
581 if (offset = jl_zenkouho (wnnfns_buf[snum],no,WNN_USE_MAE, uniq_level) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
582 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
583 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
584 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
585 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
586 if (offset = jl_zenkouho_dai (wnnfns_buf[snum], no, dai_end (no, snum),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
587 WNN_USE_MAE, uniq_level) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
588 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
589 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
590 return make_int (offset);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
591 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
592
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
593
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
594 DEFUN ("wnn-server-get-zenkouho", Fwnn_get_zenkouho, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
595 Get kanji string of KOUHO-NUMBER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
596 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
597 (kouhoNo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
598 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
599 unsigned char kanji_buf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
600 w_char wbuf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
601 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
602 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
603 CHECK_INT (kouhoNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
604 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
605 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
606 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
607 jl_get_zenkouho_kanji (wnnfns_buf[snum], XINT (kouhoNo), wbuf);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
608 w2m (wbuf, kanji_buf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
609 return make_string (kanji_buf, strlen (kanji_buf));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
610 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
611
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
612 DEFUN ("wnn-server-zenkouho-bun", Fwnn_zenkouho_bun, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
613 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
614 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
615 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
616 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
617 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
618 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
619 return make_int (jl_zenkouho_bun (wnnfns_buf[snum]));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
620 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
621
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
622 DEFUN ("wnn-server-zenkouho-suu", Fwnn_zenkouho_suu, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
623 Return the number of zen kouho
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
624 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
625 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
626 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
627 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
628 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
629 return make_int (jl_zenkouho_suu (wnnfns_buf[snum]));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
630 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
631
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
632 DEFUN ("wnn-server-dai-top", Fwnn_dai_top, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
633 Return T if bunsetsu BUN-NUMBER is dai-bunsetsu.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
634 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
635 (bunNo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
636 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
637 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
638 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
639 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
640 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
641 if (jl_dai_top (wnnfns_buf[snum], XINT (bunNo)) == 1) return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
642 else return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
643 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
644
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
645 DEFUN ("wnn-server-dai-end", Fwnn_dai_end, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
646 Return the bunsetu number of the next dai-bunsetsu after BUN-NUMBER.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
647 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
648 (bunNo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
649 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
650 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
651 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
652 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
653 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
654 return make_int (dai_end (XINT (bunNo), snum));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
655 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
656
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
657 DEFUN ("wnn-server-henkan-kakutei", Fwnn_kakutei, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
658 Set candidate with OFFSET, DAI. DAI is T if dai-bunsetsu.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
659 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
660 (offset, dai))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
661 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
662 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
663 CHECK_INT (offset);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
664 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
665 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
666 if (EQ(dai, Qnil))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
667 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
668 if (jl_set_jikouho (wnnfns_buf[snum], XINT (offset)) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
669 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
670 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
671 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
672 if (jl_set_jikouho_dai (wnnfns_buf[snum], XINT (offset)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
673 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
674 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
675 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
676 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
677
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
678 DEFUN ("wnn-server-bunsetu-henkou", Fwnn_bunsetu_henkou, 3, 3, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
679 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
680 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
681 (bunNo, len, dai))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
682 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
683 Lisp_Object val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
684 int cnt, no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
685 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
686 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
687 CHECK_INT (len);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
688 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
689 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
690 no = XINT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
691 #ifdef WNN6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
692 if ((cnt = jl_fi_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
693 (dai == Qnil) ? WNN_SHO : WNN_DAI)) < 0)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
694 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
695 #else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
696 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
697 (EQ(dai, Qnil)) ? WNN_SHO : WNN_DAI)) < 0)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
698 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
699 #endif
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
700 return make_int (cnt);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
701 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
702
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
703 DEFUN ("wnn-server-inspect", Fwnn_inspect, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
704 Get bunsetsu information specified by BUN-NUMBER.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
705 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
706 (bunNo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
707 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
708 Lisp_Object val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
709 struct wnn_jdata *info_buf;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
710 unsigned char cbuf[512];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
711 w_char wbuf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
712 int bun_no, yomilen, jirilen, i;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
713 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
714 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
715 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
716 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
717 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
718 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
719 bun_no = XINT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
720 val = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
721 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->kangovect), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
722 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->daihyoka), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
723 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->hyoka), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
724 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->ima), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
725 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->hindo), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
726 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->hinsi), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
727 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->entry), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
728 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->dic_no), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
729 yomilen = jl_get_yomi (wnnfns_buf[snum], bun_no, bun_no + 1, wbuf);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
730 jirilen = wnnfns_buf[snum]->bun[bun_no]->jirilen;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
731 for (i = yomilen; i >= jirilen; i--) wbuf[i+1] = wbuf[i];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
732 wbuf[jirilen] = '+';
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
733 w2m (wbuf, cbuf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
734 val = Fcons (make_string (cbuf, strlen (cbuf)), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
735 jl_get_kanji (wnnfns_buf[snum], bun_no, bun_no + 1, wbuf);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
736 w2m (wbuf, cbuf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
737 val = Fcons (make_string (cbuf, strlen (cbuf)), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
738 return val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
739 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
740
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
741
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
742 DEFUN ("wnn-server-henkan-quit", Fwnn_quit_henkan, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
743 do nothing
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
744 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
745 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
746 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
747 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
748 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
749 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
750 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
751 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
752
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
753 DEFUN ("wnn-server-bunsetu-kanji", Fwnn_bunsetu_kanji, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
754 Get the pair of kanji and length of bunsetsu specified by BUN-NUMBER.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
755 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
756 (bunNo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
757 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
758 int no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
759 unsigned char kanji_buf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
760 w_char wbuf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
761 int kanji_len;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
762 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
763 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
764 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
765 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
766 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
767 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
768 no = XINT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
769 kanji_len = jl_get_kanji (wnnfns_buf[snum], no, no + 1, wbuf);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
770 w2m (wbuf, kanji_buf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
771 return Fcons (make_string (kanji_buf, strlen (kanji_buf)),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
772 make_int (kanji_len));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
773 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
774
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
775 DEFUN ("wnn-server-bunsetu-yomi", Fwnn_bunsetu_yomi, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
776 Get the pair of yomi and length of bunsetsu specified by BUN-NUMBER.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
777 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
778 (bunNo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
779 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
780 int no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
781 unsigned char yomi_buf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
782 w_char wbuf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
783 int yomi_len;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
784 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
785 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
786 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
787 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
788 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
789 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
790 no = XINT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
791 yomi_len = jl_get_yomi (wnnfns_buf[snum], no, no + 1, wbuf);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
792 w2m (wbuf, yomi_buf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
793 return Fcons (make_string (yomi_buf, strlen (yomi_buf)),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
794 make_int (yomi_len));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
795 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
796
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
797 DEFUN ("wnn-server-bunsetu-suu", Fwnn_bunsetu_suu, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
798 Get the number of bunsetsu.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
799 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
800 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
801 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
802 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
803 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
804 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
805 return make_int (jl_bun_suu (wnnfns_buf[snum]));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
806 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
807
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
808 DEFUN ("wnn-server-hindo-update", Fwnn_hindo_update, 0, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
809 Update frequency of bunsetsu specified by NUM-NUMBER.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
810 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
811 (bunNo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
812 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
813 int no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
814 Lisp_Object val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
815 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
816 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
817 if (EQ(bunNo, Qnil)) no = -1;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
818 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
819 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
820 CHECK_INT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
821 no = XINT (bunNo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
822 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
823 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
824 #ifdef WNN6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
825 if (jl_optimize_fi (wnnfns_buf[snum], 0, no) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
826 #else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
827 if (jl_update_hindo (wnnfns_buf[snum], 0, no) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
828 #endif
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
829 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
830 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
831
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
832
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
833 DEFUN ("wnn-server-word-add", Fwnn_word_toroku, 5, 5, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
834 Add a word to dictionary. Arguments are
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
835 DIC-NUMBER, KANJI, YOMI, COMMENT, HINSI-NUMBER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
836 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
837 (dicno, kanji, yomi, comment, hinsi))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
838 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
839 w_char yomi_buf[256], kanji_buf[256], comment_buf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
840 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
841 CHECK_INT (dicno);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
842 CHECK_STRING (kanji);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
843 CHECK_STRING (yomi);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
844 CHECK_STRING (comment);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
845 CHECK_INT (hinsi);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
846 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
847 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
848 m2w (XSTRING (yomi)->_data, yomi_buf);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
849 if (snum == WNNSERVER_C)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
850 w2y (yomi_buf);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
851 m2w (XSTRING (kanji)->_data, kanji_buf);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
852 m2w (XSTRING (comment)->_data, comment_buf);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
853 if (jl_word_add (wnnfns_buf[snum], XINT (dicno), yomi_buf, kanji_buf,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
854 comment_buf, XINT (hinsi), 0) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
855 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
856 else return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
857 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
858
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
859
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
860 DEFUN ("wnn-server-word-delete", Fwnn_word_sakujo, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
861 Delete a word from dictionary, specified by DIC-NUMBER, SERIAL-NUMBER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
862 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
863 (no, serial))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
864 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
865 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
866 CHECK_INT (no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
867 CHECK_INT (serial);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
868 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
869 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
870 if (jl_word_delete (wnnfns_buf[snum], XINT (no), XINT (serial)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
871 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
872 else return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
873 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
874
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
875
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
876 DEFUN ("wnn-server-word-use", Fwnn_word_use, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
877 Toggle on/off word, specified by DIC-NUMBER and SERIAL-NUMBER
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
878 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
879 (no, serial))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
880 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
881 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
882 CHECK_INT (no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
883 CHECK_INT (serial);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
884 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
885 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
886 if (jl_word_use (wnnfns_buf[snum], XINT (no), XINT (serial)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
887 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
888 else return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
889 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
890
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
891 DEFUN ("wnn-server-word-info", Fwnn_word_info, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
892 Return list of yomi, kanji, comment, hindo, hinshi.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
893 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
894 (no, serial))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
895 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
896 Lisp_Object val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
897 struct wnn_jdata *info_buf;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
898 unsigned char cbuf[512];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
899 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
900 unsigned char lb;
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 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
905 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
906 if ((int)(info_buf = jl_word_info (wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
907 XINT (no), XINT (serial))) <= 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
908 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
909 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
910 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
911 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
912 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
913 val = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
914 val = Fcons (make_int (info_buf->hinshi), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
915 val = Fcons (make_int (info_buf->hindo), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
916 w2m (info_buf->com, cbuf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
917 val = Fcons (make_string (cbuf, strlen (cbuf)), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
918 w2m (info_buf->kanji, cbuf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
919 val = Fcons (make_string (cbuf, strlen (cbuf)), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
920 w2m (info_buf->yomi, cbuf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
921 val = Fcons (make_string (cbuf, strlen (cbuf)), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
922 return val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
923 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
924 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
925
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
926 DEFUN ("wnn-server-word-hindo-set", Fwnn_hindo_set, 3, 3, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
927 Set frequency to arbitrary value. Specified by DIC-NUMBER,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
928 SERIAL-NUMBER, FREQUENCY
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
929 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
930 (no, serial, hindo))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
931 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
932 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
933 CHECK_INT (no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
934 CHECK_INT (serial);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
935 CHECK_INT (hindo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
936 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
937 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
938 if (js_hindo_set (jl_env_get (wnnfns_buf[snum]),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
939 XINT (no),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
940 XINT (serial),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
941 WNN_HINDO_NOP,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
942 XINT (hindo)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
943 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
944 else return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
945 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
946
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
947
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
948 DEFUN ("wnn-server-word-search", Fwnn_dict_search, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
949 Search a word YOMI from buffer.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
950 Return list of (kanji hinshi freq dic_no serial).
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
951 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
952 (yomi))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
953 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
954 Lisp_Object val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
955 struct wnn_jdata *wordinfo;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
956 int i, count;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
957 w_char wbuf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
958 unsigned char kanji_buf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
959 int kanji_len;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
960 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
961 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
962 CHECK_STRING (yomi);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
963 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
964 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
965 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
966 m2w (XSTRING (yomi)->_data, wbuf);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
967 if (snum == WNNSERVER_C)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
968 w2y (wbuf);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
969 if ((count = jl_word_search_by_env (wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
970 wbuf, &wordinfo)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
971 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
972 val = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
973 for (i = 0, wordinfo += count; i < count; i++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
974 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
975 wordinfo--;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
976 w2m (wordinfo->kanji, kanji_buf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
977 val = Fcons (Fcons (make_string (kanji_buf, strlen (kanji_buf)),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
978 list4 (make_int (wordinfo->hinshi),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
979 make_int (wordinfo->hindo),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
980 make_int (wordinfo->dic_no),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
981 make_int (wordinfo->serial))),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
982 val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
983 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
984 return val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
985 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
986
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
987 DEFUN ("wnn-server-dict-save", Fwnn_dict_save, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
988 Save all dictionaries and frequency files.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
989 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
990 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
991 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
992 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
993 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
994 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
995 if (jl_dic_save_all (wnnfns_buf[snum]) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
996 else return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
997 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
998
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
999 DEFUN ("wnn-server-get-param", Fwnn_get_param, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1000 Returns (n nsho hindo len jiri flag jisho sbn dbn_len sbn_cnt
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1001 suuji kana eisuu kigou toji_kakko fuzokogo kaikakko)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1002 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1003 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1004 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1005 struct wnn_param param;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1006 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1007 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1008 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1009 if (jl_param_get (wnnfns_buf[snum], &param) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1010 return Fcons (make_int (param.n),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1011 Fcons (make_int (param.nsho),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1012 Fcons (make_int (param.p1),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1013 Fcons (make_int (param.p2),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1014 Fcons (make_int (param.p3),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1015 Fcons (make_int (param.p4),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1016 Fcons (make_int (param.p5),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1017 Fcons (make_int (param.p6),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1018 Fcons (make_int (param.p7),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1019 Fcons (make_int (param.p8),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1020 Fcons (make_int (param.p9),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1021 Fcons (make_int (param.p10),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1022 Fcons (make_int (param.p11),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1023 Fcons (make_int (param.p12),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1024 Fcons (make_int (param.p13),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1025 Fcons (make_int (param.p14),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1026 Fcons (make_int (param.p15),Qnil)))))))))))))))));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1027 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1028
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1029 DEFUN ("wnn-server-set-param", Fwnn_set_param, 1, 1, 0, /*
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1030 Set parameters using an alist, where the CAR contains one of
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1031 wnn_n, wnn_nsho, wnn_hindo, wnn_len, wnn_jiri, wnn_flag,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1032 wnn_jisho, wnn_sbn, wnn_dbn_len, wnn_sbn_cnt, wnn_suuji,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1033 wnn_kana, wnn_eisuu, wnn_kigou, wnn_toji_kakko, wnn_fuzokogo,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1034 or wnn_kaikakko and the CDR contains the value.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1035 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1036 (Vsetvalues_alist))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1037 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1038 int rc;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1039 struct wnn_param param;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1040 Lisp_Object tail, key, val;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1041 int snum;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1042
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1043 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1044 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1045 rc = jl_param_get (wnnfns_buf[snum], &param);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1046 if (rc < 0) return Qnil;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1047
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1048 EXTERNAL_PROPERTY_LIST_LOOP (tail, key, val, Vsetvalues_alist)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1049 {
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1050 int setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1051 CHECK_INT (val);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1052 setval = XINT (val);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1053 if (EQ (key, Qwnn_n)) param.n = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1054 else if (EQ (key, Qwnn_nsho)) param.nsho = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1055 else if (EQ (key, Qwnn_hindo)) param.p1 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1056 else if (EQ (key, Qwnn_len)) param.p2 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1057 else if (EQ (key, Qwnn_jiri)) param.p3 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1058 else if (EQ (key, Qwnn_flag)) param.p4 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1059 else if (EQ (key, Qwnn_jisho)) param.p5 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1060 else if (EQ (key, Qwnn_sbn)) param.p6 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1061 else if (EQ (key, Qwnn_dbn_len)) param.p7 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1062 else if (EQ (key, Qwnn_sbn_cnt)) param.p8 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1063 else if (EQ (key, Qwnn_suuji)) param.p9 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1064 else if (EQ (key, Qwnn_kana)) param.p10 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1065 else if (EQ (key, Qwnn_eisuu)) param.p11 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1066 else if (EQ (key, Qwnn_kigou)) param.p12 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1067 else if (EQ (key, Qwnn_toji_kakko)) param.p13 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1068 else if (EQ (key, Qwnn_fuzokogo)) param.p14 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1069 else if (EQ (key, Qwnn_kaikakko)) param.p15 = setval;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1070 else
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1071 {
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1072 signal_simple_error ("Invalid wnn keyword", key);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1073 return Qnil;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1074 }
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1075 }
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1076
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1077 #if 0
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1078 printf("wnn_n = %d\n",param.n);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1079 printf("wnn_nsho = %d\n",param.nsho);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1080 printf("wnn_hindo = %d\n",param.p1);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1081 printf("wnn_len = %d\n",param.p2);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1082 printf("wnn_jiri = %d\n",param.p3);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1083 printf("wnn_flag = %d\n",param.p4);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1084 printf("wnn_jisho = %d\n",param.p5);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1085 printf("wnn_sbn = %d\n",param.p6);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1086 printf("wnn_dbn_len = %d\n",param.p7);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1087 printf("wnn_sbn_cnt = %d\n",param.p8);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1088 printf("wnn_suuji = %d\n",param.p9);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1089 printf("wnn_kana = %d\n",param.p10);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1090 printf("wnn_eisuu = %d\n",param.p11);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1091 printf("wnn_kigou = %d\n",param.p12);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1092 printf("wnn_toji_kakko = %d\n",param.p13);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1093 printf("wnn_fuzokogo = %d\n",param.p14);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1094 printf("wnn_kaikakko = %d\n",param.p15);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1095 #endif
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1096
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1097 rc = jl_param_set (wnnfns_buf[snum], &param);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1098 if (rc < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1099 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1100 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1101
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1102 DEFUN ("wnn-server-get-msg", Fwnn_get_msg, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1103 Get message string from wnn_perror.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1104 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1105 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1106 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1107 char mbuf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1108 char *msgp;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1109 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1110 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1111 char langname[32];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1112 /* CHECK_INT (errno);*/
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1113 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1114 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1115 switch (snum)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1116 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1117 case WNNSERVER_J:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1118 strcpy (langname, "ja_JP");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1119 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1120 case WNNSERVER_C:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1121 strcpy (langname, "zh_CN");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1122 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1123 /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1124 case WNNSERVER_T:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1125 strcpy (langname, "zh_TW");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1126 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1127 */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1128 case WNNSERVER_K:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1129 strcpy (langname, "ko_KR");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1130 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1131 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1132 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1133 /* msgp = msg_get (wnn_msg_cat, XINT (errno), 0, 0);*/
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1134 msgp = wnn_perror_lang (langname);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1135 c2m (msgp, mbuf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1136 return make_string (mbuf, strlen (mbuf));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1137 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1138
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1139
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1140 DEFUN ("wnn-server-fuzokugo-set", Fwnn_fuzokugo_set, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1141 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1142 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1143 (file))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1144 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1145 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1146 CHECK_STRING (file);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1147 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1148 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1149 if (jl_fuzokugo_set (wnnfns_buf[snum], XSTRING (file)->_data) < 0)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1150 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1151 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1152 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1153
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1154 DEFUN ("wnn-server-fuzokugo-get", Fwnn_fuzokugo_get, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1155 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1156 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1157 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1158 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1159 char fname[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1160 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1161 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1162 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1163 if (jl_fuzokugo_get (wnnfns_buf[snum], fname) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1164 return make_string (fname, strlen (fname));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1165 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1166
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1167
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1168 DEFUN ("wnn-server-isconnect", Fwnn_isconnect, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1169 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1170 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1171 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1172 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1173 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1174 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1175 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1176 if (jl_isconnect (wnnfns_buf[snum])) return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1177 else return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1178 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1179
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1180 DEFUN ("wnn-server-hinsi-dicts", Fwnn_hinsi_dicts, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1181 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1182 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1183 (hinsi))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1184 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1185 int *area;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1186 int cnt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1187 Lisp_Object val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1188 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1189 CHECK_INT (hinsi);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1190 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1191 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1192 if ((cnt = jl_hinsi_dicts (wnnfns_buf[snum], XINT (hinsi), &area)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1193 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1194 val = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1195 for (area += cnt; cnt > 0; cnt--)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1196 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1197 area--;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1198 val = Fcons (make_int (*area), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1199 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1200 return val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1201 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1202
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1203 DEFUN ("wnn-server-hinsi-list", Fwnn_hinsi_list, 2, 2, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1204 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1205 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1206 (dicno, name))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1207 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1208 int cnt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1209 Lisp_Object val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1210 w_char wbuf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1211 w_char **area;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1212 unsigned char cbuf[512];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1213 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1214 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1215 CHECK_INT (dicno);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1216 CHECK_STRING (name);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1217 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1218 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1219 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1220 m2w (XSTRING (name)->_data, wbuf);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1221 if ((cnt = jl_hinsi_list (wnnfns_buf[snum], XINT (dicno), wbuf, &area)) < 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1222 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1223 if (cnt == 0) return make_int (0);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1224 val = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1225 for (area += cnt; cnt > 0; cnt--)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1226 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1227 area--;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1228 w2m (*area, cbuf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1229 val = Fcons (make_string (cbuf, strlen (cbuf)), val);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1230 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1231 return val;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1232 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1233
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1234 DEFUN ("wnn-server-hinsi-name", Fwnn_hinsi_name, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1235 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1236 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1237 (no))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1238 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1239 unsigned char name[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1240 w_char *wname;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1241 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1242 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1243 CHECK_INT (no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1244 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1245 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1246 if (!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1247 if ((wname = jl_hinsi_name (wnnfns_buf[snum], XINT (no))) == 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1248 w2m (wname, name, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1249 return make_string (name, strlen (name));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1250 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1251 #ifdef WNN6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1252 DEFUN ("wnn-server-fisys-dict-add", Fwnn_fisys_dict_add, 3, MANY, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1253 Add dictionary specified by FISYS-DICT-FILE-NAME, FISYS-FREQ-FILE-NAME,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1254 FISYS-FREQ-FILE-MODE.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1255 Specify password files of dictionary and frequency, PW1 and PW2, if needed.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1256 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1257 (int nargs, Lisp_Object *args))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1258 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1259 struct gcpro gcpro1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1260 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1261 CHECK_STRING (args[0]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1262 CHECK_STRING (args[1]);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1263 if (args[3] != Qnil) CHECK_STRING (args[3]);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1264 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1265 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1266 GCPRO1 (*args);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1267 gcpro1.nvars = nargs;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1268 if(jl_fi_dic_add(wnnfns_buf[snum],
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1269 XSTRING(args[0])->_data,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1270 XSTRING(args[1])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1271 WNN_FI_SYSTEM_DICT,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1272 WNN_DIC_RDONLY,
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1273 (args[2] == Qnil) ? WNN_DIC_RDONLY : WNN_DIC_RW,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1274 0,
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1275 (args[3] == Qnil) ? 0 : XSTRING(args[3])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1276 yes_or_no,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1277 puts2 ) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1278 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1279 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1280 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1281 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1282 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1283 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1284
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1285 DEFUN ("wnn-server-fiusr-dict-add", Fwnn_fiusr_dict_add, 4, MANY, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1286 Add dictionary specified by FIUSR-DICT-FILE-NAME, FIUSR-FREQ-FILE-NAME,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1287 FIUSR-DICT-FILE-MODE, FIUSR-FREQ-FILE-MODE.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1288 Specify password files of dictionary and frequency, PW1 and PW2, if needed.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1289 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1290 (int nargs, Lisp_Object *args))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1291 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1292 struct gcpro gcpro1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1293 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1294 CHECK_STRING (args[0]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1295 CHECK_STRING (args[1]);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1296 if (args[4] != Qnil) CHECK_STRING (args[4]);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1297 if (args[5] != Qnil) CHECK_STRING (args[5]);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1298 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1299 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1300 GCPRO1 (*args);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1301 gcpro1.nvars = nargs;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1302 if(jl_fi_dic_add(wnnfns_buf[snum],
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1303 XSTRING(args[0])->_data,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1304 XSTRING(args[1])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1305 WNN_FI_USER_DICT,
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1306 (args[2] == Qnil) ? WNN_DIC_RDONLY : WNN_DIC_RW,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1307 (args[3] == Qnil) ? WNN_DIC_RDONLY : WNN_DIC_RW,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1308 (args[4] == Qnil) ? 0 : XSTRING(args[4])->_data,
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1309 (args[5] == Qnil) ? 0 : XSTRING(args[5])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1310 yes_or_no,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1311 puts2 ) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1312 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1313 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1314 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1315 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1316 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1317 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1318
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1319 DEFUN ("wnn-server-notrans-dict-add", Fwnn_notrans_dict_add, 3, MANY, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1320 Add dictionary specified by NOTRANS-DICT-FILE-NAME, PRIORITY, DICT-FILE-MODE.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1321 Specify password files of dictionary and frequency PW1 if needed.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1322 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1323 (int nargs, Lisp_Object *args))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1324 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1325 struct gcpro gcpro1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1326 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1327 int dic_no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1328 struct wnn_env *cur_env;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1329 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1330 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1331 CHECK_STRING (args[0]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1332 CHECK_INT (args[1]);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1333 if (args[3] != Qnil) CHECK_STRING (args[3]);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1334 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1335 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1336 GCPRO1 (*args);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1337 gcpro1.nvars = nargs;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1338 if(wnnfns_norm)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1339 cur_env = wnnfns_env_norm[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1340 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1341 cur_env = wnnfns_env_rev[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1342 dic_no = js_get_autolearning_dic(cur_env, WNN_MUHENKAN_LEARNING);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1343 if (dic_no == WNN_NO_LEARNING) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1344 if((dic_no = jl_dic_add(wnnfns_buf[snum],
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1345 XSTRING(args[0])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1346 0,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1347 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1348 XINT(args[1]),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1349 WNN_DIC_RW, WNN_DIC_RW,
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1350 (args[3] == Qnil) ? 0 : XSTRING(args[3])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1351 0,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1352 yes_or_no,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1353 puts2)) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1354 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1355 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1356 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1357 js_set_autolearning_dic(cur_env, WNN_MUHENKAN_LEARNING, dic_no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1358 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1359 if(!js_is_loaded_temporary_dic(cur_env)) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1360 if(js_temporary_dic_add(cur_env,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1361 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1362 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1363 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1364 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1365 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1366 vmask |= WNN_ENV_MUHENKAN_LEARN_MASK;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1367 henv.muhenkan_flag = (args[2] == Qnil) ? WNN_DIC_RDONLY : WNN_DIC_RW;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1368 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1369 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1370 &henv) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1371 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1372 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1373 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1374 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1375 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1376 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1377
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1378 DEFUN ("wnn-server-bmodify-dict-add", Fwnn_bmodify_dict_add, 3, MANY, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1379 Add dictionary specified by BMODIFY-DICT-FILE-NAME, PRIORITY, DICT-FILE-MODE.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1380 Specify password files of dictionary and frequency PW1 if needed.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1381 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1382 (int nargs, Lisp_Object *args))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1383 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1384 struct gcpro gcpro1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1385 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1386 int dic_no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1387 struct wnn_env *cur_env;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1388 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1389 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1390 CHECK_STRING (args[0]);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1391 CHECK_INT (args[1]);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1392 if (args[3] != Qnil) CHECK_STRING (args[3]);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1393 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1394 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1395 GCPRO1 (*args);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1396 gcpro1.nvars = nargs;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1397 if(wnnfns_norm)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1398 cur_env = wnnfns_env_norm[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1399 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1400 cur_env = wnnfns_env_rev[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1401 dic_no = js_get_autolearning_dic(cur_env, WNN_BUNSETSUGIRI_LEARNING);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1402 if (dic_no == WNN_NO_LEARNING) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1403 if((dic_no = jl_dic_add(wnnfns_buf[snum],
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1404 XSTRING(args[0])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1405 0,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1406 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1407 XINT(args[1]),
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1408 WNN_DIC_RW, WNN_DIC_RW,
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1409 (args[3] == Qnil) ? 0 : XSTRING(args[3])->_data,
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1410 0,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1411 yes_or_no,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1412 puts2)) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1413 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1414 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1415 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1416 js_set_autolearning_dic(cur_env, WNN_BUNSETSUGIRI_LEARNING, dic_no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1417 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1418 if(!js_is_loaded_temporary_dic(cur_env)) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1419 if(js_temporary_dic_add(cur_env,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1420 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1421 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1422 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1423 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1424 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1425 vmask |= WNN_ENV_BUNSETSUGIRI_LEARN_MASK;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1426 henv.bunsetsugiri_flag = (args[2] == Qnil) ? WNN_DIC_RDONLY : WNN_DIC_RW;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1427 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1428 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1429 &henv) < 0) {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1430 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1431 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1432 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1433 UNGCPRO;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1434 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1435 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1436
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1437 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
1438 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1439 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1440 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1441 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1442 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1443 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1444 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1445 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1446 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1447 vmask |= WNN_ENV_LAST_IS_FIRST_MASK;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1448 henv.last_is_first_flag = (mode == Qnil) ? False : True;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1449 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1450 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1451 &henv) < 0) return Qnil;
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-complex-conv-mode", Fwnn_complex_conv, 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_COMPLEX_CONV_MASK;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1466 henv.complex_flag = (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-okuri-learn-mode", Fwnn_okuri_learn, 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_OKURI_LEARN_MASK;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1484 henv.okuri_learn_flag = (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-flag", Fwnn_okuri_flag, 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 CHECK_INT (mode);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1500 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1501 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1502 if(mode != WNN_OKURI_REGULATION &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1503 mode != WNN_OKURI_NO &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1504 mode != WNN_OKURI_YES)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1505 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1506 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1507 henv.okuri_flag = mode;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1508 vmask |= WNN_ENV_OKURI_MASK;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1509 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1510 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1511 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1512 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1513 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1514
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1515 DEFUN ("wnn-server-set-prefix-learn-mode", Fwnn_prefix_learn, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1516 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1517 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1518 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1519 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1520 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1521 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1522 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1523 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1524 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1525 vmask |= WNN_ENV_PREFIX_LEARN_MASK;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1526 henv.prefix_learn_flag = (mode == Qnil) ? False : True;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1527 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1528 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1529 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1530 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1531 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1532
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1533 DEFUN ("wnn-server-set-prefix-flag", Fwnn_prefix_flag, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1534 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1535 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1536 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1537 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1538 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1539 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1540 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1541 CHECK_INT (mode);
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 if(mode != WNN_KANA_KOUHO && mode != WNN_KANJI_KOUHO)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1545 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1546 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1547 henv.prefix_flag = mode;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1548 vmask |= WNN_ENV_PREFIX_MASK;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1549 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1550 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1551 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1552 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1553 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1554
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1555 DEFUN ("wnn-server-set-suffix-learn-mode", Fwnn_suffix_learn, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1556 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1557 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1558 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1559 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1560 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1561 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1562 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1563 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1564 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1565 vmask |= WNN_ENV_SUFFIX_LEARN_MASK;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1566 henv.suffix_learn_flag = (mode == Qnil) ? False : True;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1567 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1568 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1569 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1570 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1571 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1572
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1573 DEFUN ("wnn-server-set-common-learn-mode", Fwnn_common_learn, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1574 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1575 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1576 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1577 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1578 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1579 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1580 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1581 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1582 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1583 vmask |= WNN_ENV_COMMON_LAERN_MASK;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1584 henv.common_learn_flag = (mode == Qnil) ? False : True;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1585 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1586 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1587 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1588 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1589 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1590
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1591 DEFUN ("wnn-server-set-freq-func-mode", Fwnn_freq_func, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1592 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1593 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1594 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1595 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1596 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1597 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1598 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1599 CHECK_INT (mode);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1600 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1601 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1602 if(mode != 0 && mode != 1 && mode != 2 && mode != 3 && mode != 4)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1603 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1604 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1605 henv.freq_func_flag = mode;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1606 vmask |= WNN_ENV_FREQ_FUNC_MASK;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1607 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1608 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1609 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1610 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1611 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1612
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1613 DEFUN ("wnn-server-set-numeric-mode", Fwnn_numeric, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1614 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1615 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1616 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1617 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1618 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1619 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1620 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1621 CHECK_INT (mode);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1622 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1623 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1624 if(mode != WNN_NUM_KANSUUJI &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1625 mode != WNN_NUM_KANOLD &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1626 mode != WNN_NUM_HANCAN &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1627 mode != WNN_NUM_ZENCAN &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1628 mode != WNN_NUM_HAN &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1629 mode != WNN_NUM_ZEN &&
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1630 mode != WNN_NUM_KAN)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1631 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1632 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1633 henv.numeric_flag = mode;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1634 vmask |= WNN_ENV_NUMERIC_MASK;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1635 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1636 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1637 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1638 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1639 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1640
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1641 DEFUN ("wnn-server-set-alphabet-mode", Fwnn_alphabet, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1642 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1643 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1644 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1645 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1646 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1647 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1648 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1649 CHECK_INT (mode);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1650 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1651 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1652 if(mode != WNN_ALP_HAN && mode != WNN_ALP_ZEN)
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.alphabet_flag = mode;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1656 vmask |= WNN_ENV_ALPHABET_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-symbol-mode", Fwnn_symbol, 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 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1666 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1667 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1668 int snum;
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;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1671 CHECK_INT (mode);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1672 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1673 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1674 if(mode != WNN_KIG_HAN && mode != WNN_KIG_JIS && mode != WNN_KIG_ASC)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1675 return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1676 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1677 henv.symbol_flag = mode;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1678 vmask |= WNN_ENV_SYMBOL_MASK;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1679 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1680 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1681 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1682 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1683 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1684
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1685 DEFUN ("wnn-server-set-yuragi-mode", Fwnn_yuragi, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1686 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1687 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1688 (mode))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1689 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1690 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1691 unsigned long vmask = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1692 struct wnn_henkan_env henv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1693 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1694 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1695 vmask |= WNN_ENV_YURAGI_MASK;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1696 henv.yuragi_flag = (mode == Qnil) ? False : True;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1697 if(jl_set_henkan_env(wnnfns_buf[snum],
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1698 vmask,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1699 &henv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1700 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1701 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1702
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1703 DEFUN ("wnn-reset-previous-info", Fwnn_reset_prev, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1704 For FI-Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1705 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1706 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1707 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1708 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1709 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1710 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1711 if(jl_reset_prev_bun(wnnfns_buf[snum]) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1712 return Qt;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1713 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1714 #endif /* Wnn6 */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1715
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1716 DEFUN ("wnn-server-version", Fwnn_version, 0, 0, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1717 Returns Wnn server version ID.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1718 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1719 ())
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1720 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1721 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1722 int serv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1723 int libv;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1724 struct wnn_env *cur_env;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1725 if ((snum = check_wnn_server_type()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1726 if(!wnnfns_buf[snum]) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1727 if(wnnfns_norm)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1728 cur_env = wnnfns_env_norm[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1729 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1730 cur_env = wnnfns_env_rev[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1731 if(js_version (cur_env->js_id,&serv,&libv) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1732 return make_int (serv);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1733 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1734
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1735 DEFUN ("wnn-server-hinsi-number", Fwnn_hinsi_number, 1, 1, 0, /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1736 For Wnn.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1737 */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1738 (name))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1739 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1740 w_char w_buf[256];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1741 int no;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1742 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1743 CHECK_STRING (name);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1744 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1745 if (!wnnfns_buf[snum]) return Qnil;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1746 m2w (XSTRING (name)->_data, w_buf);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1747 if ((no = jl_hinsi_number (wnnfns_buf[snum], w_buf)) < 0) return Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1748 return make_int (no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1749 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1750
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1751 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1752 syms_of_mule_wnn (void)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1753 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1754 DEFSUBR (Fwnn_open);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1755 DEFSUBR (Fwnn_close);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1756 DEFSUBR (Fwnn_dict_add);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1757 DEFSUBR (Fwnn_dict_delete);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1758 DEFSUBR (Fwnn_dict_list);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1759 DEFSUBR (Fwnn_dict_comment);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1760 DEFSUBR (Fwnn_set_rev);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1761 DEFSUBR (Fwnn_begin_henkan);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1762 DEFSUBR (Fwnn_zenkouho);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1763 DEFSUBR (Fwnn_get_zenkouho);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1764 DEFSUBR (Fwnn_zenkouho_bun);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1765 DEFSUBR (Fwnn_zenkouho_suu);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1766 DEFSUBR (Fwnn_dai_top);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1767 DEFSUBR (Fwnn_dai_end);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1768 DEFSUBR (Fwnn_kakutei);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1769 DEFSUBR (Fwnn_bunsetu_henkou);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1770 DEFSUBR (Fwnn_inspect);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1771 DEFSUBR (Fwnn_quit_henkan);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1772 DEFSUBR (Fwnn_bunsetu_kanji);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1773 DEFSUBR (Fwnn_bunsetu_yomi);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1774 DEFSUBR (Fwnn_bunsetu_suu);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1775 DEFSUBR (Fwnn_hindo_update);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1776 DEFSUBR (Fwnn_word_toroku);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1777 DEFSUBR (Fwnn_word_sakujo);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1778 DEFSUBR (Fwnn_word_use);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1779 DEFSUBR (Fwnn_word_info);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1780 DEFSUBR (Fwnn_hindo_set);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1781 DEFSUBR (Fwnn_dict_search);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1782 DEFSUBR (Fwnn_dict_save);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1783 DEFSUBR (Fwnn_get_param);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1784 DEFSUBR (Fwnn_set_param);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1785 DEFSUBR (Fwnn_get_msg);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1786 DEFSUBR (Fwnn_fuzokugo_set);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1787 DEFSUBR (Fwnn_fuzokugo_get);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1788 DEFSUBR (Fwnn_isconnect);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1789 DEFSUBR (Fwnn_hinsi_dicts);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1790 DEFSUBR (Fwnn_hinsi_list);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1791 DEFSUBR (Fwnn_hinsi_name);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1792 DEFSUBR (Fwnn_hinsi_number);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1793 #ifdef WNN6
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1794 DEFSUBR (Fwnn_fisys_dict_add);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1795 DEFSUBR (Fwnn_fiusr_dict_add);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1796 DEFSUBR (Fwnn_notrans_dict_add);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1797 DEFSUBR (Fwnn_bmodify_dict_add);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1798 DEFSUBR (Fwnn_last_is_first);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1799 DEFSUBR (Fwnn_complex_conv);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1800 DEFSUBR (Fwnn_okuri_learn);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1801 DEFSUBR (Fwnn_okuri_flag);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1802 DEFSUBR (Fwnn_prefix_learn);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1803 DEFSUBR (Fwnn_prefix_flag);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1804 DEFSUBR (Fwnn_suffix_learn);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1805 DEFSUBR (Fwnn_common_learn);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1806 DEFSUBR (Fwnn_freq_func);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1807 DEFSUBR (Fwnn_numeric);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1808 DEFSUBR (Fwnn_alphabet);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1809 DEFSUBR (Fwnn_symbol);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1810 DEFSUBR (Fwnn_yuragi);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1811 DEFSUBR (Fwnn_reset_prev);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1812 #endif /* Wnn6 */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1813 DEFSUBR (Fwnn_version);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1814
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1815 defsymbol (&Qjserver, "jserver");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1816 defsymbol (&Qcserver, "cserver");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1817 /* defsymbol (&Qtserver, "tserver"); */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1818 defsymbol (&Qkserver, "kserver");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1819
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1820 defsymbol (&Qwnn_no_uniq, "wnn-no-uniq");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1821 defsymbol (&Qwnn_uniq, "wnn-uniq");
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1822 defsymbol (&Qwnn_uniq_kanji, "wnn-uniq-kanji");
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1823 defsymbol (&Qwnn_n, "wnn_n");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1824 defsymbol (&Qwnn_nsho, "wnn_nsho");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1825 defsymbol (&Qwnn_hindo, "wnn_hindo");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1826 defsymbol (&Qwnn_len, "wnn_len");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1827 defsymbol (&Qwnn_jiri, "wnn_jiri");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1828 defsymbol (&Qwnn_flag, "wnn_flag");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1829 defsymbol (&Qwnn_jisho, "wnn_jisho");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1830 defsymbol (&Qwnn_sbn, "wnn_sbn");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1831 defsymbol (&Qwnn_dbn_len, "wnn_dbn_len");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1832 defsymbol (&Qwnn_sbn_cnt, "wnn_sbn_cnt");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1833 defsymbol (&Qwnn_suuji, "wnn_suuji");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1834 defsymbol (&Qwnn_kana, "wnn_kana");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1835 defsymbol (&Qwnn_eisuu, "wnn_eisuu");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1836 defsymbol (&Qwnn_kigou, "wnn_kigou");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1837 defsymbol (&Qwnn_toji_kakko, "wnn_toji_kakko");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1838 defsymbol (&Qwnn_fuzokogo, "wnn_fuzokogo");
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1839 defsymbol (&Qwnn_kaikakko, "wnn_kaikakko");
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1840 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1841
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1842 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1843 vars_of_mule_wnn (void)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1844 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1845 int i;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1846
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1847 DEFVAR_INT ("lb-sisheng", &lb_sisheng /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1848 Leading character for Sisheng.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1849 */ );
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1850 DEFVAR_LISP ("wnn-server-type", &Vwnn_server_type /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1851 *jserver, cserver ..
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1852 */ );
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1853 DEFVAR_LISP ("cwnn-zhuyin", &Vcwnn_zhuyin /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1854 *pinyin or zhuyin
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1855 */ );
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1856 DEFVAR_LISP ("wnnenv-sticky", &Vwnnenv_sticky /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1857 *If non-nil, make environment sticky
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1858 */ );
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1859 DEFVAR_LISP ("wnn-uniq-level", &Vwnn_uniq_level /*
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1860 *Uniq level
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1861 */ );
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1862
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1863 Vwnn_server_type = Qjserver;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1864 Vcwnn_zhuyin = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1865 Vwnnenv_sticky = Qnil;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1866
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1867 Vwnn_uniq_level = Qwnn_uniq;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1868
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1869 for (i = 0; i < NSERVER; 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 wnnfns_buf[i] = (struct wnn_buf *) 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1872 wnnfns_env_norm[i] = (struct wnn_env *) 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1873 wnnfns_env_rev[i] = (struct wnn_env *) 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1874 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1875 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1876
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1877 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1878 w2m (w_char *wp, unsigned char *mp, unsigned char lb)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1879 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1880 w_char wc;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1881 w_char pzy[10];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1882 int i, len;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1883
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1884 while (wc = *wp++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1885 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1886 switch (wc & 0x8080)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1887 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1888 case 0x80:
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1889 if (EQ(Vwnn_server_type, Qcserver))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1890 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1891 len = cwnn_yincod_pzy (pzy, wc,
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1892 (EQ(Vcwnn_zhuyin, Qnil))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1893 ? CWNN_PINYIN
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1894 : CWNN_ZHUYIN);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1895 for (i = 0; i < len; i++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1896 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1897 if (pzy[i] & 0x80)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1898 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1899 *mp++ = PRE_LEADING_BYTE_PRIVATE_1; /* #### Not sure about this one... */
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1900 *mp++ = lb_sisheng;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1901 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1902 *mp++ = pzy[i];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1903 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1904 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1905 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1906 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1907 *mp++ = LEADING_BYTE_KATAKANA_JISX0201;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1908 *mp++ = (wc & 0xff);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1909 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1910 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1911 case 0x8080:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1912 *mp++ = lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1913 *mp++ = (wc & 0xff00) >> 8;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1914 *mp++ = wc & 0x00ff;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1915 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1916 case 0x8000:
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1917 if (lb == LEADING_BYTE_JAPANESE_JISX0208)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1918 *mp++ = LEADING_BYTE_JAPANESE_JISX0212;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1919 else if (lb == LEADING_BYTE_CHINESE_BIG5_1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1920 *mp++ = LEADING_BYTE_CHINESE_BIG5_2;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1921 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1922 *mp++ = lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1923 *mp++ = (wc & 0xff00) >> 8;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1924 *mp++ = wc & 0x00ff | 0x80;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1925 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1926 default:
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1927 *mp++ = wc & 0x00ff;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1928 break;
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 *mp = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1932 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1933
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1934 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1935 m2w (unsigned char *mp, w_char *wp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1936 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1937 unsigned int ch;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1938
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1939 while (ch = *mp++)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1940 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1941 if (BUFBYTE_LEADING_BYTE_P (ch))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1942 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1943 switch (ch)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1944 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1945 case LEADING_BYTE_KATAKANA_JISX0201:
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1946 *wp++ = *mp++; break;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1947 case LEADING_BYTE_LATIN_JISX0201:
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1948 *wp++ = *mp++ & 0x7F; break;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1949 case LEADING_BYTE_JAPANESE_JISX0208_1978:
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1950 case LEADING_BYTE_CHINESE_GB2312:
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1951 case LEADING_BYTE_JAPANESE_JISX0208:
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1952 case LEADING_BYTE_KOREAN_KSC5601:
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1953 /* case LEADING_BYTE_TW: */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1954 ch = *mp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1955 *wp++ = (ch << 8) | *mp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1956 break;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1957 case LEADING_BYTE_JAPANESE_JISX0212:
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1958 ch = *mp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1959 *wp++ = (ch << 8) | (*mp++ & 0x7f);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1960 break;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1961 case PRE_LEADING_BYTE_PRIVATE_1: /* #### Not sure about this one... */
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1962 ch = *mp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1963 if (ch == lb_sisheng)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1964 *wp++ = 0x8e80 | *mp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1965 else
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1966 mp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1967 break;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1968 default: /* ignore this character */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1969 mp += REP_BYTES_BY_FIRST_BYTE(ch) - 1;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1970 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1971 }
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1972 else
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1973 {
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1974 *wp++ = ch;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
1975 }
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1976 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1977 *wp = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1978 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1979
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1980 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1981 _xp (int x)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1982 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1983 printf ("%x\n", x); fflush (stdout);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1984 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1985
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1986 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1987 w2y (w_char *w)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1988 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1989 unsigned long pbuf[5000], ybuf[5000];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1990 unsigned long *pin;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1991 w_char *y;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1992 int len;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1993
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1994 pin = pbuf;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1995 y = w;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1996 while (1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1997 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1998 if (*w == 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
1999 {*pin =0; break;}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2000 else *pin = *w;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2001 w++; pin++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2002 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2003 len = cwnn_pzy_yincod (ybuf, pbuf,
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2004 (EQ(Vcwnn_zhuyin, Qnil)) ? CWNN_PINYIN : CWNN_ZHUYIN);
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2005 if (len <= 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2006 return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2007
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2008 pin = ybuf;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2009 while (1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2010 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2011 if (*pin == 0 || len == 0)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2012 {*y = 0;break;}
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2013 *y = *pin;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2014 y++; pin++; len--;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2015 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2016 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2017
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2018 void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2019 c2m (unsigned char *cp, unsigned char *mp, unsigned char lb)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2020 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2021 unsigned char ch;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2022 while (ch = *cp)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2023 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2024 if (ch & 0x80)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2025 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2026 *mp++ = lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2027 *mp++ = *cp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2028 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2029 *mp++ = *cp++;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2030 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2031 *mp = 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2032 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2033
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2034 int
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2035 dai_end (int no, int server)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2036 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2037 for (no++; no < jl_bun_suu (wnnfns_buf[server])
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2038 && !jl_dai_top (wnnfns_buf[server], no); no++);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2039 return (no);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2040 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2041
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2042 static int
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2043 yes_or_no (unsigned char *s)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2044 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2045 extern Lisp_Object Fy_or_n_p();
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2046 unsigned char mbuf[512];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2047 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2048 int len;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2049 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2050 if ((snum = check_wnn_server_type ()) == -1) return 0;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2051 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2052 /* if no message found, create file without query */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2053 /* if (wnn_msg_cat->msg_bd == 0) return 1;*/
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2054 if (*s == 0) return 1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2055 c2m (s, mbuf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2056 /* truncate "(Y/N)" */
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2057 for (len = 0; (mbuf[len]) && (len < 512); len++);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2058 for (; (mbuf[len] != '(') && (len > 0); len--);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2059 #if 0
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2060 if (Fy_or_n_p (make_string (mbuf, len)) == Qnil) return 0;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2061 else return (1);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2062 #else
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2063 {
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2064 Lisp_Object yes, str;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2065
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2066 str = make_string (mbuf, len);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2067 yes = call1(Qyes_or_no_p, EQ(str, Qnil));
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2068 if (NILP (yes)) return 0;
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2069 else return (1);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2070 }
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2071 #endif
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2072 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2073
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2074 static void
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2075 puts2 (char *s)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2076 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2077 #if 0
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2078 Lisp_Object args[1];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2079 char mbuf[512];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2080 unsigned char lb;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2081 extern Lisp_Object Fmessage ();
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2082 int snum;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2083 if ((snum = check_wnn_server_type ()) == -1) return;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2084 lb = lb_wnn_server_type[snum];
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2085 c2m (s, mbuf, lb);
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2086 args[0] = make_string (mbuf, strlen (mbuf));
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2087 Fmessage (1, args);
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2088 #else
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2089 message("%s",s);
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2090 #endif
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2091 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2092
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2093 int
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2094 check_wnn_server_type (void)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2095 {
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2096 if (EQ(Vwnn_server_type, Qjserver))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2097 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2098 return WNNSERVER_J;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2099 }
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2100 else if (EQ(Vwnn_server_type, Qcserver))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2101 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2102 return WNNSERVER_C;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2103 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2104 /* else if (Vwnn_server_type == Qtserver)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2105 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2106 return WNNSERVER_T;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2107 } */
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 80
diff changeset
2108 else if (EQ(Vwnn_server_type, Qkserver))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2109 {
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2110 return WNNSERVER_K;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2111 }
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2112 else return -1;
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents:
diff changeset
2113 }