annotate src/mule-wnnfns.c @ 5697:40fbceabaafd

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