annotate src/mule-wnnfns.c @ 2367:ecf1ebac70d8

[xemacs-hg @ 2004-11-04 23:05:23 by ben] commit mega-patch configure.in: Turn off -Winline and -Wchar-subscripts. Use the right set of cflags when compiling modules. Rewrite ldap configuration to separate the inclusion of lber (needed in recent Cygwin) from the basic checks for the needed libraries. add a function for MAKE_JUNK_C; initially code was added to generate xemacs.def using this, but it will need to be rewritten. add an rm -f for junk.c to avoid weird Cygwin bug with cp -f onto an existing file. Sort list of auto-detected functions and eliminate unused checks for stpcpy, setlocale and getwd. Add autodetection of Cygwin scanf problems BETA: Rewrite section on configure to indicate what flags are important and what not. digest-doc.c, make-dump-id.c, profile.c, sorted-doc.c: Add proper decls for main(). make-msgfile.c: Document that this is old junk. Move proposal to text.c. make-msgfile.lex: Move proposal to text.c. make-mswin-unicode.pl: Convert error-generating code so that the entire message will be seen as a single unrecognized token. mule/mule-ccl.el: Update docs. lispref/mule.texi: Update CCL docs. ldap/eldap.c: Mule-ize. Use EXTERNAL_LIST_LOOP_2 instead of deleted EXTERNAL_LIST_LOOP. * XEmacs 21.5.18 "chestnut" is released. --------------------------------------------------------------- MULE-RELATED WORK: --------------------------------------------------------------- --------------------------- byte-char conversion --------------------------- buffer.c, buffer.h, insdel.c, text.c: Port FSF algorithm for byte-char conversion, replacing broken previous version. Track the char position of the gap. Add functions to do char-byte conversion downwards as well as upwards. Move comments about algorithm workings to internals manual. --------------------------- work on types --------------------------- alloc.c, console-x-impl.h, dump-data.c, dump-data.h, dumper.c, dialog-msw.c, dired-msw.c, doc.c, editfns.c, esd.c, event-gtk.h, event-msw.c, events.c, file-coding.c, file-coding.h, fns.c, glyphs-eimage.c, glyphs-gtk.c, glyphs-msw.c, glyphs-shared.c, glyphs-x.c, glyphs.c, glyphs.h, gui.c, hpplay.c, imgproc.c, intl-win32.c, lrecord.h, lstream.c, keymap.c, lisp.h, libsst.c, linuxplay.c, miscplay.c, miscplay.h, mule-coding.c, nas.c, nt.c, ntheap.c, ntplay.c, objects-msw.c, objects-tty.c, objects-x.c, print.c, process-nt.c, process.c, redisplay.h, select-common.h, select-gtk.c, select-x.c, sgiplay.c, sound.c, sound.h, sunplay.c, sysfile.h, sysdep.c, syswindows.h, text.c, unexnt.c, win32.c, xgccache.c: Further work on types. This creates a full set of types for all the basic semantics of `char' that I have so far identified, so that its semantics can always be identified for the purposes of proper Mule-safe code, and the raw use of `char' always avoided. (1) More type renaming, for consistency of naming. Char_ASCII -> Ascbyte UChar_ASCII -> UAscbyte Char_Binary -> CBinbyte UChar_Binary -> Binbyte SChar_Binary -> SBinbyte (2) Introduce Rawbyte, CRawbyte, Boolbyte, Chbyte, UChbyte, and Bitbyte and use them. (3) New types Itext, Wexttext and Textcount for separating out the concepts of bytes and textual units (different under UTF-16 and UTF-32, which are potential internal encodings). (4) qxestr*_c -> qxestr*_ascii. lisp.h: New; goes with other qxe() functions. #### Maybe goes in a different section. lisp.h: Group generic int-type defs together with EMACS_INT defs. lisp.h: * lisp.h (WEXTTEXT_IS_WIDE) New defns. lisp.h: New type to replace places where int occurs as a boolean. It's signed because occasionally people may want to use -1 as an error value, and because unsigned ints are viral -- see comments in the internals manual against using them. dynarr.c: int -> Bytecount. --------------------------- Mule-izing --------------------------- device-x.c: Partially Mule-ize. dumper.c, dumper.h: Mule-ize. Use Rawbyte. Use stderr_out not printf. Use wext_*(). sysdep.c, syswindows.h, text.c: New Wexttext API for manipulation of external text that may be Unicode (e.g. startup code under Windows). emacs.c: Mule-ize. Properly deal with argv in external encoding. Use wext_*() and Wexttext. Use Rawbyte. #if 0 some old junk on SCO that is unlikely to be correct. Rewrite allocation code in run-temacs. emacs.c, symsinit.h, win32.c: Rename win32 init function and call it even earlier, to initialize mswindows_9x_p even earlier, for use in startup code (XEUNICODE_P). process.c: Use _wenviron not environ under Windows, to get Unicode environment variables. event-Xt.c: Mule-ize drag-n-drop related stuff. dragdrop.c, dragdrop.h, frame-x.c: Mule-ize. text.h: Add some more stand-in defines for particular kinds of conversion; use in Mule-ization work in frame-x.c etc. --------------------------- Freshening --------------------------- intl-auto-encap-win32.c, intl-auto-encap-win32.h: Regenerate. --------------------------- Unicode-work --------------------------- intl-win32.c, syswindows.h: Factor out common options to MultiByteToWideChar and WideCharToMultiByte. Add convert_unicode_to_multibyte_malloc() and convert_unicode_to_multibyte_dynarr() and use. Add stuff for alloca() conversion of multibyte/unicode. alloc.c: Use dfc_external_data_len() in case of unicode coding system. alloc.c, mule-charset.c: Don't zero out and reinit charset Unicode tables. This fucks up dump-time loading. Anyway, either we load them at dump time or run time, never both. unicode.c: Dump the blank tables as well. --------------------------------------------------------------- DOCUMENTATION, MOSTLY MULE-RELATED: --------------------------------------------------------------- EmacsFrame.c, emodules.c, event-Xt.c, fileio.c, input-method-xlib.c, mule-wnnfns.c, redisplay-gtk.c, redisplay-tty.c, redisplay-x.c, regex.c, sysdep.c: Add comment about Mule work needed. text.h: Add more documentation describing why DFC routines were not written to return their value. Add some other DFC documentation. console-msw.c, console-msw.h: Add pointer to docs in win32.c. emacs.c: Add comments on sources of doc info. text.c, charset.h, unicode.c, intl-win32.c, intl-encap-win32.c, text.h, file-coding.c, mule-coding.c: Collect background comments and related to text matters and internationalization, and proposals for work to be done, in text.c or Internals manual, stuff related to specific textual API's in text.h, and stuff related to internal implementation of Unicode conversion in unicode.c. Put lots of pointers to the comments to make them easier to find. s/mingw32.h, s/win32-common.h, s/win32-native.h, s/windowsnt.h, win32.c: Add bunches of new documentation on the different kinds of builds and environments under Windows and how they work. Collect this info in win32.c. Add pointers to these docs in the relevant s/* files. emacs.c: Document places with long comments. Remove comment about exiting, move to internals manual, put in pointer. event-stream.c: Move docs about event queues and focus to internals manual, put in pointer. events.h: Move docs about event stream callbacks to internals manual, put in pointer. profile.c, redisplay.c, signal.c: Move documentation to the Internals manual. process-nt.c: Add pointer to comment in win32-native.el. lisp.h: Add comments about some comment conventions. lisp.h: Add comment about the second argument. device-msw.c, redisplay-msw.c: @@#### comments are out-of-date. --------------------------------------------------------------- PDUMP WORK (MOTIVATED BY UNICODE CHANGES) --------------------------------------------------------------- alloc.c, buffer.c, bytecode.c, console-impl.h, console.c, device.c, dumper.c, lrecord.h, elhash.c, emodules.h, events.c, extents.c, frame.c, glyphs.c, glyphs.h, mule-charset.c, mule-coding.c, objects.c, profile.c, rangetab.c, redisplay.c, specifier.c, specifier.h, window.c, lstream.c, file-coding.h, file-coding.c: PDUMP: Properly implement dump_add_root_block(), which never worked before, and is necessary for dumping Unicode tables. Pdump name changes for accuracy: XD_STRUCT_PTR -> XD_BLOCK_PTR. XD_STRUCT_ARRAY -> XD_BLOCK_ARRAY. XD_C_STRING -> XD_ASCII_STRING. *_structure_* -> *_block_*. lrecord.h: some comments added about dump_add_root_block() vs dump_add_root_block_ptr(). extents.c: remove incorrect comment about pdump problems with gap array. --------------------------------------------------------------- ALLOCATION --------------------------------------------------------------- abbrev.c, alloc.c, bytecode.c, casefiddle.c, device-msw.c, device-x.c, dired-msw.c, doc.c, doprnt.c, dragdrop.c, editfns.c, emodules.c, file-coding.c, fileio.c, filelock.c, fns.c, glyphs-eimage.c, glyphs-gtk.c, glyphs-msw.c, glyphs-x.c, gui-msw.c, gui-x.c, imgproc.c, intl-win32.c, lread.c, menubar-gtk.c, menubar.c, nt.c, objects-msw.c, objects-x.c, print.c, process-nt.c, process-unix.c, process.c, realpath.c, redisplay.c, search.c, select-common.c, symbols.c, sysdep.c, syswindows.h, text.c, text.h, ui-byhand.c: New macros {alloca,xnew}_{itext,{i,ext,raw,bin,asc}bytes} for more convenient allocation of these commonly requested items. Modify functions to use alloca_ibytes, alloca_array, alloca_extbytes, xnew_ibytes, etc. also XREALLOC_ARRAY, xnew. alloc.c: Rewrite the allocation functions to factor out repeated code. Add assertions for freeing dumped data. lisp.h: Moved down and consolidated with other allocation stuff. lisp.h, dynarr.c: New functions for allocation that's very efficient when mostly in LIFO order. lisp.h, text.c, text.h: Factor out some stuff for general use by alloca()-conversion funs. text.h, lisp.h: Fill out convenience routines for allocating various kinds of bytes and put them in lisp.h. Use them in place of xmalloc(), ALLOCA(). text.h: Fill out the convenience functions so the _MALLOC() kinds match the alloca() kinds. --------------------------------------------------------------- ERROR-CHECKING --------------------------------------------------------------- text.h: Create ASSERT_ASCTEXT_ASCII() and ASSERT_ASCTEXT_ASCII_LEN() from similar Eistring checkers and change the Eistring checkers to use them instead. --------------------------------------------------------------- MACROS IN LISP.H --------------------------------------------------------------- lisp.h: Redo GCPRO declarations. Create a "base" set of functions that can be used to generate any kind of gcpro sets -- regular, ngcpro, nngcpro, private ones used in GC_EXTERNAL_LIST_LOOP_2. buffer.c, callint.c, chartab.c, console-msw.c, device-x.c, dialog-msw.c, dired.c, extents.c, ui-gtk.c, rangetab.c, nt.c, mule-coding.c, minibuf.c, menubar-msw.c, menubar.c, menubar-gtk.c, lread.c, lisp.h, gutter.c, glyphs.c, glyphs-widget.c, fns.c, fileio.c, file-coding.c, specifier.c: Eliminate EXTERNAL_LIST_LOOP, which does not check for circularities. Use EXTERNAL_LIST_LOOP_2 instead or EXTERNAL_LIST_LOOP_3 or EXTERNAL_PROPERTY_LIST_LOOP_3 or GC_EXTERNAL_LIST_LOOP_2 (new macro). Removed/redid comments on EXTERNAL_LIST_LOOP. --------------------------------------------------------------- SPACING FIXES --------------------------------------------------------------- callint.c, hftctl.c, number-gmp.c, process-unix.c: Spacing fixes. --------------------------------------------------------------- FIX FOR GEOMETRY PROBLEM IN FIRST FRAME --------------------------------------------------------------- unicode.c: Add workaround for newlib bug in sscanf() [should be fixed by release 1.5.12 of Cygwin]. toolbar.c: bug fix for problem of initial frame being 77 chars wide on Windows. will be overridden by my other ws. --------------------------------------------------------------- FIX FOR LEAKING PROCESS HANDLES: --------------------------------------------------------------- process-nt.c: Fixes for leaking handles. Inspired by work done by Adrian Aichner <adrian@xemacs.org>. --------------------------------------------------------------- FIX FOR CYGWIN BUG (Unicode-related): --------------------------------------------------------------- unicode.c: Add workaround for newlib bug in sscanf() [should be fixed by release 1.5.12 of Cygwin]. --------------------------------------------------------------- WARNING FIXES: --------------------------------------------------------------- console-stream.c: `reinit' is unused. compiler.h, event-msw.c, frame-msw.c, intl-encap-win32.c, text.h: Add stuff to deal with ANSI-aliasing warnings I got. regex.c: Gather includes together to avoid warning. --------------------------------------------------------------- CHANGES TO INITIALIZATION ROUTINES: --------------------------------------------------------------- buffer.c, emacs.c, console.c, debug.c, device-x.c, device.c, dragdrop.c, emodules.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, event-tty.c, events.c, extents.c, faces.c, file-coding.c, fileio.c, font-lock.c, frame-msw.c, glyphs-widget.c, glyphs.c, gui-x.c, insdel.c, lread.c, lstream.c, menubar-gtk.c, menubar-x.c, minibuf.c, mule-wnnfns.c, objects-msw.c, objects.c, print.c, scrollbar-x.c, search.c, select-x.c, text.c, undo.c, unicode.c, window.c, symsinit.h: Call reinit_*() functions directly from emacs.c, for clarity. Factor out some redundant init code. Move disallowed stuff that had crept into vars_of_glyphs() into complex_vars_of_glyphs(). Call init_eval_semi_early() from eval.c not in the middle of vars_of_() in emacs.c since there should be no order dependency in the latter calls. --------------------------------------------------------------- ARMAGEDDON: --------------------------------------------------------------- alloc.c, emacs.c, lisp.h, print.c: Rename inhibit_non_essential_printing_operations to inhibit_non_essential_conversion_operations. text.c: Assert on !inhibit_non_essential_conversion_operations. console-msw.c, print.c: Don't do conversion in SetConsoleTitle or FindWindow to avoid problems during armageddon. Put #errors for NON_ASCII_INTERNAL_FORMAT in places where problems would arise. --------------------------------------------------------------- CHANGES TO THE BUILD PROCEDURE: --------------------------------------------------------------- config.h.in, s/cxux.h, s/usg5-4-2.h, m/powerpc.h: Add comment about correct ordering of this file. Rearrange everything to follow this -- put all #undefs together and before the s&m files. Add undefs for HAVE_ALLOCA, C_ALLOCA, BROKEN_ALLOCA_IN_FUNCTION_CALLS, STACK_DIRECTION. Remove unused HAVE_STPCPY, HAVE_GETWD, HAVE_SETLOCALE. m/gec63.h: Deleted; totally broken, not used at all, not in FSF. m/7300.h, m/acorn.h, m/alliant-2800.h, m/alliant.h, m/altos.h, m/amdahl.h, m/apollo.h, m/att3b.h, m/aviion.h, m/celerity.h, m/clipper.h, m/cnvrgnt.h, m/convex.h, m/cydra5.h, m/delta.h, m/delta88k.h, m/dpx2.h, m/elxsi.h, m/ews4800r.h, m/gould.h, m/hp300bsd.h, m/hp800.h, m/hp9000s300.h, m/i860.h, m/ibmps2-aix.h, m/ibmrs6000.h, m/ibmrt-aix.h, m/ibmrt.h, m/intel386.h, m/iris4d.h, m/iris5d.h, m/iris6d.h, m/irist.h, m/isi-ov.h, m/luna88k.h, m/m68k.h, m/masscomp.h, m/mg1.h, m/mips-nec.h, m/mips-siemens.h, m/mips.h, m/news.h, m/nh3000.h, m/nh4000.h, m/ns32000.h, m/orion105.h, m/pfa50.h, m/plexus.h, m/pmax.h, m/powerpc.h, m/pyrmips.h, m/sequent-ptx.h, m/sequent.h, m/sgi-challenge.h, m/symmetry.h, m/tad68k.h, m/tahoe.h, m/targon31.h, m/tekxd88.h, m/template.h, m/tower32.h, m/tower32v3.h, m/ustation.h, m/vax.h, m/wicat.h, m/xps100.h: Delete C_ALLOCA, HAVE_ALLOCA, STACK_DIRECTION, BROKEN_ALLOCA_IN_FUNCTION_CALLS. All of this is auto-detected. When in doubt, I followed recent FSF sources, which also have these things deleted.
author ben
date Thu, 04 Nov 2004 23:08:28 +0000
parents 34abfb24e891
children c0934cef10c6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1 /* -*- coding: iso-2022-jp -*-
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1995 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 Copyright (C) 1995 Sun Microsystems, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 /* Synched up with: Mule 2.3. Not in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 /* Jserver Interface for Mule
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 Coded by Yutaka Ishikawa at ETL (yisikawa@etl.go.jp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 Satoru Tomura at ETL (tomura@etl.go.jp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 Modified for Wnn4 library by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 Toshiaki Shingu (shingu@cpr.canon.co.jp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 Hiroshi Kuribayashi (kuri@nff.ncl.omron.co.jp) */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 * Functions defined in this file are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 * (wnn-server-open wnn-host-name login-name)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 * wnn-host-name: STRING or NIL
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 * login-name: STRING
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 * RETURNS: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 * jserver $B$H@\B3$7!"%5!<%P!<FbIt$K@5JQ49!?5UJQ49#2$D$N4D6-$r(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 * $B:n$k!#%(%i!<$N;~$O(B nil $B$rJV$9!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 * (wnn-server-close)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 * RETURNS: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 * jserver $B$H$N@\B3$r@Z$k!#<-=q!"IQEY$O%;!<%V$5$l$J$$!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 * (wnn-server-dict-add dict-file-name hindo-file-name priority
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 * dict-file-mode hindo-file-mode pw1 pw2)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 * dict-file-name: STRING
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 * hindo-file-name: STRING or NULL-STRING
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 * priority: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 * dict-file-mode: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 * hindo-file-mode: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 * pw1: STRING or NIL
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 * pw2: STRING or NIL
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 * $B<-=q%U%!%$%kL>!"IQEY%U%!%$%kL>!"M%@hEY!"<-=q%U%!%$%k%b!<%I(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 * $BIQEY%U%!%$%k%b!<%I$G;XDj$7$?<-=q$r%P%C%U%!$KDI2C$9$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 * pw1, pw2 $B$O<-=q%U%!%$%k!"IQEY%U%!%$%k$N%Q%9%o!<%I!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 * (wnn-server-dict-delete dic-no)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 * dic-no: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 * RETURNS: $B%(%i!<$N;~(B nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 * DESCRIPTION: dic-no $B$N<-=qHV9f$N<-=q$r!"%P%C%U%!$+$i(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 * $B:o=|$9$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 * (wnn-server-dict-list)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 * RETURNS: ((dic-no1 file-name1 comment1 word-no1 nice1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 * (dic-no2 file-name2 comment2 word-no2 nice2)...)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 * DESCRIPTION: $B%P%C%U%!>e$N<-=q$N%j%9%H$rF@$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 * (wnn-server-dict-comment dic-no comment)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 * RETURNS: $B%(%i!<$N;~(B nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 * DESCRIPTION: dic-no $B$N<-=q$K%3%a%s%H$r$D$1$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 * (wnn-server-set-rev rev)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 * rev: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 * rev $B$,(B nil $B$N;~$O@5JQ49!"$=$l0J30$N;~$O5UJQ49(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 * (wnn-server-henkan-begin henkan-string)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 * henkan-string: STRING
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 * RETURNS: bunsetu-suu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 * $B2>L>4A;zJQ49$r$7!"Bh0l8uJd$NJ8@a?t$rJV$9!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 * (wnn-server-zenkouho bunsetu-no dai)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 * bunsetu-no: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 * dai: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 * RETURNS: offset
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 * $BJ8@aHV9f$G;XDj$5$l$?J8@a$NA48uJd$r$H$j$@$7(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 * $B!"8=:_$N%*%U%;%C%H$rJV$9!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 * (wnn-server-get-zenkouho offset)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 * bunsetu-no: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 * dai: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 * RETURNS: list of zenkouho
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 * $B%*%U%;%C%H$G;XDj$5$l$?8uJd$rF@$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 * (wnn-server-zenkouho-bun)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 * RETURNS: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 * $BA48uJd$rI=<($7$F$$$kJ8@aHV9f$rF@$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 * (wnn-server-zenkouho-suu)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 * RETURNS: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 * $BA48uJd$rI=<($7$F$$$kJ8@a$NA48uJd?t$rF@$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 * (wnn-server-dai-top bun-no)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 * bun-no: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 * RETURNS: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 * $BJ8@a$,BgJ8@a$N@hF,$J$i(B t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 * (wnn-server-dai-end bun-no)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 * bun-no: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 * RETURNS: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 * $B<!$NBgJ8@a$NJ8@aHV9f$rF@$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 * (wnn-server-henkan-kakutei kouho-no dai)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 * kouho-no: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 * dai: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 * RETURNS: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 * $B8uJdHV9f$G<($5$l$?8uJd$rA*Br$9$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 * (wnn-server-zenkouho) $B$r8F$s$F$+$i$G$J$$$H$$$1$J$$!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 * (wnn-server-bunsetu-henkou bunsetu-no bunsetu-length dai)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 * bunsetu-no: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 * bunsetu-length: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 * dai: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 * RETURNS:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 * $BJ8@a$ND9$5$rJQ99$9$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 * (wnn-bunsetu-kouho-inspect bunsetu-no)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 * bunsetu-no: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 * RETURNS: (kanji yomi jisho-no serial-no hinsi hindo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 * ima hyoka daihyoka kangovect)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 * $BJ8@a$N?'!9$J>pJs$rJQ49%P%C%U%!$+$i$H$j=P$9!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 * (wnn-server-henkan-quit)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 * RETURNS: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 * $B2?$b$7$J$$!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 * (wnn-server-bunsetu-kanji bun-no)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 * RETURNS: (bunsetu-kanji length)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 * (wnn-server-bunsetu-yomi bun-no)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 * RETURNS: (bunsetu-yomi length)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 * (wnn-server-bunsetu-suu)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 * RETURNS: bunsetu-suu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 * (wnn-server-hindo-update &optional bunsetu-no)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 * bunsetu-no: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 * RETURNS: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 * $BIQEY>pJs$r99?7$9$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 * (wnn-server-word-add dic-no tango yomi comment hinsi)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 * dic-no: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 * tango: STRING
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 * yoni: STRING
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 * comment: STRING
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 * hinsi: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 * RETURNS: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 * $B<-=q$KC18l$rEPO?$9$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 * (wnn-server-word-delete dic-no entry)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 * dic-no: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 * entry: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 * RETURNS: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 * $B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$r:o=|$9$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 * (wnn-server-word-use dic-no entry)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 * dic-no: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 * entry: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 * RETURNS: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 * $B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$NM-8z!?L58z$r%H%0%k$9$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 * (wnn-server-word-info dic-no entry)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 * dic-no: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 * entry: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 * RETURNS: (yomi kanji comment hindo hinsi)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 * $B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$N>pJs$rF@$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 * (wnn-server-word-hindo-set dic-no entry hindo)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 * dic-no: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 * entry: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 * hindo: INTEGER
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 * RETURNS: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 * $B<-=q$+$i%(%s%H%jHV9f$G<($5$l$kC18l$NIQEY$r@_Dj$9$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 * (wnn-server-word-search yomi)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 * yomi: STRING
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 * RETURNS: a LIST of dict-joho
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 * $BA4$F$N<-=q$+$iC18l8!:w$r9T$J$&!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 * (wnn-server-dict-save)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 * RETURNS: BOOLEAN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215 * DESCRIPTION:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 * $BA4$F$N<-=q$HIQEY%U%!%$%k$r%;!<%V$9$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 * (wnn-server-get-param)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 * RETURNS: (n nsho p1 p2 p3 ... p15)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 * DESCRIPTION: $BJQ49%Q%i%a!<%?$rF@$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 * (wnn-server-set-param n sho p1 ... p15)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 * RETURNS: $B%(%i!<$N;~(B nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 * DESCRIPTION: $BJQ49%Q%i%a!<%?$r@_Dj$9$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 * (wnn-server-get-msg error-no)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 * RETURNS: $B%(%i!<%a225;!<%8(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 * DESCRIPTION: $B%(%i!<HV9f$+$i%a%C%;!<%8$rF@$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 * (wnn-server-fuzokugo-set fname)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 * RETURNS: $B%(%i!<$N;~(B nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 * DESCRIPTION: $B%P%C%U%!$KImB08l%U%!%$%k$rFI$_9~$`!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 * (wnn-server-fuzokugo-get)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 * RETURNS: $B%U%!%$%kL>(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 * DESCRIPTION: $B%P%C%U%!$NImB08l%U%!%$%kL>$rF@$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 * (wnn-server-isconnect)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 * RETURNS: $B%3%M%/%H$7$F$l$P(B t, $B$7$F$J$1$l$P(B nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 * DESCRIPTION: $B%5!<%P$H7Q$C$F$$$k$+D4$Y$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 * (wnn-server-hinsi-dicts hinsi-no)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 * RETURNS: (dic-no1 dic-no2 ...)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 * DESCRIPTION: hinsi-no $B$NIJ;l$,EPO?$G$-$k<-=q$N%j%9%H$rF@$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 * hinsi-no = -1 $B$N$H$-$K$O!"EPO?2DG=$JA4<-=q$rF@$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 * (wnn-server-hinsi-list dic-no name)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 * RETURNS: (name1 name2 ... )
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 * DESCRIPTION: dic-no $B$N<-=q$G!"IJ;l%N!<%I$KB0$9$k(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 * $BIJ;l%N!<%I!JL>!K$N%j%9%H$rF@$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 * $BIJ;lL>$rM?$($?;~$O!"#0$rJV$9!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 * (wnn-server-hinsi-name hinsi-no)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 * RETURNS: hinsi-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 * DESCRIPTION: $BIJ;lHV9f$+$iL>A0$r<h$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 * (wnn-server-hinsi-number hinsi-name)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 * RETURNS: hinsi-no
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 * DESCRIPTION: $BIJ;lL>$rIJ;lHV9f$KJQ49$9$k!#(B
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 * (wnn-server-version)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 * RETURNS: version ID(int)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 #include <config.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 #include "lisp.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 #include "buffer.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 #include "window.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 #include "sysdep.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 #include "wnn/commonhd.h"
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
274 #include "charset.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 #include "wnn/jllib.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 #include "wnn/cplib.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 /* UCHAR $B$,Fs=EDj5A$5$l$k$N$G(B */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 #define _UCHAR_T
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 #define EGG_TIMEOUT 5
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 #define NSERVER 4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 #define WNNSERVER_J 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 #define WNNSERVER_C 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 #define WNNSERVER_T 2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 #define WNNSERVER_K 3
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 int check_wnn_server_type (void);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 void w2m (w_char *wp, unsigned char *mp, unsigned char lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 void m2w (unsigned char *mp, w_char *wp);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 void w2y (w_char *w);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 void c2m (unsigned char *cp, unsigned char *mp, unsigned char lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 static void puts2 (char *s);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 static int dai_end (int no, int server);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 static int yes_or_no (unsigned char *s);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297 /* Why doesn't wnn have a prototype for these? */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 typedef unsigned int letter;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 int cwnn_yincod_pzy(w_char *, w_char, int);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 int cwnn_pzy_yincod(letter *, letter *, int);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 static struct wnn_buf *wnnfns_buf[NSERVER];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 static struct wnn_env *wnnfns_env_norm[NSERVER];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 static struct wnn_env *wnnfns_env_rev[NSERVER];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 static int wnnfns_norm;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 static unsigned char lb_wnn_server_type[NSERVER] =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 {LEADING_BYTE_JAPANESE_JISX0208, LEADING_BYTE_CHINESE_GB2312, LEADING_BYTE_THAI_TIS620, LEADING_BYTE_KOREAN_KSC5601};
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 /* Lisp Variables and Constants Definition */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 Lisp_Object Qjserver;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 Lisp_Object Qcserver;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 /*Lisp_Object Qtserver;*/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 Lisp_Object Qkserver;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 Lisp_Object Qwnn_no_uniq;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 Lisp_Object Qwnn_uniq;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 Lisp_Object Qwnn_uniq_kanji;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 Lisp_Object Qwnn_n, Qwnn_nsho, Qwnn_hindo, Qwnn_len, Qwnn_jiri, Qwnn_flag;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 Lisp_Object Qwnn_jisho, Qwnn_sbn, Qwnn_dbn_len, Qwnn_sbn_cnt, Qwnn_suuji;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 Lisp_Object Qwnn_kana, Qwnn_eisuu, Qwnn_kigou, Qwnn_toji_kakko, Qwnn_fuzokogo, Qwnn_kaikakko;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 Lisp_Object Vwnn_server_type;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 Lisp_Object Vcwnn_zhuyin;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 Lisp_Object Vwnnenv_sticky;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 Lisp_Object Vwnn_uniq_level;
458
c33ae14dd6d0 Import from CVS: tag r21-2-44
cvs
parents: 444
diff changeset
324 Fixnum lb_sisheng;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 /* Lisp functions definition */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 DEFUN ("wnn-server-open", Fwnn_open, 2, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 Connect to jserver of host HNAME, make an environment with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 login name LNAME in the server.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
331 Return nil if error occurs.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 (hname, lname))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335 char *envname;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 char *langname;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 char *hostname;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 int size;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 CHECK_STRING (lname);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 snum = check_wnn_server_type ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 switch (snum)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 case WNNSERVER_J:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 langname = "ja_JP";
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 case WNNSERVER_C:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 langname = "zh_CN";
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352 case WNNSERVER_T:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 strcpy (langname, "zh_TW");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 case WNNSERVER_K:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 langname = "ko_KR";
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 case -1:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 default:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 size = XSTRING_LENGTH (lname) > 1024 ? 1026 : XSTRING_LENGTH (lname) + 2;
2367
ecf1ebac70d8 [xemacs-hg @ 2004-11-04 23:05:23 by ben]
ben
parents: 1650
diff changeset
364 /* !!#### */
1650
34abfb24e891 [xemacs-hg @ 2003-08-28 15:44:04 by james]
james
parents: 867
diff changeset
365 envname = (char *) ALLOCA (size);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 strncpy (envname, (char *) XSTRING_DATA (lname), size-2);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 envname[size-2] = '\0';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368 if (NILP (hname)) hostname = "";
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 CHECK_STRING (hname);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 size = XSTRING_LENGTH(hname) > 1024 ? 1025 : XSTRING_LENGTH(hname) + 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373
1650
34abfb24e891 [xemacs-hg @ 2003-08-28 15:44:04 by james]
james
parents: 867
diff changeset
374 hostname = (char *) ALLOCA (size);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 strncpy (hostname, (char *) XSTRING_DATA (hname), size-1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 hostname[size-1] = '\0';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 CHECK_STRING (lname);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 /* 97/4/16 jhod@po.iijnet.or.jp
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 * libwnn uses SIGALRM, so we need to stop and start interrupts.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 stop_interrupts();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 if (!(wnnfns_buf[snum] = jl_open_lang (envname, hostname, langname,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384 0, 0, 0, EGG_TIMEOUT)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386 start_interrupts();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 if (!jl_isconnect (wnnfns_buf[snum]))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 start_interrupts();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 wnnfns_env_norm[snum] = jl_env_get (wnnfns_buf[snum]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395 /* if (Vwnnenv_sticky == Qt) jl_env_sticky_e (wnnfns_env_norm[snum]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396 else jl_env_un_sticky_e (wnnfns_env_norm[snum]);*/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 strcat (envname, "R");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398 if (!(wnnfns_env_rev[snum] = jl_connect_lang (envname, hostname, langname,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 0, 0, 0, EGG_TIMEOUT)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 start_interrupts();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404 /* if (Vwnnenv_sticky == Qt) jl_env_sticky_e (wnnfns_env_rev[snum]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 else jl_env_un_sticky_e (wnnfns_env_rev[snum]);*/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 start_interrupts();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 DEFUN ("wnn-server-close", Fwnn_close, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 Close the connection to jserver, Dictionary and frequency files
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413 are not saved.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
414 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
415 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
416 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
417 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
420 if (wnnfns_env_norm[snum])
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
421 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422 if (NILP (Vwnnenv_sticky)) jl_env_un_sticky_e (wnnfns_env_norm[snum]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423 else jl_env_sticky_e (wnnfns_env_norm[snum]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424 jl_disconnect (wnnfns_env_norm[snum]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
425 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426 if (wnnfns_env_rev[snum])
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
428 if (NILP (Vwnnenv_sticky)) jl_env_un_sticky_e (wnnfns_env_rev[snum]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 else jl_env_sticky_e (wnnfns_env_rev[snum]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
430 jl_disconnect (wnnfns_env_rev[snum]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432 jl_env_set (wnnfns_buf[snum], 0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433 jl_close (wnnfns_buf[snum]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 wnnfns_buf[snum] = (struct wnn_buf *) 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 wnnfns_env_norm[snum] = wnnfns_env_rev[snum] = (struct wnn_env *) 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439 DEFUN ("wnn-server-dict-add", Fwnn_dict_add, 5, MANY, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 Add dictionary specified by DICT-FILE-NAME, FREQ-FILE-NAME,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441 PRIORITY, DICT-FILE-MODE, FREQ-FILE-MODE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442 Specify password files of dictionary and frequency, PW1 and PW2, if needed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 (int nargs, Lisp_Object *args))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 struct gcpro gcpro1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448 CHECK_STRING (args[0]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449 CHECK_STRING (args[1]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
450 CHECK_INT (args[2]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
451 if (! NILP (args[5])) CHECK_STRING (args[5]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452 if (! NILP (args[6])) CHECK_STRING (args[6]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455 GCPRO1 (*args);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456 gcpro1.nvars = nargs;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
457 if (jl_dic_add (wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458 XSTRING_DATA (args[0]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459 XSTRING_DATA (args[1]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461 XINT (args[2]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462 NILP (args[3]) ? WNN_DIC_RDONLY : WNN_DIC_RW,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
463 NILP (args[4]) ? WNN_DIC_RDONLY : WNN_DIC_RW,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 NILP (args[5]) ? 0 : XSTRING_DATA (args[5]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465 NILP (args[6]) ? 0 : XSTRING_DATA (args[6]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 yes_or_no,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 puts2 ) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
475
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476 DEFUN ("wnn-server-dict-delete", Fwnn_dict_delete, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 Remove dictionary specified by DIC-NUMBER from buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 (dicno))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
481 int no;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483 CHECK_INT (dicno);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 no = XINT (dicno);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 if (jl_dic_delete (wnnfns_buf[snum], no) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 DEFUN ("wnn-server-dict-list", Fwnn_dict_list, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 Return information of dictionaries.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
495 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
496 WNN_DIC_INFO *dicinfo;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 int cnt, i;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 unsigned char comment[1024];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499 Lisp_Object val;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501 unsigned char lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504 lb = lb_wnn_server_type[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 #ifdef WNN6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507 if((cnt = jl_fi_dic_list (wnnfns_buf[snum], 0x3f, &dicinfo)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
509 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 if((cnt = jl_dic_list (wnnfns_buf[snum], &dicinfo)) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 val = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513 for (i = 0, dicinfo += cnt; i < cnt; i++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515 dicinfo--;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516 w2m (dicinfo->comment, comment, lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 /* #### The following has not been Mule-ized!!
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518 fname and comment must be ASCII strings! */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519 val =
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
520 Fcons (Fcons (make_int (dicinfo->dic_no),
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 851
diff changeset
521 list4 (make_string ((Ibyte *) (dicinfo->fname),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
522 strlen (dicinfo->fname)),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
523 make_string (comment, strlen ((char *) comment)),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524 make_int (dicinfo->gosuu),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525 make_int (dicinfo->nice))), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527 return val;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 DEFUN ("wnn-server-dict-comment", Fwnn_dict_comment, 2, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531 Set comment to dictionary specified by DIC-NUMBER.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
532 Comment string COMMENT.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534 (dicno, comment))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536 w_char wbuf[512];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
537 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
538 CHECK_INT (dicno);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
539 CHECK_STRING (comment);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
540 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
542 m2w (XSTRING_DATA (comment), wbuf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
543 if (jl_dic_comment_set (wnnfns_buf[snum], XINT (dicno), wbuf) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
544 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549 DEFUN ("wnn-server-set-rev", Fwnn_set_rev, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
550 Switch the translation mode to normal if T, or reverse if NIL.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
551 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
552 (rev))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
553 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
555 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
556 if (NILP (rev))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
557 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
558 if ((!wnnfns_buf[snum]) || (!wnnfns_env_norm[snum])) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
559 jl_env_set (wnnfns_buf[snum], wnnfns_env_norm[snum]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
560 wnnfns_norm = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
561 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
562 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
563 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
564 if ((!wnnfns_buf[snum]) || (!wnnfns_env_rev[snum])) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
565 jl_env_set (wnnfns_buf[snum], wnnfns_env_rev[snum]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
566 wnnfns_norm = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
567 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
569 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
570
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
571 DEFUN ("wnn-server-henkan-begin", Fwnn_begin_henkan, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
572 Translate YOMI string to kanji. Retuen the number of bunsetsu.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
573 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
574 (hstring))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
575 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
576 int cnt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
577 w_char wbuf[5000];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
578 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
579 CHECK_STRING (hstring);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
580 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
581 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
582 m2w (XSTRING_DATA (hstring), wbuf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
583 if (snum == WNNSERVER_C)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
584 w2y (wbuf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
585
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
586 #ifdef WNN6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
587 if ((cnt = jl_fi_ren_conv (wnnfns_buf[snum], wbuf, 0, -1, WNN_USE_MAE)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
588 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
589 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
590 if ((cnt = jl_ren_conv (wnnfns_buf[snum], wbuf, 0, -1, WNN_USE_MAE)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
591 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
592 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
593 return make_int (cnt);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
594 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
595
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
596 DEFUN ("wnn-server-zenkouho", Fwnn_zenkouho, 2, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
597 Get zenkouho at BUNSETSU-NUMBER. Second argument DAI is t.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
598 if dai-bunsetsu, NIL if sho-bunsetsu. Return the current offset of zenkouho.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
599 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
600 (bunNo, dai))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
601 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
602 int no, offset;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
603 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
604 int uniq_level;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
605 CHECK_INT (bunNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
606 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
607 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
608 no = XINT (bunNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
609 if (EQ(Vwnn_uniq_level, Qwnn_no_uniq)) uniq_level = WNN_NO_UNIQ;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
610 else if (EQ(Vwnn_uniq_level, Qwnn_uniq)) uniq_level = WNN_UNIQ;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
611 else uniq_level = WNN_UNIQ_KNJ;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
612 if (NILP (dai))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
613 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
614 if ((offset = jl_zenkouho (wnnfns_buf[snum],no,WNN_USE_MAE,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
615 uniq_level)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
616 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
617 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
618 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
619 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
620 if ((offset = jl_zenkouho_dai (wnnfns_buf[snum], no, dai_end (no, snum),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
621 WNN_USE_MAE, uniq_level)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
622 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
623 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
624 return make_int (offset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
625 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
626
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
627
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
628 DEFUN ("wnn-server-get-zenkouho", Fwnn_get_zenkouho, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
629 Get kanji string of KOUHO-NUMBER.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
630 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
631 (kouhoNo))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
632 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
633 unsigned char kanji_buf[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
634 w_char wbuf[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
635 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
636 unsigned char lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
637 CHECK_INT (kouhoNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
638 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
639 lb = lb_wnn_server_type[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
640 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
641 jl_get_zenkouho_kanji (wnnfns_buf[snum], XINT (kouhoNo), wbuf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
642 w2m (wbuf, kanji_buf, lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
643 return make_string (kanji_buf, strlen ((char *) kanji_buf));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
644 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
645
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
646 DEFUN ("wnn-server-zenkouho-bun", Fwnn_zenkouho_bun, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
647 For Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
648 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
649 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
651 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
652 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
653 return make_int (jl_zenkouho_bun (wnnfns_buf[snum]));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
654 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
655
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
656 DEFUN ("wnn-server-zenkouho-suu", Fwnn_zenkouho_suu, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
657 Return the number of zen kouho.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
658 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
660 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
662 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
663 return make_int (jl_zenkouho_suu (wnnfns_buf[snum]));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
664 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
665
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
666 DEFUN ("wnn-server-dai-top", Fwnn_dai_top, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
667 Return t if bunsetsu BUN-NUMBER is dai-bunsetsu.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
668 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
669 (bunNo))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
670 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
671 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
672 CHECK_INT (bunNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
673 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
674 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
675 if (jl_dai_top (wnnfns_buf[snum], XINT (bunNo)) == 1) return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
676 else return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
677 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
678
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
679 DEFUN ("wnn-server-dai-end", Fwnn_dai_end, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
680 Return the bunsetu number of the next dai-bunsetsu after BUN-NUMBER.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
681 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
682 (bunNo))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
683 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
684 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
685 CHECK_INT (bunNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
686 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
687 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
688 return make_int (dai_end (XINT (bunNo), snum));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
689 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
690
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
691 DEFUN ("wnn-server-henkan-kakutei", Fwnn_kakutei, 2, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
692 Set candidate with OFFSET, DAI. DAI is T if dai-bunsetsu.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
693 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
694 (offset, dai))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
695 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
696 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
697 CHECK_INT (offset);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
698 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
699 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
700 if (NILP (dai))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
701 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
702 if (jl_set_jikouho (wnnfns_buf[snum], XINT (offset)) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
703 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
704 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
705 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
706 if (jl_set_jikouho_dai (wnnfns_buf[snum], XINT (offset)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
707 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
708 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
709 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
710 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
711
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
712 DEFUN ("wnn-server-bunsetu-henkou", Fwnn_bunsetu_henkou, 3, 3, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
713 Change length of BUN-NUMBER bunsetu to LEN. DAI is T if dai-bunsetsu.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
714 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
715 (bunNo, len, dai))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
716 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
717 int cnt, no;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
718 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
719 CHECK_INT (bunNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
720 CHECK_INT (len);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
721 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
722 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
723 no = XINT (bunNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
724 #ifdef WNN6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
725 if ((cnt = jl_fi_nobi_conv (wnnfns_buf[snum], no, XINT(len), -1, WNN_USE_MAE,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
726 NILP (dai) ? WNN_SHO : WNN_DAI)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
727 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
728 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
729 if ((cnt = jl_nobi_conv (wnnfns_buf[snum], no, XINT(len), -1, WNN_USE_MAE,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
730 NILP (dai) ? WNN_SHO : WNN_DAI)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
731 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
732 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
733 return make_int (cnt);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
734 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
735
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
736 DEFUN ("wnn-server-inspect", Fwnn_inspect, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
737 Get bunsetsu information specified by BUN-NUMBER.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
738 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
739 (bunNo))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
740 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
741 Lisp_Object val;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
742 unsigned char cbuf[512];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
743 w_char wbuf[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
744 int bun_no, yomilen, jirilen, i;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
745 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
746 unsigned char lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
747 CHECK_INT (bunNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
748 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
749 lb = lb_wnn_server_type[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
750 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
751 bun_no = XINT (bunNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
752 val = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
753 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->kangovect), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
754 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->daihyoka), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
755 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->hyoka), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
756 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->ima), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
757 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->hindo), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
758 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->hinsi), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
759 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->entry), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
760 val = Fcons (make_int (wnnfns_buf[snum]->bun[bun_no]->dic_no), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
761 yomilen = jl_get_yomi (wnnfns_buf[snum], bun_no, bun_no + 1, wbuf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
762 jirilen = wnnfns_buf[snum]->bun[bun_no]->jirilen;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
763 for (i = yomilen; i >= jirilen; i--) wbuf[i+1] = wbuf[i];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
764 wbuf[jirilen] = '+';
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
765 w2m (wbuf, cbuf, lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
766 val = Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
767 jl_get_kanji (wnnfns_buf[snum], bun_no, bun_no + 1, wbuf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
768 w2m (wbuf, cbuf, lb);
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
769 return Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
770 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
771
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
772
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
773 DEFUN ("wnn-server-henkan-quit", Fwnn_quit_henkan, 0, 0, 0, /*
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
774 do nothing.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
775 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
776 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
777 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
778 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
779 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
780 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
781 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
782 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
783
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
784 DEFUN ("wnn-server-bunsetu-kanji", Fwnn_bunsetu_kanji, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
785 Get the pair of kanji and length of bunsetsu specified by BUN-NUMBER.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
786 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
787 (bunNo))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
788 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
789 int no;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
790 unsigned char kanji_buf[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
791 w_char wbuf[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
792 int kanji_len;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
793 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
794 unsigned char lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
795 CHECK_INT (bunNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
796 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
797 lb = lb_wnn_server_type[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
798 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
799 no = XINT (bunNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
800 kanji_len = jl_get_kanji (wnnfns_buf[snum], no, no + 1, wbuf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
801 w2m (wbuf, kanji_buf, lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
802 return Fcons (make_string (kanji_buf, strlen ((char *) kanji_buf)),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
803 make_int (kanji_len));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
804 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
805
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
806 DEFUN ("wnn-server-bunsetu-yomi", Fwnn_bunsetu_yomi, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
807 Get the pair of yomi and length of bunsetsu specified by BUN-NUMBER.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
808 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
809 (bunNo))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
810 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
811 int no;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
812 unsigned char yomi_buf[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
813 w_char wbuf[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
814 int yomi_len;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
815 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
816 unsigned char lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
817 CHECK_INT (bunNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
818 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
819 lb = lb_wnn_server_type[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
820 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
821 no = XINT (bunNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
822 yomi_len = jl_get_yomi (wnnfns_buf[snum], no, no + 1, wbuf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
823 w2m (wbuf, yomi_buf, lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
824 return Fcons (make_string (yomi_buf, strlen ((char *) yomi_buf)),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
825 make_int (yomi_len));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
826 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
827
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
828 DEFUN ("wnn-server-bunsetu-suu", Fwnn_bunsetu_suu, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
829 Get the number of bunsetsu.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
830 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
831 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
832 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
833 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
834 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
835 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
836 return make_int (jl_bun_suu (wnnfns_buf[snum]));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
837 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
838
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
839 DEFUN ("wnn-server-hindo-update", Fwnn_hindo_update, 0, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
840 Update frequency of bunsetsu specified by NUM-NUMBER.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
841 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
842 (bunNo))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
843 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
844 int no;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
845 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
846 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
847 if (NILP (bunNo)) no = -1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
848 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
849 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
850 CHECK_INT (bunNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
851 no = XINT (bunNo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
852 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
853 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
854 #ifdef WNN6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
855 if (jl_optimize_fi (wnnfns_buf[snum], 0, no) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
856 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
857 if (jl_update_hindo (wnnfns_buf[snum], 0, no) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
858 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
859 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
860 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
861
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
862
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
863 DEFUN ("wnn-server-word-add", Fwnn_word_toroku, 5, 5, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
864 Add a word to dictionary. Arguments are
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
865 DIC-NUMBER, KANJI, YOMI, COMMENT, HINSI-NUMBER.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
866 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
867 (dicno, kanji, yomi, comment, hinsi))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
868 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
869 w_char yomi_buf[256], kanji_buf[256], comment_buf[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
870 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
871 CHECK_INT (dicno);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
872 CHECK_STRING (kanji);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
873 CHECK_STRING (yomi);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
874 CHECK_STRING (comment);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
875 CHECK_INT (hinsi);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
876 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
877 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
878 m2w (XSTRING_DATA (yomi), yomi_buf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
879 if (snum == WNNSERVER_C)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
880 w2y (yomi_buf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
881 m2w (XSTRING_DATA (kanji), kanji_buf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
882 m2w (XSTRING_DATA (comment), comment_buf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
883 if (jl_word_add (wnnfns_buf[snum], XINT (dicno), yomi_buf, kanji_buf,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
884 comment_buf, XINT (hinsi), 0) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
885 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
886 else return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
887 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
888
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
889
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
890 DEFUN ("wnn-server-word-delete", Fwnn_word_sakujo, 2, 2, 0, /*
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
891 Delete a word from dictionary, specified by DIC-NUMBER, SERIAL-NUMBER.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
892 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
893 (no, serial))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
894 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
895 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
896 CHECK_INT (no);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
897 CHECK_INT (serial);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
898 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
899 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
900 if (jl_word_delete (wnnfns_buf[snum], XINT (no), XINT (serial)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
901 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
902 else return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
903 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
904
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
905
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
906 DEFUN ("wnn-server-word-use", Fwnn_word_use, 2, 2, 0, /*
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
907 Toggle on/off word, specified by DIC-NUMBER and SERIAL-NUMBER.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
908 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
909 (no, serial))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
910 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
911 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
912 CHECK_INT (no);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
913 CHECK_INT (serial);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
914 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
915 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
916 if (jl_word_use (wnnfns_buf[snum], XINT (no), XINT (serial)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
917 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
918 else return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
919 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
920
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
921 DEFUN ("wnn-server-word-info", Fwnn_word_info, 2, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
922 Return list of yomi, kanji, comment, hindo, hinshi.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
923 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
924 (no, serial))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
925 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
926 Lisp_Object val;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
927 struct wnn_jdata *info_buf;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
928 unsigned char cbuf[512];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
929 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
930 unsigned char lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
931 CHECK_INT (no);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
932 CHECK_INT (serial);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
933 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
934 lb = lb_wnn_server_type[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
935 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
936 if ((info_buf = jl_word_info (wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
937 XINT (no), XINT (serial))) != NULL)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
938 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
939 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
940 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
941 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
942 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
943 val = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
944 val = Fcons (make_int (info_buf->hinshi), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
945 val = Fcons (make_int (info_buf->hindo), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
946 w2m (info_buf->com, cbuf, lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
947 val = Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
948 w2m (info_buf->kanji, cbuf, lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
949 val = Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
950 w2m (info_buf->yomi, cbuf, lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
951 val = Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
952 return val;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
953 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
954 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
955
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
956 DEFUN ("wnn-server-word-hindo-set", Fwnn_hindo_set, 3, 3, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
957 Set frequency to arbitrary value. Specified by DIC-NUMBER,
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
958 SERIAL-NUMBER, FREQUENCY.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
959 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
960 (no, serial, hindo))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
961 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
962 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
963 CHECK_INT (no);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
964 CHECK_INT (serial);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
965 CHECK_INT (hindo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
966 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
967 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
968 if (js_hindo_set (jl_env_get (wnnfns_buf[snum]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
969 XINT (no),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
970 XINT (serial),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
971 WNN_HINDO_NOP,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
972 XINT (hindo)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
973 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
974 else return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
975 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
976
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
977
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
978 DEFUN ("wnn-server-word-search", Fwnn_dict_search, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
979 Search a word YOMI from buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
980 Return list of (kanji hinshi freq dic_no serial).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
981 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
982 (yomi))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
983 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
984 Lisp_Object val;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
985 struct wnn_jdata *wordinfo;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
986 int i, count;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
987 w_char wbuf[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
988 unsigned char kanji_buf[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
989 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
990 unsigned char lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
991 CHECK_STRING (yomi);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
992 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
993 lb = lb_wnn_server_type[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
994 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
995 m2w (XSTRING_DATA (yomi), wbuf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
996 if (snum == WNNSERVER_C)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
997 w2y (wbuf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
998 if ((count = jl_word_search_by_env (wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
999 wbuf, &wordinfo)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1000 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1001 val = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1002 for (i = 0, wordinfo += count; i < count; i++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1003 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1004 wordinfo--;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1005 w2m (wordinfo->kanji, kanji_buf, lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1006 val = Fcons (Fcons (make_string (kanji_buf, strlen ((char *) kanji_buf)),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1007 list4 (make_int (wordinfo->hinshi),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1008 make_int (wordinfo->hindo),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1009 make_int (wordinfo->dic_no),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1010 make_int (wordinfo->serial))),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1011 val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1012 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1013 return val;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1014 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1015
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1016 DEFUN ("wnn-server-dict-save", Fwnn_dict_save, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1017 Save all dictionaries and frequency files.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1018 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1019 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1020 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1021 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1022 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1023 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1024 if (jl_dic_save_all (wnnfns_buf[snum]) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1025 else return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1026 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1027
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1028 DEFUN ("wnn-server-get-param", Fwnn_get_param, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1029 Returns (n nsho hindo len jiri flag jisho sbn dbn_len sbn_cnt
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1030 suuji kana eisuu kigou toji_kakko fuzokogo kaikakko)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1031 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1032 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1033 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1034 struct wnn_param param;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1035 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1036 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1037 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1038 if (jl_param_get (wnnfns_buf[snum], &param) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1039 return Fcons (make_int (param.n),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1040 Fcons (make_int (param.nsho),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1041 Fcons (make_int (param.p1),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1042 Fcons (make_int (param.p2),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1043 Fcons (make_int (param.p3),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1044 Fcons (make_int (param.p4),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1045 Fcons (make_int (param.p5),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1046 Fcons (make_int (param.p6),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1047 Fcons (make_int (param.p7),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1048 Fcons (make_int (param.p8),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1049 Fcons (make_int (param.p9),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1050 Fcons (make_int (param.p10),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1051 Fcons (make_int (param.p11),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1052 Fcons (make_int (param.p12),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1053 Fcons (make_int (param.p13),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1054 Fcons (make_int (param.p14),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1055 Fcons (make_int (param.p15),Qnil)))))))))))))))));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1056 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1057
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1058 DEFUN ("wnn-server-set-param", Fwnn_set_param, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1059 Set parameters using an alist, where the CAR contains one of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1060 wnn_n, wnn_nsho, wnn_hindo, wnn_len, wnn_jiri, wnn_flag,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1061 wnn_jisho, wnn_sbn, wnn_dbn_len, wnn_sbn_cnt, wnn_suuji,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1062 wnn_kana, wnn_eisuu, wnn_kigou, wnn_toji_kakko, wnn_fuzokogo,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1063 or wnn_kaikakko and the CDR contains the value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1064 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1065 (Vsetvalues_alist))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1066 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1067 int rc;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1068 struct wnn_param param;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1069 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1070
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1071 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1072 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1073 rc = jl_param_get (wnnfns_buf[snum], &param);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1074 if (rc < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1075
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1076 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1077 EXTERNAL_PROPERTY_LIST_LOOP_3 (key, val, Vsetvalues_alist)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1078 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1079 int setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1080 CHECK_INT (val);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1081 setval = XINT (val);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1082 if (EQ (key, Qwnn_n)) param.n = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1083 else if (EQ (key, Qwnn_nsho)) param.nsho = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1084 else if (EQ (key, Qwnn_hindo)) param.p1 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1085 else if (EQ (key, Qwnn_len)) param.p2 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1086 else if (EQ (key, Qwnn_jiri)) param.p3 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1087 else if (EQ (key, Qwnn_flag)) param.p4 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1088 else if (EQ (key, Qwnn_jisho)) param.p5 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1089 else if (EQ (key, Qwnn_sbn)) param.p6 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1090 else if (EQ (key, Qwnn_dbn_len)) param.p7 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1091 else if (EQ (key, Qwnn_sbn_cnt)) param.p8 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1092 else if (EQ (key, Qwnn_suuji)) param.p9 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1093 else if (EQ (key, Qwnn_kana)) param.p10 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1094 else if (EQ (key, Qwnn_eisuu)) param.p11 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1095 else if (EQ (key, Qwnn_kigou)) param.p12 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1096 else if (EQ (key, Qwnn_toji_kakko)) param.p13 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1097 else if (EQ (key, Qwnn_fuzokogo)) param.p14 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1098 else if (EQ (key, Qwnn_kaikakko)) param.p15 = setval;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1099 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1100 {
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 458
diff changeset
1101 invalid_constant ("Invalid wnn keyword", key);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1102 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1103 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1104 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1105 }
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1106
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1107 #if 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1108 printf("wnn_n = %d\n",param.n);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1109 printf("wnn_nsho = %d\n",param.nsho);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1110 printf("wnn_hindo = %d\n",param.p1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1111 printf("wnn_len = %d\n",param.p2);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1112 printf("wnn_jiri = %d\n",param.p3);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1113 printf("wnn_flag = %d\n",param.p4);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1114 printf("wnn_jisho = %d\n",param.p5);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1115 printf("wnn_sbn = %d\n",param.p6);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1116 printf("wnn_dbn_len = %d\n",param.p7);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1117 printf("wnn_sbn_cnt = %d\n",param.p8);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1118 printf("wnn_suuji = %d\n",param.p9);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1119 printf("wnn_kana = %d\n",param.p10);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1120 printf("wnn_eisuu = %d\n",param.p11);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1121 printf("wnn_kigou = %d\n",param.p12);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1122 printf("wnn_toji_kakko = %d\n",param.p13);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1123 printf("wnn_fuzokogo = %d\n",param.p14);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1124 printf("wnn_kaikakko = %d\n",param.p15);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1125 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1126
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1127 rc = jl_param_set (wnnfns_buf[snum], &param);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1128 if (rc < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1129 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1130 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1131
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1132 DEFUN ("wnn-server-get-msg", Fwnn_get_msg, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1133 Get message string from wnn_perror.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1134 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1135 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1136 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1137 unsigned char mbuf[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1138 char *msgp;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1139 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1140 unsigned char lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1141 char langname[32];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1142 /* CHECK_INT (errno);*/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1143 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1144 lb = lb_wnn_server_type[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1145 switch (snum)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1146 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1147 case WNNSERVER_J:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1148 strcpy (langname, "ja_JP");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1149 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1150 case WNNSERVER_C:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1151 strcpy (langname, "zh_CN");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1152 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1153 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1154 case WNNSERVER_T:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1155 strcpy (langname, "zh_TW");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1156 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1157 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1158 case WNNSERVER_K:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1159 strcpy (langname, "ko_KR");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1160 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1161 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1162 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1163 /* msgp = msg_get (wnn_msg_cat, XINT (errno), 0, 0);*/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1164 msgp = wnn_perror_lang (langname);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1165 c2m ((unsigned char *) msgp, mbuf, lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1166 return make_string (mbuf, strlen ((char *) mbuf));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1167 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1168
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1169
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1170 DEFUN ("wnn-server-fuzokugo-set", Fwnn_fuzokugo_set, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1171 For Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1172 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1173 (file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1174 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1175 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1176 CHECK_STRING (file);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1177 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1178 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1179 if (jl_fuzokugo_set (wnnfns_buf[snum], XSTRING_DATA (file)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1180 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1181 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1182 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1183
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1184 DEFUN ("wnn-server-fuzokugo-get", Fwnn_fuzokugo_get, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1185 For Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1186 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1187 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1188 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1189 char fname[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1190 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1191 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1192 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1193 if (jl_fuzokugo_get (wnnfns_buf[snum], fname) < 0) return Qnil;
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 851
diff changeset
1194 return make_string ((Ibyte *) fname, strlen (fname));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1195 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1196
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1197
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1198 DEFUN ("wnn-server-isconnect", Fwnn_isconnect, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1199 For Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1200 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1201 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1202 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1203 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1204 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1205 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1206 if (jl_isconnect (wnnfns_buf[snum])) return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1207 else return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1208 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1209
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1210 DEFUN ("wnn-server-hinsi-dicts", Fwnn_hinsi_dicts, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1211 For Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1212 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1213 (hinsi))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1214 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1215 int *area;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1216 int cnt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1217 Lisp_Object val;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1218 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1219 CHECK_INT (hinsi);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1220 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1221 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1222 if ((cnt = jl_hinsi_dicts (wnnfns_buf[snum], XINT (hinsi), &area)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1223 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1224 val = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1225 for (area += cnt; cnt > 0; cnt--)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1226 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1227 area--;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1228 val = Fcons (make_int (*area), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1229 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1230 return val;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1231 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1232
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1233 DEFUN ("wnn-server-hinsi-list", Fwnn_hinsi_list, 2, 2, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1234 For Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1235 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1236 (dicno, name))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1237 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1238 int cnt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1239 Lisp_Object val;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1240 w_char wbuf[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1241 w_char **area;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1242 unsigned char cbuf[512];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1243 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1244 unsigned char lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1245 CHECK_INT (dicno);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1246 CHECK_STRING (name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1247 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1248 lb = lb_wnn_server_type[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1249 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1250 m2w (XSTRING_DATA (name), wbuf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1251 if ((cnt = jl_hinsi_list (wnnfns_buf[snum], XINT (dicno), wbuf, &area)) < 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1252 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1253 if (cnt == 0) return make_int (0);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1254 val = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1255 for (area += cnt; cnt > 0; cnt--)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1256 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1257 area--;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1258 w2m (*area, cbuf, lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1259 val = Fcons (make_string (cbuf, strlen ((char *) cbuf)), val);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1260 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1261 return val;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1262 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1263
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1264 DEFUN ("wnn-server-hinsi-name", Fwnn_hinsi_name, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1265 For Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1266 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1267 (no))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1268 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1269 unsigned char name[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1270 w_char *wname;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1271 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1272 unsigned char lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1273 CHECK_INT (no);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1274 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1275 lb = lb_wnn_server_type[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1276 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1277 if ((wname = jl_hinsi_name (wnnfns_buf[snum], XINT (no))) == 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1278 w2m (wname, name, lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1279 return make_string (name, strlen ((char *) name));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1280 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1281 #ifdef WNN6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1282 DEFUN ("wnn-server-fisys-dict-add", Fwnn_fisys_dict_add, 3, MANY, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1283 Add dictionary specified by FISYS-DICT-FILE-NAME, FISYS-FREQ-FILE-NAME,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1284 FISYS-FREQ-FILE-MODE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1285 Specify password files of dictionary and frequency, PW1 and PW2, if needed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1286 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1287 (int nargs, Lisp_Object *args))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1288 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1289 struct gcpro gcpro1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1290 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1291 CHECK_STRING (args[0]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1292 CHECK_STRING (args[1]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1293 if (! NILP (args[3])) CHECK_STRING (args[3]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1294 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1295 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1296 GCPRO1 (*args);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1297 gcpro1.nvars = nargs;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1298 if(jl_fi_dic_add(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1299 XSTRING_DATA (args[0]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1300 XSTRING_DATA (args[1]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1301 WNN_FI_SYSTEM_DICT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1302 WNN_DIC_RDONLY,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1303 NILP (args[2]) ? WNN_DIC_RDONLY : WNN_DIC_RW,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1304 0,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1305 NILP (args[3]) ? 0 : XSTRING_DATA (args[3]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1306 yes_or_no,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1307 puts2 ) < 0) {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1308 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1309 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1310 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1311 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1312 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1313 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1314
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1315 DEFUN ("wnn-server-fiusr-dict-add", Fwnn_fiusr_dict_add, 4, MANY, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1316 Add dictionary specified by FIUSR-DICT-FILE-NAME, FIUSR-FREQ-FILE-NAME,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1317 FIUSR-DICT-FILE-MODE, FIUSR-FREQ-FILE-MODE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1318 Specify password files of dictionary and frequency, PW1 and PW2, if needed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1319 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1320 (int nargs, Lisp_Object *args))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1321 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1322 struct gcpro gcpro1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1323 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1324 CHECK_STRING (args[0]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1325 CHECK_STRING (args[1]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1326 if (! NILP (args[4])) CHECK_STRING (args[4]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1327 if (! NILP (args[5])) CHECK_STRING (args[5]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1328 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1329 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1330 GCPRO1 (*args);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1331 gcpro1.nvars = nargs;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1332 if(jl_fi_dic_add(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1333 XSTRING_DATA (args[0]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1334 XSTRING_DATA (args[1]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1335 WNN_FI_USER_DICT,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1336 NILP (args[2]) ? WNN_DIC_RDONLY : WNN_DIC_RW,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1337 NILP (args[3]) ? WNN_DIC_RDONLY : WNN_DIC_RW,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1338 NILP (args[4]) ? 0 : XSTRING_DATA (args[4]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1339 NILP (args[5]) ? 0 : XSTRING_DATA (args[5]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1340 yes_or_no,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1341 puts2 ) < 0) {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1342 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1343 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1344 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1345 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1346 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1347 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1348
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1349 DEFUN ("wnn-server-notrans-dict-add", Fwnn_notrans_dict_add, 3, MANY, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1350 Add dictionary specified by NOTRANS-DICT-FILE-NAME, PRIORITY, DICT-FILE-MODE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1351 Specify password files of dictionary and frequency PW1 if needed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1352 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1353 (int nargs, Lisp_Object *args))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1354 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1355 struct gcpro gcpro1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1356 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1357 int dic_no;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1358 struct wnn_env *cur_env;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1359 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1360 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1361 CHECK_STRING (args[0]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1362 CHECK_INT (args[1]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1363 if (! NILP (args[3])) CHECK_STRING (args[3]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1364 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1365 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1366 GCPRO1 (*args);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1367 gcpro1.nvars = nargs;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1368 if(wnnfns_norm)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1369 cur_env = wnnfns_env_norm[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1370 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1371 cur_env = wnnfns_env_rev[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1372 dic_no = js_get_autolearning_dic(cur_env, WNN_MUHENKAN_LEARNING);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1373 if (dic_no == WNN_NO_LEARNING) {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1374 if((dic_no = jl_dic_add(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1375 XSTRING_DATA (args[0]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1376 0,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1377 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1378 XINT(args[1]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1379 WNN_DIC_RW, WNN_DIC_RW,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1380 NILP (args[3]) ? 0 : XSTRING_DATA (args[3]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1381 0,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1382 yes_or_no,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1383 puts2)) < 0) {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1384 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1385 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1386 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1387 js_set_autolearning_dic(cur_env, WNN_MUHENKAN_LEARNING, dic_no);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1388 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1389 if(!js_is_loaded_temporary_dic(cur_env)) {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1390 if(js_temporary_dic_add(cur_env,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1391 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV) < 0) {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1392 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1393 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1394 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1395 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1396 vmask |= WNN_ENV_MUHENKAN_LEARN_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1397 henv.muhenkan_flag = NILP (args[2]) ? WNN_DIC_RDONLY : WNN_DIC_RW;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1398 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1399 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1400 &henv) < 0) {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1401 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1402 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1403 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1404 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1405 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1406 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1407
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1408 DEFUN ("wnn-server-bmodify-dict-add", Fwnn_bmodify_dict_add, 3, MANY, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1409 Add dictionary specified by BMODIFY-DICT-FILE-NAME, PRIORITY, DICT-FILE-MODE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1410 Specify password files of dictionary and frequency PW1 if needed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1411 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1412 (int nargs, Lisp_Object *args))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1413 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1414 struct gcpro gcpro1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1415 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1416 int dic_no;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1417 struct wnn_env *cur_env;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1418 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1419 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1420 CHECK_STRING (args[0]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1421 CHECK_INT (args[1]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1422 if (! NILP (args[3])) CHECK_STRING (args[3]);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1423 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1424 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1425 GCPRO1 (*args);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1426 gcpro1.nvars = nargs;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1427 if(wnnfns_norm)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1428 cur_env = wnnfns_env_norm[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1429 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1430 cur_env = wnnfns_env_rev[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1431 dic_no = js_get_autolearning_dic(cur_env, WNN_BUNSETSUGIRI_LEARNING);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1432 if (dic_no == WNN_NO_LEARNING) {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1433 if((dic_no = jl_dic_add(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1434 XSTRING_DATA (args[0]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1435 0,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1436 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1437 XINT(args[1]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1438 WNN_DIC_RW, WNN_DIC_RW,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1439 NILP (args[3]) ? 0 : XSTRING_DATA (args[3]),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1440 0,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1441 yes_or_no,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1442 puts2)) < 0) {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1443 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1444 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1445 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1446 js_set_autolearning_dic(cur_env, WNN_BUNSETSUGIRI_LEARNING, dic_no);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1447 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1448 if(!js_is_loaded_temporary_dic(cur_env)) {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1449 if(js_temporary_dic_add(cur_env,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1450 wnnfns_norm ? WNN_DIC_ADD_NOR : WNN_DIC_ADD_REV) < 0) {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1451 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1452 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1453 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1454 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1455 vmask |= WNN_ENV_BUNSETSUGIRI_LEARN_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1456 henv.bunsetsugiri_flag = NILP (args[2]) ? WNN_DIC_RDONLY : WNN_DIC_RW;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1457 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1458 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1459 &henv) < 0) {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1460 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1461 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1462 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1463 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1464 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1465 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1466
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1467 DEFUN ("wnn-server-set-last-is-first", Fwnn_last_is_first, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1468 For FI-Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1469 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1470 (mode))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1471 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1472 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1473 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1474 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1475 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1476 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1477 vmask |= WNN_ENV_LAST_IS_FIRST_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1478 henv.last_is_first_flag = NILP (mode) ? False : True;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1479 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1480 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1481 &henv) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1482 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1483 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1484
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1485 DEFUN ("wnn-server-set-complex-conv-mode", Fwnn_complex_conv, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1486 For FI-Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1487 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1488 (mode))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1489 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1490 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1491 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1492 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1493 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1494 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1495 vmask |= WNN_ENV_COMPLEX_CONV_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1496 henv.complex_flag = NILP (mode) ? False : True;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1497 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1498 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1499 &henv) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1500 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1501 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1502
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1503 DEFUN ("wnn-server-set-okuri-learn-mode", Fwnn_okuri_learn, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1504 For FI-Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1505 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1506 (mode))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1507 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1508 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1509 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1510 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1511 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1512 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1513 vmask |= WNN_ENV_OKURI_LEARN_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1514 henv.okuri_learn_flag = NILP (mode) ? False : True;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1515 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1516 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1517 &henv) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1518 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1519 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1520
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1521 DEFUN ("wnn-server-set-okuri-flag", Fwnn_okuri_flag, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1522 For FI-Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1523 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1524 (lmode))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1525 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1526 int snum, mode;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1527 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1528 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1529 CHECK_INT (lmode);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1530 mode = XINT (lmode);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1531 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1532 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1533 if(mode != WNN_OKURI_REGULATION &&
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1534 mode != WNN_OKURI_NO &&
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1535 mode != WNN_OKURI_YES)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1536 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1537 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1538 henv.okuri_flag = mode;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1539 vmask |= WNN_ENV_OKURI_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1540 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1541 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1542 &henv) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1543 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1544 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1545
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1546 DEFUN ("wnn-server-set-prefix-learn-mode", Fwnn_prefix_learn, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1547 For FI-Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1548 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1549 (mode))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1550 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1551 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1552 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1553 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1554 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1555 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1556 vmask |= WNN_ENV_PREFIX_LEARN_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1557 henv.prefix_learn_flag = NILP (mode) ? False : True;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1558 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1559 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1560 &henv) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1561 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1562 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1563
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1564 DEFUN ("wnn-server-set-prefix-flag", Fwnn_prefix_flag, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1565 For FI-Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1566 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1567 (lmode))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1568 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1569 int snum, mode;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1570 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1571 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1572 CHECK_INT (lmode);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1573 mode = XINT (lmode);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1574 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1575 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1576 if(mode != WNN_KANA_KOUHO && mode != WNN_KANJI_KOUHO)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1577 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1578 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1579 henv.prefix_flag = mode;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1580 vmask |= WNN_ENV_PREFIX_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1581 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1582 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1583 &henv) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1584 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1585 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1586
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1587 DEFUN ("wnn-server-set-suffix-learn-mode", Fwnn_suffix_learn, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1588 For FI-Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1589 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1590 (mode))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1591 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1592 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1593 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1594 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1595 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1596 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1597 vmask |= WNN_ENV_SUFFIX_LEARN_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1598 henv.suffix_learn_flag = NILP (mode) ? False : True;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1599 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1600 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1601 &henv) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1602 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1603 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1604
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1605 DEFUN ("wnn-server-set-common-learn-mode", Fwnn_common_learn, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1606 For FI-Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1607 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1608 (mode))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1609 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1610 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1611 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1612 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1613 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1614 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1615 vmask |= WNN_ENV_COMMON_LAERN_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1616 henv.common_learn_flag = NILP (mode) ? False : True;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1617 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1618 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1619 &henv) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1620 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1621 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1622
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1623 DEFUN ("wnn-server-set-freq-func-mode", Fwnn_freq_func, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1624 For FI-Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1625 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1626 (lmode))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1627 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1628 int snum, mode;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1629 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1630 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1631 CHECK_INT (lmode);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1632 mode = XINT (lmode);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1633 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1634 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1635 if(mode != 0 && mode != 1 && mode != 2 && mode != 3 && mode != 4)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1636 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1637 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1638 henv.freq_func_flag = mode;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1639 vmask |= WNN_ENV_FREQ_FUNC_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1640 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1641 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1642 &henv) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1643 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1644 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1645
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1646 DEFUN ("wnn-server-set-numeric-mode", Fwnn_numeric, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1647 For FI-Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1648 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1649 (lmode))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1650 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1651 int snum, mode;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1652 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1653 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1654 CHECK_INT (lmode);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1655 mode = XINT (lmode);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1656 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1657 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1658 if(mode != WNN_NUM_KANSUUJI &&
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1659 mode != WNN_NUM_KANOLD &&
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1660 mode != WNN_NUM_HANCAN &&
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1661 mode != WNN_NUM_ZENCAN &&
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1662 mode != WNN_NUM_HAN &&
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1663 mode != WNN_NUM_ZEN &&
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1664 mode != WNN_NUM_KAN)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1665 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1666 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1667 henv.numeric_flag = mode;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1668 vmask |= WNN_ENV_NUMERIC_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1669 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1670 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1671 &henv) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1672 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1673 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1674
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1675 DEFUN ("wnn-server-set-alphabet-mode", Fwnn_alphabet, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1676 For FI-Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1677 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1678 (lmode))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1679 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1680 int snum, mode;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1681 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1682 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1683 CHECK_INT (lmode);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1684 mode = XINT (lmode);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1685 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1686 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1687 if(mode != WNN_ALP_HAN && mode != WNN_ALP_ZEN)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1688 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1689 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1690 henv.alphabet_flag = mode;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1691 vmask |= WNN_ENV_ALPHABET_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1692 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1693 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1694 &henv) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1695 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1696 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1697
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1698 DEFUN ("wnn-server-set-symbol-mode", Fwnn_symbol, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1699 For FI-Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1700 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1701 (lmode))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1702 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1703 int snum, mode;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1704 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1705 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1706 CHECK_INT (lmode);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1707 mode = XINT (lmode);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1708 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1709 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1710 if(mode != WNN_KIG_HAN && mode != WNN_KIG_JIS && mode != WNN_KIG_ASC)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1711 return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1712 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1713 henv.symbol_flag = mode;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1714 vmask |= WNN_ENV_SYMBOL_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1715 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1716 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1717 &henv) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1718 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1719 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1720
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1721 DEFUN ("wnn-server-set-yuragi-mode", Fwnn_yuragi, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1722 For FI-Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1723 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1724 (mode))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1725 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1726 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1727 unsigned long vmask = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1728 struct wnn_henkan_env henv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1729 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1730 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1731 vmask |= WNN_ENV_YURAGI_MASK;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1732 henv.yuragi_flag = NILP (mode) ? False : True;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1733 if(jl_set_henkan_env(wnnfns_buf[snum],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1734 vmask,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1735 &henv) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1736 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1737 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1738
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1739 DEFUN ("wnn-reset-previous-info", Fwnn_reset_prev, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1740 For FI-Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1741 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1742 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1743 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1744 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1745 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1746 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1747 if(jl_reset_prev_bun(wnnfns_buf[snum]) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1748 return Qt;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1749 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1750 #endif /* Wnn6 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1751
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1752 DEFUN ("wnn-server-version", Fwnn_version, 0, 0, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1753 Returns Wnn server version ID.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1754 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1755 ())
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1756 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1757 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1758 int serv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1759 int libv;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1760 struct wnn_env *cur_env;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1761 if ((snum = check_wnn_server_type()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1762 if(!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1763 if(wnnfns_norm)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1764 cur_env = wnnfns_env_norm[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1765 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1766 cur_env = wnnfns_env_rev[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1767 if(js_version (cur_env->js_id,&serv,&libv) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1768 return make_int (serv);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1769 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1770
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1771 DEFUN ("wnn-server-hinsi-number", Fwnn_hinsi_number, 1, 1, 0, /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1772 For Wnn.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1773 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1774 (name))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1775 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1776 w_char w_buf[256];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1777 int no;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1778 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1779 CHECK_STRING (name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1780 if ((snum = check_wnn_server_type ()) == -1) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1781 if (!wnnfns_buf[snum]) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1782 m2w (XSTRING_DATA (name), w_buf);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1783 if ((no = jl_hinsi_number (wnnfns_buf[snum], w_buf)) < 0) return Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1784 return make_int (no);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1785 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1786
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1787 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1788 syms_of_mule_wnn (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1789 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1790 DEFSUBR (Fwnn_open);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1791 DEFSUBR (Fwnn_close);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1792 DEFSUBR (Fwnn_dict_add);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1793 DEFSUBR (Fwnn_dict_delete);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1794 DEFSUBR (Fwnn_dict_list);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1795 DEFSUBR (Fwnn_dict_comment);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1796 DEFSUBR (Fwnn_set_rev);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1797 DEFSUBR (Fwnn_begin_henkan);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1798 DEFSUBR (Fwnn_zenkouho);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1799 DEFSUBR (Fwnn_get_zenkouho);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1800 DEFSUBR (Fwnn_zenkouho_bun);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1801 DEFSUBR (Fwnn_zenkouho_suu);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1802 DEFSUBR (Fwnn_dai_top);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1803 DEFSUBR (Fwnn_dai_end);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1804 DEFSUBR (Fwnn_kakutei);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1805 DEFSUBR (Fwnn_bunsetu_henkou);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1806 DEFSUBR (Fwnn_inspect);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1807 DEFSUBR (Fwnn_quit_henkan);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1808 DEFSUBR (Fwnn_bunsetu_kanji);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1809 DEFSUBR (Fwnn_bunsetu_yomi);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1810 DEFSUBR (Fwnn_bunsetu_suu);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1811 DEFSUBR (Fwnn_hindo_update);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1812 DEFSUBR (Fwnn_word_toroku);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1813 DEFSUBR (Fwnn_word_sakujo);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1814 DEFSUBR (Fwnn_word_use);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1815 DEFSUBR (Fwnn_word_info);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1816 DEFSUBR (Fwnn_hindo_set);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1817 DEFSUBR (Fwnn_dict_search);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1818 DEFSUBR (Fwnn_dict_save);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1819 DEFSUBR (Fwnn_get_param);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1820 DEFSUBR (Fwnn_set_param);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1821 DEFSUBR (Fwnn_get_msg);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1822 DEFSUBR (Fwnn_fuzokugo_set);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1823 DEFSUBR (Fwnn_fuzokugo_get);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1824 DEFSUBR (Fwnn_isconnect);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1825 DEFSUBR (Fwnn_hinsi_dicts);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1826 DEFSUBR (Fwnn_hinsi_list);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1827 DEFSUBR (Fwnn_hinsi_name);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1828 DEFSUBR (Fwnn_hinsi_number);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1829 #ifdef WNN6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1830 DEFSUBR (Fwnn_fisys_dict_add);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1831 DEFSUBR (Fwnn_fiusr_dict_add);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1832 DEFSUBR (Fwnn_notrans_dict_add);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1833 DEFSUBR (Fwnn_bmodify_dict_add);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1834 DEFSUBR (Fwnn_last_is_first);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1835 DEFSUBR (Fwnn_complex_conv);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1836 DEFSUBR (Fwnn_okuri_learn);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1837 DEFSUBR (Fwnn_okuri_flag);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1838 DEFSUBR (Fwnn_prefix_learn);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1839 DEFSUBR (Fwnn_prefix_flag);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1840 DEFSUBR (Fwnn_suffix_learn);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1841 DEFSUBR (Fwnn_common_learn);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1842 DEFSUBR (Fwnn_freq_func);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1843 DEFSUBR (Fwnn_numeric);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1844 DEFSUBR (Fwnn_alphabet);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1845 DEFSUBR (Fwnn_symbol);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1846 DEFSUBR (Fwnn_yuragi);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1847 DEFSUBR (Fwnn_reset_prev);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1848 #endif /* Wnn6 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1849 DEFSUBR (Fwnn_version);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1850
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 458
diff changeset
1851 DEFSYMBOL (Qjserver);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 458
diff changeset
1852 DEFSYMBOL (Qcserver);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 458
diff changeset
1853 /* DEFSYMBOL (Qtserver); */
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 458
diff changeset
1854 DEFSYMBOL (Qkserver);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1855
563
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 458
diff changeset
1856 DEFSYMBOL (Qwnn_no_uniq);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 458
diff changeset
1857 DEFSYMBOL (Qwnn_uniq);
183866b06e0b [xemacs-hg @ 2001-05-24 07:50:48 by ben]
ben
parents: 458
diff changeset
1858 DEFSYMBOL (Qwnn_uniq_kanji);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1859 defsymbol (&Qwnn_n, "wnn_n");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1860 defsymbol (&Qwnn_nsho, "wnn_nsho");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1861 defsymbol (&Qwnn_hindo, "wnn_hindo");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1862 defsymbol (&Qwnn_len, "wnn_len");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1863 defsymbol (&Qwnn_jiri, "wnn_jiri");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1864 defsymbol (&Qwnn_flag, "wnn_flag");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1865 defsymbol (&Qwnn_jisho, "wnn_jisho");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1866 defsymbol (&Qwnn_sbn, "wnn_sbn");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1867 defsymbol (&Qwnn_dbn_len, "wnn_dbn_len");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1868 defsymbol (&Qwnn_sbn_cnt, "wnn_sbn_cnt");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1869 defsymbol (&Qwnn_suuji, "wnn_suuji");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1870 defsymbol (&Qwnn_kana, "wnn_kana");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1871 defsymbol (&Qwnn_eisuu, "wnn_eisuu");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1872 defsymbol (&Qwnn_kigou, "wnn_kigou");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1873 defsymbol (&Qwnn_toji_kakko, "wnn_toji_kakko");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1874 defsymbol (&Qwnn_fuzokogo, "wnn_fuzokogo");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1875 defsymbol (&Qwnn_kaikakko, "wnn_kaikakko");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1876 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1877
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1878 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1879 reinit_vars_of_mule_wnn (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1880 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1881 int i;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1882
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1883 for (i = 0; i < NSERVER; i++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1884 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1885 wnnfns_buf[i] = (struct wnn_buf *) 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1886 wnnfns_env_norm[i] = (struct wnn_env *) 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1887 wnnfns_env_rev[i] = (struct wnn_env *) 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1888 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1889 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1890
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1891 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1892 vars_of_mule_wnn (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1893 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1894 DEFVAR_INT ("lb-sisheng", &lb_sisheng /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1895 Leading character for Sisheng.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1896 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1897 DEFVAR_LISP ("wnn-server-type", &Vwnn_server_type /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1898 *jserver, cserver ..
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1899 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1900 DEFVAR_LISP ("cwnn-zhuyin", &Vcwnn_zhuyin /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1901 *pinyin or zhuyin
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1902 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1903 DEFVAR_LISP ("wnnenv-sticky", &Vwnnenv_sticky /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1904 *If non-nil, make environment sticky
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1905 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1906 DEFVAR_LISP ("wnn-uniq-level", &Vwnn_uniq_level /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1907 *Uniq level
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1908 */ );
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1909
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1910 Vwnn_server_type = Qjserver;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1911 Vcwnn_zhuyin = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1912 Vwnnenv_sticky = Qnil;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1913
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1914 Vwnn_uniq_level = Qwnn_uniq;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1915
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
1916 Fprovide (intern ("wnn"));
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1917 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1918
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1919 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1920 w2m (w_char *wp, unsigned char *mp, unsigned char lb)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1921 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1922 w_char wc;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1923 w_char pzy[10];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1924 int i, len;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1925
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1926 while ((wc = *wp++) != 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1927 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1928 switch (wc & 0x8080)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1929 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1930 case 0x80:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1931 if (EQ(Vwnn_server_type, Qcserver))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1932 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1933 len = cwnn_yincod_pzy (pzy, wc,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1934 NILP (Vcwnn_zhuyin)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1935 ? CWNN_PINYIN
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1936 : CWNN_ZHUYIN);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1937 for (i = 0; i < len; i++)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1938 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1939 if (pzy[i] & 0x80)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1940 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1941 *mp++ = PRE_LEADING_BYTE_PRIVATE_1; /* #### Not sure about this one... */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1942 *mp++ = lb_sisheng;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1943 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1944 *mp++ = pzy[i];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1945 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1946 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1947 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1948 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1949 *mp++ = LEADING_BYTE_KATAKANA_JISX0201;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1950 *mp++ = (wc & 0xff);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1951 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1952 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1953 case 0x8080:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1954 *mp++ = lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1955 *mp++ = (wc & 0xff00) >> 8;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1956 *mp++ = wc & 0x00ff;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1957 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1958 case 0x8000:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1959 if (lb == LEADING_BYTE_JAPANESE_JISX0208)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1960 *mp++ = LEADING_BYTE_JAPANESE_JISX0212;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1961 else if (lb == LEADING_BYTE_CHINESE_BIG5_1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1962 *mp++ = LEADING_BYTE_CHINESE_BIG5_2;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1963 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1964 *mp++ = lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1965 *mp++ = (wc & 0xff00) >> 8;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1966 *mp++ = (wc & 0x00ff) | 0x80;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1967 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1968 default:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1969 *mp++ = wc & 0x00ff;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1970 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1971 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1972 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1973 *mp = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1974 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1975
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1976 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1977 m2w (unsigned char *mp, w_char *wp)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1978 {
647
b39c14581166 [xemacs-hg @ 2001-08-13 04:45:47 by ben]
ben
parents: 563
diff changeset
1979 int ch;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1980
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1981 while ((ch = *mp++) != 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1982 {
867
804517e16990 [xemacs-hg @ 2002-06-05 09:54:39 by ben]
ben
parents: 851
diff changeset
1983 if (ibyte_leading_byte_p (ch))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1984 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1985 switch (ch)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1986 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1987 case LEADING_BYTE_KATAKANA_JISX0201:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1988 *wp++ = *mp++; break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1989 case LEADING_BYTE_LATIN_JISX0201:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1990 *wp++ = *mp++ & 0x7F; break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1991 case LEADING_BYTE_JAPANESE_JISX0208_1978:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1992 case LEADING_BYTE_CHINESE_GB2312:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1993 case LEADING_BYTE_JAPANESE_JISX0208:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1994 case LEADING_BYTE_KOREAN_KSC5601:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1995 /* case LEADING_BYTE_TW: */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1996 ch = *mp++;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1997 *wp++ = (ch << 8) | *mp++;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1998 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1999 case LEADING_BYTE_JAPANESE_JISX0212:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2000 ch = *mp++;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2001 *wp++ = (ch << 8) | (*mp++ & 0x7f);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2002 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2003 case PRE_LEADING_BYTE_PRIVATE_1: /* #### Not sure about this one... */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2004 ch = *mp++;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2005 if (ch == lb_sisheng)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2006 *wp++ = 0x8e80 | *mp++;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2007 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2008 mp++;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2009 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2010 default: /* ignore this character */
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 793
diff changeset
2011 mp += rep_bytes_by_first_byte(ch) - 1;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2012 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2013 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2014 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2015 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2016 *wp++ = ch;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2017 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2018 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2019 *wp = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2020 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2021
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2022 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2023 w2y (w_char *w)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2024 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2025 letter pbuf[5000], ybuf[5000];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2026 unsigned int *pin;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2027 w_char *y;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2028 int len;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2029
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2030 pin = pbuf;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2031 y = w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2032 while (1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2033 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2034 if (*w == 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2035 {*pin =0; break;}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2036 else *pin = *w;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2037 w++; pin++;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2038 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2039 len = cwnn_pzy_yincod (ybuf, pbuf,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2040 NILP (Vcwnn_zhuyin) ? CWNN_PINYIN : CWNN_ZHUYIN);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2041 if (len <= 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2042 return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2043
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2044 pin = ybuf;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2045 while (1)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2046 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2047 if (*pin == 0 || len == 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2048 {*y = 0;break;}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2049 *y = *pin;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2050 y++; pin++; len--;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2051 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2052 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2053
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2054 void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2055 c2m (unsigned char *cp, unsigned char *mp, unsigned char lb)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2056 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2057 unsigned char ch;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2058 while ((ch = *cp) != 0)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2059 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2060 if (ch & 0x80)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2061 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2062 *mp++ = lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2063 *mp++ = *cp++;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2064 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2065 *mp++ = *cp++;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2066 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2067 *mp = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2068 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2069
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2070 static int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2071 dai_end (int no, int server)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2072 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2073 for (no++; no < jl_bun_suu (wnnfns_buf[server])
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2074 && !jl_dai_top (wnnfns_buf[server], no); no++);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2075 return (no);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2076 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2077
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2078 static int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2079 yes_or_no (unsigned char *s)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2080 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2081 unsigned char mbuf[512];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2082 unsigned char lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2083 int len;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2084 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2085 if ((snum = check_wnn_server_type ()) == -1) return 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2086 lb = lb_wnn_server_type[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2087 /* if no message found, create file without query */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2088 /* if (wnn_msg_cat->msg_bd == 0) return 1;*/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2089 if (*s == 0) return 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2090 c2m (s, mbuf, lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2091 /* truncate "(Y/N)" */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2092 for (len = 0; (mbuf[len]) && (len < 512); len++);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2093 for (; (mbuf[len] != '(') && (len > 0); len--);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2094 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2095 Lisp_Object yes, str;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2096 struct gcpro gcpro1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2097
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2098 str = make_string (mbuf, len);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2099 GCPRO1 (str);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2100 yes = call1(Qyes_or_no_p, str);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2101 UNGCPRO;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2102 if (NILP (yes)) return 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2103 else return (1);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2104 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2105 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2106
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2107 static void
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2108 puts2 (char *s)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2109 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2110 #if 0 /* jhod: We don't really need this echoed... */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2111 #if 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2112 Lisp_Object args[1];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2113 char mbuf[512];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2114 unsigned char lb;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2115 extern Lisp_Object Fmessage ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2116 int snum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2117 if ((snum = check_wnn_server_type ()) == -1) return;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2118 lb = lb_wnn_server_type[snum];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2119 c2m (s, mbuf, lb);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2120 args[0] = make_string (mbuf, strlen (mbuf));
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2121 Fmessage (1, args);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2122 #else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2123 message("%s",s);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2124 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2125 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2126 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2127
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2128 int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2129 check_wnn_server_type (void)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2130 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2131 if (EQ(Vwnn_server_type, Qjserver))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2132 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2133 return WNNSERVER_J;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2134 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2135 else if (EQ(Vwnn_server_type, Qcserver))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2136 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2137 return WNNSERVER_C;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2138 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2139 /* else if (Vwnn_server_type == Qtserver)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2140 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2141 return WNNSERVER_T;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2142 } */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2143 else if (EQ(Vwnn_server_type, Qkserver))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2144 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2145 return WNNSERVER_K;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2146 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2147 else return -1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2148 }