annotate src/mule-wnnfns.c @ 438:84b14dcb0985 r21-2-27

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