1 ;;; egg-com.el --- Communication Routines in Egg Input
2 ;;; Method Architecture
4 ;; Copyright (C) 1997, 1998 Mule Project, Powered by Electrotechnical
6 ;; Project Leader: Satoru Tomura <tomura@etl.go.jp>
8 ;; Author: Hisashi Miyashita <himi@bird.scphys.kyoto-u.ac.jp>
9 ;; NIIBE Yutaka <gniibe@mri.co.jp>
10 ;; KATAYAMA Yoshio <kate@pfu.co.jp> ; Korean, Chinese support.
11 ;; Maintainer: NIIBE Yutaka <gniibe@mri.co.jp>
13 ;; This file is part of EGG.
15 ;; EGG is free software; you can redistribute it and/or modify
16 ;; it under the terms of the GNU General Public License as published by
17 ;; the Free Software Foundation; either version 2, or (at your option)
20 ;; EGG is distributed in the hope that it will be useful,
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;; GNU General Public License for more details.
25 ;; You should have received a copy of the GNU General Public License
26 ;; along with GNU Emacs; see the file COPYING. If not, write to the
27 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
28 ;; Boston, MA 02111-1307, USA.
36 (defvar egg-fixed-euc 'fixed-euc-jp)
37 (make-variable-buffer-local 'egg-fixed-euc)
39 (defvar egg-mb-euc 'euc-japan)
40 (make-variable-buffer-local 'egg-mb-euc)
43 (define-ccl-program ccl-decode-fixed-euc-jp
45 ((r2 = ,(charset-id 'japanese-jisx0208))
46 (r3 = ,(charset-id 'japanese-jisx0212))
47 (r4 = ,(charset-id 'katakana-jisx0201))
54 (write-read-repeat r0))
56 (write-read-repeat r0))
60 (write-read-repeat r0))
63 (write-read-repeat r0)))))))))
65 (define-ccl-program ccl-encode-fixed-euc-jp
69 (if (r0 == ,(charset-id 'latin-jisx0201)) ; Unify
74 (write-read-repeat r0)))
75 (r6 = (r0 == ,(charset-id 'japanese-jisx0208)))
76 (r6 |= (r0 == ,(charset-id 'japanese-jisx0208-1978)))
81 (write-read-repeat r0)))
82 (if (r0 == ,(charset-id 'katakana-jisx0201)) ;G2
85 (write-read-repeat r0)))
86 (if (r0 == ,(charset-id 'japanese-jisx0212)) ;G3
91 (write-read-repeat r0)))
96 (make-coding-system 'fixed-euc-jp 4 ?W "Coding System for fixed EUC Japanese"
97 (cons ccl-decode-fixed-euc-jp ccl-encode-fixed-euc-jp))
102 (define-ccl-program ccl-decode-fixed-euc-kr
104 ((r2 = ,(charset-id 'korean-ksc5601))
112 (write-read-repeat r0)))))
114 (define-ccl-program ccl-encode-fixed-euc-kr
120 (write-read-repeat r0)))
121 (if (r0 == ,(charset-id 'korean-ksc5601))
125 (write-read-repeat r0)))
130 (make-coding-system 'fixed-euc-kr 4 ?W "Coding System for fixed EUC Korean"
131 (cons ccl-decode-fixed-euc-kr ccl-encode-fixed-euc-kr))
134 (defvar egg-zhuyin nil)
136 (defconst yincode-pinyin-shengmu
137 '(("" . 0) ("B" . 1) ("C" . 2) ("Ch" . 3) ("D" . 4)
138 ("F" . 5) ("G" . 6) ("H" . 7) ("J" . 8) ("K" . 9)
139 ("L" . 10) ("M" . 11) ("N" . 12) ("P" . 13) ("Q" . 14)
140 ("R" . 15) ("S" . 16) ("Sh" . 17) ("T" . 18) ("W" . 19)
141 ("X" . 20) ("Y" . 21) ("Z" . 22) ("Zh" . 23)))
143 (defconst yincode-pinyin-yunmu
144 '(("
\e(0@
\e(B" 0 0) ("
\e(0@
\e(B" 0 1) ("
\e(0@
\e(B" 0 3) ("
\e(0@
\e(B" 0 5) ("
\e(0@
\e(B" 0 7)
145 ("a
\e(0@
\e(B" 1 0) ("
\e(0!@
\e(B" 1 1) ("
\e(0"@
\e(B" 1 3) ("
\e(0#@
\e(B" 1 5) ("
\e(0$@
\e(B" 1 7)
146 ("ai
\e(0@
\e(B" 2 0) ("
\e(0!
\e(Bi
\e(0@
\e(B" 2 1) ("
\e(0"
\e(Bi
\e(0@
\e(B" 2 3) ("
\e(0#
\e(Bi
\e(0@
\e(B" 2 5) ("
\e(0$
\e(Bi
\e(0@
\e(B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 0 0 1
204 0 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 0 1 0 0 0 0 0 0 1 1 1 0 0 1 0 0 1 1 1 0 0 1
205 0 1 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1
206 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 0 0 1 0 1 0 1 0 0 0 1
207 0 1 0 1 1 1 1 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 1 1 1 0 0 1 0 1 0 1 0 0 0 1
208 0 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 1 1 1 0 0 1
209 0 1 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 1 1 1 0 0 1
212 (defconst yincode-zhuyin-shengmu
213 '(("" . 0) ("
\e(0E
\e(B" . 1) ("
\e(0X
\e(B" . 2) ("
\e(0T
\e(B" . 3) ("
\e(0I
\e(B" . 4)
214 ("
\e(0H
\e(B" . 5) ("
\e(0M
\e(B" . 6) ("
\e(0O
\e(B" . 7) ("
\e(0P
\e(B" . 8) ("
\e(0N
\e(B" . 9)
215 ("
\e(0L
\e(B" . 10) ("
\e(0G
\e(B" . 11) ("
\e(0K
\e(B" . 12) ("
\e(0F
\e(B" . 13) ("
\e(0Q
\e(B" . 14)
216 ("
\e(0V
\e(B" . 15) ("
\e(0Y
\e(B" . 16) ("
\e(0U
\e(B" . 17) ("
\e(0J
\e(B" . 18) ("
\e(0h
\e(B" . 19)
217 ("
\e(0R
\e(B" . 20) ("
\e(0g
\e(B" . 21) ("
\e(0W
\e(B" . 22) ("
\e(0S
\e(B" . 23)))
219 (defconst yincode-zhuyin-yunmu
220 '(("
\e(0@
\e(B" 0 0) ("
\e(0A
\e(B" 0 1) ("
\e(0B
\e(B"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e(B" 10 0) ("
\e(0fA
\e(B" 10 1) ("
\e(0fB
\e(B" 10 3) ("
\e(0fC
\e(B" 10 5) ("
\e(0fD
\e(B" 10 7) ; er
231 ("
\e(0g@
\e(B" 11 0) ("
\e(0gA
\e(B" 11 1) ("
\e(0gB
\e(B" 11 3) ("
\e(0gC
\e(B" 11 5) ("
\e(0gD
\e(B" 11 7) ; i
232 ("
\e(0gZ@
\e(B" 12 0) ("
\e(0gZA
\e(B" 12 1) ("
\e(0gZB
\e(B" 12 3) ("
\e(0gZC
\e(B" 12 5) ("
\e(0gZD
\e(B" 12 7) ; ia
233 ("
\e(0gb@
\e(B" 13 0) ("
\e(0gbA
\e(B" 13 1) ("
\e(0gbB
\e(B" 13 3) ("
\e(0gbC
\e(B" 13 5) ("
\e(0gbD
\e(B" 13 7) ; ian
234 ("
\e(0gd@
\e(B" 14 0) ("
\e(0gdA
\e(B" 14 1) ("
\e(0gdB
\e(B" 14 3) ("
\e(0gdC
\e(B" 14 5) ("
\e(0gdD
\e(B" 14 7) ; iang
235 ("
\e(0g`@
\e(B" 15 0) ("
\e(0g`A
\e(B" 15 1) ("
\e(0g`B
\e(B" 15 3) ("
\e(0g`C
\e(B" 15 5) ("
\e(0g`D
\e(B" 15 7) ; iao
236 ("
\e(0g]@
\e(B" 16 0) ("
\e(0g]A
\e(B" 16 1) ("
\e(0g]B
\e(B" 16 3) ("
\e(0g]C
\e(B" 16 5) ("
\e(0g]D
\e(B" 16 7) ; ie
237 ("
\e(0gc@
\e(B" 17 0) ("
\e(0gcA
\e(B" 17 1) ("
\e(0gcB
\e(B" 17 3) ("
\e(0gcC
\e(B" 17 5) ("
\e(0gcD
\e(B" 17 7) ; in
238 ("
\e(0ge@
\e(B" 18 0) ("
\e(0geA
\e(B" 18 1) ("
\e(0geB
\e(B" 18 3) ("
\e(0geC
\e(B" 18 5) ("
\e(0geD
\e(B" 18 7) ; ing
239 ("
\e(0ie@
\e(B" 19 0) ("
\e(0ieA
\e(B" 19 1) ("
\e(0ieB
\e(B" 19 3) ("
\e(0ieC
\e(B" 19 5) ("
\e(0ieD
\e(B" 19 7) ; iong
240 ("
\e(0ga@
\e(B" 20 0) ("
\e(0gaA
\e(B" 20 1) ("
\e(0gaB
\e(B" 20 3) ("
\e(0gaC
\e(B" 20 5) ("
\e(0gaD
\e(B" 20 7) ; iu
241 ("
\e(0G@
\e(B" 21 0) ("
\e(0GA
\e(B" 21 1) ("
\e(0GB
\e(B" 21 3) ("
\e(0GC
\e(B" 21 5) ("
\e(0GD
\e(B" 21 7) ; m
242 ("
\e(0K@
\e(B" 22 0) ("
\e(0KA
\e(B" 22 1) ("
\e(0KB
\e(B" 22 3) ("
\e(0KC
\e(B" 22 5) ("
\e(0KD
\e(B" 22 7) ; n
243 ("@
\e(0@
\e(B" 23 0) ("@
\e(0A
\e(B" 23 1) ("@
\e(0B
\e(B" 23 3) ("@
\e(0C
\e(B" 23 5) ("@
\e(0D
\e(B" 23 7) ; ng
244 ("
\e(0[@
\e(B" 24 0) ("
\e(0[A
\e(B" 24 1) ("
\e(0[B
\e(B" 24 3) ("
\e(0[C
\e(B" 24 5) ("
\e(0[D
\e(B" 24 7) ; o
245 ("
\e(0he@
\e(B" 25 0) ("
\e(0heA
\e(B" 25 1) ("
\e(0heB
\e(B" 25 3) ("
\e(0heC
\e(B" 25 5) ("
\e(0heD
\e(B" 25 7) ; ong
246 ("
\e(0a@
\e(B" 26 0) ("
\e(0aA
\e(B" 26 1) ("
\e(0aB
\e(B" 26 3) ("
\e(0aC
\e(B" 26 5) ("
\e(0aD
\e(B" 26 7) ; ou
247 ("
\e(0h@
\e(B" 27 0) ("
\e(0hA
\e(B" 27 1) ("
\e(0hB
\e(B" 27 3) ("
\e(0hC
\e(B" 27 5) ("
\e(0hD
\e(B" 27 7) ; u
248 ("
\e(0hZ@
\e(B" 28 0) ("
\e(0hZA
\e(B" 28 1) ("
\e(0hZB
\e(B" 28 3) ("
\e(0hZC
\e(B" 28 5) ("
\e(0hZD
\e(B" 28 7) ; ua
249 ("
\e(0h^@
\e(B" 29 0) ("
\e(0h^A
\e(B" 29 1) ("
\e(0h^B
\e(B" 29 3) ("
\e(0h^C
\e(B" 29 5) ("
\e(0h^D
\e(B" 29 7) ; uai
250 ("
\e(0hb@
\e(B" 30 0) ("
\e(0hbA
\e(B" 30 1) ("
\e(0hbB
\e(B" 30 3) ("
\e(0hbC
\e(B" 30 5) ("
\e(0hbD
\e(B" 30 7) ; uan
251 ("
\e(0hd@
\e(B" 31 0) ("
\e(0hdA
\e(B" 31 1) ("
\e(0hdB
\e(B" 31 3) ("
\e(0hdC
\e(B" 31 5) ("
\e(0hdD
\e(B" 31 7) ; uang
252 ("
\e(0i]@
\e(B" 37 0) ("
\e(0i]A
\e(B" 37 1) ("
\e(0i]B
\e(B" 37 3) ("
\e(0i]C
\e(B" 37 5) ("
\e(0i]D
\e(B" 37 7) ; ue
253 ("
\e(0h_@
\e(B" 33 0) ("
\e(0h_A
\e(B" 33 1) ("
\e(0h_B
\e(B" 33 3) ("
\e(0h_C
\e(B" 33 5) ("
\e(0h_D
\e(B" 33 7) ; ui
254 ("
\e(0hc@
\e(B" 34 0) ("
\e(0hcA
\e(B" 34 1) ("
\e(0hcB
\e(B" 34 3) ("
\e(0hcC
\e(B" 34 5) ("
\e(0hcD
\e(B" 34 7) ; un
255 ("
\e(0h[@
\e(B" 35 0) ("
\e(0h[A
\e(B" 35 1) ("
\e(0h[B
\e(B" 35 3) ("
\e(0h[C
\e(B" 35 5) ("
\e(0h[D
\e(B" 35 7) ; uo
256 ("
\e(0i@
\e(B" 36 0) ("
\e(0iA
\e(B" 36 1) ("
\e(0iB
\e(B" 36 3) ("
\e(0iC
\e(B" 36 5) ("
\e(0iD
\e(B" 36 7) ;
\e(09
\e(B
257 ("
\e(0i]@
\e(B" 37 0) ("
\e(0i]A
\e(B" 37 1) ("
\e(0i]B
\e(B" 37 3) ("
\e(0i]C
\e(B" 37 5) ("
\e(0i]D
\e(B" 37 7) ;
\e(09
\e(Be
258 ("0
\e(0@
\e(B" 38 0) ("1
\e(0A
\e(B" 38 1) ("2
\e(0B
\e(B" 38 3) ("3
\e(0C
\e(B" 38 5) ("4
\e(0D
\e(B" 38 7) ; undefined
259 ("
\e(0ib@
\e(B" 39 0) ("
\e(0ibA
\e(B" 39 1) ("
\e(0ibB
\e(B" 39 3) ("
\e(0ibC
\e(B" 39 5) ("
\e(0ibD
\e(B" 39 7) ;
\e(09
\e(Ban
260 ("
\e(0ic@
\e(B" 40 0) ("
\e(0icA
\e(B" 40 1) ("
\e(0icB
\e(B" 40 3) ("
\e(0icC
\e(B" 40 5) ("
\e(0icD
\e(B" 40 7) ;
\e(09
\e(Bn
263 (defconst yincode-zhuyin-table
266 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
267 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x9586 ?\x0000 ?\x9592 ?\x9599
268 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x0000 ?\x0000
269 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x959b ?\x95a0 ?\x0000 ?\x959e
272 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000
273 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
274 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x0000
275 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
278 ?\x828b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
279 ?\x0000 ?\x0280 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
280 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
281 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
284 ?\x838b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000
285 ?\x0000 ?\x0380 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
286 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
287 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
290 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
291 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x0000
292 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
293 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
296 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000
297 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
298 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
299 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
302 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
303 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
304 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
305 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
308 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
309 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
310 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
311 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
314 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
315 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
316 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x08a4 ?\x0000 ?\x0000
317 ?\x08a7 ?\x0000 ?\x08a5 ?\x0000 ?\x08a8 ?\x0000 ?\x889b ?\x88a0 ?\x8000 ?\x889e
320 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
321 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
322 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
323 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
326 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000
327 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
328 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
329 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
332 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
333 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
334 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
335 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
338 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
339 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
340 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
341 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
344 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000
345 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
346 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
347 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
350 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
351 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
352 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0ea4 ?\x0000 ?\x0000
353 ?\x0ea7 ?\x0000 ?\x0ea5 ?\x0000 ?\x0ea8 ?\x0000 ?\x8e9b ?\x8ea0 ?\x8000 ?\x8e9e
356 ?\x8f8b ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000
357 ?\x0000 ?\x0f80 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
358 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
359 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
362 ?\x908b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000
363 ?\x0000 ?\x1080 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
364 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
365 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
368 ?\x918b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
369 ?\x0000 ?\x1180 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
370 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
371 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
374 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000
375 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x0000
376 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
377 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
380 ?\x939b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000
381 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
382 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x0000 ?\x1380 ?\x0000 ?\x0000
383 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
386 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
387 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
388 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x14a4 ?\x0000 ?\x0000
389 ?\x14a7 ?\x0000 ?\x14a5 ?\x0000 ?\x14a8 ?\x0000 ?\x949b ?\x94a0 ?\x8000 ?\x949e
392 ?\x958b ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0090 ?\x0000 ?\x9591 ?\x9592
393 ?\x0000 ?\x1580 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x1588 ?\x1589 ?\x0000
394 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0093 ?\x8000 ?\x00a4 ?\x0000 ?\x0000
395 ?\x00a7 ?\x0000 ?\x00a5 ?\x0000 ?\x00a8 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
398 ?\x968b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
399 ?\x0000 ?\x1680 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
400 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
401 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
404 ?\x978b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
405 ?\x0000 ?\x1780 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
406 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
407 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
411 (defconst egg-chinese-syllable-max-len
412 (max (length "Zhu
\e(0!
\e(Bng
\e(0@
\e(B") (length "
\e(0ShdA
\e(B")))
414 (defun egg-chinese-syllable (str pos)
415 (setq str (substring str pos (min (length str)
416 (+ pos egg-chinese-syllable-max-len))))
417 (or (car (egg-pinyin-syllable str))
418 (car (egg-zhuyin-syllable str))))
420 (defsubst egg-make-fixed-euc-china-code (s y)
422 (+ (* 2 (nth 1 y)) (logand (nth 2 y) 1) 32)
423 (+ (* 4 (if (= s 0) 20 s)) (lsh (nth 2 y) -1) 156)))
425 (defun egg-pinyin-syllable (str)
427 (if (eq (string-match "^[A-Za-z
\e(0!
\e(B-
\e(0?
\e(B]+
\e(0@
\e(B" str) 0)
429 (setq end (match-end 0))
431 ((setq s (cdr (assoc (substring str 0 2) yincode-pinyin-shengmu)))
432 (setq y (substring str 2 end)))
433 ((setq s (cdr (assoc (substring str 0 1) yincode-pinyin-shengmu)))
434 (setq y (substring str 1 end)))
436 (setq s 0 y (substring str 0 end))))
437 (if (and (setq y (assoc y yincode-pinyin-yunmu))
438 (= (aref yincode-pinyin-table (+ (* 39 s) (nth 1 y))) 1))
439 (cons end (egg-make-fixed-euc-china-code s y)))))))
441 (defun egg-zhuyin-syllable (str)
442 (let (end s y c z (zhuyin-len (egg-charset-bytes 'chinese-sisheng)))
443 (if (eq (string-match "^[
\e(0E
\e(B-
\e(0i
\e(B@0-4]+[
\e(0@ABCD
\e(B]" str) 0)
445 (setq end (match-end 0)
446 c (substring str 0 zhuyin-len)
447 s (cdr (assoc c yincode-zhuyin-shengmu))
448 y (assoc (substring str zhuyin-len end) yincode-zhuyin-yunmu))
451 y (assoc (substring str 0 end) yincode-zhuyin-yunmu)))
453 (setq z (aref yincode-zhuyin-table (+ (* 41 s) (nth 1 y))))
454 (/= (logand z ?\x8000) 0))
455 (if (/= (logand z ?\x80) 0)
456 (cons end (egg-make-fixed-euc-china-code
457 (logand (lsh z -8) ?\x7f)
458 (list nil (logand z ?\x7f) (nth 2 y))))
459 (cons end (egg-make-fixed-euc-china-code s y))))))))
461 (defun encode-fixed-euc-china-region (beg end type)
462 "Encode the text in the region to EUC-CN/TW."
466 (narrow-to-region beg end)
467 (goto-char (point-min))
468 (while (< (point) (point-max))
469 (setq s (buffer-substring
471 (min (point-max) (+ (point) egg-chinese-syllable-max-len))))
473 ((setq syl (egg-pinyin-syllable s))
474 (delete-region (point) (+ (point) (car syl)))
475 (insert (car (cdr syl)) (cdr (cdr syl))))
476 ((setq syl (egg-zhuyin-syllable s))
477 (delete-region (point) (+ (point) (car syl)))
478 (insert (car (cdr syl)) (cdr (cdr syl))))
480 (setq c (split-char (following-char))
483 ((or (and (eq cset 'chinese-gb2312) (eq type 'cn))
484 (and (eq cset 'chinese-cns11643-1) (eq type 'tw)))
486 (insert (+ (nth 1 c) 128) (+ (nth 2 c) 128)))
487 ((and (eq cset 'chinese-cns11643-2) (eq type 'tw))
489 (insert (+ (nth 1 c) 128) (nth 2 c)))
490 ((eq cset 'chinese-sisheng)
492 (insert 0 (+ (nth 1 c) 128)))
495 (insert 0 (nth 1 c)))
498 (- (point-max) (point-min))))))
500 (defun pre-write-encode-fixed-euc-china (from to type)
501 (let ((buf (current-buffer))
502 (work (get-buffer-create " *pre-write-encoding-work*")))
505 (if (null (stringp from))
508 (setq from (buffer-substring from to))))
509 (insert (string-as-multibyte from))
510 (encode-fixed-euc-china-region 1 (point-max) type)
513 (defun pre-write-encode-euc-cn (from to)
514 (pre-write-encode-fixed-euc-china from to 'cn))
516 (defun pre-write-encode-euc-tw (from to)
517 (pre-write-encode-fixed-euc-china from to 'tw))
519 (defun decode-fixed-euc-china-region (beg end type)
520 "Decode EUC-CN/TW encoded text in the region.
521 Return the length of resulting text."
523 (let ((str (string-as-unibyte (buffer-substring beg end)))
526 (delete-region beg end)
527 (setq l (1- (length str)))
529 (setq c0 (aref str i)
535 (insert leading-code-private-11
536 (charset-id 'chinese-sisheng)
542 (insert (charset-id 'chinese-gb2312) c0 (logior c1 ?\x80)))
544 (insert (charset-id 'chinese-cns11643-1) c0 c1))
546 (insert (charset-id 'chinese-cns11643-2) c0 (+ c1 ?\x80)))))
548 (setq c1 (logand c1 ?\x7f))
549 (setq s (- (lsh c1 -2) 7);;(+ (lsh (- c1 32) -2) 1)
550 y (- (lsh c0 -1) 16);;(lsh (- c0 32) -1)
551 ss (+ (logand c0 1) (logand c1 3)))
554 (setq c0 (aref yincode-zhuyin-table (+ (* 41 s) y)))
555 (if (eq (logand c0 ?\x8080) ?\x80)
557 y (logand c0 ?\x7f)))
559 (eq (aref yincode-pinyin-table (+ (* 39 s) y)) 0))
561 (setq s (car (nth s yincode-zhuyin-shengmu))
562 y (car (nth (+ (* 5 y) ss) yincode-zhuyin-yunmu))))
564 (eq (aref yincode-pinyin-table (+ (* 39 s) y)) 0))
566 (setq s (car (nth s yincode-pinyin-shengmu))
567 y (car (nth (+ (* 5 y) ss) yincode-pinyin-yunmu))))
568 (if enable-multibyte-characters
570 (insert (string-as-unibyte s) (string-as-unibyte y))))))
572 (if (looking-at "\0\0") (forward-char 2))))
574 (defun post-read-decode-fixed-euc-china (len type)
576 (buffer-modified-p (buffer-modified-p)))
578 (decode-fixed-euc-china-region pos (+ pos len) type)
579 (set-buffer-modified-p buffer-modified-p))))
581 (defun post-read-decode-euc-cn (len)
582 (post-read-decode-fixed-euc-china len 'cn))
584 (defun post-read-decode-euc-tw (len)
585 (post-read-decode-fixed-euc-china len 'tw))
587 (make-coding-system 'fixed-euc-cn 0 ?W "Coding System for fixed EUC Chinese-gb2312")
588 (coding-system-put 'fixed-euc-cn 'pre-write-conversion 'pre-write-encode-euc-cn)
589 (coding-system-put 'fixed-euc-cn 'post-read-conversion 'post-read-decode-euc-cn)
591 (make-coding-system 'fixed-euc-tw 0 ?W "Coding System for fixed EUC Chinese-cns11643")
592 (coding-system-put 'fixed-euc-tw 'pre-write-conversion 'pre-write-encode-euc-tw)
593 (coding-system-put 'fixed-euc-tw 'post-read-conversion 'post-read-decode-euc-tw)
595 (defsubst comm-format-u32c (uint32c)
596 (let ((h0 (car uint32c))
598 (let ((b0 (logand (lsh h0 -8) 255))
600 (b2 (logand (lsh h1 -8) 255))
601 (b3 (logand h1 255)))
605 (insert-char b3 1))))
607 (defsubst comm-format-u32 (uint32)
608 (let ((b0 (logand (lsh uint32 -24) 255))
609 (b1 (logand (lsh uint32 -16) 255))
610 (b2 (logand (lsh uint32 -8) 255))
611 (b3 (logand uint32 255)))
617 (defsubst comm-format-i32 (int32)
618 (let ((b0 (logand (ash int32 -24) 255))
619 (b1 (logand (ash int32 -16) 255))
620 (b2 (logand (ash int32 -8) 255))
621 (b3 (logand int32 255)))
627 (defsubst comm-format-u16 (uint16)
628 (let ((b0 (logand (lsh uint16 -8) 255))
629 (b1 (logand uint16 255)))
633 (defsubst comm-format-u8 (uint8)
634 (let ((b0 (logand uint8 255)))
637 ;;; XXX should support other code conversion
638 (defsubst comm-format-u16-string (s)
639 (let ((euc-string (encode-coding-string s egg-fixed-euc)))
644 ;;; XXX should support other code conversion
645 (defsubst comm-format-mb-string (s)
646 (let ((euc-string (encode-coding-string s egg-mb-euc)))
650 (defsubst comm-format-u8-string (s)
654 (defsubst comm-format-u8-vector (s)
657 (defsubst comm-format-bytes (s)
661 (defmacro comm-format (format &rest args)
662 "Format a string out of a control-list and arguments into the buffer.
663 u means unsigned 32-bit in big endian.
664 i means unsigned 32-bit in big endian.
665 w means unsigned 16-bit in big endian.
666 b means unsigned 8-bit.
667 S means 16-bit(big endian) wide-character string (0x0000 terminated).
668 E means multibyte string (0x00 terminated).
669 s means 8-bit string (0x00 terminated).
670 v means 8-bit vector."
671 (let ((p args) result arg f)
674 (setq f (car format))
678 (cond ((eq f 'U) (list 'comm-format-u32c arg))
679 ((eq f 'u) (list 'comm-format-u32 arg))
680 ((eq f 'i) (list 'comm-format-i32 arg))
681 ((eq f 'v) (list 'comm-format-u8-vector arg))
682 ((eq f 'w) (list 'comm-format-u16 arg))
683 ((eq f 'b) (list 'comm-format-u8 arg))
684 ((eq f 'S) (list 'comm-format-u16-string arg))
685 ((eq f 'E) (list 'comm-format-mb-string arg))
686 ((eq f 's) (list 'comm-format-u8-string arg))
687 ((eq f 'B) (list 'comm-format-bytes arg))))))
689 (setq format (cdr format)))
694 ;; Do not move the point, leave it where it was.
695 (defun comm-accept-process-output (proc)
697 (accept-process-output proc)
700 ;; Assume PROC is bound to the process of current buffer
701 (defsubst comm-following-char-or-wait (proc)
704 (while (= p (point-max))
705 (accept-process-output proc))
709 (defun comm-following+forward-char (proc)
711 (comm-following-char-or-wait proc)
714 (defsubst comm-unpack-u32c (proc uint32c)
718 (lsh (comm-following+forward-char proc) 8)
719 (comm-following+forward-char proc)))
722 (lsh (comm-following+forward-char proc) 8)
723 (comm-following+forward-char proc)))
724 (set uint32c (cons h0 h1))))
726 (defsubst comm-unpack-u32 (proc uint32)
729 (lsh (comm-following+forward-char proc) 24)
730 (lsh (comm-following+forward-char proc) 16)
731 (lsh (comm-following+forward-char proc) 8)
732 (comm-following+forward-char proc))))
734 (defsubst comm-unpack-u16 (proc uint16)
737 (lsh (comm-following+forward-char proc) 8)
738 (comm-following+forward-char proc))))
740 (defsubst comm-unpack-u8 (proc uint8)
742 (comm-following+forward-char proc)))
744 ;;; XXX should support other conversion (euc-kr, cns)
745 (defsubst comm-unpack-u16-string (proc s)
746 (let ((start (point)))
747 (while (not (search-forward "\0\0" nil t))
748 (comm-accept-process-output proc))
749 (set s (string-as-multibyte
750 (buffer-substring start
752 (decode-coding-region start (- (point) 2)
755 ;;; XXX should support other conversion (euc-kr, cns)
756 (defsubst comm-unpack-mb-string (proc s)
757 (let ((start (point)))
758 (while (not (search-forward "\0" nil t))
759 (comm-accept-process-output proc))
760 (set s (string-as-multibyte
761 (buffer-substring start
763 (decode-coding-region start (- (point) 1)
766 (defsubst comm-unpack-u8-string (proc s)
767 (let ((start (point)))
768 (while (not (search-forward "\0" nil 1))
769 (comm-accept-process-output proc))
770 (set s (buffer-substring start (1- (point))))))
772 (defsubst comm-unpack-bytes (proc s)
773 (let ((start (point)))
774 (while (not (search-forward "\377" nil 1))
775 (comm-accept-process-output proc))
776 (set s (buffer-substring start (1- (point))))))
778 (defmacro comm-unpack (format &rest args)
779 "Unpack a string out of a control-string and set arguments.
780 u means unsigned 32-bit in big endian.
781 w means unsigned 16-bit in big endian.
782 b means unsigned 8-bit.
783 S means 16-bit(big endian) string (0x0000 terminated).
784 E means multibyte string (0x00 terminated).
785 s means 8-bit string (0x00 terminated).
787 (let ((p args) result arg f)
790 (setq f (car format))
794 (cond ((eq f 'U) (list 'comm-unpack-u32c
795 'proc (list 'quote arg)))
796 ((eq f 'u) (list 'comm-unpack-u32
797 'proc (list 'quote arg)))
798 ((eq f 'w) (list 'comm-unpack-u16
799 'proc (list 'quote arg)))
800 ((eq f 'b) (list 'comm-unpack-u8
801 'proc (list 'quote arg)))
802 ((eq f 'S) (list 'comm-unpack-u16-string
803 'proc (list 'quote arg)))
804 ((eq f 'E) (list 'comm-unpack-mb-string
805 'proc (list 'quote arg)))
806 ((eq f 's) (list 'comm-unpack-u8-string
807 'proc (list 'quote arg)))
808 ((eq f 'B) (list 'comm-unpack-u8-string
809 'proc (list 'quote arg)))))))
811 (setq format (cdr format)))
816 (defmacro comm-call-with-proc (proc vlist send-expr &rest receive-exprs)
821 (set-buffer (process-buffer proc))
824 (process-send-region proc (point-min) (point-max))
825 (goto-char (prog1 (point) (accept-process-output proc))))
828 (defmacro comm-call-with-proc-1 (proc vlist send-expr &rest receive-exprs)
835 (process-send-region proc (point-min) (point-max))
836 (goto-char (prog1 (point) (accept-process-output proc))))
840 ;;; egg-com.el ends here.