1 ;;; egg/wnnrpc.el --- WNN Support (low level interface) in Egg
2 ;;; Input Method Architecture
4 ;; Copyright (C) 1997, 1998 Mule Project, Powered by Electrotechnical
6 ;; Project Leader: Satoru Tomura <tomura@etl.go.jp>
8 ;; Author: NIIBE Yutaka <gniibe@mri.co.jp>
9 ;; KATAYAMA Yoshio <kate@pfu.co.jp> ; Korean, Chinese support.
11 ;; Maintainer: NIIBE Yutaka <gniibe@mri.co.jp>
13 ;; This file will be part of GNU Emacs (in future).
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 ;; (load-library "egg/wnn")
37 (defmacro wnn-const (c)
38 "Macro for WNN constants."
39 (cond ((eq c 'JS_VERSION) 0)
42 ((eq c 'JS_CONNECT) 5)
43 ((eq c 'JS_DISCONNECT) 6)
44 ((eq c 'JS_ENV_EXIST) 7)
45 ((eq c 'JS_ENV_STICKY) 8)
46 ((eq c 'JS_ENV_UNSTICKY) 9)
47 ((eq c 'JS_KANREN) 17)
48 ((eq c 'JS_KANTAN_SHO) 18)
49 ((eq c 'JS_KANZEN_SHO) 19)
50 ((eq c 'JS_KANTAN_DAI) 20)
51 ((eq c 'JS_KANZEN_DAI) 21)
52 ((eq c 'JS_HINDO_SET) 24)
53 ((eq c 'JS_DIC_ADD) 33)
54 ((eq c 'JS_DIC_DELETE) 34)
55 ((eq c 'JS_DIC_USE) 35)
56 ((eq c 'JS_DIC_LIST) 36)
57 ((eq c 'JS_DIC_INFO) 37)
58 ((eq c 'JS_FUZOKUGO_SET) 41)
59 ((eq c 'JS_FUZOKUGO_GET) 48)
60 ((eq c 'JS_WORD_ADD) 49)
61 ((eq c 'JS_WORD_DELETE) 50)
62 ((eq c 'JS_WORD_SEARCH) 51)
63 ((eq c 'JS_WORD_SEARCH_BY_ENV) 52)
64 ((eq c 'JS_WORD_INFO) 53)
65 ((eq c 'JS_WORD_COMMENT_SET) 54)
66 ((eq c 'JS_PARAM_SET) 65)
67 ((eq c 'JS_PARAM_GET) 66)
69 ((eq c 'JS_ACCESS) 82)
71 ((eq c 'JS_ENV_LIST) 85)
72 ((eq c 'JS_FILE_LIST_ALL) 86)
73 ((eq c 'JS_DIC_LIST_ALL) 87)
74 ((eq c 'JS_FILE_READ) 97)
75 ((eq c 'JS_FILE_WRITE) 98)
76 ((eq c 'JS_FILE_SEND) 99)
77 ((eq c 'JS_FILE_RECEIVE) 100)
78 ((eq c 'JS_HINDO_FILE_CREATE) 101)
79 ((eq c 'JS_DIC_FILE_CREATE) 102)
80 ((eq c 'JS_FILE_REMOVE) 103)
81 ((eq c 'JS_FILE_LIST) 104)
82 ((eq c 'JS_FILE_INFO) 105)
83 ((eq c 'JS_FILE_LOADED) 106)
84 ((eq c 'JS_FILE_LOADED_LOCAL) 107)
85 ((eq c 'JS_FILE_DISCARD) 108)
86 ((eq c 'JS_FILE_COMMENT_SET) 109)
87 ((eq c 'JS_FILE_PASSWORD) 110)
88 ((eq c 'JS_FILE_STAT) 111)
90 ((eq c 'JS_HINSI_LIST) 114)
91 ((eq c 'JS_HINSI_NAME) 115)
92 ((eq c 'JS_HINSI_NUMBER) 116)
93 ((eq c 'JS_HINSI_DICTS) 117)
94 ((eq c 'JS_HINSI_TABLE_SET) 118)
96 ((eq c 'JLIB_VERSION) 16387) ; 0x4003
98 ((eq c 'WNN_REV_DICT) 3)
99 ((eq c 'WNN_VECT_NO) -1)
100 ((eq c 'WNN_VECT_BUNSETSU) 2)
101 ((eq c 'WNN_VECT_KANREN) 0)
102 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>3VP2;4fTZ5DWV5d!"5GB<AK
\e(B"
280 "
\e$AV;6A5DF56H!"1d8|AK
\e(B"
281 "
\e$AV86(5D5%WV2;4fTZ
\e(B"
291 "
\e$ADZ4f
\e(Balloc
\e$AJ'0\
\e(B"
300 "
\e$A:COsSP#b#u#g7"Iz
\e(B"
302 "alloc
\e$AJ'0\AK
\e(B"
303 "
\e$A2;D\:M
\e(Bserver
\e$AA,=S
\e(B"
304 "
\e$AM(PE9f3L5D0f1>2;7{
\e(B"
305 "
\e$A2;JG#c#W#n#nSC;'Iz3I5D;7>3
\e(B"
311 "
\e$AWSD?B<2;D\44=(
\e(B"
321 "
\e$AND<~2;D\6AH!
\e(B"
322 "
\e$AND<~2;D\P43v
\e(B"
323 "
\e$A2;JG#c#W#n#nSC;'?I6AH!5DND<~
\e(B"
324 "
\e$ARTIO5DND<~2;D\6AH!
\e(B"
325 "password
\e$A2;6T
\e(B"
326 "
\e$AND<~U}TZ6AH!
\e(B"
327 "
\e$AND<~2;D\O{3}
\e(B"
328 "
\e$AND<~C;SP44=(3v@4
\e(B"
329 "
\e$A2;JG#c#W#n#n5DND<~
\e(B"
330 "
\e$AND<~5D
\e(BI-node
\e$A:M
\e(BFILE_UNIQ
\e$A2;D\R;VB
\e(B"
331 "
\e$A4JPTND<~L+4s
\e(B"
332 "
\e$A4JPTND<~L+4s
\e(B"
333 "
\e$A4JPTND<~2;4fTZ
\e(B"
334 "
\e$A4JPTND<~5DDZH]2;6T
\e(B"
336 "
\e$A4JPTND<~2;D\6AH!
\e(B"
338 "
\e$A4JPT:EBk2;6T
\e(B"
340 "
\e$AUb8v2YWw2;V'3V
\e(B"
341 "password
\e$A5DJdHkND<~2;D\4r?*
\e(B"
342 "uumrc
\e$AND<~2;4fTZ
\e(B"
343 "uumrc
\e$AND<~5DPNJ=4mNs
\e(B"
344 "
\e$ARTIO;7>32;D\44=(
\e(B"
345 "
\e$AUb8v#c#W#n#nSC;'!"6AH!5DND<~C;SP
\e(B"
346 "
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 "Array of WNN error messages. Indexed by error code.")
591 (defun wnnrpc-get-error-message (errno)
592 "Return error message string specified by ERRNO."
593 (let ((msg (cdr (or (assoc egg-default-language wnnrpc-error-message)
594 (assoc its-current-language wnnrpc-error-message)
595 (assoc 'Japanese wnnrpc-error-message)))))
596 (or (and (< errno (length msg)) (aref msg errno))
597 (format "#%d" errno))))
599 (defmacro wnnrpc-call-with-environment (e vlist send-expr &rest receive-exprs)
601 `((proc (wnnenv-get-proc ,e))
602 (env-id (wnnenv-get-env-id ,e))
603 (egg-zhuyin its-zhuyin))
609 (set-buffer (process-buffer proc))
612 (process-send-region proc (point-min) (point-max))
613 (goto-char (prog1 (point) (accept-process-output proc))))
616 (defsubst wnnrpc-test-result-and-get-error (proc result)
617 (if (< result 0) ; Get error # (XXX: Bad protocol)
619 (comm-unpack (u) error)
623 (defun wnnrpc-open (proc myhostname username)
624 "Open the session. Return 0 on success, error code on failure."
625 (comm-call-with-proc proc (result)
626 (comm-format (u u s s)
628 (wnn-const JLIB_VERSION)
630 (comm-unpack (u) result)
631 (wnnrpc-test-result-and-get-error proc result)))
633 (defun wnnrpc-connect (proc envname)
634 "Establish new `connection' and make an environment.
635 Return the identitifation of the environment on success,
636 negate-encoded error code on failure."
637 (comm-call-with-proc proc (result)
638 (comm-format (u s) (wnn-const JS_CONNECT) envname)
639 (comm-unpack (u) result)
640 (wnnrpc-test-result-and-get-error proc result)))
642 (defun wnnrpc-open-file (proc env-id filename)
643 "Open the file FILENAME on the environment ENV-ID on server process PROC.
644 Return file descripter on success, negate-encoded error code on failure."
645 (comm-call-with-proc proc (result)
646 (comm-format (u u s) (wnn-const JS_FILE_READ) env-id filename)
647 (comm-unpack (u) result)
648 (wnnrpc-test-result-and-get-error proc result)))
650 (defun wnnrpc-set-fuzokugo-file (proc env-id fid)
651 "For PROC, on environment ENV-ID,
652 Set Fuzokugo file specified by FID.
653 Return 0 on success, negate-encoded error code on failure."
654 (comm-call-with-proc proc (result)
655 (comm-format (u u i) (wnn-const JS_FUZOKUGO_SET) env-id fid)
656 (comm-unpack (u) result)
657 (wnnrpc-test-result-and-get-error proc result)))
659 (defun wnnrpc-set-dictionary (proc env-id rev dic freq pri dic-mode freq-mode)
660 "Set dictionary on server.
661 Return 0 on success, negate-encoded error code on faiulure."
662 (comm-call-with-proc proc (result)
663 (comm-format (u u i i i u u s s u) (wnn-const JS_DIC_ADD)
667 "" "" ; XXX: No password
669 (comm-unpack (u) result)
670 (wnnrpc-test-result-and-get-error proc result)))
672 (defun wnnrpc-version (proc)
673 "Return the version number of WNN server."
674 (comm-call-with-proc proc (result)
675 (comm-format (u) (wnn-const JS_VERSION))
676 (comm-unpack (u) result)
679 (defun wnnrpc-access (proc env-id mode path)
680 "On the server connected by PROC, check the accessibility of file in
681 the environment ENV-ID. Return 0 when the remote file
682 (dictionary/frequency) of PATH can be accessed in mode MODE. Return
684 (comm-call-with-proc proc (result)
685 (comm-format (u u u s) (wnn-const JS_ACCESS) env-id mode path)
686 (comm-unpack (u) result)
689 (defun wnnrpc-mkdir (proc env-id path)
690 "Create directory specified by PATH."
691 (comm-call-with-proc proc (result)
692 (comm-format (u u s) (wnn-const JS_MKDIR) env-id path)
693 (comm-unpack (u) result)
694 (wnnrpc-test-result-and-get-error proc result)))
696 (defun wnnrpc-create-dictionary (proc env-id dicname)
697 "Create dictionary on server."
698 (comm-call-with-proc proc (result)
699 (comm-format (u u s S s s u) (wnn-const JS_DIC_FILE_CREATE)
700 env-id dicname "" ; XXX: No comment
701 "" "" ; XXX: No passwd
702 (wnn-const WNN_REV_DICT))
703 (comm-unpack (u) result)
704 (wnnrpc-test-result-and-get-error proc result)))
706 (defun wnnrpc-create-frequency (proc env-id freqname dictionary)
707 "Create frequency file on server."
708 (comm-call-with-proc proc (result)
709 (comm-format (u u u s S s) (wnn-const JS_HINDO_FILE_CREATE)
710 env-id dictionary freqname "" ; XXX: No comment
711 "") ; XXX: No password
712 (comm-unpack (u) result)
713 (wnnrpc-test-result-and-get-error proc result)))
715 (defun wnnrpc-discard-file (proc env-id fid)
716 "Discard a file specified by FID. Call this for already-opened file
717 before remove and create new file."
718 (comm-call-with-proc proc (result)
719 (comm-format (u u u) (wnn-const JS_FILE_DISCARD)
721 (comm-unpack (u) result)
722 (wnnrpc-test-result-and-get-error proc result)))
724 (defun wnnrpc-remove-file (proc filename)
726 (comm-call-with-proc proc (result)
727 (comm-format (u s s) (wnn-const JS_FILE_REMOVE) filename "") ; No passwd
728 (comm-unpack (u) result)
729 (wnnrpc-test-result-and-get-error proc result)))
731 (defun wnnrpc-set-conversion-parameters (proc env-id v)
732 "Set conversion parameters."
733 (comm-call-with-proc proc (result)
734 (comm-format (u u i i i i i i i i i i i i i i i i i)
735 (wnn-const JS_PARAM_SET)
737 (aref v 0) (aref v 1) (aref v 2) (aref v 3)
738 (aref v 4) (aref v 5) (aref v 6) (aref v 7)
739 (aref v 8) (aref v 9) (aref v 10) (aref v 11)
740 (aref v 12) (aref v 13) (aref v 14) (aref v 15)
741 (aref v 16) (aref v 17))
742 (comm-unpack (u) result)
743 (wnnrpc-test-result-and-get-error proc result)))
745 (defsubst wnnrpc-receive-sho-bunsetsu-list-sub (e proc number-of-sho-bunsetsu)
748 end start jiritsugo-end dic-no entry freq right-now
749 hinshi status status-backward kangovect evaluation)
750 (while (< i number-of-sho-bunsetsu)
751 (comm-unpack (u u u u u u u u u u u u)
752 end start jiritsugo-end dic-no entry freq right-now
753 hinshi status status-backward kangovect evaluation)
756 (wnn-bunsetsu-create e
757 end start jiritsugo-end dic-no entry freq right-now
758 hinshi status status-backward kangovect evaluation)
763 (defsubst wnnrpc-receive-sho-bunsetsu-list-sub-2 (proc slist)
765 result origin fuzokugo b)
768 (comm-unpack (S S S) result origin fuzokugo)
769 (wnn-bunsetsu-set-converted b result)
770 (wnn-bunsetsu-set-yomi b origin)
771 (wnn-bunsetsu-set-fuzokugo b fuzokugo)
775 (defun wnnrpc-receive-sho-bunsetsu-list (e proc number-of-sho-bunsetsu)
776 (let ((slist (wnnrpc-receive-sho-bunsetsu-list-sub e proc
777 number-of-sho-bunsetsu)))
778 (wnnrpc-receive-sho-bunsetsu-list-sub-2 proc slist)))
780 (defun wnnrpc-renbunsetsu-conversion (e yomi hinshi fuzoku &optional v)
781 "Convert YOMI string into Kanji.
782 HINSHI and FUZOKU are information of preceding bunsetsu."
786 v1 (wnn-const WNN_VECT_KANREN))
787 (setq v0 (wnn-const WNN_VECT_KANREN)
788 v1 (wnn-const WNN_VECT_NO)))
789 (wnnrpc-call-with-environment e (number-of-dai-bunsetsu kanji-length error
790 number-of-sho-bunsetsu dlist)
791 (comm-format (u u S i S i i i) (wnn-const JS_KANREN)
792 env-id yomi hinshi fuzoku v0 v1
793 (wnn-const WNN_VECT_BUNSETSU))
794 (comm-unpack (u) number-of-dai-bunsetsu)
795 (if (< number-of-dai-bunsetsu 0)
797 (comm-unpack (u) error)
798 (error "WNN Error on renbunsetsu conversion: %s"
799 (wnnrpc-get-error-message error)))
800 (comm-unpack (u u) number-of-sho-bunsetsu kanji-length)
801 (setq dlist (cons nil nil))
804 end start count evaluation)
807 (comm-unpack (u u u u) end start count evaluation)
808 (setcar d (vector end start count evaluation))
809 (if (< (setq i (1+ i)) number-of-dai-bunsetsu)
810 (setq d (setcdr d (cons nil nil)))
811 (throw 'break nil))))
813 (wnnrpc-receive-sho-bunsetsu-list e proc
814 number-of-sho-bunsetsu)))))))
816 (defun wnnrpc-get-bunsetsu-candidates (e yomi hinshi fuzoku &optional v)
821 v1 (wnn-const WNN_VECT_KANZEN))
822 (setq v0 (wnn-const WNN_VECT_KANZEN)
823 v1 (wnn-const WNN_VECT_NO)))
824 (wnnrpc-call-with-environment e (number-of-sho-bunsetsu kanji-length slist)
825 (comm-format (u u S i S i i) (wnn-const JS_KANZEN_SHO)
826 env-id yomi hinshi fuzoku v0 v1)
827 (comm-unpack (u) number-of-sho-bunsetsu)
828 (if (< number-of-sho-bunsetsu 0)
830 (comm-unpack (u) error)
831 (error "WNN Error on getting candidates: %s"
832 (wnnrpc-get-error-message error)))
833 (comm-unpack (u) kanji-length)
834 (wnnrpc-receive-sho-bunsetsu-list e proc number-of-sho-bunsetsu)))))
836 (defun wnnrpc-tanbunsetsu-conversion (e yomi hinshi fuzoku &optional v)
841 v1 (wnn-const WNN_VECT_KANTAN))
842 (setq v0 (wnn-const WNN_VECT_KANTAN)
843 v1 (wnn-const WNN_VECT_NO)))
844 (wnnrpc-call-with-environment e (number-of-sho-bunsetsu kanji-length slist)
845 (comm-format (u u S i S i i) (wnn-const JS_KANTAN_SHO)
846 env-id yomi hinshi fuzoku v0 v1)
847 (comm-unpack (u) number-of-sho-bunsetsu)
848 (if (< number-of-sho-bunsetsu 0) ; Get error # (XXX: Bad protocol)
850 (comm-unpack (u) error)
851 (error "WNN Error on tanbunsetsu conversion: %s"
852 (wnnrpc-get-error-message error)))
853 (comm-unpack (u) kanji-length)
854 (wnnrpc-receive-sho-bunsetsu-list e proc number-of-sho-bunsetsu)))))
856 (defun wnnrpc-set-frequency (e dicno entry ima hindo)
858 (wnnrpc-call-with-environment e (result)
859 (comm-format (u u i i i i) (wnn-const JS_HINDO_SET)
860 env-id dicno entry ima hindo)
861 (comm-unpack (u) result)
862 (wnnrpc-test-result-and-get-error proc result)))
864 (defun wnnrpc-close (proc)
866 (comm-call-with-proc proc (result)
867 (comm-format (u) (wnn-const JS_CLOSE))
868 (comm-unpack (u) result)
869 (wnnrpc-test-result-and-get-error proc result)))
871 (defun wnnrpc-env-exist (proc envname)
873 (comm-call-with-proc proc (result)
874 (comm-format (u s) (wnn-const JS_ENV_EXIST) envname)
875 (comm-unpack (u) result)
878 (defun wnnrpc-make-env-sticky (e)
880 (wnnrpc-call-with-environment e (result)
881 (comm-format (u u) (wnn-const JS_ENV_STICKY) env-id)
882 (comm-unpack (u) result)
883 (wnnrpc-test-result-and-get-error proc result)))
885 (defun wnnrpc-make-env-unsticky (e)
887 (wnnrpc-call-with-environment e (result)
888 (comm-format (u u) (wnn-const JS_ENV_UNSTICKY) env-id)
889 (comm-unpack (u) result)
890 (wnnrpc-test-result-and-get-error proc result)))
892 (defun wnnrpc-disconnect (e)
894 (wnnrpc-call-with-environment e (result)
895 (comm-format (u u) (wnn-const JS_DISCONNECT) env-id)
896 (comm-unpack (u) result)
897 (wnnrpc-test-result-and-get-error proc result)))
899 (defun wnnrpc-add-word (e dictionary yomi kanji comment hinshi initial-freq)
901 (wnnrpc-call-with-environment e (result)
902 (comm-format (u u u S S S u u) (wnn-const JS_WORD_ADD)
904 dictionary yomi kanji comment
906 (comm-unpack (u) result)
907 (wnnrpc-test-result-and-get-error proc result)))
909 (defun wnnrpc-get-dictionary-list-with-environment (e)
911 (wnnrpc-call-with-environment e (number-of-dic)
912 (comm-format (u u) (wnn-const JS_DIC_LIST) env-id)
913 (comm-unpack (u) number-of-dic)
914 (if (< number-of-dic 0)
915 (let (error) ; XXX js.c is correct?
916 (comm-unpack (u) error)
917 (error "WNN Error on listing dictionaries: %s"
918 (wnnrpc-get-error-message error)))
919 (wnnrpc-receive-dictionary-list proc number-of-dic))))
921 (defun wnnrpc-receive-dictionary-list (proc number-of-dic)
922 (let (dic-entry dic freq dic-mode freq-mode enable-flag nice
923 rev comment dicname freqname dic-passwd freq-passwd
924 type gosuu dic-local-flag freq-local-flag)
925 (if (= number-of-dic 0)
927 (comm-unpack (u u u u u u u u S s s s s u u u u)
928 dic-entry dic freq dic-mode freq-mode enable-flag nice
929 rev comment dicname freqname dic-passwd freq-passwd
930 type gosuu dic-local-flag freq-local-flag)
932 (vector dic-entry dic freq dic-mode freq-mode enable-flag nice
933 rev comment dicname freqname dic-passwd freq-passwd
934 type gosuu dic-local-flag freq-local-flag)
935 (wnnrpc-receive-dictionary-list proc (1- number-of-dic))))))
937 (defsubst wnndic-get-id (dic)
940 (defsubst wnndic-get-comment (dic)
943 (defsubst wnndic-get-dictname (dic)
946 (defun wnnrpc-get-writable-dictionary-id-list (e)
948 (wnnrpc-call-with-environment e (number-of-dic result)
949 (comm-format (u u i) (wnn-const JS_HINSI_DICTS) env-id -1)
950 (comm-unpack (u) number-of-dic)
951 (if (> number-of-dic 0)
952 (let ((l (cons nil nil))
958 (comm-unpack (u) dic)
960 (if (< (setq i (1+ i)) number-of-dic)
961 (setq l (setcdr l (cons nil nil)))
962 (throw 'break nil))))
964 (if (= number-of-dic 0)
967 (comm-unpack (u) error)
968 (error "WNN Error on listing dictionaries: %s"
969 (wnnrpc-get-error-message error)))))))
971 (defun wnnrpc-get-hinshi-list (e dic name)
973 (wnnrpc-call-with-environment e (number-of-hinshi size result)
974 (comm-format (u u u S) (wnn-const JS_HINSI_LIST) env-id dic name)
975 (comm-unpack (u u) number-of-hinshi size)
976 (if (> number-of-hinshi 0)
977 (let ((l (cons nil nil))
983 (comm-unpack (S) hinshi)
985 (if (< (setq i (1+ i)) number-of-hinshi)
986 (setq l (setcdr l (cons nil nil)))
987 (throw 'break nil))))
989 (if (= number-of-hinshi 0)
992 (comm-unpack (u) error)
993 (error "WNN Error on listing HINSHI: %s"
994 (wnnrpc-get-error-message error)))))))
996 (defun wnnrpc-hinshi-number (proc name)
998 (comm-call-with-proc proc (result)
999 (comm-format (u S) (wnn-const JS_HINSI_NUMBER) name)
1000 (comm-unpack (u) result)
1001 (wnnrpc-test-result-and-get-error proc result)))
1003 (defun wnnrpc-get-conversion-parameters (e)
1005 (wnnrpc-call-with-environment e (result
1006 n nsho p1 p2 p3 p4 p5 p6 p7 p8 p9
1007 p10 p11 p12 p13 p14 p15)
1008 (comm-format (u u) (wnn-const JS_PARAM_GET) env-id)
1009 (comm-unpack (u) result)
1012 (comm-unpack (u) error)
1014 (comm-unpack (u u u u u u u u u u u u u u u u u)
1015 n nsho p1 p2 p3 p4 p5 p6 p7 p8 p9
1016 p10 p11 p12 p13 p14 p15)
1017 (vector n nsho p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15))))
1019 (defun wnnrpc-file-loaded (proc path)
1021 (comm-call-with-proc proc (result)
1022 (comm-format (u s) (wnn-const JS_FILE_LOADED) path)
1023 (comm-unpack (u) result)
1026 (defun wnnrpc-write-file (e fid filename)
1027 (wnnrpc-call-with-environment e (result)
1028 (comm-format (u u u s) (wnn-const JS_FILE_WRITE) env-id fid filename)
1029 (comm-unpack (u) result)
1030 (wnnrpc-test-result-and-get-error proc result)))
1032 (defun wnnrpc-get-fuzokugo-file (e)
1034 (wnnrpc-call-with-environment e (result)
1035 (comm-format (u u u) (wnn-const JS_FUZOKUGO_GET) env-id)
1036 (comm-unpack (u) result)
1037 (wnnrpc-test-result-and-get-error proc result)))
1039 (defsubst wnnrpc-receive-file-list (proc)
1042 number-of-files fid local-flag ref-count type name)
1043 (comm-unpack (u) number-of-files)
1044 (if (< number-of-files 0)
1045 (error "WNN: wnnrpc-receive-file-list")
1046 (while (< i number-of-files)
1047 (comm-unpack (u u u u s) fid local-flag ref-count type name)
1048 (setq flist (cons (vector fid local-flag ref-count type name) flist))
1052 (defun wnnrpc-get-file-list (proc)
1054 (comm-call-with-proc proc (result)
1055 (comm-format (u) (wnn-const JS_FILE_LIST_ALL))
1056 (wnnrpc-receive-file-list proc)))
1058 (defun wnnrpc-get-file-list-with-env (e)
1060 (wnnrpc-call-with-environment e (result)
1061 (comm-format (u u) (wnn-const JS_FILE_LIST) env-id)
1062 (wnnrpc-receive-file-list proc)))
1064 (defun wnnrpc-file-attribute (e path)
1065 "3: dictionary, 4: hindo file, 5: fuzokugo-file"
1066 (wnnrpc-call-with-environment e (result)
1067 (comm-format (u u s) (wnn-const JS_FILE_STAT) env-id path)
1068 (comm-unpack (u) result)
1069 (wnnrpc-test-result-and-get-error proc result)))
1071 (defun wnnrpc-get-file-info (e fid)
1073 (wnnrpc-call-with-environment e (result name local-flag ref-count type)
1074 (comm-format (u u u) (wnn-const JS_FILE_INFO) env-id fid)
1075 (comm-unpack (u) result)
1078 (comm-unpack (u) error)
1080 (comm-unpack (s u u u) name local-flag ref-count type)
1081 (vector name local-flag ref-count type))))
1083 (defun wnnrpc-who (proc)
1085 (comm-call-with-proc proc (number-of-entry w)
1086 (comm-format (u) (wnn-const JS_WHO))
1087 (comm-unpack (u) number-of-entry)
1088 (if (< number-of-entry 0)
1090 (comm-unpack (u) error)
1093 sd username hostname e-array)
1094 (while (< i number-of-entry)
1095 (comm-unpack (u s s) sd username hostname)
1096 (setq e-array (make-vector 32 nil))
1098 (while (< j (wnn-const WNN_MAX_ENV_OF_A_CLIENT))
1102 (setq w (cons (vector sd username hostname e-array) w))
1106 (defun wnnrpc-get-env-list (proc)
1107 (comm-call-with-proc proc (number-of-entry l)
1108 (comm-format (u) (wnn-const JS_ENV_LIST))
1109 (comm-unpack (u) number-of-entry)
1110 (if (< number-of-entry 0)
1112 (comm-unpack (u) error)
1115 env-id env-name ref-count fuzokugo-fid dic-max
1116 dic-array file-array)
1117 (while (< i number-of-entry)
1118 (comm-unpack (u s u u u) env-id env-name ref-count
1119 fuzokugo-fid dic-max)
1120 (setq dic-array (make-vector 30 nil))
1121 (setq file-array (make-vector 60 nil))
1123 (while (< j (wnn-const WNN_MAX_DIC_OF_AN_ENV))
1125 (aset dic-array j d)
1128 (while (< j (wnn-const WNN_MAX_FILE_OF_AN_ENV))
1130 (aset file-array j f)
1132 (setq l (cons (vector env-id env-name ref-count fuzokugo-fid dic-max
1133 dic-array file-array) l))
1137 (defun wnnrpc-kill (proc)
1139 (comm-call-with-proc proc (result)
1140 (comm-format (u) (wnn-const JS_KILL))
1141 (comm-unpack (u) result)
1142 result)) ; XXX: Bad protocol: error?
1144 (defun wnnrpc-delete-dictionary (e dic)
1146 (wnnrpc-call-with-environment e (result)
1147 (comm-format (u u u) (wnn-const JS_DIC_DELETE) env-id dic)
1148 (comm-unpack (u) result)
1149 (wnnrpc-test-result-and-get-error proc result)))
1151 (defun wnnrpc-set-flag-on-dictionary (e dic flag)
1153 (wnnrpc-call-with-environment e (result)
1154 (comm-format (u u u u) (wnn-const JS_DIC_USE) env-id dic flag)
1155 (comm-unpack (u) result)
1156 (wnnrpc-test-result-and-get-error proc result)))
1158 (defun wnnrpc-get-dictionary-list (proc)
1160 (comm-call-with-proc proc (number-of-dic)
1161 (comm-format (u) (wnn-const JS_DIC_LIST_ALL))
1162 (comm-unpack (u) number-of-dic)
1163 (wnnrpc-receive-dictionary-list proc number-of-dic)))
1165 (defun wnnrpc-delete-word (e dic entry)
1167 (wnnrpc-call-with-environment e (result)
1168 (comm-format (u u u u) (wnn-const JS_WORD_DELETE) env-id dic entry)
1169 (comm-unpack (u) result)
1170 (wnnrpc-test-result-and-get-error proc result)))
1172 (defun wnnrpc-receive-word (proc yomi)
1174 dic serial hinshi hindo right-now internal-hindo internal-right-now
1177 (comm-unpack (u) dic)
1180 (comm-unpack (u u u u u u) serial hinshi hindo right-now
1181 internal-hindo internal-right-now)
1182 (setq l (cons (vector dic serial hinshi hindo right-now
1183 internal-hindo internal-right-now
1184 yomi nil nil) l) )))
1188 (comm-unpack (S S) kanji comment)
1189 (aset (car l1) 8 kanji)
1190 (aset (car l1) 9 comment)
1194 (defun wnnrpc-search-word-in-dictionary (e dic yomi)
1196 (wnnrpc-call-with-environment e (c0 c1)
1197 (comm-format (u u u S) (wnn-const JS_WORD_SEARCH) env-id dic yomi)
1198 ;; XXX Bad protocol: error?
1199 (comm-unpack (u u) c0 c1) ; ignored
1200 (wnnrpc-receive-word proc yomi)))
1202 (defun wnnrpc-search-word (e yomi)
1204 (wnnrpc-call-with-environment e (c0 c1)
1205 (comm-format (u u S) (wnn-const JS_WORD_SEARCH_BY_ENV) env-id yomi)
1206 ;; XXX Bad protocol: error?
1207 (comm-unpack (u u) c0 c1) ; ignored
1208 (wnnrpc-receive-word proc yomi)))
1210 (defun wnnrpc-get-word-info (e dic entry)
1212 (wnnrpc-call-with-environment e (result c0 c1 yomi)
1213 (comm-format (u u u u) (wnn-const JS_WORD_INFO) env-id dic entry)
1214 (comm-unpack (u) result)
1217 (comm-unpack (u) error)
1219 (comm-unpack (S) yomi) ; XXX: reversed string
1220 (comm-unpack (u u) c0 c1) ; ignored
1221 (wnnrpc-receive-word proc yomi))))
1223 (defun wnnrpc-set-comment-on-word (e dic entry comment)
1225 (wnnrpc-call-with-environment e (result)
1226 (comm-format (u u u u S) (wnn-const JS_WORD_COMMENT_SET)
1227 env-id dic entry comment)
1228 (comm-unpack (u) result)
1229 (wnnrpc-test-result-and-get-error proc result)))
1231 (defun wnnrpc-get-dictionary-info (e dic)
1233 (wnnrpc-call-with-environment e (result)
1234 (comm-format (u u u) (wnn-const JS_DIC_INFO) env-id dic)
1235 (comm-unpack (u) result)
1238 (comm-unpack (u) error)
1240 (wnnrpc-receive-dictionary-list proc 1))))
1242 (defun wnnrpc-set-file-comment (e fid comment)
1244 (wnnrpc-call-with-environment e (result)
1245 (comm-format (u u u S) (wnn-const JS_FILE_COMMENT_SET) env-id fid comment)
1246 (comm-unpack (u) result)
1247 (wnnrpc-test-result-and-get-error proc result)))
1249 (defun wnnrpc-hinshi-name (proc hinshi)
1251 (comm-call-with-proc proc (result)
1252 (comm-format (u u) (wnn-const JS_HINSI_NAME) hinshi)
1253 (comm-unpack (u) result)
1256 (comm-unpack (u) error)
1258 (comm-unpack (S) result)
1261 ;;; WHICH: 1: DIC, 2: HINDO, 3(0): Both
1262 (defun wnnrpc-set-file-password (e fid which old new)
1264 (wnnrpc-call-with-environment e (result)
1265 (comm-format (u u u u s s) (wnn-const JS_FILE_PASSWORD)
1266 env-id fid which old new)
1267 (comm-unpack (u) result)
1268 (wnnrpc-test-result-and-get-error proc result)))
1270 (defun wnnrpc-set-hinshi-table (e dic hinshi-table)
1272 (wnnrpc-call-with-environment e (result)
1273 (comm-format (u u u S) (wnn-const JS_HINSI_TABLE_SET)
1274 env-id dic hinshi-table)
1275 (comm-unpack (u) result)
1276 (wnnrpc-test-result-and-get-error proc result)))
1278 (defsubst wnnrpc-receive-dai-bunsetsu-list (proc number-of-bunsetsu)
1281 end start number-of-sho-bunsetsu evaluation v)
1282 (while (< i number-of-bunsetsu)
1283 (comm-unpack (u u u u)
1284 end start number-of-sho-bunsetsu evaluation)
1286 (cons (vector end start number-of-sho-bunsetsu evaluation nil)
1289 (setq slist (reverse slist))
1294 (setq result (wnnrpc-receive-sho-bunsetsu-list-sub-2 proc (aref v 2)))
1300 (wnnrpc-receive-sho-bunsetsu-list-sub-2 proc (aref v 4))
1304 (defun wnnrpc-daibunsetsu-conversion (e yomi hinshi fuzoku &optional v)
1309 v1 (wnn-const WNN_VECT_KANTAN))
1310 (setq v0 (wnn-const WNN_VECT_KANTAN)
1311 v1 (wnn-const WNN_VECT_NO)))
1312 (wnnrpc-call-with-environment e (number-of-bunsetsu sho-size kanji-size)
1313 (comm-format (u u S i S i i) (wnn-const JS_KANTAN_DAI)
1314 env-id yomi hinshi fuzoku v0 v1)
1315 (comm-unpack (u) number-of-bunsetsu)
1316 (if (< number-of-bunsetsu 0) ; Get error # (XXX: Bad protocol)
1318 (comm-unpack (u) error)
1319 (error "WNN Error on daibunsetsu conversion: %s"
1320 (wnnrpc-get-error-message error)))
1321 (comm-unpack (u u) sho-size kanji-size)
1322 (wnnrpc-receive-dai-bunsetsu-list proc number-of-bunsetsu)))))
1324 (defun wnnrpc-get-daibunsetsu-candidate (e yomi hinshi fuzoku &optional v)
1329 v1 (wnn-const WNN_VECT_KANZEN))
1330 (setq v0 (wnn-const WNN_VECT_KANZEN)
1331 v1 (wnn-const WNN_VECT_NO)))
1332 (wnnrpc-call-with-environment e (number-of-bunsetsu sho-size kanji-size)
1333 (comm-format (u u S i S i i) (wnn-const JS_KANZEN_DAI)
1334 env-id yomi hinshi fuzoku v0 v1)
1335 (comm-unpack (u) number-of-bunsetsu)
1336 (if (< number-of-bunsetsu 0) ; Get error # (XXX: Bad protocol)
1338 (comm-unpack (u) error)
1339 (error "WNN Error on daibunsetsu conversion: %s"
1340 (wnnrpc-get-error-message error)))
1341 (comm-unpack (u u) sho-size kanji-size)
1342 (wnnrpc-receive-dai-bunsetsu-list proc number-of-bunsetsu)))))
1344 ;; XXX: NIY: check in the file contents
1346 (defun wnnrpc-local-file-loaded (proc path)
1348 (let ((attr (file-attributes path)))
1349 (let ((time (cons (car (nth 6 attr)) (car (cdr (nth 6 attr)))))
1350 (inode (nth 10 attr))
1354 (concat (system-name)
1355 "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0") 0 16)))
1356 (comm-call-with-proc proc (result)
1357 (comm-format (u U U U s) (wnn-const JS_FILE_LOADED_LOCAL)
1358 time dev inode padded-hostname)
1359 (comm-unpack (u) result)
1362 (defun wnnrpc-file-receive (e fid local-filename)
1364 (wnnrpc-call-with-environment e (filename)
1365 (comm-format (u u u) (wnn-const JS_FILE_RECEIVE)
1367 (comm-unpack (s) filename)
1368 (if (null local-filename)
1369 (setq local-filename (substring filename
1370 (1+ (string-match "!" filename)))))
1371 (wnnrpc-file-receive-sub proc local-filename)))
1373 (defun wnnrpc-file-receive-sub (proc local-filename)
1374 ;; XXX check file header
1375 (let ((attr (file-attributes local-filename)))
1376 (let ((time (cons (car (nth 6 attr)) (car (cdr (nth 6 attr)))))
1377 (inode (nth 10 attr))
1381 (concat (system-name)
1382 "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0") 0 16)))
1383 (comm-call-with-proc-1 proc (result)
1384 (comm-format (u U U U s) 0 ; ACK
1385 time dev inode padded-hostname)
1386 (comm-unpack (s) result)
1389 (comm-unpack (u) error)
1393 ((or (= result 1) (= result 3) (= result 2))
1394 ;; XXX distingush creation...
1395 (comm-call-with-proc-1 proc (contents result)
1396 (comm-format (u) 0) ; ACK
1397 (comm-unpack (B u) contents result)
1398 ;; XXX XXXXXXXXXXXXXXXXX save the contents...
1399 (wnnrpc-test-result-and-get-error proc result))))))))
1401 (defun wnnrpc-file-send (e filename)
1403 (wnnrpc-call-with-environment e (result)
1404 (comm-format (u u U U U s) (wnn-const JS_FILE_SEND)
1405 env-id time dev inode padded-hostname)
1406 (comm-unpack (u) result)
1409 (comm-unpack (u) result)
1412 (comm-unpack (u) error)
1415 (comm-unpack (u) result)
1418 (comm-unpack (u) error)
1420 (let ((path (concat (system-name) "!" filename)))
1421 (wnnrpc-send-file-sub proc path))))))
1423 (defun wnnrpc-send-file-sub (proc path)
1424 (comm-call-with-proc-1 proc (result)
1426 (comm-format (s) path)
1427 ;; XXXXXXXXXXXXXX send the contents of file...
1430 (comm-format (b b) 255 0)
1431 (comm-format (b) c)))
1432 (comm-format (b b) 255 255))
1433 (comm-unpack (u) result)
1434 (wnnrpc-test-result-and-get-error proc result)))
1436 (defun wnnrpc-file-remove-client ()
1439 (defun wnnrpc-dic-file-create-client ()
1442 (defun wnnrpc-hindo-file-create-client ()
1446 ;;; egg/wnnrpc.el ends here.