annotate src/mule-wnnfns.c @ 80:1ce6082ce73f r20-0b90

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