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 (or (assoc egg-default-language wnnrpc-error-message)
594 (assoc its-current-language wnnrpc-error-message)
595 (assoc "Japanese" wnnrpc-error-message))))
596 (or (aref (cdr msg) errno) (format "#%d" errno))))
598 (defmacro wnnrpc-call-with-environment (e vlist send-expr &rest receive-exprs)
600 `((proc (wnnenv-get-proc ,e))
601 (env-id (wnnenv-get-env-id ,e))
602 (egg-zhuyin its-zhuyin))
608 (set-buffer (process-buffer proc))
611 (process-send-region proc (point-min) (point-max))
612 (goto-char (prog1 (point) (accept-process-output proc))))
615 (defsubst wnnrpc-test-result-and-get-error (proc result)
616 (if (< result 0) ; Get error # (XXX: Bad protocol)
618 (comm-unpack (u) error)
622 (defun wnnrpc-open (proc myhostname username)
623 "Open the session. Return 0 on success, error code on failure."
624 (comm-call-with-proc proc (result)
625 (comm-format (u u s s)
627 (wnn-const JLIB_VERSION)
629 (comm-unpack (u) result)
630 (wnnrpc-test-result-and-get-error proc result)))
632 (defun wnnrpc-connect (proc envname)
633 "Establish new `connection' and make an environment.
634 Return the identitifation of the environment on success,
635 negate-encoded error code on failure."
636 (comm-call-with-proc proc (result)
637 (comm-format (u s) (wnn-const JS_CONNECT) envname)
638 (comm-unpack (u) result)
639 (wnnrpc-test-result-and-get-error proc result)))
641 (defun wnnrpc-open-file (proc env-id filename)
642 "Open the file FILENAME on the environment ENV-ID on server process PROC.
643 Return file descripter on success, negate-encoded error code on failure."
644 (comm-call-with-proc proc (result)
645 (comm-format (u u s) (wnn-const JS_FILE_READ) env-id filename)
646 (comm-unpack (u) result)
647 (wnnrpc-test-result-and-get-error proc result)))
649 (defun wnnrpc-set-fuzokugo-file (proc env-id fid)
650 "For PROC, on environment ENV-ID,
651 Set Fuzokugo file specified by FID.
652 Return 0 on success, negate-encoded error code on failure."
653 (comm-call-with-proc proc (result)
654 (comm-format (u u i) (wnn-const JS_FUZOKUGO_SET) env-id fid)
655 (comm-unpack (u) result)
656 (wnnrpc-test-result-and-get-error proc result)))
658 (defun wnnrpc-set-dictionary (proc env-id rev dic freq pri dic-mode freq-mode)
659 "Set dictionary on server.
660 Return 0 on success, negate-encoded error code on faiulure."
661 (comm-call-with-proc proc (result)
662 (comm-format (u u i i i u u s s u) (wnn-const JS_DIC_ADD)
666 "" "" ; XXX: No password
668 (comm-unpack (u) result)
669 (wnnrpc-test-result-and-get-error proc result)))
671 (defun wnnrpc-version (proc)
672 "Return the version number of WNN server."
673 (comm-call-with-proc proc (result)
674 (comm-format (u) (wnn-const JS_VERSION))
675 (comm-unpack (u) result)
678 (defun wnnrpc-access (proc env-id mode path)
679 "On the server connected by PROC, check the accessibility of file in
680 the environment ENV-ID. Return 0 when the remote file
681 (dictionary/frequency) of PATH can be accessed in mode MODE. Return
683 (comm-call-with-proc proc (result)
684 (comm-format (u u u s) (wnn-const JS_ACCESS) env-id mode path)
685 (comm-unpack (u) result)
688 (defun wnnrpc-mkdir (proc env-id path)
689 "Create directory specified by PATH."
690 (comm-call-with-proc proc (result)
691 (comm-format (u u s) (wnn-const JS_MKDIR) env-id path)
692 (comm-unpack (u) result)
693 (wnnrpc-test-result-and-get-error proc result)))
695 (defun wnnrpc-create-dictionary (proc env-id dicname)
696 "Create dictionary on server."
697 (comm-call-with-proc proc (result)
698 (comm-format (u u s S s s u) (wnn-const JS_DIC_FILE_CREATE)
699 env-id dicname "" ; XXX: No comment
700 "" "" ; XXX: No passwd
701 (wnn-const WNN_REV_DICT))
702 (comm-unpack (u) result)
703 (wnnrpc-test-result-and-get-error proc result)))
705 (defun wnnrpc-create-frequency (proc env-id freqname dictionary)
706 "Create frequency file on server."
707 (comm-call-with-proc proc (result)
708 (comm-format (u u u s S s) (wnn-const JS_HINDO_FILE_CREATE)
709 env-id dictionary freqname "" ; XXX: No comment
710 "") ; XXX: No password
711 (comm-unpack (u) result)
712 (wnnrpc-test-result-and-get-error proc result)))
714 (defun wnnrpc-discard-file (proc env-id fid)
715 "Discard a file specified by FID. Call this for already-opened file
716 before remove and create new file."
717 (comm-call-with-proc proc (result)
718 (comm-format (u u u) (wnn-const JS_FILE_DISCARD)
720 (comm-unpack (u) result)
721 (wnnrpc-test-result-and-get-error proc result)))
723 (defun wnnrpc-remove-file (proc filename)
725 (comm-call-with-proc proc (result)
726 (comm-format (u s s) (wnn-const JS_FILE_REMOVE) filename "") ; No passwd
727 (comm-unpack (u) result)
728 (wnnrpc-test-result-and-get-error proc result)))
730 (defun wnnrpc-set-conversion-parameters (proc env-id v)
731 "Set conversion parameters."
732 (comm-call-with-proc proc (result)
733 (comm-format (u u i i i i i i i i i i i i i i i i i)
734 (wnn-const JS_PARAM_SET)
736 (aref v 0) (aref v 1) (aref v 2) (aref v 3)
737 (aref v 4) (aref v 5) (aref v 6) (aref v 7)
738 (aref v 8) (aref v 9) (aref v 10) (aref v 11)
739 (aref v 12) (aref v 13) (aref v 14) (aref v 15)
740 (aref v 16) (aref v 17))
741 (comm-unpack (u) result)
742 (wnnrpc-test-result-and-get-error proc result)))
744 (defsubst wnnrpc-receive-sho-bunsetsu-list-sub (e proc number-of-sho-bunsetsu)
747 end start jiritsugo-end dic-no entry freq right-now
748 hinshi status status-backward kangovect evaluation)
749 (while (< i number-of-sho-bunsetsu)
750 (comm-unpack (u u u u u u u u u u u u)
751 end start jiritsugo-end dic-no entry freq right-now
752 hinshi status status-backward kangovect evaluation)
755 (wnn-bunsetsu-create e
756 end start jiritsugo-end dic-no entry freq right-now
757 hinshi status status-backward kangovect evaluation)
762 (defsubst wnnrpc-receive-sho-bunsetsu-list-sub-2 (proc slist)
764 result origin fuzokugo b)
767 (comm-unpack (S S S) result origin fuzokugo)
768 (wnn-bunsetsu-set-converted b result)
769 (wnn-bunsetsu-set-yomi b origin)
770 (wnn-bunsetsu-set-fuzokugo b fuzokugo)
774 (defun wnnrpc-receive-sho-bunsetsu-list (e proc number-of-sho-bunsetsu)
775 (let ((slist (wnnrpc-receive-sho-bunsetsu-list-sub e proc
776 number-of-sho-bunsetsu)))
777 (wnnrpc-receive-sho-bunsetsu-list-sub-2 proc slist)))
779 (defun wnnrpc-renbunsetsu-conversion (e yomi hinshi fuzoku &optional v)
780 "Convert YOMI string into Kanji.
781 HINSHI and FUZOKU are information of preceding bunsetsu."
785 v1 (wnn-const WNN_VECT_KANREN))
786 (setq v0 (wnn-const WNN_VECT_KANREN)
787 v1 (wnn-const WNN_VECT_NO)))
788 (wnnrpc-call-with-environment e (number-of-dai-bunsetsu kanji-length error
789 number-of-sho-bunsetsu dlist)
790 (comm-format (u u S i S i i i) (wnn-const JS_KANREN)
791 env-id yomi hinshi fuzoku v0 v1
792 (wnn-const WNN_VECT_BUNSETSU))
793 (comm-unpack (u) number-of-dai-bunsetsu)
794 (if (< number-of-dai-bunsetsu 0)
796 (comm-unpack (u) error)
797 (error "WNN Error on renbunsetsu conversion: %s"
798 (wnnrpc-get-error-message error)))
799 (comm-unpack (u u) number-of-sho-bunsetsu kanji-length)
800 (setq dlist (cons nil nil))
803 end start count evaluation)
806 (comm-unpack (u u u u) end start count evaluation)
807 (setcar d (vector end start count evaluation))
808 (if (< (setq i (1+ i)) number-of-dai-bunsetsu)
809 (setq d (setcdr d (cons nil nil)))
810 (throw 'break nil))))
812 (wnnrpc-receive-sho-bunsetsu-list e proc
813 number-of-sho-bunsetsu)))))))
815 (defun wnnrpc-get-bunsetsu-candidates (e yomi hinshi fuzoku &optional v)
820 v1 (wnn-const WNN_VECT_KANZEN))
821 (setq v0 (wnn-const WNN_VECT_KANZEN)
822 v1 (wnn-const WNN_VECT_NO)))
823 (wnnrpc-call-with-environment e (number-of-sho-bunsetsu kanji-length slist)
824 (comm-format (u u S i S i i) (wnn-const JS_KANZEN_SHO)
825 env-id yomi hinshi fuzoku v0 v1)
826 (comm-unpack (u) number-of-sho-bunsetsu)
827 (if (< number-of-sho-bunsetsu 0)
829 (comm-unpack (u) error)
830 (error "WNN Error on getting candidates: %s"
831 (wnnrpc-get-error-message error)))
832 (comm-unpack (u) kanji-length)
833 (wnnrpc-receive-sho-bunsetsu-list e proc number-of-sho-bunsetsu)))))
835 (defun wnnrpc-tanbunsetsu-conversion (e yomi hinshi fuzoku &optional v)
840 v1 (wnn-const WNN_VECT_KANTAN))
841 (setq v0 (wnn-const WNN_VECT_KANTAN)
842 v1 (wnn-const WNN_VECT_NO)))
843 (wnnrpc-call-with-environment e (number-of-sho-bunsetsu kanji-length slist)
844 (comm-format (u u S i S i i) (wnn-const JS_KANTAN_SHO)
845 env-id yomi hinshi fuzoku v0 v1)
846 (comm-unpack (u) number-of-sho-bunsetsu)
847 (if (< number-of-sho-bunsetsu 0) ; Get error # (XXX: Bad protocol)
849 (comm-unpack (u) error)
850 (error "WNN Error on tanbunsetsu conversion: %s"
851 (wnnrpc-get-error-message error)))
852 (comm-unpack (u) kanji-length)
853 (wnnrpc-receive-sho-bunsetsu-list e proc number-of-sho-bunsetsu)))))
855 (defun wnnrpc-set-frequency (e dicno entry ima hindo)
857 (wnnrpc-call-with-environment e (result)
858 (comm-format (u u i i i i) (wnn-const JS_HINDO_SET)
859 env-id dicno entry ima hindo)
860 (comm-unpack (u) result)
861 (wnnrpc-test-result-and-get-error proc result)))
863 (defun wnnrpc-close (proc)
865 (comm-call-with-proc proc (result)
866 (comm-format (u) (wnn-const JS_CLOSE))
867 (comm-unpack (u) result)
868 (wnnrpc-test-result-and-get-error proc result)))
870 (defun wnnrpc-env-exist (proc envname)
872 (comm-call-with-proc proc (result)
873 (comm-format (u s) (wnn-const JS_ENV_EXIST) envname)
874 (comm-unpack (u) result)
877 (defun wnnrpc-make-env-sticky (e)
879 (wnnrpc-call-with-environment e (result)
880 (comm-format (u u) (wnn-const JS_ENV_STICKY) env-id)
881 (comm-unpack (u) result)
882 (wnnrpc-test-result-and-get-error proc result)))
884 (defun wnnrpc-make-env-unsticky (e)
886 (wnnrpc-call-with-environment e (result)
887 (comm-format (u u) (wnn-const JS_ENV_UNSTICKY) env-id)
888 (comm-unpack (u) result)
889 (wnnrpc-test-result-and-get-error proc result)))
891 (defun wnnrpc-disconnect (e)
893 (wnnrpc-call-with-environment e (result)
894 (comm-format (u u) (wnn-const JS_DISCONNECT) env-id)
895 (comm-unpack (u) result)
896 (wnnrpc-test-result-and-get-error proc result)))
898 (defun wnnrpc-add-word (e dictionary yomi kanji comment hinshi initial-freq)
900 (wnnrpc-call-with-environment e (result)
901 (comm-format (u u u S S S u u) (wnn-const JS_WORD_ADD)
903 dictionary yomi kanji comment
905 (comm-unpack (u) result)
906 (wnnrpc-test-result-and-get-error proc result)))
908 (defun wnnrpc-get-dictionary-list-with-environment (e)
910 (wnnrpc-call-with-environment e (number-of-dic)
911 (comm-format (u u) (wnn-const JS_DIC_LIST) env-id)
912 (comm-unpack (u) number-of-dic)
913 (if (< number-of-dic 0)
914 (let (error) ; XXX js.c is correct?
915 (comm-unpack (u) error)
916 (error "WNN Error on listing dictionaries: %s"
917 (wnnrpc-get-error-message error)))
918 (wnnrpc-receive-dictionary-list proc number-of-dic))))
920 (defun wnnrpc-receive-dictionary-list (proc number-of-dic)
921 (let (dic-entry dic freq dic-mode freq-mode enable-flag nice
922 rev comment dicname freqname dic-passwd freq-passwd
923 type gosuu dic-local-flag freq-local-flag)
924 (if (= number-of-dic 0)
926 (comm-unpack (u u u u u u u u S s s s s u u u u)
927 dic-entry dic freq dic-mode freq-mode enable-flag nice
928 rev comment dicname freqname dic-passwd freq-passwd
929 type gosuu dic-local-flag freq-local-flag)
931 (vector dic-entry dic freq dic-mode freq-mode enable-flag nice
932 rev comment dicname freqname dic-passwd freq-passwd
933 type gosuu dic-local-flag freq-local-flag)
934 (wnnrpc-receive-dictionary-list proc (1- number-of-dic))))))
936 (defsubst wnndic-get-id (dic)
939 (defsubst wnndic-get-comment (dic)
942 (defsubst wnndic-get-dictname (dic)
945 (defun wnnrpc-get-writable-dictionary-id-list (e)
947 (wnnrpc-call-with-environment e (number-of-dic result)
948 (comm-format (u u i) (wnn-const JS_HINSI_DICTS) env-id -1)
949 (comm-unpack (u) number-of-dic)
950 (if (> number-of-dic 0)
951 (let ((l (cons nil nil))
957 (comm-unpack (u) dic)
959 (if (< (setq i (1+ i)) number-of-dic)
960 (setq l (setcdr l (cons nil nil)))
961 (throw 'break nil))))
963 (if (= number-of-dic 0)
966 (comm-unpack (u) error)
967 (error "WNN Error on listing dictionaries: %s"
968 (wnnrpc-get-error-message error)))))))
970 (defun wnnrpc-get-hinshi-list (e dic name)
972 (wnnrpc-call-with-environment e (number-of-hinshi size result)
973 (comm-format (u u u S) (wnn-const JS_HINSI_LIST) env-id dic name)
974 (comm-unpack (u u) number-of-hinshi size)
975 (if (> number-of-hinshi 0)
976 (let ((l (cons nil nil))
982 (comm-unpack (S) hinshi)
984 (if (< (setq i (1+ i)) number-of-hinshi)
985 (setq l (setcdr l (cons nil nil)))
986 (throw 'break nil))))
988 (if (= number-of-hinshi 0)
991 (comm-unpack (u) error)
992 (error "WNN Error on listing HINSHI: %s"
993 (wnnrpc-get-error-message error)))))))
995 (defun wnnrpc-hinshi-number (proc name)
997 (comm-call-with-proc proc (result)
998 (comm-format (u S) (wnn-const JS_HINSI_NUMBER) name)
999 (comm-unpack (u) result)
1000 (wnnrpc-test-result-and-get-error proc result)))
1002 (defun wnnrpc-get-conversion-parameters (e)
1004 (wnnrpc-call-with-environment e (result
1005 n nsho p1 p2 p3 p4 p5 p6 p7 p8 p9
1006 p10 p11 p12 p13 p14 p15)
1007 (comm-format (u u) (wnn-const JS_PARAM_GET) env-id)
1008 (comm-unpack (u) result)
1011 (comm-unpack (u) error)
1013 (comm-unpack (u u u u u u u u u u u u u u u u u)
1014 n nsho p1 p2 p3 p4 p5 p6 p7 p8 p9
1015 p10 p11 p12 p13 p14 p15)
1016 (vector n nsho p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15))))
1018 (defun wnnrpc-file-loaded (proc path)
1020 (comm-call-with-proc proc (result)
1021 (comm-format (u s) (wnn-const JS_FILE_LOADED) path)
1022 (comm-unpack (u) result)
1025 (defun wnnrpc-write-file (e fid filename)
1026 (wnnrpc-call-with-environment e (result)
1027 (comm-format (u u u s) (wnn-const JS_FILE_WRITE) env-id fid filename)
1028 (comm-unpack (u) result)
1029 (wnnrpc-test-result-and-get-error proc result)))
1031 (defun wnnrpc-get-fuzokugo-file (e)
1033 (wnnrpc-call-with-environment e (result)
1034 (comm-format (u u u) (wnn-const JS_FUZOKUGO_GET) env-id)
1035 (comm-unpack (u) result)
1036 (wnnrpc-test-result-and-get-error proc result)))
1038 (defsubst wnnrpc-receive-file-list (proc)
1041 number-of-files fid local-flag ref-count type name)
1042 (comm-unpack (u) number-of-files)
1043 (if (< number-of-files 0)
1044 (error "WNN: wnnrpc-receive-file-list")
1045 (while (< i number-of-files)
1046 (comm-unpack (u u u u s) fid local-flag ref-count type name)
1047 (setq flist (cons (vector fid local-flag ref-count type name) flist))
1051 (defun wnnrpc-get-file-list (proc)
1053 (comm-call-with-proc proc (result)
1054 (comm-format (u) (wnn-const JS_FILE_LIST_ALL))
1055 (wnnrpc-receive-file-list proc)))
1057 (defun wnnrpc-get-file-list-with-env (e)
1059 (wnnrpc-call-with-environment e (result)
1060 (comm-format (u u) (wnn-const JS_FILE_LIST) env-id)
1061 (wnnrpc-receive-file-list proc)))
1063 (defun wnnrpc-file-attribute (e path)
1064 "3: dictionary, 4: hindo file, 5: fuzokugo-file"
1065 (wnnrpc-call-with-environment e (result)
1066 (comm-format (u u s) (wnn-const JS_FILE_STAT) env-id path)
1067 (comm-unpack (u) result)
1068 (wnnrpc-test-result-and-get-error proc result)))
1070 (defun wnnrpc-get-file-info (e fid)
1072 (wnnrpc-call-with-environment e (result name local-flag ref-count type)
1073 (comm-format (u u u) (wnn-const JS_FILE_INFO) env-id fid)
1074 (comm-unpack (u) result)
1077 (comm-unpack (u) error)
1079 (comm-unpack (s u u u) name local-flag ref-count type)
1080 (vector name local-flag ref-count type))))
1082 (defun wnnrpc-who (proc)
1084 (comm-call-with-proc proc (number-of-entry w)
1085 (comm-format (u) (wnn-const JS_WHO))
1086 (comm-unpack (u) number-of-entry)
1087 (if (< number-of-entry 0)
1089 (comm-unpack (u) error)
1092 sd username hostname e-array)
1093 (while (< i number-of-entry)
1094 (comm-unpack (u s s) sd username hostname)
1095 (setq e-array (make-vector 32 nil))
1097 (while (< j (wnn-const WNN_MAX_ENV_OF_A_CLIENT))
1101 (setq w (cons (vector sd username hostname e-array) w))
1105 (defun wnnrpc-get-env-list (proc)
1106 (comm-call-with-proc proc (number-of-entry l)
1107 (comm-format (u) (wnn-const JS_ENV_LIST))
1108 (comm-unpack (u) number-of-entry)
1109 (if (< number-of-entry 0)
1111 (comm-unpack (u) error)
1114 env-id env-name ref-count fuzokugo-fid dic-max
1115 dic-array file-array)
1116 (while (< i number-of-entry)
1117 (comm-unpack (u s u u u) env-id env-name ref-count
1118 fuzokugo-fid dic-max)
1119 (setq dic-array (make-vector 30 nil))
1120 (setq file-array (make-vector 60 nil))
1122 (while (< j (wnn-const WNN_MAX_DIC_OF_AN_ENV))
1124 (aset dic-array j d)
1127 (while (< j (wnn-const WNN_MAX_FILE_OF_AN_ENV))
1129 (aset file-array j f)
1131 (setq l (cons (vector env-id env-name ref-count fuzokugo-fid dic-max
1132 dic-array file-array) l))
1136 (defun wnnrpc-kill (proc)
1138 (comm-call-with-proc proc (result)
1139 (comm-format (u) (wnn-const JS_KILL))
1140 (comm-unpack (u) result)
1141 result)) ; XXX: Bad protocol: error?
1143 (defun wnnrpc-delete-dictionary (e dic)
1145 (wnnrpc-call-with-environment e (result)
1146 (comm-format (u u u) (wnn-const JS_DIC_DELETE) env-id dic)
1147 (comm-unpack (u) result)
1148 (wnnrpc-test-result-and-get-error proc result)))
1150 (defun wnnrpc-set-flag-on-dictionary (e dic flag)
1152 (wnnrpc-call-with-environment e (result)
1153 (comm-format (u u u u) (wnn-const JS_DIC_USE) env-id dic flag)
1154 (comm-unpack (u) result)
1155 (wnnrpc-test-result-and-get-error proc result)))
1157 (defun wnnrpc-get-dictionary-list (proc)
1159 (comm-call-with-proc proc (number-of-dic)
1160 (comm-format (u) (wnn-const JS_DIC_LIST_ALL))
1161 (comm-unpack (u) number-of-dic)
1162 (wnnrpc-receive-dictionary-list proc number-of-dic)))
1164 (defun wnnrpc-delete-word (e dic entry)
1166 (wnnrpc-call-with-environment e (result)
1167 (comm-format (u u u u) (wnn-const JS_WORD_DELETE) env-id dic entry)
1168 (comm-unpack (u) result)
1169 (wnnrpc-test-result-and-get-error proc result)))
1171 (defun wnnrpc-receive-word (proc yomi)
1173 dic serial hinshi hindo right-now internal-hindo internal-right-now
1176 (comm-unpack (u) dic)
1179 (comm-unpack (u u u u u u) serial hinshi hindo right-now
1180 internal-hindo internal-right-now)
1181 (setq l (cons (vector dic serial hinshi hindo right-now
1182 internal-hindo internal-right-now
1183 yomi nil nil) l) )))
1187 (comm-unpack (S S) kanji comment)
1188 (aset (car l1) 8 kanji)
1189 (aset (car l1) 9 comment)
1193 (defun wnnrpc-search-word-in-dictionary (e dic yomi)
1195 (wnnrpc-call-with-environment e (c0 c1)
1196 (comm-format (u u u S) (wnn-const JS_WORD_SEARCH) env-id dic yomi)
1197 ;; XXX Bad protocol: error?
1198 (comm-unpack (u u) c0 c1) ; ignored
1199 (wnnrpc-receive-word proc yomi)))
1201 (defun wnnrpc-search-word (e yomi)
1203 (wnnrpc-call-with-environment e (c0 c1)
1204 (comm-format (u u S) (wnn-const JS_WORD_SEARCH_BY_ENV) env-id yomi)
1205 ;; XXX Bad protocol: error?
1206 (comm-unpack (u u) c0 c1) ; ignored
1207 (wnnrpc-receive-word proc yomi)))
1209 (defun wnnrpc-get-word-info (e dic entry)
1211 (wnnrpc-call-with-environment e (result c0 c1 yomi)
1212 (comm-format (u u u u) (wnn-const JS_WORD_INFO) env-id dic entry)
1213 (comm-unpack (u) result)
1216 (comm-unpack (u) error)
1218 (comm-unpack (S) yomi) ; XXX: reversed string
1219 (comm-unpack (u u) c0 c1) ; ignored
1220 (wnnrpc-receive-word proc yomi))))
1222 (defun wnnrpc-set-comment-on-word (e dic entry comment)
1224 (wnnrpc-call-with-environment e (result)
1225 (comm-format (u u u u S) (wnn-const JS_WORD_COMMENT_SET)
1226 env-id dic entry comment)
1227 (comm-unpack (u) result)
1228 (wnnrpc-test-result-and-get-error proc result)))
1230 (defun wnnrpc-get-dictionary-info (e dic)
1232 (wnnrpc-call-with-environment e (result)
1233 (comm-format (u u u) (wnn-const JS_DIC_INFO) env-id dic)
1234 (comm-unpack (u) result)
1237 (comm-unpack (u) error)
1239 (wnnrpc-receive-dictionary-list proc 1))))
1241 (defun wnnrpc-set-file-comment (e fid comment)
1243 (wnnrpc-call-with-environment e (result)
1244 (comm-format (u u u S) (wnn-const JS_FILE_COMMENT_SET) env-id fid comment)
1245 (comm-unpack (u) result)
1246 (wnnrpc-test-result-and-get-error proc result)))
1248 (defun wnnrpc-hinshi-name (proc hinshi)
1250 (comm-call-with-proc proc (result)
1251 (comm-format (u u) (wnn-const JS_HINSI_NAME) hinshi)
1252 (comm-unpack (u) result)
1255 (comm-unpack (u) error)
1257 (comm-unpack (S) result)
1260 ;;; WHICH: 1: DIC, 2: HINDO, 3(0): Both
1261 (defun wnnrpc-set-file-password (e fid which old new)
1263 (wnnrpc-call-with-environment e (result)
1264 (comm-format (u u u u s s) (wnn-const JS_FILE_PASSWORD)
1265 env-id fid which old new)
1266 (comm-unpack (u) result)
1267 (wnnrpc-test-result-and-get-error proc result)))
1269 (defun wnnrpc-set-hinshi-table (e dic hinshi-table)
1271 (wnnrpc-call-with-environment e (result)
1272 (comm-format (u u u S) (wnn-const JS_HINSI_TABLE_SET)
1273 env-id dic hinshi-table)
1274 (comm-unpack (u) result)
1275 (wnnrpc-test-result-and-get-error proc result)))
1277 (defsubst wnnrpc-receive-dai-bunsetsu-list (proc number-of-bunsetsu)
1280 end start number-of-sho-bunsetsu evaluation v)
1281 (while (< i number-of-bunsetsu)
1282 (comm-unpack (u u u u)
1283 end start number-of-sho-bunsetsu evaluation)
1285 (cons (vector end start number-of-sho-bunsetsu evaluation nil)
1288 (setq slist (reverse slist))
1293 (setq result (wnnrpc-receive-sho-bunsetsu-list-sub-2 proc (aref v 2)))
1299 (wnnrpc-receive-sho-bunsetsu-list-sub-2 proc (aref v 4))
1303 (defun wnnrpc-daibunsetsu-conversion (e yomi hinshi fuzoku &optional v)
1308 v1 (wnn-const WNN_VECT_KANTAN))
1309 (setq v0 (wnn-const WNN_VECT_KANTAN)
1310 v1 (wnn-const WNN_VECT_NO)))
1311 (wnnrpc-call-with-environment e (number-of-bunsetsu sho-size kanji-size)
1312 (comm-format (u u S i S i i) (wnn-const JS_KANTAN_DAI)
1313 env-id yomi hinshi fuzoku v0 v1)
1314 (comm-unpack (u) number-of-bunsetsu)
1315 (if (< number-of-bunsetsu 0) ; Get error # (XXX: Bad protocol)
1317 (comm-unpack (u) error)
1318 (error "WNN Error on daibunsetsu conversion: %s"
1319 (wnnrpc-get-error-message error)))
1320 (comm-unpack (u u) sho-size kanji-size)
1321 (wnnrpc-receive-dai-bunsetsu-list proc number-of-bunsetsu)))))
1323 (defun wnnrpc-get-daibunsetsu-candidate (e yomi hinshi fuzoku &optional v)
1328 v1 (wnn-const WNN_VECT_KANZEN))
1329 (setq v0 (wnn-const WNN_VECT_KANZEN)
1330 v1 (wnn-const WNN_VECT_NO)))
1331 (wnnrpc-call-with-environment e (number-of-bunsetsu sho-size kanji-size)
1332 (comm-format (u u S i S i i) (wnn-const JS_KANZEN_DAI)
1333 env-id yomi hinshi fuzoku v0 v1)
1334 (comm-unpack (u) number-of-bunsetsu)
1335 (if (< number-of-bunsetsu 0) ; Get error # (XXX: Bad protocol)
1337 (comm-unpack (u) error)
1338 (error "WNN Error on daibunsetsu conversion: %s"
1339 (wnnrpc-get-error-message error)))
1340 (comm-unpack (u u) sho-size kanji-size)
1341 (wnnrpc-receive-dai-bunsetsu-list proc number-of-bunsetsu)))))
1343 ;; XXX: NIY: check in the file contents
1345 (defun wnnrpc-local-file-loaded (proc path)
1347 (let ((attr (file-attributes path)))
1348 (let ((time (cons (car (nth 6 attr)) (car (cdr (nth 6 attr)))))
1349 (inode (nth 10 attr))
1353 (concat (system-name)
1354 "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0") 0 16)))
1355 (comm-call-with-proc proc (result)
1356 (comm-format (u U U U s) (wnn-const JS_FILE_LOADED_LOCAL)
1357 time dev inode padded-hostname)
1358 (comm-unpack (u) result)
1361 (defun wnnrpc-file-receive (e fid local-filename)
1363 (wnnrpc-call-with-environment e (filename)
1364 (comm-format (u u u) (wnn-const JS_FILE_RECEIVE)
1366 (comm-unpack (s) filename)
1367 (if (null local-filename)
1368 (setq local-filename (substring filename
1369 (1+ (string-match "!" filename)))))
1370 (wnnrpc-file-receive-sub proc local-filename)))
1372 (defun wnnrpc-file-receive-sub (proc local-filename)
1373 ;; XXX check file header
1374 (let ((attr (file-attributes local-filename)))
1375 (let ((time (cons (car (nth 6 attr)) (car (cdr (nth 6 attr)))))
1376 (inode (nth 10 attr))
1380 (concat (system-name)
1381 "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0") 0 16)))
1382 (comm-call-with-proc-1 proc (result)
1383 (comm-format (u U U U s) 0 ; ACK
1384 time dev inode padded-hostname)
1385 (comm-unpack (s) result)
1388 (comm-unpack (u) error)
1392 ((or (= result 1) (= result 3) (= result 2))
1393 ;; XXX distingush creation...
1394 (comm-call-with-proc-1 proc (contents result)
1395 (comm-format (u) 0) ; ACK
1396 (comm-unpack (B u) contents result)
1397 ;; XXX XXXXXXXXXXXXXXXXX save the contents...
1398 (wnnrpc-test-result-and-get-error proc result))))))))
1400 (defun wnnrpc-file-send (e filename)
1402 (wnnrpc-call-with-environment e (result)
1403 (comm-format (u u U U U s) (wnn-const JS_FILE_SEND)
1404 env-id time dev inode padded-hostname)
1405 (comm-unpack (u) result)
1408 (comm-unpack (u) result)
1411 (comm-unpack (u) error)
1414 (comm-unpack (u) result)
1417 (comm-unpack (u) error)
1419 (let ((path (concat (system-name) "!" filename)))
1420 (wnnrpc-send-file-sub proc path))))))
1422 (defun wnnrpc-send-file-sub (proc path)
1423 (comm-call-with-proc-1 proc (result)
1425 (comm-format (s) path)
1426 ;; XXXXXXXXXXXXXX send the contents of file...
1429 (comm-format (b b) 255 0)
1430 (comm-format (b) c)))
1431 (comm-format (b b) 255 255))
1432 (comm-unpack (u) result)
1433 (wnnrpc-test-result-and-get-error proc result)))
1435 (defun wnnrpc-file-remove-client ()
1438 (defun wnnrpc-dic-file-create-client ()
1441 (defun wnnrpc-hindo-file-create-client ()
1445 ;;; egg/wnnrpc.el ends here.