1 ;;; egg-com.el --- Communication Routines in Egg Input Method Architecture
3 ;; Copyright (C) 1999, 2000 Free Software Foundation, Inc
5 ;; Author: Hisashi Miyashita <himi@bird.scphys.kyoto-u.ac.jp>
6 ;; NIIBE Yutaka <gniibe@chroot.org>
7 ;; KATAYAMA Yoshio <kate@pfu.co.jp> ; Korean, Chinese support.
9 ;; Maintainer: TOMURA Satoru <tomura@etl.go.jp>
11 ;; Keywords: mule, multilingual, input method
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.
37 (defvar egg-fixed-euc '(fixed-euc-jp))
38 (make-variable-buffer-local 'egg-fixed-euc)
39 (put 'egg-fixed-euc 'permanent-local t)
41 (defvar egg-mb-euc 'euc-japan)
42 (make-variable-buffer-local 'egg-mb-euc)
43 (put 'egg-mb-euc 'permanent-local t)
48 (define-ccl-program ccl-decode-fixed-euc-jp
50 ((r2 = ,(charset-id 'japanese-jisx0208))
51 (r3 = ,(charset-id 'japanese-jisx0212))
52 (r4 = ,(charset-id 'katakana-jisx0201))
59 (write-read-repeat r0))
60 (write-multibyte-character r4 r0)
67 (write-multibyte-character r2 r0)
73 (write-multibyte-character r3 r0)
77 (define-ccl-program ccl-encode-fixed-euc-jp
81 (if (r0 == ,(charset-id 'latin-jisx0201)) ; Unify
86 (write-read-repeat r0)))
87 (r6 = (r0 == ,(charset-id 'japanese-jisx0208)))
88 (r6 |= (r0 == ,(charset-id 'japanese-jisx0208-1978)))
93 (write-read-repeat r0)))
94 (if (r0 == ,(charset-id 'katakana-jisx0201)) ;G2
97 (write-read-repeat r0)))
98 (if (r0 == ,(charset-id 'japanese-jisx0212)) ;G3
103 (write-read-repeat r0)))
108 (if (featurep 'xemacs)
109 (make-coding-system 'fixed-euc-jp 'ccl "Coding System for fixed EUC Japanese"
111 decode ccl-decode-fixed-euc-jp
112 encode ccl-encode-fixed-euc-jp))
113 (make-coding-system 'fixed-euc-jp 4 ?W "Coding System for fixed EUC Japanese"
114 (cons ccl-decode-fixed-euc-jp ccl-encode-fixed-euc-jp)))
119 (define-ccl-program ccl-decode-fixed-euc-kr
121 ((r2 = ,(charset-id 'korean-ksc5601))
127 (write-read-repeat r0))
131 (write-multibyte-character r2 r0)
135 (define-ccl-program ccl-encode-fixed-euc-kr
141 (write-read-repeat r0)))
142 (if (r0 == ,(charset-id 'korean-ksc5601))
146 (write-read-repeat r0)))
151 (if (featurep 'xemacs)
152 (make-coding-system 'fixed-euc-kr 'ccl "Coding System for fixed EUC Korean"
153 '(mnemonic "W" decode ccl-decode-fixed-euc-kr
154 encode ccl-encode-fixed-euc-kr))
155 (make-coding-system 'fixed-euc-kr 4 ?W "Coding System for fixed EUC Korean"
156 (cons ccl-decode-fixed-euc-kr ccl-encode-fixed-euc-kr)))
160 (defconst egg-pinyin-shengmu
161 '(("" . 0) ("B" . 1) ("C" . 2) ("Ch" . 3) ("D" . 4)
162 ("F" . 5) ("G" . 6) ("H" . 7) ("J" . 8) ("K" . 9)
163 ("L" . 10) ("M" . 11) ("N" . 12) ("P" . 13) ("Q" . 14)
164 ("R" . 15) ("S" . 16) ("Sh" . 17) ("T" . 18) ("W" . 19)
165 ("X" . 20) ("Y" . 21) ("Z" . 22) ("Zh" . 23)))
167 (defconst egg-pinyin-yunmu
168 '(("
\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)
169 ("a
\e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bng
\e(0@
\e(B" 31 5) ("u
\e(0$
\e(Bng
\e(0@
\e(B" 31 7)
200 ("ue
\e(0@
\e(B" 32 0) ("u
\e(0%@
\e(B" 32 1) ("u
\e(0&@
\e(B" 32 3) ("u
\e(0'@
\e(B" 32 5) ("u
\e(0(@
\e(B" 32 7)
201 ("ui
\e(0@
\e(B" 33 0) ("u
\e(0)@
\e(B" 33 1) ("u
\e(0*@
\e(B" 33 3) ("u
\e(0+@
\e(B" 33 5) ("u
\e(0,@
\e(B" 33 7)
202 ("un
\e(0@
\e(B" 34 0) ("
\e(01
\e(Bn
\e(0@
\e(B" 34 1) ("
\e(02
\e(Bn
\e(0@
\e(B" 34 3) ("
\e(03
\e(Bn
\e(0@
\e(B" 34 5) ("
\e(04
\e(Bn
\e(0@
\e(B" 34 7)
203 ("uo
\e(0@
\e(B" 35 0) ("u
\e(0-@
\e(B" 35 1) ("u
\e(0.@
\e(B" 35 3) ("u
\e(0/@
\e(B" 35 5) ("u
\e(00@
\e(B" 35 7)
204 ("
\e(09@
\e(B" 36 0) ("
\e(05@
\e(B" 36 1) ("
\e(06@
\e(B" 36 3) ("
\e(07@
\e(B" 36 5) ("
\e(08@
\e(B" 36 7)
205 ("
\e(09
\e(Be
\e(0@
\e(B" 37 0) ("
\e(09%@
\e(B" 37 1) ("
\e(09&@
\e(B" 37 3) ("
\e(09'@
\e(B" 37 5) ("
\e(09(@
\e(B" 37 7)
206 ("0
\e(0@
\e(B" 38 0) ("1
\e(0@
\e(B" 38 1) ("2
\e(0@
\e(B" 38 3) ("3
\e(0@
\e(B" 38 5) ("4
\e(0@
\e(B" 38 7)))
208 (defconst egg-pinyin-table
210 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
211 0 1 1 1 1 1 0 1 1 1 0 1 0 1 0 1 1 1 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 1
212 0 1 1 1 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" 7 7) ; ei
252 ("
\e(0c@
\e(B" 8 0) ("
\e(0cA
\e(B" 8 1) ("
\e(0cB
\e(B" 8 3) ("
\e(0cC
\e(B" 8 5) ("
\e(0cD
\e(B" 8 7) ; en
253 ("
\e(0e@
\e(B" 9 0) ("
\e(0eA
\e(B" 9 1) ("
\e(0eB
\e(B" 9 3) ("
\e(0eC
\e(B" 9 5) ("
\e(0eD
\e(B" 9 7) ; eng
254 ("
\e(0f@
\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
255 ("
\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
256 ("
\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
257 ("
\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
258 ("
\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
259 ("
\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
260 ("
\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
261 ("
\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
262 ("
\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
263 ("
\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
264 ("
\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
265 ("
\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
266 ("
\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
267 ("@
\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
268 ("
\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
269 ("
\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
270 ("
\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
271 ("
\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
272 ("
\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
273 ("
\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
274 ("
\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
275 ("
\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
276 ("
\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
277 ("
\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
278 ("
\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
279 ("
\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
280 ("
\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
281 ("
\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
282 ("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
283 ("
\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
284 ("
\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
287 (defconst egg-zhuyin-table
290 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
291 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x9586 ?\x0000 ?\x9592 ?\x9599
292 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x0000 ?\x0000
293 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x959b ?\x95a0 ?\x0000 ?\x959e
296 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000
297 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
298 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x0000
299 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
302 ?\x828b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
303 ?\x0000 ?\x0280 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
304 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
305 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
308 ?\x838b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000
309 ?\x0000 ?\x0380 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
310 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
311 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
314 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
315 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x0000
316 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
317 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
320 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000
321 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
322 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
323 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
326 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
327 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
328 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
329 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
332 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
333 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
334 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
335 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
338 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
339 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
340 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x08a4 ?\x0000 ?\x0000
341 ?\x08a7 ?\x0000 ?\x08a5 ?\x0000 ?\x08a8 ?\x0000 ?\x889b ?\x88a0 ?\x8000 ?\x889e
344 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
345 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
346 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
347 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
350 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000
351 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
352 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
353 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
356 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
357 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
358 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
359 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
362 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
363 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
364 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
365 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
368 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000
369 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
370 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
371 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
374 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
375 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
376 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0ea4 ?\x0000 ?\x0000
377 ?\x0ea7 ?\x0000 ?\x0ea5 ?\x0000 ?\x0ea8 ?\x0000 ?\x8e9b ?\x8ea0 ?\x8000 ?\x8e9e
380 ?\x8f8b ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000
381 ?\x0000 ?\x0f80 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
382 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000
383 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
386 ?\x908b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000
387 ?\x0000 ?\x1080 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
388 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
389 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
392 ?\x918b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
393 ?\x0000 ?\x1180 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
394 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
395 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
398 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x8000
399 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x0000
400 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
401 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
404 ?\x939b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000
405 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
406 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000 ?\x0000 ?\x1380 ?\x0000 ?\x0000
407 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
410 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
411 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
412 ?\x8000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x14a4 ?\x0000 ?\x0000
413 ?\x14a7 ?\x0000 ?\x14a5 ?\x0000 ?\x14a8 ?\x0000 ?\x949b ?\x94a0 ?\x8000 ?\x949e
416 ?\x958b ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0090 ?\x0000 ?\x9591 ?\x9592
417 ?\x0000 ?\x1580 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x1588 ?\x1589 ?\x0000
418 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0093 ?\x8000 ?\x00a4 ?\x0000 ?\x0000
419 ?\x00a7 ?\x0000 ?\x00a5 ?\x0000 ?\x00a8 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
422 ?\x968b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
423 ?\x0000 ?\x1680 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
424 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000
425 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
428 ?\x978b ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
429 ?\x0000 ?\x1780 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000
430 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x8000 ?\x8000
431 ?\x8000 ?\x8000 ?\x0000 ?\x8000 ?\x8000 ?\x8000 ?\x0000 ?\x0000 ?\x8000 ?\x0000
435 (defconst egg-chinese-syllable-max-len
436 (max (length "Zhu
\e(0!
\e(Bng
\e(0@
\e(B") (length "
\e(0ShdA
\e(B")))
438 (defun egg-chinese-syllable (str pos)
439 (setq str (substring str pos (min (length str)
440 (+ pos egg-chinese-syllable-max-len))))
441 (or (car (egg-pinyin-syllable str))
442 (car (egg-zhuyin-syllable str))))
444 (defsubst egg-make-fixed-euc-china-code (s y)
446 (+ (* 2 (nth 1 y)) (logand (nth 2 y) 1) 32)
447 (+ (* 4 (if (= s 0) 20 s)) (lsh (nth 2 y) -1) 156)))
449 (defun egg-pinyin-syllable (str)
450 (if (eq (string-match "^[A-Za-z
\e(0!
\e(B-
\e(0?
\e(B]+
\e(0@
\e(B" str) 0)
452 (setq end (match-end 0))
454 ((setq s (cdr (assoc (substring str 0 2) egg-pinyin-shengmu)))
455 (setq y (substring str 2 end)))
456 ((setq s (cdr (assoc (substring str 0 1) egg-pinyin-shengmu)))
457 (setq y (substring str 1 end)))
459 (setq s 0 y (substring str 0 end))))
460 (if (and (setq y (assoc y egg-pinyin-yunmu))
461 (= (aref egg-pinyin-table (+ (* 39 s) (nth 1 y))) 1))
462 (cons end (egg-make-fixed-euc-china-code s y))))))
464 (defun egg-zhuyin-syllable (str)
465 (if (eq (string-match "^[
\e(0E
\e(B-
\e(0i
\e(B@0-4]+[
\e(0@ABCD
\e(B]" str) 0)
466 (let (end s y c z (zhuyin-len (length "
\e(0E
\e(B")))
467 (setq end (match-end 0)
468 c (substring str 0 zhuyin-len)
469 s (cdr (assoc c egg-zhuyin-shengmu))
470 y (assoc (substring str zhuyin-len end) egg-zhuyin-yunmu))
471 (if (or (null (and s y))
472 (and (or (eq s 11) (eq s 12)) (eq (nth 1 y) 0))) ; [
\e(0GK
\e(B][
\e(0@ABCD
\e(B]
474 y (assoc (substring str 0 end) egg-zhuyin-yunmu)))
476 (setq z (aref egg-zhuyin-table (+ (* 41 s) (nth 1 y))))
477 (/= (logand z ?\x8000) 0))
478 (if (/= (logand z ?\x80) 0)
479 (cons end (egg-make-fixed-euc-china-code
480 (logand (lsh z -8) ?\x7f)
481 (list nil (logand z ?\x7f) (nth 2 y))))
482 (cons end (egg-make-fixed-euc-china-code s y)))))))
484 (defun encode-fixed-euc-china-region (beg end type)
485 "Encode the text in the region to EUC-CN/TW."
489 (narrow-to-region beg end)
490 (goto-char (point-min))
491 (while (< (point) (point-max))
492 (setq s (buffer-substring
494 (min (point-max) (+ (point) egg-chinese-syllable-max-len))))
496 ((setq syl (egg-pinyin-syllable s))
497 (delete-region (point) (+ (point) (car syl)))
498 (insert (car (cdr syl)) (cdr (cdr syl))))
499 ((setq syl (egg-zhuyin-syllable s))
500 (delete-region (point) (+ (point) (car syl)))
501 (insert (car (cdr syl)) (cdr (cdr syl))))
503 (setq c (split-char (following-char))
506 ((or (and (eq cset 'chinese-gb2312) (eq type 'cn))
507 (and (eq cset 'chinese-cns11643-1) (eq type 'tw)))
509 (insert (+ (nth 1 c) 128) (+ (nth 2 c) 128)))
510 ((and (eq cset 'chinese-cns11643-2) (eq type 'tw))
512 (insert (+ (nth 1 c) 128) (nth 2 c)))
513 ((eq cset 'chinese-sisheng)
515 (insert 0 (+ (nth 1 c) 128)))
518 (insert 0 (+ (nth 1 c) 128)))
521 (insert 0 (nth 1 c)))
524 (- (point-max) (point-min))))))
526 (defun pre-write-encode-fixed-euc-china (from to type)
527 (let ((buf (current-buffer))
528 (work (get-buffer-create " *pre-write-encoding-work*")))
531 (if (null (stringp from))
534 (setq from (buffer-substring from to))))
535 (insert (string-as-multibyte from))
536 (encode-fixed-euc-china-region 1 (point-max) type)
539 (defun pre-write-encode-euc-cn (from to)
540 (pre-write-encode-fixed-euc-china from to 'cn))
542 (defun pre-write-encode-euc-tw (from to)
543 (pre-write-encode-fixed-euc-china from to 'tw))
545 (defun decode-fixed-euc-china-region (beg end type zhuyin)
546 "Decode EUC-CN/TW encoded text in the region.
547 Return the length of resulting text."
549 (let ((str (string-as-unibyte (buffer-substring beg end)))
552 (delete-region beg end)
553 (setq l (1- (length str)))
555 (setq c0 (if (featurep 'xemacs)
556 (char-to-int (aref str i))
558 c1 (if (featurep 'xemacs)
559 (char-to-int (aref str (1+ i)))
565 (insert (make-char (if (featurep 'xemacs)
573 (insert (make-char 'chinese-gb2312 c0 c1)))
575 (insert (make-char 'chinese-cns11643-1 c0 c1)))
577 (insert (make-char 'chinese-cns11643-2 c0 c1)))))
579 (setq c1 (logand c1 ?\x7f))
580 (setq s (- (lsh c1 -2) 7);;(+ (lsh (- c1 32) -2) 1)
581 y (- (lsh c0 -1) 16);;(lsh (- c0 32) -1)
582 ss (+ (logand c0 1) (logand c1 3)))
584 (eq (aref egg-pinyin-table (+ (* 39 20) y)) 0))
587 (setq s (car (nth s egg-pinyin-shengmu))
588 y (car (nth (+ (* 5 y) ss) egg-pinyin-yunmu)))
589 (setq c0 (aref egg-zhuyin-table (+ (* 41 s) y)))
590 (if (eq (logand c0 ?\x8080) ?\x80)
592 y (logand c0 ?\x7f)))
593 (setq s (car (nth s egg-zhuyin-shengmu))
594 y (car (nth (+ (* 5 y) ss) egg-zhuyin-yunmu))))
595 (if enable-multibyte-characters
597 (insert (string-as-unibyte s) (string-as-unibyte y))))))
599 (if (looking-at "\0\0") (forward-char 2))))
601 (defun post-read-decode-fixed-euc-china (len type zhuyin)
603 (buffer-modified-p (buffer-modified-p)))
605 (decode-fixed-euc-china-region pos (+ pos len) type zhuyin)
606 (set-buffer-modified-p buffer-modified-p))))
608 (defun post-read-decode-euc-py-cn (len)
609 (post-read-decode-fixed-euc-china len 'cn nil))
611 (defun post-read-decode-euc-zy-cn (len)
612 (post-read-decode-fixed-euc-china len 'cn t))
614 (defun post-read-decode-euc-py-tw (len)
615 (post-read-decode-fixed-euc-china len 'tw nil))
617 (defun post-read-decode-euc-zy-tw (len)
618 (post-read-decode-fixed-euc-china len 'tw t))
620 ;; XEmacs incompatibility note.
622 ;; XEmacs uses pre-write-conversion and post-read-conversion when
623 ;; characters are read from or written to files. post-read-conversion
624 ;; functions are called with arguments start and end. It is not
625 ;; compatible with Emacs' counterpart which is called with length.
626 ;; This coding-system does not work on XEmacs because
627 ;; post-read-conversion is written in Emacs style.
629 ;; The actual usage of this coding-system is to convert string to the
630 ;; format cserver expects. The problem is that post-read-conversion
631 ;; and pre-write-conversion is ignored when decode-coding-string and
632 ;; encode-coding-string are called, not post-read-conversion is
633 ;; incompatible. So I decided to leave post-read-conversion as is and
634 ;; call it from comm-format-u16-string and comm-unpack-u16-string to
635 ;; work around the problem.
636 (if (featurep 'xemacs)
637 (make-coding-system 'fixed-euc-py-cn 'no-conversion
638 "Coding System for fixed EUC Chinese-gb2312"
639 '(mnemonic "W" pre-write-conversion pre-write-encode-euc-cn
640 post-read-conversion post-read-decode-euc-py-cn))
641 (make-coding-system 'fixed-euc-py-cn 0 ?W
642 "Coding System for fixed EUC Chinese-gb2312")
643 (coding-system-put 'fixed-euc-py-cn
644 'pre-write-conversion 'pre-write-encode-euc-cn)
645 (coding-system-put 'fixed-euc-py-cn
646 'post-read-conversion 'post-read-decode-euc-py-cn))
648 (if (featurep 'xemacs)
649 (make-coding-system 'fixed-euc-zy-cn 'no-conversion
650 "Coding System for fixed EUC Chinese-gb2312"
651 '(mnemonic "W" pre-write-conversion pre-write-encode-euc-cn
652 post-read-conversion post-read-decode-euc-zy-cn))
653 (make-coding-system 'fixed-euc-zy-cn 0 ?W
654 "Coding System for fixed EUC Chinese-gb2312")
655 (coding-system-put 'fixed-euc-zy-cn
656 'pre-write-conversion 'pre-write-encode-euc-cn)
657 (coding-system-put 'fixed-euc-zy-cn
658 'post-read-conversion 'post-read-decode-euc-zy-cn))
660 (if (featurep 'xemacs)
661 (make-coding-system 'fixed-euc-py-tw 'no-conversion
662 "Coding System for fixed EUC Chinese-gb2312"
663 '(mnemonic "W" pre-write-conversion pre-write-encode-euc-tw
664 post-read-conversion post-read-decode-euc-py-tw))
665 (make-coding-system 'fixed-euc-py-tw 0 ?W
666 "Coding System for fixed EUC Chinese-cns11643")
667 (coding-system-put 'fixed-euc-py-tw
668 'pre-write-conversion 'pre-write-encode-euc-tw)
669 (coding-system-put 'fixed-euc-py-tw
670 'post-read-conversion 'post-read-decode-euc-py-tw))
672 (if (featurep 'xemacs)
673 (make-coding-system 'fixed-euc-zy-tw 'no-conversion
674 "Coding System for fixed EUC Chinese-gb2312"
675 '(mnemonic "W" pre-write-conversion pre-write-encode-euc-tw
676 post-read-conversion post-read-decode-euc-zy-tw))
677 (make-coding-system 'fixed-euc-zy-tw 0 ?W
678 "Coding System for fixed EUC Chinese-cns11643")
679 (coding-system-put 'fixed-euc-zy-tw
680 'pre-write-conversion 'pre-write-encode-euc-tw)
681 (coding-system-put 'fixed-euc-zy-tw
682 'post-read-conversion 'post-read-decode-euc-zy-tw)
687 (define-ccl-program ccl-decode-egg-binary
692 (read r1)) ; toss out
693 (write-read-repeat r0)))))
695 (define-ccl-program ccl-encode-egg-binary
702 (write-read-repeat r0))))))
704 (if (featurep 'xemacs)
705 (define-coding-system-alias 'egg-binary 'binary)
706 (make-coding-system 'egg-binary 4 ?W "Coding System for binary data"
707 (cons ccl-decode-egg-binary ccl-encode-egg-binary)))
710 (defun comm-format-u32c (uint32c)
711 (insert-char (logand (lsh (car uint32c) -8) 255) 1)
712 (insert-char (logand (car uint32c) 255) 1)
713 (insert-char (logand (lsh (nth 1 uint32c) -8) 255) 1)
714 (insert-char (logand (nth 1 uint32c) 255) 1))
716 (defun comm-format-u32 (uint32)
717 (insert-char (logand (lsh uint32 -24) 255) 1)
718 (insert-char (logand (lsh uint32 -16) 255) 1)
719 (insert-char (logand (lsh uint32 -8) 255) 1)
720 (insert-char (logand uint32 255) 1))
722 (defun comm-format-i32 (int32)
723 (insert-char (logand (ash int32 -24) 255) 1)
724 (insert-char (logand (ash int32 -16) 255) 1)
725 (insert-char (logand (ash int32 -8) 255) 1)
726 (insert-char (logand int32 255) 1))
728 (defun comm-format-u16 (uint16)
729 (insert-char (logand (lsh uint16 -8) 255) 1)
730 (insert-char (logand uint16 255) 1))
732 (defun comm-format-u8 (uint8)
733 (insert-char (logand uint8 255) 1))
735 (defun comm-format-truncate-after-null (s)
736 (if (string-match "\0" s)
737 (substring s 0 (match-beginning 0))
740 (defun comm-format-u16-string (s)
741 (if (and (featurep 'xemacs)
742 (coding-system-get egg-fixed-euc 'pre-write-conversion))
743 (let ((fixed-euc egg-fixed-euc))
744 (insert (with-temp-buffer
745 (insert (comm-format-truncate-after-null s))
746 (goto-char (point-min))
747 (funcall (coding-system-get fixed-euc 'pre-write-conversion)
748 (point-min) (point-max))
750 (insert (encode-coding-string (comm-format-truncate-after-null s)
754 (defun comm-format-mb-string (s)
755 (insert (encode-coding-string (comm-format-truncate-after-null s)
759 (defun comm-format-u8-string (s)
760 (insert (comm-format-truncate-after-null s))
763 (defun comm-format-binary-data (s)
764 (insert (encode-coding-string s 'egg-binary))
765 (insert-char ?\377 2))
767 (defun comm-format-fixlen-string (s len)
768 (setq s (comm-format-truncate-after-null s))
769 (insert (if (< (length s) len) s (substring s 0 (1- len))))
770 (insert-char 0 (max (- len (length s)) 1)))
772 (defun comm-format-vector (s len)
774 (insert (if (<= (length s) len) s (substring s 0 len)))
775 (insert-char 0 (- len (length s))))
777 (defmacro comm-format (format &rest args)
778 "Format a string out of a control-list and arguments into the buffer.
779 The formated datas are network byte oder (i.e. big endian)..
780 U: 32-bit integer. The argument is 2 element 16-bit unsigned integer list.
781 u: 32-bit integer. The argument is treat as unsigned integer.
782 (Note: Elisp's integer may be less than 32 bits)
784 (Note: Elisp's integer may be greater than 32 bits)
787 S: 16-bit wide-character EUC string (0x0000 terminated).
788 E: Multibyte EUC string (0x00 terminated).
789 s: 8-bit string (0x00 terminated).
790 B: Binary data (0xff terminated).
791 v: 8-bit vector (no terminator). This takes 2 args (data length).
792 V: Fixed length string (0x00 terminated). This takes 2 args (data length)."
795 (result (list 'progn))
802 (cond ((eq f 'U) (list 'comm-format-u32c arg))
803 ((eq f 'u) (list 'comm-format-u32 arg))
804 ((eq f 'i) (list 'comm-format-i32 arg))
805 ((eq f 'w) (list 'comm-format-u16 arg))
806 ((eq f 'b) (list 'comm-format-u8 arg))
807 ((eq f 'S) (list 'comm-format-u16-string arg))
808 ((eq f 'E) (list 'comm-format-mb-string arg))
809 ((eq f 's) (list 'comm-format-u8-string arg))
810 ((eq f 'B) (list 'comm-format-binary-data arg))
811 ((eq f 'V) (setq p (cdr p))
812 (list 'comm-format-fixlen-string arg (car p)))
813 ((eq f 'v) (setq p (cdr p))
814 (list 'comm-format-vector arg (car p))))))
815 (setq form (cdr form)
818 (error "comm-format %s: arguments mismatch" format))
821 (defvar comm-accept-timeout nil)
823 ;; Assume PROC is bound to the process of current buffer
824 ;; Do not move the point, leave it where it was.
825 (defmacro comm-accept-process-output ()
827 (if (null (accept-process-output proc comm-accept-timeout))
828 (egg-error "backend timeout"))
831 (defmacro comm-require-process-output (n)
832 `(if (< (point-max) (+ (point) ,n))
833 (comm-wait-for-space proc ,n)))
835 (defun comm-wait-for-space (proc n)
838 (while (< (point-max) r)
839 (if (null (accept-process-output proc comm-accept-timeout))
840 (egg-error "backend timeout"))
843 (defmacro comm-following+forward-char ()
848 (defun comm-unpack-u32c ()
850 (comm-require-process-output 4)
851 (list (+ (lsh (comm-following+forward-char) 8)
852 (comm-following+forward-char))
853 (+ (lsh (comm-following+forward-char) 8)
854 (comm-following+forward-char)))))
856 (defun comm-unpack-i32 ()
858 (comm-require-process-output 4)
859 (+ (lsh (- (logxor (comm-following+forward-char) 128) 128) 24)
860 (lsh (comm-following+forward-char) 16)
861 (lsh (comm-following+forward-char) 8)
862 (comm-following+forward-char))))
864 (defun comm-unpack-u32 ()
866 (comm-require-process-output 4)
867 (+ (lsh (comm-following+forward-char) 24)
868 (lsh (comm-following+forward-char) 16)
869 (lsh (comm-following+forward-char) 8)
870 (comm-following+forward-char))))
872 (defun comm-unpack-u16 ()
874 (comm-require-process-output 2)
875 (+ (lsh (comm-following+forward-char) 8)
876 (comm-following+forward-char))))
878 (defun comm-unpack-u8 ()
880 (comm-require-process-output 1)
881 (comm-following+forward-char)))
883 (defun comm-unpack-u16-string ()
884 (let ((start (point)))
885 (while (not (search-forward "\0\0" nil t))
886 (comm-accept-process-output))
887 (if (and (featurep 'xemacs)
888 (coding-system-get egg-fixed-euc 'post-read-conversion))
889 (let ((string (buffer-substring start (- (point) 2)))
890 (fixed-euc egg-fixed-euc))
893 (goto-char (point-min))
894 (funcall (coding-system-get fixed-euc 'post-read-conversion)
897 (decode-coding-string (buffer-substring start (- (point) 2))
900 (defun comm-unpack-mb-string ()
901 (let ((start (point)))
902 (while (not (search-forward "\0" nil t))
903 (comm-accept-process-output))
904 (decode-coding-string (buffer-substring start (1- (point)))
907 (defun comm-unpack-u8-string ()
908 (let ((start (point)))
909 (while (not (search-forward "\0" nil 1))
910 (comm-accept-process-output))
911 (buffer-substring start (1- (point)))))
913 (defun comm-unpack-binary-data ()
914 (let ((start (point)))
915 (while (not (search-forward "\377\377" nil 1))
916 (comm-accept-process-output))
918 (decode-coding-string (buffer-substring start (- (point) 2))
921 (defun comm-unpack-fixlen-string (len)
923 (comm-require-process-output len)
924 (goto-char (+ (point) len))
925 (setq s (buffer-substring (- (point) len) (point)))
926 (if (string-match "\0" s)
927 (setq s (substring s 0 (match-beginning 0))))
930 (defun comm-unpack-vector (len)
932 (comm-require-process-output len)
933 (goto-char (+ (point) len))
934 (buffer-substring (- (point) len) (point))))
936 (defmacro comm-unpack (format &rest args)
937 "Unpack a string out of a control-string and set arguments.
938 See `comm-format' for FORMAT."
941 (result (list 'progn))
948 (cond ((eq f 'U) `(setq ,arg (comm-unpack-u32c)))
949 ((eq f 'u) `(setq ,arg (comm-unpack-u32)))
950 ((eq f 'i) `(setq ,arg (comm-unpack-i32)))
951 ((eq f 'w) `(setq ,arg (comm-unpack-u16)))
952 ((eq f 'b) `(setq ,arg (comm-unpack-u8)))
953 ((eq f 'S) `(setq ,arg (comm-unpack-u16-string)))
954 ((eq f 'E) `(setq ,arg (comm-unpack-mb-string)))
955 ((eq f 's) `(setq ,arg (comm-unpack-u8-string)))
956 ((eq f 'B) `(setq ,arg (comm-unpack-binary-data)))
957 ((eq f 'V) (setq p (cdr p))
958 `(setq ,arg (comm-unpack-fixlen-string ,(car p))))
959 ((eq f 'v) (setq p (cdr p))
960 `(setq ,arg (comm-unpack-vector ,(car p)))))))
961 (setq form (cdr form)
964 (error "comm-unpack %s: arguments mismatch" format))
967 (defmacro comm-call-with-proc (proc vlist send-expr &rest receive-exprs)
969 (and (eq (car-safe (car vlist)) 'zhuyin)
970 '((egg-fixed-euc (nth (if zhuyin 1 0) egg-fixed-euc))))))
972 (buffer (process-buffer proc))
974 (if (and (eq (process-status proc) 'open)
975 (buffer-live-p buffer))
981 (goto-char (point-max))
982 (process-send-region proc (point-min) (point-max))
984 (egg-error "process %s was killed" proc)))))
986 (defmacro comm-call-with-proc-1 (proc vlist send-expr &rest receive-exprs)
990 (goto-char (point-max))
991 (process-send-region proc (point-min) (point-max))
995 ;;; egg-com.el ends here.