wnn6-sdk-1.0.0/0002755000000000000000000000000007153676736011703 5ustar rootrootwnn6-sdk-1.0.0/contrib/0002755000000000000000000000000007153676736013343 5ustar rootrootwnn6-sdk-1.0.0/contrib/im/0002755000000000000000000000000007153676736013750 5ustar rootrootwnn6-sdk-1.0.0/contrib/im/Xsi/0002755000000000000000000000000007153676736014513 5ustar rootrootwnn6-sdk-1.0.0/contrib/im/Xsi/config/0002755000000000000000000000000007153676737015761 5ustar rootrootwnn6-sdk-1.0.0/contrib/im/Xsi/config/X11.tmpl0000644000000000000000000004667407153676737017247 0ustar rootrootXCOMM XCOMM $Id: Project.tmpl,v 2.106 1999/04/12 09:24:33 matsui Exp $ XCOMM XCOMM ------------------------------------------------------------------------- #if defined(SunArchitecture) && defined(SVR4) #include "/usr/openwin/lib/config/Project.tmpl" #else /* Sun & SVR4 */ #if defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(NetBSDArchitecture) || defined(OpenBSDArchitecture) || defined(BSD386Architecture) #include "/usr/X11R6/lib/X11/config/X11.tmpl" #else /* Linux || *BSD */ #include "/usr/lib/X11/config/Project.tmpl" #endif /* Linux || *BSD */ #endif /* Sun & SVR4 */ #ifndef InstallAppDefFiles #define InstallAppDefFiles YES /* install application defaults */ #endif #ifdef uniosu #ifdef ManDirectoryRoot #undef ManDirectoryRoot #endif #define ManDirectoryRoot /usr/catman/w_man #endif #ifndef ManDirectoryRoot #ifdef ProjectRoot #define ManDirectoryRoot Concat(ProjectRoot,/man) #else #if SystemV4 #define ManDirectoryRoot /usr/share/man #else #define ManDirectoryRoot /usr/man #endif #endif #endif #ifndef ManSuffix #define ManSuffix n /* use just one tab or cpp will die */ #endif #ifndef LibManSuffix #define LibManSuffix 3 /* use just one tab or cpp will die */ #endif #ifndef ConnectionFlags #if (SystemV || SystemV4) && !HasSockets #define ConnectionFlags -DSTREAMSCONN #else #define ConnectionFlags -DTCPCONN -DUNIXCONN #endif #endif #ifndef ShmDefines #if HasShm #define ShmDefines -DMITSHM #else #define ShmDefines /**/ #endif #endif #ifndef BinDir #ifdef ProjectRoot #define BinDir Concat(ProjectRoot,/bin) #else #if ((defined LINUX) || (defined FREEBSD) || (defined BSDOS) || (defined NETBSD)) #define BinDir /usr/X11R6/bin #else #define BinDir /usr/bin/X11 #endif /* LINUX || FREEBSD || BSDOS || NETBSD */ #endif /* ProjectRoot */ #endif /* BinDir */ #ifndef BuildIncRoot #define BuildIncRoot $(TOP) #endif #ifndef BuildIncTop #define BuildIncTop .. /* relative to $(TOP)/X11 */ #endif #ifndef LibDir #define LibDir $(USRLIBDIR)/X11 #endif #ifndef ConfigDir #define ConfigDir $(LIBDIR)/config #endif #ifndef LintlibDir #define LintlibDir $(USRLIBDIR)/lint #endif #ifndef ManPath #define ManPath ManDirectoryRoot #endif #ifndef ManSourcePath #define ManSourcePath $(MANPATH)/man #endif #ifndef ManDir #define ManDir $(MANSOURCEPATH)$(MANSUFFIX) #endif #ifndef LibmanDir #define LibmanDir $(MANSOURCEPATH)$(LIBMANSUFFIX) #endif #ifndef XAppLoadDir #define XAppLoadDir $(LIBDIR)/app-defaults #endif #ifndef DefaultUserPath /* for xdm */ #define DefaultUserPath :/bin:/usr/bin:$(BINDIR):/usr/ucb #endif #ifndef DefaultSystemPath /* for xdm */ #define DefaultSystemPath /etc:/bin:/usr/bin:$(BINDIR):/usr/ucb #endif #ifndef DefaultSystemShell /* for xdm to set in SHELL */ #define DefaultSystemShell BourneShell #endif #ifndef UseCCMakeDepend /* use slow cc -E script */ #define UseCCMakeDepend NO #endif #ifndef DependDir #if UseCCMakeDepend #define DependDir $(SCRIPTSRC) #else #define DependDir $(UTILSRC)/makedepend #endif #endif #ifndef ContribDir #define ContribDir $(TOP)/../contrib /* contrib is outside core tree */ #endif #ifndef DependCmd #define DependCmd $(DEPENDSRC)/makedepend #endif #ifndef RemoveTargetProgramByMoving #define RemoveTargetProgramByMoving NO #endif #ifndef AllocateLocalDefines #define AllocateLocalDefines /**/ #endif #ifndef ForceNormalLib #define ForceNormalLib (HasSaberC | HasGcc) #endif #ifndef SharedLibX #define SharedLibX HasSharedLibraries #endif #ifndef NormalLibX #define NormalLibX (!SharedLibX | ForceNormalLib) #endif #ifndef SharedOldLibX #define SharedOldLibX HasSharedLibraries #endif #ifndef NormalOldLibX #define NormalOldLibX (!SharedOldLibX | ForceNormalLib) #endif #ifndef SharedLibXt #define SharedLibXt HasSharedLibraries #endif #ifndef NormalLibXt #define NormalLibXt (!SharedLibXt | ForceNormalLib) #endif #ifndef SharedLibXaw #define SharedLibXaw HasSharedLibraries #endif #ifndef NormalLibXaw #define NormalLibXaw (!SharedLibXaw | ForceNormalLib) #endif #ifndef SharedLibXmu #define SharedLibXmu HasSharedLibraries #endif #ifndef NormalLibXmu #define NormalLibXmu (!SharedLibXmu | ForceNormalLib) #endif #ifndef SharedLibXau #define SharedLibXau NO /* don't need shared form */ #endif #ifndef NormalLibXau #define NormalLibXau (!SharedLibXau | ForceNormalLib) #endif #ifndef SharedLibXdmcp #define SharedLibXdmcp NO /* don't need shared form */ #endif #ifndef NormalLibXdmcp #define NormalLibXdmcp (!SharedLibXdmcp | ForceNormalLib) #endif #ifndef SharedLibXext #define SharedLibXext HasSharedLibraries #endif #ifndef NormalLibXext #define NormalLibXext (!SharedLibXext | ForceNormalLib) #endif #ifndef SharedLibXinput #define SharedLibXinput HasSharedLibraries #endif #ifndef NormalLibXinput #define NormalLibXinput (!SharedLibXinput | ForceNormalLib) #endif #ifndef SharedLibXTest #define SharedLibXTest HasSharedLibraries #endif #ifndef NormalLibXTest #define NormalLibXTest (!SharedLibXTest | ForceNormalLib) #endif #ifndef SharedLibXTrap #define SharedLibXTrap HasSharedLibaries #endif #ifndef NormalLibXTrap #define NormalLibXTrap (!SharedLibXTrap | ForceNormalLib) #endif #ifndef SharedLibPex #define SharedLibPex HasSharedLibraries #endif #ifndef NormalLibPex #define NormalLibPex (!SharedLibPex | ForceNormalLib) #endif #ifndef SharedLibPhigs #define SharedLibPhigs NO /* XXX - haven't made it sharable yet */ #endif #ifndef NormalLibPhigs #define NormalLibPhigs (!SharedLibPhigs | ForceNormalLib) #endif XCOMM ------------------------------------------------------------------------- XCOMM X Window System make variables; this need to be coordinated with rules /* * This list must be reflected in the DIRS_TO_BUILD list in the top-level * Makefile. */ PATHSEP = / /* for building filenames */ USRLIBDIR = UsrLibDir /* nonshared libraries */ SHLIBDIR = ShLibDir /* shared libraries */ BINDIR = BinDir /* programs */ INCROOT = IncRoot /* base of where to put header files */ BUILDINCROOT = BuildIncRoot /* base of build loc */ BUILDINCDIR = $(BUILDINCROOT)/X11 BUILDINCTOP = BuildIncTop /* top relative to BUILDINCDIR */ INCDIR = $(INCROOT)/X11 /* header files, must end in X11 */ LIBDIR = LibDir /* rgb, XErrorDB, etc. */ CONFIGDIR = ConfigDir /* build configuration information */ LINTLIBDIR = LintlibDir /* lint libraries */ MANPATH = ManPath /* top of manual page tree */ MANSOURCEPATH = ManSourcePath /* prefix for man page sources */ MANSUFFIX = ManSuffix /* suffix for man pages */ LIBMANSUFFIX = LibManSuffix /* suffix for library man pages */ MANDIR = ManDir /* man pages for commands */ LIBMANDIR = LibmanDir /* man pages for library routines */ XAPPLOADDIR = XAppLoadDir /* application default resource dir */ INSTAPPFLAGS = $(INSTDATFLAGS) /* XXX - this should go away - XXX */ #ifdef UseInstalled IMAKE = imake /* assume BINDIR in path */ DEPEND = makedepend /* assume BINDIR in path */ MKDIRHIER = BourneShell $(BINDIR)/mkdirhier #else IMAKE = $(IMAKESRC)/imake DEPEND = DependCmd MKDIRHIER = BourneShell $(SCRIPTSRC)/mkdirhier.sh #endif CONFIGSRC = $(TOP)/config DOCUTILSRC = $(TOP)/doc/util LIBSRC = $(TOP)/lib INCLUDESRC = $(TOP)/X11 UTILSRC = $(TOP)/util SCRIPTSRC = $(UTILSRC)/scripts CONTRIBSRC = ContribDir DEPENDSRC = DependDir IMAKESRC = $(CONFIGSRC) XLIBSRC = $(LIBSRC)/X XMUSRC = $(LIBSRC)/Xmu TOOLKITSRC = $(LIBSRC)/Xt AWIDGETSRC = $(LIBSRC)/Xaw OLDXLIBSRC = $(LIBSRC)/oldX XDMCPLIBSRC = $(LIBSRC)/Xdmcp EXTENSIONSRC = $(TOP)/extensions XILIBSRC = $(EXTENSIONSRC)/lib/xinput XTESTLIBSRC = $(EXTENSIONSRC)/lib/xtest /* * _Use - makes a choice based on UseInstalled. */ #ifndef _Use #ifdef UseInstalled #define _Use(a,b) a #else #define _Use(a,b) b #endif #endif /* * _UseCat - combination of _Use and Concat. * exists to avoid problems with some preprocessors */ #ifndef _UseCat #if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) #ifdef UseInstalled #define _UseCat(a,b,c) a##c #else #define _UseCat(a,b,c) b##c #endif #else #ifdef UseInstalled #define _UseCat(a,b,c) a/**/c #else #define _UseCat(a,b,c) b/**/c #endif #endif #endif #ifndef ShLibIncludeFile /* need this to make ANSI-style preprocessors happy */ #define ShLibIncludeFile #endif #include ShLibIncludeFile #if HasSharedLibraries SOXLIBREV = SharedXlibRev SOXTREV = SharedXtRev SOXAWREV = SharedXawRev SOOLDXREV = SharedOldXRev SOXMUREV = SharedXmuRev SOXEXTREV = SharedXextRev SOXINPUTREV = SharedXinputRev SOXTESTREV = SharedXTestRev SOXTRAPREV = SharedXTrapRev SOPEXREV = SharedPexRev #endif #if !SharedLibXext DEPEXTENSIONLIB = _UseCat($(USRLIBDIR),$(EXTENSIONSRC)/lib,/libXext.a) EXTENSIONLIB = LoaderLibPrefix _Use(-lXext, $(DEPEXTENSIONLIB)) #endif #if !SharedLibX DEPXLIB = $(DEPEXTENSIONLIB) _UseCat($(USRLIBDIR),$(XLIBSRC),/libX11.a) XLIBONLY = LoaderLibPrefix _Use(-lX11,$(XLIBSRC)/libX11.a) XLIB = $(EXTENSIONLIB) $(XLIBONLY) #endif DEPXAUTHLIB = _UseCat($(USRLIBDIR),$(XAUTHSRC),/libXau.a) XAUTHLIB = LoaderLibPrefix _Use(-lXau,$(DEPXAUTHLIB)) DEPXDMCPLIB = _UseCat($(USRLIBDIR),$(XDMCPLIBSRC),/libXdmcp.a) XDMCPLIB = LoaderLibPrefix _Use(-lXdmcp,$(DEPXDMCPLIB)) #if !SharedLibXmu DEPXMULIB = _UseCat($(USRLIBDIR),$(XMUSRC),/libXmu.a) XMULIB = LoaderLibPrefix _Use(-lXmu,$(DEPXMULIB)) #endif #if !SharedOldLibX DEPOLDXLIB = _UseCat($(USRLIBDIR),$(OLDXLIBSRC),/liboldX.a) OLDXLIB = LoaderLibPrefix _Use(-loldX,$(DEPOLDXLIB)) #endif #if !SharedLibXt DEPXTOOLLIB = _UseCat($(USRLIBDIR),$(TOOLKITSRC),/libXt.a) XTOOLLIB = LoaderLibPrefix _Use(-lXt,$(DEPXTOOLLIB)) #endif #if !SharedLibXaw DEPXAWLIB = _UseCat($(USRLIBDIR),$(AWIDGETSRC),/libXaw.a) XAWLIB = LoaderLibPrefix _Use(-lXaw,$(DEPXAWLIB)) #endif #if !SharedLibXinput DEPXILIB = _UseCat($(USRLIBDIR),$(XILIBSRC),/libXi.a) XILIB = LoaderLibPrefix _Use(-lXi,$(DEPXILIB)) #endif #if !SharedLibXTest DEPXTESTLIB = _UseCat($(USRLIBDIR),$(XTESTLIBSRC),/libXtst.a) XTESTLIB = LoaderLibPrefix _Use(-lXtst,$(DEPXTESTLIB)) #endif #if !SharedLibPex DEPPEXLIB = _UseCat($(USRLIBDIR),$(PEXLIBSRC),/libPEX5.a) PEXLIB = LoaderLibPrefix _Use(-lPEX5,$(DEPPEXLIB)) #endif #if !SharedLibPhigs DEPPHIGSLIB = _UseCat($(USRLIBDIR),$(PHIGSLIBSRC),/libphigs.a) PHIGSLIB = LoaderLibPrefix _Use(-lphigs,$(DEPPHIGSLIB)) #endif DEPXBSDLIB = _UseCat($(USRLIBDIR),$(LIBSRC)/Berk,/libXbsd.a) XBSDLIB = LoaderLibPrefix _Use(-lXbsd,$(DEPXBSDLIB)) LINTEXTENSIONLIB = _UseCat($(LINTLIBDIR),$(EXTENSIONSRC)/lib,/llib-lXext.ln) LINTXLIB = _UseCat($(LINTLIBDIR),$(XLIBSRC),/llib-lX11.ln) LINTXMU = _UseCat($(LINTLIBDIR),$(XMUSRC),/llib-lXmu.ln) LINTXTOOL = _UseCat($(LINTLIBDIR),$(TOOLKITSRC),/llib-lXt.ln) LINTXAW = _UseCat($(LINTLIBDIR),$(AWIDGETSRC),/llib-lXaw.ln) LINTXI = _UseCat($(LINTLIBDIR),$(XILIBSRC),/llib-lXi.ln) LINTPEX = _UseCat($(LINTLIBDIR),$(PEXLIBSRC),/llib-lPEX5.ln) LINTPHIGS = _UseCat($(LINTLIBDIR),$(PHIGSLIBSRC),/llib-lphigs.ln) #ifndef XawClientDepLibs #define XawClientDepLibs $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB) #endif #ifndef XawClientLibs #define XawClientLibs $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB) #endif #ifndef NeedDefaultDepLibs #define NeedDefaultDepLibs YES #endif #if NeedDefaultDepLibs /* * Individual libraries should override this */ #if HasSharedLibraries || UseInstalled DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB) #else DEPLIBS = $(LOCAL_LIBRARIES) #endif DEPLIBS1 = $(DEPLIBS) DEPLIBS2 = $(DEPLIBS) DEPLIBS3 = $(DEPLIBS) #endif /* NeedDefaultDepLibs */ /* * OMRON INPUT MATHOD MAKE ENV */ #if defined(uniosu) || (defined(SVR4) && !defined(DGUX)) || defined(hpux) #define termLibrary -lcurses #define cvtfileDir ./sysV #else #define termLibrary -ltermcap #define cvtfileDir ./bsd #endif #define WnnSpecialObjectRule(obj, depends, direct, define) @@\ obj : depends @@\ $(CC) -c $(CFLAGS) define direct/`basename $@ .o`.c @@\ #ifdef MakeDir #undef MakeDir #endif #define MakeDir(dir) DirFailPrefix@if [ -d dir ]; then set +x; \ @@\ else (set -x; $(MKDIRHIER) dir; chown $(WNNOWNER) dir); fi #ifdef MakeDirectory #undef MakeDirectory #endif #define MakeDirectory(step,dir) @@\ step:: @@\ MakeDir(dir) #define LinkDiffNameFile(src,dest,dir) @@\ src: dir/dest @@\ $(RM) $@ @@\ $(LN) $? $@ @@\ #ifdef MakeMakeSubdirs #undef MakeMakeSubdirs #endif #define MakeMakeSubdirs(dirs,target) @@\ target:: @@\ DirFailPrefix@case '${MFLAGS}' in *[ik]*) set +e;; esac; \ @@\ case '${MFLAGS}' in *n*) executeit="no";; esac; \ @@\ for i in dirs ;\ @@\ do \ @@\ echo "making Makefiles in $(CURRENT_DIR)/$$i..."; \ @@\ case "$$i" in \ @@\ ./?*/?*/?*/?*) newtop=../../../../;; \ @@\ ./?*/?*/?*) newtop=../../../;; \ @@\ ./?*/?*) newtop=../../;; \ @@\ ./?*) newtop=../;; \ @@\ */?*/?*/?*) newtop=../../../../;; \ @@\ */?*/?*) newtop=../../../;; \ @@\ */?*) newtop=../../;; \ @@\ *) newtop=../;; \ @@\ esac; \ @@\ case "$(TOP)" in \ @@\ /?*) imaketop= ;; \ @@\ *) imaketop=$$newtop ;; \ @@\ esac; \ @@\ cd $$i; \ @@\ $(RM) Makefile.bak; \ @@\ if [ -f Makefile ]; then \ @@\ echo " $(MV) Makefile Makefile.bak"; \ @@\ if [ "$$executeit" != "no" ]; then \ @@\ $(MV) Makefile Makefile.bak; \ @@\ fi; \ @@\ fi; \ @@\ if [ "$$executeit" != "no" ]; then \ @@\ ImakeSubCmdHelper -DTOPDIR=$$imaketop$(TOP) -DCURDIR=$(CURRENT_DIR)/$$i; \ @@\ fi; \ @@\ $(MAKE) $(MFLAGS) Makefiles; \ @@\ cd $$newtop; \ @@\ done #ifdef UseInstalled #define ImakeSubCmdHelper $(IMAKE_CMD) #else #define ImakeSubCmdHelper $$imaketop$(NEWTOP)$(IMAKE) -I$$imaketop$(NEWTOP)$(IMIRULESRC) -I$$imaketop$(NEWTOP)$(IRULESRC) $(IMAKE_DEFINES) #endif #define WnnInstallDicMultiple(list,dest) @@\ install:: list @@\ MakeDir($(DESTDIR)dest) @@\ @case '${MFLAGS}' in *[i]*) set +e;; esac; @@\ @for i in list; do if [ -f $(DESTDIR)dest/$$i ]; then \ @@\ set +x; \ @@\ else (set -x; \ @@\ $(INSTALL) -c $(INSTALLFLAGS) $$i $(DESTDIR)dest; \ @@\ $(WNNTOUCH) $(DESTDIR)dest/$$i); fi \ @@\ done /* * If you want to install dictionaries forcibly, set WnnInstallDicForcibly * as YES. Default is that dictionary isn't installed if it exist already. */ #ifndef WnnOwner #define WnnOwner wnn #endif #ifndef ImTop #define ImTop $(CONTRIBSRC)/im/Xsi #endif #ifndef WnnWnnDir #define WnnWnnDir /usr/local/lib/wnn6 #endif #ifndef WnnBinDir #define WnnBinDir /usr/local/bin #endif #ifndef WnnIncDir #define WnnIncDir $(INCROOT) #endif #ifndef WnnLibDir #define WnnLibDir $(USRLIBDIR) #endif WNNOWNER = WnnOwner IMTOP = ImTop WNNWNNDIR = WnnWnnDir WNNBINDIR = WnnBinDir WNNINCDIR = WnnIncRoot WNNLIBDIR = WnnLibDir WNNTERM_LIB = termLibrary PUBDICSRC = $(IMTOP)/Pubdic WNNCONSDICSRC = $(IMTOP)/Wnn-consortium/dic WNNTOP = $(IMTOP)/Wnn JWNNWNNDIR = $(WNNWNNDIR)/ja_JP JWNNBINDIR = $(WNNBINDIR)/Wnn6 JWNNINCDIR = $(WNNINCDIR)/wnn JWNNDICDIR = $(JWNNWNNDIR)/dic JWNNPUBDICDIR = $(JWNNDICDIR)/pubdic JWNNWNNCONSDICDIR = $(JWNNDICDIR)/wnncons JWNNFZKSRCDIR = $(JWNNDICDIR)/src WNNCONVSRC = $(WNNTOP)/conv WNNETCSRC = $(WNNTOP)/etc WNNFUZOKUGOSRC = $(WNNTOP)/fuzokugo WNNINCLUDESRC = $(WNNTOP)/include WNNJDSRC = $(WNNTOP)/jd WNNJLIBSRC = $(WNNTOP)/jlib WNNJLIBV3SRC = $(WNNTOP)/jlib.V3 WNNJSERVERSRC = $(WNNTOP)/jserver WNNDSERVERSRC = $(WNNTOP)/wnnds WNNJUTILSRC = $(WNNTOP)/jutil WNNLDSRC = $(WNNTOP)/ld WNNPUBDICSRC = $(WNNTOP)/pubdic WNNWNNCONSSRC = $(WNNTOP)/wnncons WNNWNNCONSDICSRC = $(WNNWNNCONSSRC)/dic WNNROMKANSRC = $(WNNTOP)/romkan WNNUUMSRC = $(WNNTOP)/uum WNNCNVFILEDIR = $(WNNJDSRC)/cvtfileDir WNNINCLUDES = -I$(WNNINCLUDESRC) -I$(WNNROMKANMSRC) WNNDEFINES = -DLIBDIR=\"$(WNNWNNDIR)\" WNNJLIB = $(WNNJLIBSRC)/libwnn6_fromsrc.a WNNCONVLIB = $(WNNCONVSRC)/libconvkey.a CWNNTOP = $(IMTOP)/cWnn CWNNWNNDIR = $(WNNWNNDIR)/zh_CN CWNNINCDIR = $(WNNINCDIR)/cwnn CWNNBINDIR = $(WNNBINDIR)/cWnn6 CWNNDICDIR = $(CWNNWNNDIR)/dic CWNNSYSDICDIR = $(CWNNDICDIR)/sys CWNNCDSRC = $(CWNNTOP)/cd CWNNCDICSRC = $(CWNNTOP)/cdic CWNNCONVSRC = $(CWNNTOP)/conv CWNNETCSRC = $(CWNNTOP)/etc CWNNFUZOKUGOSRC = $(CWNNTOP)/fuzokugo CWNNINCLUDESRC = $(CWNNTOP)/include CWNNJLIBSRC = $(CWNNTOP)/jlib CWNNJSERVERSRC = $(CWNNTOP)/jserver CWNNDSERVERSRC = $(CWNNTOP)/wnnds CWNNJUTILSRC = $(CWNNTOP)/jutil CWNNROMKANSRC = $(CWNNTOP)/romkan CWNNUUMSRC = $(CWNNTOP)/uum CWNNCNVFILEDIR = $(CWNNCDSRC)/cvtfileDir CWNNINCLUDES = -I$(CWNNINCLUDESRC) -I$(CWNNROMKANMSRC) CWNNDEFINES = -DLIBDIR=\"$(WNNWNNDIR)\" CWNNJLIB = $(CWNNJLIBSRC)/libcwnn.a CWNNCONVLIB = $(CWNNCONVSRC)/libconvkey.a TWNNWNNDIR = $(WNNWNNDIR)/zh_TW TWNNDICDIR = $(TWNNWNNDIR)/dic TWNNSYSDICDIR = $(TWNNDICDIR)/sys TWNNTDSRC = $(CWNNTOP)/td TWNNTDICSRC = $(CWNNTOP)/tdic LWNNWNNDIR = $(WNNWNNDIR)/lt_LN KWNNTOP = $(IMTOP)/kWnn KWNNWNNDIR = $(WNNWNNDIR)/ko_KR KWNNINCDIR = $(WNNINCDIR)/kwnn KWNNBINDIR = $(WNNBINDIR)/kWnn6 KWNNDICDIR = $(KWNNWNNDIR)/dic KWNNSYSDICDIR = $(KWNNDICDIR)/sys KWNNKDSRC = $(KWNNTOP)/kd KWNNKDICSRC = $(KWNNTOP)/kdic KWNNCONVSRC = $(KWNNTOP)/conv KWNNETCSRC = $(KWNNTOP)/etc KWNNFUZOKUGOSRC = $(KWNNTOP)/fuzokugo KWNNINCLUDESRC = $(KWNNTOP)/include KWNNJLIBSRC = $(KWNNTOP)/jlib KWNNJSERVERSRC = $(KWNNTOP)/jserver KWNNDSERVERSRC = $(KWNNTOP)/wnnds KWNNJUTILSRC = $(KWNNTOP)/jutil KWNNROMKANSRC = $(KWNNTOP)/romkan KWNNUUMSRC = $(KWNNTOP)/uum KWNNCNVFILEDIR = $(KWNNKDSRC)/cvtfileDir KWNNINCLUDES = -I$(KWNNINCLUDESRC) -I$(KWNNROMKANMSRC) KWNNDEFINES = -DLIBDIR=\"$(WNNWNNDIR)\" KWNNJLIB = $(KWNNJLIBSRC)/libkwnn.a KWNNCONVLIB = $(KWNNCONVSRC)/libconvkey.a WNNLANGDEF = -DJAPANESE CWNNLANGDEF = -DCHINESE TWNNLANGDEF = -DTAIWANESE KWNNLANGDEF = -DKOREAN LWNNLANGDEF = -DLATIN ALLLANGDEF = $(WNNLANGDEF) $(CWNNLANGDEF) $(KWNNLANGDEF) $(LWNNLANGDEF) XWNMOTOP = $(IMTOP)/Xwnmo XWNMOSRC = $(XWNMOTOP)/xwnmo XJUTILSRC = $(XWNMOTOP)/xjutil XWNMOROMKANSRC = $(XWNMOTOP)/romkan XWNMOJLIBSRC = $(XWNMOTOP)/jlib XWNMOJDSRC = $(XWNMOTOP)/jd XWNMOROMKANMSRC = $(XWNMOTOP)/romkan_m XWNMOINCLUDES = -I$(XWNMOROMKANMSRC) -I$(WNNINCLUDESRC) XWNMOJLIB = $(XWNMOJLIBSRC)/libwnn_m.a XWNMOLIBRARIES = $(XWNMOJLIB) XWNMODEFS = $(XVERSION) -DUSING_BUSHU -DATOK -DWIDGET -DEGBRIDGE XVERSION = -DX11R5 XCOMM -------------------------------------------------- XCOMM for SDK #define BuildWnn YES #define BuildJlib YES EXTRA_INCLUDES = EXTRA_DEFINES = EXTRA_LDOPTIONS = EXTRA_LIBRARIES = WSFLAGS = $(EXTRA_DEFINES) $(EXTRA_INCLUDES) LICENSE_LIB = XVERSION = -DUSE_INSTALLED IMAKEGFLAGS = $(WSFLAGS) -DUseInstalled -DNEED_DEFINE_LIB IMAKE = imake $(IMAKEGFLAGS) XCOMM -------------------------------------------------- IMIRULESRC = $(IMTOP)/config IMAKE_CMD = $(NEWTOP)$(IMAKE) -I$(NEWTOP)$(IMIRULESRC) \ -I$(NEWTOP)$(IRULESRC) $(IMAKE_DEFINES) wnn6-sdk-1.0.0/contrib/im/Xsi/config/Project.tmpl0000644000000000000000000004670007153676737020272 0ustar rootrootXCOMM XCOMM $Id: Project.tmpl,v 2.106 1999/04/12 09:24:33 matsui Exp $ XCOMM XCOMM ------------------------------------------------------------------------- #if defined(SunArchitecture) && defined(SVR4) #include "/usr/openwin/lib/config/Project.tmpl" #else /* Sun & SVR4 */ #if defined(LinuxArchitecture) || defined(FreeBSDArchitecture) || defined(NetBSDArchitecture) || defined(OpenBSDArchitecture) || defined(BSD386Architecture) #include "/usr/X11R6/lib/X11/config/Project.tmpl" #else /* Linux || *BSD */ #include "/usr/lib/X11/config/Project.tmpl" #endif /* Linux || *BSD */ #endif /* Sun & SVR4 */ #ifndef InstallAppDefFiles #define InstallAppDefFiles YES /* install application defaults */ #endif #ifdef uniosu #ifdef ManDirectoryRoot #undef ManDirectoryRoot #endif #define ManDirectoryRoot /usr/catman/w_man #endif #ifndef ManDirectoryRoot #ifdef ProjectRoot #define ManDirectoryRoot Concat(ProjectRoot,/man) #else #if SystemV4 #define ManDirectoryRoot /usr/share/man #else #define ManDirectoryRoot /usr/man #endif #endif #endif #ifndef ManSuffix #define ManSuffix n /* use just one tab or cpp will die */ #endif #ifndef LibManSuffix #define LibManSuffix 3 /* use just one tab or cpp will die */ #endif #ifndef ConnectionFlags #if (SystemV || SystemV4) && !HasSockets #define ConnectionFlags -DSTREAMSCONN #else #define ConnectionFlags -DTCPCONN -DUNIXCONN #endif #endif #ifndef ShmDefines #if HasShm #define ShmDefines -DMITSHM #else #define ShmDefines /**/ #endif #endif #ifndef BinDir #ifdef ProjectRoot #define BinDir Concat(ProjectRoot,/bin) #else #if ((defined LINUX) || (defined FREEBSD) || (defined BSDOS) || (defined NETBSD)) #define BinDir /usr/X11R6/bin #else #define BinDir /usr/bin/X11 #endif /* LINUX || FREEBSD || BSDOS || NETBSD */ #endif /* ProjectRoot */ #endif /* BinDir */ #ifndef BuildIncRoot #define BuildIncRoot $(TOP) #endif #ifndef BuildIncTop #define BuildIncTop .. /* relative to $(TOP)/X11 */ #endif #ifndef LibDir #define LibDir $(USRLIBDIR)/X11 #endif #ifndef ConfigDir #define ConfigDir $(LIBDIR)/config #endif #ifndef LintlibDir #define LintlibDir $(USRLIBDIR)/lint #endif #ifndef ManPath #define ManPath ManDirectoryRoot #endif #ifndef ManSourcePath #define ManSourcePath $(MANPATH)/man #endif #ifndef ManDir #define ManDir $(MANSOURCEPATH)$(MANSUFFIX) #endif #ifndef LibmanDir #define LibmanDir $(MANSOURCEPATH)$(LIBMANSUFFIX) #endif #ifndef XAppLoadDir #define XAppLoadDir $(LIBDIR)/app-defaults #endif #ifndef DefaultUserPath /* for xdm */ #define DefaultUserPath :/bin:/usr/bin:$(BINDIR):/usr/ucb #endif #ifndef DefaultSystemPath /* for xdm */ #define DefaultSystemPath /etc:/bin:/usr/bin:$(BINDIR):/usr/ucb #endif #ifndef DefaultSystemShell /* for xdm to set in SHELL */ #define DefaultSystemShell BourneShell #endif #ifndef UseCCMakeDepend /* use slow cc -E script */ #define UseCCMakeDepend NO #endif #ifndef DependDir #if UseCCMakeDepend #define DependDir $(SCRIPTSRC) #else #define DependDir $(UTILSRC)/makedepend #endif #endif #ifndef ContribDir #define ContribDir $(TOP)/../contrib /* contrib is outside core tree */ #endif #ifndef DependCmd #define DependCmd $(DEPENDSRC)/makedepend #endif #ifndef RemoveTargetProgramByMoving #define RemoveTargetProgramByMoving NO #endif #ifndef AllocateLocalDefines #define AllocateLocalDefines /**/ #endif #ifndef ForceNormalLib #define ForceNormalLib (HasSaberC | HasGcc) #endif #ifndef SharedLibX #define SharedLibX HasSharedLibraries #endif #ifndef NormalLibX #define NormalLibX (!SharedLibX | ForceNormalLib) #endif #ifndef SharedOldLibX #define SharedOldLibX HasSharedLibraries #endif #ifndef NormalOldLibX #define NormalOldLibX (!SharedOldLibX | ForceNormalLib) #endif #ifndef SharedLibXt #define SharedLibXt HasSharedLibraries #endif #ifndef NormalLibXt #define NormalLibXt (!SharedLibXt | ForceNormalLib) #endif #ifndef SharedLibXaw #define SharedLibXaw HasSharedLibraries #endif #ifndef NormalLibXaw #define NormalLibXaw (!SharedLibXaw | ForceNormalLib) #endif #ifndef SharedLibXmu #define SharedLibXmu HasSharedLibraries #endif #ifndef NormalLibXmu #define NormalLibXmu (!SharedLibXmu | ForceNormalLib) #endif #ifndef SharedLibXau #define SharedLibXau NO /* don't need shared form */ #endif #ifndef NormalLibXau #define NormalLibXau (!SharedLibXau | ForceNormalLib) #endif #ifndef SharedLibXdmcp #define SharedLibXdmcp NO /* don't need shared form */ #endif #ifndef NormalLibXdmcp #define NormalLibXdmcp (!SharedLibXdmcp | ForceNormalLib) #endif #ifndef SharedLibXext #define SharedLibXext HasSharedLibraries #endif #ifndef NormalLibXext #define NormalLibXext (!SharedLibXext | ForceNormalLib) #endif #ifndef SharedLibXinput #define SharedLibXinput HasSharedLibraries #endif #ifndef NormalLibXinput #define NormalLibXinput (!SharedLibXinput | ForceNormalLib) #endif #ifndef SharedLibXTest #define SharedLibXTest HasSharedLibraries #endif #ifndef NormalLibXTest #define NormalLibXTest (!SharedLibXTest | ForceNormalLib) #endif #ifndef SharedLibXTrap #define SharedLibXTrap HasSharedLibaries #endif #ifndef NormalLibXTrap #define NormalLibXTrap (!SharedLibXTrap | ForceNormalLib) #endif #ifndef SharedLibPex #define SharedLibPex HasSharedLibraries #endif #ifndef NormalLibPex #define NormalLibPex (!SharedLibPex | ForceNormalLib) #endif #ifndef SharedLibPhigs #define SharedLibPhigs NO /* XXX - haven't made it sharable yet */ #endif #ifndef NormalLibPhigs #define NormalLibPhigs (!SharedLibPhigs | ForceNormalLib) #endif XCOMM ------------------------------------------------------------------------- XCOMM X Window System make variables; this need to be coordinated with rules /* * This list must be reflected in the DIRS_TO_BUILD list in the top-level * Makefile. */ PATHSEP = / /* for building filenames */ USRLIBDIR = UsrLibDir /* nonshared libraries */ SHLIBDIR = ShLibDir /* shared libraries */ BINDIR = BinDir /* programs */ INCROOT = IncRoot /* base of where to put header files */ BUILDINCROOT = BuildIncRoot /* base of build loc */ BUILDINCDIR = $(BUILDINCROOT)/X11 BUILDINCTOP = BuildIncTop /* top relative to BUILDINCDIR */ INCDIR = $(INCROOT)/X11 /* header files, must end in X11 */ LIBDIR = LibDir /* rgb, XErrorDB, etc. */ CONFIGDIR = ConfigDir /* build configuration information */ LINTLIBDIR = LintlibDir /* lint libraries */ MANPATH = ManPath /* top of manual page tree */ MANSOURCEPATH = ManSourcePath /* prefix for man page sources */ MANSUFFIX = ManSuffix /* suffix for man pages */ LIBMANSUFFIX = LibManSuffix /* suffix for library man pages */ MANDIR = ManDir /* man pages for commands */ LIBMANDIR = LibmanDir /* man pages for library routines */ XAPPLOADDIR = XAppLoadDir /* application default resource dir */ INSTAPPFLAGS = $(INSTDATFLAGS) /* XXX - this should go away - XXX */ #ifdef UseInstalled IMAKE = imake /* assume BINDIR in path */ DEPEND = makedepend /* assume BINDIR in path */ MKDIRHIER = BourneShell $(BINDIR)/mkdirhier #else IMAKE = $(IMAKESRC)/imake DEPEND = DependCmd MKDIRHIER = BourneShell $(SCRIPTSRC)/mkdirhier.sh #endif CONFIGSRC = $(TOP)/config DOCUTILSRC = $(TOP)/doc/util LIBSRC = $(TOP)/lib INCLUDESRC = $(TOP)/X11 UTILSRC = $(TOP)/util SCRIPTSRC = $(UTILSRC)/scripts CONTRIBSRC = ContribDir DEPENDSRC = DependDir IMAKESRC = $(CONFIGSRC) XLIBSRC = $(LIBSRC)/X XMUSRC = $(LIBSRC)/Xmu TOOLKITSRC = $(LIBSRC)/Xt AWIDGETSRC = $(LIBSRC)/Xaw OLDXLIBSRC = $(LIBSRC)/oldX XDMCPLIBSRC = $(LIBSRC)/Xdmcp EXTENSIONSRC = $(TOP)/extensions XILIBSRC = $(EXTENSIONSRC)/lib/xinput XTESTLIBSRC = $(EXTENSIONSRC)/lib/xtest /* * _Use - makes a choice based on UseInstalled. */ #ifndef _Use #ifdef UseInstalled #define _Use(a,b) a #else #define _Use(a,b) b #endif #endif /* * _UseCat - combination of _Use and Concat. * exists to avoid problems with some preprocessors */ #ifndef _UseCat #if (__STDC__ && !defined(UnixCpp)) || defined(AnsiCpp) #ifdef UseInstalled #define _UseCat(a,b,c) a##c #else #define _UseCat(a,b,c) b##c #endif #else #ifdef UseInstalled #define _UseCat(a,b,c) a/**/c #else #define _UseCat(a,b,c) b/**/c #endif #endif #endif #ifndef ShLibIncludeFile /* need this to make ANSI-style preprocessors happy */ #define ShLibIncludeFile #endif #include ShLibIncludeFile #if HasSharedLibraries SOXLIBREV = SharedXlibRev SOXTREV = SharedXtRev SOXAWREV = SharedXawRev SOOLDXREV = SharedOldXRev SOXMUREV = SharedXmuRev SOXEXTREV = SharedXextRev SOXINPUTREV = SharedXinputRev SOXTESTREV = SharedXTestRev SOXTRAPREV = SharedXTrapRev SOPEXREV = SharedPexRev #endif #if !SharedLibXext DEPEXTENSIONLIB = _UseCat($(USRLIBDIR),$(EXTENSIONSRC)/lib,/libXext.a) EXTENSIONLIB = LoaderLibPrefix _Use(-lXext, $(DEPEXTENSIONLIB)) #endif #if !SharedLibX DEPXLIB = $(DEPEXTENSIONLIB) _UseCat($(USRLIBDIR),$(XLIBSRC),/libX11.a) XLIBONLY = LoaderLibPrefix _Use(-lX11,$(XLIBSRC)/libX11.a) XLIB = $(EXTENSIONLIB) $(XLIBONLY) #endif DEPXAUTHLIB = _UseCat($(USRLIBDIR),$(XAUTHSRC),/libXau.a) XAUTHLIB = LoaderLibPrefix _Use(-lXau,$(DEPXAUTHLIB)) DEPXDMCPLIB = _UseCat($(USRLIBDIR),$(XDMCPLIBSRC),/libXdmcp.a) XDMCPLIB = LoaderLibPrefix _Use(-lXdmcp,$(DEPXDMCPLIB)) #if !SharedLibXmu DEPXMULIB = _UseCat($(USRLIBDIR),$(XMUSRC),/libXmu.a) XMULIB = LoaderLibPrefix _Use(-lXmu,$(DEPXMULIB)) #endif #if !SharedOldLibX DEPOLDXLIB = _UseCat($(USRLIBDIR),$(OLDXLIBSRC),/liboldX.a) OLDXLIB = LoaderLibPrefix _Use(-loldX,$(DEPOLDXLIB)) #endif #if !SharedLibXt DEPXTOOLLIB = _UseCat($(USRLIBDIR),$(TOOLKITSRC),/libXt.a) XTOOLLIB = LoaderLibPrefix _Use(-lXt,$(DEPXTOOLLIB)) #endif #if !SharedLibXaw DEPXAWLIB = _UseCat($(USRLIBDIR),$(AWIDGETSRC),/libXaw.a) XAWLIB = LoaderLibPrefix _Use(-lXaw,$(DEPXAWLIB)) #endif #if !SharedLibXinput DEPXILIB = _UseCat($(USRLIBDIR),$(XILIBSRC),/libXi.a) XILIB = LoaderLibPrefix _Use(-lXi,$(DEPXILIB)) #endif #if !SharedLibXTest DEPXTESTLIB = _UseCat($(USRLIBDIR),$(XTESTLIBSRC),/libXtst.a) XTESTLIB = LoaderLibPrefix _Use(-lXtst,$(DEPXTESTLIB)) #endif #if !SharedLibPex DEPPEXLIB = _UseCat($(USRLIBDIR),$(PEXLIBSRC),/libPEX5.a) PEXLIB = LoaderLibPrefix _Use(-lPEX5,$(DEPPEXLIB)) #endif #if !SharedLibPhigs DEPPHIGSLIB = _UseCat($(USRLIBDIR),$(PHIGSLIBSRC),/libphigs.a) PHIGSLIB = LoaderLibPrefix _Use(-lphigs,$(DEPPHIGSLIB)) #endif DEPXBSDLIB = _UseCat($(USRLIBDIR),$(LIBSRC)/Berk,/libXbsd.a) XBSDLIB = LoaderLibPrefix _Use(-lXbsd,$(DEPXBSDLIB)) LINTEXTENSIONLIB = _UseCat($(LINTLIBDIR),$(EXTENSIONSRC)/lib,/llib-lXext.ln) LINTXLIB = _UseCat($(LINTLIBDIR),$(XLIBSRC),/llib-lX11.ln) LINTXMU = _UseCat($(LINTLIBDIR),$(XMUSRC),/llib-lXmu.ln) LINTXTOOL = _UseCat($(LINTLIBDIR),$(TOOLKITSRC),/llib-lXt.ln) LINTXAW = _UseCat($(LINTLIBDIR),$(AWIDGETSRC),/llib-lXaw.ln) LINTXI = _UseCat($(LINTLIBDIR),$(XILIBSRC),/llib-lXi.ln) LINTPEX = _UseCat($(LINTLIBDIR),$(PEXLIBSRC),/llib-lPEX5.ln) LINTPHIGS = _UseCat($(LINTLIBDIR),$(PHIGSLIBSRC),/llib-lphigs.ln) #ifndef XawClientDepLibs #define XawClientDepLibs $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB) #endif #ifndef XawClientLibs #define XawClientLibs $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB) #endif #ifndef NeedDefaultDepLibs #define NeedDefaultDepLibs YES #endif #if NeedDefaultDepLibs /* * Individual libraries should override this */ #if HasSharedLibraries || UseInstalled DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB) #else DEPLIBS = $(LOCAL_LIBRARIES) #endif DEPLIBS1 = $(DEPLIBS) DEPLIBS2 = $(DEPLIBS) DEPLIBS3 = $(DEPLIBS) #endif /* NeedDefaultDepLibs */ /* * OMRON INPUT MATHOD MAKE ENV */ #if defined(uniosu) || (defined(SVR4) && !defined(DGUX)) || defined(hpux) #define termLibrary -lcurses #define cvtfileDir ./sysV #else #define termLibrary -ltermcap #define cvtfileDir ./bsd #endif #define WnnSpecialObjectRule(obj, depends, direct, define) @@\ obj : depends @@\ $(CC) -c $(CFLAGS) define direct/`basename $@ .o`.c @@\ #ifdef MakeDir #undef MakeDir #endif #define MakeDir(dir) DirFailPrefix@if [ -d dir ]; then set +x; \ @@\ else (set -x; $(MKDIRHIER) dir; chown $(WNNOWNER) dir); fi #ifdef MakeDirectory #undef MakeDirectory #endif #define MakeDirectory(step,dir) @@\ step:: @@\ MakeDir(dir) #define LinkDiffNameFile(src,dest,dir) @@\ src: dir/dest @@\ $(RM) $@ @@\ $(LN) $? $@ @@\ #ifdef MakeMakeSubdirs #undef MakeMakeSubdirs #endif #define MakeMakeSubdirs(dirs,target) @@\ target:: @@\ DirFailPrefix@case '${MFLAGS}' in *[ik]*) set +e;; esac; \ @@\ case '${MFLAGS}' in *n*) executeit="no";; esac; \ @@\ for i in dirs ;\ @@\ do \ @@\ echo "making Makefiles in $(CURRENT_DIR)/$$i..."; \ @@\ case "$$i" in \ @@\ ./?*/?*/?*/?*) newtop=../../../../;; \ @@\ ./?*/?*/?*) newtop=../../../;; \ @@\ ./?*/?*) newtop=../../;; \ @@\ ./?*) newtop=../;; \ @@\ */?*/?*/?*) newtop=../../../../;; \ @@\ */?*/?*) newtop=../../../;; \ @@\ */?*) newtop=../../;; \ @@\ *) newtop=../;; \ @@\ esac; \ @@\ case "$(TOP)" in \ @@\ /?*) imaketop= ;; \ @@\ *) imaketop=$$newtop ;; \ @@\ esac; \ @@\ cd $$i; \ @@\ $(RM) Makefile.bak; \ @@\ if [ -f Makefile ]; then \ @@\ echo " $(MV) Makefile Makefile.bak"; \ @@\ if [ "$$executeit" != "no" ]; then \ @@\ $(MV) Makefile Makefile.bak; \ @@\ fi; \ @@\ fi; \ @@\ if [ "$$executeit" != "no" ]; then \ @@\ ImakeSubCmdHelper -DTOPDIR=$$imaketop$(TOP) -DCURDIR=$(CURRENT_DIR)/$$i; \ @@\ fi; \ @@\ $(MAKE) $(MFLAGS) Makefiles; \ @@\ cd $$newtop; \ @@\ done #ifdef UseInstalled #define ImakeSubCmdHelper $(IMAKE_CMD) #else #define ImakeSubCmdHelper $$imaketop$(NEWTOP)$(IMAKE) -I$$imaketop$(NEWTOP)$(IMIRULESRC) -I$$imaketop$(NEWTOP)$(IRULESRC) $(IMAKE_DEFINES) #endif #define WnnInstallDicMultiple(list,dest) @@\ install:: list @@\ MakeDir($(DESTDIR)dest) @@\ @case '${MFLAGS}' in *[i]*) set +e;; esac; @@\ @for i in list; do if [ -f $(DESTDIR)dest/$$i ]; then \ @@\ set +x; \ @@\ else (set -x; \ @@\ $(INSTALL) -c $(INSTALLFLAGS) $$i $(DESTDIR)dest; \ @@\ $(WNNTOUCH) $(DESTDIR)dest/$$i); fi \ @@\ done /* * If you want to install dictionaries forcibly, set WnnInstallDicForcibly * as YES. Default is that dictionary isn't installed if it exist already. */ #ifndef WnnOwner #define WnnOwner wnn #endif #ifndef ImTop #define ImTop $(CONTRIBSRC)/im/Xsi #endif #ifndef WnnWnnDir #define WnnWnnDir /usr/local/lib/wnn6 #endif #ifndef WnnBinDir #define WnnBinDir /usr/local/bin #endif #ifndef WnnIncDir #define WnnIncDir $(INCROOT) #endif #ifndef WnnLibDir #define WnnLibDir $(USRLIBDIR) #endif WNNOWNER = WnnOwner IMTOP = ImTop WNNWNNDIR = WnnWnnDir WNNBINDIR = WnnBinDir WNNINCDIR = WnnIncRoot WNNLIBDIR = WnnLibDir WNNTERM_LIB = termLibrary PUBDICSRC = $(IMTOP)/Pubdic WNNCONSDICSRC = $(IMTOP)/Wnn-consortium/dic WNNTOP = $(IMTOP)/Wnn JWNNWNNDIR = $(WNNWNNDIR)/ja_JP JWNNBINDIR = $(WNNBINDIR)/Wnn6 JWNNINCDIR = $(WNNINCDIR)/wnn JWNNDICDIR = $(JWNNWNNDIR)/dic JWNNPUBDICDIR = $(JWNNDICDIR)/pubdic JWNNWNNCONSDICDIR = $(JWNNDICDIR)/wnncons JWNNFZKSRCDIR = $(JWNNDICDIR)/src WNNCONVSRC = $(WNNTOP)/conv WNNETCSRC = $(WNNTOP)/etc WNNFUZOKUGOSRC = $(WNNTOP)/fuzokugo WNNINCLUDESRC = $(WNNTOP)/include WNNJDSRC = $(WNNTOP)/jd WNNJLIBSRC = $(WNNTOP)/jlib WNNJLIBV3SRC = $(WNNTOP)/jlib.V3 WNNJSERVERSRC = $(WNNTOP)/jserver WNNDSERVERSRC = $(WNNTOP)/wnnds WNNJUTILSRC = $(WNNTOP)/jutil WNNLDSRC = $(WNNTOP)/ld WNNPUBDICSRC = $(WNNTOP)/pubdic WNNWNNCONSSRC = $(WNNTOP)/wnncons WNNWNNCONSDICSRC = $(WNNWNNCONSSRC)/dic WNNROMKANSRC = $(WNNTOP)/romkan WNNUUMSRC = $(WNNTOP)/uum WNNCNVFILEDIR = $(WNNJDSRC)/cvtfileDir WNNINCLUDES = -I$(WNNINCLUDESRC) -I$(WNNROMKANMSRC) WNNDEFINES = -DLIBDIR=\"$(WNNWNNDIR)\" WNNJLIB = $(WNNJLIBSRC)/libwnn6_fromsrc.a WNNCONVLIB = $(WNNCONVSRC)/libconvkey.a CWNNTOP = $(IMTOP)/cWnn CWNNWNNDIR = $(WNNWNNDIR)/zh_CN CWNNINCDIR = $(WNNINCDIR)/cwnn CWNNBINDIR = $(WNNBINDIR)/cWnn6 CWNNDICDIR = $(CWNNWNNDIR)/dic CWNNSYSDICDIR = $(CWNNDICDIR)/sys CWNNCDSRC = $(CWNNTOP)/cd CWNNCDICSRC = $(CWNNTOP)/cdic CWNNCONVSRC = $(CWNNTOP)/conv CWNNETCSRC = $(CWNNTOP)/etc CWNNFUZOKUGOSRC = $(CWNNTOP)/fuzokugo CWNNINCLUDESRC = $(CWNNTOP)/include CWNNJLIBSRC = $(CWNNTOP)/jlib CWNNJSERVERSRC = $(CWNNTOP)/jserver CWNNDSERVERSRC = $(CWNNTOP)/wnnds CWNNJUTILSRC = $(CWNNTOP)/jutil CWNNROMKANSRC = $(CWNNTOP)/romkan CWNNUUMSRC = $(CWNNTOP)/uum CWNNCNVFILEDIR = $(CWNNCDSRC)/cvtfileDir CWNNINCLUDES = -I$(CWNNINCLUDESRC) -I$(CWNNROMKANMSRC) CWNNDEFINES = -DLIBDIR=\"$(WNNWNNDIR)\" CWNNJLIB = $(CWNNJLIBSRC)/libcwnn.a CWNNCONVLIB = $(CWNNCONVSRC)/libconvkey.a TWNNWNNDIR = $(WNNWNNDIR)/zh_TW TWNNDICDIR = $(TWNNWNNDIR)/dic TWNNSYSDICDIR = $(TWNNDICDIR)/sys TWNNTDSRC = $(CWNNTOP)/td TWNNTDICSRC = $(CWNNTOP)/tdic LWNNWNNDIR = $(WNNWNNDIR)/lt_LN KWNNTOP = $(IMTOP)/kWnn KWNNWNNDIR = $(WNNWNNDIR)/ko_KR KWNNINCDIR = $(WNNINCDIR)/kwnn KWNNBINDIR = $(WNNBINDIR)/kWnn6 KWNNDICDIR = $(KWNNWNNDIR)/dic KWNNSYSDICDIR = $(KWNNDICDIR)/sys KWNNKDSRC = $(KWNNTOP)/kd KWNNKDICSRC = $(KWNNTOP)/kdic KWNNCONVSRC = $(KWNNTOP)/conv KWNNETCSRC = $(KWNNTOP)/etc KWNNFUZOKUGOSRC = $(KWNNTOP)/fuzokugo KWNNINCLUDESRC = $(KWNNTOP)/include KWNNJLIBSRC = $(KWNNTOP)/jlib KWNNJSERVERSRC = $(KWNNTOP)/jserver KWNNDSERVERSRC = $(KWNNTOP)/wnnds KWNNJUTILSRC = $(KWNNTOP)/jutil KWNNROMKANSRC = $(KWNNTOP)/romkan KWNNUUMSRC = $(KWNNTOP)/uum KWNNCNVFILEDIR = $(KWNNKDSRC)/cvtfileDir KWNNINCLUDES = -I$(KWNNINCLUDESRC) -I$(KWNNROMKANMSRC) KWNNDEFINES = -DLIBDIR=\"$(WNNWNNDIR)\" KWNNJLIB = $(KWNNJLIBSRC)/libkwnn.a KWNNCONVLIB = $(KWNNCONVSRC)/libconvkey.a WNNLANGDEF = -DJAPANESE CWNNLANGDEF = -DCHINESE TWNNLANGDEF = -DTAIWANESE KWNNLANGDEF = -DKOREAN LWNNLANGDEF = -DLATIN ALLLANGDEF = $(WNNLANGDEF) $(CWNNLANGDEF) $(KWNNLANGDEF) $(LWNNLANGDEF) XWNMOTOP = $(IMTOP)/Xwnmo XWNMOSRC = $(XWNMOTOP)/xwnmo XJUTILSRC = $(XWNMOTOP)/xjutil XWNMOROMKANSRC = $(XWNMOTOP)/romkan XWNMOJLIBSRC = $(XWNMOTOP)/jlib XWNMOJDSRC = $(XWNMOTOP)/jd XWNMOROMKANMSRC = $(XWNMOTOP)/romkan_m XWNMOINCLUDES = -I$(XWNMOROMKANMSRC) -I$(WNNINCLUDESRC) XWNMOJLIB = $(XWNMOJLIBSRC)/libwnn_m.a XWNMOLIBRARIES = $(XWNMOJLIB) XWNMODEFS = $(XVERSION) -DUSING_BUSHU -DATOK -DWIDGET -DEGBRIDGE XVERSION = -DX11R5 XCOMM -------------------------------------------------- XCOMM for SDK #define BuildWnn YES #define BuildJlib YES EXTRA_INCLUDES = EXTRA_DEFINES = EXTRA_LDOPTIONS = EXTRA_LIBRARIES = WSFLAGS = $(EXTRA_DEFINES) $(EXTRA_INCLUDES) LICENSE_LIB = XVERSION = -DUSE_INSTALLED IMAKEGFLAGS = $(WSFLAGS) -DUseInstalled -DNEED_DEFINE_LIB IMAKE = imake $(IMAKEGFLAGS) XCOMM -------------------------------------------------- IMIRULESRC = $(IMTOP)/config IMAKE_CMD = $(NEWTOP)$(IMAKE) -I$(NEWTOP)$(IMIRULESRC) \ -I$(NEWTOP)$(IRULESRC) $(IMAKE_DEFINES) wnn6-sdk-1.0.0/contrib/im/Xsi/Makefile.ini0000644000000000000000000000331107153676737016726 0ustar rootroot# # $Id: Makefile.ini,v 2.24 1999/02/26 05:09:17 yamasita Exp $ # # If TOP dir is not "../../mit", set TOP. # If CONTRIBSRC is not "$(TOP)/../contrib", set CURRENT_DIR and ContribDir # in a configration file. SHELL = /bin/sh RM = rm -f MV = mv MAKE = make TOP = `pwd`/../../../contrib CURRENT_DIR = ./../contrib/im/Xsi # CONFIGSRC = /usr/lib/X11/config # CONFIGSRC = /usr/openwin/lib/X11/config CONFIGSRC = /usr/X11R6/lib/X11/config IMAKESRC = $(CONFIGSRC) IRULESRC = $(CONFIGSRC) WSFLAGS = IMAKEGFLAGS = $(WSFLAGS) -DUseInstalled IMAKE = imake $(IMAKEGFLAGS) IMTOP = $(TOP)/$(CURRENT_DIR) IMIRULESRC = $(IMTOP)/config IMAKE_CMD = $(NEWTOP)$(IMAKE) -I$(NEWTOP)$(IMIRULESRC) -I$(NEWTOP)$(IRULESRC) $(IMAKE_DEFINES) all: @case "Use make World instead, and set TOP and CONTRIBDIR if necessary" World:: @echo "" @echo "Building Input Method." @echo "" @date @echo "" -$(RM) Makefile.bak; $(MV) Makefile Makefile.bak $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) $(MAKE) $(MFLAGS) Makefiles $(MAKE) $(MFLAGS) clean $(MAKE) $(MFLAGS) includes $(MAKE) $(MFLAGS) depend $(MAKE) $(MFLAGS) $(WORLDOPTS) @echo "" @date @echo "" @echo "Full build of Input Method." @echo "" Everything:: @echo "" @echo "Rebuilding Input Method." @echo "" @date @echo "" -$(RM) Makefile.bak; $(MV) Makefile Makefile.bak $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR) $(MAKE) $(MFLAGS) Makefiles $(MAKE) $(MFLAGS) includes $(MAKE) $(MFLAGS) depend $(MAKE) $(MFLAGS) $(WORLDOPTS) @echo "" @date @echo "" @echo "Rebuild of Input Method." @echo "" wnn6-sdk-1.0.0/contrib/im/Xsi/Imakefile0000644000000000000000000000173107153676737016325 0ustar rootrootXCOMM XCOMM $Id: Imakefile,v 2.5 1998/09/28 02:12:14 yamasita Exp $ XCOMM #define IHaveSubdirs #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' WNNDIR = Wnn SUBDIRS= $(WNNDIR) MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) World:: @echo "" @echo "Building Input Method." @echo "" @date @echo "" -$(RM) Makefile.bak; $(MV) Makefile Makefile.bak $(MAKE) $(MFLAGS) -f Makefile.bak Makefile $(MAKE) $(MFLAGS) Makefiles $(MAKE) $(MFLAGS) clean $(MAKE) $(MFLAGS) includes $(MAKE) $(MFLAGS) depend $(MAKE) $(MFLAGS) $(WORLDOPTS) @echo "" @date @echo "" @echo "Full build of Input Method." @echo "" Everything:: @echo "" @echo "Rebuilding Input Method." @echo "" @date @echo "" -$(RM) Makefile.bak; $(MV) Makefile Makefile.bak $(MAKE) $(MFLAGS) -f Makefile.bak Makefile $(MAKE) $(MFLAGS) Makefiles $(MAKE) $(MFLAGS) includes $(MAKE) $(MFLAGS) depend $(MAKE) $(MFLAGS) $(WORLDOPTS) @echo "" @date @echo "" @echo "Rebuild of Input Method." @echo "" wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/0002755000000000000000000000000007153676736015255 5ustar rootrootwnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/etc/0002755000000000000000000000000007153676736016030 5ustar rootrootwnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/etc/strings.c0000644000000000000000000002053407153676736017667 0ustar rootroot/* * $Id: strings.c,v 2.3.2.1 2000/08/04 05:37:06 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ /* long strings library. Copyed from GMW programs!! */ #include #include "commonhd.h" #include "wnn_string.h" #ifndef NULL #define NULL 0 #endif #define is_half_width(c) (! is_full_width(c)) #define is_full_width(c) (((c) & 0xff00)) #define is_gaiji(c) (is_full_width(c) && ! ((c) & 0x8080)) #define is_jis_kanji(c) (((c) & 0x8080) == 0x8080) w_char *wnn_Strcat(s1,s2) register w_char *s1; register w_char *s2; { register w_char *d; for (d = s1;*d++ != 0;); for (--d;(*d++ = *s2++) != 0;); return s1; } w_char *wnn_Strncat(s1,s2,n) register w_char *s1; register w_char *s2; register int n; { register w_char *d; for (d = s1;*d++ != 0;); for (--d;n > 0 && (*d++ = *s2++) != 0;n--); if (n <= 0) { *d = 0; return d; } else { return --d; } } int wnn_Strcmp(s1,s2) register w_char *s1; register w_char *s2; { for (;*s1 != 0 && *s1 == *s2;s1++, s2++); if(*s1 > *s2) return 1; if(*s1 == *s2) return 0; return(-1); /* return (int)(*s1 - *s2); Since w_char, it is always positive */ } /* s1 is substr of s2? then return 1*/ int wnn_Substr(s1, s2) register w_char *s1; register w_char *s2; { for (;*s1 != 0 && *s1 == *s2;s1++, s2++); return (int)(!*s1); } int wnn_Strncmp(s1,s2,n) register w_char *s1; register w_char *s2; register int n; { if(n == 0)return(0); for (;n > 0 && *s1++ == *s2++;n--); return (int)(*--s1 - *--s2); } w_char *wnn_Strcpy(s1,s2) register w_char *s1; register w_char *s2; { register w_char *d; for (d = s1;(*d++ = *s2++) != 0;); return s1; } w_char *wnn_Strncpy(s1,s2,n) register w_char *s1; register w_char *s2; register int n; { /* register w_char *d; for (d = s1;n > 0;n--) { *d++ = *s2++; } return s1; */ if (s2 > s1) { for ( ; n-- > 0; ) { *s1++ = *s2++; } } else if (s2 < s1) { s1 += n - 1; s2 += n - 1; for ( ; n-- > 0; ) { *s1-- = *s2--; } } return s1; } int wnn_Strlen(s) register w_char *s; { register int n; for (n = 0;*s++ != 0;n++); return n; } void wnn_Sreverse(d, s) w_char *d, *s; { w_char *s0; s0 = s; for(;*s++;); s--; for(;--s >= s0;){ *d++ = *s; } *d = 0; } wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/etc/serverdefs.c0000644000000000000000000002124107153676736020342 0ustar rootroot/* * $Id: serverdefs.c,v 2.6.2.1 2000/08/04 05:37:06 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ #include #include #ifdef UX386 #include #else #include #endif #include "commonhd.h" #include "config.h" #include "serverdefs.h" #define MACHINE_NAME 1 #define UNIXDOMAIN_NAME 2 #define SERVICE_NAME 3 #define SERVICE_PORT_NUM 4 #define SERVERENV_NAME 5 typedef struct _server_env_struct { char *lang; char *env; } server_env_struct; static server_env_struct server_env[] = { {WNN_J_LANG, WNN_JSERVER_ENV}, {WNN_C_LANG, WNN_CSERVER_ENV}, {WNN_K_LANG, WNN_KSERVER_ENV}, {WNN_T_LANG, WNN_TSERVER_ENV}, {NULL, NULL} }; static char * get_default_server_env(lang) register char *lang; { register server_env_struct *p; if (!lang || !*lang) return(NULL); for (p = server_env; p->lang; p++) { if (!strncmp(lang, p->lang, strlen(lang))) { return(p->env); } } return(NULL); } static char * get_serverdefs(lang, cnt) char *lang; int cnt; { FILE *fp; static char s[7][EXPAND_PATH_LENGTH]; char serv_defs[EXPAND_PATH_LENGTH]; char data[1024]; int num; strcpy(serv_defs, LIBDIR); strcat(serv_defs, SERVERDEFS_FILE); if ((fp = fopen(serv_defs, "r")) == NULL) { return(NULL); } if (!lang || !*lang) lang = "ja_JP"; while (fgets(data, 1024, fp) != NULL) { num = sscanf(data, "%s %s %s %s %s %s %s", s[0],s[1],s[2],s[3],s[4],s[5],s[6]); if ((num < 4) || s[0][0] == ';') { continue; } if (!strncmp(lang, s[0], strlen(s[0]))) { fclose(fp); if (cnt >= num) return(NULL); if (strlen(s[cnt]) == strlen("NULL") && !strcmp(s[cnt], "NULL")) { return(NULL); } else { return(s[cnt]); } } } fclose(fp); return(NULL); } char * wnn_get_machine_of_serverdefs(lang) char *lang; { return(get_serverdefs(lang, MACHINE_NAME)); } char * wnn_get_unixdomain_of_serverdefs(lang) char *lang; { return(get_serverdefs(lang, UNIXDOMAIN_NAME)); } char * wnn_get_service_of_serverdefs(lang) char *lang; { return(get_serverdefs(lang, SERVICE_NAME)); } int wnn_get_port_num_of_serverdefs(lang) char *lang; { char *port_char; if ((port_char = get_serverdefs(lang, SERVICE_PORT_NUM)) == NULL) { return(-1); } else { return(atoi(port_char)); } } char * wnn_get_serverenv_of_serverdefs(lang) char *lang; { char *serverenv; if (!(serverenv = get_serverdefs(lang, SERVERENV_NAME))) { return(get_default_server_env(lang)); } else { return(serverenv); } } wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/etc/zy_table.c0000644000000000000000000004175207153676736020014 0ustar rootroot/* * $Id: zy_table.c,v 2.1.2.1 2000/08/04 05:37:07 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /** cWnn Version 1.1 **/ #include #include "commonhd.h" #ifdef CHINESE #include "cplib.h" /* zy_shengmu_tbl: ShengMu table of Chinese ZhuYin */ char *zy_shengmu_tbl[ZY_NUM_SHENGMU] = { "", "ŽÅ", "ŽØ", "ŽÔ", "ŽÉ", /* "", "B", "C", "Ch", "D", */ "ŽÈ", "ŽÍ", "ŽÏ", "ŽÐ", "ŽÎ", /* "F", "G", "H", "J", "K", */ "ŽÌ", "ŽÇ", "ŽË", "ŽÆ", "ŽÑ", /* "L", "M", "N", "P", "Q", */ "ŽÖ", "ŽÙ", "ŽÕ", "ŽÊ", "Žè", /* "R", "S", "Sh", "T", "W", */ "ŽÒ", "Žç", "Ž×", "ŽÓ" /* "X", "Y", "Z", "Zh" */ }; /* zy_yunmu_tbl: YunMu table of Chinese ZhuYin */ char *zy_yunmu_tbl[ZY_NUM_YUNMU*5] = { /* 3.20 "", "", "", "", "", */ "ŽÀ", "ŽÁ", "ŽÂ", "ŽÃ", "ŽÄ", /* a */ "ŽÚŽÀ", "ŽÚŽÁ", "ŽÚŽÂ", "ŽÚŽÃ", "ŽÚŽÄ", /* a */ "ŽÞŽÀ", "ŽÞŽÁ", "ŽÞŽÂ", "ŽÞŽÃ", "ŽÞŽÄ", /* ai */ "ŽâŽÀ", "ŽâŽÁ", "ŽâŽÂ", "ŽâŽÃ", "ŽâŽÄ", /* an */ "ŽäŽÀ", "ŽäŽÁ", "ŽäŽÂ", "ŽäŽÃ", "ŽäŽÄ", /* ang */ "ŽàŽÀ", "ŽàŽÁ", "ŽàŽÂ", "ŽàŽÃ", "ŽàŽÄ", /* ao */ "ŽÜŽÀ", "ŽÜŽÁ", "ŽÜŽÂ", "ŽÜŽÃ", "ŽÜŽÄ", /* e */ "ŽßŽÀ", "ŽßŽÁ", "ŽßŽÂ", "ŽßŽÃ", "ŽßŽÄ", /* ei */ "ŽãŽÀ", "ŽãŽÁ", "ŽãŽÂ", "ŽãŽÃ", "ŽãŽÄ", /* en */ "ŽåŽÀ", "ŽåŽÁ", "ŽåŽÂ", "ŽåŽÃ", "ŽåŽÄ", /* eng */ "ŽæŽÀ", "ŽæŽÁ", "ŽæŽÂ", "ŽæŽÃ", "ŽæŽÄ", /* er */ "ŽçŽÀ", "ŽçŽÁ", "ŽçŽÂ", "ŽçŽÃ", "ŽçŽÄ", /* i */ "ŽçŽÚŽÀ", "ŽçŽÚŽÁ", "ŽçŽÚŽÂ", "ŽçŽÚŽÃ", "ŽçŽÚŽÄ", /* ia */ "ŽçŽâŽÀ", "ŽçŽâŽÁ", "ŽçŽâŽÂ", "ŽçŽâŽÃ", "ŽçŽâŽÄ", /* ian */ "ŽçŽäŽÀ", "ŽçŽäŽÁ", "ŽçŽäŽÂ", "ŽçŽäŽÃ", "ŽçŽäŽÄ", /* iang */ "ŽçŽàŽÀ", "ŽçŽàŽÁ", "ŽçŽàŽÂ", "ŽçŽàŽÃ", "ŽçŽàŽÄ", /* iao */ "ŽçŽÝŽÀ", "ŽçŽÝŽÁ", "ŽçŽÝŽÂ", "ŽçŽÝŽÃ", "ŽçŽÝŽÄ", /* ie */ "ŽçŽãŽÀ", "ŽçŽãŽÁ", "ŽçŽãŽÂ", "ŽçŽãŽÃ", "ŽçŽãŽÄ", /* in */ "ŽçŽåŽÀ", "ŽçŽåŽÁ", "ŽçŽåŽÂ", "ŽçŽåŽÃ", "ŽçŽåŽÄ", /* ing */ "ŽéŽåŽÀ", "ŽéŽåŽÁ", "ŽéŽåŽÂ", "ŽéŽåŽÃ", "ŽéŽåŽÄ", /* iong */ "ŽçŽáŽÀ", "ŽçŽáŽÁ", "ŽçŽáŽÂ", "ŽçŽáŽÃ", "ŽçŽáŽÄ", /* iu */ "ŽÇŽÀ", "ŽÇŽÁ", "ŽÇŽÂ", "ŽÇŽÃ", "ŽÇŽÄ", /* m */ "ŽËŽÀ", "ŽËŽÁ", "ŽËŽÂ", "ŽËŽÃ", "ŽËŽÄ", /* n */ "@ŽÀ", "@ŽÁ", "@ŽÂ", "@ŽÃ", "@ŽÄ", /* ng */ "ŽÛŽÀ", "ŽÛŽÁ", "ŽÛŽÂ", "ŽÛŽÃ", "ŽÛŽÄ", /* o */ "ŽèŽåŽÀ", "ŽèŽåŽÁ", "ŽèŽåŽÂ", "ŽèŽåŽÃ", "ŽèŽåŽÄ", /* ong */ "ŽáŽÀ", "ŽáŽÁ", "ŽáŽÂ", "ŽáŽÃ", "ŽáŽÄ", /* ou */ "ŽèŽÀ", "ŽèŽÁ", "ŽèŽÂ", "ŽèŽÃ", "ŽèŽÄ", /* u */ "ŽèŽÚŽÀ", "ŽèŽÚŽÁ", "ŽèŽÚŽÂ", "ŽèŽÚŽÃ", "ŽèŽÚŽÄ", /* ua */ "ŽèŽÞŽÀ", "ŽèŽÞŽÁ", "ŽèŽÞŽÂ", "ŽèŽÞŽÃ", "ŽèŽÞŽÄ", /* uai */ "ŽèŽâŽÀ", "ŽèŽâŽÁ", "ŽèŽâŽÂ", "ŽèŽâŽÃ", "ŽèŽâŽÄ", /* uan */ "ŽèŽäŽÀ", "ŽèŽäŽÁ", "ŽèŽäŽÂ", "ŽèŽäŽÃ", "ŽèŽäŽÄ", /* uang */ "ŽéŽÝŽÀ", "ŽéŽÝŽÁ", "ŽéŽÝŽÂ", "ŽéŽÝŽÃ", "ŽéŽÝŽÄ", /* ue */ "ŽèŽßŽÀ", "ŽèŽßŽÁ", "ŽèŽßŽÂ", "ŽèŽßŽÃ", "ŽèŽßŽÄ", /* ui */ "ŽèŽãŽÀ", "ŽèŽãŽÁ", "ŽèŽãŽÂ", "ŽèŽãŽÃ", "ŽèŽãŽÄ", /* un */ "ŽèŽÛŽÀ", "ŽèŽÛŽÁ", "ŽèŽÛŽÂ", "ŽèŽÛŽÃ", "ŽèŽÛŽÄ", /* uo */ "ŽéŽÀ", "ŽéŽÁ", "ŽéŽÂ", "ŽéŽÃ", "ŽéŽÄ", /* ޹ */ "ŽéŽÝŽÀ", "ŽéŽÝŽÁ", "ŽéŽÝŽÂ", "ŽéŽÝŽÃ", "ŽéŽÝŽÄ", /* ޹e */ "0ŽÀ", "1ŽÁ", "2ŽÂ", "3ŽÃ", "4ŽÄ", /* undefinited YunMu */ "ŽéŽâŽÀ", "ŽéŽâŽÁ", "ŽéŽâŽÂ", "ŽéŽâŽÃ", "ŽéŽâŽÄ", /* ޹an, only ZhuYin */ "ŽéŽãŽÀ", "ŽéŽãŽÁ", "ŽéŽãŽÂ", "ŽéŽãŽÃ", "ŽéŽãŽÄ", /* ޹n, only ZhuYin */ }; /* zhuyin_tbl: size is ZY_NUM_SHENGMU*ZY_NUM_YUNMU, including empty ShengMu */ /* empty YunMu and undefinited ShengMu '-' */ int zhuyin_tbl[ZY_NUM_SHENGMU*ZY_NUM_YUNMU] = { /* empty ShengMu */ 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X8000,0X0000,0X0000,0X0000,0X0000,0X0000,0X9586,0X0000,0X9592,0X9599, 0X0000,0X8000,0X8000,0X8000,0X8000,0X0000,0X8000,0X0000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X959B,0X95A0,0X0000,0X959E, 0X95A2, /* SHengMu B */ 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X0000,0X8000,0X8000,0X8000, 0X0000,0X8000,0X0000,0X8000,0X0000,0X8000,0X8000,0X8000,0X8000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X8000,0X0000,0X0000,0X8000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu C */ 0X828B,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X0000,0X8000,0X8000, 0X0000,0X0280,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000, 0X8000,0X0000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu Ch */ 0X838B,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X0000,0X8000,0X8000, 0X0000,0X0380,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X0000,0X8000, 0X8000,0X8000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu D */ 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X0000,0X8000,0X8000,0X8000,0X0000,0X8000,0X8000,0X0000,0X8000,0X0000, 0X8000,0X0000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000, 0X8000,0X0000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu F */ 0X0000,0X8000,0X0000,0X8000,0X8000,0X0000,0X0000,0X8000,0X8000,0X8000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X8000,0X0000,0X8000,0X8000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu G */ 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X8000,0X8000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu H */ 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X8000,0X0000,0X8000,0X0000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X8000,0X8000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu J */ 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X8000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X08A4,0X0000,0X0000, 0X08A7,0X0000,0X08A5,0X0000,0X08A8,0X0000,0X889B,0X88A0,0X8000,0X889E, 0X88A2, /* ShengMu K */ 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X8000,0X8000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu L */ 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X0000,0X8000, 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X0000, 0X8000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X8000,0X0000,0X0000, 0X8000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X0000, 0X0000, /* ShengMu M */ 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X0000,0X8000,0X0000,0X8000,0X0000,0X8000,0X8000,0X8000,0X8000,0X0000, 0X8000,0X0000,0X0000,0X0000,0X8000,0X0000,0X8000,0X8000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu N */ 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X0000,0X8000,0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X0000, 0X8000,0X0000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000, 0X8000,0X0000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X8000,0X0000, 0X0000, /* ShengMu P */ 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X0000,0X8000,0X8000,0X8000, 0X0000,0X8000,0X0000,0X8000,0X0000,0X8000,0X8000,0X8000,0X8000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X8000,0X0000,0X8000,0X8000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu Q */ 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X8000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0EA4,0X0000,0X0000, 0X0EA7,0X0000,0X0EA5,0X0000,0X0EA8,0X0000,0X8E9B,0X8EA0,0X8000,0X8E9E, 0X8EA2, /* ShengMu R */ 0X8F8B,0X0000,0X0000,0X8000,0X8000,0X8000,0X8000,0X0000,0X8000,0X8000, 0X0000,0X0F80,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X8000,0X0000, 0X8000,0X0000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu S */ 0X908B,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X0000,0X8000,0X8000, 0X0000,0X1080,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000, 0X8000,0X0000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu Sh */ 0X918B,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X0000,0X1180,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X8000, 0X8000,0X8000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu T */ 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X0000,0X8000, 0X0000,0X8000,0X0000,0X8000,0X0000,0X8000,0X8000,0X0000,0X8000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000, 0X8000,0X0000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu W */ 0X939B,0X8000,0X8000,0X8000,0X8000,0X0000,0X0000,0X8000,0X8000,0X8000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X8000,0X0000,0X0000,0X1380,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu X */ 0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X8000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X14A4,0X0000,0X0000, 0X14A7,0X0000,0X14A5,0X0000,0X14A8,0X0000,0X949B,0X94A0,0X8000,0X949E, 0X94A2, /* ShengMu Y */ 0X958B,0X8000,0X0000,0X8000,0X8000,0X8000,0X0090,0X0000,0X9591,0X9592, 0X0000,0X1580,0X0000,0X0000,0X0000,0X0000,0X0000,0X1588,0X1589,0X0000, 0X0000,0X0000,0X0000,0X0000,0X8000,0X0093,0X8000,0X00A4,0X0000,0X0000, 0X00A7,0X0000,0X00A5,0X0000,0X00A8,0X0000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu Z */ 0X968B,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X0000,0X1680,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000, 0X8000,0X0000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000,0X8000,0X0000, 0X0000, /* ShengMu Zh */ 0X978B,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X0000,0X1780,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000,0X0000, 0X0000,0X0000,0X0000,0X0000,0X0000,0X8000,0X8000,0X8000,0X8000,0X8000, 0X8000,0X8000,0X0000,0X8000,0X8000,0X8000,0X0000,0X0000,0X8000,0X0000, 0X0000, }; #endif /* CHINESE */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/etc/yincoding.c0000644000000000000000000007025707153676736020170 0ustar rootroot/* * $Id: yincoding.c,v 2.4.2.1 2000/08/04 05:37:07 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /** cWnn Version 1.1 **/ #include #include #include "commonhd.h" #ifdef CHINESE #ifdef SYSVR2 #include #endif #ifdef BSD42 #include #endif #include "cplib.h" #include "rk_spclval.h" #include "jh.h" #include "wnn_string.h" extern char *py_table[]; extern char *zy_table[]; unsigned char last_mark; /* Using to reme previous auto_state() */ /* copied from old sstrings.c */ static int cwnn_sStrcpy(c , w) register unsigned char *c; register w_char *w; { unsigned char *c0 = c; for(;*w != 0 ; w++){ if ((*w & 0x8080) == 0x8000) { *c++ = 0x8f; *c++ = (char)((*w & 0xff00) >> 8); *c++ = (char)((*w & 0x007f) | 0x0080); } else { if (*w & 0xff00) *c++ = (char)((*w & 0xff00) >> 8); else if (*w & 0x80) *c++ = 0x8e; *c++ = (char)(*w & 0x00ff); } } *c = '\0'; return (c - c0); } static int cwnn_Sstrcpy(w , c ) w_char *w; unsigned char *c; { w_char *w0 = w; for(;*c;){ if (*c & 0x80) { if (*c == 0x8e) { c++; *w++ = (unsigned short)*c++; } else if (*c == 0x8f) { c++; *w = (unsigned short)(*c++ << 8); *w++ |= (unsigned short)(*c++ & 0x7f); } else { *w = (unsigned short)(*c++ << 8); *w++ |= (unsigned short)*c++; } } else { *w++ = (unsigned short)*c++; } } *w = 0; return(w - w0); } static int cwnn_Sstrcat(w , c ) w_char *w; unsigned char *c; { w_char *w0 = w; for ( ; *w; w++); for(;*c;){ if (*c & 0x80) { if (*c == 0x8e) { c++; *w++ = (unsigned short)*c++; } else if (*c == 0x8f) { c++; *w = (unsigned short)(*c++ << 8); *w++ |= (unsigned short)(*c++ & 0x7f); } else { *w = (unsigned short)(*c++ << 8); *w++ |= (unsigned short)*c++; } } else { *w++ = (unsigned short)*c++; } } *w = 0; return(w - w0); } /********** py_yunmu(), zy_yunmu(): if yuyin with YunMu, return YunMu's position in YunMu table. after that, you must calculate its real yun_raw static if without YunMu, return -1 ***********/ static int py_yunmu(yuyin) register char *yuyin; { register int i; for ( i = (PY_NUM_YUNMU*5)- 1; i >= 0 ; i-- ){ if ( strncmp(yuyin, py_yunmu_tbl[i], strlen(py_yunmu_tbl[i])) == 0 ) return(i); } return(-1); } static int zy_yunmu(yuyin) register char *yuyin; { register int i; for ( i = (ZY_NUM_YUNMU*5)- 1; i >= 0 ; i-- ){ if ( strncmp(yuyin, zy_yunmu_tbl[i], strlen(zy_yunmu_tbl[i])) == 0 ) return(i); } return(-1); } /* is_pinyin(): if is PinYin with Shengmu, return 1 */ /* if is PinYin without Shengmu , return 0 */ /* else return -1 */ static int is_pinyin(sheng_raw, yun_raw) register int sheng_raw; register int yun_raw; { if ( (sheng_raw >= 0) && (sheng_raw < PY_NUM_SHENGMU) && (yun_raw >= 0) && (yun_raw < PY_NUM_YUNMU) && ( pinyin_tbl[sheng_raw * PY_NUM_YUNMU + yun_raw] == 1) ) { if ( sheng_raw == EMPTY_SHENG_RAW ) return(0); else return(1); } else return(-1); } /* is_zhuyin(): if is ZhuYin with Shengmu: return 1 */ /* if is ZhuYin without Shengmu: return 0 */ /* else: return -1 */ static int is_zhuyin(sheng_raw, yun_raw) register int sheng_raw; register int yun_raw; { if ( (sheng_raw >= 0) && (sheng_raw < ZY_NUM_SHENGMU) && (yun_raw >= 0) && (yun_raw < ZY_NUM_YUNMU) && ((zhuyin_tbl[sheng_raw * ZY_NUM_YUNMU + yun_raw] & 0x8000) == 0x8000) ) if ( sheng_raw == EMPTY_SHENG_RAW ) return ( 0); else return(1); return(-1); } /* py_shengmu(), zy_shengmu(): if yuyin with ShengMu, return Shengmu's position in ShengMu table. if without ShengMu, return -1 */ static int py_shengmu(yuyin) register char *yuyin; { register int i; for ( i = PY_NUM_SHENGMU - 1; i > 0; i-- ) { if ( strncmp(yuyin, py_shengmu_tbl[i], strlen(py_shengmu_tbl[i])) == 0 ) return (i); } return ( -1); } static int zy_shengmu(yuyin) register char *yuyin; { register int i; for ( i = ZY_NUM_SHENGMU - 1; i > 0; i-- ) { if ( strncmp(yuyin, zy_shengmu_tbl[i], strlen(zy_shengmu_tbl[i])) == 0 ) return (i); } return (-1); } /* create_yincod(): input: raw in ShengMu table of PinYin, raw in YunMu table of PinYin, sisheng output: yincod: if is PinYin, otherwise:0. */ static w_char create_yincod(sheng_raw, yun_raw, ss) register int sheng_raw; register int yun_raw; register int ss; { int ret = 0; if (is_pinyin(sheng_raw, yun_raw ) == 1) /*Has Shengmu*/ ret = 0x0080 + (((yun_raw<<1)+0x20)<<8) + ((sheng_raw-1)<<2) + 0x20; else if (is_pinyin(sheng_raw, yun_raw ) == 0) /*Not Shengmu */ ret = 0x0080 + (((yun_raw<<1)+0x20)<<8) + ((X_SHENG_RAW-1)<<2) + 0x20; /*Rent this */ else return(ret); if ((ss>0)&&(ss<=4)) ret += 0x0100 + ss - 1 ; return(ret); } /* pzy_yincod() in: The param is expected to be a PinYin or a ZhuYin. return: a Yin_code is returned, if it is a PinYin or a ZhuYin. otherwise, 0 is returned, */ static int pzy_get_sheng_yun(yuyin, ss, sheng_raw, yun_raw, which) register char *yuyin; /* one PinYin or ZhuYin with end of character */ register int *ss; /* get SiSheng from PinYin or ZhuYin */ register int *sheng_raw; /* position in ShengMu table */ int *yun_raw; /* position in YunMu table */ int which; { /* register int j; */ register char *pzytmp; *ss = -1; *sheng_raw = -1; *yun_raw = -1; pzytmp = yuyin; if ( which == CWNN_PINYIN ){ /* for Pinyin case */ if ((*sheng_raw = py_shengmu(pzytmp)) == -1 ) { /* no ShengMu */ if ( (*yun_raw = py_yunmu(pzytmp)) == -1 ) return(0); else { pzytmp += strlen(py_yunmu_tbl[*yun_raw]); *sheng_raw = 0; *ss = *yun_raw % 5; *yun_raw = *yun_raw / 5; return(pzytmp - yuyin); } } else { /* has ShengMu */ /* for ( j = 0; (int)j < (int)strlen(py_shengmu_tbl[*sheng_raw]); j++) pzytmp++; */ pzytmp += strlen(py_shengmu_tbl[*sheng_raw]); if (strlen(pzytmp) == 0 ) return(0); if ( (*yun_raw = py_yunmu(pzytmp)) != -1 ) { pzytmp += strlen(py_yunmu_tbl[*yun_raw]); *ss = *yun_raw % 5; *yun_raw = *yun_raw / 5; return(pzytmp - yuyin); } else { pzytmp = yuyin; if ( (*yun_raw = py_yunmu(pzytmp)) == -1 ) return(0); else { pzytmp += strlen(py_yunmu_tbl[*yun_raw]); *sheng_raw = 0; *ss = *yun_raw % 5; *yun_raw = *yun_raw / 5; return(pzytmp - yuyin); } } } /* has ShengMu when Pinyin*/ } else { /* for Zhuyin case */ if ((*sheng_raw = zy_shengmu(pzytmp)) == -1 ) { /* no ShengMu */ if ( (*yun_raw = zy_yunmu(pzytmp)) == -1 ) return(0); else { pzytmp += strlen(zy_yunmu_tbl[*yun_raw]); *sheng_raw = 0; *ss = *yun_raw % 5; *yun_raw = *yun_raw / 5; return(pzytmp - yuyin); } } else { /* has ShengMu */ /* for ( j = 0; (int)j < (int)strlen(zy_shengmu_tbl[*sheng_raw]); j++) pzytmp++; */ pzytmp += strlen(zy_shengmu_tbl[*sheng_raw]); if (strlen(pzytmp) == 0 ) return(0); if ( (*yun_raw = zy_yunmu(pzytmp)) != -1 ) { pzytmp += strlen(zy_yunmu_tbl[*yun_raw]); *ss = *yun_raw % 5; *yun_raw = *yun_raw / 5; return(pzytmp - yuyin); } else { pzytmp = yuyin; if ( (*yun_raw = zy_yunmu(pzytmp)) == -1 ) return(0); else { pzytmp += strlen(zy_yunmu_tbl[*yun_raw]); *sheng_raw = 0; *ss = *yun_raw % 5; *yun_raw = *yun_raw / 5; return(pzytmp - yuyin); } } } /* has ShengMu when Zhuyin */ } /* which */ } static w_char pzy_yincod(one_yuyin, len) register char *one_yuyin; register int *len; { int ss[1]; int sheng_raw[1]; int yun_raw[1]; register int zytmp; register int ret; *len = 0; /* for Pinyin */ if((ret = pzy_get_sheng_yun(one_yuyin, ss, sheng_raw, yun_raw, CWNN_PINYIN))) if ( is_pinyin(sheng_raw[0], yun_raw[0]) != -1 ) { *len = ret; return(create_yincod(sheng_raw[0], yun_raw[0], ss[0])); } /* for Zhuyin */ if((ret = pzy_get_sheng_yun(one_yuyin, ss, sheng_raw, yun_raw, CWNN_ZHUYIN))){ zytmp = zhuyin_tbl[sheng_raw[0] * ZY_NUM_YUNMU + yun_raw[0]]; if ( is_zhuyin(sheng_raw[0], yun_raw[0]) != -1 ) { if ((zytmp & 0x0080 ) == 0x0080) { sheng_raw[0] = (zytmp >>8) & 0x7f; yun_raw[0] = zytmp & 0x7f; } *len = ret; return(create_yincod(sheng_raw[0], yun_raw[0], ss[0])); } } return(0); /* Otherwise, Not a Pinyin nor Zhuyin */ } /* ltoScpy(): copy strings from letter type to w_char type */ static int ltoScpy(w,l) register w_char *w; register letter *l; { register w_char *w0 = w; for(;*l;l++){ if (/* ((*l & 0x0000ffff) == PY_EOF) || isZY_EOF(*l & 0x0000ffff) ||*/ (*l == EOLTTR)) /* add by Kuwari */ break; *w++ = (*l & 0x0000ffff); } *w = (w_char)0; return(w - w0); } /* find_pinyin(): find a YuYin in a string. if there is a YuYin. it must be at the tail of string. return point of start YuYin else return -1 eg. ;abcdHuang. 'Huang.' is a PinYin & return 5 012345 */ static int find_pinyin(str) register char *str; { register char *py_zy_tmp; register int i; register int pnt ; int len; pnt = -1; if ((((*(str+strlen(str)-2)<<8)&0xff00)| (*(str+strlen(str)-1)&0x00ff))!= PY_EOF) return( -1 ); for ( i = strlen(str) - 1; i >= 0; i-- ) { if ( (int)(strlen(str) - i) > PY_LEN ) return( pnt ); py_zy_tmp = str + i; if ( pzy_yincod(py_zy_tmp, &len) != 0 ) pnt = i; } return (pnt); } static int find_zhuyin(str) register char *str; { register char *py_zy_tmp; register int i; register int pnt ; int len; pnt = -1; if (!isZY_EOF(((*(str+strlen(str)-2)<<8)&0xff00)| (*(str+strlen(str)-1)&0x00ff))) return( -1 ); for ( i = strlen(str) - 1; i >= 0; i-- ) { if ( (int)(strlen(str) - i) > PY_LEN ) return( pnt ); py_zy_tmp = str + i; if ( pzy_yincod(py_zy_tmp, &len) != 0 ) pnt = i; } return (pnt); } /* get_one_zhuyin(): get one ZhuYin from ZhuYin strings */ /* get_one_pinyin(): get one PinYin from PinYin strings */ static int get_one_pinyin(pinzhuyin_str,one_pinzhuyin) register unsigned char *pinzhuyin_str; register char *one_pinzhuyin; { register w_char chrtmp; for (; (chrtmp = (((*pinzhuyin_str<<8)&0xff00)|(*(pinzhuyin_str+1)&0x00ff))) != PY_EOF && *pinzhuyin_str != 0;pinzhuyin_str++) *one_pinzhuyin++ = *pinzhuyin_str; if (chrtmp == PY_EOF) { *one_pinzhuyin++ = *pinzhuyin_str; pinzhuyin_str++; *one_pinzhuyin++ = *pinzhuyin_str; *one_pinzhuyin = 0; return(1); } else { *one_pinzhuyin = 0; return(0); } } static int get_one_zhuyin(pinzhuyin_str,one_pinzhuyin) register unsigned char *pinzhuyin_str; register char *one_pinzhuyin; { register w_char chrtmp; for (; !isZY_EOF(chrtmp = (((*pinzhuyin_str<<8)&0xff00)|(*(pinzhuyin_str+1) &0x00ff))) && *pinzhuyin_str != 0; pinzhuyin_str++) *one_pinzhuyin++ = *pinzhuyin_str; if ( isZY_EOF(chrtmp) ) { *one_pinzhuyin++ = *pinzhuyin_str; pinzhuyin_str++; *one_pinzhuyin++ = *pinzhuyin_str; *one_pinzhuyin = 0; return(1); } else { *one_pinzhuyin = 0; return(0); } } /* cwnn_is_yincod(c) To check is "c"is a yincod. if so, return(1) otherwise return 0*/ int cwnn_is_yincod(c) register w_char c; { register int sheng_raw; register int yun_raw; if (! _cwnn_isyincod_d(c) ) return (0); sheng_raw = Shengraw(c); yun_raw = Yunraw(c); if ( is_pinyin(sheng_raw, yun_raw) ) return(1); if ( sheng_raw == X_SHENG_RAW && is_pinyin(EMPTY_SHENG_RAW, yun_raw) == 0) return( 1 ); else return(0); } /* For a given 'yincod', creat the corresponding Pinyin or Zhuyin to pzy_buf as a w_char string. If the given 'yincod' is not a yincod, 'yincod', followed by a NULL is created to pzy_fub. Return: the lenth of pzy_buf is returned. Lenth means the lenth in console but not num of character. */ int cwnn_yincod_pzy(pzy_buf, c, which ) register w_char *pzy_buf; /* out: a Pinyin or Zhuyin */ register w_char c; /* input: a yincod */ int which; /* option Pinyin or Zhuyin */ { register int sheng_raw; register int yun_raw; register int ss; /* for Sisheng */ register int zytmp; if ( ! cwnn_is_yincod(c) ) { *pzy_buf = c; *(pzy_buf + 1) = 0; return(1); /* if ( ((c&0x00ff)>0xa0) && ((c&0x00ff)< 0xff) && ((c>>8) > 0xa0) && ((c>>8) < 0xff) ) return(2); else return(1); */ } sheng_raw = Shengraw(c); yun_raw = Yunraw(c); ss = _cwnn_sisheng(c); if (which == CWNN_PINYIN){ /* For Pinyin case */ if (sheng_raw == X_SHENG_RAW && is_pinyin(sheng_raw, yun_raw) == -1 ) if ( is_pinyin(EMPTY_SHENG_RAW, yun_raw) == 0 ) sheng_raw = EMPTY_SHENG_RAW; cwnn_Sstrcpy(pzy_buf, py_shengmu_tbl[sheng_raw]); if ( _cwnn_has_sisheng(c) ) cwnn_Sstrcat(pzy_buf, py_yunmu_tbl[yun_raw*5+ss]); else cwnn_Sstrcat(pzy_buf, py_yunmu_tbl[yun_raw*5]); } else { /* For Zhuyin case */ zytmp = zhuyin_tbl[sheng_raw * ZY_NUM_YUNMU + yun_raw]; if ( is_zhuyin(sheng_raw, yun_raw) == -1 ) { if ((zytmp & 0x0080)== 0x0080 ){ sheng_raw = (zytmp >>8) & 0x7f; yun_raw = zytmp & 0x7f; } else { if ((sheng_raw == X_SHENG_RAW) &&(is_zhuyin(EMPTY_SHENG_RAW,yun_raw)==0)) sheng_raw = EMPTY_SHENG_RAW; } } cwnn_Sstrcpy(pzy_buf, zy_shengmu_tbl[sheng_raw]); if ( yun_raw == EMPTY_YUN_RAW ) { w_char tmp_w; if ( _cwnn_has_sisheng(c) ) { switch (ss) { case 1: tmp_w = ZY_EOF_1; break; case 2: tmp_w = ZY_EOF_2; break; case 3: tmp_w = ZY_EOF_3; break; case 4: tmp_w = ZY_EOF_4; break; } } else { tmp_w = ZY_EOF_0; } wnn_Strncat(pzy_buf, &tmp_w, 1); } else { if ( _cwnn_has_sisheng(c)) cwnn_Sstrcat(pzy_buf, zy_yunmu_tbl[yun_raw*5+ss]); else cwnn_Sstrcat(pzy_buf, zy_yunmu_tbl[yun_raw*5]); } } return(wnn_Strlen(pzy_buf)); } /* Copy s2 which having yincod to s1 in which yincod are replaced by the corresponding Pinyin or Zhuyin. Lenth of s2 is returned */ int cwnn_yincod_pzy_str(s1, s2, n, which) register w_char *s1; /* result string having Pinyin or Zhuyin */ register w_char *s2; /* input string having Yincod */ int n; int which; { w_char s2tmp[LINE_SIZE]; register int i, j; w_char pzy_buf[10]; int len, sum_len; len = 0; sum_len = 0; for (i = 0; i < n; i++) s2tmp[i] = s2[i]; for (i = 0; i < n; i++) { /* len = cwnn_yincod_pzy(pzy_buf, s2tmp[i], which); for (j = 0; j < len; j++) *s1++ = pzy_buf[j]; sum_len += len; */ /* Strlen(pzy_buf) is the num of w_char , but "len" means the width */ len = cwnn_yincod_pzy(pzy_buf, s2tmp[i], which); for (j = 0; j < wnn_Strlen(pzy_buf); j++) *s1++ = pzy_buf[j]; sum_len += wnn_Strlen(pzy_buf); } *s1 =0; return(sum_len); } /* cwnn_pzy_yincod(s1, s2, which): After the matching in automaton, the string may be a Pinyin or a Zhuyin If so, it will be replace by the coreesponding Yincod */ int cwnn_pzy_yincod(s1, s2, which) letter *s1, *s2; int which; { /* register w_char codetmp2[PY_LEN]; register char *codetmp1 = {" "}; */ w_char codetmp2_buf[PY_LEN*10+1]; char codetmp1_buf[PY_LEN*20+2]; register w_char *codetmp2 = codetmp2_buf; register char *codetmp1 = codetmp1_buf; register letter *lettertmp = s2, *s1tmp = s1; register w_char yincod; int len; int conv = 0; w_char save_w[2]; char save, tmp[6]; save_w[0] = save_w[1] = 0; ltoScpy(codetmp2, lettertmp); if (cwnn_sStrcpy(codetmp1, codetmp2) <= 0) return(0); /* if ((yincod = pzy_yincod(codetmp1)) != 0) getstr_pzy(s1, yincod, which); Jun 13 Zhong */ for (;*lettertmp && *lettertmp != EOLTTR;) { if ( ( yincod = pzy_yincod(codetmp1, &len)) != 0) { conv++; *s1tmp++ = (letter)yincod; save = codetmp1[len]; codetmp1[len] = '\0'; lettertmp += cwnn_Sstrcpy(codetmp2, codetmp1); codetmp1[len] = save; codetmp1 += len; } else { save_w[0] = (w_char)(*lettertmp & 0xffff); *s1tmp++ = *lettertmp++; codetmp1 += cwnn_sStrcpy(tmp, save_w); } } if (*lettertmp == EOLTTR) *s1tmp++ = *lettertmp++; if (conv) { return(s1tmp - s1); } else { return(0); } } /* cwnn_py_yincod_str(), cwnn_zy_yincod_str():HUANG: for atod we get yomi as PinYin or ZhuYin strings from ascii-dictionary and translate it to YINcode */ void cwnn_py_yincod_str(yuyin_str, css, un_sisheng_yincod_str, yincod_str) register char *yuyin_str; /* yomi: PinYin or ZhuYin strings */ register char *css; /* get sisheng strings from PinYin strings */ register w_char *un_sisheng_yincod_str; /* no-sisheng Yincod strings */ register w_char *yincod_str; /* Yincod strings with sisheng */ { /* register char one_yuyin[LINE_SIZE]; register w_char not_yuyin[LINE_SIZE]; */ char one_yuyin_buf[LINE_SIZE]; w_char not_yuyin_buf[LINE_SIZE]; register char *one_yuyin = one_yuyin_buf; register w_char *not_yuyin = not_yuyin_buf; register int yin_eof; register w_char yincod; register int i, pst; int len; for ( ; *yuyin_str; ) { yin_eof = get_one_pinyin(yuyin_str, one_yuyin); yuyin_str += strlen(one_yuyin); cwnn_Sstrcpy(not_yuyin, one_yuyin); pst = find_pinyin(one_yuyin); if ( yin_eof == 1 && pst != -1 ) { for ( i = 0; i < pst; i++ ) { *yincod_str++ = not_yuyin[i]; *un_sisheng_yincod_str++ = not_yuyin[i]; *css++ = '5'; } yincod = pzy_yincod(one_yuyin, &len); *yincod_str ++ = yincod; *un_sisheng_yincod_str++ = _cwnn_yincod_0(yincod); *css++ = (char)(_cwnn_sisheng(yincod) + 0x30); } else { for ( i = 0; not_yuyin[i]; i++ ) { *yincod_str++ = not_yuyin[i]; *un_sisheng_yincod_str++ = not_yuyin[i]; *css++ = '5'; } } } *yincod_str = 0; *un_sisheng_yincod_str = 0; *css = 0; } void cwnn_zy_yincod_str(yuyin_str, css, un_sisheng_yincod_str, yincod_str) register char *yuyin_str; /* yomi: PinYin or ZhuYin strings */ register char *css; /* get sisheng strings from PinYin strings */ register w_char *un_sisheng_yincod_str; /* no-sisheng Yincod strings */ register w_char *yincod_str; /* Yincod strings with sisheng */ { /* register char one_yuyin[LINE_SIZE]; register w_char not_yuyin[LINE_SIZE]; */ char one_yuyin_buf[LINE_SIZE]; w_char not_yuyin_buf[LINE_SIZE]; register char *one_yuyin = one_yuyin_buf; register w_char *not_yuyin = not_yuyin_buf; register int yin_eof; register w_char yincod; register int i, pst; int len; for ( ; *yuyin_str; ) { yin_eof = get_one_zhuyin(yuyin_str, one_yuyin); yuyin_str += strlen(one_yuyin); cwnn_Sstrcpy(not_yuyin, one_yuyin); pst = find_zhuyin(one_yuyin); if ( yin_eof == 1 && pst != -1 ) { for ( i = 0; i < pst; i++ ) { *yincod_str++ = not_yuyin[i]; *un_sisheng_yincod_str++ = not_yuyin[i]; *css++ = '5'; } yincod = pzy_yincod(one_yuyin, &len); *yincod_str ++ = yincod; *un_sisheng_yincod_str++ = _cwnn_yincod_0(yincod); *css++ = (char)(_cwnn_sisheng(yincod) + 0x30); } else { for ( i = 0; not_yuyin[i]; i++ ) { *yincod_str++ = not_yuyin[i]; *un_sisheng_yincod_str++ = not_yuyin[i]; *css++ = '5'; } } } *yincod_str = 0; *un_sisheng_yincod_str = 0; *css = 0; } /* cwnn_py_str_analysis(), cp_zy_str_analysis(): HUANG: for atod we get yomi as PinYin or ZhuYin strings from ascii-dictionary and translate it to YINcode */ void cwnn_py_str_analysis(yuyin_str, css, un_sisheng_yincod_str, yincod_str) register char *yuyin_str; /* yomi: PinYin or ZhuYin strings */ register char *css; /* get sisheng strings from PinYin strings */ register w_char *un_sisheng_yincod_str; /* no-sisheng Yincod strings */ register w_char *yincod_str; /* Yincod strings with sisheng */ { /* register char one_yuyin[LINE_SIZE]; register w_char not_yuyin[LINE_SIZE]; */ char one_yuyin_buf[LINE_SIZE]; w_char not_yuyin_buf[LINE_SIZE]; register char *one_yuyin = one_yuyin_buf; register w_char *not_yuyin = not_yuyin_buf; register int yin_eof; register w_char yincod; register int i, pst; int len; for ( ; *yuyin_str; ) { yin_eof = get_one_pinyin(yuyin_str, one_yuyin); yuyin_str += strlen(one_yuyin); cwnn_Sstrcpy(not_yuyin, one_yuyin); pst = find_pinyin(one_yuyin); if ( yin_eof == 1 && pst != -1 ) { for ( i = 0; i < pst; i++ ) { *yincod_str++ = not_yuyin[i]; *un_sisheng_yincod_str++ = not_yuyin[i]; *css++ = '5'; } yincod = pzy_yincod(one_yuyin, &len); *yincod_str ++ = yincod; *un_sisheng_yincod_str++ = _cwnn_yincod_0(yincod); *css++ = (char)(_cwnn_sisheng(yincod) + 0x30); } else { for ( i = 0; not_yuyin[i]; i++ ) { *yincod_str++ = not_yuyin[i]; *un_sisheng_yincod_str++ = not_yuyin[i]; *css++ = '5'; } } } *yincod_str = 0; *un_sisheng_yincod_str = 0; *css = 0; } void cwnn_zy_str_analysis(yuyin_str, css, un_sisheng_yincod_str, yincod_str) register char *yuyin_str; /* yomi: PinYin or ZhuYin strings */ register char *css; /* get sisheng strings from PinYin strings */ register w_char *un_sisheng_yincod_str; /* no-sisheng Yincod strings */ register w_char *yincod_str; /* Yincod strings with sisheng */ { /* register char one_yuyin[LINE_SIZE]; register w_char not_yuyin[LINE_SIZE]; */ char one_yuyin_buf[LINE_SIZE]; w_char not_yuyin_buf[LINE_SIZE]; register char *one_yuyin = one_yuyin_buf; register w_char *not_yuyin = not_yuyin_buf; register int yin_eof; register w_char yincod; register int i, pst; int len; for ( ; *yuyin_str; ) { yin_eof = get_one_zhuyin(yuyin_str, one_yuyin); yuyin_str += strlen(one_yuyin); cwnn_Sstrcpy(not_yuyin, one_yuyin); pst = find_zhuyin(one_yuyin); if ( yin_eof == 1 && pst != -1 ) { for ( i = 0; i < pst; i++ ) { *yincod_str++ = not_yuyin[i]; *un_sisheng_yincod_str++ = not_yuyin[i]; *css++ = '5'; } yincod = pzy_yincod(one_yuyin, &len); *yincod_str ++ = yincod; *un_sisheng_yincod_str++ = _cwnn_yincod_0(yincod); *css++ = (char)(_cwnn_sisheng(yincod) + 0x30); } else { for ( i = 0; not_yuyin[i]; i++ ) { *yincod_str++ = not_yuyin[i]; *un_sisheng_yincod_str++ = not_yuyin[i]; *css++ = '5'; } } } *yincod_str = 0; *un_sisheng_yincod_str = 0; *css = 0; } #endif /* CHINESE */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/etc/pwd.c0000644000000000000000000001614707153676736016775 0ustar rootroot/* * $Id: pwd.c,v 2.4.2.1 2000/08/04 05:37:06 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ /* eval(crypt(PWD, "HA")) routine. */ #ifndef JS #include #include "commonhd.h" #include "jslib.h" #include "wnn_os.h" #endif extern char *crypt(); #ifdef JS static #endif void new_pwd(src, encd) char *src, *encd; { int i, x,c; char xx[2]; char *cr; if(encd == NULL)encd = src; if(strcmp(src, "") == 0){ bzero(encd, WNN_PASSWD_LEN);return;} x = time(NULL); xx[0] = x & 0x3f; xx[1] = (x & 0x3f00) >> 8; for (i = 0; i < 2; i++) { c = xx[i] + '.'; if (c > '9') c += 7; if (c > 'Z') c += 6; xx[i] = c; } cr = crypt(src, xx); bzero(encd, WNN_PASSWD_LEN); strncpy(encd, cr, WNN_PASSWD_LEN); } #ifdef JS static #endif int check_pwd(src, encd) char *src, *encd; { if(strcmp(encd, "") == 0) return(1); /* No passwd */ return(!strncmp(encd, crypt(src, encd),WNN_PASSWD_LEN)); } wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/etc/msg.c0000644000000000000000000003151307153676736016763 0ustar rootroot/* * $Id: msg.c,v 2.11.2.2 2000/08/04 05:37:05 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* struct msg_cat msg_open(name, nlspath, lang) char *name; char *nlspath; char *lang; char * msg_get(cd, id, s, lang) struct msg_cat cd; int id; char *s; void msg_close(cd) struct msg_cat cd; format of message file \t */ #include #include "commonhd.h" #include "dslib.h" #include "wnn_os.h" #include "msg.h" #include "mt_jserver.h" extern char *getenv(); static char * bsearch(ky, bs, nel, width, compar) char *ky; char *bs; unsigned long nel; unsigned long width; int (*compar)(); { char *key = ky; char *base = bs; int two_width = width + width; char *last = base + width * (nel - 1); register char *p; register int ret; while (last >= base) { p = base + width * ((last - base)/two_width); ret = (*compar)((void *)key, (void *)p); if (ret == 0) return ((char *)p); /* found */ if (ret < 0) last = p - width; else base = p + width; } return ((char *) 0); /* not found */ } static char * getlang(lang, args) char *lang; ARGS *args; { static char tmp[32]; char *p; int i; if(lang == NULL || *lang == '\0'){ #ifdef HAS_SETLOCALE lang = setlocale(LC_ALL, NULL); if(lang == NULL || *lang == '\0') #endif { lang = getenv("LC_MESSAGES"); if(lang == NULL || *lang == '\0'){ lang = getenv("LANG"); if(lang == NULL || *lang == '\0'){ lang = DEF_LANG; } } } } for (i = 0, p = lang; *p && (*p != '.') && (i < sizeof(tmp) - 1) ; i++, p++) { tmp[i] = *p; } tmp[i] = '\0'; return(tmp); /* return(lang); */ } static int _search(id, bd) register int id; register struct msg_bd *bd; { return(id - bd->msg_id); } static void _escape(op, ip) register char *op, *ip; { for( ; *ip != 0; ip++, op++){ if(*ip == '\\'){ switch(*++ip){ case 'n': *op = '\n'; break; case 't': *op = '\t'; break; case 'b': *op = '\b'; break; case 'r': *op = '\r'; break; case 'f': *op = '\f'; break; case 'v': *op = '\v'; break; case '0': *op = 0; break; /* case 'a': *op = '\a'; break; case 'e': case 'E': case 'o': case 'd': case 'x': break; */ default: *op = *ip; break; } } else { if (*ip == '\n') { *op = '\0'; } else { *op = *ip; } } } *op = 0; } static char * get_msg_bd(cd, id) register struct msg_cat *cd; register int id; { register struct msg_bd *bd; if(cd->msg_bd == 0 || cd->msg_cnt == 0) return(NULL); bd = (struct msg_bd *) bsearch(id, cd->msg_bd, cd->msg_cnt, sizeof(struct msg_bd), _search); if(bd == NULL) return(NULL); return(bd->msg); } /* expand %N: the value of the name parameter passed to msg_open() %L: the value of LANG %l: the language element from LANG %t: the territory element from LANG %c: the codeset element from LANG %%: a single % charctor */ static int expand(op, ip, name, lang) register char *op, *ip, *name, *lang; { if (!ip || !*ip) return(-1); for( ; *ip != 0; ip++){ if(*ip == '%'){ switch(*++ip){ case 'N': if (!name || !*name) return(-1); strcpy(op, name); op += strlen(name); break; case 'L': if (!lang || !*lang) return(-1); strcpy(op, lang); op += strlen(lang); break; /* case 'l': strcpy(op, language); op += strlen(language); break; case 't': strcpy(op, terr); op += strlen(terr); break; case 'c': strcpy(op, code); op += strlen(code); break; case '%': strcpy(op, "%"); op += strlen("%"); break; */ default: break; } }else{ *op = *ip; op++; } } *op = '\0'; return(0); } struct msg_cat * msg_open(name, nlspath, lang, args) char *name; char *nlspath; char *lang; ARGS *args; { struct msg_cat *cd; char fn[128]; FILE *fp; char data[1024]; char save[1024]; int msg_cnt = 0; int msg_byte = 0; register char *dp; register struct msg_bd *bd; register char *msg, *l; l = getlang(lang, args); if (name && *name == '/') { strcpy(fn, name); } else { if (expand(fn, nlspath, name, l) == -1) { return(NULL); } } if (!(cd = (struct msg_cat *)malloc(sizeof(struct msg_cat)))) return(NULL); strcpy(cd->name, name); strcpy(cd->lang, l); strcpy(cd->nlspath, nlspath); cd->nextp = NULL; cd->msg_cnt = 0; if((fp = fopen(fn, "r")) == NULL){ /* message file not found */ cd->msg_bd = 0; return(cd); } for( ; ; ){ /* first: count bytes */ if(fgets(data, 1024, fp) == NULL) break; if(*data == '#') continue; /* comment */ for(dp = data ; *dp != '\t'; dp++); /* msg_id:message\n */ dp++; msg_byte += strlen(dp); msg_cnt++; } rewind(fp); cd->msg_cnt = msg_cnt; if (!(bd = cd->msg_bd = (struct msg_bd *) malloc((sizeof(struct msg_bd)) * msg_cnt + msg_byte + 1))) { fclose(fp); free(cd); return(NULL); } msg = (char *) bd + (sizeof(struct msg_bd)) * msg_cnt; for( ; ; ){ /* second : get message */ if(fgets(data, 1024, fp) == NULL) break; if(*data == '#') continue; /* comment */ for(dp = data ; *dp != '\t'; dp++); /* msg_id:message\n */ *dp = 0; dp++; bd->msg_id = atoi(data); bd->msg = msg; bd++; _escape(save, dp); strcpy(msg, save); msg += strlen(save); *msg = 0; msg++; } fclose(fp); return(cd); } char * msg_get(catd, id, msg, lang, args) struct msg_cat *catd; int id; char *msg; register char *lang; ARGS *args; { register struct msg_cat *cd; static char ret[128]; register char *msg_bd; if(catd == 0) goto error; cd = catd; if(lang == 0 || *lang == '\0'){ lang = cd->lang; } else { for ( ; ; cd = cd->nextp) { if(strcmp(lang, cd->lang) == 0) break; if(cd->nextp == 0) { cd->nextp = msg_open(cd->name, cd->nlspath, lang, args); cd = cd->nextp; break; } } } if((msg_bd = get_msg_bd(cd, id))) return(msg_bd); error: if(msg != 0 && *msg != '\0') return(msg); sprintf(ret, "mes_id = %d: %s", id, DEF_MSG); return(ret); } void msg_close(cd) register struct msg_cat *cd; { if(cd->nextp) msg_close(cd->nextp); if(cd->msg_bd) free(cd->msg_bd); if(cd) free(cd); } #ifdef not_use /* test */ main() { struct msg_cat *cd; cd = msg_open("msg","%L", "ja_JP", NULL); printf(msg_get(cd, 5, "message not found\n", "ja_JP", NULL), 555); printf(msg_get(cd, 6, "message not found\n", "zh_CN", NULL)); printf(msg_get(cd, -1, "", "ja_JP", NULL), 555); printf(msg_get(cd, 2, "message not found\n", "ja_JP", NULL), "abc"); printf(msg_get(cd, 100, "message not found\n", "zh_CN", NULL), "abc"); } #endif /* not_use */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/etc/gethinsi.c0000644000000000000000000004544507153676736020020 0ustar rootroot/* * $Id: gethinsi.c,v 2.13.2.1 2000/08/04 05:37:05 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ /* ÉÊ»ì¥Õ¥¡¥¤¥ë¤Î¹½Â¤¤Ë´Ø¤¹¤ëÄêµÁ */ #include #include "commonhd.h" #include "config.h" #include "wnnerror.h" #include "jslib.h" #include "wnn_os.h" #include "wnn_string.h" #ifdef NEW_HINSI #include "fzk.h" #include "kaiseki.h" #else /* NEW_HINSI */ #include "hinsi_file.h" #endif /* NEW_HINSI */ #include "mt_jserver.h" /* wnn_loadhinsi(NULL) ÉÊ»ì¤Î¾ðÊó¤òÆÉ¤ß¹þ¤à wnn_find_hinsi_by_name(c) ̾Á°¤òÍ¿¤¨¤Æ¡¢ÉÊ»ìÈÖ¹æ¤ò¼è¤ë char *c; char *wnn_get_hinsi_name(k) ÉÊ»ìÈֹ椫¤é̾Á°¤ò¼è¤ë int k; int wnn_get_fukugou_component(k,str, ) Ê£¹çÉÊ»ì¤ËÂФ·¤Æ ¹½À®Í×ÁǤòµá¤á¤ë int k; ¹½À®Í×ÁǤθĿô¤¬ÊÖÃͤȤ·¤ÆÊÖ¤µ¤ì¡¢ unsigned short **str; ¹½À®Í×ÁÇ¤Ï str °Ê¹ß¤ËÊÖ¤µ¤ì¤ë¡£ */ /* extern int wnn_errorno; */ /* *here start the real program */ #define SIZE 1024 int wnnerror_hinsi; static int hinsi_loaded = 0; static int line_no = 0; #ifdef NEW_HINSI static w_char *heap, *hp; static unsigned short *wheap, *whp; static w_char **hinsi; static struct wnn_fukugou *fukugou; static struct wnn_hinsi_node *node; static int cucucu, fufufu, eof; #else /* NEW_HINSI */ static w_char heap[HEAP_LEN]; static w_char *hp = heap; static unsigned short wheap[WHEAP_LEN]; static unsigned short *whp = wheap; static w_char *hinsi[MAXHINSI]; static struct wnn_fukugou fukugou[MAXFUKUGOU]; static struct wnn_hinsi_node node[MAXNODE]; #endif /* NEW_HINSI */ int mhinsi = 0; int mfukugou = 0; int mnode = 0; #if !defined(DSERVER) && defined(JSERVER) extern char *hinsi_file_name; #endif /* !DSERVER && JSERVER */ static void error_long(args) ARGS *args; { wnnerror_hinsi = WNN_TOO_LONG_HINSI_FILE_LINE; } static void error_no_heap(args) ARGS *args; { wnnerror_hinsi = WNN_TOO_BIG_HINSI_FILE; } static int get_char0(fp, args) FILE *fp; ARGS *args; { int c,d; for(;(c = getc(fp)) == COMMENT_CHAR || c == CONTINUE_CHAR || c == IGNORE_CHAR1 || c == IGNORE_CHAR2;){ if(c == CONTINUE_CHAR){ if((d = getc(fp))== EOF){ break; } if(d == '\n'){ line_no += 1; continue; }else{ ungetc(d,fp); break; } }else if(c == COMMENT_CHAR){ for(;;){ if((c = getc(fp))== EOF){ return(EOF); } if(c == '\n'){ ungetc(c,fp); line_no += 1; break; } } } } if(c == '\n')line_no += 1; return(c); } static int get_char(fp, args) /* remove null lines */ FILE *fp; ARGS *args; { int d; #ifndef NEW_HINSI static int cucucu = -1; static int fufufu = 0; #endif /* NEW_HINSI */ if(cucucu != -1){ d = cucucu; cucucu = -1; return(d); }else{ if(fufufu == 0){ /* remove all new lines in the head of the file */ for(;(d = get_char0(fp, args)) == '\n';); fufufu = 1; }else{ d = get_char0(fp, args); } if(d == '\n'){ while((cucucu = get_char0(fp, args)) == '\n'); } return(d); } } /* get one phrase and return the separater */ static int get_phrase(s0,size,fp, args) UCHAR *s0; int size; FILE *fp; ARGS *args; { UCHAR *s = s0; int c; #ifndef NEW_HINSI static int eof = 0; #endif /* NEW_HINSI */ if(eof){ *s0 = 0; return(EOF); } while((c = get_char(fp, args)) != '\n' && c != DEVIDE_CHAR && c != NODE_CHAR && c != HINSI_SEPARATE_CHAR && c != EOF){ if(s - s0 >= size){ error_long(args); return(HINSI_ERR); } *s++ = c; } if(c == EOF) eof = 1; if(s - s0 >= size - 1){ error_long(args); return(HINSI_ERR); } *s++ = '\0'; return(c); } static int stradd(cp,str, args) w_char **cp; char *str; ARGS *args; { int len = strlen(str); if(hp + len + 1 >= heap + HEAP_LEN){ error_no_heap(args); return(-1); } *cp = hp; wnn_Sstrcpy(hp,str); hp += wnn_Strlen(hp) + 1; return(0); } static int w_stradd(cp,str, args) unsigned short **cp; unsigned short *str; ARGS *args; { *cp = whp; for(;*str != TERMINATE; str++,whp++){ if(whp >= wheap + WHEAP_LEN){ error_no_heap(args); return(-1); } *whp = *str; } *whp++ = TERMINATE; return(0); } int wnn_loadhinsi(fname, args) unsigned char *fname; ARGS *args; { FILE *fp; UCHAR buf[SIZE]; unsigned short fukugou_str[MAXHINSI]; int sep; int h; unsigned short *c; char tmp[256]; extern int wnn_find_hinsi_by_name(); #ifdef NEW_HINSI return(0); #endif /* NEW_HINSI */ if(fname == NULL){ strcpy(tmp, LIBDIR); strcat(tmp, HINSIDATA_FILE); fname = (unsigned char *)tmp; } if((fp = fopen((char *)fname, "r")) == NULL){ wnnerror_hinsi = WNN_NO_HINSI_DATA_FILE; goto err_1; } hinsi_loaded = 1; while((sep = get_phrase(buf,SIZE,fp, args)) != EOF){ if(sep == HINSI_ERR){ goto err; /* wnnerror_hinsi set in get_phrase */ } if(buf[0] == YOYAKU_CHAR){ /* yoyaku */ if(sep != '\n'){ wnnerror_hinsi = WNN_BAD_HINSI_FILE; goto err; } hinsi[mhinsi++] = NULL; }else if(sep == '\n'){ /* hinsi */ if(stradd(&hinsi[mhinsi++],buf, args))goto err; }else if(sep == DEVIDE_CHAR){ /* fukugou */ if(stradd(&fukugou[mfukugou].name,buf, args))goto err; c = fukugou_str; while((sep = get_phrase(buf,SIZE,fp, args)) != EOF){ if(sep == -1){ goto err; /* wnnerror_hinsi set in get_phrase */ } if(sep != EOF && sep != HINSI_SEPARATE_CHAR && sep != '\n'){ wnnerror_hinsi = WNN_BAD_HINSI_FILE; goto err; } if((h = wnn_find_hinsi_by_name(buf, args)) == -1 || h >= mhinsi){ wnnerror_hinsi = WNN_BAD_HINSI_FILE; goto err; } *c++ = h; if(sep == '\n' || sep == EOF) break; } *c = TERMINATE; if(w_stradd(&fukugou[mfukugou++].component,fukugou_str, args))goto err; }else if(sep == NODE_CHAR){ int first = 1; w_char *dummy; node[mnode].kosuu = 0; if(stradd(&node[mnode].name,buf, args))goto err; while((sep = get_phrase(buf,SIZE,fp, args)) != EOF){ if(sep == -1){ goto err; /* wnnerror_hinsi set in get_phrase */ } if(sep != EOF && sep != HINSI_SEPARATE_CHAR && sep != '\n'){ wnnerror_hinsi = WNN_BAD_HINSI_FILE; goto err; } node[mnode].kosuu++; if(first){ if(stradd(&node[mnode].son,buf, args))goto err; first = 0; }else{ if(stradd(&dummy,buf, args))goto err; } if(sep == '\n' || sep == EOF) break; } mnode++; } } fclose(fp); return(0); err: fclose(fp); err_1: return(HINSI_ERR); } static int find_hinsi_by_name(c, args) register w_char *c; ARGS *args; { register int k; #if !defined(DSERVER) && defined(NEW_HINSI) mhinsi = ft->hinsi_data->mhinsi; mfukugou = ft->hinsi_data->mfukugou; hinsi = ft->hinsi_data->hinsi; fukugou = ft->hinsi_data->fukugou; #endif /* !DSERVER && NEW_HINSI */ char *hfname = NULL; #if !defined(DSERVER) && defined(JSERVER) hfname = hinsi_file_name; #endif /* !DSERVER && JSERVER */ if(!hinsi_loaded){ if(wnn_loadhinsi(hfname, args) != 0){ return(-1); } } for(k = 0 ; k < mhinsi; k++){ if(hinsi[k] && wnn_Strcmp(hinsi[k],c) == 0){ return(k); } } for(k = 0 ; k < mfukugou; k++){ if(fukugou[k].name && wnn_Strcmp(fukugou[k].name,c) == 0){ return(FUKUGOU_START - k); } } return(-1); } int wnn_find_hinsi_by_name(c, args) register char *c; ARGS *args; { w_char hin[WNN_HINSI_NAME_LEN]; wnn_Sstrcpy(hin, c); return(find_hinsi_by_name(hin, args)); } static w_char * get_hinsi_name(k, args) int k; ARGS *args; { #if !defined(DSERVER) && defined(NEW_HINSI) mhinsi = ft->hinsi_data->mhinsi; mfukugou = ft->hinsi_data->mfukugou; hinsi = ft->hinsi_data->hinsi; fukugou = ft->hinsi_data->fukugou; #endif /* !DSERVER && NEW_HINSI */ char *hfname = NULL; #if !defined(DSERVER) && defined(JSERVER) hfname = hinsi_file_name; #endif /* !DSERVER && JSERVER */ if(!hinsi_loaded){ if(wnn_loadhinsi(hfname, args) != 0){ return(NULL); } } if(k < mhinsi && k >= 0){ return(hinsi[k]); }else if(k > FUKUGOU_START - mfukugou){ return(fukugou[FUKUGOU_START - k].name); } return(NULL); } char * wnn_get_hinsi_name(k, args) int k; ARGS *args; { w_char *s; static char hin[WNN_HINSI_NAME_LEN * 2]; if((s = get_hinsi_name(k, args)) == NULL)return(NULL); wnn_sStrcpy(hin, s); return(hin); } static int wnn_get_fukugou_component_body(k,shp, args) register int k; register unsigned short **shp; ARGS *args; { static unsigned short tmp; register unsigned short *s; int n; #if !defined(DSERVER) && defined(NEW_HINSI) mhinsi = ft->hinsi_data->mhinsi; mfukugou = ft->hinsi_data->mfukugou; hinsi = ft->hinsi_data->hinsi; fukugou = ft->hinsi_data->fukugou; #endif /* !DSERVER && NEW_HINSI */ if(k < mhinsi && k >= 0){ tmp = k; *shp = &tmp; return(1); } if(k > FUKUGOU_START - mfukugou && k <= FUKUGOU_START){ /* This fix for NEWS-OS 6.0.1 compiler bug!! */ n = FUKUGOU_START - k; for(*shp = s = fukugou[n].component;*s != TERMINATE;s++); return(s - *shp); } return(-1); } int wnn_get_fukugou_component(k,shp, args) register int k; register unsigned short **shp; ARGS *args; { char *hfname = NULL; #if !defined(DSERVER) && defined(JSERVER) hfname = hinsi_file_name; #endif /* !DSERVER && JSERVER */ if(!hinsi_loaded){ if(wnn_loadhinsi(hfname, args) != 0){ return(-1); } } return(wnn_get_fukugou_component_body(k, shp, args)); } #ifdef NEW_HINSI int new_wnn_loadhinsi(fp, hinsi_data) FILE *fp; struct HDT **hinsi_data; { UCHAR buf[SIZE]; unsigned short fukugou_str[MAXHINSI]; int sep; int h; unsigned short *c; struct HDT *hdata; static int wnn_find_load_hinsi_by_name(); if((hdata = (struct HDT *)malloc(sizeof(struct HDT))) == NULL) { return(-1); } hp = heap = hdata->heap; whp = wheap = hdata->wheap; hdata->mhinsi = 0; hdata->mfukugou = 0; hdata->mnode = 0; cucucu = -1; eof = fufufu = 0; hinsi_loaded = 1; while((sep = get_phrase(buf,SIZE,fp)) != EOF){ if(sep == HINSI_ERR){ goto err; /* wnnerror_hinsi set in get_phrase */ } if(buf[0] == YOYAKU_CHAR){ /* yoyaku */ if(sep != '\n'){ wnnerror_hinsi = WNN_BAD_HINSI_FILE; goto err; } hdata->hinsi[(hdata->mhinsi)++] = NULL; }else if(sep == '\n'){ /* hinsi */ if(stradd(&(hdata->hinsi[(hdata->mhinsi)++]),buf))goto err; }else if(sep == DEVIDE_CHAR){ /* fukugou */ if(stradd(&(hdata->fukugou[hdata->mfukugou].name),buf))goto err; c = fukugou_str; while((sep = get_phrase(buf,SIZE,fp)) != EOF){ if(sep == -1){ goto err; /* wnnerror_hinsi set in get_phrase */ } if(sep != EOF && sep != HINSI_SEPARATE_CHAR && sep != '\n'){ wnnerror_hinsi = WNN_BAD_HINSI_FILE; goto err; } if((h = wnn_find_load_hinsi_by_name(hdata, buf)) == -1 || h >= hdata->mhinsi){ wnnerror_hinsi = WNN_BAD_HINSI_FILE; goto err; } *c++ = h; if(sep == '\n' || sep == EOF) break; } *c = TERMINATE; if(w_stradd(&(hdata->fukugou[(hdata->mfukugou)++].component),fukugou_str))goto err; }else if(sep == NODE_CHAR){ int first = 1; w_char *dummy; hdata->node[hdata->mnode].kosuu = 0; if(stradd(&(hdata->node[hdata->mnode].name),buf))goto err; while((sep = get_phrase(buf,SIZE,fp)) != EOF){ if(sep == -1){ goto err; /* wnnerror_hinsi set in get_phrase */ } if(sep != EOF && sep != HINSI_SEPARATE_CHAR && sep != '\n'){ wnnerror_hinsi = WNN_BAD_HINSI_FILE; goto err; } (hdata->node[hdata->mnode].kosuu)++; if(first){ if(stradd(&(hdata->node[hdata->mnode].son),buf))goto err; first = 0; }else{ if(stradd(&dummy,buf))goto err; } if(sep == '\n' || sep == EOF) break; } (hdata->mnode)++; } } *hinsi_data = hdata; return(0); err: free(hdata); return(HINSI_ERR); } int find_load_hinsi_by_name(hdata, c) struct HDT *hdata; register w_char *c; { register int k; for(k = 0 ; k < hdata->mhinsi; k++){ if(hdata->hinsi[k] && wnn_Strcmp(hdata->hinsi[k],c) == 0){ return(k); } } for(k = 0 ; k < hdata->mfukugou; k++){ if(hdata->fukugou[k].name && wnn_Strcmp(hdata->fukugou[k].name,c) == 0){ return(FUKUGOU_START - k); } } return(-1); } static int wnn_find_load_hinsi_by_name(hdata, c) struct HDT *hdata; register char *c; { w_char hin[WNN_HINSI_NAME_LEN]; wnn_Sstrcpy(hin, c); return(find_load_hinsi_by_name(hdata, hin)); } #endif /* NEW_HINSI */ /* ?? need doc. */ int wnn_get_hinsi_i4_boundary_free(hinsi_pter) register unsigned char *hinsi_pter; { register int ret; ret = *hinsi_pter; ret = (ret<<8) | *(hinsi_pter+1); return(ret); } wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/etc/bdic.c0000644000000000000000000014604107153676736017101 0ustar rootroot/* * $Id: bdic.c,v 2.43.2.1 2000/08/04 05:37:02 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ /* Binary (Updatable, Stable) dictionary common routine. */ #if defined(JS) #ifdef WRITE_CHECK #define BDIC_WRITE_CHECK #endif /* WRITE_CHECK */ #endif /* JS */ #ifdef UX386 #include #else #include #endif #ifndef JS #include #include #include "commonhd.h" #include "jslib.h" #include "jh.h" #endif #include "jdata.h" #include "wnn_os.h" #include "wnn_string.h" #include "mt_jserver.h" #ifdef JS #ifndef BDIC_WRITE_CHECK #define vputc(X, pt, args) putc((X), (pt)) #endif /* !BDIC_WRITE_CHECK */ #define vgetc(pt, args) getc(pt) #else /* JS */ #define vputc(X, pt, args) putc((X), (pt)) #define vgetc(pt, args) getc(pt) #endif /* JS */ #ifndef min #define min(a, b) ((a > b)? b:a) #define max(a, b) ((a < b)? b:a) #endif /*:::DOC_START * * Function Name: dic_get_compressed_filename * Description : get compressed filename * Parameter : * t_file: (Out) compressed filename * file_name: (In) file_name * caution: file should be compressed; * * Return value : file pointer for fopen-ed or popen-ed dictionary file * * Author : fujimori * * Revision history: * 24-Nov-94: fujimori: initial * *:::DOC_END */ #ifdef JS static #endif void dic_get_compressed_filename(t_file, file_name ) char *t_file; char *file_name; { FILE *fp; char mode_str[32]; /* check environment i-file+ext "" ".gz" ".Z" ; one of any three magic-of-file gz Z - ; one of any three prog gz Z - */ char t_file_ext [3][4]; int magic_len [3]; char magic [3][4]; int pair_no; int i; FILE *ifpter2; FILE *pfpter2; char buf [1024]; int num_read; strcpy(mode_str, "r"); strcpy(&t_file_ext[0][0], ".gz"); strcpy(&t_file_ext[1][0], ".Z"); strcpy(&t_file_ext[2][0], ".Z"); magic_len[0] = 2; magic_len[1] = 2; magic_len[2] = 2; strcpy(&magic[0][0], "\037\213\010"); strcpy(&magic[1][0], "\037\235\220"); strcpy(&magic[2][0], "\037\235\220"); /* open dic file with input mode */ if((fp = fopen(file_name , mode_str)) == NULL){ /* try for zipped dict */ /* check pair */ for(pair_no = -1, i=0; i<3; i++) { /* build compressed file name */ strcpy(t_file, file_name ); strcat(t_file, t_file_ext[i] ); /* try to open it */ ifpter2 = fopen(t_file , "r"); pfpter2 = (FILE *) -1; if( (ifpter2 == NULL) || (pfpter2 == NULL) ){ } else { if( (num_read = fread(buf, 1, magic_len[i], ifpter2) ) == magic_len[i] ) { if( strncmp(buf, magic[i], magic_len[i]) == 0 ) { if(pair_no<0) pair_no = i; } } } if( ifpter2 ) fclose(ifpter2); } if(pair_no<0) { strcpy(t_file, "\0" ); return ; } /* build compressed file name */ strcpy(t_file, file_name ); strcat(t_file, t_file_ext[pair_no] ); } else { /* check pair */ fclose(fp); /* build compressed file name */ strcpy(t_file, file_name ); } return ; } /* End of dic_get_compressed_filename */ /*:::DOC_START * * Function Name: dic_fopen * Description : open normal or compressed dictionary * Parameter : * file_name: (In) file_name * mode_str: (In) open mode * p_is_compressed: (Out) indicate if compressed or not, * used when close, !0: compressed; * * Return value : file pointer for fopen-ed or popen-ed dictionary file * * Author : fujimori * * Revision history: * 22-Sep-94: fujimori: initial * *:::DOC_END */ #ifdef JS static #endif FILE * dic_fopen(file_name, mode_str, p_is_compressed) char *file_name; char *mode_str; int *p_is_compressed; { FILE *fp; *p_is_compressed = 0; if( strcmp( mode_str, "r" ) ) { return fopen(file_name , mode_str); } { /* check environment i-file+ext "" ".gz" ".Z" ; one of any three magic-of-file gz Z - ; one of any three prog gz Z - */ /* "1024" as file_name size should be not used, use "/usr/include/stdio.h:450:#define FILENAME_MAX 1024 ", but ... */ char t_file [1024], cmd [1024]; char t_file_ext [3][4]; char cmd_b [3][40]; int magic_len [3]; char magic [3][4]; int magic_len_max = 2; int magic_len_min = 2; int pair_no; int i; FILE *ifpter2; FILE *pfpter2; char buf [1024]; int num_read; strcpy(&t_file_ext[0][0], ".gz"); strcpy(&t_file_ext[1][0], ".Z"); strcpy(&t_file_ext[2][0], ".Z"); strcpy(&cmd_b[0][0], "gunzip -c"); strcpy(&cmd_b[1][0], "uncompress -c"); strcpy(&cmd_b[2][0], "uncompress -c"); magic_len[0] = 2; magic_len[1] = 2; magic_len[2] = 2; strcpy(&magic[0][0], "\037\213\010"); strcpy(&magic[1][0], "\037\235\220"); strcpy(&magic[2][0], "\037\235\220"); /* open dic file with input mode */ if((fp = fopen(file_name , mode_str)) == NULL){ /* try for zipped dict */ /* check pair */ for(pair_no = -1, i=0; i<3; i++) { /* build compressed file name */ strcpy(t_file, file_name ); strcat(t_file, t_file_ext[i] ); /* try to open it */ ifpter2 = fopen(t_file , "r"); pfpter2 = (FILE *) -1; if( (ifpter2 == NULL) || (pfpter2 == NULL) ){ } else { if( (num_read = fread(buf, 1, magic_len[i], ifpter2) ) == magic_len[i] ) { if( strncmp(buf, magic[i], magic_len[i]) == 0 ) { if(pair_no<0) pair_no = i; } } } if( ifpter2 ) fclose(ifpter2); } if(pair_no<0) { return NULL; } /* build compressed file name */ strcpy(t_file, file_name ); strcat(t_file, t_file_ext[pair_no] ); /* try to open it */ if((fp = fopen(t_file , "r")) == NULL){ return NULL; } fclose(fp); /* build command and open */ strcpy(cmd, cmd_b[pair_no] ); strcat(cmd, t_file ); if((fp = popen(cmd, "r")) == NULL){ return NULL; } *p_is_compressed = 1; } else { /* check pair */ if( (num_read = fread(buf, 1, magic_len_max, fp) ) > (magic_len_min-1) ) { for(pair_no = -1, i=0; i<3; i++) { if( strncmp(buf, magic[i], magic_len[i]) == 0 ) { if(pair_no<0) pair_no = i; } } if(pair_no<0) { } else { *p_is_compressed = 1; } } else { } fclose(fp); if(*p_is_compressed) { /* build command and open */ if(pair_no == 0) { strcpy(cmd, cmd_b[pair_no] ); strcat(cmd, file_name ); } else { char *cmd_23a = "cat "; char *cmd_23b = " | uncompress -c -"; strcpy(cmd, cmd_23a ); strcat(cmd, file_name ); strcat(cmd, cmd_23b ); } if((fp = popen(cmd, "r")) == NULL){ return NULL; } } else { if((fp = fopen(file_name , "r")) == NULL){ return NULL; } } } } return fp; } /* End of dic_fopen */ /*:::DOC_START * * Function Name: dic_fclose * Description : close dictionary file * Parameter : * fp: (In) file pointer for dictionary file * is_compressed: (In) indicate if file is compressed or not * * Return value : None. * * Author : fujimori * * Revision history: * 22-Sep-94: fujimori: initial * *:::DOC_END */ #ifdef JS static #endif void dic_fclose(fp, is_compressed) FILE *fp; int is_compressed; { if(fp==(FILE*)-1 || fp == NULL){ } else { if(is_compressed) { pclose(fp); } else { fclose(fp); } } } /* End of dic_fclose */ /*:::DOC_START * * Function Name: cd_convert_yomi * Description : convert or dis-convert one w_char in yomi * Parameter : * w_c: (In) a w_char to be converted or dis-converted. * deconvert: (In) 0 specify convert, !0 specify dis-convert. * * Return value : converted or dis-converted one w_char in yomi. or Null. * * Author : fujimori * * Revision history: * 22-Sep-94: fujimori: initial * *:::DOC_END */ #ifdef JS static #endif w_char cd_convert_yomi(w_c, deconvert) w_char w_c; int deconvert; { int j; /* data for conversion */ /* convert to ascii */ int cvt_tbl_size = 128-33-1; int cvt_tbl_offset = 33; static w_char cvt_tbl[] = { 0xa1aa, 0xa1af, 0xa1f4, 0xa1f0, 0xa1f3, 0xa1f5, 0xa1ad, /* 041 ! - ' */ 0xa1ca, 0xa1cb, 0xa1f6, 0xa1dc, 0xa1a4, 0xa1dd, 0xa1a5, 0xa1bf, /* 050 ( - / */ 0xa3b0, 0xa3b1, 0xa3b2, 0xa3b3, 0xa3b4, 0xa3b5, 0xa3b6, 0xa3b7, /* 060 0 - 7 */ 0xa3b8, 0xa3b9, 0xa1a7, 0xa1a8, 0xa1e3, 0xa1e1, 0xa1e4, 0xa1a9, /* 070 8 - ? */ 0xa1f7, 0xa3c1, 0xa3c2, 0xa3c3, 0xa3c4, 0xa3c5, 0xa3c6, 0xa3c7, /* 100 @ - G */ 0xa3c8, 0xa3c9, 0xa3ca, 0xa3cb, 0xa3cc, 0xa3cd, 0xa3ce, 0xa3cf, /* 110 H - O */ 0xa3d0, 0xa3d1, 0xa3d2, 0xa3d3, 0xa3d4, 0xa3d5, 0xa3d6, 0xa3d7, /* 120 P - W */ 0xa3d8, 0xa3d9, 0xa3da, 0xa1ce, 0xa1ef, 0xa1cf, 0xa1b0, 0xa1b2, /* 130 X - _ */ 0xa1ae, 0xa3e1, 0xa3e2, 0xa3e3, 0xa3e4, 0xa3e5, 0xa3e6, 0xa3e7, /* 140 ` - g */ 0xa3e8, 0xa3e9, 0xa3ea, 0xa3eb, 0xa3ec, 0xa3ed, 0xa3ee, 0xa3ef, /* 150 h - o */ 0xa3f0, 0xa3f1, 0xa3f2, 0xa3f3, 0xa3f4, 0xa3f5, 0xa3f6, 0xa3f7, /* 160 p - w */ 0xa3f8, 0xa3f9, 0xa3fa, 0xa1d0, 0xa1c3, 0xa1d1, 0xa1b1, /* 170 x - ~ */ }; int cvt_tbl2_size = 3; int cvt_tbl2_offset = 0; static w_char cvt_tbl2[][2] = { { 0xa1bc, 0xf8, }, { 0xa5f4, 0xf9, }, { 0xa1ab, 0xfa, }, /* 1/28 "¡¼" 5/84 "¥ô" unused f8, 1/x "¡«" dakuten */ }; if( deconvert == 0 ) { if( w_c > 0x20 && w_c < 0x7f ) { /* already ascii, do nothing */ return w_c; } else if( w_c > 0xa4a0 && w_c < 0xa4f4 ) { /* "hiragana", re-move first byte */ return w_c&0xff; } else if( w_c > 0xa5a0 && w_c < 0xa5f4 ) { /* "katakana", print warning and re-move first byte */ return w_c&0xff; } else { for(j=0; j 0x20 && w_c < 0x7f ) { /* convert to ascii */ return cvt_tbl[w_c-cvt_tbl_offset]; } else if( w_c > 0xa0 && w_c < 0xf4 ) { /* "hiragana" or "katakana", insert first byte */ return w_c|0xa400; } else { for(j=0; j 0 ); } } /* End of dic_read_to_eof */ #ifdef JS static #else extern #endif int output_file_header(), input_file_uniq(), output_header_jt(), #ifdef BDIC_WRITE_CHECK put_short(), output_file_uniq(), #endif /* BDIC_WRITE_CHECK */ create_file_header(), input_file_header(), change_file_uniq1(), output_header_hjt(); #ifdef JS static #else extern #endif #ifdef BDIC_WRITE_CHECK void new_pwd(); #else /* BDIC_WRITE_CHECK */ void put_short(), output_file_uniq(), new_pwd(); #endif /* BDIC_WRITE_CHECK */ #ifdef BDIC_WRITE_CHECK static int vputc(c, fp, args) char c; FILE *fp; ARGS *args; { if (fwrite(&c, sizeof(char), 1, fp) <= 0) return(-1); return(0); } #endif /* BDIC_WRITE_CHECK */ #ifdef JS static #endif #ifdef BDIC_WRITE_CHECK int #else /* BDIC_WRITE_CHECK */ void #endif /* BDIC_WRITE_CHECK */ putnull(ofpter, n, args) register FILE *ofpter; register int n; ARGS *args; { for(;n;n--){ #ifdef BDIC_WRITE_CHECK if (vputc('\0', ofpter, args) == -1) return(-1); #else /* BDIC_WRITE_CHECK */ vputc('\0', ofpter, args); #endif /* BDIC_WRITE_CHECK */ } #ifdef BDIC_WRITE_CHECK return(0); #endif /* BDIC_WRITE_CHECK */ } #ifdef JS static #endif #ifdef BDIC_WRITE_CHECK int #else /* BDIC_WRITE_CHECK */ void #endif /* BDIC_WRITE_CHECK */ put_n_str(ofpter, c, n, args) register FILE *ofpter; register int n; register char *c; ARGS *args; { for(;n;n--){ #ifdef BDIC_WRITE_CHECK if (vputc(*c++, ofpter, args) == -1) return(-1); #else /* BDIC_WRITE_CHECK */ vputc(*c++, ofpter, args); #endif /* BDIC_WRITE_CHECK */ } #ifdef BDIC_WRITE_CHECK return(0); #endif /* BDIC_WRITE_CHECK */ } #ifdef JS static #endif #ifdef BDIC_WRITE_CHECK int #else /* BDIC_WRITE_CHECK */ void #endif /* BDIC_WRITE_CHECK */ put_n_EU_str(ofpter, c, n, args) register FILE *ofpter; register w_char *c; register int n; ARGS *args; { for(;n;n--){ #ifdef BDIC_WRITE_CHECK if (put_short(ofpter, (int)(*c++), args) == -1) return(-1); #else /* BDIC_WRITE_CHECK */ put_short(ofpter, (int)(*c++), args); #endif /* BDIC_WRITE_CHECK */ } #ifdef BDIC_WRITE_CHECK return(0); #endif /* BDIC_WRITE_CHECK */ } #ifdef JS static #endif #ifdef BDIC_WRITE_CHECK int #else /* BDIC_WRITE_CHECK */ void #endif /* BDIC_WRITE_CHECK */ put_short(ofpter, i, args) register FILE *ofpter; register int i; ARGS *args; { #ifdef BDIC_WRITE_CHECK if ((vputc(i >> 8, ofpter, args) == -1) || (vputc(i , ofpter, args) == -1)) return(-1); return(0); #else /* BDIC_WRITE_CHECK */ vputc(i >> 8, ofpter, args); vputc(i , ofpter, args); #endif /* BDIC_WRITE_CHECK */ } #ifdef JS static #endif #ifdef BDIC_WRITE_CHECK int #else /* BDIC_WRITE_CHECK */ void #endif /* BDIC_WRITE_CHECK */ putint(ofpter, i, args) register FILE *ofpter; register int i; ARGS *args; { #ifdef BDIC_WRITE_CHECK if ((vputc(i >> 24, ofpter, args) == -1) || (vputc(i >> 16, ofpter, args) == -1) || (vputc(i >> 8 , ofpter, args) == -1) || (vputc(i , ofpter, args) == -1)) return(-1); return(0); #else /* BDIC_WRITE_CHECK */ vputc(i >> 24, ofpter, args); vputc(i >> 16, ofpter, args); vputc(i >> 8 , ofpter, args); vputc(i , ofpter, args); #endif /* BDIC_WRITE_CHECK */ } #ifdef JS static #endif #ifdef BDIC_WRITE_CHECK int #else /* BDIC_WRITE_CHECK */ void #endif /* BDIC_WRITE_CHECK */ put_n_int(ofpter, i, n, args) register FILE *ofpter; register int *i; register int n; ARGS *args; { #ifdef COPY_HINDO_IN for(;n;n--){ #ifdef BDIC_WRITE_CHECK if(putint(ofpter, (int)(*i++), args) == -1) return(-1); #else /* BDIC_WRITE_CHECK */ putint(ofpter, (int)(*i++), args); #endif /* BDIC_WRITE_CHECK */ } #ifdef BDIC_WRITE_CHECK return(0); #endif /* BDIC_WRITE_CHECK */ #else /* COPY_HINDO_IN */ #ifdef BDIC_WRITE_CHECK return(putnull(ofpter, n, args)); #else /* BDIC_WRITE_CHECK */ putnull(ofpter, n, args); #endif /* BDIC_WRITE_CHECK */ #endif /* COPY_HINDO_IN */ } #ifdef JS static #endif int getnull(ifpter, n, args) register FILE *ifpter; register int n; ARGS *args; { register int k; for(;n;n--){ k = vgetc(ifpter, args); if(k == -1)return(-1); } return(0); } #ifdef JS static #endif int getnstr(ifpter, n, st, args) register FILE *ifpter; register int n; register char *st; ARGS *args; { int k; for(;n;n--){ k = vgetc(ifpter, args); *st++ = k; if(k == -1)return(-1); } return(0); } #if !defined(JS) && !defined(JSERVER) int get_n_EU_str(ifpter, n, st, args) register FILE *ifpter; register int n; register w_char *st; ARGS *args; { register int k; extern int get_short(); for(;n;n--){ k = get_short((short *)st++, ifpter, args); if(k == -1)return(-1); } return(0); } int get_short(sp,ifpter, args) register short *sp; FILE *ifpter; ARGS *args; { register int i = 0; register int k; i |= (k = vgetc(ifpter, args)) << 8; if(k == -1)return(-1); i |= (k = vgetc(ifpter, args)); if(k == -1)return(-1); *sp = i; return(0); } #endif #ifdef JS static #endif int getint(ip,ifpter, args) register FILE *ifpter; int *ip; ARGS *args; { register int i = 0; register int k; i |= (k = vgetc(ifpter, args)) << 24; if(k == -1)return(-1); i |= (k = vgetc(ifpter, args)) << 16; if(k == -1)return(-1); i |= (k = vgetc(ifpter, args)) << 8; if(k == -1)return(-1); i |= (k = vgetc(ifpter, args)); if(k == -1)return(-1); *ip = i; return(0); } #ifndef JS void udytoS(yomi,tnum,hostart,tary) register w_char *yomi; register int tnum; char *hostart; register struct uind1 *tary; { struct uind2 *hop; int len; hop = (struct uind2 *)((char *)hostart + tary[tnum].pter); yomi[0] = tary[tnum].yomi1 >> 16; yomi[1] = tary[tnum].yomi1 & 0xffff; if(yomi[1]){ yomi[2] = tary[tnum].yomi2 >> 16; if(yomi[2]){ yomi[3] = tary[tnum].yomi2 & 0xffff; } } len = hop->yomi[0]; /*Strncpy(yomi + 4, (hop->yomi) + 1, len - 4); In order not to use ../etc/strings.c*/ bcopy((char *)((hop->yomi) + 1), (char *)(yomi + 4), max(0, ((len - 4)) * 2)); yomi[len] = 0; } #endif #ifdef BDIC_WRITE_CHECK static char * make_tmp_name(n, args) char *n; ARGS *args; { static char buf[256]; if (n == NULL || *n == '\0') return NULL; sprintf(buf, "%s~", n); return(buf); } static char * make_backup_name(n, args) char *n; ARGS *args; { static char buf[256]; if (n == NULL || *n == '\0') return NULL; sprintf(buf, "%s#", n); return(buf); } #ifdef JS static #endif void check_backup(n, args) char *n; ARGS *args; { char *p; if ((p = make_tmp_name(n, args)) && (access(p, F_OK) != -1)) unlink(p); if ((p = make_backup_name(n, args)) && (access(p, F_OK) != -1)) { unlink(n); link(p, n); unlink(p); } } static int copy_file_to_file(from, to) FILE *from, *to; { char buf[1024]; int r_len, w_len, i; for (;;) { r_len = fread(buf, 1, 1024, from); if (r_len <= 0) break; for ( i = 0; i < r_len; i += w_len) { w_len = fwrite(&buf[i], 1, r_len - i, to); if (w_len <= 0) { fseek(from, 0, 0); fseek(to, 0, 0); return(-1); } if (w_len >= r_len) break; } } fseek(from, 0, 0); fseek(to, 0, 0); return(0); } #ifdef JS static #endif void delete_tmp_file(n) char *n; { if (n && *n) unlink(n); } #ifdef JS static #endif char * make_backup_file(n, args) char *n; ARGS *args; { FILE *fp, *fp2; char *p, *p2; if ((p = make_backup_name(n, args)) == NULL) return(NULL); if ((p2 = make_tmp_name(n, args)) == NULL) return(NULL); fp = fp2 = NULL; if (((fp = fopen(p2, "w+")) == NULL) || ((fp2 = fopen(n, "r")) == NULL)) { if(fp) fclose(fp); if(fp2) fclose(fp2); return NULL; } if (copy_file_to_file(fp2, fp) == -1) { fclose(fp); fclose(fp2); return(NULL); } fclose(fp); fclose(fp2); if (access(p, F_OK) != -1) unlink(p); link(p2, p); unlink(p2); return(p); } #ifdef JS static #endif char * make_tmp_file(n, copy, ret_fp, args) char *n; int copy; FILE **ret_fp; ARGS *args; { FILE *fp, *fp2; struct wnn_file_head fh; char *p; p = make_tmp_name(n, args); if ((fp = fopen(p, "w+")) == NULL) { *ret_fp = NULL; return NULL; } if (copy && (fp2 = fopen(n, "r")) != NULL) { input_file_header(fp2, &fh, args); fseek(fp2, 0, 0); if ((copy_file_to_file(fp2, fp) == -1) || (create_file_header(fp, fh.file_type, fh.file_passwd, args) == -1)) { fclose(fp); fclose(fp2); *ret_fp = NULL; return NULL; } fseek(fp, 0, 0); fclose(fp2); } *ret_fp = fp; return p; } #ifdef JS static #endif void move_tmp_to_org(tmp_name, org_name, copy) char *tmp_name, *org_name; int copy; { FILE *org, *tmp; org = tmp = NULL; if (copy) { if (((tmp = fopen(tmp_name, "r")) == NULL) || ((org = fopen(org_name, "w+")) == NULL)) { if(tmp) fclose(tmp); if(org) fclose(org); return; } copy_file_to_file(tmp, org); fclose(tmp); fclose(org); } else { unlink(org_name); link(tmp_name, org_name); } unlink(tmp_name); } #endif /* BDIC_WRITE_CHECK */ #ifdef JS static #endif int set_file_header(fh, ofpter, file_type, file_passwd, args) FILE *ofpter; int file_type; char *file_passwd; ARGS *args; struct wnn_file_head *fh; { struct stat buf; char hostname[WNN_HOSTLEN]; if(fstat(fileno(ofpter), &buf) == -1){ return(-1); } gethostname(hostname, WNN_HOSTLEN); hostname[WNN_HOSTLEN - 1] = '\0'; fh->file_uniq.time = (int)buf.st_ctime; fh->file_uniq.dev = (int)buf.st_dev; fh->file_uniq.inode = (int)buf.st_ino; bzero(fh->file_uniq.createhost, WNN_HOSTLEN); strcpy(fh->file_uniq.createhost, hostname); /* file_uniq_org */ fh->file_uniq_org.time = (int)buf.st_ctime; fh->file_uniq_org.dev = (int)buf.st_dev; fh->file_uniq_org.inode = (int)buf.st_ino; bzero(fh->file_uniq_org.createhost, WNN_HOSTLEN); strcpy(fh->file_uniq_org.createhost, hostname); fh->file_type = file_type; if(file_passwd){ strncpy(fh->file_passwd, file_passwd, WNN_PASSWD_LEN); }else{ bzero(fh->file_passwd, WNN_PASSWD_LEN); } return(0); } #ifdef JS static #endif int create_file_header(ofpter, file_type, file_passwd, args) FILE *ofpter; int file_type; char *file_passwd; ARGS *args; { struct wnn_file_head fh; if(set_file_header(&fh, ofpter, file_type, file_passwd, args) == -1) return(-1); if(output_file_header(ofpter, &fh, args) == -1) return(-1); return(0); } /* 128 Bytes File Header */ #ifdef JS static #endif int output_file_header(ofpter, hp, args) FILE *ofpter; struct wnn_file_head *hp; ARGS *args; { #ifdef BDIC_WRITE_CHECK if ((put_n_str(ofpter, WNN_FILE_STRING, WNN_FILE_STRING_LEN, args) == -1) || (putint(ofpter, hp->file_type, args) == -1) || (output_file_uniq(&hp->file_uniq, ofpter, args) == -1) || (output_file_uniq(&hp->file_uniq_org, ofpter, args) == -1) || (put_n_str(ofpter, hp->file_passwd, WNN_PASSWD_LEN, args) == -1) || (putnull(ofpter, 36, args) == -1)) return(-1); /* Future Use */ #else /* BDIC_WRITE_CHECK */ put_n_str(ofpter, WNN_FILE_STRING, WNN_FILE_STRING_LEN, args); putint(ofpter, hp->file_type, args); output_file_uniq(&hp->file_uniq, ofpter, args); output_file_uniq(&hp->file_uniq_org, ofpter, args); put_n_str(ofpter, hp->file_passwd, WNN_PASSWD_LEN, args); putnull(ofpter, 36, args); /* Future Use */ #endif /* BDIC_WRITE_CHECK */ return(0); } #ifdef JS static #endif int input_file_header(ifpter, hp, args) FILE *ifpter; struct wnn_file_head *hp; ARGS *args; { char wnn_file_string[WNN_FILE_STRING_LEN + 1]; int err = 0; getnstr(ifpter, WNN_FILE_STRING_LEN, wnn_file_string, args); if(strncmp(wnn_file_string, WNN_FILE_STRING, WNN_FILE_STRING_LEN)) err = -1; if(getint((&hp->file_type), ifpter, args) == -1) err = -1; if(input_file_uniq(&(hp->file_uniq), ifpter, args) == -1) err = -1; if(input_file_uniq(&(hp->file_uniq_org), ifpter, args) == -1) err = -1; getnstr(ifpter, WNN_PASSWD_LEN, hp->file_passwd, args); getnull(ifpter, 36, args); return(err); } #ifdef JS static #endif #ifdef BDIC_WRITE_CHECK int #else /* BDIC_WRITE_CHECK */ void #endif /* BDIC_WRITE_CHECK */ output_file_uniq(funiq, ofpter, args) struct wnn_file_uniq *funiq; FILE *ofpter; ARGS *args; { #ifdef BDIC_WRITE_CHECK if ((putint(ofpter, funiq->time, args) == -1) || (putint(ofpter, funiq->dev, args) == -1) || (putint(ofpter, funiq->inode, args) == -1) || (put_n_str(ofpter, funiq->createhost, strlen(funiq->createhost), args) == -1) || (putnull(ofpter, WNN_HOSTLEN - strlen(funiq->createhost), args) == -1)) return(-1); return(0); #else /* BDIC_WRITE_CHECK */ putint(ofpter, funiq->time, args); putint(ofpter, funiq->dev, args); putint(ofpter, funiq->inode, args); put_n_str(ofpter, funiq->createhost, strlen(funiq->createhost), args); putnull(ofpter, WNN_HOSTLEN - strlen(funiq->createhost), args); #endif /* BDIC_WRITE_CHECK */ } #ifdef JS static #endif int input_file_uniq(funiq, ifpter, args) struct wnn_file_uniq *funiq; FILE *ifpter; ARGS *args; { if( getint(&(funiq->time), ifpter, args) == -1 || getint(&(funiq->dev), ifpter, args) == -1 || getint(&(funiq->inode), ifpter, args) == -1 || getnstr(ifpter, WNN_HOSTLEN, funiq->createhost, args) == -1) return(-1); return(0); } #ifdef JS static #endif int check_inode(f, fh) FILE *f; struct wnn_file_head *fh; { struct stat buf; if(fstat(fileno(f), &buf) == -1){ return(-1); } if((int)buf.st_ino != fh->file_uniq.inode){ return(-1); } return(0); } /*:::DOC_START * * Function Name: dic_check_inode * Description : check i-node of file * Parameter : * f: (In) file pointer for dictionary file * fh: (In) file header * file_name: (In) file_name * is_compressed: (In) indicate if file is compressed or not * * Return value : check result, 0: same, -1: different * (same as check_inode()), always same if file is compressed * * Author : fujimori * * Revision history: * 22-Sep-94: fujimori: initial * *:::DOC_END */ #ifdef JS static #endif int dic_check_inode(f, fh, file_name, is_compressed) FILE *f; struct wnn_file_head *fh; char *file_name; int is_compressed; { /* Implementation */ FILE *fp; if(is_compressed == 0){ return(check_inode(f, fh)); } else { struct stat buf; /* open dic file with input mode */ /* try for zipped dict */ /* "1024" as file_name size should be not used, use "/usr/include/stdio.h:450:#define FILENAME_MAX 1024 ", but ... */ char t_file [1024]; /* build compressed file name */ dic_get_compressed_filename(t_file, file_name ); /* try to open it */ if((fp = fopen(t_file , "r")) == NULL){ return (-1); } if(fstat(fileno(fp), &buf) == -1){ fclose(fp); return(-1); } if((int)buf.st_ino != fh->file_uniq.inode){ } fclose(fp); return(0); } } /* End of dic_check_inode */ #ifdef JS static #endif int change_file_uniq(fh, n, args) struct wnn_file_head *fh; char *n; ARGS *args; { int x; FILE *fp; #ifdef BDIC_WRITE_CHECK char *tmp, *backup = NULL; backup = make_backup_file(n, args); if ((tmp = make_tmp_file(n, 1, &fp, args)) == NULL) { delete_tmp_file(backup); #else /* BDIC_WRITE_CHECK */ if((fp = fopen(n,"r+")) == NULL){ #endif /* BDIC_WRITE_CHECK */ return(-1); } /* file_uniq_org ¤ÏÊѹ¹¤·¤Ê¤¤ */ #ifdef BDIC_WRITE_CHECK if (change_file_uniq1(fp, fh->file_type, fh->file_passwd, &(fh->file_uniq_org), args) == -1) { fclose(fp); delete_tmp_file(tmp); delete_tmp_file(backup); return(-1); } #else /* BDIC_WRITE_CHECK */ change_file_uniq1(fp, fh->file_type, fh->file_passwd, &(fh->file_uniq_org), args); #endif /* BDIC_WRITE_CHECK */ fseek(fp, 0, 0); x = input_file_header(fp, fh, args);/* It must not occur. */ fclose(fp); #ifdef BDIC_WRITE_CHECK if(x == -1) { delete_tmp_file(tmp); delete_tmp_file(backup); return(-1); } move_tmp_to_org(tmp, n, 0); delete_tmp_file(backup); #else /* BDIC_WRITE_CHECK */ if(x == -1) return(-1); #endif /* BDIC_WRITE_CHECK */ return(0); } #ifdef JS static #endif int change_file_uniq1(ofpter, file_type, file_passwd, file_uniq, args) FILE *ofpter; int file_type; char *file_passwd; struct wnn_file_uniq *file_uniq; ARGS *args; { struct stat buf; char hostname[WNN_HOSTLEN]; struct wnn_file_head fh; if(fstat(fileno(ofpter), &buf) == -1){ return(-1); } gethostname(hostname, WNN_HOSTLEN); hostname[WNN_HOSTLEN - 1] = '\0'; fh.file_uniq.time = (int)buf.st_ctime; fh.file_uniq.dev = (int)buf.st_dev; fh.file_uniq.inode = (int)buf.st_ino; bzero(fh.file_uniq.createhost, WNN_HOSTLEN); strcpy(fh.file_uniq.createhost, hostname); /* file_uniq_org */ fh.file_uniq_org.time = file_uniq->time; fh.file_uniq_org.dev = file_uniq->dev; fh.file_uniq_org.inode = file_uniq->inode; bzero(fh.file_uniq_org.createhost, WNN_HOSTLEN); strcpy(fh.file_uniq_org.createhost, file_uniq->createhost); fh.file_type = file_type; if(file_passwd){ strncpy(fh.file_passwd, file_passwd, WNN_PASSWD_LEN); }else{ bzero(fh.file_passwd, WNN_PASSWD_LEN); } if(output_file_header(ofpter, &fh, args) == -1) return(-1); return(0); } #if !defined(JS) && !defined(JSERVER) void vputs(c, fp, args) register char *c; register FILE *fp; ARGS *args; { while(*c){ vputc(*c++, fp, args); } } int vputws(w, fp, args) register w_char *w; register FILE *fp; ARGS *args; { register int n; UCHAR tmp[LENGTHYOMI*3]; n = wnn_sStrcpy(tmp, w); vputs(tmp, fp, args); return(n); } #endif extern char *wnn_get_hinsi_name(); #if !defined(JS) && !defined(JSERVER) int put_yomi_str(yomi, ofpter, args) w_char *yomi; FILE *ofpter; ARGS *args; { register int c; register int i = 0; UCHAR tmp[LENGTHYOMI*3], *p; wnn_sStrcpy(tmp, yomi); for(p = tmp;*p;p++){ c = (int)*p; if(c == '\\'){ vputc('\\', ofpter, args); vputc('\\', ofpter, args); i += 2; }else if(c > 0x20){ vputc(c, ofpter, args); i += 1; }else{ char tmp[8]; sprintf(tmp , "\\0%o" , c); vputs(tmp, ofpter, args); i += strlen(tmp); } } return(i); } #endif #ifndef JS /*:::DOC_START * * Function Name: Get_knj2 * Description : get KOUHO string , YOMI string and comment string from * "kptr" with "kanji2" offset * Parameter : * kptr: (In) wchar pointer of those strings * kanji2: (In) offset of terget entry. ¾åµ­¡¢¥Ý¥¤¥ó¥¿¡¼¤Î * ²¿ÈÖ¤áÀè¤Î¸õÊ䡦ÆÉ¤ß¡¦¥³¥á¥ó¥È¤Î¥¹¥È¥ê¥ó¥°¤òÆÀ¤¿¤¤¤«¤ò»ØÄꤹ¤ë¡£ * 0: jentptr¤½¤Î¤â¤Î¡£ * 1: ¼¡ * . * n: nÈÖÌÜ * kouho: (Out) return of the HOUHO(¸õÊä) string * yomi: (Out) return of the YOMI(ÆÉ¤ß) string * com: (Out) return of the comment string * * Return value : None. * * Author : Masaki Harima * * Revision history: * 31-AUG-94: harima: just wrote this comment. no changes souces * *:::DOC_END */ void Get_knj2(kptr,kanji2, kouho, yomi, comment) UCHAR *kptr; int kanji2; w_char *kouho, *comment, *yomi; { extern void get_kanji_str(); int tcnt; for (tcnt = 0; tcnt < kanji2; tcnt++){ kptr += *kptr; } get_kanji_str(kptr, kouho, yomi, comment); return; } static void copy_kanji_str_from_cd(kptr, kanji) UCHAR *kptr; w_char *kanji; { int n , k; n = *kptr++ - 1; for(k = 0 ; k < n ;) { if(kanji) *kanji++ = ((int) *kptr << 8 | *(kptr + 1)); kptr += 2; k+= 2; } if(kanji)*kanji = 0; } void get_kanji_str(kptr, kanji, yomi, comment) UCHAR *kptr; w_char *kanji, *comment, *yomi; { w_char *tmpy; w_char *tmpk; w_char *tmpc; extern void Get_kanji_str_r(); /* ´Á»ú¡¦ÆÉ¤ß¡¦¥³¥á¥ó¥È¾ðÊó¤ò½é´ü²½ */ if(kanji) kanji[0] = (w_char)0; if(yomi) yomi[0] = (w_char)0; if(comment) comment[0] = (w_char)0; /* CAUTION: jisho syurui is not checked, but ... */ /* not compact dictionary case */ if( (((int) (*kptr)) % 2 ) == 0){ Get_kanji_str_r(kptr, &tmpk, &tmpy, &tmpc); #ifdef CONVERT_from_TOP /* Don't warry. Only use in server and jutil */ if(kanji && tmpk)wnn_Strcpy(kanji, tmpk); if(yomi && tmpy)wnn_Strcpy(yomi, tmpy); #else /* conver from bottom */ if(kanji && tmpk)wnn_Sreverse(kanji, tmpk); if(yomi && tmpy)wnn_Sreverse(yomi, tmpy); #endif /* CONVERT_from_TOP */ if(comment && tmpc)wnn_Strcpy(comment, tmpc); }else{ w_char *c; w_char tmpk_dt[LENGTHKANJI]; c = tmpk = &tmpk_dt[0]; copy_kanji_str_from_cd(kptr, c); #ifdef CONVERT_from_TOP /* Don't warry. Only use in server and jutil */ if(kanji && tmpk)wnn_Strcpy(kanji, tmpk); #else /* conver from bottom */ if(kanji && tmpk)wnn_Sreverse(kanji, tmpk); #endif /* CONVERT_from_TOP */ } } /* ?? need doc. CAUTION: *tmpk is IO */ void Get_kanji_str_r_cd (kptr, tmpk, tmpy, tmpc) UCHAR *kptr; w_char **tmpk, **tmpy, **tmpc; { /* CAUTION: jisho syurui is not checked, but ... */ /* not compact dictionary case */ if( (((int) (*kptr)) % 2 ) == 0){ printf("Get_kanji_str_r_cd: do not call me for non-compact dictionary.\n" ); }else{ /* compact dictionary case */ } copy_kanji_str_from_cd(kptr, *tmpk); } void Get_kanji_str_r(kptr, tmpk, tmpy, tmpc) UCHAR *kptr; w_char **tmpk, **tmpy, **tmpc; { int state = *(kptr + 1); static w_char dmy = 0; /* Must not be allocated on Stack!! */ int adres; /* CAUTION: jisho syurui is not checked, but ... */ /* not compact dictionary case */ if( (((int) (*kptr)) % 2 ) == 0){ }else{ /* compact dictionary case */ printf("Get_kanji_str_r: do not call me for compact dictionary.\n" ); } if(state & FORWARDED){ /* Forward occures when comment-set is used */ adres = (*(w_char *)(kptr + 2)) << 16 | (*(w_char *)(kptr + 4)); Get_kanji_str_r(kptr + adres, tmpk, tmpy, tmpc); return; } /* get_kanji_str_r(kptr, tmpk, tmpy, comment); */ if(state & HAS_YOMI){ *tmpy = ((w_char *)(kptr + 2)); *tmpk = *tmpy + wnn_Strlen(*tmpy) + 1; }else{ *tmpy = &dmy; *tmpk = ((w_char *)(kptr + 2)); } if(state & HAS_COMMENT){ *tmpc = *tmpk + wnn_Strlen(*tmpk) + 1; }else{ *tmpc = &dmy; } } UCHAR kanjiaddr(d0, kanji, yomi, comment) UCHAR *d0; w_char *kanji, *yomi, *comment; { w_char *dest = (w_char *)(d0 + 2); int state = 0; w_char *pt; if(yomi && *yomi){ #ifdef CONVERT_from_TOP /* Don't warry. Only use in server and jutil */ pt = yomi; for(;*pt;){ *dest++ = *pt++; } #else /* conver from bottom */ pt = yomi + wnn_Strlen(yomi) - 1; for(;pt >= yomi;){ *dest++ = *pt--; } #endif /* CONVERT_from_TOP */ state |= HAS_YOMI; *dest++ = 0; } #ifdef CONVERT_from_TOP /* Don't warry. Only use in server and jutil */ pt = kanji; for(;*pt;){ *dest++ = *pt++; } #else /* conver from bottom */ pt = kanji + wnn_Strlen(kanji) - 1; for(;pt >= kanji;){ *dest++ = *pt--; } #endif /* CONVERT_from_TOP */ *dest++ = 0; if(comment && *comment){ pt = comment; for(;*pt;){ *dest++ = *pt++; } state |= HAS_COMMENT; *dest++ = 0; } *d0 = (UCHAR)((UCHAR *)dest - d0); *(d0 + 1) = state; return(*d0); } #endif /*:::DOC_START * * Function Name: create_null_dic * Description : ¼­½ñ¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë * Parameter : * fn : (In) ºîÀ®¼­½ñ¥Õ¥¡¥¤¥ë̾ * comm : (In) ºîÀ®¼­½ñ¥Õ¥¡¥¤¥ë¥³¥á¥ó¥È * passwd (In) ºîÀ®¼­½ñ¥Õ¥¡¥¤¥ë¥Ñ¥¹¥ï¡¼¥É * hpasswd : (In) ºîÀ®¼­½ñÆâÉÑÅ٥ѥ¹¥ï¡¼¥É * which : (In) ºîÀ®¼­½ñ¥Õ¥¡¥¤¥ë¥¿¥¤¥× * args : (InOut) ¥¹¥ì¥Ã¥É´ÉÍýÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ #ifdef JS static #endif int create_null_dic(fn, comm, passwd, hpasswd, which, args) char *fn; w_char *comm; char *passwd, *hpasswd; /* not encoded passwd */ int which; ARGS *args; { FILE *fp; struct JT jt; char epasswd[WNN_PASSWD_LEN]; extern void new_pwd(); /* ¥Þ¡¼¥¸¼­½ñ¤Ë¤Ï¥·¥¹¥Æ¥à¼­½ñ¥Þ¥¹¥¯¤òΩ¤Æ¤ë */ if(which == WNN_MERGE_DICT) which |= WNN_SYSTEM_DICT; jt.total = 0; jt.gosuu = 0; if(hpasswd){ new_pwd(hpasswd, jt.hpasswd); }else{ bzero(jt.hpasswd, WNN_PASSWD_LEN); } jt.syurui = which; jt.maxserial = 0; jt.maxtable = 0; jt.maxhontai = (which == WNN_UD_DICT)? 4: 0; jt.maxkanji = 0; if(comm){ jt.maxcomment = wnn_Strlen(comm); }else{ jt.maxcomment = 0; } jt.maxhinsi_list = 0; jt.maxri1[D_YOMI] = 0; jt.maxri1[D_KANJI] = 0; jt.maxri2 = 0; if((fp = fopen(fn, "w+")) == NULL){ /* error1( "Jserver:create_null_ud:No file %s.\n", fn); */ return(-1); } if(passwd){ new_pwd(passwd, epasswd); }else{ bzero(epasswd, WNN_PASSWD_LEN); } if(create_file_header(fp, WNN_FT_DICT_FILE,epasswd, args) == -1 || output_header_jt(fp, &jt, args) == -1){ fclose(fp);return(-1); } #ifdef BDIC_WRITE_CHECK if (put_n_EU_str(fp, comm, jt.maxcomment, args) == -1) { fclose(fp); return(-1); } #else /* BDIC_WRITE_CHECK */ put_n_EU_str(fp, comm, jt.maxcomment, args); #endif /* BDIC_WRITE_CHECK */ if(which == WNN_UD_DICT){ #ifdef BDIC_WRITE_CHECK if (putint(fp, 0, args) == -1) { /* hontai[0] */ fclose(fp); return(-1); } #else /* BDIC_WRITE_CHECK */ putint(fp, 0, args); /* hontai[0] */ #endif /* BDIC_WRITE_CHECK */ } #ifdef BSD42 fchmod(fileno(fp), 0664); fclose(fp); #else /* SYSV */ fclose(fp); chmod(fn, 0664); #endif /* BSD42 */ return(0); } /* End of create_null_dic */ #ifdef JS static #endif int create_hindo_file(funiq, fn, comm, passwd, serial, hindo_in, args) struct wnn_file_uniq *funiq; char *fn; w_char *comm; char *passwd; /* Not encoded */ int serial; int *hindo_in; ARGS *args; { FILE *fp; struct HJT hjt; char epasswd[WNN_PASSWD_LEN]; w_char tmp[1]; int i; tmp[0] = 0; if(comm == NULL) comm = tmp; bcopy(funiq, &(hjt.dic_file_uniq), WNN_F_UNIQ_LEN); hjt.maxcomment = wnn_Strlen(comm); hjt.maxserial = serial; hjt.hindo_area = (int)((serial + MAX_HINDO_DATA_AREA - 1) / MAX_HINDO_DATA_AREA); if(hjt.hindo_area != 0) { if((hjt.curserial = (unsigned char *) malloc(hjt.hindo_area * sizeof(unsigned char))) == NULL) return(-1); for(i = 0; i < hjt.hindo_area; i++) (hjt.curserial)[i] = 0; } else hjt.curserial = NULL; if((fp = fopen(fn, "w+")) == NULL){ return(-1); } if(passwd){ new_pwd(passwd, epasswd); }else{ bzero(epasswd, WNN_PASSWD_LEN); } if(create_file_header(fp, WNN_FT_HINDO_FILE, epasswd, args) == -1){fclose(fp);return(-1);} #ifdef BDIC_WRITE_CHECK if ((output_header_hjt(fp, &hjt, args) == -1) || (put_n_EU_str(fp, comm, hjt.maxcomment, args) == -1) || (put_n_int(fp, hindo_in, 0, args) == -1)) { fclose(fp); return(-1); } #else /* BDIC_WRITE_CHECK */ output_header_hjt(fp, &hjt, args); put_n_EU_str(fp, comm, hjt.maxcomment, args); put_n_int(fp, hindo_in, 0, args); #endif /* BDIC_WRITE_CHECK */ #ifdef BSD42 fchmod(fileno(fp), 0664); fclose(fp); #else /* SYSV */ fclose(fp); chmod(fn, 0664); #endif /* BSD42 */ return(0); } /* Header Total 128 Bytes */ #ifndef JS int input_header_jt(ifpter, jt1, args) FILE *ifpter; struct JT *jt1; ARGS *args; { if( getint(&jt1->syurui , ifpter, args) == -1 || getint(&jt1->maxcomment, ifpter, args) == -1 || getint(&jt1->maxhinsi_list, ifpter, args) == -1 || getint(&jt1->maxserial , ifpter, args) == -1 || getint(&jt1->maxkanji , ifpter, args) == -1 || getint(&jt1->maxtable , ifpter, args) == -1 || getint(&jt1->maxhontai , ifpter, args) == -1 || getint(&jt1->gosuu , ifpter, args) == -1 || getnstr(ifpter, WNN_PASSWD_LEN, jt1->hpasswd, args) == -1 || getint(&jt1->total , ifpter, args) == -1 || getint(&jt1->maxri1[D_YOMI] , ifpter, args) == -1 || getint(&jt1->maxri1[D_KANJI] , ifpter, args) == -1 || getint(&jt1->maxri2, ifpter, args) == -1 || getnull(ifpter, 56, args) == -1) return(-1); return(0); } #endif #ifdef JS static #endif int output_header_jt(ofpter, jt1, args) FILE *ofpter; struct JT *jt1; ARGS *args; { #ifdef BDIC_WRITE_CHECK if ((putint(ofpter, jt1->syurui, args) == -1) || (putint(ofpter, jt1->maxcomment, args) == -1) || (putint(ofpter, jt1->maxhinsi_list, args) == -1) || (putint(ofpter, jt1->maxserial, args) == -1) || (putint(ofpter, jt1->maxkanji, args) == -1) || (putint(ofpter, jt1->maxtable, args) == -1) || (putint(ofpter, jt1->maxhontai, args) == -1) || (putint(ofpter, jt1->gosuu, args) == -1) || (put_n_str(ofpter, jt1->hpasswd, WNN_PASSWD_LEN, args) == -1) || (putint(ofpter, jt1->total, args) == -1) || (putint(ofpter, jt1->maxri1[D_YOMI], args) == -1) || (putint(ofpter, jt1->maxri1[D_KANJI], args) == -1) || (putint(ofpter, jt1->maxri2, args) == -1) || (putnull(ofpter, 56, args) == -1)) return(-1); #else /* BDIC_WRITE_CHECK */ putint(ofpter, jt1->syurui, args); putint(ofpter, jt1->maxcomment, args); putint(ofpter, jt1->maxhinsi_list, args); putint(ofpter, jt1->maxserial, args); putint(ofpter, jt1->maxkanji, args); putint(ofpter, jt1->maxtable, args); putint(ofpter, jt1->maxhontai, args); putint(ofpter, jt1->gosuu, args); put_n_str(ofpter, jt1->hpasswd, WNN_PASSWD_LEN, args); putint(ofpter, jt1->total, args); putint(ofpter, jt1->maxri1[D_YOMI], args); putint(ofpter, jt1->maxri1[D_KANJI], args); putint(ofpter, jt1->maxri2, args); putnull(ofpter, 56, args); #endif /* BDIC_WRITE_CHECK */ return(0); } /* Header 64 Byte */ #ifndef JS int input_header_hjt(ifpter, hjt1, args) FILE *ifpter; struct HJT *hjt1; ARGS *args; { int i; if( input_file_uniq(&hjt1->dic_file_uniq, ifpter, args) == -1 || /* 7 * 4 */ getint(&hjt1->maxcomment, ifpter, args) == -1 || getint(&hjt1->maxserial, ifpter, args) == -1) return(-1); if(getint(&hjt1->hindo_area, ifpter, args) == -1) return(-1); if(hjt1->hindo_area != 0) { if((hjt1->curserial = (unsigned char *) malloc(hjt1->hindo_area * sizeof(unsigned char))) == NULL) return(-1); for(i = 0; i < hjt1->hindo_area; i++) (hjt1->curserial)[i] = vgetc(ifpter, args); } else hjt1->curserial = NULL; return(0); } #endif #ifdef JS static #endif int output_header_hjt(ofpter, hjt1, args) FILE *ofpter; struct HJT *hjt1; ARGS *args; { int i; #ifdef BDIC_WRITE_CHECK if ((output_file_uniq(&hjt1->dic_file_uniq, ofpter, args) == -1) || (putint(ofpter, hjt1->maxcomment, args) == -1) || (putint(ofpter, hjt1->maxserial, args) == -1) || (putint(ofpter, hjt1->hindo_area, args) == -1)) return(-1); for(i = 0; i < hjt1->hindo_area; i++) { if(vputc((hjt1->curserial)[i], ofpter, args) == -1) return(-1); } #else /* BDIC_WRITE_CHECK */ output_file_uniq(&hjt1->dic_file_uniq, ofpter, args); putint(ofpter, hjt1->maxcomment, args); putint(ofpter, hjt1->maxserial, args); putint(ofpter, hjt1->hindo_area, args); for(i = 0; i < hjt1->hindo_area; i++) vputc((hjt1->curserial)[i], ofpter, args); #endif /* BDIC_WRITE_CHECK */ return(0); } #if !defined(JS) && !defined(JSERVER) /* Only use JUTIL */ void Print_entry(yomi, kstr, cstr, hindo, ima, hinsi, serial, ofpter, esc_exp, args) w_char *yomi, *kstr,*cstr; int serial, hindo, ima, hinsi; FILE *ofpter; int esc_exp; ARGS *args; { register int len; char *k; char buf[32]; static w_char revy[LENGTHKANJI]; extern void kanji_esc_str(); if ((yomi == 0) || (kstr == 0)) return; if(serial != -1){ sprintf(buf, "%d\t", serial); vputs(buf, ofpter, args); } len = put_yomi_str(yomi, ofpter, args); if(len < 8)vputc('\t' , ofpter, args); if(len < 16)vputc('\t' , ofpter, args); vputc('\t' , ofpter, args); if(esc_exp){ #ifdef CONVERT_from_TOP /* Don't warry. Only use in jutil */ wnn_Strcpy(revy, yomi); #else /* conver from bottom */ wnn_Sreverse(revy, yomi); #endif /* CONVERT_from_TOP */ kanji_esc_str(kstr, revy, wnn_Strlen(yomi), args); len = put_yomi_str(kstr, ofpter, args); }else{ len = vputws(kstr, ofpter, args); } if(len < 8)vputc('\t' , ofpter, args); if(len < 16)vputc('\t' , ofpter, args); vputc('\t' , ofpter, args); k = wnn_get_hinsi_name(hinsi, args); if(k){ vputs(k, ofpter, args); if((int)strlen(k) < 8)vputc('\t' , ofpter, args); vputc('\t' , ofpter, args); }else{ sprintf(buf, "%d\t\t", hinsi); vputs(buf, ofpter, args); } if(ima) vputc('*', ofpter, args); if(hindo == -1){ /* Real hindo == -1 means Not to use it */ vputs("-", ofpter, args); }else{ sprintf(buf, "%d", hindo); vputs(buf, ofpter, args); } if(cstr && cstr[0]){ vputc('\t', ofpter, args); len = vputws(cstr, ofpter, args); } vputc('\n', ofpter, args); } #endif #ifdef BDIC_WRITE_CHECK #undef BDIC_WRITE_CHECK #endif wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/etc/fi_bdic.c0000644000000000000000000004117607153676736017562 0ustar rootroot/* * $Id: fi_bdic.c,v 2.7.2.1 2000/08/04 05:37:05 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* * New FI-Wnn function call for both of server and library * Binary FI dictionary common routine */ #ifdef UX386 #include #else #include #endif #ifndef JS #include #include #include "commonhd.h" #include "jslib.h" #include "jh.h" #endif #include "jdata.h" #include "wnn_os.h" #include "wnn_string.h" #include "mt_jserver.h" #include "fi_jdata.h" #ifdef JS static #else extern #endif /* JS */ int output_header_fi_jt(), output_header_fi_hjt(); #ifndef JS extern int getint(), getnstr(), input_file_uniq(), create_file_header(); extern void new_pwd(); extern # ifdef BDIC_WRITE_CHECK int # else void #endif /* BDIC_WRITE_CHECK */ putint(), put_n_str(), output_file_uniq(), put_n_EU_str(), putnull(); #endif /* Not JS */ #ifndef JS /*:::DOC_START * * Function Name: input_header_fi_jt * Description : £Æ£É´Ø·¸¼­½ñ¤Î¥Ø¥Ã¥ÀÉô¤òÆÉ¤ß¹þ¤à * Parameter : * ifpter : (In) ¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿ * jt1 : (Out) £Æ£É´Ø·¸¼­½ñ¤Ø¤Î¥Ý¥¤¥ó¥¿ * args : (InOut) ¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int input_header_fi_jt(ifpter, jt1, args) FILE *ifpter; struct FI_JT *jt1; ARGS *args; { int i; if( getint(&jt1->syurui , ifpter, args) == -1 || getint(&jt1->maxcomment, ifpter, args) == -1 || getnstr(ifpter, WNN_PASSWD_LEN, jt1->hpasswd, args) == -1 || getnstr(ifpter, 1, &jt1->maxjisho, args) == -1) return(-1); /* ÀܳÄêµÁ£×£î£î¼­½ñ f_uniq ÇÛÎó¤ÎÆÉ¤ß¹þ¤ß */ if(jt1->maxjisho) { if((jt1->jisho_uniq = (struct wnn_file_uniq *) malloc(jt1->maxjisho * sizeof(struct wnn_file_uniq))) == NULL) return(-1); for(i = 0; i < jt1->maxjisho; i++) { if(input_file_uniq(&((jt1->jisho_uniq)[i]), ifpter, args) == -1) return(-1); } } return(0); } /* End of input_header_fi_jt */ /*:::DOC_START * * Function Name: input_header_fi_hjt * Description : £Æ£É´Ø·¸ÉÑÅ٤ΥإåÀÉô¤òÆÉ¤ß¹þ¤à * Parameter : * ifpter : (In) ¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿ * jt1 : (Out) £Æ£É´Ø·¸ÉÑÅ٤ؤΥݥ¤¥ó¥¿ * args : (InOut) ¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int input_header_fi_hjt(ifpter, hjt1, args) FILE *ifpter; struct FI_HJT *hjt1; ARGS *args; { if( input_file_uniq(&hjt1->fi_dic_uniq, ifpter, args) == -1 || getint(&hjt1->maxcomment, ifpter, args) == -1 || getnstr(ifpter, 1, &hjt1->maxjisho, args) == -1) return(-1); return(0); } /* End of input_header_fi_hjt */ #endif /* Not JS */ /*:::DOC_START * * Function Name: output_header_fi_jt * Description : £Æ£É´Ø·¸¼­½ñ¤Î¥Ø¥Ã¥ÀÉô¤ò½ñ¤­¹þ¤à * Parameter : * ofpter : (Out) ¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿ * jt1 : (In) £Æ£É´Ø·¸¼­½ñ¤Ø¤Î¥Ý¥¤¥ó¥¿ * args : (InOut) ¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ #ifdef JS static #endif int output_header_fi_jt(ofpter, jt1, args) FILE *ofpter; struct FI_JT *jt1; ARGS *args; { int i; #ifdef BDIC_WRITE_CHECK if ((putint(ofpter, jt1->syurui, args) == -1) || (putint(ofpter, jt1->maxcomment, args) == -1) || (put_n_str(ofpter, jt1->hpasswd, WNN_PASSWD_LEN, args) == -1) || (put_n_str(ofpter, &jt1->maxjisho, 1, args) == -1)) return(-1); /* ÀܳÄêµÁ£×£î£î¼­½ñ f_uniq ÇÛÎó¤Î½ñ¤­¹þ¤ß */ for(i = 0; i < jt1->maxjisho; i++) { if(output_file_uniq(&((jt1->jisho_uniq)[i]), ofpter, args) == -1) return(-1); } #else /* BDIC_WRITE_CHECK */ putint(ofpter, jt1->syurui, args); putint(ofpter, jt1->maxcomment, args); put_n_str(ofpter, jt1->hpasswd, WNN_PASSWD_LEN, args); put_n_str(ofpter, &jt1->maxjisho, 1, args); /* ÀܳÄêµÁ£×£î£î¼­½ñ f_uniq ÇÛÎó¤Î½ñ¤­¹þ¤ß */ for(i = 0; i < jt1->maxjisho; i++) output_file_uniq(&((jt1->jisho_uniq)[i]), ofpter, args); #endif /* BDIC_WRITE_CHECK */ return(0); } /* End of output_header_fi_jt */ /*:::DOC_START * * Function Name: output_header_fi_hjt * Description : £Æ£É´Ø·¸ÉÑÅ٤ΥإåÀÉô¤ò½ñ¤­¹þ¤à * Parameter : * ofpter : (Out) ¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿ * hjt1 : (In) £Æ£É´Ø·¸ÉÑÅ٤ؤΥݥ¤¥ó¥¿ * args : (InOut) ¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ #ifdef JS static #endif int output_header_fi_hjt(ofpter, hjt1, args) FILE *ofpter; struct FI_HJT *hjt1; ARGS *args; { #ifdef BDIC_WRITE_CHECK if ((output_file_uniq(&hjt1->fi_dic_uniq, ofpter, args) == -1) || (putint(ofpter, hjt1->maxcomment, args) == -1) || (put_n_str(ofpter, &hjt1->maxjisho, 1, args) == -1)) return(-1); #else /* BDIC_WRITE_CHECK */ output_file_uniq(&hjt1->fi_dic_uniq, ofpter, args); putint(ofpter, hjt1->maxcomment, args); put_n_str(ofpter, &hjt1->maxjisho, 1, args); #endif /* BDIC_WRITE_CHECK */ return(0); } /* End of output_header_fi_hjt */ /*:::DOC_START * * Function Name: create_fi_index_table * Description : £Æ£É¥¤¥ó¥Ç¥Ã¥¯¥¹¥Æ¡¼¥Ö¥ë¤òºîÀ®¤¹¤ë * Parameter : * fp : (Out) ¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿ * njisho : (In) Âбþ£Æ£É´Ø·¸¼­½ñ¤ÎÀܳÄêµÁ£×£î£î¼­½ñ¿ô * primary : (In) ÀܳÄêµÁ£×£î£î¼­½ñ¤Î primary index table ¿ô¤Î * ÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * args : (InOut) ¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int create_fi_index_table(fp, njisho, primary, args) FILE *fp; unsigned char njisho; int *primary; ARGS *args; { int i; for(i = 0; i < njisho; i++) { #ifdef BDIC_WRITE_CHECK if((putint(fp, primary[i], args) == -1) || (putnull(fp, primary[i], args) == -1) || (putint(fp, 0, args) == -1)) return(-1); #else /* BDIC_WRITE_CHECK */ putint(fp, primary[i], args); putnull(fp, primary[i], args); putint(fp, 0, args); #endif /* BDIC_WRITE_CHECK */ } return(0); } /* End of create_fi_index_table */ /*:::DOC_START * * Function Name: create_fi_hindo_file * Description : £Æ£É´Ø·¸ÉÑÅÙ¤òºîÀ®¤¹¤ë¥µ¥Ö¥ë¡¼¥Á¥ó´Ø¿ô * Parameter : * funiq : (In) Âбþ£Æ£É´Ø·¸¼­½ñ¤Î file uniq orig * fn : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë̾ * comm : (In) £Æ£É´Ø·¸ÉÑÅÙ¥³¥á¥ó¥È * passwd : (In) £Æ£É´Ø·¸ÉÑÅ٥ѥ¹¥ï¡¼¥É * njisho : (In) Âбþ£Æ£É´Ø·¸¼­½ñ¤ÎÀܳÄêµÁ£×£î£î¼­½ñ¿ô * primary : (In) ÀܳÄêµÁ£×£î£î¼­½ñ primary index table ¿ô¤Î * ÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * args : (InOut) ¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ #ifdef JS static #endif int create_fi_hindo_file(funiq, fn, comm, passwd, njisho, primary, args) struct wnn_file_uniq *funiq; char *fn; w_char *comm; char *passwd; /* Not encoded */ unsigned char njisho; int *primary; ARGS *args; { FILE *fp; struct FI_HJT hjt; char epasswd[WNN_PASSWD_LEN]; w_char tmp[1]; tmp[0] = 0; if(comm == NULL) comm = tmp; bcopy(funiq, &(hjt.fi_dic_uniq), WNN_F_UNIQ_LEN); hjt.maxcomment = wnn_Strlen(comm); hjt.maxjisho = njisho; if((fp = fopen(fn, "w+")) == NULL){ return(-1); } if(passwd){ new_pwd(passwd, epasswd); }else{ bzero(epasswd, WNN_PASSWD_LEN); } if(create_file_header(fp, WNN_FT_FI_HINDO_FILE, epasswd, args) == -1) { fclose(fp); return(-1); } #ifdef BDIC_WRITE_CHECK if ((output_header_fi_hjt(fp, &hjt, args) == -1) || (put_n_EU_str(fp, comm, hjt.maxcomment, args) == -1) || (create_fi_index_table(fp, njisho, primary, args) == -1)) { fclose(fp); return(-1); } #else /* BDIC_WRITE_CHECK */ output_header_fi_hjt(fp, &hjt, args); put_n_EU_str(fp, comm, hjt.maxcomment, args); create_fi_index_table(fp, njisho, primary, args); #endif /* BDIC_WRITE_CHECK */ #ifdef BSD42 fchmod(fileno(fp), 0664); fclose(fp); #else /* SYSV */ fclose(fp); chmod(fn, 0664); #endif /* BSD42 */ return(0); } /*:::DOC_START * * Function Name: create_null_fi_dic * Description : £Æ£É´Ø·¸¼­½ñ¤òºîÀ®¤¹¤ë¥µ¥Ö¥ë¡¼¥Á¥ó´Ø¿ô * Parameter : * fn : (In) £Æ£É´Ø·¸¼­½ñ¥Õ¥¡¥¤¥ë̾ * comm : (In) £Æ£É´Ø·¸¼­½ñ¥³¥á¥ó¥È * passwd : (In) £Æ£É´Ø·¸¼­½ñ¥Ñ¥¹¥ï¡¼¥É * hpasswd : (In) £Æ£É´Ø·¸ÉÑÅ٥ѥ¹¥ï¡¼¥É * which : (In) £Æ£É´Ø·¸¼­½ñ¥¿¥¤¥×(WNN_FI_USER_DICT) * njisho : (In) ÀܳÄêµÁ£×£î£î¼­½ñ¿ô * duniq : (In) ÀܳÄêµÁ£×£î£î¼­½ñ file uniq orig ¤ÎÇÛÎó¤Ø¤Î * ¥Ý¥¤¥ó¥¿ * primary : (In) ÀܳÄêµÁ£×£î£î¼­½ñ primary index table ¿ô¤Î * ÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * args : (InOut) ¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Author : Hideyuki Kishiba */ #ifdef JS static #endif int create_null_fi_dic(fn, comm, passwd, hpasswd, which, njisho, duniq, primary, args) char *fn; w_char *comm; char *passwd, *hpasswd; /* not encoded passwd */ int which; unsigned char njisho; struct wnn_file_uniq *duniq; int *primary; ARGS *args; { FILE *fp; struct FI_JT jt; char epasswd[WNN_PASSWD_LEN]; extern void new_pwd(); if(hpasswd){ new_pwd(hpasswd, jt.hpasswd); }else{ bzero(jt.hpasswd, WNN_PASSWD_LEN); } jt.syurui = which; if(comm) jt.maxcomment = wnn_Strlen(comm); else jt.maxcomment = 0; jt.maxjisho = njisho; jt.jisho_uniq = duniq; if((fp = fopen(fn, "w+")) == NULL){ return(-1); } if(passwd){ new_pwd(passwd, epasswd); }else{ bzero(epasswd, WNN_PASSWD_LEN); } if(create_file_header(fp, WNN_FT_FI_DICT_FILE, epasswd, args) == -1) { fclose(fp); return(-1); } #ifdef BDIC_WRITE_CHECK if ((output_header_fi_jt(fp, &jt, args) == -1) || (put_n_EU_str(fp, comm, jt.maxcomment, args) == -1) || (create_fi_index_table(fp, njisho, primary, args) == -1)) { fclose(fp); return(-1); } #else /* BDIC_WRITE_CHECK */ output_header_fi_jt(fp, &jt, args); put_n_EU_str(fp, comm, jt.maxcomment, args); create_fi_index_table(fp, njisho, primary, args); #endif /* BDIC_WRITE_CHECK */ #ifdef BSD42 fchmod(fileno(fp), 0664); fclose(fp); #else /* SYSV */ fclose(fp); chmod(fn, 0664); #endif /* BSD42 */ return(0); } /* End of create_null_fi_dic */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/etc/py_table.c0000644000000000000000000002551307153676736017777 0ustar rootroot/* * $Id: py_table.c,v 2.1.2.1 2000/08/04 05:37:06 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /** cWnn Version 1.1 **/ #include #include "commonhd.h" #ifdef CHINESE #include "cplib.h" /* pyshengmu_tbl[]: ShengMu table of Chinese PinYin */ char *py_shengmu_tbl[PY_NUM_SHENGMU] = { "", "B", "C", "Ch", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "Sh", "T", "W", "X", "Y", "Z", "Zh" }; /* py_yunmu_tbl[]: YunMu table of Chinese ZhuYin */ char *py_yunmu_tbl[PY_NUM_YUNMU*5] = { "ŽÀ", "ŽÀ", "ŽÀ", "ŽÀ", "ŽÀ", "aŽÀ", "Ž¡ŽÀ", "Ž¢ŽÀ", "Ž£ŽÀ", "ޤŽÀ", "aiŽÀ", "Ž¡iŽÀ", "Ž¢iŽÀ", "Ž£iŽÀ", "ޤiŽÀ", "anŽÀ", "Ž¡nŽÀ", "Ž¢nŽÀ", "Ž£nŽÀ", "ޤnŽÀ", "angŽÀ", "Ž¡ngŽÀ", "Ž¢ngŽÀ", "Ž£ngŽÀ", "ޤngŽÀ", "aoŽÀ", "Ž¡oŽÀ", "Ž¢oŽÀ", "Ž£oŽÀ", "ޤoŽÀ", "eŽÀ", "Ž¥ŽÀ", "ަŽÀ", "ާŽÀ", "ލŽÀ", "eiŽÀ", "Ž¥iŽÀ", "ަiŽÀ", "ާiŽÀ", "ލiŽÀ", "enŽÀ", "Ž¥nŽÀ", "ަnŽÀ", "ާnŽÀ", "ލnŽÀ", "engŽÀ", "Ž¥ngŽÀ", "ަngŽÀ", "ާngŽÀ", "ލngŽÀ", "erŽÀ", "Ž¥rŽÀ", "ަrŽÀ", "ާrŽÀ", "ލrŽÀ", "iŽÀ", "Ž©ŽÀ", "ŽªŽÀ", "Ž«ŽÀ", "ެŽÀ", "iaŽÀ", "iŽ¡ŽÀ", "iŽ¢ŽÀ", "iŽ£ŽÀ", "iޤŽÀ", "ianŽÀ", "iŽ¡nŽÀ", "iŽ¢nŽÀ", "iŽ£nŽÀ", "iޤnŽÀ", "iangŽÀ", "iŽ¡ngŽÀ", "iŽ¢ngŽÀ", "iŽ£ngŽÀ", "iޤngŽÀ", "iaoŽÀ", "iŽ¡oŽÀ", "iŽ¢oŽÀ", "iŽ£oŽÀ", "iޤoŽÀ", "ieŽÀ", "iŽ¥ŽÀ", "iަŽÀ", "iާŽÀ", "iލŽÀ", "inŽÀ", "Ž©nŽÀ", "ŽªnŽÀ", "Ž«nŽÀ", "ެnŽÀ", "ingŽÀ", "Ž©ngŽÀ", "ŽªngŽÀ", "Ž«ngŽÀ", "ެngŽÀ", "iongŽÀ", "iŽ­ngŽÀ", "iŽ®ngŽÀ", "iޝngŽÀ", "iްngŽÀ", "iuŽÀ", "iޱŽÀ", "i޲ŽÀ", "i޳ŽÀ", "iŽ´ŽÀ", "mŽÀ", "mŽÀ", "mŽÀ", "mŽÀ", "mŽÀ", "nŽÀ", "nŽÀ", "޽ŽÀ", "޾ŽÀ", "Ž¿ŽÀ", "ngŽÀ", "ngŽÀ", "ngŽÀ", "ngŽÀ", "ngŽÀ", "oŽÀ", "Ž­ŽÀ", "Ž®ŽÀ", "ޝŽÀ", "ްŽÀ", "ongŽÀ", "Ž­ngŽÀ", "Ž®ngŽÀ", "ޝngŽÀ", "ްngŽÀ", "ouŽÀ", "Ž­uŽÀ", "Ž®uŽÀ", "ޝuŽÀ", "ްuŽÀ", "uŽÀ", "ޱŽÀ", "޲ŽÀ", "޳ŽÀ", "Ž´ŽÀ", "uaŽÀ", "uŽ¡ŽÀ", "uŽ¢ŽÀ", "uŽ£ŽÀ", "uޤŽÀ", "uaiŽÀ", "uŽ¡iŽÀ", "uŽ¢iŽÀ", "uŽ£iŽÀ", "uޤiŽÀ", "uanŽÀ", "uŽ¡nŽÀ", "uŽ¢nŽÀ", "uŽ£nŽÀ", "uޤnŽÀ", "uangŽÀ", "uŽ¡ngŽÀ", "uŽ¢ngŽÀ", "uŽ£ngŽÀ", "uޤngŽÀ", "ueŽÀ", "uŽ¥ŽÀ", "uަŽÀ", "uާŽÀ", "uލŽÀ", "uiŽÀ", "uŽ©ŽÀ", "uŽªŽÀ", "uŽ«ŽÀ", "uެŽÀ", "unŽÀ", "ޱnŽÀ", "޲nŽÀ", "޳nŽÀ", "Ž´nŽÀ", "uoŽÀ", "uŽ­ŽÀ", "uŽ®ŽÀ", "uޝŽÀ", "uްŽÀ", "޹ŽÀ", "޵ŽÀ", "޶ŽÀ", "Ž·ŽÀ", "ޏŽÀ", "޹eŽÀ", "޹ޥŽÀ", "޹ަŽÀ", "޹ާŽÀ", "޹ލŽÀ", "0ŽÀ", "1ŽÀ", "2ŽÀ", "3ŽÀ", "4ŽÀ", /* for undefinited YunMu */ }; /* pinyin_tbl: size is NUM_SHENGMU*NUM_YUNMU, including empty ShengMu */ /* and empty YunMu , and undefinited YunMu'-' */ int pinyin_tbl[PY_NUM_SHENGMU*PY_NUM_YUNMU] = { 0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1, 0,1,1,1,1,1,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1, 0,1,1,1,1,1,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,1,1,0,0,1, 0,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,0,1,0,1,0,0,0,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1, 0,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,1, 0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,1,1,0,0,1, 0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,0,0,1, 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,0,0,1,0,1,0,1,0,0,0,1, 0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,1,1,0,0,1, 0,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,0,1,0,0,0,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1, 0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,1,1,1,0,1,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,1, 0,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,0,1,0,0,0,0,1,1,1,0,0,1,0,0,0,0,1,1,1,1, 0,1,1,1,1,1,0,1,1,1,0,1,0,1,0,1,1,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,1, 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,0,0,1,0,1,0,1,0,0,0,1, 0,0,0,1,1,1,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,0,0,1,1,1,0,0,1, 0,1,1,1,1,1,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1, 0,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1, 0,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,0,1,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1, 0,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1, 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,0,0,1,0,1,0,1,0,0,0,1, 0,1,0,1,1,1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,0,1,1,1,1,0,0,1,0,1,0,1,0,0,0,1, 0,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1,1,1,0,0,1, 0,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,1,1,0,0,1 }; #endif /* CHINESE */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/jlib/0002755000000000000000000000000007153676737016176 5ustar rootrootwnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/jlib/Imakefile0000644000000000000000000000464407153676737020015 0ustar rootrootXCOMM XCOMM $Id: Imakefile,v 2.13 1999/02/24 02:50:19 kaneda Exp $ XCOMM #ifdef NEED_DEFINE_LIB #define DoNormalLib YES #define DoSharedLib NO #define DoDebugLib NO #define DoProfileLib NO #endif #include #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' #if BuildMTJlib MTDEFINES = -D_POSIX4A_DRAFT6_SOURCE -DMULTI_THREAD -DPTHREADS #endif JLIBDEFINES = -DWRITE_CHECK $(MTDEFINES) INCLUDES = -I$(WNNINCLUDESRC) -I$(TOP) DEFINES = $(WNNDEFINES) $(ALLLANGDEF) $(JLIBDEFINES) INSTALLFLAGS = $(INSTBINFLAGS) LINTLIBS = SRC1= js.c \ wnnerrmsg.c \ jl.c OBJ1= js.o \ wnnerrmsg.o \ jl.o SRC3= $(WNNETCSRC)/msg.c OBJ3= msg.o SRC4= $(WNNETCSRC)/yincoding.c OBJ4= yincoding.o SRC5= $(WNNETCSRC)/py_table.c OBJ5= py_table.o SRC6= $(WNNETCSRC)/zy_table.c OBJ6= zy_table.o SRC7= $(WNNETCSRC)/strings.c OBJ7= strings.o SRC8= $(WNNETCSRC)/serverdefs.c OBJ8= serverdefs.o LOCAL_RKSRCS= $(WNNROMKANSRC)/rk_bltinfn.c \ $(WNNROMKANSRC)/rk_main.c \ $(WNNROMKANSRC)/rk_modread.c \ $(WNNROMKANSRC)/rk_read.c \ $(WNNROMKANSRC)/rk_vars.c \ $(WNNROMKANSRC)/rk_multi.c LOCAL_RKOBJS= $(WNNROMKANSRC)/rk_bltinfn.o \ $(WNNROMKANSRC)/rk_main.o \ $(WNNROMKANSRC)/rk_modread.o \ $(WNNROMKANSRC)/rk_read.o \ $(WNNROMKANSRC)/rk_vars.o \ $(WNNROMKANSRC)/rk_multi.o LOCAL_ETCSRCS = $(SRC3) $(SRC4) $(SRC5) $(SRC6) $(SRC7) $(SRC8) LOCAL_ETCOBJS = $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(OBJ7) $(OBJ8) SRCS= $(SRC1) $(LOCAL_ETCSRCS) OBJS= $(OBJ1) $(LOCAL_ETCOBJS) $(LOCAL_RKOBJS) LibraryObjectRule() AllTarget($(OBJS) libwnn6_fromsrc.a) js.o : js.c \ $(WNNETCSRC)/bdic.c \ $(WNNETCSRC)/pwd.c \ $(WNNETCSRC)/gethinsi.c SingleProgramTarget(kankana,kankana.o,$(WNNJLIB),) NormalLibraryTarget(wnn6_fromsrc,$(OBJS)) LintLibraryTarget(wnn6_fromsrc,$(SRCS)) instlib:: install InstallLibrary(wnn6_fromsrc,$(WNNLIBDIR)) #if ProfileLibJlib ProfiledLibraryTarget(wnn,$(OBJS)) InstallLibrary(wnn_p,$(WNNLIBDIR)) #endif WnnSpecialObjectRule($(OBJ3),$(SRC3),$(WNNETCSRC),) WnnSpecialObjectRule($(OBJ4),$(SRC4),$(WNNETCSRC),) WnnSpecialObjectRule($(OBJ5),$(SRC5),$(WNNETCSRC),) WnnSpecialObjectRule($(OBJ6),$(SRC6),$(WNNETCSRC),) WnnSpecialObjectRule($(OBJ7),$(SRC7),$(WNNETCSRC),) WnnSpecialObjectRule($(OBJ8),$(SRC8),$(WNNETCSRC),) $(LOCAL_RKOBJS) : $(LOCAL_RKSRCS) @case '${MFLAGS}' in *[ik]*) set +e;; esac; \ cd $(WNNROMKANSRC); echo "making all in $(WNNROMKANSRC)"; \ $(MAKE) 'CDEBUGFLAGS=$(CDEBUGFLAGS)' $(MFLAGS) DependTarget() wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/jlib/wnnerrmsg.c0000644000000000000000000003064507153676737020372 0ustar rootroot/* * $Id: wnnerrmsg.c,v 2.11.2.1 2000/08/04 05:37:24 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ #include #include "jd_sock.h" #include "jslib.h" #include "jllib.h" #include "commonhd.h" #include "wnn_os.h" #include "msg.h" #include "mt_jlib.h" #include "mt_jserver.h" #ifdef not_use char *wnn_errormsg[] ={ "no_error 0", "¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£", /*WNN_NO_EXIST 1 */ "no_error 2", "¥á¥â¥ê¤ò³ÎÊݤǤ­¤Þ¤»¤ó¡£", /*WNN_MALLOC_ERR 3 */ "no_error 4", "¼­½ñ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£", /*WNN_NOT_A_DICT 5 */ "ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£", /*WNN_NOT_A_HINDO_FILE 6 */ "ÉÕ°¸ì¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£", /*WNN_NOT_A_FUZOKUGO_FILE 7 */ "no_error 8", "¼­½ñ¥Æ¡¼¥Ö¥ë¤¬°ìÇդǤ¹¡£", /*WNN_JISHOTABLE_FULL 9*/ "ÉÑÅÙ¥Õ¥¡¥¤¥ë¤¬¡¢»ØÄꤵ¤ì¤¿¼­½ñ¤ÎÉÑÅÙ¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£", /*WNN_HINDO_NO_MATCH 10 */ "no_error 11", "no_error 12", "no_error 13", "no_error 14", "no_error 15", "¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤Ç¤­¤Þ¤»¤ó¡£", /*WNN_OPENF_ERR 16*/ "Àµ¤·¤¤ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£", /* WNN_NOT_HINDO_FILE 17 */ "Àµ¤·¤¤ÉÕ°¸ì¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£", /* WNN_NOT_FZK_FILE 18 */ "ÉÕ°¸ì¤Î¸Ä¿ô¡¢¥Ù¥¯¥¿Ä¹¤µ¤Ê¤É¤¬Â¿²á¤®¤Þ¤¹¡£", /* WNN_FZK_TOO_DEF 19 */ "¤½¤ÎÈÖ¹æ¤Î¼­½ñ¤Ï¡¢»È¤ï¤ì¤Æ¤¤¤Þ¤»¤ó¡£", /*WNN_DICT_NOT_USED 20 */ "no_error 21", "no_error 22", "no_error 23", "ÉÕ°¸ì¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó", /* WNN_BAD_FZK_FILE 24 */ "µ¿»÷ÉÊ»ìÈֹ椬°Û¾ï¤Ç¤¹hinsi.data¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£", /*WNN_GIJI_HINSI_ERR 25 */ "̤ÄêµÁ¤ÎÉʻ줬Á°Ã¼ÉÊ»ì¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£", /*WNN_NO_DFE_HINSI 26*/ "ÉÕ°¸ì¥Õ¥¡¥¤¥ë¤¬ÆÉ¤ß¹þ¤Þ¤ì¤Æ¤¤¤Þ¤»¤ó¡£", /*WNN_FZK_FILE_NO_LOAD 27 */ "no_error 28", "no_error 29", "¼­½ñ¤Î¥¨¥ó¥È¥ê¤¬Â¿²á¤®¤Þ¤¹¡£", /*WNN_DIC_ENTRY_FULL 30 */ "ÊÑ´¹¤·¤è¤¦¤È¤¹¤ëʸ»úÎó¤¬Ä¹²á¤®¤Þ¤¹¡£", /*WNN_LONG_MOJIRETSU 31 */ "ÉÕ°¸ì²òÀÏÎΰ褬ÉÔ­¤·¤Æ¤¤¤Þ¤¹¡£", /*WNN_WKAREA_FULL 32 */ "no_error 33", "¸õÊ䤬¿²á¤®¤Æ¼¡¸õÊ䤬¼è¤ê½Ð¤»¤Þ¤»¤ó¡£", /* WNN_JKTAREA_FULL 34 */ "»ØÄꤵ¤ì¤¿Ã±¸ì¤¬Â¸ºß¤·¤Þ¤»¤ó¡£", /* WNN_NO_KOUHO 35 */ "no_error 36", "no_error 37", "no_error 38", "no_error 39", "ÆÉ¤ß¤¬Ä¹²á¤®¤Þ¤¹¡£", /*WNN_YOMI_LONG 40 */ "´Á»ú¤¬Ä¹²á¤®¤Þ¤¹¡£", /*WNN_KANJI_LONG 41 */ "»ØÄꤵ¤ì¤¿¼­½ñ¤Ï¡¢ÅÐÏ¿²Äǽ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£", /*WNN_NOT_A_UD 42 */ "ÅÐÏ¿¤¹¤ëÆÉ¤ß¤¬ÆþÎϤµ¤ì¤Æ¤¤¤Þ¤»¤ó¡£", /*WNN_NO_YOMI 43 */ "»ØÄꤵ¤ì¤¿¼­½ñ¤Ï¡¢µÕ°ú¤­²Äǽ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£", /* WNN_NOT_A_REV 44 */ "¥ê¡¼¥É¥ª¥ó¥ê¡¼¤Î¼­½ñ¤Î¥¨¥ó¥È¥ê¤ÏÅÐÏ¿/ºï½ü¤Ç¤­¤Þ¤»¤ó¡£", /*WNN_RDONLY 45 */ "´Ä¶­¤Ë¼­½ñ¤¬Â¸ºß¤·¤Þ¤»¤ó¡£", /* WNN_DICT_NOT_IN_ENV 46 */ "no_error 47", "no_error 48", "¥ê¡¼¥É¥ª¥ó¥ê¡¼¤ÎÉÑÅÙ¤ÏÊѹ¹¤Ç¤­¤Þ¤»¤ó¡£", /* WNN_RDONLY_HINDO 49 */ "»ØÄꤵ¤ì¤¿Ã±¸ì¤¬Â¸ºß¤·¤Þ¤»¤ó¡£", /*WNN_WORD_NO_EXIST 50 */ "no_error 51", "no_error 52", "no_error 53", "no_error 54", "no_error 55", "no_error 56", "no_error 57", "no_error 58", "no_error 59", "¥á¥â¥ê¤ò³ÎÊݤǤ­¤Þ¤»¤ó¡£", /*WNN_MALLOC_INITIALIZE 60 */ "no_error 61", "no_error 62", "no_error 63", "no_error 64", "no_error 65", "no_error 66", "no_error 67", "²¿¤«¤Î¥¨¥é¡¼¤¬µ¯¤³¤ê¤Þ¤·¤¿¡£", /* WNN_SOME_ERROR 68 */ "¥Ð¥°¤¬È¯À¸¤·¤Æ¤¤¤ëÌÏÍͤǤ¹¡£", /*WNN_SONOTA 69 */ "¥µ¡¼¥Ð¤¬Æ°ºî¤·¤Æ¤¤¤Þ¤»¤ó¡£", /*WNN_JSERVER_DEAD 70 */ "¥á¥â¥ê¤ò³ÎÊݤǤ­¤Þ¤»¤ó¡£", /*WNN_ALLOC_FAIL 71 */ "¥µ¡¼¥Ð¤ÈÀܳ¤Ç¤­¤Þ¤»¤ó¡£", /*WNN_SOCK_OPEN_FAIL 72 */ "ÄÌ¿®¥×¥í¥È¥³¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤¬¹ç¤Ã¤Æ¤¤¤Þ¤»¤ó¡£", /* WNN_BAD_VERSION 73 */ "¥¯¥é¥¤¥¢¥ó¥È¤ÎÀ¸À®¤·¤¿´Ä¶­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£", /* WNN_BAD_ENV 74 */ "no_error 75", "no_error 76", "no_error 77", "no_error 78", "no_error 79", "¥Ç¥£¥ì¥¯¥È¥ê¤òºî¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£", /* WNN_MKDIR_FAIL 80 */ "no_error 81", "no_error 82", "no_error 83", "no_error 84", "no_error 85", "no_error 86", "no_error 87", "no_error 88", "no_error 89", "¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£", /* WNN_FILE_READ_ERROR 90*/ "¥Õ¥¡¥¤¥ë¤ò½ñ¤­½Ð¤¹¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£", /* WNN_FILE_WRITE_ERROR 91*/ "¥¯¥é¥¤¥¢¥ó¥È¤ÎÆÉ¤ß¹þ¤ó¤À¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£", /* WNN_FID_ERROR 92*/ "¤³¤ì°Ê¾å¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£", /* WNN_NO_MORE_FILE 93*/ "¥Ñ¥¹¥ï¡¼¥É¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹¡£", /* WNN_INCORRECT_PASSWD 94 */ "¥Õ¥¡¥¤¥ë¤¬ÆÉ¤ß¹þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£ ", /*WNN_FILE_IN_USE 95 */ "¥Õ¥¡¥¤¥ë¤¬ºï½ü¤Ç¤­¤Þ¤»¤ó¡£ ", /*WNN_UNLINK 96 */ "¥Õ¥¡¥¤¥ë¤¬ºîÀ®½ÐÍè¤Þ¤»¤ó¡£", /*WNN_FILE_CREATE_ERROR 97 */ "£×£î£î¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¤Þ¤»¤ó¡£", /*WNN_NOT_A_FILE 98 */ "¥Õ¥¡¥¤¥ë¤ÎI-node¤ÈFILE_UNIQ¤ò°ìÃפµ¤»¤ë»ö¤¬¤Ç¤­¤Þ¤»¤ó¡£", /*WNN_INODE_CHECK_ERROR 99 */ "ÉÊ»ì¥Õ¥¡¥¤¥ë¤¬Â礭²á¤®¤Þ¤¹¡£", /* WNN_TOO_BIG_HINSI_FILE 100 */ "ÉÊ»ì¥Õ¥¡¥¤¥ë¤¬Â礭²á¤®¤Þ¤¹¡£", /* WNN_TOO_LONG_HINSI_FILE_LINE 101 */ "ÉÊ»ì¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£", /* WNN_NO_HINSI_DATA_FILE 102 */ "ÉÊ»ì¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹¡£", /* WNN_BAD_HINSI_FILE 103 */ "no_error 104", "ÉÊ»ì¥Õ¥¡¥¤¥ë¤¬ÆÉ¤ß¹þ¤Þ¤ì¤Æ¤¤¤Þ¤»¤ó¡£", /* WNN_HINSI_NOT_LOADED 105*/ "ÉÊ»ì̾¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹¡£", /* WNN_BAD_HINSI_NAME 106 */ "ÉÊ»ìÈֹ椬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹¡£", /* WNN_BAD_HINSI_NO 107 */ "no_error 108", "¤½¤ÎÁàºî¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£", /*NOT_SUPPORTED_OPERATION 109 Not Used*/ "¥Ñ¥¹¥ï¡¼¥É¤ÎÆþ¤Ã¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤Ç¤­¤Þ¤»¤ó¡£", /*WNN_CANT_OPEN_PASSWD_FILE 110 */ /* ½é´ü²½»þ¤Î¥¨¥é¡¼ */ "uumrc¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£", /*WNN_RC_FILE_NO_EXIST 111 Not Used*/ "uumrc¥Õ¥¡¥¤¥ë¤Î·Á¼°¤¬¸í¤Ã¤Æ¤¤¤Þ¤¹¡£", /* WNN_RC_FILE_BAD_FORMAT 112 Not Used*/ "¤³¤ì°Ê¾å´Ä¶­¤òºî¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£", /* WNN_NO_MORE_ENVS 113 */ "¤³¤Î¥¯¥é¥¤¥¢¥ó¥È¤¬ÆÉ¤ß¹þ¤ó¤À¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¤Þ¤»¤ó¡£", /* WNN_FILE_NOT_READ_FROM_CLIENT 114 */ "¼­½ñ¤ËÉÑÅÙ¥Õ¥¡¥¤¥ë¤¬¤Ä¤¤¤Æ¤¤¤Þ¤»¤ó¡£", /*WNN_NO_HINDO_FILE 115 */ "¥Ñ¥¹¥ï¡¼¥É¤Î¥Õ¥¡¥¤¥ë¤¬ºîÀ®½ÐÍè¤Þ¤»¤ó¡£" /*WNN_CANT_CREATE_PASSWD_FILE 116*/ }; int wnn_errormsg_len = sizeof(wnn_errormsg) / sizeof(char *); extern int wnn_errorno; static char msg[] = ":BAD ERRORNO!!! "; char *wnn_perror() { static char msgarea[100]; if((wnn_errorno < 0) || (wnn_errorno > sizeof(wnn_errormsg) / sizeof(char *))){ sprintf(msgarea , "%d" , wnn_errorno); strcat(msgarea , msg); return(msgarea); } return(wnn_errormsg[wnn_errorno]); } #endif /* not_use */ extern struct msg_cat *wnn_msg_cat; static char msg[] = ":BAD ERRORNO!!! "; char * wnn_perror_lang(lang, args) char *lang; ARGS *args; { static char msgarea[100]; char *x; LockMutex(&msg_lock); sprintf(msgarea , "%d" , wnn_errorno); strcat(msgarea , msg); x = msg_get(wnn_msg_cat, wnn_errorno, msgarea, lang, args); UnlockMutex(&msg_lock); return x; } char * wnn_perror(args) ARGS *args; { return(wnn_perror_lang(NULL, args)); } /* Local Variables: eval: (setq kanji-flag t) eval: (setq kanji-fileio-code 0) eval: (mode-line-kanji-code-update) End: */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/jlib/js.c0000644000000000000000000041507407153676737016767 0ustar rootroot/* * $Id: js.c,v 2.69.2.4 2000/08/04 05:37:22 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4 */ /* Nihongo Henkan Library */ /* entry functions js_open_lang js_close js_change_current_jserver js_connect_lang js_disconnect js_isconnect js_param_get js_param_set js_access js_mkdir js_get_lang js_set_lang extern Variables int wnn_errorno; */ extern char *malloc(); #include #include #ifdef UX386 #include #else #include #endif #include #ifndef UX386 #include #endif #include #include extern int errno; #include #include "jd_sock.h" #include "commonhd.h" #include "demcom.h" #include "config.h" #include "wnnerror.h" #include "jslib.h" #include "jllib.h" #include "mt_jlib.h" #include "jh.h" #include "msg.h" #include "serverdefs.h" #ifdef SYSVR2 #define bzero(adr,n) memset((adr),0,(n)) #endif #define JS /* For include ../etc/bdic.c */ #include "../etc/bdic.c" /* * Hideyuki Kishiba (Jul. 11, 1994) * New bdic function for FI-Wnn */ #include "../etc/fi_bdic.c" #include "../etc/pwd.c" char *malloc(); typedef struct _host_address { int address_len; char *address; } host_address; int wnn_errorno =0; struct msg_cat *wnn_msg_cat = NULL; /* j Lib. */ static int current_sd; /** ¥½¥±¥Ã¥Èfd **/ static WNN_JSERVER_ID_INT *current_js = NULL; /* Packet Buffers */ static unsigned char snd_buf[S_BUF_SIZ]; /** Á÷¿® **/ static int sbp=0; /** Á÷¿®¥Ð¥Ã¥Õ¥¡¡¼¥Ý¥¤¥ó¥¿¡¼ **/ static int rbc= -1; /** ¼õ¿®¥Ð¥Ã¥Õ¥¡¡¼¥Ý¥¤¥ó¥¿¡¼ **/ #if defined(EAGAIN) # if defined(EWOULDBLOCK) # define ERRNO_CHECK(no) ((no) == EAGAIN || (no) == EWOULDBLOCK) # else /* defined(EWOULDBLOCK) */ # define ERRNO_CHECK(no) ((no) == EAGAIN) # endif /* defined(EWOULDBLOCK) */ #else /* defined(EAGAIN) */ # if defined(EWOULDBLOCK) # define ERRNO_CHECK(no) ((no) == EWOULDBLOCK) # else /* defined(EWOULDBLOCK) */ # define ERRNO_CHECK(no) (0) # endif /* defined(EWOULDBLOCK) */ #endif /* defined(EAGAIN) */ static int _get_server_name( char *server, char *pserver, int pserver_size, int *portNO ); static int writen(); /********* V4 *****************/ /*** jserver_dead Macro ***/ static jmp_buf current_jserver_dead; #define handler_of_jserver_dead(current_js) \ { \ if (current_js) { \ if(current_js->js_dead){ \ js_wnn_errorno_set=WNN_JSERVER_DEAD; \ } else \ if(setjmp(js_current_jserver_dead)){ \ if (!js_wnn_errorno_eql) js_wnn_errorno_set=WNN_JSERVER_DEAD; \ } else \ js_wnn_errorno_set = 0; /* here initialize wnn_errorno; */ \ } \ } #define handler_of_jserver_dead_env(env) \ { \ if (env->js_id) { \ if(env->js_id->js_dead){ \ env_wnn_errorno_set=WNN_JSERVER_DEAD; \ } else \ if(setjmp(env_current_jserver_dead)){ \ if (!env_wnn_errorno_eql) env_wnn_errorno_set=WNN_JSERVER_DEAD; \ } else \ env_wnn_errorno_set = 0; /* here initialize wnn_errorno; */ \ } \ } static void set_current_js(server) register WNN_JSERVER_ID *server; { current_js = (WNN_JSERVER_ID_INT *)server; current_sd = current_js->orig.sd; } #undef ARGS #define ARGS char #define js_wnn_errorno_set wnn_errorno #define js_wnn_errorno_eql wnn_errorno #define env_wnn_errorno_set wnn_errorno #define env_wnn_errorno_eql wnn_errorno #define js_current_jserver_dead current_jserver_dead #define env_current_jserver_dead current_jserver_dead /** ¥Ç¡¼¥â¥ó¤¬»à¤ó¤À»þ¤Î¤¿¤á¤Î¸å»ÏËö **/ static void demon_dead(server) ARGS *server; { current_js->orig.js_dead= -1; js_wnn_errorno_set = WNN_JSERVER_DEAD; shutdown(current_sd, 2); close(current_sd); #if DEBUG fprintf(stderr,"jslib:JSERVER %s is Dead\n",current_js->orig.js_name); #endif if(current_js->orig.js_dead_env_flg){ longjmp(current_js->orig.js_dead_env,666); } longjmp(js_current_jserver_dead,666); /* never reach */ } /** ¥½¥±¥Ã¥È¤ò¥ª¡¼¥×¥ó¤·¤Æcurrent_sd¤Ë¥½¥±¥Ã¥Èfd¤òÊÖ¤¹ (cd¤È¤¤¤¦¤Î¤Ï¥³¥ß¥å¥Ë¥±¡¼¥·¥ç¥ó¥Ç¥Ð¥¤¥¹¤Î̾»Ä) **/ static int cd_open(lang) register char *lang; { #ifdef AF_UNIX int sd; struct sockaddr_un saddr; /** ¥½¥±¥Ã¥È **/ char *sock_name = NULL; saddr.sun_family = AF_UNIX; /* find socket name from table by lang */ if (lang && *lang) { if ((sock_name = wnn_get_unixdomain_of_serverdefs(lang)) == NULL) { sock_name = UNIX_SOCKET_NAME; } } else { sock_name = UNIX_SOCKET_NAME; /* Jserver */ } strcpy(saddr.sun_path, sock_name); #if ((defined AIXV3) || (defined FREEBSD) || (defined BSDOS) || (defined NETBSD)) strcat(saddr.sun_path, "="); #endif if ((sd = socket(AF_UNIX,SOCK_STREAM, 0)) == ERROR) { #if DEBUG xerror("jslib:Can't create socket.\n"); #endif return -1; } if (connect(sd,(struct sockaddr *)&saddr,strlen(saddr.sun_path)+sizeof(saddr.sun_family)) == ERROR) { #if DEBUG xerror("jslib:Can't connect socket.\n"); #endif close(sd); return -1; } return sd; #else return -1; #endif } static intfntype connect_timeout() { SIGNAL_RETURN; } static int cd_open_in_core(sa, tmout) register struct sockaddr_in *sa; register int tmout; { int sd; int ret; int old_alarm = 0; intfntype (*save_alarm_proc)() = NULL; if ((sd = socket(AF_INET, SOCK_STREAM, 0)) == ERROR){ #if DEBUG xerror("jslib:Can't create Inet socket.\n"); #endif return -1 ; } if (tmout > 0) { save_alarm_proc = signal(SIGALRM, connect_timeout); old_alarm = alarm(tmout); } ret = connect(sd, (struct sockaddr *)sa, sizeof(struct sockaddr_in)); if (tmout > 0) { alarm(old_alarm); if (save_alarm_proc) signal(SIGALRM, save_alarm_proc); else signal(SIGALRM, SIG_IGN); } if (ret == ERROR) { #if DEBUG xerror("jslib:Can't connect Inet socket.\n"); #endif close(sd); return -1 ; } return sd; } static int cd_open_in_by_addr(addr, addrlen, port, tmout) char *addr; int addrlen, port, tmout; { struct sockaddr_in saddr_in; bzero((char *)&saddr_in,sizeof(saddr_in)); bcopy(addr,(char *)&saddr_in.sin_addr, addrlen); saddr_in.sin_family = AF_INET; saddr_in.sin_port = port; return(cd_open_in_core(&saddr_in, tmout)); } typedef struct _my_serv_struct { char *name; int port; struct _my_serv_struct *next; } my_serv_struct; static int my_getservbyname(name) register char *name; { static my_serv_struct *tbl = NULL; register my_serv_struct *p; struct servent *sp = NULL; register int len; for (p = tbl; p; p = p->next) { if (p->name && !strcmp(p->name, name)) return(p->port); } if (!(sp = getservbyname(name,"tcp"))) return(-1); len = strlen(name); if (!(p = (my_serv_struct *)malloc(sizeof(my_serv_struct) + len + 1))) return(-1); p->name = ((char *)p) + sizeof(my_serv_struct); strcpy(p->name, name); p->port = ntohs(sp->s_port); p->next = tbl; tbl = p; return(p->port); } static int cd_open_in(server, lang, tmout) register char *server; register char *lang; register int tmout; { struct sockaddr_in saddr_in; /** ¥½¥±¥Ã¥È **/ register struct hostent *hp; int serverNO, port_num; char pserver[64]; char sserver[64]; char *serv_name = NULL; unsigned long ia; char *inet_ntoa(); serverNO = _get_server_name(server, pserver, sizeof(pserver), &port_num); if (port_num > 0) { /* absolute port number is specified */ serverNO += port_num; } else { /* find service name from table by lang */ if (lang && *lang) { if ((serv_name = wnn_get_service_of_serverdefs(lang)) == NULL) { strncpy(sserver, SERVERNAME, sizeof(sserver) - 1); } else { strncpy(sserver, serv_name, sizeof(sserver) - 1); } } else { strncpy(sserver, SERVERNAME, sizeof(sserver) - 1); } sserver[sizeof(sserver) - 1] = 0; if ((port_num = my_getservbyname(sserver)) != -1) { serverNO += port_num; } else { if (lang && *lang && (port_num = wnn_get_port_num_of_serverdefs(lang)) != -1) { serverNO += port_num; } else { serverNO += WNN_PORT_IN; } } } bzero((char *)&saddr_in,sizeof(saddr_in)); if (isascii(pserver[0]) && isdigit(pserver[0])) { ia = inet_addr(pserver); saddr_in.sin_addr.s_addr = ia; } else if ((hp = gethostbyname(pserver))) { bcopy(hp->h_addr,(char *)&saddr_in.sin_addr, hp->h_length); } else { return(-1); } saddr_in.sin_family = AF_INET; saddr_in.sin_port = htons(serverNO); return(cd_open_in_core(&saddr_in, tmout)); } /* get server name and return serverNo */ /* and return absolute port number 1993/12/07 S.Kuwari */ static int _get_server_name(server, pserver, pserver_size, portNO) char *server; char *pserver; int pserver_size; int *portNO; { register char *p; register int port = 0, offset = 0; strncpy(pserver, server, pserver_size - 1); pserver[pserver_size - 1] = '\0'; if ((p = strchr(pserver, ':'))) { *p = '\0'; if (*(p+1)) offset = atoi(p+1); } if ((p = strchr(pserver, '/'))) { *p = '\0'; if (*(p+1)) port = atoi(p+1); } *portNO = port; return(offset); } /* Packet SND/RCV subroutines */ static void put4com(); /* ¥µ¡¼¥Ð¤¬»ØÄê¥×¥í¥È¥³¥ë¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯ */ #define check_version(cmd) \ (((cmd>>12) & 0xFFF) > (current_js->version & 0xFFF)) /* ¥µ¡¼¥Ð¤¬£Æ£É´Ø·¸½èÍý¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯ */ #define CHECK_FI \ ((current_js->version & 0xFFF) >= 0xF00) /** ¥Ñ¥±¥Ã¥È¤Î¥Ø¥Ã¥À¡¼¤òÁ÷¤ë **/ static void snd_head(cmd, server) int cmd; /** cmd=¥³¥Þ¥ó¥É **/ ARGS *server; { sbp=0; if (check_version(cmd)) { js_wnn_errorno_set = WNN_NOT_SUPPORT_PACKET; longjmp(js_current_jserver_dead,666); } put4com(cmd, server); rbc= -1; } /** ¥Ñ¥±¥Ã¥È¤Î¥Ø¥Ã¥À¡¼¤òÁ÷¤ë **/ static int snd_env_head(env,cmd) register struct wnn_env *env; int cmd; /** cmd=¥³¥Þ¥ó¥É **/ { ARGS *args = NULL; snd_head(cmd, args); put4com(env->env_id, args); return 0; } /** ¥Ñ¥±¥Ã¥È¤Î¥Ø¥Ã¥À¡¼¤òÁ÷¤ë **/ static int snd_server_head(server,cmd) register WNN_JSERVER_ID *server; int cmd; /** cmd=¥³¥Þ¥ó¥É **/ { ARGS *args = NULL; snd_head(cmd, args); return 0; } /** Á÷¿®¥Ð¥Ã¥Õ¥¡¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë **/ static int snd_flush(server) ARGS *server; { if(sbp==0)return(-1); writen(sbp, server); sbp=0; return(0); } static int writen(n, server) int n; ARGS *server; {int cc,x; for(cc=0;cc=S_BUF_SIZ){ writen(S_BUF_SIZ, server); sbp=0; } } /** ¥µ¡¼¥Ð¤Ø2¥Ð¥¤¥ÈÁ÷¤ë **/ static void put2com(c, server) int c; ARGS *server; { put1com(c>>(8*1), server); put1com(c , server); } /** ¥µ¡¼¥Ð¤Ø4¥Ð¥¤¥ÈÁ÷¤ë **/ static void put4com(c, server) int c; ARGS *server; { put1com(c>>(8*3), server); put1com(c>>(8*2), server); put1com(c>>(8*1), server); put1com(c , server); } /** ¥µ¡¼¥Ð¤ØÊ¸»úÎó¤òÁ÷¤ë **/ static void putwscom(p, server) register w_char *p; ARGS *server; { if(p==NULL){ put2com(0, server); return; } while(*p)put2com(*p++, server); put2com(0, server); } /** ¥µ¡¼¥Ð¤ØÊ¸»úÎó¤òÁ÷¤ë **/ static void putscom(p, server) register char *p; ARGS *server; { if(p==NULL){ put1com(0, server); return; } while(*p)put1com(*p++, server); put1com(0, server); } /** ¥µ¡¼¥Ð¤«¤é1¥Ð¥¤¥È¼õ¤±¤ë **/ static int get1com(server) ARGS *server; { static int rbp; static unsigned char rcv_buf[R_BUF_SIZ]; /** ¼õ¿® **/ if(rbc<=0){ while(1) { errno = 0; rbc = read(current_sd, rcv_buf, R_BUF_SIZ); if(rbc <= 0) { if (ERRNO_CHECK(errno)) { continue; } else if (rbc == 0) { demon_dead(server); return -1; } else { /* cc == -1 */ if (errno != EINTR) { demon_dead(server); return -1; } continue; } } rbp=0; #if DEBUG fprintf(stderr,"jslib:read:rbc=%d\n",rbc); /* dmp(rcv_buf,rbc); */ #endif break; } } rbc--; return rcv_buf[rbp++] & 0xFF ; } /** ¥µ¡¼¥Ð¤«¤é2¥Ð¥¤¥È¼õ¤±¤ë **/ static int get2com(server) ARGS *server; {register int h; h=get1com(server); return (h<<8) | get1com(server); } /** ¥µ¡¼¥Ð¤«¤é4¥Ð¥¤¥È¼õ¤±¤ë **/ static int get4com(server) ARGS *server; {register int h1,h2,h3; h1=get1com(server) << 24 ; h2=get1com(server) << 16 ; h3=get1com(server) << 8 ; return h1 | h2 | h3 | get1com(server); } /** ¥µ¡¼¥Ð¤«¤éʸ»úÎó¤ò¼õ¤±¼è¤ë **/ static void getscom(cp, server, buflen) register char *cp; ARGS *server; register int buflen; { register int i; for (i = 0 ; i < buflen ; i++) { if ((*cp++ = get1com(server)) == '\0') break; } /* Buffer Overflow size? */ if (i >= buflen) { /* »Ä¤ê¤Î¥Ç¡¼¥¿¤òÇË´þ¤¹¤ë */ while (get1com(server) != 0) ; if (i > 0) *(cp - 1) = '\0'; /* set null terminate */ } } /** ¥µ¡¼¥Ð¤«¤éʸ»úÎó¤ò¼õ¤±¼è¤ë **/ static void getwscom(wp, server, buflen) register w_char *wp; ARGS *server; register int buflen; /* not bytes. "buflen" is word length. */ { register int i; for (i = 0 ; i < buflen ; i++) { if ((*wp++ = get2com(server)) == '\0') break; } /* Buffer Overflow size? */ if (i >= buflen) { /* »Ä¤ê¤Î¥Ç¡¼¥¿¤òÇË´þ¤¹¤ë */ while (get2com(server) != 0) ; if (i > 0) *(wp - 1) = '\0'; /* set null terminate */ } } /* Debug Subroutines */ #if DEBUG void xerror(s)char *s; { fprintf(stderr,"%s\n",s); } void dmp(p,c)char *p; { int i,j; for(i=0;;i+=16){ for(j=0;j<16;j++){ if(c<=0){ fprintf(stderr,"\n"); return;} fprintf(stderr,"%02x ",p[i+j]&0xFF); c--; } fprintf(stderr,"\n"); } } #endif /* get login name form /etc/passwd file */ static char* getlogname() { extern struct passwd *getpwuid(); struct passwd *p; if ((p = getpwuid(getuid())) == NULL) return(NULL); return(p->pw_name); } static int send_js_open_core(server, host, user, version) WNN_JSERVER_ID *server; char *host, *user; int version; { int x; handler_of_jserver_dead(server); if(js_wnn_errorno_eql) return(-1); snd_head(JS_OPEN, server); put4com(version, server); /* H.T. */ putscom(host, server); putscom(user, server); snd_flush(server); if((x = get4com(server)) == -1){ js_wnn_errorno_set=get4com(server); return(-1); } return(x); } /*:::DOC_START * * Function Name: version_negotiation * Description : * ¥¯¥é¥¤¥¢¥ó¥È¡¿¥µ¡¼¥Ð´Ö¤Î¥×¥í¥È¥³¥ë¥Ð¡¼¥¸¥ç¥ó¤ÎÄ´À°¤ò¹Ô¤¦ * Parameter : * server : (InOut) ¥µ¡¼¥Ð¾ðÊó¹½Â¤ÂΤؤΥݥ¤¥ó¥¿ * host : (In) ¥¯¥é¥¤¥¢¥ó¥È»ÈÍÑ¥Û¥¹¥È̾ * user : (In) ¥¯¥é¥¤¥¢¥ó¥È»ÈÍѥ桼¥¶Ì¾ * init_version : (In) ¥¯¥é¥¤¥¢¥ó¥È¤Î¥×¥í¥È¥³¥ë½é´ü¥Ð¡¼¥¸¥ç¥óÈÖ¹æ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int version_negotiation(server, host, user, init_version) WNN_JSERVER_ID *server; char *host, *user; int init_version; { int version, dummy; /* ¥á¥¸¥ã¡¼¡¦¥Ð¡¼¥¸¥ç¥ó¥Á¥§¥Ã¥¯ */ if((init_version >> 12) != 4) return(-1); if (init_version > 0x4F00) { /* 4.F00 ¤è¤êÂ礭¤±¤ì¤Ð 4.F00 ¤ÇºÆ¥È¥é¥¤ */ if (send_js_open_core(server, host, user, 0x4F00) < 0) { if (js_wnn_errorno_eql == WNN_BAD_VERSION) { /* 4.003 ¤ÇºÆ¥È¥é¥¤ */ if (send_js_open_core(server, host, user, 0x4003) < 0) return(-1); ((WNN_JSERVER_ID_INT *)server)->version = 0x4003; return(0); } return(-1); } /* ¥µ¡¼¥Ð¥Ð¡¼¥¸¥ç¥ó¤Î¥Á¥§¥Ã¥¯ */ if (js_version(server, &version, &dummy) == -1) return(-1); if (version > 0x4F00) { /* ¥µ¡¼¥Ð¥Ð¡¼¥¸¥ç¥ó¤ÇºÆ¥È¥é¥¤ */ if (send_js_open_core(server, host, user, version) >= 0) { ((WNN_JSERVER_ID_INT *)server)->version = version; return(0); } } ((WNN_JSERVER_ID_INT *)server)->version = 0x4F00; } else { /* 4.003 ¤ÇºÆ¥È¥é¥¤ */ if (send_js_open_core(server, host, user, 0x4003) < 0) return(-1); ((WNN_JSERVER_ID_INT *)server)->version = 0x4003; } return(0); } /* End of version_negotiation */ static WNN_JSERVER_ID * reconnect_other_host(server, user, host, tmout) WNN_JSERVER_ID *server; char *user, *host; int tmout; { char addr[32]; int addrlen, i, port; char *new_js; int x; struct hostent *hp; addrlen = get4com(server); /* Buffer Overflow size? */ if (addrlen > sizeof(addr)) { for (i = 0; i < addrlen; i++) get1com(server); } else { for (i = 0; i < addrlen; i++) addr[i] = get1com(server); } port = get4com(server); js_close(server); /* Buffer Overflow size? */ if (addrlen > sizeof(addr)) { js_wnn_errorno_set = WNN_SOME_ERROR; return NULL; } if (!(hp = gethostbyaddr(addr, addrlen, AF_INET))) { js_wnn_errorno_set = WNN_NO_JSERVER; return NULL; } sbp=0; /* init sndBufPointer */ if(!(new_js=(char *)malloc(sizeof(WNN_JSERVER_ID_INT)))){ js_wnn_errorno_set=WNN_ALLOC_FAIL; return NULL; } server =(WNN_JSERVER_ID *) new_js; strncpy(server->js_name, hp->h_name, sizeof(server->js_name) - 1); server->js_name[sizeof(server->js_name) - 1] = '\0'; server->js_dead= 0; server->js_dead_env_flg= 0; if((current_sd= cd_open_in_by_addr(addr, addrlen, port, tmout))==-1){ js_wnn_errorno_set = WNN_NO_JSERVER; free((char*)server); current_js=NULL; return NULL; } server->sd= current_sd; ((WNN_JSERVER_ID_INT *)server)->version = JLIB_VERSION; ((WNN_JSERVER_ID_INT *)server)->extensions = NULL; if ((x = send_js_open_core(server, host, user, JLIB_VERSION)) == -1) { x = js_wnn_errorno_eql; js_wnn_errorno_set = 0; if ((x != WNN_BAD_VERSION) || version_negotiation(server, host, user, JLIB_VERSION)) { js_close(server); /* H.T. */ current_js = NULL; return NULL; } } else if (x == 1) { /* re-connect to other server */ return(reconnect_other_host(server, user, host, tmout)); } return(server); } /* * Lib. Functions * raw lib. */ /*** js ¡¦global ***/ /** jserver ¤ÈÀܳ¤¹¤ë¡£jserver_id ¤òÊÖ¤¹¡£ **/ WNN_JSERVER_ID * js_open_lang(servername, lang, tmout) register char *servername, *lang; register int tmout; {char *new_js, *username; char host[WNN_HOSTLEN],user[WNN_ENVNAME_LEN]; int x; WNN_JSERVER_ID_INT *server; DoOnce( &once, _InitMutexs ); LockMutex(&msg_lock); if (wnn_msg_cat == NULL){ char nlspath[64]; strcpy(nlspath, LIBDIR); strcat(nlspath, "/%L/%N"); wnn_msg_cat = msg_open("libwnn.msg", nlspath, lang, NULL); if(wnn_msg_cat == NULL){ fprintf(stderr, "libwnn: Can't open message file for libwnn.a\n"); } } UnlockMutex(&msg_lock); if(!(new_js=(char *)malloc(sizeof(WNN_JSERVER_ID_INT)))){ wnn_errorno=WNN_ALLOC_FAIL; return NULL; } LockMutex(&open_lock); current_js =(WNN_JSERVER_ID_INT *) new_js; if (servername == NULL) { current_js->orig.js_name[0] = '\0'; } else { strncpy(current_js->orig.js_name, servername, sizeof(current_js->orig.js_name) - 1); current_js->orig.js_name[sizeof(current_js->orig.js_name) - 1] = '\0'; } current_js->orig.js_dead= 0; current_js->orig.js_dead_env_flg= 0; InitMutex(&(current_js_js_lock)); /* if(user == NULL || 0==strcmp(user,"")) */ username = getlogname(); if (username) { strncpy(user, username, WNN_ENVNAME_LEN); user[WNN_ENVNAME_LEN-1] = '\0'; /* truncate by WNN_ENVNAME_LEN */ } else { user[0] = '\0'; } if(servername == NULL || 0==strcmp(servername,"") || 0==strcmp(servername,"unix")){ strcpy(host,"unix"); if((current_sd= cd_open(lang))==-1){ UnlockMutex(&open_lock); wnn_errorno=WNN_SOCK_OPEN_FAIL;free((char*)current_js);current_js=NULL; return NULL; } }else{ gethostname(host,WNN_HOSTLEN); host[WNN_HOSTLEN-1] = '\0'; /* truncate by WNN_HOSTLEN */ if((current_sd= cd_open_in(servername, lang, tmout))==-1){ UnlockMutex(&open_lock); wnn_errorno=WNN_SOCK_OPEN_FAIL;free((char*)current_js);current_js=NULL; return NULL; } } current_js->orig.sd= current_sd; current_js->version= JLIB_VERSION; current_js->extensions= NULL; server = current_js; if ((x = send_js_open_core(server, host, user, JLIB_VERSION)) == -1) { x = wnn_errorno; wnn_errorno = 0; if ((x != WNN_BAD_VERSION) || version_negotiation(server, host, user, JLIB_VERSION)) { js_close(current_js); current_js = NULL; wnn_errorno = x; UnlockMutex(&open_lock); return NULL; } } else if (x == 1) { /* re-connect to other server */ return(reconnect_other_host(server, user, host, tmout)); } UnlockMutex(&open_lock); return (WNN_JSERVER_ID *)current_js; } /** ¥½¥±¥Ã¥È¤ò¥¯¥í¡¼¥º¤¹¤ë **/ /** jserver ¤È¤ÎÀܳ¤ò close ¤¹¤ë¡£ **/ int js_close(server) WNN_JSERVER_ID *server; { register int x; WNN_JSERVER_ID_INT tmp_js_id; if(server==0) return(-1); tmp_js_id = *(WNN_JSERVER_ID_INT *)server; free((char *)server); current_js = &tmp_js_id; server = (WNN_JSERVER_ID *)current_js; set_current_js(server); LockMutex(&(current_js_js_lock)); /* handler of jserver dead */ handler_of_jserver_dead(server); if(wnn_errorno) { UnlockMutex(&(current_js_js_lock)); return(-1); } snd_head(JS_CLOSE, server); snd_flush(server); x=get4com(server); if(x==-1)wnn_errorno=get4com(server); close(current_sd); UnlockMutex(&(current_js_js_lock)); return x; } /* jserver ¤È¤Î´Ö¤Ë connection ¤òÄ¥¤ê¡¢Æ±»þ¤Ë jserver ¤ÎÆâÉô¤Ë´Ä ¶­¤òºî¤ë¡£env_name ¤Ë´û¤Ë¸ºß¤¹¤ë´Ä¶­¤ò»ØÄꤷ¤¿»þ¤Ë¤Ï¤½¤Î´Ä¶­¤ò ÊÖ¤·¡¢NULL ¤ò»ØÄꤷ¤¿»þ¤Ë¤Ï¿·¤·¤¤´Ä¶­¤òºî¤Ã¤ÆÊÖ¤¹¡£ */ struct wnn_env * js_connect_lang(server, env_name, lang) register char *env_name; WNN_JSERVER_ID *server; char *lang; { register int e_id; register struct wnn_env_int *env; void js_set_lang(); set_current_js(server); if(!(env=(struct wnn_env_int *)malloc(sizeof(struct wnn_env_int)))){ js_wnn_errorno_set=WNN_ALLOC_FAIL; return NULL; } LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); free(env); return(NULL); } snd_head(JS_CONNECT, server); putscom(env_name, server); snd_flush(server); e_id=get4com(server); if(e_id==-1){ js_wnn_errorno_set= get4com(server); free(env); return NULL; } UnlockMutex(&(server_js_lock)); env->orig.env_id = e_id; env->orig.js_id = (WNN_JSERVER_ID *)server; env->orig.muhenkan_mode = WNN_DIC_RDONLY; env->orig.bunsetsugiri_mode = WNN_DIC_RDONLY; env->orig.kutouten_mode = 1; env->orig.kakko_mode = 1; env->orig.kigou_mode = 1; strncpy(env->orig.lang, lang, sizeof(env->orig.lang) - 1); /* set language name */ env->orig.lang[sizeof(env->orig.lang) - 1] = 0; env->orig.autotune = 0; /* ³Ø½¬¾ðÊ󼫯°¥»¡¼¥Ö¤Î³ÎÄê²ó¿ô½é´ü²½¡Ê¥Ç¥Õ¥©¥ë¥È 50 ²ó¡Ë*/ env->orig.autosave = 50; return (struct wnn_env *)env; } /* get language value from env */ char * js_get_lang(env) struct wnn_env *env; { return(env->lang); } int js_env_exist(server,env_name) register char *env_name; register WNN_JSERVER_ID *server; { int x; set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } snd_head(JS_ENV_EXIST, server); putscom(env_name, server); snd_flush(server); x =get4com(server); UnlockMutex(&(server_js_lock)); return x; } int js_env_sticky(env) register struct wnn_env *env; { int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_ENV_STICKY); snd_flush(env->js_id); x = get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } int js_env_un_sticky(env) register struct wnn_env *env; { int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_ENV_UN_STICKY); snd_flush(env->js_id); x = get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /** env ¤Ç¼¨¤µ¤ì¤ë´Ä¶­¤ò̵¤¯¤¹¡£ **/ int js_disconnect(env) register struct wnn_env *env; {register int x; if(env==0) return(-1); /* ËÜÍè¤Ï¡¢free ¤·¤Ê¤­¤ã¤¢¤«¤ó¤Î¤À¤±¤É¡¢¥ê¥½¡¼¥¹´ÉÍý¤¬½ÐÍè¤Ê¤¤¤·¡¢ ¤Þ¤¢¡¢8¥Ð¥¤¥È¤À¤«¤é¡¢¥´¥ß¤¬»Ä¤ë¤±¤É¤¤¤¤¤À¤í¤¦¡£ free((char *)env); */ set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_DISCONNECT); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1){ env_wnn_errorno_set= get4com(env->js_id); } UnlockMutex(&(env_js_lock)); return x; } /** ¥µ¡¼¥Ð¤È¥³¥Í¥¯¥È¤·¤Æ¤¤¤ë¤« **/ int js_isconnect(env) struct wnn_env *env; { if (env && env->js_id) return(env->js_id->js_dead); return(-1); } /** env ¤Î ´Ä¶­ ¤È¤ÎÄÌ¿®¥Ð¥Ã¥Õ¥¡¤ò flush ¤¹¤ë¡£ **/ void js_flush(env) struct wnn_env *env; { } /* Parameter set/get */ /** ÊÑ´¹ parameter ¤òÀßÄꤹ¤ë¡£ **/ /** js_param_set **/ int js_param_set(env,para) struct wnn_env *env; register struct wnn_param *para; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_PARAM_SET); put4com(para->n, env->js_id); /* £Î(Âç)ʸÀá²òÀϤΣΠ*/ put4com(para->nsho, env->js_id); /* ÂçʸÀáÃæ¤Î¾®Ê¸Àá¤ÎºÇÂç¿ô */ put4com(para->p1, env->js_id); /* ´´¸ì¤ÎÉÑÅ٤Υѥé¥á¡¼¥¿ */ put4com(para->p2, env->js_id); /* ¾®Ê¸ÀáĹ¤Î¥Ñ¥é¥á¡¼¥¿ */ put4com(para->p3, env->js_id); /* ´´¸ìĹ¤Î¥Ñ¥é¥á¡¼¥¿ */ put4com(para->p4, env->js_id); /* º£»È¤Ã¤¿¤è¥Ó¥Ã¥È¤Î¥Ñ¥é¥á¡¼¥¿ */ put4com(para->p5, env->js_id); /* ¼­½ñ¤Î¥Ñ¥é¥á¡¼¥¿ */ put4com(para->p6, env->js_id); /* ¾®Ê¸Àá¤Îɾ²ÁÃͤΥѥé¥á¡¼¥¿ */ put4com(para->p7, env->js_id); /* ÂçʸÀáĹ¤Î¥Ñ¥é¥á¡¼¥¿ */ put4com(para->p8, env->js_id); /* ¾®Ê¸Àá¿ô¤Î¥Ñ¥é¥á¡¼¥¿ */ put4com(para->p9, env->js_id); /* µ¿»÷ÉÊ»ì ¿ô»ú¤ÎÉÑÅÙ */ put4com(para->p10, env->js_id); /* µ¿»÷ÉÊ»ì ¥«¥Ê¤ÎÉÑÅÙ *//* CWNN ±Ñ¿ô¤ÎÉÑÅÙ */ put4com(para->p11, env->js_id); /* µ¿»÷ÉÊ»ì ±Ñ¿ô¤ÎÉÑÅÙ *//* CWNN µ­¹æ¤ÎÉÑÅÙ */ put4com(para->p12, env->js_id); /* µ¿»÷ÉÊ»ì µ­¹æ¤ÎÉÑÅÙ *//* CWNN ³«³ç¸Ì¤ÎÉÑÅÙ */ put4com(para->p13, env->js_id); /* µ¿»÷ÉÊ»ì Êijç¸Ì¤ÎÉÑÅÙ *//* CWNN Êijç¸Ì¤ÎÉÑÅÙ */ put4com(para->p14, env->js_id); /* µ¿»÷ÉÊ»ì ÉÕ°¸ì¤ÎÉÑÅÙ *//* BWNN No of koho */ put4com(para->p15, env->js_id); /* µ¿»÷ÉÊ»ì ³«³ç¸Ì¤ÎÉÑÅÙ *//* CWNN Not used */ snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1){ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return -1; } UnlockMutex(&(env_js_lock)); return 0; } extern int js_get_autolearning_mode_core(); #define WNN_ENV_LOCAL_MASK \ (WNN_ENV_KUTOUTEN_MASK|WNN_ENV_KAKKO_MASK|WNN_ENV_KIGOU_MASK) /*:::DOC_START * * Function Name: js_set_henkan_env * Description : ¥µ¡¼¥ÐÆâ¤ÎÊÑ´¹´Ä¶­¤òÀßÄꤹ¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * valuemask : (In) Í­¸úÀßÄêÃͥӥåȥޥ¹¥¯ * henv : (In) ÊÑ´¹´Ä¶­¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_set_henkan_env(env,valuemask,henv) struct wnn_env *env; unsigned long valuemask; register struct wnn_henkan_env *henv; { register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } if (valuemask & WNN_ENV_LOCAL_MASK){ if (valuemask & WNN_ENV_KUTOUTEN_MASK) env->kutouten_mode = henv->kutouten_flag; if (valuemask & WNN_ENV_KAKKO_MASK) env->kakko_mode = henv->kakko_flag; if (valuemask & WNN_ENV_KIGOU_MASK) env->kigou_mode = henv->kigou_flag; } if (!(valuemask & ~WNN_ENV_LOCAL_MASK)) { UnlockMutex(&(env_js_lock)); return 0; } snd_env_head(env,JS_SET_HENKAN_ENV); put4com(valuemask, env->js_id); /* ÀßÄê¥Ó¥Ã¥È¥Þ¥¹¥¯ */ put4com(henv->last_is_first_flag, env->js_id); /* ºÇ½ª»ÈÍѺÇÍ¥Àè */ put4com(henv->complex_flag, env->js_id); /* Ê£¹ç¸ìÍ¥Àè */ put4com(henv->okuri_learn_flag, env->js_id); /* Á÷¤ê´ð½à³Ø½¬ */ put4com(henv->okuri_flag, env->js_id); /* Á÷¤ê´ð½à½èÍý */ put4com(henv->prefix_learn_flag, env->js_id); /* ÀÜÆ¬¸ì³Ø½¬ */ put4com(henv->prefix_flag, env->js_id); /* ÀÜÆ¬¸ì¸õÊä */ put4com(henv->suffix_learn_flag, env->js_id); /* ÀÜÈø¸ì³Ø½¬ */ put4com(henv->common_learn_flag, env->js_id); /* ÈÆÍÑ¸ì³Ø½¬ */ put4com(henv->freq_func_flag, env->js_id); /* ÉÑÅپ徺³ÎΨ´Ø¿ô */ put4com(henv->numeric_flag, env->js_id); /* µ¿»÷¿ô»ú¤Î½é´üɽ¼¨ÊýË¡ */ put4com(henv->alphabet_flag, env->js_id); /* µ¿»÷¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤Î½é´üɽ¼¨ÊýË¡ */ put4com(henv->symbol_flag, env->js_id); /* µ¿»÷µ­¹æ¤Î½é´üɽ¼¨ÊýË¡ */ put4com(henv->yuragi_flag, env->js_id); /* Ĺ²»¡¦¤æ¤é¤®½èÍý */ put4com(henv->rendaku_flag, env->js_id); /* Ï¢Âù½èÍý */ put4com(henv->bunsetsugiri_flag, env->js_id); /* ʸÀáÀÚ¤ê³Ø½¬¥â¡¼¥É */ put4com(henv->muhenkan_flag, env->js_id); /* ̵ÊÑ´¹³Ø½¬¥â¡¼¥É */ put4com(henv->fi_relation_learn_flag, env->js_id); /* £Æ£É´Ø·¸³Ø½¬¥â¡¼¥É */ put4com(henv->fi_freq_func_flag, env->js_id); /* £Æ£É´Ø·¸ÉÑÅپ徺³ÎΨ´Ø¿ô */ snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1){ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return -1; } if (valuemask & WNN_ENV_BUNSETSUGIRI_LEARN_MASK) env->bunsetsugiri_mode = henv->bunsetsugiri_flag; if (valuemask & WNN_ENV_MUHENKAN_LEARN_MASK) env->muhenkan_mode = henv->muhenkan_flag; UnlockMutex(&(env_js_lock)); return 0; } /* End of js_set_henkan_env */ /*:::DOC_START * * Function Name: js_set_henkan_hinsi * Description : ÊÑ´¹¤Ë¡Ê»ÈÍÑ¡¿ÉÔ»ÈÍѡˤ¹¤ëÉʻ췲¤òÀßÄꤹ¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * mode : (In) ÀßÄê¥â¡¼¥É¡Ê0 == ÀäÂÐÀßÄê, else ÁêÂÐÀßÄê¡Ë * nhinsi : (In) ÀßÄêÉÊ»ì¿ô¡ÊÉé == ÉÔ»ÈÍÑ, Àµ »ÈÍÑ¡Ë * hlist : (In) ÀßÄêÉÊ»ì¥ê¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_set_henkan_hinsi(env,mode,nhinsi,hlist) struct wnn_env *env; int mode, nhinsi, *hlist; { register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_SET_HENKAN_HINSI); put4com(mode, env->js_id); put4com(nhinsi, env->js_id); for(x = 0; x < abs(nhinsi); x++) put4com(hlist[x], env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1){ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return -1; } UnlockMutex(&(env_js_lock)); return 0; } /** js_param_get **/ /** env ¤Ç¼¨¤µ¤ì¤ë´Ä¶­¤ÎÊÑ´¹ parameter ¤ò¼è¤ê½Ð¤¹¡£ **/ int js_param_get(env,para) struct wnn_env *env; register struct wnn_param *para; { if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_PARAM_GET); snd_flush(env->js_id); if(get4com(env->js_id) == -1){ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return -1; } para->n=get4com(env->js_id); /* £Î(Âç)ʸÀá²òÀϤΣΠ*/ para->nsho=get4com(env->js_id); /* ÂçʸÀáÃæ¤Î¾®Ê¸Àá¤ÎºÇÂç¿ô */ para->p1=get4com(env->js_id); /* ´´¸ì¤ÎÉÑÅ٤Υѥé¥á¡¼¥¿ */ para->p2=get4com(env->js_id); /* ¾®Ê¸ÀáĹ¤Î¥Ñ¥é¥á¡¼¥¿ */ para->p3=get4com(env->js_id); /* ´´¸ìĹ¤Î¥Ñ¥é¥á¡¼¥¿ */ para->p4=get4com(env->js_id); /* º£»È¤Ã¤¿¤è¥Ó¥Ã¥È¤Î¥Ñ¥é¥á¡¼¥¿ */ para->p5=get4com(env->js_id); /* ¼­½ñ¤Î¥Ñ¥é¥á¡¼¥¿ */ para->p6=get4com(env->js_id); /* ¾®Ê¸Àá¤Îɾ²ÁÃͤΥѥé¥á¡¼¥¿ */ para->p7=get4com(env->js_id); /* ÂçʸÀáĹ¤Î¥Ñ¥é¥á¡¼¥¿ */ para->p8=get4com(env->js_id); /* ¾®Ê¸Àá¿ô¤Î¥Ñ¥é¥á¡¼¥¿ */ para->p9=get4com(env->js_id); /* µ¿»÷ÉÊ»ì ¿ô»ú¤ÎÉÑÅÙ */ para->p10=get4com(env->js_id); /* µ¿»÷ÉÊ»ì ¥«¥Ê¤ÎÉÑÅÙ */ para->p11=get4com(env->js_id); /* µ¿»÷ÉÊ»ì ±Ñ¿ô¤ÎÉÑÅÙ */ para->p12=get4com(env->js_id); /* µ¿»÷ÉÊ»ì µ­¹æ¤ÎÉÑÅÙ */ para->p13=get4com(env->js_id); /* µ¿»÷ÉÊ»ì Êijç¸Ì¤ÎÉÑÅÙ */ para->p14=get4com(env->js_id); /* µ¿»÷ÉÊ»ì ÉÕ°¸ì¤ÎÉÑÅÙ */ para->p15=get4com(env->js_id); /* µ¿»÷ÉÊ»ì ³«³ç¸Ì¤ÎÉÑÅÙ */ UnlockMutex(&(env_js_lock)); return 0; } /*:::DOC_START * * Function Name: js_get_henkan_env * Description : ¥µ¡¼¥ÐÆâ¤ÎÊÑ´¹´Ä¶­¤òÆÀ¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * henv : (Out) ÊÑ´¹´Ä¶­¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_get_henkan_env(env,henv) struct wnn_env *env; register struct wnn_henkan_env *henv; { if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_GET_HENKAN_ENV); snd_flush(env->js_id); if(get4com(env->js_id) == -1){ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return -1; } henv->last_is_first_flag=get4com(env->js_id); /* ºÇ½ª»ÈÍѺÇÍ¥Àè */ henv->complex_flag=get4com(env->js_id); /* Ê£¹ç¸ìÍ¥Àè */ henv->okuri_learn_flag=get4com(env->js_id); /* Á÷¤ê´ð½à³Ø½¬ */ henv->okuri_flag=get4com(env->js_id); /* Á÷¤ê´ð½à½èÍý */ henv->prefix_learn_flag=get4com(env->js_id); /* ÀÜÆ¬¸ì³Ø½¬ */ henv->prefix_flag=get4com(env->js_id); /* ÀÜÆ¬¸ì¸õÊä */ henv->suffix_learn_flag=get4com(env->js_id); /* ÀÜÈø¸ì³Ø½¬ */ henv->common_learn_flag=get4com(env->js_id); /* ÈÆÍÑ¸ì³Ø½¬ */ henv->freq_func_flag=get4com(env->js_id); /* ÉÑÅپ徺³ÎΨ´Ø¿ô */ henv->numeric_flag=get4com(env->js_id); /* µ¿»÷¿ô»ú¤Î½é´üɽ¼¨ÊýË¡ */ henv->alphabet_flag=get4com(env->js_id); /* µ¿»÷¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤Î½é´üɽ¼¨ÊýË¡ */ henv->symbol_flag=get4com(env->js_id); /* µ¿»÷µ­¹æ¤Î½é´üɽ¼¨ÊýË¡ */ henv->yuragi_flag=get4com(env->js_id); /* Ĺ²»¡¦¤æ¤é¤®½èÍý */ henv->rendaku_flag=get4com(env->js_id); /* Ï¢Âù½èÍý */ henv->bunsetsugiri_flag=get4com(env->js_id); /* ʸÀáÀÚ¤ê³Ø½¬¥â¡¼¥É */ henv->muhenkan_flag=get4com(env->js_id); /* ̵ÊÑ´¹³Ø½¬¥â¡¼¥É */ henv->fi_relation_learn_flag=get4com(env->js_id); /* £Æ£É´Ø·¸³Ø½¬¥â¡¼¥É */ henv->fi_freq_func_flag=get4com(env->js_id); /* £Æ£É´Ø·¸ÉÑÅپ徺³ÎΨ´Ø¿ô */ env->bunsetsugiri_mode = henv->bunsetsugiri_flag; env->muhenkan_mode = henv->muhenkan_flag; henv->kutouten_flag = env->kutouten_mode; /* ¶çÆÉÅÀ */ henv->kakko_flag = env->kakko_mode; /* ³ç¸Ì */ henv->kigou_flag = env->kigou_mode; /* µ­¹æ */ UnlockMutex(&(env_js_lock)); return 0; } /* End of js_get_henkan_env */ /*:::DOC_START * * Function Name: js_get_henkan_env_local * Description : ÊÑ´¹¤Î´Ä¶­¤ÎÆâ¡¤¥é¥¤¥Ö¥é¥ê¤Ë¤¢¤ë¤â¤Î¤ò¼è¤ë * ¶çÆÉÅÀ¡¤³ç¸Ì¡¤µ­¹æ * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * henv : (In) ÊÑ´¹´Ä¶­¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Seiji KUWARI * * Revision history: * *:::DOC_END */ int js_get_henkan_env_local(env,henv) struct wnn_env *env; register struct wnn_henkan_env *henv; { if(env==0) return(-1); LockMutex(&(env_js_lock)); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } henv->kutouten_flag = env->kutouten_mode; /* ¶çÆÉÅÀ */ henv->kakko_flag = env->kakko_mode; /* ³ç¸Ì */ henv->kigou_flag = env->kigou_mode; /* µ­¹æ */ UnlockMutex(&(env_js_lock)); return 0; } /*:::DOC_START * * Function Name: js_get_henkan_hinsi * Description : ÊÑ´¹¤Ë¡Ê»ÈÍÑ¡¿ÉÔ»ÈÍѡˤ¹¤ëÉʻ췲¤òÆÀ¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * nhinsi : (Out) ÀßÄêÉÊ»ì¿ô¡ÊÉé == ÉÔ»ÈÍÑ, Àµ »ÈÍÑ¡Ë * hlist : (Out) ÀßÄêÉÊ»ì¥ê¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_get_henkan_hinsi(env,nhinsi,hlist) struct wnn_env *env; int *nhinsi, **hlist; { int i; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_GET_HENKAN_HINSI); snd_flush(env->js_id); if(get4com(env->js_id) == -1){ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return -1; } *nhinsi = get4com(env->js_id); if(((*hlist) = (int *)malloc(abs(*nhinsi) * sizeof(int))) == NULL) { int dummy; for(i = 0; i < abs(*nhinsi); i++) dummy = get4com(env->js_id); env_wnn_errorno_set = WNN_ALLOC_FAIL; UnlockMutex(&(env_js_lock)); return -1; } for(i = 0; i < abs(*nhinsi); i++) (*hlist)[i] = get4com(env->js_id); UnlockMutex(&(env_js_lock)); return 0; } /* End of js_get_henkan_hinsi */ /* global File Operation */ /** js_mkdir **/ int js_mkdir(env,path) struct wnn_env *env; char *path; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_MKDIR); putscom(path, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /** js_access **/ int js_access(env,path,amode) struct wnn_env *env; char *path; int amode; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_ACCESS); put4com(amode, env->js_id); putscom(path, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /** js_file_list_all **/ static int rcv_file_list(); int js_file_list_all(server,ret) WNN_JSERVER_ID *server; struct wnn_ret_buf *ret; { int x; set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } snd_server_head(server,JS_FILE_LIST_ALL); snd_flush(server); x = rcv_file_list(ret, server); UnlockMutex(&(server_js_lock)); return x; } /** js_file_list **/ int js_file_list(env,ret) struct wnn_env *env; struct wnn_ret_buf *ret; { int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FILE_LIST); snd_flush(env->js_id); x = rcv_file_list(ret, env->js_id); UnlockMutex(&(env_js_lock)); return x; } static void re_alloc(); static int rcv_file_list(ret, server) struct wnn_ret_buf *ret; ARGS *server; {register int i,count; WNN_FILE_INFO_STRUCT *files; count=get4com(server); re_alloc(ret,sizeof(WNN_FILE_INFO_STRUCT)*count); files=(WNN_FILE_INFO_STRUCT *)ret->buf; for(i=0;ifid= get4com(server); files->localf= get4com(server); files->ref_count= get4com(server); files->type= get4com(server); getscom(files->name, server, WNN_F_NAMELEN); files++; } return count; } /** js_file_stat **/ int js_file_stat(env,path, s) struct wnn_env *env; char *path; WNN_FILE_STAT *s; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FILE_STAT); putscom(path, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); UnlockMutex(&(env_js_lock)); s->type = x; return x; } /** js_file_info **/ int js_file_info(env,fid,file) struct wnn_env *env; int fid; register WNN_FILE_INFO_STRUCT *file; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FILE_INFO); put4com(fid, env->js_id); snd_flush(env->js_id); file->fid= fid; x=get4com(env->js_id); if(x==-1){ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } getscom(file->name, env->js_id, WNN_F_NAMELEN); file->localf= get4com(env->js_id); file->ref_count= get4com(env->js_id); file->type= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return 0; } /** js_file_loaded **/ int js_file_loaded(server,path) WNN_JSERVER_ID *server; char *path; {register int x; set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } snd_server_head(server,JS_FILE_LOADED); putscom(path, server); snd_flush(server); x=get4com(server); UnlockMutex(&(server_js_lock)); return x; } /** js_file_loaded_local **/ static int check_local_file(); static int file_loaded_local(); static int js_file_loaded_local_body(server,path) WNN_JSERVER_ID *server; char *path; {int x; handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { return(-1); } if(check_local_file(path, server) == -1) return (-1); snd_server_head(server, JS_FILE_LOADED_LOCAL); x=file_loaded_local(path, server); return x; } int js_file_loaded_local(server,path) WNN_JSERVER_ID *server; char *path; { int x; set_current_js(server); LockMutex(&(server_js_lock)); x = js_file_loaded_local_body(server,path); UnlockMutex(&(server_js_lock)); return x; } static int check_local_file(path, server) char *path; ARGS *server; { register FILE *f; register int x; struct wnn_file_head fh; int is_compressed; #ifdef WRITE_CHECK check_backup(path, NULL); #endif /* WRITE_CHECK */ f=dic_fopen(path,"r", &is_compressed); if(f == NULL){ js_wnn_errorno_set = WNN_OPENF_ERR; return -1; } x=input_file_header(f, &fh, NULL); if(x==-1){ dic_fclose(f, is_compressed); js_wnn_errorno_set = WNN_NOT_A_FILE; return -1; } if(dic_check_inode(f, &fh, path, is_compressed) == -1){ change_file_uniq(&fh, path, NULL); #ifdef WRITE_CHECK dic_fclose(f, is_compressed); f=dic_fopen(path,"r", &is_compressed); if(f == NULL){ js_wnn_errorno_set = WNN_OPENF_ERR; return (-1); } #endif /* WRITE_CHECK */ if(dic_check_inode(f, &fh, path, is_compressed) == -1){ dic_fclose(f, is_compressed); js_wnn_errorno_set = WNN_INODE_CHECK_ERROR; return (-1); } } dic_fclose(f, is_compressed); return 0; } static int file_loaded_local(path, server) char *path; ARGS *server; {register int x,i; FILE *f; struct wnn_file_head fh; int is_compressed; #ifdef WRITE_CHECK check_backup(path, NULL); #endif /* WRITE_CHECK */ f=dic_fopen(path,"r", &is_compressed); if(f == NULL){ js_wnn_errorno_set = WNN_OPENF_ERR; return -1; } x=input_file_header(f, &fh, NULL); if(x==-1){ dic_fclose(f, is_compressed); js_wnn_errorno_set = WNN_NOT_A_FILE; return -1; } put4com(fh.file_uniq.time, server); put4com(fh.file_uniq.dev, server); put4com(fh.file_uniq.inode, server); for(i=0;ijs_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_HINDO_FILE_CREATE); put4com(fid, env->js_id); putscom(fn, env->js_id); putwscom(comment, env->js_id); putscom(hpasswd, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /*:::DOC_START * * Function Name: js_fi_hindo_file_create * Description : ¥µ¡¼¥Ð¦¤Ë£Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * fid : (In) Âбþ£Æ£É´Ø·¸¼­½ñ¥Õ¥¡¥¤¥ë£É£Ä * fn : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë̾ * comment : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¥³¥á¥ó¥È * hpasswd : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¥Ñ¥¹¥ï¡¼¥É * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_fi_hindo_file_create(env, fid, fn, comment, hpasswd) struct wnn_env *env; int fid; char *fn; w_char *comment; char *hpasswd; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FI_HINDO_FILE_CREATE); put4com(fid, env->js_id); putscom(fn, env->js_id); putwscom(comment, env->js_id); putscom(hpasswd, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /* End of js_fi_hindo_file_create */ /*:::DOC_START * * Function Name: js_dic_file_create * Description : ¥µ¡¼¥Ð¦¤Ë¼­½ñ¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * fn : (In) ºîÀ®¼­½ñ¥Õ¥¡¥¤¥ë̾ * type : (In) ºîÀ®¼­½ñ¥Õ¥¡¥¤¥ë¥¿¥¤¥× * comment : (In) ºîÀ®¼­½ñ¥Õ¥¡¥¤¥ë¥³¥á¥ó¥È * passwd (In) ºîÀ®¼­½ñ¥Õ¥¡¥¤¥ë¥Ñ¥¹¥ï¡¼¥É * hpasswd : (In) ºîÀ®¼­½ñÆâÉÑÅ٥ѥ¹¥ï¡¼¥É * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_dic_file_create(env, fn, type, comment, passwd, hpasswd) struct wnn_env *env; char *fn; w_char *comment; char *passwd, *hpasswd; int type; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_DIC_FILE_CREATE); putscom(fn, env->js_id); putwscom(comment, env->js_id); putscom(passwd, env->js_id); putscom(hpasswd, env->js_id); put4com(type, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /* End of js_dic_file_create */ /** js_file_discard **/ int js_file_discard(env,fid) struct wnn_env *env; int fid; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FILE_DISCARD); put4com(fid, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /** js_file_read **/ int js_file_read(env,fn) struct wnn_env *env; char *fn; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FILE_READ); putscom(fn, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /** js_file_write **/ int js_file_write(env,fid,fn) struct wnn_env *env; int fid; char *fn; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FILE_WRITE); put4com(fid, env->js_id); putscom(fn, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /** js_file_receive **/ static int xget1com(); static void xput1com(); int js_file_receive(env,fid,fn) struct wnn_env *env; int fid; char *fn; {register int mode, x; char file_name[1024]; char buf[1024]; FILE *f; int n; struct wnn_file_head fh; int i; #ifdef WRITE_CHECK char *tmp = NULL, *backup = NULL, tmp_x; int tmp_err = 0; #endif /* WRITE_CHECK */ int is_compressed; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FILE_RECEIVE); put4com(fid, env->js_id); snd_flush(env->js_id); /**/ getscom(file_name, env->js_id, sizeof(file_name)); if(fn ==NULL || strcmp(fn,"")==0){ gethostname(buf, 1024); n = strlen(buf); buf[n] = C_LOCAL; buf[n+1] = 0; if(strncmp(buf, file_name, n + 1) == 0){ fn = file_name + n + 1; } } #ifdef WRITE_CHECK check_backup(fn, NULL); #endif /* WRITE_CHECK */ if((f = dic_fopen(fn, "r", &is_compressed)) == NULL){ /* New File */ fh.file_uniq.time = fh.file_uniq.dev = fh.file_uniq.inode = 0; }else{ /* Old File Exists */ if(input_file_header(f, &fh, NULL) == -1){ env_wnn_errorno_set=WNN_NOT_A_FILE; dic_fclose(f, is_compressed); put4com(-1, env->js_id);snd_flush(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } if( is_compressed ){ env_wnn_errorno_set=NOT_SUPPORTED_OPERATION; dic_fclose(f, is_compressed); put4com(-1, env->js_id);snd_flush(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } dic_fclose(f, is_compressed); } put4com(0, env->js_id); /* Ack */ put4com(fh.file_uniq.time, env->js_id); put4com(fh.file_uniq.dev, env->js_id); put4com(fh.file_uniq.inode, env->js_id); for(i=0;ijs_id); } snd_flush(env->js_id); if((mode=get4com(env->js_id))==-1){ /* check stat */ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return -1; }else if(mode==0){ UnlockMutex(&(env_js_lock)); return 0; /* need not saving */ }else if(mode == 1 || mode == 3){ /* mode == 3 means the file is a new one. */ #ifdef WRITE_CHECK backup = make_backup_file(fn, NULL); if ((tmp = make_tmp_file(fn, 0, &f, NULL)) == NULL) { delete_tmp_file(backup); #else /* WRITE_CHECK */ if((f = fopen(fn, "w+")) == NULL){ #endif /* WRITE_CHECK */ env_wnn_errorno_set=WNN_FILE_WRITE_ERROR; put4com(-1, env->js_id);snd_flush(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } }else if(mode == 2){ #ifdef WRITE_CHECK backup = make_backup_file(fn, NULL); if ((tmp = make_tmp_file(fn, 1, &f, NULL)) == NULL) { delete_tmp_file(backup); #else /* WRITE_CHECK */ if((f = fopen(fn, "r+")) == NULL){ /* New File */ #endif /* WRITE_CHECK */ env_wnn_errorno_set=WNN_FILE_WRITE_ERROR; put4com(-1, env->js_id);snd_flush(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } } put4com(0, env->js_id); snd_flush(env->js_id); /* ACK */ for(;;){ if((x=xget1com(env->js_id))== -1) break; /* EOF */ #ifdef WRITE_CHECK tmp_x = (char)x; if (fwrite(&tmp_x, sizeof(char), 1, f) == -1) tmp_err = 1; #else /* WRITE_CHECK */ fputc(x,f); #endif /* WRITE_CHECK */ } fclose(f); #ifdef WRITE_CHECK if (tmp_err == 0) { move_tmp_to_org(tmp, fn, 1); } else { delete_tmp_file(tmp); } delete_tmp_file(backup); #endif /* WRITE_CHECK */ x=get4com(env->js_id); if(x==-1) env_wnn_errorno_set= get4com(env->js_id); #ifdef WRITE_CHECK if (tmp_err) { env_wnn_errorno_set = WNN_FILE_WRITE_ERROR; UnlockMutex(&(env_js_lock)); return(-1); } #endif /* WRITE_CHECK */ UnlockMutex(&(env_js_lock)); return x; } static int xget1com(server) ARGS *server; {register int x; if((x= get1com(server)) != 0xFF) return x; if(get1com(server) == 0xFF) return -1; /* EOF */ return 0xFF; } /** js_file_send **/ int js_file_send(env,fn) struct wnn_env *env; char *fn; {register int x; FILE *f; int n; char buf[1024],*b; register int cc,i; int is_compressed; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } if(check_local_file(fn, env->js_id) == -1) { UnlockMutex(&(env_js_lock)); return (-1); } snd_env_head(env,JS_FILE_SEND); x=file_loaded_local(fn, env->js_id); if(x!= -1){ /* file is already loaded */ if(get4com(env->js_id) == -1) { env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } return x; UnlockMutex(&(env_js_lock)); } x=get4com(env->js_id); if(x==-1){ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return -1; } gethostname(buf, 1024); n = strlen(buf); buf[n] = C_LOCAL; strcpy(buf + n + 1,fn); putscom(buf, env->js_id); #ifdef WRITE_CHECK check_backup(fn, NULL); #endif /* WRITE_CHECK */ if((f=dic_fopen(fn,"r", &is_compressed))== NULL){ xput1com(-1, env->js_id); /* EOF */ UnlockMutex(&(env_js_lock)); return -1; } /* send contents of file */ for(;;){ cc = fread(buf,1,1024,f); if(cc <= 0) break; /* EOF */ for(b=buf,i=0;ijs_id); } } dic_fclose(f, is_compressed); xput1com(-1, env->js_id); /* EOF */ snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1) env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } static void xput1com(d, server) int d; ARGS *server; { if(d == -1){ put1com(0xFF, server); put1com(0xFF, server); return;/* EOF */} put1com(d, server); if(d == 0xFF){ put1com(0x00, server);} } /*** Dic. Operation for Env. ***/ /** js_dic_add **/ static int js_dic_add_body(env,fid,hfid,rev, jnice,rw,hrw, pw1, pw2) struct wnn_env *env; int fid,hfid,rev,jnice,rw,hrw; char *pw1, *pw2; {register int x; snd_env_head(env,JS_DIC_ADD); put4com(fid, env->js_id); put4com(hfid, env->js_id); put4com(jnice, env->js_id); put4com(rw, env->js_id); put4com(hrw, env->js_id); putscom(pw1, env->js_id); putscom(pw2, env->js_id); put4com(rev, env->js_id); /* rev is to add it as reverse dict */ snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); return x; } int js_dic_add(env,fid,hfid,rev, jnice,rw,hrw, pw1, pw2) struct wnn_env *env; int fid,hfid,rev,jnice,rw,hrw; char *pw1, *pw2; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } x = js_dic_add_body(env,fid,hfid,rev, jnice,rw,hrw, pw1, pw2); UnlockMutex(&(env_js_lock)); return x; } /*:::DOC_START * * Function Name: js_fi_dic_add_body * Description : js_fi_dic_add ¤Î¥µ¥Ö¥ë¡¼¥Á¥ó´Ø¿ô * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * fid : (In) £Æ£É´Ø·¸¼­½ñ¥Õ¥¡¥¤¥ë£É£Ä * hfid : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë£É£Ä * suflag : (In) ¥·¥¹¥Æ¥à¼­½ñ£ï£ò¥æ¡¼¥¶¼­½ñ * rw : (In) ¼­½ñ¹¹¿·¤¬²Äǽ£ï£òÉÔ²Äǽ * hrw : (In) ÉÑÅÙ¹¹¿·¤¬²Äǽ£ï£òÉÔ²Äǽ * pw1 : (In) £Æ£É´Ø·¸¼­½ñ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¥ï¡¼¥É * pw2 : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¥ï¡¼¥É * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñÈÖ¹æ * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int js_fi_dic_add_body(env, fid, hfid, suflag, rw, hrw, pw1, pw2) struct wnn_env *env; int fid,hfid,suflag,rw,hrw; char *pw1, *pw2; {register int x; snd_env_head(env,JS_FI_DIC_ADD); put4com(fid, env->js_id); put4com(hfid, env->js_id); put4com(suflag, env->js_id); put4com(rw, env->js_id); put4com(hrw, env->js_id); putscom(pw1, env->js_id); putscom(pw2, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); return x; } /* End of js_fi_dic_add_body */ /*:::DOC_START * * Function Name: js_fi_dic_add * Description : ´Ä¶­¤Ë£Æ£É¼­½ñ¤òÄɲ乤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * fid : (In) £Æ£É´Ø·¸¼­½ñ¥Õ¥¡¥¤¥ë£É£Ä * hfid : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë£É£Ä * suflag : (In) ¥·¥¹¥Æ¥à¼­½ñ£ï£ò¥æ¡¼¥¶¼­½ñ * rw : (In) ¼­½ñ¹¹¿·¤¬²Äǽ£ï£òÉÔ²Äǽ * hrw : (In) ÉÑÅÙ¹¹¿·¤¬²Äǽ£ï£òÉÔ²Äǽ * pw1 : (In) £Æ£É´Ø·¸¼­½ñ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¥ï¡¼¥É * pw2 : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¥ï¡¼¥É * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñÈÖ¹æ * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_fi_dic_add(env, fid, hfid, suflag, rw, hrw, pw1, pw2) struct wnn_env *env; int fid,hfid,suflag,rw,hrw; char *pw1, *pw2; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } /* call sub routine function */ x = js_fi_dic_add_body(env, fid, hfid, suflag, rw, hrw, pw1, pw2); UnlockMutex(&(env_js_lock)); return x; } /* End of js_fi_dic_add */ /** js_dic_delete **/ int js_dic_delete(env,dicno) struct wnn_env *env; int dicno; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_DIC_DELETE); put4com(dicno, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /** js_dic_use **/ int js_dic_use(env,dic_no,flag) struct wnn_env *env; int dic_no,flag; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_DIC_USE); put4com(dic_no, env->js_id); put4com(flag, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /** js_fuzokugo_set **/ int js_fuzokugo_set(env,fid) struct wnn_env *env; int fid; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FUZOKUGO_SET); put4com(fid, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /** js_fuzokugo_get **/ int js_fuzokugo_get(env) struct wnn_env *env; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FUZOKUGO_GET); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } static int rcv_dic_list(); static void get_dic_info(); /*:::DOC_START * * Function Name: js_dic_list_all * Description : »ØÄꤵ¤ì¤¿¥µ¡¼¥Ð¤ÎÁ´´Ä¶­¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë£×£î£î¼­½ñ¤Î * ¾ðÊó¤òÊÖ¤¹ * Parameter : * server : (In) ¥µ¡¼¥Ð¤Ø¤Î¥Ý¥¤¥ó¥¿ * ret : (Out) ¥Ç¡¼¥¿¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñ¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_dic_list_all(server,ret) WNN_JSERVER_ID *server; struct wnn_ret_buf *ret; { int x; set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } snd_server_head(server,JS_DIC_LIST_ALL); snd_flush(server); x = rcv_dic_list(ret, server); UnlockMutex(&(server_js_lock)); return x; } /* End of js_dic_list_all */ /*:::DOC_START * * Function Name: js_dic_list * Description : »ØÄꤵ¤ì¤¿´Ä¶­¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë£×£î£î¼­½ñ¤Î¾ðÊó¤òÊÖ¤¹ * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * ret : (Out) ¥Ç¡¼¥¿¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñ¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_dic_list(env,ret) struct wnn_env *env; struct wnn_ret_buf *ret; { int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_DIC_LIST); snd_flush(env->js_id); x = rcv_dic_list(ret, env->js_id); UnlockMutex(&(env_js_lock)); return x; } /* End of js_dic_list */ /*:::DOC_START * * Function Name: js_fi_dic_list_all * Description : »ØÄꤵ¤ì¤¿¥µ¡¼¥Ð¤ÎÁ´´Ä¶­¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¼­½ñ¤ÎÆâ¡¢ * »ØÄꤵ¤ì¤¿¼­½ñ·²¤Î¾ðÊó¤òÊÖ¤¹ * Parameter : * server : (In) ¥µ¡¼¥Ð¤Ø¤Î¥Ý¥¤¥ó¥¿ * dmask : (In) ¼­½ñ·²ÀßÄê¥Þ¥¹¥¯ * ret : (Out) ¥Ç¡¼¥¿¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñ¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_fi_dic_list_all(server, dmask, ret) WNN_JSERVER_ID *server; unsigned long dmask; struct wnn_ret_buf *ret; { int x; set_current_js(server); /* ¥µ¡¼¥Ð¤¬ FI-Wnn ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ê¤é¡¢½¾Íè¤Î dic_list Ì¿Îá¤òÁ÷¤ë */ if(!CHECK_FI) return(js_dic_list_all(server, ret)); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } snd_server_head(server,JS_FI_DIC_LIST_ALL); put4com(dmask, server); snd_flush(server); x = rcv_dic_list(ret, server); UnlockMutex(&(server_js_lock)); return x; } /* End of js_fi_dic_list_all */ /*:::DOC_START * * Function Name: js_fi_dic_list * Description : »ØÄꤵ¤ì¤¿´Ä¶­¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¼­½ñ¤ÎÆâ¡¢ * »ØÄꤵ¤ì¤¿¼­½ñ·²¤Î¾ðÊó¤òÊÖ¤¹ * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * dmask : (In) ¼­½ñ·²ÀßÄê¥Þ¥¹¥¯ * ret : (Out) ¥Ç¡¼¥¿¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñ¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_fi_dic_list(env, dmask, ret) struct wnn_env *env; unsigned long dmask; struct wnn_ret_buf *ret; { int x; if(env==0) return(-1); set_current_js(env->js_id); /* ¥µ¡¼¥Ð¤¬ FI-Wnn ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ê¤é¡¢½¾Íè¤Î dic_list Ì¿Îá¤òÁ÷¤ë */ if(!CHECK_FI) return(js_dic_list(env, ret)); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FI_DIC_LIST); put4com(dmask, env->js_id); snd_flush(env->js_id); x = rcv_dic_list(ret, env->js_id); UnlockMutex(&(env_js_lock)); return x; } /* End of js_fi_dic_list */ /*:::DOC_START * * Function Name: rcv_dic_list * Description : ¼­½ñ¾ðÊó¼õ¤±¼è¤êÍѹ½Â¤ÂΤÎÎΰè¤ò³ÎÊݤ¹¤ë * Parameter : * ret : (Out) ¥Ç¡¼¥¿¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * server : (In) ¥µ¡¼¥Ð¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñ¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int rcv_dic_list(ret, server) struct wnn_ret_buf *ret; ARGS *server; {register int i,count; register WNN_DIC_INFO *dic; if((count=get4com(server)) == -1) { js_wnn_errorno_set = get4com(server); return(-1); } re_alloc(ret, sizeof(WNN_DIC_INFO)*(count + 1)); dic=(WNN_DIC_INFO *)ret->buf; for(i=0;idic_no = -1; return count; } /* End of rcv_dic_list */ /*:::DOC_START * * Function Name: get_dic_info * Description : ¼­½ñ¾ðÊó¤ò¥µ¡¼¥Ð¤«¤é¼õ¤±¼è¤ë * Parameter : * dic : (Out) ¼­½ñ¾ðÊó¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * server : (In) ¥µ¡¼¥Ð¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñ¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static void get_dic_info(dic, server) register WNN_DIC_INFO *dic; ARGS *server; { dic->dic_no =get4com(server); /* dic_No */ dic->body =get4com(server); /* body fid */ dic->hindo =get4com(server); /* hindo fid */ dic->rw =get4com(server); /* r/w */ dic->hindo_rw =get4com(server); /* hindo r/w */ dic->enablef =get4com(server); /* enable/disable */ dic->nice =get4com(server); /* nice */ dic->rev = get4com(server); /* added H.T */ getwscom(dic->comment, server, WNN_COMMENT_LEN); getscom(dic->fname, server, WNN_F_NAMELEN); getscom(dic->hfname, server, WNN_F_NAMELEN); getscom(dic->passwd, server, WNN_PASSWD_LEN); getscom(dic->hpasswd, server, WNN_PASSWD_LEN); dic->type = get4com(server); dic->gosuu = get4com(server); dic->localf = get4com(server); dic->hlocalf = get4com(server); } /* End of get_dic_info */ /*:::DOC_START * * Function Name: rcv_fzk_list * Description : ÉÕ°¸ì¾ðÊó¼õ¤±¼è¤êÍѹ½Â¤ÂΤÎÎΰè¤ò³ÎÊݤ·¡¢ * ¥µ¡¼¥Ð¤«¤é¾ðÊó¤ò¼õ¤±¼è¤ë * Parameter : * curfzk : (Out) ¸½ºß»ÈÍÑ¥Õ¥¡¥¤¥ë¼±ÊÌ»Ò * ret : (Out) ÉÕ°¸ì¾ðÊó¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * server : (In) ¥µ¡¼¥Ð¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : -1==ERROR, else ÆÉ¹þ¤ßÉÕ°¸ì¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int rcv_fzk_list(curfzk, ret, server) int *curfzk; WNN_FZK_INFO **ret; ARGS *server; { register int i, count; register WNN_FZK_INFO *fzk; /* ÆÉ¹þ¤ßÉÕ°¸ì¿ô¡¦¸½ºß»ÈÍÑ¥Õ¥¡¥¤¥ë¼±Ê̻Ҥò¼õ¤±¼è¤ë */ if((count = get4com(server)) == -1) { js_wnn_errorno_set = get4com(server); return(-1); } *curfzk = get4com(server); /* ¾ðÊó¼õ¤±¼è¤êÍѹ½Â¤ÂΤÎÎΰè¤ò³ÎÊݤ¹¤ë */ if(((*ret) = (WNN_FZK_INFO *)malloc((count + 1) * sizeof(WNN_FZK_INFO))) == NULL) { WNN_FZK_INFO dummy; for(i = 0; i < count; i++){ getwscom(dummy.comment, server, WNN_COMMENT_LEN); getscom(dummy.fname, server, WNN_F_NAMELEN); } js_wnn_errorno_set = WNN_ALLOC_FAIL; return(-1); } fzk = (WNN_FZK_INFO *)*ret; /* ÉÕ°¸ì¾ðÊó¤ò¼õ¤±¼è¤ë */ for(i = 0; i < count; i++){ getwscom(fzk->comment, server, WNN_COMMENT_LEN); getscom(fzk->fname, server, WNN_F_NAMELEN); fzk++; } fzk->fname[0] = 0; return count; } /* End of rcv_fzk_list */ /*:::DOC_START * * Function Name: js_fuzokugo_list * Description : »ØÄꤵ¤ì¤¿¥µ¡¼¥Ð¤ËÆÉ¤ß¹þ¤Þ¤ì¤Æ¤¤¤ëÁ´ÉÕ°¸ì¾ðÊó¤È * ´Ä¶­¤Ë¸½ºßÀßÄꤵ¤ì¤Æ¤¤¤ë¾ðÊó¤Î¼±Ê̻ҤòÊÖ¤¹ * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * curfzk : (Out) ¸½ºß»ÈÍÑ¥Õ¥¡¥¤¥ë¼±ÊÌ»Ò * ret : (Out) ÉÕ°¸ì¾ðÊó¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : -1==ERROR, else ÆÉ¹þ¤ßÉÕ°¸ì¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_fuzokugo_list(env, curfzk, ret) struct wnn_env *env; int *curfzk; WNN_FZK_INFO **ret; { register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FUZOKUGO_LIST); snd_flush(env->js_id); x = rcv_fzk_list(curfzk, ret, env->js_id); UnlockMutex(&(env_js_lock)); return x; } /* End of js_fuzokugo_list */ /*** Dic. Operation by dic_No. ***/ /** js_word_add **/ int js_word_add(env,dic_no,yomi,kanji,comment,hinshi,init_hindo) struct wnn_env *env; int dic_no; w_char *yomi,*kanji,*comment; int hinshi,init_hindo; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_WORD_ADD); put4com(dic_no, env->js_id); putwscom(yomi, env->js_id); putwscom(kanji, env->js_id); putwscom(comment, env->js_id); put4com(hinshi, env->js_id); put4com(init_hindo, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /** js_word_delete **/ int js_word_delete(env,dic_no,entry) struct wnn_env *env; int dic_no; int entry; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_WORD_DELETE); put4com(dic_no, env->js_id); put4com(entry, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1)env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /** js_word_search **/ static int rcv_word_data(); int js_word_search(env,dic_no,yomi,ret) struct wnn_env *env; int dic_no; w_char *yomi; struct wnn_ret_buf *ret; { int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_WORD_SEARCH); put4com(dic_no, env->js_id); putwscom(yomi, env->js_id); snd_flush(env->js_id); x = rcv_word_data(ret, yomi, env->js_id); UnlockMutex(&(env_js_lock)); return x; } /** js_word_search_by_env **/ int js_word_search_by_env(env,yomi,ret) struct wnn_env *env; w_char *yomi; struct wnn_ret_buf *ret; { int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_WORD_SEARCH_BY_ENV); putwscom(yomi, env->js_id); snd_flush(env->js_id); x = rcv_word_data(ret, yomi, env->js_id); UnlockMutex(&(env_js_lock)); return x; } /** js_word_info **/ int js_word_info(env,dic_no,entry,ret) struct wnn_env *env; int dic_no,entry; struct wnn_ret_buf *ret; {register int x; w_char yomi[LENGTHYOMI]; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_WORD_INFO); put4com(dic_no, env->js_id); put4com(entry, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1){ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } getwscom(yomi, env->js_id, sizeof(yomi) / sizeof(w_char)); rcv_word_data(ret, yomi, env->js_id); UnlockMutex(&(env_js_lock)); return(0); } int js_word_comment_set(env, dic_no, entry, comment) struct wnn_env *env; int dic_no,entry; w_char *comment; { register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_WORD_COMMENT_SET); put4com(dic_no, env->js_id); put4com(entry, env->js_id); putwscom(comment, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1){ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } UnlockMutex(&(env_js_lock)); return(0); } /** rcv for word_search **/ static int rcv_word_data(ret, yomi, server) struct wnn_ret_buf *ret; w_char *yomi; /* Yomi is not sent from server * (at least for the time being). */ ARGS *server; {register int x, j_c,k_c, databytes, wlen; w_char *k; w_char wbuf[LENGTHKANJI]; register struct wnn_jdata *jd; register int cnt, error_flag; j_c = get4com(server); k_c = get4com(server); databytes = sizeof(w_char)*(k_c + j_c * 3 + j_c * wnn_Strlen(yomi)); re_alloc(ret, sizeof(struct wnn_jdata)*(j_c + 1) + databytes); jd=(struct wnn_jdata *)ret->buf; for(cnt = 0;;cnt++){ jd->dic_no = x = get4com(server); if(x==-1) break; jd->serial = get4com(server); jd->hinshi = get4com(server); jd->hindo = get4com(server); jd->ima = get4com(server); jd->int_hindo = get4com(server); jd->int_ima = get4com(server); jd++; } jd++; k= (w_char *)jd; jd=(struct wnn_jdata *)ret->buf; error_flag = 0; for(;;){ if(jd->dic_no==-1) break; if (!error_flag) { wlen = wnn_Strlen(yomi) + 1; if ((wlen * sizeof(w_char)) > databytes) { error_flag = 1; } else { jd->yomi = k; /* Copy Yomi */ wnn_Strcpy(k, yomi); k+= wlen; databytes -= (wlen * sizeof(w_char)); } } getwscom(wbuf, server, sizeof(wbuf) / sizeof(w_char)); if (!error_flag) { wlen = wnn_Strlen(wbuf) + 1; if ((wlen * sizeof(w_char)) > databytes) { error_flag = 1; } else { jd->kanji = k; /* Get Kanji */ wnn_Strcpy(k, wbuf); k+= wlen; databytes -= (wlen * sizeof(w_char)); } } getwscom(wbuf, server, sizeof(wbuf) / sizeof(w_char)); if (!error_flag) { wlen = wnn_Strlen(wbuf) + 1; if ((wlen * sizeof(w_char)) > databytes) { error_flag = 1; } else { jd->com = k; /* Get Comment */ wnn_Strcpy(k, wbuf); k+= wlen; databytes -= (wlen * sizeof(w_char)); } } jd++; } return cnt; } /** js_dic_info **/ int js_dic_info(env,dic_no,ret) struct wnn_env *env; int dic_no; register WNN_DIC_INFO *ret; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_DIC_INFO); put4com(dic_no, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1){ env_wnn_errorno_set = get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } get_dic_info(ret, env->js_id); UnlockMutex(&(env_js_lock)); return dic_no; } /** js_who **/ int js_who(server,ret) WNN_JSERVER_ID *server; struct wnn_ret_buf *ret; {register int i,j,c; WNN_JWHO *w; set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } snd_server_head(server,JS_WHO); snd_flush(server); c=get4com(server); if(c==-1){ js_wnn_errorno_set= get4com(server); UnlockMutex(&(server_js_lock)); return -1; } re_alloc(ret, sizeof(WNN_JWHO)*c); w=(WNN_JWHO *)ret->buf; for(i=0;isd=get4com(server); getscom(w->user_name, server, sizeof(w->user_name)); getscom(w->host_name, server, sizeof(w->host_name)); for(j=0;jenv)[j]=get4com(server); } w++; } UnlockMutex(&(server_js_lock)); return(c); } /** jserver Ãæ¤ÎÁ´¤Æ¤Î´Ä¶­¤Ë´Ø¤¹¤ë¾ðÊó¤òÆÀ¤ë¡£ (¥¦¥éµ») **/ int js_env_list(server,ret) WNN_JSERVER_ID *server; struct wnn_ret_buf *ret; {register int i,j,c; WNN_ENV_INFO *w; set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } snd_server_head(server,JS_ENV_LIST); snd_flush(server); c=get4com(server); if(c==-1){ js_wnn_errorno_set= get4com(server); UnlockMutex(&(server_js_lock)); return -1; } re_alloc(ret, sizeof(WNN_ENV_INFO)*c); w=(WNN_ENV_INFO *)ret->buf; for(i=0;ienv_id = get4com(server); getscom(w->env_name, server, WNN_ENVNAME_LEN); w->ref_count=get4com(server); w->fzk_fid=get4com(server); w->jishomax=get4com(server); for(j=0;jjisho)[j]= get4com(server); } for(j=0;jfile)[j]= get4com(server); } w++; } UnlockMutex(&(server_js_lock)); return(c); } /**** ****/ /*:::DOC_START * * Function Name: js_hindo_set * Description : »ØÄꤵ¤ì¤¿¸õÊä¤Îº£¥Ó¥Ã¥È¡¦ÉÑÅÙ¤òÀßÄꤹ¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * dic : (In) ¸õÊ䤬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¼­½ñÈÖ¹æ * entry : (In) ¸õÊä¤Î¥¨¥ó¥È¥êÈÖ¹æ * ima : (In) º£¥Ó¥Ã¥È¤ÎÀßÄêÊýË¡¥Õ¥é¥° * hindo : (In) ÉÑÅÙ¤ÎÀßÄêÊýË¡¥Õ¥é¥° * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_hindo_set(env,dic,entry,ima,hindo) struct wnn_env *env; int dic, entry, ima,hindo; {register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_HINDO_SET); put4com(dic, env->js_id); put4com(entry, env->js_id); put4com(ima, env->js_id); put4com(hindo, env->js_id); snd_flush(env->js_id); if((x=get4com(env->js_id))==-1){ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return -1; } UnlockMutex(&(env_js_lock)); return x; } /* End of js_hindo_set */ /*:::DOC_START * * Function Name: js_set_fi_priority * Description : »ØÄê£Æ£É´Ø·¸¥Ç¡¼¥¿¤Î£Æ£É´Ø·¸Àܳº£¥Ó¥Ã¥È¤È * £Æ£É´Ø·¸ÀܳÉÑÅÙ¤òÀßÄꤹ¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * fi_rel_entry : (In) »ÈÍѣƣɴط¸Á÷¿®Íѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_set_fi_priority(env, fi_rel_entry) struct wnn_env *env; struct wnn_fi_rel_buf *fi_rel_entry; { register int x; if(env==0) return(-1); set_current_js(env->js_id); /* ¥µ¡¼¥Ð¤¬£Æ£É³Ø½¬¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤»þ¤Ï²¿¤â¤·¤Ê¤¤ */ if(!CHECK_FI) return(0); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_SET_FI_PRIORITY); put4com(fi_rel_entry->num, env->js_id); for(x = 0; x < fi_rel_entry->num; x++) { put4com(fi_rel_entry->fi_buf[x].fi_dic_no, env->js_id); put4com(fi_rel_entry->fi_buf[x].dic_no, env->js_id); put4com(fi_rel_entry->fi_buf[x].entry, env->js_id); put4com(fi_rel_entry->fi_buf[x].offset, env->js_id); put4com(fi_rel_entry->fi_buf[x].fi_hindo, env->js_id); put4com(fi_rel_entry->fi_buf[x].fi_ima, env->js_id); } snd_flush(env->js_id); if((x = get4com(env->js_id)) == -1) { env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return -1; } UnlockMutex(&(env_js_lock)); return x; } /* End of js_set_fi_priority */ /*:::DOC_START * * Function Name: js_optimize_fi * Description : ³ÎÄꤵ¤ì¤¿Á´¸õÊä¤Îº£¥Ó¥Ã¥È¡¦ÉÑÅÙ¤òÀßÄꤷ¡¢³Æ³Ø½¬½èÍý * ¡ÊÀÜÆ¬¸ì¡¦Á÷¤ê´ð½à¡¦ÈÆÍѸ졦ÀÜÈø¸ì¡¦£Æ£É¡Ë¤ò¹Ô¤¦ * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * nkouho : (In) ³ÎÄê¸õÊä¿ô * dic : (In) ¸õÊ䤬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¼­½ñÈÖ¹æÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * entry (In) ¸õÊä¤Î¥¨¥ó¥È¥êÈÖ¹æÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * ima : (In) º£¥Ó¥Ã¥È¤ÎÀßÄêÊýË¡¥Õ¥é¥°ÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * hindo : (In) ÉÑÅÙ¤ÎÀßÄêÊýË¡¥Õ¥é¥°ÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * kmoji : (In) ¸õÊäʸ»ú¿ô¡ÊÉÕ°¸ì¤Ê¤·¡ËÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * kouho : (In) ¸õÊäʸ»úÎó¡ÊÉÕ°¸ì¤¢¤ê¡ËÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_optimize_fi(env,nkouho,dic,entry,ima,hindo,kmoji,kouho) struct wnn_env *env; int nkouho, *dic, *entry, *ima, *hindo, *kmoji; w_char **kouho; { register int x, i; x = 0; if(env==0) return(-1); set_current_js(env->js_id); /* ¥µ¡¼¥Ð¤¬£Æ£É³Ø½¬¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤»þ¤Ï¡¢ ½¾Íè¤ÎÉÑÅÙÀßÄê¥×¥í¥È¥³¥ë¤ò³ÎÄê¸õÊä¿ô²óÁ÷¤ë */ if(!CHECK_FI) { for(i = 0; i < nkouho; i++) { x = js_hindo_set(env, dic[i], entry[i], ima[i], hindo[i]); if(x == -1) return(-1); } return(x); } LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_OPTIMIZE_FI); put4com(nkouho, env->js_id); for(x = 0; x < nkouho; x++) { put4com(dic[x], env->js_id); put4com(entry[x], env->js_id); put4com(ima[x], env->js_id); put4com(hindo[x], env->js_id); put4com(kmoji[x], env->js_id); putwscom(kouho[x], env->js_id); } snd_flush(env->js_id); if((x = get4com(env->js_id)) == -1) { env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return -1; } UnlockMutex(&(env_js_lock)); return x; } /* End of js_optimize_fi */ /**** Henkan ****/ static void put_fzk_vec(hinsi,fzk,vec,vec1, server) int hinsi; w_char *fzk; int vec; int vec1; ARGS *server; { put4com(hinsi, server); putwscom(fzk, server); put4com(vec, server); put4com(vec1, server); } /** kanren **/ static int rcv_dai(), rcv_fi_rel_data(); static void rcv_sho_x(); static void rcv_sho_kanji(); int js_kanren(env,yomi,hinsi,fzk,vec,vec1,vec2,rb) struct wnn_env *env; w_char *yomi; int hinsi; w_char *fzk; int vec; int vec1; int vec2; struct wnn_ret_buf *rb; { int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_KANREN); putwscom(yomi, env->js_id); put_fzk_vec(hinsi,fzk,vec,vec1, env->js_id); put4com(vec2, env->js_id); snd_flush(env->js_id); x = rcv_dai(rb, env->js_id); UnlockMutex(&(env_js_lock)); return x; } /*:::DOC_START * * Function Name: js_fi_kanren * Description : ϢʸÀá£Æ£ÉÊÑ´¹¤ò¹Ô¤¤¡¢·ë²Ì¤ò¼õ¤±¼è¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * yomi: (In) ÊÑ´¹ÆÉ¤ßʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * hinsi (In) Á°¤ÎʸÀá¤ÎÉÊ»ìÈÖ¹æ * fzk : (In) Á°¤ÎʸÀá¤ÎÉÕ°¸ìʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * vec : (In) ½ªÃ¼¥Ù¥¯¥È¥ë£± * vec1 : (In) ½ªÃ¼¥Ù¥¯¥È¥ë£² * vec2 : (In) ϢʸÀáÊÑ´¹¤ÎÅÓÃæ¤ÎʸÀá¤Î½ªÃ¼¥Ù¥¯¥È¥ë * prev : (In) ľÁ°³ÎÄêʸÀá¾ðÊó¹½Â¤ÂΤؤΥݥ¤¥ó¥¿ * rb : (Out) ÊÑ´¹·ë²ÌÂåÆþÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * fi_rb : (Out) »ÈÍѣƣɴط¸ÂåÆþÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_fi_kanren(env,yomi,hinsi,fzk,vec,vec1,vec2,prev,rb,fi_rb) struct wnn_env *env; w_char *yomi; int hinsi; w_char *fzk; int vec; int vec1; int vec2; struct wnn_prev_bun *prev; struct wnn_ret_buf *rb; struct wnn_fi_rel_buf *fi_rb; { int x; if(env==0) return(-1); set_current_js(env->js_id); /* ¥µ¡¼¥Ð¤¬£Æ£ÉÊÑ´¹¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤»þ¤Ï¡¢½¾Íè¤ÎϢʸÀá²òÀÏ ¥×¥í¥È¥³¥ë¤òÁ÷¤ë */ if(!CHECK_FI) return(js_kanren(env,yomi,hinsi,fzk,vec,vec1,vec2,rb)); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FI_KANREN); putwscom(yomi, env->js_id); put_fzk_vec(hinsi,fzk,vec,vec1, env->js_id); put4com(vec2, env->js_id); /* ľÁ°³ÎÄêʸÀá¾ðÊó */ for(x = 0; x < WNN_PREV_BUN_SUU; x++) { put4com(prev[x].dic_no, env->js_id); /* Wnn ¼­½ñÈÖ¹æ */ put4com(prev[x].entry, env->js_id); /* ¥¨¥ó¥È¥êÈÖ¹æ */ put4com(prev[x].jirilen, env->js_id); /* ¼«Î©¸ìÆÉ¤ßĹ */ put4com(prev[x].hinsi, env->js_id); /* ÉÊ»ìÈÖ¹æ */ putwscom((prev[x].kouho + prev[x].real_kanjilen), env->js_id); /* ÉÕ°¸ìʸ»úÎó */ } snd_flush(env->js_id); /* ϢʸÀá£Æ£ÉÊÑ´¹·ë²Ì¤ò¼õ¤±¼è¤ë */ x = rcv_dai(rb, env->js_id); /* »ÈÍѣƣɴط¸¤ò¼õ¤±¼è¤ë */ if(x != -1) { if(rcv_fi_rel_data(fi_rb, env->js_id) == -1) x = -1; } UnlockMutex(&(env_js_lock)); return x; } /* End of js_fi_kanren */ /* rcv dai */ static int rcv_dai(ret, server) struct wnn_ret_buf *ret; ARGS *server; {int dai_cnt,sho_sum,kanji_sum,d_size,s_size,k_size,x; register int i; struct wnn_dai_bunsetsu *dai_list; register struct wnn_dai_bunsetsu *dp; struct wnn_sho_bunsetsu *sho_list; register struct wnn_sho_bunsetsu *sp; w_char *kanji,*kp; dai_cnt = get4com(server); if(dai_cnt == -1){ /* error dayo */ js_wnn_errorno_set = get4com(server); return -1; } sho_sum = get4com(server); kanji_sum = get4com(server); d_size=sizeof(struct wnn_dai_bunsetsu)*dai_cnt; s_size=sizeof(struct wnn_sho_bunsetsu)*sho_sum; k_size=sizeof(w_char)*kanji_sum; /* re_alloc(ret, d_size+s_size+k_size); Seems This cause Bug?? H.T.*/ re_alloc(ret, d_size+s_size+k_size); dai_list = ( struct wnn_dai_bunsetsu *) ret->buf; sho_list = ( struct wnn_sho_bunsetsu *)((char *)ret->buf + d_size); kanji = (w_char *)((char *)ret->buf + d_size + s_size); for(dp = dai_list,i=0; i end = get4com(server); dp -> start = get4com(server); dp -> sbncnt = get4com(server); dp -> hyoka = get4com(server); dp++; } for(dp = dai_list, sp = sho_list, i=0; i sbn = sp; x = dp -> sbncnt; rcv_sho_x(sp,x, server); sp += x; dp++; } for(dp=dai_list, kp=kanji, i=0; isbn,dp->sbncnt,&kp,&k_size,server); dp++; } return dai_cnt; } /* rcv sho routines */ static void rcv_sho_x(sho_list,sho_cnt, server) register struct wnn_sho_bunsetsu *sho_list; int sho_cnt; ARGS *server; {register int i; for(i=0;i end = get4com(server); sho_list -> start = get4com(server); sho_list -> jiriend = get4com(server); sho_list -> dic_no = get4com(server); sho_list -> entry = get4com(server); sho_list -> hindo = get4com(server); sho_list -> ima = get4com(server); sho_list -> hinsi = get4com(server); sho_list -> status = get4com(server); sho_list -> status_bkwd = get4com(server); sho_list ->kangovect = get4com(server); sho_list -> hyoka = get4com(server); sho_list++; } } static void rcv_sho_kanji(sho_list,sho_cnt,kanji,kanjibytes,server) struct wnn_sho_bunsetsu *sho_list; int sho_cnt; w_char **kanji; int *kanjibytes; ARGS *server; { register w_char *k; register int i, bytes, error_flag, wlen; w_char wbuf[LENGTHKANJI]; k = *kanji; bytes = *kanjibytes; if (bytes <= 0) error_flag = 1; else error_flag = 0; for(i=0;i bytes) { error_flag = 1; } else { sho_list->kanji = k; wnn_Strcpy(k, wbuf); k += wlen; bytes -= (wlen * sizeof(w_char)); } } getwscom(wbuf, server, sizeof(wbuf) / sizeof(w_char)); if (!error_flag) { wlen = wnn_Strlen(wbuf) + 1; if ((wlen * sizeof(w_char)) > bytes) { error_flag = 1; } else { sho_list->yomi = k; wnn_Strcpy(k, wbuf); k += wlen; bytes -= (wlen * sizeof(w_char)); } } getwscom(wbuf, server, sizeof(wbuf) / sizeof(w_char)); if (!error_flag) { wlen = wnn_Strlen(wbuf) + 1; if ((wlen * sizeof(w_char)) > bytes) { /* '>=' ¤Ç¤Ï¤Ê¤¤ */ error_flag = 1; } else { sho_list->fuzoku = k; wnn_Strcpy(k, wbuf); k += wlen; bytes -= (wlen * sizeof(w_char)); } } sho_list++; } *kanji = k; *kanjibytes = bytes; } static int rcv_sho(ret, server) struct wnn_ret_buf *ret; ARGS *server; {int sho_sum,kanji_sum,s_size,k_size; struct wnn_sho_bunsetsu *sho_list; w_char *kanji,*kp; sho_sum = get4com(server); if(sho_sum == -1){ /* error dayo */ js_wnn_errorno_set = get4com(server); return -1; } kanji_sum = get4com(server); s_size=sizeof(struct wnn_sho_bunsetsu)*sho_sum; k_size=sizeof(w_char)*kanji_sum; re_alloc(ret, s_size+k_size); sho_list = ( struct wnn_sho_bunsetsu *)((char *)ret->buf); kanji = (w_char *)((char *)ret->buf + s_size); rcv_sho_x(sho_list,sho_sum, server); kp=kanji; rcv_sho_kanji(sho_list,sho_sum,&kp,&k_size,server); return sho_sum; } /*:::DOC_START * * Function Name: rcv_fi_rel_data * Description : ϢʸÀá£Æ£ÉÊÑ´¹¤Ë»ÈÍѤ·¤¿£Æ£É´Ø·¸¾ðÊó¤ò¼õ¤±¼è¤ë * Parameter : * ret : (Out) »ÈÍѣƣɴط¸¼õ¿®Íѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * server : (In) ÂÐ¾Ý jserver ¾ðÊó¹½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int rcv_fi_rel_data(ret, server) struct wnn_fi_rel_buf *ret; ARGS *server; { register int i, fi_num; struct fi_rel_data *fi_data; fi_num = get4com(server); /* »ÈÍѣƣɴط¸¿ô */ if(fi_num == 0) return(0); /* »ÈÍѣƣɴط¸¤¬¤Ê¤«¤Ã¤¿ */ if(ret->size < ret->num + fi_num) { /* ¿·¤¿¤Ë£Æ£É´Ø·¸¥Ç¡¼¥¿¹½Â¤ÂÎÇÛÎó¤ò³ÎÊݤ¹¤ë */ fi_data = (struct fi_rel_data *) malloc((ret->num + fi_num) * sizeof(struct fi_rel_data)); /* ´û¤Ë»ÈÍѤ·¤Æ¤¤¤¿£Æ£É´Ø·¸¥Ç¡¼¥¿¤ò¥³¥Ô¡¼¤¹¤ë */ if(fi_data) { if(ret->fi_buf) { bcopy(ret->fi_buf, fi_data, ret->num * sizeof(struct fi_rel_data)); free((char *)ret->fi_buf); } } ret->fi_buf = fi_data; ret->size = ret->num + fi_num; } /* £Æ£É´Ø·¸¥Ç¡¼¥¿¹½Â¤ÂÎÇÛÎ󤬳ÎÊݤǤ­¤¿¤«¡© */ if(ret->fi_buf == NULL) { int dummy; for(i = 0; i < 4 * fi_num; i++) dummy = get4com(server); js_wnn_errorno_set = WNN_MALLOC_ERR; return(-1); } /* »ÈÍѣƣɴط¸¥Ç¡¼¥¿¤ò¼õ¤±¼è¤ë */ fi_data = ret->fi_buf + ret->num; for(i = 0; i < fi_num; i++, fi_data++) { fi_data->fi_dic_no = get4com(server); fi_data->dic_no = get4com(server); fi_data->entry = get4com(server); fi_data->offset = get4com(server); fi_data->fi_hindo = WNN_HINDO_NOP; fi_data->fi_ima = WNN_IMA_OFF; } ret->num = ret->num + fi_num; return(0); } /* End of rcv_fi_rel_data */ /** kantan **/ int js_kantan_dai(env,yomi,hinsi,fzk,vec,vec1,rb) struct wnn_env *env; w_char *yomi; int hinsi; w_char *fzk; int vec; int vec1; struct wnn_ret_buf *rb; { int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_KANTAN_DAI); putwscom(yomi, env->js_id); put_fzk_vec(hinsi,fzk,vec,vec1, env->js_id); snd_flush(env->js_id); x = rcv_dai(rb, env->js_id); UnlockMutex(&(env_js_lock)); return x; } int js_kantan_sho(env,yomi,hinsi,fzk,vec,vec1,rb) struct wnn_env *env; w_char *yomi; int hinsi; w_char *fzk; int vec; int vec1; struct wnn_ret_buf *rb; {int sbncnt; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_KANTAN_SHO); putwscom(yomi, env->js_id); put_fzk_vec(hinsi,fzk,vec,vec1, env->js_id); snd_flush(env->js_id); sbncnt = rcv_sho(rb, env->js_id); UnlockMutex(&(env_js_lock)); return sbncnt; } /** kanzen **/ int js_kanzen_dai(env,yomi,hinsi,fzk,vec,vec1,rb) struct wnn_env *env; w_char *yomi; int hinsi; w_char *fzk; int vec; int vec1; struct wnn_ret_buf *rb; { int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_KANZEN_DAI); putwscom(yomi, env->js_id); put_fzk_vec(hinsi,fzk,vec,vec1, env->js_id); snd_flush(env->js_id); x = rcv_dai(rb, env->js_id); UnlockMutex(&(env_js_lock)); return x; } int js_kanzen_sho(env,yomi,hinsi,fzk,vec,vec1,rb) struct wnn_env *env; w_char *yomi; int hinsi; w_char *fzk; int vec; int vec1; struct wnn_ret_buf *rb; {int sbncnt; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_KANZEN_SHO); putwscom(yomi, env->js_id); put_fzk_vec(hinsi,fzk,vec,vec1, env->js_id); snd_flush(env->js_id); sbncnt = rcv_sho(rb, env->js_id); UnlockMutex(&(env_js_lock)); return sbncnt; } /** henkan with data **/ int js_henkan_with_data(env,fuku,nhinsi,hlist,henkan,yomi,hinsi,fzk,vec,vec1,vec2,rb) struct wnn_env *env; int fuku, nhinsi, *hlist, henkan; w_char *yomi; int hinsi; w_char *fzk; int vec; int vec1; int vec2; struct wnn_ret_buf *rb; { int x, i, loop = abs(nhinsi); if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_HENKAN_WITH_DATA); put4com(fuku, env->js_id); /* Ê£¹ç¸ìÍ¥Àè */ put4com(nhinsi, env->js_id); /* ÊÑ´¹ÀßÄêÉÊ»ì¿ô */ for(i = 0; i < loop; i++) put4com(hlist[i], env->js_id); /* ÊÑ´¹ÀßÄêÉÊ»ìÈÖ¹æ */ put4com(henkan, env->js_id); /* ÊÑ´¹¼ïÊÌ */ putwscom(yomi, env->js_id); put_fzk_vec(hinsi,fzk,vec,vec1, env->js_id); put4com(vec2, env->js_id); snd_flush(env->js_id); switch(henkan) { case WNN_KANREN: case WNN_KANTAN_DAI: case WNN_KANZEN_DAI: x = rcv_dai(rb, env->js_id); break; case WNN_KANTAN_SHO: case WNN_KANZEN_SHO: x = rcv_sho(rb, env->js_id); break; default: x = get4com(env->js_id); env_wnn_errorno_set= get4com(env->js_id); } UnlockMutex(&(env_js_lock)); return x; } /** js_version **/ int js_version(server,serv,libv) int *serv,*libv; WNN_JSERVER_ID *server; { set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } snd_server_head(server, JS_VERSION); snd_flush(server); *libv= JLIB_VERSION; *serv = get4com(server); UnlockMutex(&(server_js_lock)); return *serv; } static void re_alloc(ret,size) register struct wnn_ret_buf *ret; int size; { if(ret->size < size){ if(ret->buf) free((char *)ret->buf); ret->buf = malloc(size); ret->size = size; } } int js_kill(server) WNN_JSERVER_ID *server; { int x; set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } snd_server_head(server, JS_KILL); snd_flush(server); x = get4com(server); UnlockMutex(&(server_js_lock)); return(x); } int js_file_remove(server, n, pwd) WNN_JSERVER_ID *server; char *n, *pwd; { register int x; set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } snd_server_head(server,JS_FILE_REMOVE); putscom(n, server); putscom(pwd, server); snd_flush(server); if((x=get4com(server))==-1){ js_wnn_errorno_set= get4com(server); UnlockMutex(&(server_js_lock)); return -1; } UnlockMutex(&(server_js_lock)); return(x); } int js_file_remove_client(server, n, pwd) WNN_JSERVER_ID *server; char *n, *pwd; { struct wnn_file_head fh; register FILE *fp; int is_compressed; set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } if(js_file_loaded_local_body(server, n) != -1){ js_wnn_errorno_set = WNN_FILE_IN_USE; UnlockMutex(&(server_js_lock)); return(-1); } #ifdef WRITE_CHECK check_backup(n, NULL); #endif /* WRITE_CHECK */ if((fp=dic_fopen(n,"r", &is_compressed)) == NULL){ js_wnn_errorno_set = WNN_FILE_READ_ERROR; UnlockMutex(&(server_js_lock)); return(-1); } if(input_file_header(fp, &fh, NULL) == -1){ dic_fclose(fp, is_compressed); UnlockMutex(&(server_js_lock)); return(-1); } dic_fclose(fp, is_compressed); if(!check_pwd(pwd, fh.file_passwd)){ js_wnn_errorno_set = WNN_INCORRECT_PASSWD; UnlockMutex(&(server_js_lock)); return(-1); } if(unlink(n) == -1){ js_wnn_errorno_set = WNN_UNLINK; UnlockMutex(&(server_js_lock)); return(-1); } UnlockMutex(&(server_js_lock)); return(0); } /*:::DOC_START * * Function Name: js_dic_file_create_client * Description : ¥¯¥é¥¤¥¢¥ó¥È¦¤Ë¼­½ñ¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * fn : (In) ºîÀ®¼­½ñ¥Õ¥¡¥¤¥ë̾ * type : (In) ºîÀ®¼­½ñ¥Õ¥¡¥¤¥ë¥¿¥¤¥× * com : (In) ºîÀ®¼­½ñ¥Õ¥¡¥¤¥ë¥³¥á¥ó¥È * passwd (In) ºîÀ®¼­½ñ¥Õ¥¡¥¤¥ë¥Ñ¥¹¥ï¡¼¥É * hpasswd : (In) ºîÀ®¼­½ñÆâÉÑÅ٥ѥ¹¥ï¡¼¥É * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_dic_file_create_client(env, fn, type, com, passwd, hpasswd) struct wnn_env *env; int type; char *fn; w_char *com; char *passwd, *hpasswd; { int x, js_jishonum; if(env==0) return(-1); LockMutex(&(env_js_lock)); /* * Hideyuki Kishiba (Jul. 7, 1994) * £Æ£É´Ø·¸¼­½ñ¡¢¥°¥ë¡¼¥×¼­½ñ¡¢¥Þ¡¼¥¸¼­½ñ¤ÎºîÀ®½èÍý¤òÄɲà */ if(type != WNN_REV_DICT && type != CWNN_REV_DICT && type != BWNN_REV_DICT && type != WNN_UD_DICT && type != WNN_FI_USER_DICT && type != WNN_GROUP_DICT && type != WNN_MERGE_DICT){ env_wnn_errorno_set = WNN_NOT_A_UD; UnlockMutex(&(env_js_lock)); return(-1); } if(type == WNN_FI_USER_DICT) { /* £Æ£É´Ø·¸¼­½ñºîÀ®´Ø¿ô¤ò¸Æ¤Ö */ int i, j; unsigned char njisho; struct wnn_file_uniq duniq[WNN_MAX_JISHO_OF_AN_ENV]; int dprimary[WNN_MAX_JISHO_OF_AN_ENV]; /* ÀܳÄêµÁ¼­½ñ¾ðÊó¡Êprimary index table¡¦file uniq¡Ë¤Î¼õ¤±¼è¤ê */ set_current_js(env->js_id); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env, JS_DIC_FILE_CREATE_CLIENT); snd_flush(env->js_id); x = get4com(env->js_id); if(x == -1) { env_wnn_errorno_set = get4com(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } js_jishonum = get1com(env->js_id); /* ÀܳÄêµÁ¼­½ñ¿ô */ if (js_jishonum > WNN_MAX_JISHO_OF_AN_ENV) njisho = WNN_MAX_JISHO_OF_AN_ENV; else njisho = js_jishonum; for(i = 0; i < njisho; i++) { /* ÀܳÄêµÁ¼­½ñ file uniq */ duniq[i].time = get4com(env->js_id); duniq[i].dev = get4com(env->js_id); duniq[i].inode = get4com(env->js_id); for(j = 0; j < WNN_HOSTLEN; j++){ duniq[i].createhost[j] = get1com(env->js_id); } /* ÀܳÄêµÁ¼­½ñÅÐÏ¿¸ì×ÿô */ dprimary[i] = get4com(env->js_id); } if (js_jishonum > WNN_MAX_JISHO_OF_AN_ENV) { js_jishonum -= WNN_MAX_JISHO_OF_AN_ENV; for(i = 0; i < js_jishonum; i++) { get4com(env->js_id); get4com(env->js_id); get4com(env->js_id); for(j = 0; j < WNN_HOSTLEN; j++){ get1com(env->js_id); } get4com(env->js_id); } } x = create_null_fi_dic(fn, com, passwd, hpasswd, type, njisho, duniq, dprimary, NULL); } else /* £×£î£î¼­½ñºîÀ®´Ø¿ô¤ò¸Æ¤Ö */ x = create_null_dic(fn,com, passwd, hpasswd, type, NULL); if(x == -1){ env_wnn_errorno_set = WNN_FILE_CREATE_ERROR; UnlockMutex(&(env_js_lock)); return(-1); } UnlockMutex(&(env_js_lock)); return(0); } /* End of js_dic_file_create_client */ /** js_hindo_file_create_client **/ int js_hindo_file_create_client(env,fid,fn,com,hpasswd) struct wnn_env *env; int fid; char *fn; w_char *com; char *hpasswd; { register int x; struct wnn_file_uniq funiq; int serial; register int i; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_HINDO_FILE_CREATE_CLIENT); put4com(fid, env->js_id); snd_flush(env->js_id); x = get4com(env->js_id); if(x == -1){ env_wnn_errorno_set = get4com(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } serial = get4com(env->js_id); funiq.time = get4com(env->js_id); funiq.dev = get4com(env->js_id); funiq.inode = get4com(env->js_id); for(i=0;ijs_id); } if(create_hindo_file(&funiq,fn,com,hpasswd,serial, NULL, NULL) == -1){ env_wnn_errorno_set = WNN_FILE_CREATE_ERROR; UnlockMutex(&(env_js_lock)); return(-1); } UnlockMutex(&(env_js_lock)); return(0); } /*:::DOC_START * * Function Name: js_fi_hindo_file_create_client * Description : ¥¯¥é¥¤¥¢¥ó¥È¦¤Ë£Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * fid : (In) Âбþ£Æ£É´Ø·¸¼­½ñ¥Õ¥¡¥¤¥ë£É£Ä * fn : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë̾ * com : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¥³¥á¥ó¥È * hpasswd : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¥Ñ¥¹¥ï¡¼¥É * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int js_fi_hindo_file_create_client(env, fid, fn, com, hpasswd) struct wnn_env *env; int fid; char *fn; w_char *com; char *hpasswd; { register int x; struct wnn_file_uniq funiq; unsigned char njisho; int *primary; register int i; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FI_HINDO_FILE_CREATE_CLIENT); put4com(fid, env->js_id); snd_flush(env->js_id); x = get4com(env->js_id); if(x == -1){ env_wnn_errorno_set = get4com(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } funiq.time = get4com(env->js_id); funiq.dev = get4com(env->js_id); funiq.inode = get4com(env->js_id); for(i=0;ijs_id); } njisho = get1com(env->js_id); if((primary = (int *)malloc(njisho * sizeof(int))) == NULL) { env_wnn_errorno_set = WNN_MALLOC_ERR; UnlockMutex(&(env_js_lock)); return(-1); } for(i = 0; i < njisho; i++) primary[i] = get4com(env->js_id); if(create_fi_hindo_file(&funiq,fn,com,hpasswd,njisho,primary,NULL) == -1){ free(primary); env_wnn_errorno_set = WNN_FILE_CREATE_ERROR; UnlockMutex(&(env_js_lock)); return(-1); } free(primary); UnlockMutex(&(env_js_lock)); return(0); } /* End of js_fi_hindo_file_create_client */ int js_file_comment_set(env, fid, comment) struct wnn_env *env; int fid; w_char *comment; { register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FILE_COMMENT_SET); put4com(fid, env->js_id); putwscom(comment, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1){ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } UnlockMutex(&(env_js_lock)); return(0); } /* * Hinsi Primitives */ int js_hinsi_name(server, no, rb) WNN_JSERVER_ID *server; int no; struct wnn_ret_buf *rb; { register int size; set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } snd_server_head(server,JS_HINSI_NAME); put4com(no, server); snd_flush(server); if((size = get4com(server)) == -1){ js_wnn_errorno_set = get4com(server); UnlockMutex(&(server_js_lock)); return(-1); } re_alloc(rb,sizeof(w_char)*(size + 1)); getwscom((w_char *)rb->buf, server, size + 1); UnlockMutex(&(server_js_lock)); return(0); } int js_hinsi_number(server, name) WNN_JSERVER_ID *server; w_char *name; { register int no; set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } snd_server_head(server,JS_HINSI_NUMBER); putwscom(name, server); snd_flush(server); if((no = get4com(server)) == -1){ js_wnn_errorno_set = get4com(server); UnlockMutex(&(server_js_lock)); return(-1); } UnlockMutex(&(server_js_lock)); return(no); } int js_hinsi_list(env, dic_no, name, rb) struct wnn_env *env; int dic_no; w_char *name; struct wnn_ret_buf *rb; { int wtotal; int count; register w_char *s; register w_char **r; register int k, wlen, error_flag; w_char wbuf[LENGTHKANJI]; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_HINSI_LIST); put4com(dic_no, env->js_id); putwscom(name, env->js_id); snd_flush(env->js_id); if((count = get4com(env->js_id)) == -1){ env_wnn_errorno_set = get4com(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } wtotal = get4com(env->js_id); wtotal += 1; re_alloc(rb,sizeof(w_char)*(wtotal) + count * sizeof(w_char *) ); r = (w_char **)rb->buf; s = (w_char *)((w_char **)rb->buf + count); error_flag = 0; for(k = 0 ; k < count ; k++){ getwscom(wbuf, env->js_id, sizeof(wbuf) / sizeof(w_char)); if (!error_flag) { wlen = wnn_Strlen(wbuf) + 1; if (wlen > wtotal) { error_flag = 1; } else { *r++ = s; wnn_Strcpy(s, wbuf); s += wlen; wtotal -= wlen; } } } UnlockMutex(&(env_js_lock)); return(count); } int js_hinsi_dicts(env, no, rb) struct wnn_env *env; int no; struct wnn_ret_buf *rb; { register int k, count; int *p; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_HINSI_DICTS); put4com(no, env->js_id); snd_flush(env->js_id); if((count = get4com(env->js_id)) == -1){ env_wnn_errorno_set = get4com(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } re_alloc(rb,sizeof(int) * (count + 1)); p = (int *)rb->buf; for(k = 0 ; k < count ; k++){ *p++ = get4com(env->js_id); } UnlockMutex(&(env_js_lock)); return(count); } char *wnn_dic_types[] = {"","¸ÇÄê","ÅÐÏ¿","µÕ°ú","Àµµ¬","¸ÇÄê","FI¥·¥¹","FI¥æ¡¼¥¶","FIÉÑÅÙ","¥°¥ë¡¼¥×","¥Þ¡¼¥¸"}; char *cwnn_dic_types[] = {"","¹Ì¶¨","µÇ¼","Æ´Òô","Õý¹æ"}; char *bwnn_dic_types[] = {"","¹Ì¶¨","µÇ¼","±ÊÐÍ","Õý¹æ"}; char *kwnn_dic_types[] = {"","°íÁ¤","µî·Ï","¿ª¿ë","Á¤±Ô"}; /* ͳïÒ ÔôÖâ æ½ìÚ ïáЮ */ /* New primitives 9/8 */ int js_file_password_set(env, fid, which, old, new) struct wnn_env *env; int fid; int which; /* 1 for dic, 2 for hindo 3(0) for both*/ char *old, *new; { register int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_FILE_PASSWORD_SET); put4com(fid, env->js_id); put4com(which, env->js_id); putscom(old, env->js_id); putscom(new, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1){ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } UnlockMutex(&(env_js_lock)); return(0); } int js_hinsi_table_set(env, dic_no, hinsi_table) struct wnn_env *env; int dic_no; w_char *hinsi_table; { int x; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_HINSI_TABLE_SET); put4com(dic_no, env->js_id); putwscom(hinsi_table, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if(x==-1){ env_wnn_errorno_set= get4com(env->js_id); UnlockMutex(&(env_js_lock)); return(-1); } UnlockMutex(&(env_js_lock)); return(0); } /* Start of packets in 4004 */ int js_open_extension(server, ext_name) WNN_JSERVER_ID *server; char *ext_name; { register wnn_extension_set *p; if (!ext_name || !*ext_name) { js_wnn_errorno_set = WNN_NOT_SUPPORT_EXTENSION; return(-1); } for (p = ((WNN_JSERVER_ID_INT *)server)->extensions; p && p->id && p->name; p++) { if (!strcmp(p->name, ext_name)) { return(p->id); } } js_wnn_errorno_set = WNN_NOT_SUPPORT_EXTENSION; return(0); } int js_get_extension(server, ret) WNN_JSERVER_ID *server; char ***ret; { register wnn_extension_set *p; register char *s, **l; int total = 0, num = 0; if (!((WNN_JSERVER_ID_INT *)server)->extensions) { js_wnn_errorno_set = WNN_NOT_SUPPORT_PACKET; return(-1); } for (p = ((WNN_JSERVER_ID_INT *)server)->extensions; p && p->id && p->name; p++) { total += strlen(p->name) + 1; num++; } if (num == 0) return(0); if (!(l = (char **)(s = malloc((sizeof(char *) * num) + total)))) { js_wnn_errorno_set = WNN_MALLOC_ERR; return(-1); } *ret = l; s += sizeof(char *) * num; for (p = ((WNN_JSERVER_ID_INT *)server)->extensions; p && p->id && p->name; p++) { *l++ = s; strcpy(s, p->name); s += strlen(s) + 1; } return(num); } static int access_host_core(server, ha, enable, ule) WNN_JSERVER_ID *server; host_address *ha; int enable, ule; { register int x; register char *p; handler_of_jserver_dead(server); if (js_wnn_errorno_eql) return(-1); if (enable) { snd_server_head(server, JS_ACCESS_ADD_HOST); put4com(ule, server); } else { snd_server_head(server, JS_ACCESS_REMOVE_HOST); } put4com(ha->address_len, server); p = ha->address; for (x = 0; x < ha->address_len; x++) put1com(*p++, server); snd_flush(server); x=get4com(server); if(x==-1){ js_wnn_errorno_set= get4com(server); return(-1); } return(x); } static int access_host(server, host, enable, ule) WNN_JSERVER_ID *server; char *host; int enable, ule; { struct hostent *hp; struct in_addr addr; host_address ha; char **l; int x; if ((addr.s_addr = inet_addr(host)) != -1) { ha.address = (char *)&addr.s_addr; ha.address_len = sizeof(addr.s_addr); x = access_host_core(server, &ha, enable, ule); return(x); } else if ((hp = gethostbyname(host)) && hp->h_addrtype == AF_INET) { ha.address_len = sizeof(addr.s_addr); for (l = hp->h_addr_list; *l; l++) { ha.address = *l; if ((x = access_host_core(server, &ha, enable, ule)) == -1) { return(-1); } } return(0); } else { js_wnn_errorno_set = WNN_ACCESS_NO_HOST; return(-1); } } int js_access_add_host(server, host, ule) WNN_JSERVER_ID *server; char *host; int ule; { int x; set_current_js(server); LockMutex(&(server_js_lock)); x = access_host(server, host, 1, ule); UnlockMutex(&(server_js_lock)); return(x); } int js_access_remove_host(server, host) WNN_JSERVER_ID *server; char *host; { int x; set_current_js(server); LockMutex(&(server_js_lock)); x = access_host(server, host, 0, 0); UnlockMutex(&(server_js_lock)); return(x); } static int access_user_core(server, ha, user, enable) WNN_JSERVER_ID *server; host_address *ha; char *user; int enable; { register int x; register char *p; handler_of_jserver_dead(server); if (js_wnn_errorno_eql) return(-1); if (enable) { snd_server_head(server, JS_ACCESS_ADD_USER); } else { snd_server_head(server, JS_ACCESS_REMOVE_USER); } put4com(ha->address_len, server); p = ha->address; for (x = 0; x < ha->address_len; x++) put1com(*p++, server); putscom(user, server); snd_flush(server); x=get4com(server); if(x==-1){ js_wnn_errorno_set= get4com(server); return(-1); } return(x); } static int access_user(server, host, user, enable) WNN_JSERVER_ID *server; char *host, *user; int enable; { struct hostent *hp; struct in_addr addr; host_address ha; char **l; int x; if (!host || !*host) { ha.address = NULL; ha.address_len = 0; x = access_user_core(server, &ha, user, enable); return(x); } else if ((addr.s_addr = inet_addr(host)) != -1) { ha.address = (char *)&addr.s_addr; ha.address_len = sizeof(addr.s_addr); x = access_user_core(server, &ha, user, enable); return(x); } else if ((hp = gethostbyname(host)) && hp->h_addrtype == AF_INET) { ha.address_len = sizeof(addr.s_addr); for (l = hp->h_addr_list; *l; l++) { ha.address = *l; if ((x = access_user_core(server, &ha, user, enable)) == -1) { return(-1); } } return(0); } else { js_wnn_errorno_set = WNN_ACCESS_NO_USER; return(-1); } } int js_access_add_user(server, host, user) WNN_JSERVER_ID *server; char *host, *user; { int x; set_current_js(server); LockMutex(&(server_js_lock)); x = access_user(server, host, user, 1); UnlockMutex(&(server_js_lock)); return(x); } int js_access_remove_user(server, host, user) WNN_JSERVER_ID *server; char *host, *user; { int x; set_current_js(server); LockMutex(&(server_js_lock)); x = access_user(server, host, user, 0); UnlockMutex(&(server_js_lock)); return(x); } static int access_control(server, enable) WNN_JSERVER_ID *server; int enable; { int x; handler_of_jserver_dead(server); if (js_wnn_errorno_eql) return(-1); if (enable) { snd_server_head(server, JS_ACCESS_ENABLE); } else { snd_server_head(server, JS_ACCESS_DISABLE); } snd_flush(server); x=get4com(server); if(x==-1){ js_wnn_errorno_set= get4com(server); return(-1); } return(x); } int js_access_enable(server) WNN_JSERVER_ID *server; { int x; set_current_js(server); LockMutex(&(server_js_lock)); x = access_control(server, 1); UnlockMutex(&(server_js_lock)); return(x); } int js_access_disable(server) WNN_JSERVER_ID *server; { int x; set_current_js(server); LockMutex(&(server_js_lock)); x = access_control(server, 0); UnlockMutex(&(server_js_lock)); return(x); } static int get_host_name_len(host_p) host_address *host_p; { char *p; register struct hostent *hp; int user_len = 0; char address[32]; char *inet_ntoa(); if ((p = strchr(host_p->address, ':'))) { user_len = strlen(p); } bcopy((char *)host_p->address, address, host_p->address_len); if ((hp = gethostbyaddr (address, host_p->address_len, AF_INET))) { return(strlen(hp->h_name) + user_len); } if (!(p = inet_ntoa(*((struct in_addr *)(address))))) return(0); return(strlen(p) + user_len); } static int get_host_name(host_p, host) host_address *host_p; char *host; { char *p, *user; register struct hostent *hp; int user_len = 0; char address[32]; char *inet_ntoa(); if ((user = strchr(host_p->address, ':'))) { user_len = strlen(user); } bcopy((char *)host_p->address, address, host_p->address_len); if ((hp = gethostbyaddr (address, host_p->address_len, AF_INET))) { strcpy(host, hp->h_name); if (user) strcat(host, user); return(strlen(host)); } if (!(p = inet_ntoa(*((struct in_addr *)(address))))) return(0); strcpy(host, p); if (user) strcat(host, user); return(strlen(host)); } char ** js_access_get_info(server, enable, ret_num) WNN_JSERVER_ID *server; int *enable; int *ret_num; { int i, j, host_num, except_num, total_num, bytes, total, error_flag; register char *p, **out, *save, **out_save; host_address *host_p; char dummy[1024]; *ret_num = -1; set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if (js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(NULL); } snd_server_head(server, JS_ACCESS_GET_INFO); snd_flush(server); *enable = get4com(server); if(*enable == -1){ js_wnn_errorno_set= get4com(server); UnlockMutex(&(server_js_lock)); return((char **)NULL); } bytes = get4com(server); host_num = get4com(server); except_num = get4com(server); total_num = host_num + except_num; if (total_num == 0) { *ret_num = 0; UnlockMutex(&(server_js_lock)); return((char **)NULL); } if (!(save = p = malloc((sizeof(host_address) * total_num) + bytes))) { for (i = 0; i < bytes; i++) get1com(server); js_wnn_errorno_set = WNN_MALLOC_ERR; return((char **)NULL); } host_p = (host_address *)p; p += sizeof(host_address) * total_num; error_flag = 0; for (i = 0; i < host_num; i++, host_p++) { host_p->address_len = get4com(server); if ((host_p->address_len >= bytes) || (bytes <= 0) || error_flag) { error_flag = 1; for (j = 0; j < host_p->address_len; j++) get1com(server); if (get4com(server)) getscom(dummy, server, sizeof(dummy)); } else { for (j = 0; j < host_p->address_len; j++) p[j] = get1com(server); host_p->address = p; p += host_p->address_len; bytes -= host_p->address_len; if (get4com(server)) { *p++ = ':'; bytes--; getscom(p, server, bytes); if (bytes > 0) { p += strlen(p) + 1; bytes -= strlen(p) + 1; } } else { *p++ = '\0'; bytes--; } } } for (i = 0; i < except_num; i++, host_p++) { if ((bytes <= 0) || error_flag) { error_flag = 1; getscom(dummy, server, sizeof(dummy)); } else { host_p->address = p; *p++ = '@'; bytes--; getscom(p, server, bytes); if (bytes > 0) { p += strlen(p) + 1; bytes -= strlen(p) + 1; host_p->address_len = strlen(host_p->address); } } } if (error_flag) { free((char *)save); js_wnn_errorno_set = WNN_SOME_ERROR; UnlockMutex(&(server_js_lock)); return((char **)NULL); } for (host_p = (host_address *)save, total = 0, i = 0; i < total_num; i++, host_p++) { if (host_p->address_len > 0 && host_p->address[0] == '@') total += strlen(host_p->address); /* exceptional user name */ else total += get_host_name_len(host_p); } if (!(p = malloc((sizeof(char *) * total_num) + total + total_num))) { free((char *)save); js_wnn_errorno_set = WNN_MALLOC_ERR; UnlockMutex(&(server_js_lock)); return((char **)NULL); } out = out_save = (char **)p; p += (sizeof(char *) * total_num); for (host_p = (host_address *)save, i = 0; i < total_num; i++, host_p++) { *out++ = p; if (host_p->address_len > 0 && host_p->address[0] == '@') { strcpy(p, host_p->address) /* exceptional user name */; p += strlen(host_p->address) + 1; } else p += get_host_name(host_p, p) + 1; } free((char *)save); *ret_num = total_num; UnlockMutex(&(server_js_lock)); return(out_save); } /*:::DOC_START * * Function Name: js_is_loaded_temporary_dic * Description : * ¥Æ¥ó¥Ý¥é¥ê¼­½ñ¤¬´Ä¶­¤Ë¤¢¤ë¤«¤É¤¦¤«¤òÄ´¤Ù¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : 1==EXIST, 0==NO EXIST, -1==ERROR * * Author : Seiji KUWARI * * Revision history: * *:::DOC_END */ int js_is_loaded_temporary_dic(env) struct wnn_env *env; { register int x = 0; if(!env) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_IS_LOADED_TEMPORARY_DIC); snd_flush(env->js_id); x=get4com(env->js_id); if (x == -1) { wnn_errorno = get4com(env->js_id); } UnlockMutex(&(env_js_lock)); return x; } /*:::DOC_START * * Function Name: js_temporary_dic_delete * Description : * ¥Æ¥ó¥Ý¥é¥ê¼­½ñ¤ò´Ä¶­¤ËÄɲ乤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Seiji KUWARI * * Revision history: * *:::DOC_END */ int js_temporary_dic_add(env, rev) struct wnn_env *env; int rev; { register int x = 0; if(!env) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_TEMPORARY_DIC_ADD); put4com(rev, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if (x == -1) wnn_errorno = get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /*:::DOC_START * * Function Name: js_temporary_dic_delete * Description : * ¥Æ¥ó¥Ý¥é¥ê¼­½ñ¤ò´Ä¶­¤«¤éºï½ü¤¹¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Seiji KUWARI * * Revision history: * *:::DOC_END */ int js_temporary_dic_delete(env) struct wnn_env *env; { register int x; if(!env) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_TEMPORARY_DIC_DELETE); snd_flush(env->js_id); x=get4com(env->js_id); if (x == -1) wnn_errorno = get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /*:::DOC_START * * Function Name: js_temporary_word_add * Description : * ¥Æ¥ó¥Ý¥é¥ê¼­½ñ¤Ëñ¸ì¤òÅÐÏ¿¤¹¤ë¡£ * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * yomi : (In) ÆÉ¤ß * kanji : (In) ´Á»ú * comment : (In) ¥³¥á¥ó¥È * hinsi : (In) ÉÊ»ì * init_hindo :(In) ½é´üÉÑÅÙ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Seiji KUWARI * * Revision history: * *:::DOC_END */ int js_temporary_word_add(env, yomi, kanji, comment, hinshi, init_hindo) struct wnn_env *env; w_char *yomi,*kanji,*comment; int hinshi,init_hindo; { register int x; if(!env) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_TEMPORARY_WORD_ADD); putwscom(yomi, env->js_id); putwscom(kanji, env->js_id); putwscom(comment, env->js_id); put4com(hinshi, env->js_id); put4com(init_hindo, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if (x == -1) wnn_errorno = get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /*:::DOC_START * * Function Name: js_autolearning_word_add * Description : * ¼«Æ°ÅÐÏ¿¤Îñ¸ì¤òÅÐÏ¿¤¹¤ë¡£ * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * type : (In) ³Ø½¬¤¹¤ë¥¿¥¤¥×(¥«¥¿¥«¥Ê/ʸÀáÀÚ¤ê) * yomi : (In) ÆÉ¤ß * kanji : (In) ´Á»ú * comment : (In) ¥³¥á¥ó¥È * hinsi : (In) ÉÊ»ì * init_hindo :(In) ½é´üÉÑÅÙ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Seiji KUWARI * * Revision history: * *:::DOC_END */ int js_autolearning_word_add(env, type, yomi, kanji, comment, hinshi, init_hindo) struct wnn_env *env; w_char *yomi,*kanji,*comment; int type, hinshi,init_hindo; { register int x; if(!env) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_AUTOLEARNING_WORD_ADD); put4com(type, env->js_id); putwscom(yomi, env->js_id); putwscom(kanji, env->js_id); putwscom(comment, env->js_id); put4com(hinshi, env->js_id); put4com(init_hindo, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if (x == -1) wnn_errorno = get4com(env->js_id); UnlockMutex(&(env_js_lock)); return x; } /*:::DOC_START * * Function Name: js_set_autolearning_dic * Description : * ¼«Æ°ÅÐÏ¿ÍѤμ­½ñ¤òÅÐÏ¿¤¹¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * type : (In) ¼­½ñ¤Î¥¿¥¤¥×(¥«¥¿¥«¥Ê/ʸÀáÀÚ¤ê) * dic_no : (In) ¼­½ñÈÖ¹æ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Seiji KUWARI * * Revision history: * *:::DOC_END */ int js_set_autolearning_dic(env, type, dic_no) register struct wnn_env *env; register int type, dic_no; { int x; if(!env) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_SET_AUTOLEARNING_DIC); put4com(type, env->js_id); put4com(dic_no, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if (x == -1) wnn_errorno = get4com(env->js_id); UnlockMutex(&(env_js_lock)); return(x); } /*:::DOC_START * * Function Name: js_get_autolearning_dic * Description : * ¼«Æ°ÅÐÏ¿ÍѤμ­½ñ¤òÄ´¤Ù¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * type : (In) ¼­½ñ¤Î¥¿¥¤¥×(¥«¥¿¥«¥Ê/ʸÀáÀÚ¤ê) * * Return value : -1==ERROR, ELSE==¼­½ñ¤ÎÈÖ¹æ * * Author : Seiji KUWARI * * Revision history: * *:::DOC_END */ int js_get_autolearning_dic(env, type) register struct wnn_env *env; register int type; { register int x; if(!env) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_GET_AUTOLEARNING_DIC); put4com(type, env->js_id); snd_flush(env->js_id); x=get4com(env->js_id); if (x == -1) { UnlockMutex(&(env_js_lock)); wnn_errorno = get4com(env->js_id); return -1; } x=get4com(env->js_id); UnlockMutex(&(env_js_lock)); return(x); } /* For wnnoffline */ #ifdef WNNOFFLINE int js_lock(server) WNN_JSERVER_ID *server; { int x; set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } snd_server_head(server,JS_LOCK); snd_flush(server); if((x=get4com(server)) == -1) { js_wnn_errorno_set = get4com(server); } UnlockMutex(&(server_js_lock)); return x; } int js_unlock(server) WNN_JSERVER_ID *server; { int x; set_current_js(server); LockMutex(&(server_js_lock)); handler_of_jserver_dead(server); if(js_wnn_errorno_eql) { UnlockMutex(&(server_js_lock)); return(-1); } snd_server_head(server,JS_UNLOCK); snd_flush(server); if((x=get4com(server)) == -1) { js_wnn_errorno_set = get4com(server); } UnlockMutex(&(server_js_lock)); return x; } #endif /* WNNOFFLINE */ /*:::DOC_START * * Function Name: * rcv_dai_sim, rcv_sho_x_sim, rcv_sho_kanji_sim, rcv_sho_sim * Description : * emulate rcv_dai etc. for local test * Parameter : same as emulated (omitted) * * Return value : same as emulated (omitted) * * Author : fujimori * * Revision history: * 20-Dec-94: initial release * *:::DOC_END */ /*:::DOC_START * * Function Name: js_ikeiji_with_data * Description : * ÊÑ´¹ÍѳƼï¥Ç¡¼¥¿¡ÊÊ£¹ç¸ìÊÑ´¹¡¢ÊÑ´¹ÉÊ»ì¥ê¥¹¥È¡Ë¤ò * »ØÄꤷ¤Æ¡¢°Û·Á»ú ÊÑ´¹½èÍý¤ò¹Ô¤Ê¤¦ * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * fuku : (In) Ê£¹ç¸ìÊÑ´¹ * nhinsi : (In) ÉÊ»ì¤Î¿ô * hlist : (In) ÉÊ»ì¥ê¥¹¥È * henkan : (In) ÊÑ´¹¤Î¥¿¥¤¥× * yomi : (In) ¸¡º÷¤Î¥­¡¼ * hinsi : (In) ¸¡º÷·ë²Ì¤ÎÉÊ»ì * fzk : (In) ÉÕ°¸ì¤Î¾ðÊó * vec : (In) Àܳ¤Î¾ðÊó * vec1 : (In) Àܳ¤Î¾ðÊó 1 * vec2 : (In) Àܳ¤Î¾ðÊó 2 * cur_bun : (In) ʸÀá¤Î¾ðÊó * yomi_orig : (In) ÆÉ¤ß * rb : (Out) ¸¡º÷¤Î·ë²Ì * * Return value : ÂçʸÀá¤Î¿ô * * Author : fujimori * * Revision history: * 20-Dec-94: initial release * *:::DOC_END */ int js_ikeiji_with_data(env,fuku,nhinsi,hlist,henkan,yomi,hinsi,fzk,vec,vec1,vec2, cur_bun, yomi_orig, rb) struct wnn_env *env; int fuku, nhinsi, *hlist, henkan; w_char *yomi; int hinsi; w_char *fzk; int vec; int vec1; int vec2; WNN_BUN *cur_bun; w_char *yomi_orig; struct wnn_ret_buf *rb; { int x; int i, loop = abs(nhinsi); int for_ret_status; int for_ret_status_bkwd; for_ret_status = (cur_bun->dai_top)? WNN_NOT_CONNECT : WNN_CONNECT; /* where are WNN_SENTOU and WNN_GIJI gone to ? */ for_ret_status_bkwd = (cur_bun->dai_end)? WNN_NOT_CONNECT_BK : WNN_CONNECT_BK; if(env==0) return(-1); set_current_js(env->js_id); LockMutex(&(env_js_lock)); handler_of_jserver_dead_env(env); if(env_wnn_errorno_eql) { UnlockMutex(&(env_js_lock)); return(-1); } snd_env_head(env,JS_HENKAN_IKEIJI); put4com(fuku, env->js_id); /* Ê£¹ç¸ìÍ¥Àè */ put4com(nhinsi, env->js_id); /* ÊÑ´¹ÀßÄêÉÊ»ì¿ô */ for(i = 0; i < loop; i++) put4com(hlist[i], env->js_id); /* ÊÑ´¹ÀßÄêÉÊ»ìÈÖ¹æ */ put4com(henkan, env->js_id); /* ÊÑ´¹¼ïÊÌ */ putwscom(yomi, env->js_id); put_fzk_vec(hinsi,fzk,vec,vec1, env->js_id); put4com(vec2, env->js_id); /* need fugokugo-len, hinsi, etc */ put4com( (int) (cur_bun->yomilen - cur_bun->jirilen), env->js_id); put4com(cur_bun->hinsi, env->js_id); /* more */ put4com( cur_bun->hyoka, env->js_id); /* for ret_sho_hyoka in jserver */ put4com( cur_bun->daihyoka, env->js_id); /* for ret_hyoka in jserver */ put4com( for_ret_status /* (wnn_sho_bunsetsu*)->status */ , env->js_id); /* for ret_status in jserver */ put4com( for_ret_status_bkwd /* (wnn_sho_bunsetsu*)->status_bkwd */ , env->js_id); /* for int ret_status_bkwd in jserver */ put4com( cur_bun->kangovect, env->js_id); /* for ret_kangovect in jserver */ /* ÊÑ´¹ÆÉ¤ßʸ»úÎó¤ò¥µ¡¼¥Ð¤«¤é¼õ¤±¼è¤ë ¤¿¤á¤Ë ¥µ¡¼¥Ð ¤ËÅϤ¹ */ putwscom(yomi_orig, env->js_id); /* for ret_yomi_orig[i] in jserver */ put4com( cur_bun->jirilen, env->js_id); /* for ret_jirilen_orig in jserver */ put4com( cur_bun->yomilen, env->js_id); /* for ret_yomilen_orig in jserver */ put4com( cur_bun->kanjilen, env->js_id); /* for ret_kanjilen_orig in jserver */ put4com( cur_bun->real_kanjilen, env->js_id); /* for ret_real_kanjilen_orig in jserver */ snd_flush(env->js_id); switch(henkan) { case WNN_IKEIJI_DAI: x = rcv_dai(rb, env->js_id); break; default: x = get4com(env->js_id); env_wnn_errorno_set= get4com(env->js_id); } UnlockMutex(&(env_js_lock)); return x; } /* end of js_ikeiji_with_data */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/jlib/jl.c0000644000000000000000000067566707153676737017000 0ustar rootroot/* * $Id: jl.c,v 2.113.2.4 2000/09/01 09:31:20 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4 */ /* Nihongo Henkan Hi-level Library */ #include "commonhd.h" #include "config.h" #include #include #ifdef SYSVR2 # include #endif #ifdef BSD42 # include #endif #include #include #include #include "wnnerror.h" #include "jd_sock.h" #include "jslib.h" #include "jllib.h" #include "mt_jlib.h" #include "msg.h" #include "serverdefs.h" #include "wnn_string.h" extern struct msg_cat *wnn_msg_cat; #define MAXENVS WNN_MAX_ENV_OF_A_CLIENT #define MAXINCLUDE 10 #define DEFAULT_BUN_LEN 3 #define DEFAULT_ZENKOUHO_LEN 3 #define DEFAULT_HEAP_LEN 3 #define INCREMENT 2 #define SHO 0 #define DAI 1 #define IKEIJI 2 /* ==WNN_IKEIJI */ #define BUN 0 #define ZENKOUHO 1 /* Must not change!, they are assigned to two bit flag */ #define ZENKOUHO_DAI 3 /* DAI << 1 | ZENKOUHO */ #define ZENKOUHO_IKEIJI_DAI 5 /* IKEIJI << 1 | ZENKOUHO */ #define if_dead_disconnect(env) \ { \ if (env_wnn_errorno_eql == WNN_JSERVER_DEAD) { \ jl_disconnect_if_server_dead_body((WNN_ENV_INT *)env);\ } \ } #define if_dead_disconnect_b(buf) \ { \ if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) { \ jl_disconnect_if_server_dead_body((WNN_ENV_INT *) \ ((WNN_BUF_MT *)buf)->orig.env);\ ((WNN_BUF_MT *)buf)->orig.env = NULL; \ } \ } #define ARGS char #define env_wnn_errorno_set wnn_errorno #define env_wnn_errorno_eql wnn_errorno #define env_wnn_errorno_copy(env) {} #define buf_wnn_errorno_set wnn_errorno #define buf_wnn_errorno_eql wnn_errorno #define buf_wnn_errorno_copy(buf) {} #define env_rb rb #define buf_rb rb static struct wnn_ret_buf rb = {0, NULL}; static struct wnn_ret_buf dicrb = {0, NULL}; static struct wnn_ret_buf wordrb = {0, NULL}; static int dumbhinsi; static w_char *mae_fzk; static int syuutanv; static int syuutanv1; int confirm_state; # ifdef KOREAN static int kwnn_tankan = -1; static int kwnn_hangul = -1; static int kwnn_meisi = -1; static int kwnn_fuzokugo = -1; # endif /* KOREAN */ static int wnn_rendaku = -1; static int wnn_settou = -1; static int wnn_meisi = -1; /* ³Ø½¬¾ðÊ󼫯°¥»¡¼¥ÖÍѳÎÄꥫ¥¦¥ó¥¿¡¼ */ static int kakutei_count = 0; #define jl_get_yomi_body(buf, bun_no, bun_no2, area) \ wnn_get_area_body(buf, bun_no, bun_no2, area, WNN_YOMI) #define jl_get_kanji_body(buf, bun_no, bun_no2, area) \ wnn_get_area_body(buf, bun_no, bun_no2, area, WNN_KANJI) #define CONFIRM 1 #define CONFIRM1 2 #define CREATE_WITHOUT_CONFIRM 3 #define NO_CREATE 4 static void add_down_bnst(); static int alloc_heap(); static int call_error_handler(); static int change_ascii_to_int(); static int create_file(); static int dai_end(); static int expand_expr(); static int expand_expr_all(); static int file_discard(); static int file_exist(); static int file_read(); static int file_remove(); static int find_same_kouho(); static int find_same_kouho_dai(); static void free_bun(); static void free_down(); static void free_sho(); static void free_zenkouho(); static int get_c_jikouho(); static int get_c_jikouho_dai(); static int get_c_jikouho_from_zenkouho(); static int get_c_jikouho_from_zenkouho_dai(); static int get_pwd(); static int insert_dai(); static int insert_sho(); static int jl_set_env_wnnrc1_body(); static int jl_yomi_len_body(); static int make_dir1(); static int make_dir_rec1(); static void make_space_for(); static void make_space_for_bun(); static void make_space_for_zenkouho(); static void message_out(); static int ren_conv1(), ren_conv_sub(); static int nobi_conv_sub(); static void set_dai(); static void set_sho(); static int tan_conv1(), tan_conv_sub(); static int wnn_get_area_body(); static w_char *wnn_area(); static void _Sstrcpy(); static int jl_hinsi_number_e_body(); static int zen_conv_sho1(); static int zen_conv_dai1(); static int set_ima_off(); static int optimize_in_lib(); static int optimize_in_server(); static int insert_dai_or_ikeiji(); static int jl_dic_save_all_e_body(); /* * Sub-routines to handle files, enviroments and connections. */ struct wnn_file_name_id { struct wnn_file_name_id *next; int id; char name[1]; }; struct wnn_jl_env{ WNN_JSERVER_ID *js; struct wnn_env_int *env; char env_n[WNN_ENVNAME_LEN]; char server_n[WNN_HOSTLEN]; char lang[32]; int ref_cnt; struct wnn_file_name_id *file; } envs[MAXENVS]; static void initialize_envs() { int i; for (i = 0; i < MAXENVS; i++) { envs[i].ref_cnt = 0; } } /* * File management routines. */ static struct wnn_jl_env *find_jl_env(env) register struct wnn_env_int *env; { register int k; for(k = 0 ; k < MAXENVS; k++){ if(envs[k].env == env) return(envs + k); } return(NULL); } static struct wnn_env_int * find_env_of_same_js_id(js_id) register WNN_JSERVER_ID *js_id; { register int k; for(k = 0 ; k < MAXENVS; k++){ if (envs[k].js == NULL) continue; if (envs[k].js->sd == js_id->sd){ return(envs[k].env); } } return(NULL); } static WNN_JSERVER_ID * find_same_env_server(env_n, server_n, lang) register char *env_n, *server_n, *lang; { register int k; if (server_n == NULL || lang == NULL) return(NULL); for(k = 0 ; k < MAXENVS; k++){ if(strncmp(envs[k].server_n, server_n, WNN_HOSTLEN - 1) == 0 && strcmp(envs[k].lang, lang) == 0){ return(envs[k].js); } } return(NULL); } static int find_same_server_from_id(js) register WNN_JSERVER_ID *js; { register int k; for(k = 0 ; k < MAXENVS; k++){ if(envs[k].js == NULL) continue; if(envs[k].js->sd == js->sd) return(1); } return(0); } static struct wnn_env_int * find_same_env(js, env_n, lang) register WNN_JSERVER_ID *js; register char *env_n; char *lang; { register int k; if (env_n == NULL || lang == NULL) return(NULL); for(k = 0 ; k < MAXENVS; k++){ if(envs[k].js == js && strcmp(envs[k].env_n, env_n) == 0 && strcmp(envs[k].lang, lang) == 0){ envs[k].ref_cnt++; return(envs[k].env); } } return(NULL); } static char * env_name(env) register struct wnn_env_int *env; { register int k; for(k = 0 ; k < MAXENVS; k++){ if(envs[k].env == env){ return(envs[k].env_n); } } return(NULL); } static void add_new_env(js, env, env_n, server_n, lang) register WNN_JSERVER_ID *js; register struct wnn_env_int *env; char *env_n, *server_n, *lang; { register int k; for(k = 0 ; k < MAXENVS; k++){ if(envs[k].ref_cnt == 0){ strncpy(envs[k].server_n, server_n, WNN_HOSTLEN - 1); envs[k].server_n[WNN_HOSTLEN - 1] = '\0'; strncpy(envs[k].env_n, env_n, WNN_ENVNAME_LEN - 1); envs[k].env_n[WNN_ENVNAME_LEN - 1] = '\0'; strncpy(envs[k].lang, lang, sizeof(envs[k].lang) - 1); envs[k].lang[sizeof(envs[k].lang) - 1] = 0; envs[k].js = js; envs[k].env = env; envs[k].ref_cnt = 1; envs[k].file = NULL; break; } } } static int delete_env(env) register struct wnn_env_int *env; { register int k; for(k = 0 ; k < MAXENVS; k++){ if(envs[k].env == env){ if(--envs[k].ref_cnt == 0){ strcpy(envs[k].server_n, ""); strcpy(envs[k].env_n, ""); strcpy(envs[k].lang, ""); envs[k].js = NULL; envs[k].env = NULL; return(1); /* Need To delete env */ }else{ return(0); /* Need not to delete env */ } } } return(-1); /* This must not happen */ } /* Routines to manipulate files */ static int add_file_to_env(env, id, name) struct wnn_env_int *env; int id; register char *name; { register struct wnn_file_name_id *f, *f1; if((f = (struct wnn_file_name_id *)malloc(sizeof(struct wnn_file_name_id) + strlen(name) + 1)) == NULL){ env_wnn_errorno_set=WNN_ALLOC_FAIL; return(-1); } strcpy(f->name, name); f->id = id; LockMutex(&envs_lock); f1 = find_jl_env(env)->file; f->next = f1; find_jl_env(env)->file = f; UnlockMutex(&envs_lock); return(0); } static char * find_file_name_from_id(env, id) struct wnn_env_int *env; register int id; { register struct wnn_file_name_id *f; f = find_jl_env(env)->file; for(;f; f = f->next){ if(f->id == id){ return(f->name); } } /* env_wnn_errorno_set=WNN_FILE_NOT_READ_FROM_CLIENT; */ return(NULL); } static int delete_file_from_env(env, id) struct wnn_env_int *env; register int id; { struct wnn_file_name_id *f; register struct wnn_file_name_id **prev; register struct wnn_jl_env *jl_env_p; LockMutex(&envs_lock); jl_env_p = find_jl_env(env); if (!jl_env_p->file) { UnlockMutex(&envs_lock); return(0); } for(prev = &jl_env_p->file; (f = *prev); prev = &f->next){ if (f->id == id) { *prev = f->next; free(f); UnlockMutex(&envs_lock); return(0); } } UnlockMutex(&envs_lock); env_wnn_errorno_set=WNN_FILE_NOT_READ_FROM_CLIENT; return(-1); } /* * Libraries which handle Connection To Jserver */ struct wnn_env * jl_connect_lang(env_n, server_n, lang, wnnrc_n, error_handler, message_handler, timeout) register char *env_n, *server_n, *wnnrc_n, *lang; int (*error_handler)(), (*message_handler)(); int timeout; { register WNN_JSERVER_ID *js = NULL; struct wnn_env_int *env; int env_exist, cnt; char p_lang[16]; register char *p, *l; static int initialized_envs = 0; extern char *getenv(); DoOnce( &once, _InitMutexs ); LockMutex(&open_lock); if (!initialized_envs) { initialize_envs(); initialized_envs = 1; } wnn_errorno = 0; /* if lang not specified use $LANG */ if(!lang || !*lang){ lang = getenv("LANG"); } if (!lang || !*lang){ /* Sorry! Default is Japanese. :-) */ strcpy(p_lang, "ja_JP"); } else { /* Use only [language]_[teritorry] */ for(p = p_lang, l = lang, cnt = 0; (*l != '@') && (*l != '.') && (*l != 0) && (cnt < sizeof(p_lang) - 1) ; p++, l++, cnt++) *p = *l; *p = 0; } LockMutex(&envs_lock); /* To See serverdefs file when server_n is not specified. */ if(!server_n || !*server_n){ /* find server machine name from table by lang */ if ((server_n = wnn_get_machine_of_serverdefs(p_lang))) { if((js = find_same_env_server(env_n, server_n, p_lang)) == NULL){ if((js = js_open_lang(server_n, p_lang, timeout)) == NULL){ server_n = NULL; } } } if (!server_n || !*server_n) { server_n = "unix"; } } if (js == NULL) { if((js = find_same_env_server(env_n, server_n, p_lang)) == NULL){ if((js = js_open_lang(server_n, p_lang, timeout)) == NULL){ UnlockMutex(&envs_lock); UnlockMutex(&open_lock); return(NULL); } /* js_hinsi_list(js); */ } } if ((env_exist = js_env_exist(js, env_n)) < 0) { UnlockMutex(&envs_lock); UnlockMutex(&open_lock); return (NULL); } if((env = find_same_env(js, env_n, p_lang)) == NULL){ /* Incr ref_cnt */ if((env = (WNN_ENV_INT *)js_connect_lang(js, env_n, p_lang)) == NULL){ UnlockMutex(&envs_lock); UnlockMutex(&open_lock); return(NULL); } InitMutex(&(env->env_lock)); # ifdef KOREAN if(!strncmp(lang, WNN_K_LANG, 5)) { w_char tmp[8]; _Sstrcpy(tmp, "Ó¤í®"); kwnn_tankan = jl_hinsi_number_e_body(env, tmp); _Sstrcpy(tmp, "ÇѱÛ"); kwnn_hangul = jl_hinsi_number_e_body(env, tmp); _Sstrcpy(tmp, "Ù£Þò"); kwnn_meisi = jl_hinsi_number_e_body(env, tmp); _Sstrcpy(tmp, "ݾáÕåÞ"); kwnn_fuzokugo = jl_hinsi_number_e_body(env, tmp); } # endif /* KOREAN */ if(!strncmp(lang, WNN_J_LANG, 5)) { w_char tmp[8]; _Sstrcpy(tmp, WNN_HINSI_RENDAKU); wnn_rendaku = jl_hinsi_number_e_body(env, tmp); _Sstrcpy(tmp, WNN_HINSI_SETTOUO); wnn_settou = jl_hinsi_number_e_body(env, tmp); _Sstrcpy(tmp, WNN_HINSI_MEISI); wnn_meisi = jl_hinsi_number_e_body(env, tmp); } add_new_env(js, env, env_n, server_n, p_lang); } UnlockMutex(&envs_lock); if(env_exist == 0 && wnnrc_n){ jl_set_env_wnnrc(env, wnnrc_n, error_handler, message_handler); } else { unsigned long mask = WNN_ENV_BUNSETSUGIRI_LEARN_MASK | WNN_ENV_MUHENKAN_LEARN_MASK; struct wnn_henkan_env henv; if(wnnrc_n) jl_set_env_wnnrc1_body(env, wnnrc_n, error_handler, message_handler, 0, 1); if(js_get_henkan_env(env, &henv) == 0) { env->orig.muhenkan_mode = henv.muhenkan_flag; env->orig.bunsetsugiri_mode = henv.bunsetsugiri_flag; } else { env->orig.muhenkan_mode = WNN_DIC_RDONLY; env->orig.bunsetsugiri_mode = WNN_DIC_RDONLY; } } UnlockMutex(&open_lock); return((struct wnn_env *)env); } static void jl_disconnect_body(env) register struct wnn_env_int *env; { int ret; env_wnn_errorno_set = 0; LockMutex(&envs_lock); if((ret = delete_env(env)) < 0){ UnlockMutex(&envs_lock); return; } else if (ret) { js_disconnect((WNN_ENV *)env); } if(!find_same_server_from_id(env->orig.js_id)){ js_close(env->orig.js_id); env->orig.js_id = 0; } UnlockMutex(&envs_lock); } void jl_disconnect(env) register struct wnn_env *env; { if(!env) return; LockMutex(&ENV_LOCK(env)); jl_disconnect_body((WNN_ENV_INT *)env); UnlockMutex(&ENV_LOCK(env)); } int jl_isconnect_e(env) register struct wnn_env *env; { if(!env) return(0); LockMutex(&ENV_LOCK(env)); if (js_isconnect(env) == 0) { UnlockMutex(&ENV_LOCK(env)); return(1); } else { UnlockMutex(&ENV_LOCK(env)); return (0); } } int jl_isconnect(buf) register struct wnn_buf *buf; { int x; if(!buf) return(0); LockMutex(&BUF_LOCK(buf)); x = jl_isconnect_e(buf->env); UnlockMutex(&BUF_LOCK(buf)); return x; } /* JSERVER ¤¬»à¤ó¤À¤é env ¤ò disconnect ¤·¤Æ²ó¤ë */ static void jl_disconnect_if_server_dead_body(env) register struct wnn_env *env; { register struct wnn_env_int *same_env; int ret; LockMutex(&envs_lock); if((ret = delete_env((WNN_ENV_INT *)env)) < 0){ UnlockMutex(&envs_lock); return; } else if (ret) { js_disconnect(env); } while ((same_env = find_env_of_same_js_id(env->js_id)) != 0) { if(delete_env(same_env)){ LockMutex(&(same_env->env_lock)); js_disconnect((WNN_ENV *)same_env); UnlockMutex(&(same_env->env_lock)); } } UnlockMutex(&envs_lock); js_close(env->js_id); /* jserver ¤¬»à¤ó¤À¸å¤Ç¤â js_id ¤ò»²¾È¤¹¤ë´Ø¿ô¤¬Â¸ºß¤¹¤ë¤Î¤Ç¡¢ NULL ¥Ý¥¤¥ó¥¿½é´ü²½¤Ï¹Ô¤ï¤º¡¢js_dead ¥Õ¥é¥°¤Ë¤è¤ê jserver ¤¬ »à¤ó¤Ç¤¤¤ë¤«¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦ */ /* env->js_id = 0; */ } void jl_disconnect_if_server_dead(env) register struct wnn_env *env; { if(!env) return; LockMutex(&ENV_LOCK(env)); jl_disconnect_if_server_dead_body((WNN_ENV_INT *)env); UnlockMutex(&ENV_LOCK(env)); } struct wnn_buf * jl_open_lang(env_n, server_n, lang, wnnrc_n, error_handler, message_handler, timeout) char *env_n, *server_n, *wnnrc_n, *lang; int (*error_handler)(), (*message_handler)(); int timeout; { register int k, dmy; register struct wnn_buf_mt *buf; struct wnn_env *env; wnn_errorno = 0; if(rb.size == 0) rb.buf = (char *)malloc((unsigned)(rb.size = 1024)); #define ALLOC_SET(pter, type, size, size_var) \ ((pter) = ((type *)malloc((unsigned)(sizeof(type) * ((size_var) = (size)))))) if(!ALLOC_SET(buf, struct wnn_buf_mt, 1, dmy)){ wnn_errorno=WNN_ALLOC_FAIL;return NULL; } buf->orig.bun_suu = 0; buf->orig.zenkouho_suu = 0; buf->orig.zenkouho_daip = 0; buf->orig.c_zenkouho = -1; buf->orig.zenkouho_bun = -1; buf->orig.zenkouho_end_bun = -1; buf->orig.free_heap = NULL; buf->orig.heap = NULL; buf->orig.zenkouho_dai_suu = 0; buf->orig.env = NULL; /* * Hideyuki Kishiba (Sep. 20, 1994) * »ÈÍѣƣɴط¸¼õ¤±¼è¤êÍѹ½Â¤ÂΤò½é´ü²½¤¹¤ë */ buf->orig.fi_rb.size = buf->orig.fi_rb.num = 0; buf->orig.fi_rb.fi_buf = NULL; /* ľÁ°³ÎÄê¾ðÊóÇÛÎó¤Î½é´ü²½ */ for(k = 0; k < WNN_PREV_BUN_SUU; k++) { buf->orig.prev_bun[k].dic_no = -2; buf->orig.prev_bun[k].real_kanjilen = 0; buf->orig.prev_bun[k].kouho[0] = 0; } if(!ALLOC_SET(buf->orig.bun, WNN_BUN *, DEFAULT_BUN_LEN, buf->orig.msize_bun) || !ALLOC_SET(buf->orig.zenkouho_dai, int, DEFAULT_ZENKOUHO_LEN + 1, buf->orig.msize_zenkouho) || !ALLOC_SET(buf->orig.zenkouho, WNN_BUN *, DEFAULT_ZENKOUHO_LEN, buf->orig.msize_zenkouho) || !ALLOC_SET(buf->orig.down_bnst, WNN_BUN *, DEFAULT_BUN_LEN, buf->orig.msize_bun) ){ wnn_errorno=WNN_ALLOC_FAIL;return NULL; } for(k = 0 ; k < DEFAULT_BUN_LEN ; k++){ buf->orig.down_bnst[k] = NULL; } if(alloc_heap(buf, DEFAULT_HEAP_LEN) == -1){ return NULL; } env = jl_connect_lang(env_n, server_n, lang, wnnrc_n, error_handler, message_handler, timeout); buf->orig.env = env; InitMutex(&BUF_LOCK(buf)); return((struct wnn_buf *)buf); } static void _Sstrcpy(ws, s) w_char *ws; unsigned char *s; { register int eesiz = -1; register unsigned char x; register w_char *ie; register unsigned char *ee; register int cs_id, non_limit = 1; int _etc_cs[3]; int cs_mask[3]; _etc_cs[0] = 2; _etc_cs[1] = 1; _etc_cs[2] = 2; cs_mask[0] = 0x8080; cs_mask[1] = 0x0080; cs_mask[2] = 0x8000; ie=ws;ee=s; for(;(non_limit?(*ee):(eesiz>0));){ x = *ee++; if(x > 0x9f || x == 0x8e || x == 0x8f){ cs_id = ((x == 0x8e)? 1 : ((x == 0x8f)? 2: 0)); if (cs_id == 1 || cs_id == 2) x = *ee++; if (_etc_cs[cs_id] <= 0) continue; if (_etc_cs[cs_id] > 1) { *ie = (w_char)(x & 0x7f) << 8; x = *ee++; } else { *ie = (w_char)0; } *ie |= (x & 0x7f); *ie++ |= cs_mask[cs_id]; eesiz -= _etc_cs[cs_id] + 1; }else{ *ie++ = x; eesiz--; } } non_limit = ((char *)ie - (char *)ws) / sizeof(w_char); ws[non_limit] = 0; } static int alloc_heap(buf, len) struct wnn_buf_mt *buf; register int len; { char **c; register WNN_BUN *d; if((c =(char **)malloc((unsigned)(len * sizeof(WNN_BUN) + sizeof(char *)))) == NULL){ buf_wnn_errorno_set=WNN_ALLOC_FAIL; return(-1); } *c = buf->orig.heap; buf->orig.heap = (char *)c; d = (WNN_BUN *)(c + 1); for(--len; len > 0 ; len--, d++){ d->free_next = d + 1; } d->free_next = buf->orig.free_heap; buf->orig.free_heap = (WNN_BUN *)(c + 1); return(0); } void jl_close(buf) register struct wnn_buf *buf; { register char *c, *next; struct wnn_buf_mt tmpbuf; if(buf == NULL) return; tmpbuf = *(WNN_BUF_MT *)buf; LockMutex(&(tmpbuf.buf_lock)); if(buf->env){ LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; jl_disconnect_body((WNN_ENV_INT *)buf->env); UnlockMutex(&(envmt->env_lock)); buf->env = 0; } if(buf->bun) free((char *)buf->bun); if(buf->zenkouho) free((char *)buf->zenkouho); if(buf->zenkouho_dai) free((char *)buf->zenkouho_dai); if(buf->down_bnst) free((char *)buf->down_bnst); for(c = buf->heap; c; c = next) { next = *(char **)c; free(c); } free((char *)buf); UnlockMutex(&(tmpbuf.buf_lock)); } /* * Conversion Libraries */ /*:::DOC_START * * Function Name: jl_ren_conv * Description : ϢʸÀáÊÑ´¹¤ò¹Ô¤¦ * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * yomi : (In) ÊÑ´¹ÆÉ¤ßʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ºï½ü¤¹¤ëʸÀá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ºï½ü¤¹¤ëʸÀá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * * Return value : -1==ERROR, else ÊÑ´¹Ê¸Àá¿ô * * Author : Hideyuki Kishiba * * Revision history: * 16-May-96: ´ß¾ì: »ÈÍѺѣƣɴط¸¥Ç¡¼¥¿¤ò½é´ü²½ * *:::DOC_END */ int jl_ren_conv(buf, yomi, bun_no, bun_no2, use_maep) register struct wnn_buf *buf; register w_char *yomi; int bun_no, bun_no2; int use_maep; { int x; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; /* »ÈÍѺѣƣɴط¸¥Ç¡¼¥¿¤ò½é´ü²½¤¹¤ë¡£ 05/16/96 H.Kishiba */ buf->fi_rb.num = 0; if(bun_no < 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } x = ren_conv_sub((WNN_BUF_MT *)buf, yomi, bun_no, bun_no2, use_maep, 0, 0, NULL, 0); UnlockMutex(&BUF_LOCK(buf)); return x; } /* End of jl_ren_conv */ /*:::DOC_START * * Function Name: jl_ren_conv_with_hinsi_name * Description : ÊÑ´¹¤Ë»ÈÍѤ¹¤ëÉÊ»ì¤ò¸ÂÄꤷ¤ÆÏ¢Ê¸ÀáÊÑ´¹¤ò¹Ô¤¦ * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * yomi : (In) ÊÑ´¹ÆÉ¤ßʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ºï½ü¤¹¤ëʸÀá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ºï½ü¤¹¤ëʸÀá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * nhinsi : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ì¿ô * hlist : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ì̾ÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : -1==ERROR, else ÊÑ´¹Ê¸Àá¿ô * * Author : Hideyuki Kishiba * * Revision history: * 16-May-96: ´ß¾ì: »ÈÍѺѣƣɴط¸¥Ç¡¼¥¿¤ò½é´ü²½ * *:::DOC_END */ int jl_ren_conv_with_hinsi_name(buf, yomi, bun_no, bun_no2, use_maep, nhinsi, hname) register struct wnn_buf *buf; register w_char *yomi; int bun_no, bun_no2; int use_maep, nhinsi; char **hname; { int x, i, hsize, *hno = NULL; w_char tmp[64]; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; /* »ÈÍѺѣƣɴط¸¥Ç¡¼¥¿¤ò½é´ü²½¤¹¤ë¡£ 05/16/96 H.Kishiba */ buf->fi_rb.num = 0; if(bun_no < 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(nhinsi) { hsize = abs(nhinsi); hno = (int *)malloc(hsize * sizeof(int)); for(i = 0; i < hsize; i++) { _Sstrcpy(tmp, hname[i]); if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) { free((char *)hno); UnlockMutex(&BUF_LOCK(buf)); return(-1); } } } x = ren_conv_sub((WNN_BUF_MT *)buf, yomi, bun_no, bun_no2, use_maep, 0, nhinsi, hno, 0); if(nhinsi) free((char *)hno); UnlockMutex(&BUF_LOCK(buf)); return x; } /* End of jl_ren_conv_with_hinsi_name */ /*:::DOC_START * * Function Name: jl_fi_ren_conv * Description : ϢʸÀá£Æ£ÉÊÑ´¹¤ò¹Ô¤¦ * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * yomi : (In) ÊÑ´¹ÆÉ¤ßʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ºï½ü¤¹¤ëʸÀá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ºï½ü¤¹¤ëʸÀá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * * Return value : -1==ERROR, else ÊÑ´¹Ê¸Àá¿ô * * Author : Hideyuki Kishiba * * Revision history: * 16-May-96: ´ß¾ì: »ÈÍѺѣƣɴط¸¥Ç¡¼¥¿¤ò½é´ü²½ * *:::DOC_END */ int jl_fi_ren_conv(buf, yomi, bun_no, bun_no2, use_maep) register struct wnn_buf *buf; register w_char *yomi; int bun_no, bun_no2; int use_maep; { int x; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; /* »ÈÍѺѣƣɴط¸¥Ç¡¼¥¿¤ò½é´ü²½¤¹¤ë¡£ 05/16/96 H.Kishiba */ buf->fi_rb.num = 0; if(bun_no < 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } x = ren_conv_sub((WNN_BUF_MT *)buf, yomi, bun_no, bun_no2, use_maep, 0, 0, NULL, 1); UnlockMutex(&BUF_LOCK(buf)); return x; } /* End of jl_fi_ren_conv */ /*:::DOC_START * * Function Name: ren_conv_sub * Description : ϢʸÀáÊÑ´¹¤Î¥µ¥Ö¥ë¡¼¥Á¥ó´Ø¿ô¤½¤Î£± * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * yomi : (In) ÊÑ´¹ÆÉ¤ßʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ºï½ü¤¹¤ëʸÀá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ºï½ü¤¹¤ëʸÀá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * fuku : (In) Ê£¹ç¸ìÍ¥ÀèÊÑ´¹¥Õ¥é¥° * nhinsi : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ì¿ô * hlist : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ìÈÖ¹æÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * fi_flag : (In) »ÈÍѤ·¤¿£Æ£É´Ø·¸¾ðÊó¤ò¡Ê¼õ¤±¼è¤é¤Ê¤¤¡¿ * ¼õ¤±¼è¤ë¡Ë¥Õ¥é¥° * * Return value : -1==ERROR, else ÊÑ´¹Ê¸Àá¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int ren_conv_sub(buf, yomi, bun_no, bun_no2, use_maep, fuku, nhinsi, hlist, fi_flag) register struct wnn_buf *buf; w_char *yomi; register int bun_no, bun_no2; int use_maep, fuku, nhinsi, *hlist, fi_flag; { int x; if(bun_no2 >= buf->bun_suu || bun_no2 < 0) bun_no2 = buf->bun_suu; free_down(buf, bun_no, bun_no2); x = ren_conv1((WNN_BUF_MT *)buf, yomi, bun_no, bun_no2, use_maep, fuku, nhinsi, hlist, fi_flag); return x; } /* End of ren_conv_sub */ /*:::DOC_START * * Function Name: ren_conv1 * Description : ϢʸÀáÊÑ´¹¤Î¥µ¥Ö¥ë¡¼¥Á¥ó´Ø¿ô¤½¤Î£² * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * yomi : (In) ÊÑ´¹ÆÉ¤ßʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ºï½ü¤¹¤ëʸÀá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ºï½ü¤¹¤ëʸÀá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * fuku : (In) Ê£¹ç¸ìÍ¥ÀèÊÑ´¹¥Õ¥é¥° * nhinsi : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ì¿ô * hlist : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ìÈÖ¹æÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * fi_flag : (In) »ÈÍѤ·¤¿£Æ£É´Ø·¸¾ðÊó¤ò¡Ê¼õ¤±¼è¤é¤Ê¤¤¡¿ * ¼õ¤±¼è¤ë¡Ë¥Õ¥é¥° * * Return value : -1==ERROR, else ÊÑ´¹Ê¸Àá¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int ren_conv1(buf, yomi, bun_no, bun_no2, use_maep, fuku, nhinsi, hlist, fi_flag) register struct wnn_buf_mt *buf; w_char *yomi; register int bun_no, bun_no2; int use_maep, fuku, nhinsi, *hlist, fi_flag; { int dcnt; struct wnn_dai_bunsetsu *dp; int size; w_char yomi1[LENGTHBUNSETSU]; if (yomi == NULL || *yomi == (w_char)0) return(0); if(bun_no2 >= buf->orig.bun_suu || bun_no2 < 0) bun_no2 = buf->orig.bun_suu; if (use_maep & WNN_USE_MAE && bun_no > 0) { dumbhinsi = buf->orig.bun[bun_no - 1]->hinsi; jl_get_yomi_body(buf, bun_no - 1, bun_no, yomi1); mae_fzk = yomi1 + buf->orig.bun[bun_no - 1]->jirilen; } else { dumbhinsi = WNN_BUN_SENTOU; mae_fzk = (w_char *)0; } if(use_maep & WNN_USE_ATO && bun_no2 < buf->orig.bun_suu){ syuutanv = buf->orig.bun[bun_no2]->kangovect; syuutanv1 = WNN_VECT_KANREN; }else{ syuutanv = WNN_VECT_KANREN; syuutanv1 = WNN_VECT_NO; if(bun_no2 < buf->orig.bun_suu){ buf->orig.bun[bun_no2]->dai_top = 1; } } if(!(buf->orig.env)) return(-1); LockMutex(&(envmt->env_lock)); if(fuku == 0 && nhinsi == 0) { if(fi_flag == 0) { /* ϢʸÀáÊÑ´¹ */ if((dcnt = js_kanren(buf->orig.env, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, WNN_VECT_BUNSETSU, &buf_rb)) < 0){ buf_wnn_errorno_copy(buf); if_dead_disconnect_b(buf); UnlockMutex(&(envmt->env_lock)); return(-1); } } else { /* ϢʸÀá£Æ£ÉÊÑ´¹ */ if((dcnt = js_fi_kanren(buf->orig.env, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, WNN_VECT_BUNSETSU, buf->orig.prev_bun, &buf_rb, &(buf->orig.fi_rb))) < 0){ buf_wnn_errorno_copy(buf); if_dead_disconnect_b(buf); UnlockMutex(&(envmt->env_lock)); return(-1); } } } else { /* ÊÑ´¹´Ä¶­»ØÄêϢʸÀáÊÑ´¹ */ if((dcnt = js_henkan_with_data(buf->orig.env, fuku, nhinsi, hlist, WNN_KANREN, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, WNN_VECT_BUNSETSU, &buf_rb)) < 0) { buf_wnn_errorno_copy(buf); if_dead_disconnect_b(buf); UnlockMutex(&(envmt->env_lock)); return(-1); } } dp = (struct wnn_dai_bunsetsu *)buf_rb.buf; free_bun(buf, bun_no, bun_no2); if(use_maep & WNN_USE_ATO && bun_no2 < buf->orig.bun_suu){ buf->orig.bun[bun_no2]->dai_top = (dp[dcnt-1].sbn[dp[dcnt-1].sbncnt-1].status_bkwd == WNN_CONNECT_BK)? 0:1; } size = insert_dai(buf, BUN, bun_no, bun_no2, dp, dcnt, 0, fuku, nhinsi, hlist); if(buf->orig.zenkouho_end_bun > bun_no && buf->orig.zenkouho_bun < bun_no2){ free_zenkouho(buf); }else if(buf->orig.zenkouho_bun >= bun_no2){ buf->orig.zenkouho_bun += size - bun_no2; buf->orig.zenkouho_end_bun += size - bun_no2; } UnlockMutex(&(envmt->env_lock)); return(buf->orig.bun_suu); } /* End of ren_conv1 */ /*:::DOC_START * * Function Name: jl_tan_conv * Description : ñʸÀáÊÑ´¹¤ò¹Ô¤¦ * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * yomi : (In) ÊÑ´¹ÆÉ¤ßʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ºï½ü¤¹¤ëʸÀá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ºï½ü¤¹¤ëʸÀá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * ich_shop : (In) ¡Ê¾®Ê¸Àá¡¿ÂçʸÀá¡ËÊÑ´¹¥Õ¥é¥° * * Return value : -1==ERROR, else ÊÑ´¹Ê¸Àá¿ô * * Author : Hideyuki Kishiba * * Revision history: * 16-May-96: ´ß¾ì: »ÈÍѺѣƣɴط¸¥Ç¡¼¥¿¤ò½é´ü²½ * *:::DOC_END */ int jl_tan_conv(buf, yomi, bun_no, bun_no2, use_maep, ich_shop) register struct wnn_buf *buf; w_char *yomi; register int bun_no, bun_no2; int use_maep, ich_shop; { int x; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; /* »ÈÍѺѣƣɴط¸¥Ç¡¼¥¿¤ò½é´ü²½¤¹¤ë¡£ 05/16/96 H.Kishiba */ buf->fi_rb.num = 0; if(bun_no < 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(tan_conv_sub((WNN_BUF_MT *)buf, yomi, bun_no, bun_no2, use_maep, ich_shop, 0, 0, NULL) == -1) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } x = buf->bun_suu; UnlockMutex(&BUF_LOCK(buf)); return x; } /* End of jl_tan_conv */ /*:::DOC_START * * Function Name: jl_tan_conv_hinsi_flag * Description : ÊÑ´¹¤Ë»ÈÍѤ¹¤ëÉÊ»ì¤ò¸ÂÄꤷ¤ÆÃ±Ê¸ÀáÊÑ´¹¤ò¹Ô¤¦ * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * yomi : (In) ÊÑ´¹ÆÉ¤ßʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ºï½ü¤¹¤ëʸÀá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ºï½ü¤¹¤ëʸÀá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * ich_shop : (In) ¡Ê¾®Ê¸Àá¡¿ÂçʸÀá¡ËÊÑ´¹¥Õ¥é¥° * hinsi_op : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ì¥Õ¥é¥° * * Return value : -1==ERROR, else ÊÑ´¹Ê¸Àá¿ô * * Author : Hideyuki Kishiba * * Revision history: * 16-May-96: ´ß¾ì: »ÈÍѺѣƣɴط¸¥Ç¡¼¥¿¤ò½é´ü²½ * *:::DOC_END */ int jl_tan_conv_hinsi_flag(buf, yomi, bun_no, bun_no2, use_maep, ich_shop, hinsi_op) register struct wnn_buf *buf; w_char *yomi; register int bun_no, bun_no2; int use_maep, ich_shop, hinsi_op; { int x, hno; w_char tmp[64]; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; /* »ÈÍѺѣƣɴط¸¥Ç¡¼¥¿¤ò½é´ü²½¤¹¤ë¡£ 05/16/96 H.Kishiba */ buf->fi_rb.num = 0; if(bun_no < 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(strncmp(js_get_lang(buf->env), WNN_J_LANG, 5)) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(hinsi_op == WNN_ZIP) _Sstrcpy(tmp, WNN_HINSI_ZIPCODE); else if(hinsi_op == WNN_TEL) _Sstrcpy(tmp, WNN_HINSI_TELNO); else if(hinsi_op == WNN_TANKAN) _Sstrcpy(tmp, WNN_HINSI_TANKAN); else { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if((hno = jl_hinsi_number_e(buf->env, tmp)) == -1) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(tan_conv_sub((WNN_BUF_MT *)buf, yomi, bun_no, bun_no2, use_maep, ich_shop, 0, 1, &hno) == -1) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } x = buf->bun_suu; UnlockMutex(&BUF_LOCK(buf)); return x; } /* jl_tan_conv_hinsi_flag */ /*:::DOC_START * * Function Name: jl_tan_conv_with_hinsi_name * Description : ÊÑ´¹¤Ë»ÈÍѤ¹¤ëÉÊ»ì¤ò¸ÂÄꤷ¤ÆÃ±Ê¸ÀáÊÑ´¹¤ò¹Ô¤¦ * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * yomi : (In) ÊÑ´¹ÆÉ¤ßʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ºï½ü¤¹¤ëʸÀá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ºï½ü¤¹¤ëʸÀá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * ich_shop : (In) ¡Ê¾®Ê¸Àá¡¿ÂçʸÀá¡ËÊÑ´¹¥Õ¥é¥° * nhinsi : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ì¿ô * hlist : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ì̾ÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : -1==ERROR, else ÊÑ´¹Ê¸Àá¿ô * * Author : Hideyuki Kishiba * * Revision history: * 16-May-96: ´ß¾ì: »ÈÍѺѣƣɴط¸¥Ç¡¼¥¿¤ò½é´ü²½ * *:::DOC_END */ int jl_tan_conv_with_hinsi_name(buf, yomi, bun_no, bun_no2, use_maep, ich_shop, nhinsi, hname) register struct wnn_buf *buf; w_char *yomi; register int bun_no, bun_no2; int use_maep, ich_shop, nhinsi; char **hname; { int i, x, hsize, *hno = NULL; w_char tmp[64]; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; /* »ÈÍѺѣƣɴط¸¥Ç¡¼¥¿¤ò½é´ü²½¤¹¤ë¡£ 05/16/96 H.Kishiba */ buf->fi_rb.num = 0; if(bun_no < 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } /* if(strncmp(js_get_lang(buf->env), WNN_J_LANG, 5) || nhinsi == 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } */ if(nhinsi) { hsize = abs(nhinsi); hno = (int *)malloc(hsize * sizeof(int)); for(i = 0; i < hsize; i++) { _Sstrcpy(tmp, hname[i]); if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) { free((char *)hno); UnlockMutex(&BUF_LOCK(buf)); return(-1); } } } if(tan_conv_sub((WNN_BUF_MT *)buf, yomi, bun_no, bun_no2, use_maep, ich_shop, 0, nhinsi, hno) == -1) { if(nhinsi) free((char *)hno); UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(nhinsi) free((char *)hno); x = buf->bun_suu; UnlockMutex(&BUF_LOCK(buf)); return x; } /* jl_tan_conv_with_hinsi_name */ /*:::DOC_START * * Function Name: tan_conv_sub * Description : ñʸÀáÊÑ´¹¤Î¥µ¥Ö¥ë¡¼¥Á¥ó´Ø¿ô¤½¤Î£± * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * yomi : (In) ÊÑ´¹ÆÉ¤ßʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ºï½ü¤¹¤ëʸÀá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ºï½ü¤¹¤ëʸÀá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * ich_shop : (In) ¡Ê¾®Ê¸Àá¡¿ÂçʸÀá¡ËÊÑ´¹¥Õ¥é¥° * fuku : (In) Ê£¹ç¸ìÍ¥ÀèÊÑ´¹¥Õ¥é¥° * nhinsi : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ì¿ô * hlist : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ìÈÖ¹æÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : -1==ERROR, else ÊÑ´¹Ê¸Àá¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int tan_conv_sub(buf, yomi, bun_no, bun_no2, use_maep, ich_shop, fuku, nhinsi, hlist) register struct wnn_buf *buf; w_char *yomi; register int bun_no, bun_no2; int use_maep, ich_shop, fuku, nhinsi, *hlist; { int x; if(bun_no2 >= buf->bun_suu || bun_no2 < 0) bun_no2 = buf->bun_suu; free_down(buf, bun_no, bun_no2); x = tan_conv1((WNN_BUF_MT *)buf, yomi, bun_no, bun_no2, use_maep, ich_shop, fuku, nhinsi, hlist); return x; } /* End of tan_conv_sub */ /*:::DOC_START * * Function Name: tan_conv1 * Description : ñʸÀáÊÑ´¹¤Î¥µ¥Ö¥ë¡¼¥Á¥ó´Ø¿ô¤½¤Î£² * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * yomi : (In) ÊÑ´¹ÆÉ¤ßʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ºï½ü¤¹¤ëʸÀá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ºï½ü¤¹¤ëʸÀá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * ich_shop : (In) ¡Ê¾®Ê¸Àá¡¿ÂçʸÀá¡ËÊÑ´¹¥Õ¥é¥° * fuku : (In) Ê£¹ç¸ìÍ¥ÀèÊÑ´¹¥Õ¥é¥° * nhinsi : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ì¿ô * hlist : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ìÈÖ¹æÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : -1==ERROR, else ÊÑ´¹Ê¸Àá¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int tan_conv1(buf, yomi, bun_no, bun_no2, use_maep, ich_shop, fuku, nhinsi, hlist) register struct wnn_buf_mt *buf; w_char *yomi; register int bun_no, bun_no2; int use_maep, ich_shop, fuku, nhinsi, *hlist; { int dcnt; struct wnn_dai_bunsetsu *dp; struct wnn_sho_bunsetsu *sp; int ret; w_char yomi1[LENGTHBUNSETSU]; if (yomi == NULL || *yomi == (w_char)0) return(0); if(bun_no2 >= buf->orig.bun_suu || bun_no2 < 0) bun_no2 = buf->orig.bun_suu; if (use_maep & WNN_USE_MAE && bun_no > 0) { dumbhinsi = buf->orig.bun[bun_no - 1]->hinsi; jl_get_yomi_body(buf, bun_no - 1, bun_no, yomi1); mae_fzk = yomi1 + buf->orig.bun[bun_no - 1]->jirilen; } else { dumbhinsi = WNN_BUN_SENTOU; mae_fzk = (w_char *)0; } if(use_maep & WNN_USE_ATO && bun_no2 < buf->orig.bun_suu){ syuutanv = buf->orig.bun[bun_no2]->kangovect; syuutanv1 = WNN_VECT_KANTAN; }else{ syuutanv = WNN_VECT_KANTAN; syuutanv1 = WNN_VECT_NO; if(bun_no2 < buf->orig.bun_suu){ buf->orig.bun[bun_no2]->dai_top = 1; } } if(!(buf->orig.env)) return(-1); LockMutex(&(envmt->env_lock)); if(ich_shop == WNN_SHO){ if(fuku == 0 && nhinsi == 0) { /* ¾®Ê¸ÀáñʸÀáÊÑ´¹ */ if((dcnt = js_kantan_sho(buf->orig.env, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, &buf_rb)) < 0){ buf_wnn_errorno_copy(buf); if_dead_disconnect_b(buf); UnlockMutex(&(envmt->env_lock)); return(-1); } } else { /* ÊÑ´¹´Ä¶­»ØÄ꾮ʸÀáñʸÀáÊÑ´¹ */ if((dcnt = js_henkan_with_data(buf->orig.env, fuku, nhinsi, hlist, WNN_KANTAN_SHO, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, WNN_VECT_BUNSETSU, &buf_rb)) < 0) { buf_wnn_errorno_copy(buf); if_dead_disconnect_b(buf); UnlockMutex(&(envmt->env_lock)); return(-1); } } sp = (struct wnn_sho_bunsetsu *)buf_rb.buf; if(use_maep & WNN_USE_ATO && bun_no2 < buf->orig.bun_suu){ buf->orig.bun[bun_no2]->dai_top = (sp[dcnt-1].status_bkwd == WNN_CONNECT_BK)? 0:1; } free_bun(buf, bun_no, bun_no2); ret = insert_sho(buf, BUN, bun_no, bun_no2, sp, dcnt, 0, fuku, nhinsi, hlist); } else { if(fuku == 0 && nhinsi == 0) { /* ÂçʸÀáñʸÀáÊÑ´¹ */ if((dcnt = js_kantan_dai(buf->orig.env, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, &buf_rb)) < 0){ buf_wnn_errorno_copy(buf); if_dead_disconnect_b(buf); UnlockMutex(&(envmt->env_lock)); return(-1); } } else { /* ÊÑ´¹´Ä¶­»ØÄêÂçʸÀáñʸÀáÊÑ´¹ */ if((dcnt = js_henkan_with_data(buf->orig.env, fuku, nhinsi, hlist, WNN_KANTAN_DAI, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, WNN_VECT_BUNSETSU, &buf_rb)) < 0) { buf_wnn_errorno_copy(buf); if_dead_disconnect_b(buf); UnlockMutex(&(envmt->env_lock)); return(-1); } } dp = (struct wnn_dai_bunsetsu *)buf_rb.buf; if(use_maep & WNN_USE_ATO && bun_no2 < buf->orig.bun_suu){ buf->orig.bun[bun_no2]->dai_top = (dp[dcnt-1].sbn[dp[dcnt-1].sbncnt-1].status_bkwd == WNN_CONNECT_BK)? 0:1; } free_bun(buf, bun_no, bun_no2); ret = insert_dai(buf, BUN, bun_no, bun_no2, dp, dcnt, 0, fuku, nhinsi, hlist); } if(buf->orig.zenkouho_end_bun > bun_no && buf->orig.zenkouho_bun < bun_no2){ free_zenkouho(buf); }else if(buf->orig.zenkouho_bun >= bun_no2){ buf->orig.zenkouho_bun += ret - bun_no2; buf->orig.zenkouho_end_bun += ret - bun_no2; } UnlockMutex(&(envmt->env_lock)); return(ret); } /* End of tan_conv1 */ /*:::DOC_START * * Function Name: jl_nobi_conv * Description : ±ä¤ÓÊÑ´¹¤ò¹Ô¤¦ * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ÊÑ´¹Ê¸Àá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * ichbn_len : (In) Âè°ìʸÀáÌܤÎŤµ * bun_no2 : (In) ÊÑ´¹Ê¸Àá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * ich_shop : (In) °ìʸÀáÌܤò¡Ê¾®Ê¸Àá¡¿ÂçʸÀá¡ËÊÑ´¹¤¹¤ë¥Õ¥é¥° * * Return value : -1==ERROR, else ÊÑ´¹Ê¸Àá¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_nobi_conv(buf, bun_no, ichbn_len, bun_no2, use_maep, ich_shop) register struct wnn_buf *buf; int ichbn_len, use_maep, ich_shop; register int bun_no, bun_no2; { int x; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(bun_no < 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(nobi_conv_sub(buf, bun_no, ichbn_len, bun_no2, use_maep, ich_shop, 0, NULL, 0) == -1) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } x = buf->bun_suu; UnlockMutex(&BUF_LOCK(buf)); return x; } /* End of jl_nobi_conv */ /*:::DOC_START * * Function Name: jl_nobi_conv_hinsi_flag * Description : ÊÑ´¹¤Ë»ÈÍѤ¹¤ëÉÊ»ì¤ò¸ÂÄꤷ¤Æ±ä¤ÓÊÑ´¹¤ò¹Ô¤¦ * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ÊÑ´¹Ê¸Àá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * ichbn_len : (In) Âè°ìʸÀáÌܤÎŤµ * bun_no2 : (In) ÊÑ´¹Ê¸Àá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * ich_shop : (In) °ìʸÀáÌܤò¡Ê¾®Ê¸Àá¡¿ÂçʸÀá¡ËÊÑ´¹¤¹¤ë¥Õ¥é¥° * hinsi_op : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ì¥Õ¥é¥° * * Return value : -1==ERROR, else ÊÑ´¹Ê¸Àá¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_nobi_conv_hinsi_flag(buf, bun_no, ichbn_len, bun_no2, use_maep, ich_shop, hinsi_op) register struct wnn_buf *buf; int ichbn_len, use_maep, ich_shop, hinsi_op; register int bun_no, bun_no2; { int x, hno; w_char tmp[64]; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(bun_no < 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(strncmp(js_get_lang(buf->env), WNN_J_LANG, 5)) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(hinsi_op == WNN_ZIP) _Sstrcpy(tmp, WNN_HINSI_ZIPCODE); else if(hinsi_op == WNN_TEL) _Sstrcpy(tmp, WNN_HINSI_TELNO); else if(hinsi_op == WNN_TANKAN) _Sstrcpy(tmp, WNN_HINSI_TANKAN); else { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if((hno = jl_hinsi_number_e(buf->env, tmp)) == -1) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(nobi_conv_sub(buf, bun_no, ichbn_len, bun_no2, use_maep, ich_shop, 1, &hno, 0) == -1) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } x = buf->bun_suu; UnlockMutex(&BUF_LOCK(buf)); return x; } /* jl_nobi_conv_hinsi_flag */ /*:::DOC_START * * Function Name: jl_nobi_conv_with_hinsi_name * Description : ÊÑ´¹¤Ë»ÈÍѤ¹¤ëÉÊ»ì¤ò¸ÂÄꤷ¤Æ±ä¤ÓÊÑ´¹¤ò¹Ô¤¦ * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ÊÑ´¹Ê¸Àá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * ichbn_len : (In) Âè°ìʸÀáÌܤÎŤµ * bun_no2 : (In) ÊÑ´¹Ê¸Àá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * ich_shop : (In) °ìʸÀáÌܤò¡Ê¾®Ê¸Àá¡¿ÂçʸÀá¡ËÊÑ´¹¤¹¤ë¥Õ¥é¥° * nhinsi : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ì¿ô * hname : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ì̾ÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : -1==ERROR, else ÊÑ´¹Ê¸Àá¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_nobi_conv_with_hinsi_name(buf, bun_no, ichbn_len, bun_no2, use_maep, ich_shop, nhinsi, hname) register struct wnn_buf *buf; int ichbn_len, use_maep, ich_shop, nhinsi; register int bun_no, bun_no2; char **hname; { int x, i, hsize, *hno = NULL; w_char tmp[64]; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(bun_no < 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } /* if(strncmp(js_get_lang(buf->env), WNN_J_LANG, 5) || nhinsi == 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } */ if(nhinsi) { hsize = abs(nhinsi); hno = (int *)malloc(hsize * sizeof(int)); for(i = 0; i < hsize; i++) { _Sstrcpy(tmp, hname[i]); if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) { free((char *)hno); UnlockMutex(&BUF_LOCK(buf)); return(-1); } } } if(nobi_conv_sub(buf, bun_no, ichbn_len, bun_no2, use_maep, ich_shop, nhinsi, hno, 0) == -1) { if(nhinsi) free((char *)hno); UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(nhinsi) free((char *)hno); x = buf->bun_suu; UnlockMutex(&BUF_LOCK(buf)); return x; } /* End of jl_nobi_conv_with_hinsi_name */ /*:::DOC_START * * Function Name: jl_fi_nobi_conv * Description : £Æ£É±ä¤ÓÊÑ´¹¤ò¹Ô¤¦ * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ÊÑ´¹Ê¸Àá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * ichbn_len : (In) Âè°ìʸÀáÌܤÎŤµ * bun_no2 : (In) ÊÑ´¹Ê¸Àá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * ich_shop : (In) °ìʸÀáÌܤò¡Ê¾®Ê¸Àá¡¿ÂçʸÀá¡ËÊÑ´¹¤¹¤ë¥Õ¥é¥° * * Return value : -1==ERROR, else ÊÑ´¹Ê¸Àá¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_fi_nobi_conv(buf, bun_no, ichbn_len, bun_no2, use_maep, ich_shop) register struct wnn_buf *buf; int ichbn_len, use_maep, ich_shop; register int bun_no, bun_no2; { int x; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(bun_no < 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(nobi_conv_sub(buf, bun_no, ichbn_len, bun_no2, use_maep, ich_shop, 0, NULL, 1) == -1) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } x = buf->bun_suu; UnlockMutex(&BUF_LOCK(buf)); return x; } /* End of jl_fi_nobi_conv */ /*:::DOC_START * * Function Name: nobi_conv_sub * Description : ±ä¤ÓÊÑ´¹¤Î¥µ¥Ö¥ë¡¼¥Á¥ó´Ø¿ô * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ÊÑ´¹Ê¸Àá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * ichbn_len : (In) Âè°ìʸÀáÌܤÎŤµ * bun_no2 : (In) ÊÑ´¹Ê¸Àá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * use_maep : (In) Á°¸å¤ÎÀܳ¤ò¡Ê»È¤¦¡¿Èݡ˥ե饰 * ich_shop : (In) °ìʸÀáÌܤò¡Ê¾®Ê¸Àá¡¿ÂçʸÀá¡ËÊÑ´¹¤¹¤ë¥Õ¥é¥° * nhinsi : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ì¿ô * hlist : (In) ÉÊ»ì»ØÄêÊÑ´¹»þ¤Î»ØÄêÉÊ»ìÈÖ¹æÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ * fi_flag : (In) »ÈÍѤ·¤¿£Æ£É´Ø·¸¾ðÊó¤ò¡Ê¼õ¤±¼è¤é¤Ê¤¤¡¿ * ¼õ¤±¼è¤ë¡Ë¥Õ¥é¥° * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int nobi_conv_sub(buf, bun_no, ichbn_len, bun_no2, use_maep, ich_shop, nhinsi, hlist, fi_flag) register struct wnn_buf *buf; int ichbn_len, use_maep, ich_shop, nhinsi, *hlist, fi_flag; register int bun_no, bun_no2; { w_char yomi[LENGTHCONV], ytmp; int ret; int len1; register WNN_BUN *b1; /* ³Ø½¬¤¬¤¦¤Þ¤¯¤¤¤¯¤è¤¦¤ËÊѹ¹¤·¤Þ¤·¤¿¡£H.T. */ if(bun_no2 >= buf->bun_suu || bun_no2 < 0) bun_no2 = buf->bun_suu; len1 = jl_get_yomi_body((WNN_BUF_MT *)buf, bun_no, bun_no2, yomi); ytmp = yomi[ichbn_len]; if(len1 < ichbn_len){ ichbn_len = len1; } yomi[ichbn_len] = 0; if(buf->bun[bun_no]->nobi_top != 1){ /* need to add down_bnst */ if(buf->bun[bun_no]) add_down_bnst((WNN_BUF_MT *)buf, bun_no, buf->bun[bun_no]); if(bun_no + 1 < buf->bun_suu){ add_down_bnst((WNN_BUF_MT *)buf, bun_no, buf->bun[bun_no + 1]); /* Á´¤Æ bun_no ¤Î down_bnst ¤Ë²Ã¤¨¤ë¤è¤¦¤ËÊѹ¹ */ } } b1 = buf->down_bnst[bun_no]; buf->down_bnst[bun_no] = NULL; free_down((WNN_BUF_MT *)buf, bun_no, bun_no2); if((ret = tan_conv1((WNN_BUF_MT *)buf, yomi, bun_no, bun_no2, use_maep & WNN_USE_MAE, ich_shop, 0, nhinsi, hlist)) == -1) return(-1); yomi[ichbn_len] = ytmp; if(ytmp){ int maep; if(ich_shop){ maep = use_maep & ~WNN_USE_MAE; }else{ maep = use_maep | WNN_USE_MAE; } if(ren_conv1((WNN_BUF_MT *)buf, yomi + ichbn_len, ret, ret, maep, 0, 0, NULL, fi_flag) == -1) return(-1); } buf->bun[bun_no]->nobi_top = 1; buf->down_bnst[bun_no] = b1; return(0); } /* End of nobi_conv_sub */ int jl_nobi_conv_e2(buf, env, bun_no, ichbn_len, bun_no2, use_maep, ich_shop) register struct wnn_buf *buf; struct wnn_env *env; int ichbn_len, use_maep, ich_shop; register int bun_no, bun_no2; { w_char yomi[LENGTHCONV], ytmp; int ret; int len1; int x; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(bun_no < 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(bun_no2 >= buf->bun_suu || bun_no2 < 0) bun_no2 = buf->bun_suu; len1 = jl_get_yomi_body((WNN_BUF_MT *)buf, bun_no, bun_no2, yomi); ytmp = yomi[ichbn_len]; if(len1 < ichbn_len){ ichbn_len = len1; } yomi[ichbn_len] = 0; if(buf->bun[bun_no]->nobi_top != 1){ /* need to add down_bnst */ if(buf->bun[bun_no]) add_down_bnst((WNN_BUF_MT *)buf, bun_no, buf->bun[bun_no]); if(bun_no + 1 < buf->bun_suu){ if(ichbn_len < jl_yomi_len_body((WNN_BUF_MT *)buf, bun_no, bun_no + 1)){ add_down_bnst((WNN_BUF_MT *)buf, bun_no + 1, buf->bun[bun_no + 1]); free_down((WNN_BUF_MT *)buf, bun_no + 2, bun_no2); }else{ add_down_bnst((WNN_BUF_MT *)buf, bun_no, buf->bun[bun_no + 1]); free_down((WNN_BUF_MT *)buf, bun_no + 1, bun_no2); } } } if((ret = tan_conv1((WNN_BUF_MT *)buf, yomi, bun_no, bun_no2, use_maep & WNN_USE_MAE, ich_shop, 0, 0, NULL)) == -1){ UnlockMutex(&BUF_LOCK(buf)); return(-1); } buf->env = env; yomi[ichbn_len] = ytmp; if(ytmp){ int maep; if(ich_shop){ maep = use_maep & ~WNN_USE_MAE; }else{ maep = use_maep | WNN_USE_MAE; } if(ren_conv1((WNN_BUF_MT *)buf, yomi + ichbn_len, ret, ret, maep, 0, 0, NULL, 0) == -1){ UnlockMutex(&BUF_LOCK(buf)); return(-1); } } buf->bun[bun_no]->nobi_top = 1; x = buf->bun_suu; UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_kill(buf, bun_no, bun_no2) struct wnn_buf *buf; register int bun_no, bun_no2; { int x; if(!buf) return(0); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(bun_no < 0) { UnlockMutex(&BUF_LOCK(buf)); return(0); } if(bun_no2 < bun_no || bun_no2 < 0) bun_no2 = buf->bun_suu; free_zenkouho((WNN_BUF_MT *)buf); /* toriaezu */ free_down((WNN_BUF_MT *)buf, bun_no, bun_no2); free_bun((WNN_BUF_MT *)buf, bun_no, bun_no2); bcopy((char *)&buf->bun[bun_no2], (char *)&buf->bun[bun_no], (buf->bun_suu - bun_no2) * sizeof(WNN_BUN *)); bcopy((char *)&buf->down_bnst[bun_no2], (char *)&buf->down_bnst[bun_no], (buf->bun_suu - bun_no2) * sizeof(WNN_BUN *)); buf->bun_suu -= bun_no2 - bun_no; x = buf->bun_suu; UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_zenkouho(buf, bun_no, use_maep, uniq_level) register struct wnn_buf *buf; int bun_no, use_maep, uniq_level; { int x; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; x = zen_conv_sho1(buf, bun_no, use_maep, uniq_level, 0, 0, NULL); UnlockMutex(&BUF_LOCK(buf)); return x; } static int zen_conv_sho1(buf, bun_no, use_maep, uniq_level, fuku, nhinsi, hlist) register struct wnn_buf *buf; int bun_no, use_maep, uniq_level, fuku, nhinsi, *hlist; { register struct wnn_buf_mt *buf_m = (WNN_BUF_MT *)buf; int cnt; w_char yomi[LENGTHBUNSETSU], yomi1[LENGTHBUNSETSU]; struct wnn_sho_bunsetsu *sp; register int k; int x; int nobi_top; jl_get_yomi_body(buf_m, bun_no, bun_no + 1, yomi); if (use_maep & WNN_USE_MAE && bun_no > 0) { dumbhinsi = buf->bun[bun_no - 1]->hinsi; jl_get_yomi_body(buf_m, bun_no - 1, bun_no, yomi1); mae_fzk = yomi1 + buf->bun[bun_no - 1]->jirilen; } else { dumbhinsi = WNN_BUN_SENTOU; mae_fzk = (w_char *)0; } if(use_maep & WNN_USE_ATO && bun_no + 1 < buf->bun_suu){ syuutanv = buf->bun[bun_no+1]->kangovect; syuutanv1 = WNN_VECT_KANZEN; buf->zenkouho_endvect = syuutanv; }else{ syuutanv = WNN_VECT_KANZEN; syuutanv1 = WNN_VECT_NO; if(bun_no + 1 < buf->bun_suu){ buf->bun[bun_no + 1]->dai_top = 1; } buf->zenkouho_endvect = -1; } if(!(buf->env)) return(-1); LockMutex(&(envmt->env_lock)); if(fuku == 0 && nhinsi == 0) { if(buf->bun[bun_no]->fukugou == 0 && buf->bun[bun_no]->num_hinsi == 0) { if((cnt = js_kanzen_sho(buf->env, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, &buf_rb)) < 0){ buf_wnn_errorno_copy(buf_m); if_dead_disconnect_b(buf_m); UnlockMutex(&(envmt->env_lock)); return(-1); } } else { fuku = buf->bun[bun_no]->fukugou; nhinsi = buf->bun[bun_no]->num_hinsi; hlist = buf->bun[bun_no]->hinsi_list; if((cnt = js_henkan_with_data(buf->env, fuku, nhinsi, hlist, WNN_KANZEN_SHO, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, WNN_VECT_BUNSETSU, &buf_rb)) < 0){ buf_wnn_errorno_copy(buf_m); if_dead_disconnect_b(buf_m); UnlockMutex(&(envmt->env_lock)); return(-1); } } } else { if((cnt = js_henkan_with_data(buf->env, fuku, nhinsi, hlist, WNN_KANZEN_SHO, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, WNN_VECT_BUNSETSU, &buf_rb)) < 0){ buf_wnn_errorno_copy(buf_m); if_dead_disconnect_b(buf_m); UnlockMutex(&(envmt->env_lock)); return(-1); } } sp = (struct wnn_sho_bunsetsu *)buf_rb.buf; free_zenkouho(buf_m); nobi_top = buf->bun[bun_no]->nobi_top; /* ÂçʸÀἡ¸õÊä¤ò¼è¤Ã¤¿¤¢¤È¡¢ÉÊ»ì»ØÄêÊÑ´¹¡Ê¾®Ê¸Àá¡Ë¤ò¤·¤ÆÁ´¸õÊä¿ô (cnt) ¤¬ 0 ¤Î¾ì¹ç¶õ¤Î¼¡¸õÊä¥ê¥¹¥È¤¬É½¼¨¤µ¤ì¤ë¤Î¤Ç¡¢¥Á¥§¥Ã¥¯¤òÄɲä·¤ÆÀµ¤·¤¯ ½èÍý¤µ¤ì¤ë¤è¤¦¤Ë¤¹¤ë¡£06/05/96 H.Kishiba */ if((buf->bun[bun_no]->from_zenkouho & 1) == BUN || cnt == 0){ set_sho(buf->bun[bun_no], &buf->zenkouho[0]); buf->zenkouho_suu = 1; /* Connection information of Old bunsetsu * May not be correct. */ k = get_c_jikouho(sp, cnt, buf->bun[bun_no]); if(k >= 0){ buf->zenkouho[0]->dai_top = (sp[k].status == WNN_CONNECT)? 0:1; buf->zenkouho[0]->dai_end = (sp[k].status_bkwd == WNN_CONNECT_BK)? 0:1; } if(uniq_level || k < 0){ insert_sho(buf_m, ZENKOUHO, -1, -1, sp, cnt, uniq_level, fuku, nhinsi, hlist); }else{ insert_sho(buf_m, ZENKOUHO, -1, -1, sp, k, uniq_level, fuku, nhinsi, hlist); insert_sho(buf_m, ZENKOUHO, -1, -1, sp + k + 1, cnt - k - 1, uniq_level, fuku, nhinsi, hlist); } buf->c_zenkouho = 0; }else{ insert_sho(buf_m, ZENKOUHO, -1, -1, sp, cnt, uniq_level, fuku, nhinsi, hlist); k = get_c_jikouho_from_zenkouho(buf_m, buf->bun[bun_no]); if(k < 0){ k = 0; /* Only when the kouho has been removed from dict. */ } buf->c_zenkouho = k; } buf->zenkouho_bun = bun_no; buf->zenkouho_end_bun = bun_no + 1; buf->zenkouho_daip = SHO; for(k = 0 ; k < buf->zenkouho_suu; k++){ /* ¼¡¸õÊä¥ê¥¹¥È¤ÎÀèÆ¬¤Î¸õÊä¤ËÂФ·¤Æ¤Ïɬ¤ºº£¥Ó¥Ã¥È¤òÍî¤È¤¹¤è¤¦¤Ë¤¹¤ë ¡ÊʸÀáĹºÇ½ª»ÈÍѺÇÍ¥Àè¡Ë */ if(k == 0 || (buf->zenkouho[k]->ima && buf->zenkouho[k]->dic_no != -1)){ add_down_bnst(buf_m, bun_no, buf->zenkouho[k]); } /* * ʸÀá¿­¤Ð¤·/½Ì¤á¤ò¹Ô¤Ã¤¿¸å¼¡¸õÊä¤ò¼è¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¼¡¸õÊä¤ÎʸÀá¾ðÊó * ¤Ë¤âʸÀá¿­¤Ð¤·/½Ì¤á¤Î¾ðÊó¤ò¤Ä¤±¤Æ¤ª¤¯¡£Ê¸ÀáÀÚ¤ê³Ø½¬¤Ç»ÈÍѤ¹¤ë¡£ */ if (nobi_top) buf->zenkouho[k]->nobi_top = 1; } x = buf->c_zenkouho; UnlockMutex(&(envmt->env_lock)); return x; } int jl_zenkouho_hinsi_flag(buf, bun_no, use_maep, uniq_level, hinsi_op) register struct wnn_buf *buf; int bun_no, use_maep, uniq_level, hinsi_op; { int x, hno; w_char tmp[64]; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(strncmp(js_get_lang(buf->env), WNN_J_LANG, 5)) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(hinsi_op == WNN_ZIP) _Sstrcpy(tmp, WNN_HINSI_ZIPCODE); else if(hinsi_op == WNN_TEL) _Sstrcpy(tmp, WNN_HINSI_TELNO); else if(hinsi_op == WNN_TANKAN) _Sstrcpy(tmp, WNN_HINSI_TANKAN); else { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if((hno = jl_hinsi_number_e(buf->env, tmp)) == -1) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } x = zen_conv_sho1(buf, bun_no, use_maep, uniq_level, 0, 1, &hno); UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_zenkouho_with_hinsi_name(buf, bun_no, use_maep, uniq_level, nhinsi, hname) register struct wnn_buf *buf; int bun_no, use_maep, uniq_level, nhinsi; char **hname; { int x, i, hsize, *hno = NULL; w_char tmp[64]; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; /* if(strncmp(js_get_lang(buf->env), WNN_J_LANG, 5) || nhinsi == 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } */ if(nhinsi){ hsize = abs(nhinsi); hno = (int *)malloc(hsize * sizeof(int)); for(i = 0; i < hsize; i++) { _Sstrcpy(tmp, hname[i]); if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) { free((char *)hno); UnlockMutex(&BUF_LOCK(buf)); return(-1); } } } x = zen_conv_sho1(buf, bun_no, use_maep, uniq_level, 0, nhinsi, hno); if(nhinsi) free((char *)hno); UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_zenkouho_dai(buf, bun_no, bun_no2, use_maep, uniq_level) register struct wnn_buf *buf; int bun_no, bun_no2, use_maep, uniq_level; { int x; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; x = zen_conv_dai1(buf, bun_no, bun_no2, use_maep, uniq_level, 0, 0, NULL); UnlockMutex(&BUF_LOCK(buf)); return x; } static int zen_conv_dai1(buf, bun_no, bun_no2, use_maep, uniq_level, fuku, nhinsi, hlist) register struct wnn_buf *buf; int bun_no, bun_no2, use_maep, uniq_level, fuku, nhinsi, *hlist; { register struct wnn_buf_mt *buf_m = (WNN_BUF_MT *)buf; int cnt; w_char yomi[LENGTHBUNSETSU], yomi1[LENGTHBUNSETSU]; struct wnn_dai_bunsetsu *dp; int tmp; register int k; int x; int nobi_top; if(bun_no2 > (tmp = dai_end(buf_m, bun_no)) || bun_no2 < 0) bun_no2 = tmp; jl_get_yomi_body(buf_m, bun_no, bun_no2, yomi); if (use_maep & WNN_USE_MAE && bun_no > 0) { dumbhinsi = buf->bun[bun_no - 1]->hinsi; jl_get_yomi_body(buf_m, bun_no - 1, bun_no, yomi1); mae_fzk = yomi1 + buf->bun[bun_no - 1]->jirilen; } else { dumbhinsi = WNN_BUN_SENTOU; mae_fzk = (w_char *)0; } if(use_maep & WNN_USE_ATO && bun_no2 < buf->bun_suu){ syuutanv = buf->bun[bun_no2]->kangovect; syuutanv1 = WNN_VECT_KANZEN; buf->zenkouho_endvect = syuutanv; }else{ syuutanv = WNN_VECT_KANZEN; syuutanv1 = WNN_VECT_NO; if(bun_no2 < buf->bun_suu){ buf->bun[bun_no2]->dai_top = 1; } buf->zenkouho_endvect = -1; } if(!(buf->env)) return(-1); LockMutex(&(envmt->env_lock)); if(fuku == 0 && nhinsi == 0) { if(buf->bun[bun_no]->fukugou == 0 && buf->bun[bun_no]->num_hinsi == 0) { if((cnt = js_kanzen_dai(buf->env, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, &buf_rb)) < 0){ buf_wnn_errorno_copy(buf_m); if_dead_disconnect_b(buf_m); UnlockMutex(&(envmt->env_lock)); return(-1); } } else { fuku = buf->bun[bun_no]->fukugou; nhinsi = buf->bun[bun_no]->num_hinsi; hlist = buf->bun[bun_no]->hinsi_list; if((cnt = js_henkan_with_data(buf->env, fuku, nhinsi, hlist, WNN_KANZEN_DAI, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, WNN_VECT_BUNSETSU, &buf_rb)) < 0) { buf_wnn_errorno_copy(buf_m); if_dead_disconnect_b(buf_m); UnlockMutex(&(envmt->env_lock)); return(-1); } } } else { if((cnt = js_henkan_with_data(buf->env, fuku, nhinsi, hlist, WNN_KANZEN_DAI, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, WNN_VECT_BUNSETSU, &buf_rb)) < 0) { buf_wnn_errorno_copy(buf_m); if_dead_disconnect_b(buf_m); UnlockMutex(&(envmt->env_lock)); return(-1); } } dp = (struct wnn_dai_bunsetsu *)buf_rb.buf; free_zenkouho(buf_m); /* Wander if it is OK, that is, only when all the * zenkouho's are got from zenkouho_dai, we need not move * the current dai-bunsetsu to the top of zenkouho's */ for(k = bun_no; k < bun_no2; k++){ if(buf->bun[k]->from_zenkouho != ZENKOUHO_DAI)break; } if (k >= bun_no2) k--; nobi_top = buf->bun[k]->nobi_top; if(k != bun_no2){ /* move the current to the top. */ make_space_for(buf_m, ZENKOUHO, buf->zenkouho_suu, buf->zenkouho_suu, bun_no2 - bun_no); set_dai(&buf->bun[bun_no], &buf->zenkouho[0], bun_no2 - bun_no); buf->zenkouho_dai[0] = 0; buf->zenkouho_dai[1] = bun_no2 - bun_no; buf->zenkouho_dai_suu = 1; buf->zenkouho_suu = bun_no2 - bun_no; k = get_c_jikouho_dai(dp, cnt, buf->bun, bun_no); if(k >= 0){ buf->zenkouho[0]->dai_top = (dp[k].sbn->status == WNN_CONNECT)? 0:1; buf->zenkouho[bun_no2-bun_no-1]->dai_end = (dp[k].sbn[dp[k].sbncnt-1].status_bkwd == WNN_CONNECT_BK)? 0:1; /* KURI *//* USO*?*/ } else if (cnt == 0) { /* ¡Ö¡¦¡×¤Ï¸õÊä¿ô¤¬ 0 ¤Ê¤Î¤Ç¡¢dai_top, dai_end ¤ò ¶¯À©Åª¤Ë 1 ¤Ë¤¹¤ë */ buf->zenkouho[0]->dai_top = 1; buf->zenkouho[bun_no2-bun_no-1]->dai_end = 1; } if(uniq_level || k < 0){ insert_dai(buf_m, ZENKOUHO, -1, -1, dp, cnt, uniq_level, fuku, nhinsi, hlist); }else{ insert_dai(buf_m, ZENKOUHO, -1, -1, dp, k, uniq_level, fuku, nhinsi, hlist); insert_dai(buf_m, ZENKOUHO, -1, -1, dp + k + 1, cnt - k - 1, uniq_level, fuku, nhinsi, hlist); } buf->c_zenkouho = 0; }else{ insert_dai(buf_m, ZENKOUHO, -1, -1, dp, cnt, uniq_level, fuku, nhinsi, hlist); k = get_c_jikouho_from_zenkouho_dai(buf_m, buf->bun[bun_no]); if(k < 0){ k = 0; /* Only when the kouho has been removed from dict. */ } buf->c_zenkouho = k; } buf->zenkouho_bun = bun_no; buf->zenkouho_end_bun = bun_no2; buf->zenkouho_daip = DAI; for(k = 0 ; k < buf->zenkouho_suu; k++){ /* ¼¡¸õÊä¥ê¥¹¥È¤ÎÀèÆ¬¤Î¸õÊä¤ËÂФ·¤Æ¤Ïɬ¤ºº£¥Ó¥Ã¥È¤òÍî¤È¤¹¤è¤¦¤Ë¤¹¤ë ¡ÊʸÀáĹºÇ½ª»ÈÍѺÇÍ¥Àè¡Ë */ if(k == 0 || (buf->zenkouho[k]->ima && buf->zenkouho[k]->dic_no != -1)) { add_down_bnst(buf_m, bun_no, buf->zenkouho[k]); } /* * ʸÀá¿­¤Ð¤·/½Ì¤á¤ò¹Ô¤Ã¤¿¸å¼¡¸õÊä¤ò¼è¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¼¡¸õÊä¤ÎʸÀá¾ðÊó * ¤Ë¤âʸÀá¿­¤Ð¤·/½Ì¤á¤Î¾ðÊó¤ò¤Ä¤±¤Æ¤ª¤¯¡£Ê¸ÀáÀÚ¤ê³Ø½¬¤Ç»ÈÍѤ¹¤ë¡£ */ if (nobi_top) buf->zenkouho[k]->nobi_top = 1; } x = buf->c_zenkouho; UnlockMutex(&(envmt->env_lock)); return x; } int jl_zenkouho_dai_hinsi_flag(buf, bun_no, bun_no2, use_maep, uniq_level, hinsi_op) register struct wnn_buf *buf; int bun_no, bun_no2, use_maep, uniq_level, hinsi_op; { int x, hno; w_char tmp[64]; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(strncmp(js_get_lang(buf->env), WNN_J_LANG, 5)) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(hinsi_op == WNN_ZIP) _Sstrcpy(tmp, WNN_HINSI_ZIPCODE); else if(hinsi_op == WNN_TEL) _Sstrcpy(tmp, WNN_HINSI_TELNO); else if(hinsi_op == WNN_TANKAN) _Sstrcpy(tmp, WNN_HINSI_TANKAN); else { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if((hno = jl_hinsi_number_e(buf->env, tmp)) == -1) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } x = zen_conv_dai1(buf, bun_no, bun_no2, use_maep, uniq_level, 0, 1, &hno); UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_zenkouho_dai_with_hinsi_name(buf, bun_no, bun_no2, use_maep, uniq_level, nhinsi, hname) register struct wnn_buf *buf; int bun_no, bun_no2, use_maep, uniq_level, nhinsi; char **hname; { int x, i, hsize, *hno = NULL; w_char tmp[64]; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; /* if(strncmp(js_get_lang(buf->env), WNN_J_LANG, 5) || nhinsi == 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } */ if(nhinsi){ hsize = abs(nhinsi); hno = (int *)malloc(hsize * sizeof(int)); for(i = 0; i < hsize; i++) { _Sstrcpy(tmp, hname[i]); if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) { free((char *)hno); UnlockMutex(&BUF_LOCK(buf)); return(-1); } } } x = zen_conv_dai1(buf, bun_no, bun_no2, use_maep, uniq_level, 0, nhinsi, hno); if(nhinsi) free((char *)hno); UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_set_jikouho(buf, offset) register struct wnn_buf *buf; register int offset; { if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(buf->zenkouho_suu <= 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(buf->zenkouho_daip == DAI){ UnlockMutex(&BUF_LOCK(buf)); return(-1); } offset = (offset + buf->zenkouho_suu) % buf->zenkouho_suu; if(buf->zenkouho_bun+1 < buf->bun_suu && buf->zenkouho_endvect != -1) buf->bun[buf->zenkouho_bun+1]->dai_top = buf->zenkouho[offset]->dai_end; free_sho((WNN_BUF_MT *)buf, &buf->bun[buf->zenkouho_bun]); set_sho(buf->zenkouho[offset], &buf->bun[buf->zenkouho_bun]); buf->c_zenkouho = offset; UnlockMutex(&BUF_LOCK(buf)); return(offset); } int jl_set_jikouho_dai(buf, offset) register struct wnn_buf *buf; int offset; { register int st, end, bun, k; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(buf->zenkouho_suu <= 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(buf->zenkouho_daip == SHO){ UnlockMutex(&BUF_LOCK(buf)); return(-1); } offset = (offset + buf->zenkouho_dai_suu) % buf->zenkouho_dai_suu; if(buf->zenkouho_end_bun < buf->bun_suu && buf->zenkouho_endvect != -1) buf->bun[buf->zenkouho_end_bun]->dai_top = buf->zenkouho[buf->zenkouho_dai[offset+1]-1]->dai_end; free_bun((WNN_BUF_MT *)buf, buf->zenkouho_bun, buf->zenkouho_end_bun); st = buf->zenkouho_dai[offset]; end = buf->zenkouho_dai[offset + 1]; make_space_for((WNN_BUF_MT *)buf, BUN, buf->zenkouho_bun, buf->zenkouho_end_bun, end - st); for(bun = buf->zenkouho_bun, k = st; k < end;){ set_sho(buf->zenkouho[k++], &buf->bun[bun++]); } buf->zenkouho_end_bun = buf->zenkouho_bun + end - st; buf->c_zenkouho = offset; UnlockMutex(&BUF_LOCK(buf)); return(offset); } /*:::DOC_START * * Function Name: do_autolearning * Description : ¼«Æ°³Ø½¬¤ò¹Ô¤¦ * js_auto_word_add()¤ò¸Æ¤Ö * Parameter : * buf : (In) wnn_buf¹½Â¤ÂΤؤΥݥ¤¥ó¥¿ * type : (In) ³Ø½¬¤¹¤ë¥¿¥¤¥×(¥«¥¿¥«¥Ê/ʸÀáÀÚ¤ê) * yomi : (In) ÆÉ¤ß * kanji : (In) ´Á»ú * hinsi : (In) ÉÊ»ì * * Return value : 0==SUCCESS, -1==ERROR * * Author : Seiji KUWARI * * Revision history: * 15-May-96: ´ß¾ì: js_autolearning_word_add() ¤¬¥¨¥é¡¼¤Ç¤â env ¤Î * ³Ø½¬ÀßÄê¤ÏÊѹ¹¤·¤Ê¤¤ * *:::DOC_END */ static int do_autolearning(env, type, yomi, kanji, hinsi) struct wnn_env *env; int type; w_char *yomi, *kanji; int hinsi; { int ret; if ((ret = js_autolearning_word_add(env, type, yomi, kanji, NULL, hinsi, 0)) == -1) { if (env_wnn_errorno_eql == WNN_JSERVER_DEAD) { jl_disconnect_body(env); } return(-1); } return(ret); } #ifdef KOREAN /* ñ´Á³Ø½¬ * ñ´Á»ú¤òÁª¤ó¤À¾ì¹ç¤Ï¡¢¤½¤ÎÁ°¤Î´Á»úʸ»úÎó¤È¤¢¤ï¤»¤Æ¼­½ñÅÐÏ¿¤¹¤ë¡£ * ¡ÖÃíʸ½ñ¡×¤Ç¡¢¡ÖÃíʸ¡×¤¬¼­½ñ¤Ë¤¢¤Ã¤Æ¡¢¡Ö½ñ¡×¤¬¡¢Ã±´Á¤Î¾ì¹ç¤Ï¡¢¡ÖÃíʸ½ñ¡× * ¤ò¼­½ñÅÐÏ¿¤¹¤ë¡£ * º£¤Ï¡¢ÉÊ»ì¤Ï̾»ì¤È¤·¤ÆÅÐÏ¿¤·¤Æ¤¤¤ë¡£ */ static int tankan_auto_learning(buf, k, hinsi) register struct wnn_buf *buf; int k; int hinsi; { int i, j; w_char tmp[LENGTHYOMI]; w_char yomi[LENGTHYOMI]; w_char kanji[LENGTHKANJI]; for (i = k; i > 0; i--) { if (buf->bun[i]->dic_no == -1) { i++; break; } wnn_area(buf->bun[i], tmp, WNN_KANJI); for (j = 0; j < buf->bun[i]->kanjilen; j++) { if (!ishanja(tmp[j])) { i++; goto _find;; } } } _find: yomi[0] = kanji[0] = 0; for ( ; i <= k; i++) { wnn_area(buf->bun[i], tmp, WNN_YOMI); wnn_Strncat(yomi, tmp, buf->bun[i]->jirilen); wnn_area(buf->bun[i], tmp, WNN_KANJI); wnn_Strncat(kanji, tmp, buf->bun[i]->kanjilen); } return(do_autolearning(buf->env, WNN_MUHENKAN_LEARNING, yomi, kanji, hinsi)); } /* ¥Ï¥ó¥°¥ë³Ø½¬ * ÊÑ´¹»þ¤ËÂè°ì¸õÊä¤È¤·¤Æ´Á»ú¤¬Áª¤Ð¤ì¤¿¤¬¡¢¥Ï¥ó¥°¥ë¤ò³ÎÄꤷ¤¿¾ì¹ç¤Ë¤½¤Î¥Ï * ¥ó¥°¥ë¤òÅÐÏ¿¤¹¤ë¡£ * ÉÊ»ì¤Ï¥Ï¥ó¥°¥ë¤È¤·¤ÆÅÐÏ¿¤·¤Æ¤¤¤ë */ static int hangul_auto_learning(buf, k, hinsi, bun_no2) register struct wnn_buf *buf; int k; int hinsi; int bun_no2; { int i, j; int find; w_char tmp[LENGTHYOMI]; w_char yomi[LENGTHYOMI]; w_char kanji[LENGTHKANJI]; yomi[0] = kanji[0] = 0; find = 0; for (i = k; i < bun_no2; i++) { wnn_area(buf->bun[i], tmp, WNN_KANJI); for (j = 0; j < buf->bun[i]->kanjilen; j++) { if (!ishangul(tmp[j])) { if (tmp[j] != ' ' && tmp[j] != JSPACE) goto _find_hangul; tmp[j] = 0; find = 1; break; } } wnn_Strncat(kanji, tmp, j); wnn_area(buf->bun[i], tmp, WNN_YOMI); wnn_Strncat(yomi, tmp, j); if (find == 1) break; } _find_hangul: return(do_autolearning(buf->env, WNN_MUHENKAN_LEARNING, yomi, kanji, hinsi)); } /* ÉÕ°¸ì³Ø½¬ * ¼«Î©¸ì¡Ü¥Ï¥ó¥°¥ë¤ò³ÎÄꤷ¤¿¾ì¹ç¤Ë¡¢¤½¤Î¥Ï¥ó¥°¥ëʸ»úÎó¤ò¤½¤Î¼«Î©¸ì¤ËÀܳ * ²Äǽ¤ÊÉÕ°¸ì¤È¤·¤ÆÅÐÏ¿¤¹¤ë¡£ * º£¤Ï¡¢µ¿»÷ʸÀá¤Î¡ÖÉÕ°¸ì¡×ÉÊ»ì¤È¤·¤ÆÅÐÏ¿¤·¤Æ¤¤¤ë¡£ */ static int fuzokugo_auto_learning(buf, k, hinsi, bun_no2) register struct wnn_buf *buf; int k; int hinsi; int bun_no2; { int i, j; int find; w_char tmp[LENGTHYOMI]; w_char yomi[LENGTHYOMI]; w_char kanji[LENGTHKANJI]; if (k <= 0 || buf->bun[k-1]->dic_no == -1) return (0); wnn_area(buf->bun[k-1], tmp, WNN_KANJI); for (j = 0; j < buf->bun[k-1]->kanjilen; j++) { if (!ishanja(tmp[j])) return(0); } yomi[0] = kanji[0] = 0; find = 0; for (i = k; i < bun_no2; i++) { wnn_area(buf->bun[i], tmp, WNN_KANJI); for (j = 0; j < buf->bun[i]->kanjilen; j++) { if (!ishangul(tmp[j])) { if (tmp[j] != ' ' && tmp[j] != JSPACE) goto _find_fzk; tmp[j] = 0; find = 1; break; } } wnn_Strncat(kanji, tmp, j); wnn_area(buf->bun[i], tmp, WNN_YOMI); wnn_Strncat(yomi, tmp, j); if (find == 1) break; } _find_fzk: return(do_autolearning(buf->env, WNN_BUNSETSUGIRI_LEARNING, yomi, kanji, hinsi)); } #endif /* KOREAN */ static int muhenkan_auto_learning(buf, wb) struct wnn_buf *buf; register WNN_BUN *wb; { int hinsi; w_char yomi[LENGTHYOMI]; w_char kanji[LENGTHKANJI]; wnn_area(wb, yomi, WNN_YOMI); wnn_area(wb, kanji, WNN_KANJI); yomi[wb->jirilen] = (w_char)0; kanji[wb->real_kanjilen] = (w_char)0; if(wb->entry == WNN_IKEIJI_ENTRY) hinsi = wb->hinsi; else hinsi = wnn_meisi; return(do_autolearning(buf->env, WNN_MUHENKAN_LEARNING, yomi, kanji, hinsi)); } static int bunsetsugiri_auto_learning(buf, wb, bun_no, bun_no2) register struct wnn_buf *buf; register WNN_BUN *wb; int bun_no, bun_no2; { register int i; register WNN_BUN *wb1; w_char yomi[LENGTHYOMI]; w_char kanji[LENGTHKANJI]; int yomilen, kanjilen, fuzokugolen, found_dai_top; wnn_area(wb, yomi, WNN_YOMI); wnn_area(wb, kanji, WNN_KANJI); yomilen = wb->yomilen; kanjilen = wb->kanjilen; wb1 = buf->bun[bun_no+1]; wnn_area(wb1, &yomi[yomilen], WNN_YOMI); wnn_area(wb1, &kanji[kanjilen], WNN_KANJI); yomilen += wb1->yomilen; kanjilen += wb1->kanjilen; fuzokugolen = wb1->yomilen - wb1->jirilen; yomi[yomilen - fuzokugolen] = (w_char)0; kanji[kanjilen - fuzokugolen] = (w_char)0; return(do_autolearning(buf->env, WNN_BUNSETSUGIRI_LEARNING, yomi, kanji, wb1->hinsi)); } static int rendaku_learning(buf, mode, wb1, bun_no, bun_no2) register struct wnn_buf *buf; register WNN_BUN *wb1; int mode, bun_no, bun_no2; { register int i; register WNN_BUN *wb; w_char yomi[LENGTHYOMI]; w_char kanji[LENGTHKANJI]; int yomilen, kanjilen, fuzokugolen, found_dai_top; wb = buf->bun[bun_no]; wnn_area(wb, yomi, WNN_YOMI); wnn_area(wb, kanji, WNN_KANJI); yomilen = wb->yomilen; kanjilen = wb->kanjilen; wnn_area(wb1, &yomi[yomilen], WNN_YOMI); wnn_area(wb1, &kanji[kanjilen], WNN_KANJI); yomilen += wb1->yomilen; kanjilen += wb1->kanjilen; fuzokugolen = wb1->yomilen - wb1->jirilen; yomi[yomilen - fuzokugolen] = (w_char)0; kanji[kanjilen - fuzokugolen] = (w_char)0; if (mode != WNN_DIC_RW) { if (js_temporary_word_add(buf->env, yomi, kanji, NULL, wnn_meisi, 0) == -1) { if (env_wnn_errorno_eql == WNN_JSERVER_DEAD) { jl_disconnect_body(buf->env); } return(-1); } return(0); } return(do_autolearning(buf->env, WNN_BUNSETSUGIRI_LEARNING, yomi, kanji, wnn_meisi)); } /*:::DOC_START * * Function Name: jl_update_hindo * Description : ³ÎÄêʸÀᤫ¤éÉÑÅÙ¾ðÊó¡Êº£¥Ó¥Ã¥È¡¦ÉÑÅ١ˤι¹¿·¤È * jlib ¤ÇȽÃǤǤ­¤ë³Ø½¬½èÍý¤ò¹Ô¤¦ * Parameter : * buf : (In) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ³ÎÄꤷ¤¿Ê¸Àá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ³ÎÄꤷ¤¿Ê¸Àá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_update_hindo(buf, bun_no, bun_no2) register struct wnn_buf *buf; int bun_no, bun_no2; { register int k; register WNN_BUN *wb; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(bun_no < 0 || !(buf->env)) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(bun_no2 >= buf->bun_suu || bun_no2 < 0) bun_no2 = buf->bun_suu; LockMutex(&(envmt->env_lock)); if( /* º£¥Ó¥Ã¥È¤òÍî¤È¤¹¤Ù¤­¸õÊä¤Îº£¥Ó¥Ã¥È¤òÍî¤È¤¹ */ set_ima_off(buf, bun_no, bun_no2, 0) == -1 || /* jlib Æâ¤ÇȽÃǤǤ­¤ë³Ø½¬½èÍý¤ò¹Ô¤¦ */ optimize_in_lib(buf, bun_no, bun_no2) == -1) { buf_wnn_errorno_copy((WNN_BUF_MT *)buf); if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) goto ERROR_RET; } /* ³ÎÄꤷ¤¿¸õÊä¤Îº£¥Ó¥Ã¥È¡¦ÉÑÅÙ¤ò¾å¤²¤ë */ for(k = bun_no; k < bun_no2; k++) { if(buf->bun[k]->hindo_updated != 1) continue; buf->bun[k]->hindo_updated = 2; wb = buf->bun[k]; if(js_hindo_set(buf->env, wb->dic_no, wb->entry, WNN_IMA_ON, WNN_HINDO_INC) == -1){ buf_wnn_errorno_copy((WNN_BUF_MT *)buf); if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) goto ERROR_RET; } } /* ³Ø½¬¾ðÊ󼫯°¥»¡¼¥Ö³ÎÄê²ó¿ô¤Ë㤷¤¿¤é¡¢¼«Æ°¥»¡¼¥Ö¤ò¹Ô¤¦ */ kakutei_count ++; if(buf->env->autosave > 0 && kakutei_count >= buf->env->autosave) { jl_dic_save_all_e_body(buf->env); kakutei_count = 0; } UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return(0); ERROR_RET: jl_disconnect_body(buf->env); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return(-1); } /* End of jl_update_hindo */ /*:::DOC_START * * Function Name: jl_optimize_fi * Description : ³ÎÄêʸÀᤫ¤éÉÑÅÙ¾ðÊó¡Êº£¥Ó¥Ã¥È¡¦ÉÑÅ١ˤι¹¿·¤È¡¢ * Wnn5 ¤ÇÄɲä·¤¿³Ø½¬½èÍý¤È£Æ£É³Ø½¬½èÍý¤ò¹Ô¤¦ * Parameter : * buf : (In) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ³ÎÄꤷ¤¿Ê¸Àá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ³ÎÄꤷ¤¿Ê¸Àá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_optimize_fi(buf, bun_no, bun_no2) register struct wnn_buf *buf; int bun_no, bun_no2; { if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(bun_no < 0 || !(buf->env)) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(strncmp(js_get_lang(buf->env), WNN_J_LANG, 5)) { UnlockMutex(&BUF_LOCK(buf)); return(jl_update_hindo(buf, bun_no, bun_no2)); } if(bun_no2 >= buf->bun_suu || bun_no2 < 0) bun_no2 = buf->bun_suu; LockMutex(&(envmt->env_lock)); if( /* º£¥Ó¥Ã¥È¤òÍî¤È¤¹¤Ù¤­¸õÊä¤È£Æ£ÉÀܳ´Ø·¸¤Îº£¥Ó¥Ã¥È¤òÍî¤È¤¹ */ set_ima_off(buf, bun_no, bun_no2, 1) == -1 || /* jlib Æâ¤ÇȽÃǤǤ­¤ë³Ø½¬½èÍý¤ò¹Ô¤¦ */ optimize_in_lib(buf, bun_no, bun_no2) == -1 || /* server Æâ¤ÇȽÃǤ¹¤ë Wnn5 ³Ø½¬½èÍý¤È£Æ£É³Ø½¬½èÍý¤ò¹Ô¤¦ */ optimize_in_server(buf, bun_no, bun_no2) == -1) { buf_wnn_errorno_copy((WNN_BUF_MT *)buf); if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) goto ERROR_RET; } /* ³Ø½¬¾ðÊ󼫯°¥»¡¼¥Ö³ÎÄê²ó¿ô¤Ë㤷¤¿¤é¡¢¼«Æ°¥»¡¼¥Ö¤ò¹Ô¤¦ */ kakutei_count ++; if(buf->env->autosave > 0 && kakutei_count >= buf->env->autosave) { jl_dic_save_all_e_body(buf->env); kakutei_count = 0; } UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return(0); ERROR_RET: jl_disconnect_body(buf->env); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return(-1); } /* End of jl_optimize_fi */ /*:::DOC_START * * Function Name: jl_reset_prev_bun * Description : Á°³ÎÄêʸÀá¾ðÊó¤ò½é´ü²½¤¹¤ë * Parameter : * buf : (In) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_reset_prev_bun(buf) register struct wnn_buf *buf; { int i; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(!(buf->env)) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } for(i = 0; i < WNN_PREV_BUN_SUU; i++) buf->prev_bun[i].dic_no = -2; UnlockMutex(&BUF_LOCK(buf)); return(0); } /* End of jl_reset_prev_bun */ /*:::DOC_START * * Function Name: set_ima_off * Description : ÊÑ´¹¤Ë»ÈÍѤµ¤ì¤Ê¤«¤Ã¤¿¸õÊä¤Îº£¥Ó¥Ã¥È¤òÍî¤È¤·¡¢£Æ£ÉÊÑ´¹Ãæ¤Ë * »ÈÍѤ·¤¿£Æ£ÉÀܳ´Ø·¸¤Îº£¥Ó¥Ã¥È¤ò¤¹¤Ù¤ÆÍî¤È¤¹ * Parameter : * buf : (In) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ³ÎÄꤷ¤¿Ê¸Àá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ³ÎÄꤷ¤¿Ê¸Àá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * fi_flag : (In) £Æ£É³Ø½¬¡Ê¤·¤Ê¤¤¡¿¤¹¤ë¡Ë¥Õ¥é¥° * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int set_ima_off(buf, bun_no, bun_no2, fi_flag) register struct wnn_buf *buf; int bun_no, bun_no2, fi_flag; { register int k; register WNN_BUN *wb; /* ¸õÊä¤Îº£¥Ó¥Ã¥È¤òÍî¤È¤¹ */ for(k = bun_no; k < bun_no2; k++){ if(buf->bun[k]->hindo_updated == 1) continue; for(wb = buf->down_bnst[k]; wb; wb = wb->down){ if(wb->bug == 1) break; wb->bug = 1; if(wb->dic_no != -1){ if(js_hindo_set(buf->env, wb->dic_no, wb->entry, WNN_IMA_OFF, WNN_HINDO_NOP) == -1) { buf_wnn_errorno_copy((WNN_BUF_MT *)buf); if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) return(-1); } } } } free_down((WNN_BUF_MT *)buf, bun_no, bun_no2); /* £Æ£ÉÀܳ´Ø·¸¤Îº£¥Ó¥Ã¥È¤òÍî¤È¤¹ */ if(fi_flag) { if(js_set_fi_priority(buf->env, &(buf->fi_rb)) == -1) { buf_wnn_errorno_copy((WNN_BUF_MT *)buf); if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) return(-1); } /* £Æ£ÉÀܳ´Ø·¸´ÉÍý¹½Â¤ÂΤνé´ü²½ */ buf->fi_rb.num = 0; } return(0); } /* End of set_ima_off */ /*:::DOC_START * * Function Name: optimize_in_lib * Description : jlib Æâ¤Ç¹Ô¤¦³Ø½¬½èÍý¤ò¤¹¤ë * Parameter : * buf : (In) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ³ÎÄꤷ¤¿Ê¸Àá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ³ÎÄꤷ¤¿Ê¸Àá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int optimize_in_lib(buf, bun_no, bun_no2) register struct wnn_buf *buf; int bun_no, bun_no2; { register int k; register WNN_BUN *wb; for(k = bun_no; k < bun_no2; k++){ if(buf->bun[k]->hindo_updated == 1) continue; buf->bun[k]->hindo_updated = 1; wb = buf->bun[k]; #ifdef KOREAN if(!strncmp(js_get_lang(buf->env), WNN_K_LANG, 5)) { /* ñ´Á³Ø½¬ */ if ((wb->hinsi == kwnn_tankan) && /* Tankan */ (buf->env->muhenkan_mode != WNN_DIC_RDONLY)) { if (tankan_auto_learning(buf, k, kwnn_meisi) == -1) { buf_wnn_errorno_copy(buf); if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) return(-1); } } /* ´Ö°ã¤Ã¤Æ´Á»ú¤ËÊÑ´¹¤·¤¿¤Î¤ò¥Ï¥ó¥°¥ëÎó¤È¤·¤Æ¼­½ñ¤ËÅÐÏ¿ */ if ((wb->from_zenkouho & 1) == ZENKOUHO && wb->hinsi == kwnn_hangul && wb->dic_no == -1 && /* Hangul */ (buf->env->muhenkan_mode != WNN_DIC_RDONLY) ) { if (hangul_auto_learning(buf, k, kwnn_hangul, bun_no2) == -1) { buf_wnn_errorno_copy(buf); if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) return(-1); } } /* ÉÕ°¸ì³Ø½¬ */ if (k > 0 && wb->hinsi == kwnn_hangul && wb->dic_no == -1 && /* Hangul */ (buf->env->bunsetsugiri_mode != WNN_DIC_RDONLY)) { if (fuzokugo_auto_learning(buf, k, kwnn_fuzokugo, bun_no2) == -1) { buf_wnn_errorno_copy(buf); if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) return(-1); } } } else #endif /* KOREAN */ { /* ¤Ò¤é¤¬¤Ê³Ø½¬¡¦¥«¥¿¥«¥Ê³Ø½¬¡¦°Û·Á»ú³Ø½¬ */ if (((wb->dic_no == -1) && (buf->env->muhenkan_mode != WNN_DIC_RDONLY) && ((wb->entry == WNN_KATAKANA) || (wb->entry == WNN_HIRAGANA))&& (wb->jirilen >= WNN_KATAKANA_LEARNING_LEN)) || wb->entry == WNN_IKEIJI_ENTRY) { int entry; if ((entry = muhenkan_auto_learning(buf, wb)) == -1) { buf_wnn_errorno_copy(buf); if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) return(-1); } wb->dic_no = WNN_MUHENKAN_DIC; wb->entry = entry; } /* ÂçʸÀá³Ø½¬ */ if (wb->dai_top && ((k + 1) < bun_no2) && !buf->bun[k + 1]->dai_top) { if (rendaku_learning(buf, buf->env->bunsetsugiri_mode, buf->bun[k + 1], k, k+1) == -1) { buf_wnn_errorno_copy(buf); if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) return(-1); } } else /* Ï¢Âù³Ø½¬ */ if ((k > bun_no) && (wb->hinsi == wnn_rendaku) && (buf->bun[k-1]->yomilen == buf->bun[k-1]->jirilen)) { if (rendaku_learning(buf, buf->env->bunsetsugiri_mode, wb, k-1, k) == -1) { buf_wnn_errorno_copy(buf); if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) return(-1); } } else /* ÀÜÆ¬¸ì(¤ª)³Ø½¬ */ if (((k + 1) < bun_no2) && (wb->hinsi == wnn_settou)) { if (rendaku_learning(buf, buf->env->bunsetsugiri_mode, buf->bun[k + 1], k, k+1) == -1) { buf_wnn_errorno_copy(buf); if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) return(-1); } } else /* ʸÀáÀÚ¤ê³Ø½¬ */ if (wb->nobi_top && (buf->env->bunsetsugiri_mode != WNN_DIC_RDONLY) && ((k + 1) < bun_no2) && (buf->bun[k+1]->hinsi != wnn_rendaku && buf->bun[k]->hinsi != wnn_settou)) { if (bunsetsugiri_auto_learning(buf, wb, k, bun_no2) == -1) { buf_wnn_errorno_copy(buf); if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) return(-1); } } } } return(0); } /* End of optimize_in_lib */ /*:::DOC_START * * Function Name: optimize_in_server * Description : jserver Æâ¤Ç¹Ô¤¦³Ø½¬½èÍý¤ò¤¹¤ë * Parameter : * buf : (In) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * bun_no : (In) ³ÎÄꤷ¤¿Ê¸Àá¤ÎÀèÆ¬Ê¸ÀáÈÖ¹æ * bun_no2 : (In) ³ÎÄꤷ¤¿Ê¸Àá¤ÎºÇ½ªÊ¸Àá¤Îľ¸å¤ÎʸÀáÈÖ¹æ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int optimize_in_server(buf, bun_no, bun_no2) register struct wnn_buf *buf; int bun_no, bun_no2; { register int k, j; register WNN_BUN *wb; int nkouho, *dic, *entry, *ima, *hindo, *kmoji; w_char **kouho, *tmp; struct wnn_prev_bun *prev; /* ÆüËܸì¤Î¤ß¤ò¥µ¥Ý¡¼¥È */ if(strncmp(js_get_lang(buf->env), WNN_J_LANG, 5)) return(0); /* Á°³ÎÄêʸÀá¾ðÊóʬ¤ò³ÎÄê¸õÊä¿ô¤Ë²Ã¤¨¤ë */ nkouho = bun_no2 - bun_no + WNN_PREV_BUN_SUU; if ( (dic = (int *)malloc(nkouho * sizeof(int))) == NULL ) return(-1); if ( (entry = (int *)malloc(nkouho * sizeof(int))) == NULL ) { free(dic); return(-1); } if ( (ima = (int *)malloc(nkouho * sizeof(int))) == NULL ) { free(dic); free(entry); return(-1); } if ( (hindo = (int *)malloc(nkouho * sizeof(int))) == NULL ) { free(dic); free(entry); free(ima); return(-1); } if ( (kmoji = (int *)malloc(nkouho * sizeof(int))) == NULL ) { free(dic); free(entry); free(ima); free(hindo); return(-1); } if ( (kouho = (w_char **)malloc(nkouho * sizeof(w_char *))) == NULL ) { free(dic); free(entry); free(ima); free(hindo); free(kmoji); return(-1); } if ( (tmp = (w_char *)malloc(nkouho * sizeof(w_char) * LENGTHKANJI)) == NULL ) { free(dic); free(entry); free(ima); free(hindo); free(kmoji); free(kouho); return(-1); } for(k = 0; k < nkouho; k++) { kouho[k] = tmp; tmp += LENGTHKANJI; } /* Á°³ÎÄêʸÀá¾ðÊó¤ò³ÎÄêʸÀá¾ðÊó¤ËÆþ¤ì¤ë */ prev = buf->prev_bun; for(j = 0, k = WNN_PREV_BUN_SUU - 1; j < WNN_PREV_BUN_SUU; j++, k--) { dic[j] = prev[k].dic_no; entry[j] = prev[k].entry; ima[j] = WNN_HINDO_NOP; hindo[j] = WNN_HINDO_NOP; kmoji[j] = prev[k].real_kanjilen; wnn_Strcpy(kouho[j], prev[k].kouho); } for(k = WNN_PREV_BUN_SUU; k < nkouho; k++) { wb = buf->bun[(k - WNN_PREV_BUN_SUU) + bun_no]; dic[k] = wb->dic_no; /* ¼­½ñÈÖ¹æ */ entry[k] = wb->entry; /* ¥¨¥ó¥È¥êÈÖ¹æ */ if(wb->hindo_updated == 1) { ima[k] = WNN_IMA_ON; /* º£¥Ó¥Ã¥È¤ÎÀßÄêÊýË¡ */ hindo[k] = WNN_HINDO_INC; /* ÉÑÅÙ¤ÎÀßÄêÊýË¡ */ wb->hindo_updated = 2; } else { ima[k] = WNN_HINDO_NOP; /* º£¥Ó¥Ã¥È¤ÎÀßÄêÊýË¡ */ hindo[k] = WNN_HINDO_NOP; /* ÉÑÅÙ¤ÎÀßÄêÊýË¡ */ } kmoji[k] = wb->real_kanjilen; /* ¸õÊäʸ»ú¿ô¡ÊÉÕ°¸ì¤Ê¤·¡Ë*/ wnn_area(wb, kouho[k], WNN_KANJI); /* ¸õÊäʸ»úÎó¡ÊÉÕ°¸ì¤¢¤ê¡Ë*/ } /* ľÁ°³ÎÄêµ­²±Ê¸Àá¿ô¤è¤ê³ÎÄêʸÀá¿ô¤¬¾¯¤Ê¤¤¤È¤­¤Ï¡¢ ³ÎÄêʸÀá¿ôʬ¸Å¤¤Ê¸Àá¾ðÊó¤ò¾Ãµî¤·¡¢Á´ÂΤÇľÁ°³ÎÄêµ­²±Ê¸Àá¿ô¤Î ʸÀá¾ðÊó¤ò³Ð¤¨¤Æ¤ª¤¯¤è¤¦¤Ë¤¹¤ë */ for(j = WNN_PREV_BUN_SUU - 1, k = WNN_PREV_BUN_SUU - (bun_no2 - bun_no) - 1; k >= 0; j--, k--) { prev[j].dic_no = prev[k].dic_no; prev[j].entry = prev[k].entry; prev[j].real_kanjilen = prev[k].real_kanjilen; wnn_Strcpy(prev[j].kouho, prev[k].kouho); prev[j].jirilen = prev[k].jirilen; prev[j].hinsi = prev[k].hinsi; } /* º£²ó¤Î³ÎÄê¾ðÊó¤òľÁ°³ÎÄê¾ðÊó¤ËÂåÆþ¤¹¤ë */ for(j = 0, k = nkouho - WNN_PREV_BUN_SUU - 1; j < WNN_PREV_BUN_SUU && k >= 0; j++, k--) { wb = buf->bun[k + bun_no]; prev[j].dic_no = wb->dic_no; prev[j].entry = wb->entry; prev[j].real_kanjilen = wb->real_kanjilen; wnn_area(wb, prev[j].kouho, WNN_KANJI); prev[j].jirilen = wb->jirilen; prev[j].hinsi = wb->hinsi; } /* Wnn5 ³Ø½¬¡Ü£Æ£É³Ø½¬ */ k = js_optimize_fi(buf->env, nkouho, dic, entry, ima, hindo, kmoji, kouho); if(k == -1) { buf_wnn_errorno_copy((WNN_BUF_MT *)buf) if (buf_wnn_errorno_eql == WNN_JSERVER_DEAD) { free(dic); free(entry); free(ima); free(hindo); free(kmoji); free(kouho[0]); free(kouho); return(-1); } } free(dic); free(entry); free(ima); free(hindo); free(kmoji); free(kouho[0]); free(kouho); return(0); } /* End of optimize_in_server */ static w_char * wnn_area(bp, area, kanjip) WNN_BUN *bp; w_char *area; int kanjip; { register WNN_BUN *bp1; register w_char *c, *end; for(bp1 = bp; bp1; bp1 = bp1->next){ if(bp1 != bp) c = (w_char *)bp1; else c = bp1->yomi; end = (w_char *)&bp1->next; for(;c < end;){ if(!kanjip){ if((*area++ = *c++) == 0){ area--; goto out;} }else{ if(*c++ == 0) kanjip--; } } } out: return(area); } static int dai_end(buf, bun_no) register struct wnn_buf_mt *buf; register int bun_no; { bun_no++; for(;bun_no < buf->orig.bun_suu && !buf->orig.bun[bun_no]->dai_top; bun_no++); return(bun_no); } #define dai_end_zenkouho(buf, bun_no) (buf->zenkouho_dai[bun_no + 1]) #ifdef CONVERT_by_STROKE /* É®·Á (Bi Xing) */ void jl_get_zenkouho_yomi(buf, zen_num, area) register struct wnn_buf *buf; int zen_num; w_char *area; { register int k, end; if(!buf) return; LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(buf->zenkouho_daip==SHO){ wnn_area(buf->zenkouho[zen_num], area, WNN_YOMI); }else{ end = dai_end_zenkouho(buf, zen_num); for(k = buf->zenkouho_dai[zen_num]; k < end; k++){ area = wnn_area(buf->zenkouho[k], area, WNN_KANJI); } } UnlockMutex(&BUF_LOCK(buf)); } #endif void jl_get_zenkouho_kanji(buf, zen_num, area) register struct wnn_buf *buf; int zen_num; w_char *area; { register int k, end; if(!buf) return; LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(buf->zenkouho_daip==SHO){ wnn_area(buf->zenkouho[zen_num], area, WNN_KANJI); }else{ end = dai_end_zenkouho(buf, zen_num); for(k = buf->zenkouho_dai[zen_num]; k < end; k++){ area = wnn_area(buf->zenkouho[k], area, WNN_KANJI); } } UnlockMutex(&BUF_LOCK(buf)); } static int wnn_get_area_body(buf, bun_no, bun_no2, area, kanjip) struct wnn_buf_mt *buf; register int bun_no, bun_no2; w_char *area; int kanjip; { register int k; w_char *area1 = area; int x; if(bun_no < 0) { return(0); } if(bun_no2 >= buf->orig.bun_suu || bun_no2 < 0) bun_no2 = buf->orig.bun_suu; for(k = bun_no; k < bun_no2; k++){ area = wnn_area(buf->orig.bun[k], area, kanjip); } x = area - area1; return x; } int wnn_get_area(buf, bun_no, bun_no2, area, kanjip) struct wnn_buf *buf; register int bun_no, bun_no2; w_char *area; int kanjip; { int x; if(!buf) return(0); LockMutex(&BUF_LOCK(buf)); x = wnn_get_area_body((WNN_BUF_MT *)buf, bun_no, bun_no2, area, kanjip); UnlockMutex(&BUF_LOCK(buf)); return x; } #define JISHO 1 #define HINDO 2 #define FI_JISHO 3 /* Hideyuki Kishiba (Jul. 7, 1994) */ #define FI_HINDO 4 /* New type for FI-Wnn */ /*********************************/ static int jl_dic_add_e_body(env,dic_name,hindo_name,rev, prio,rw, hrw, pwd_dic, pwd_hindo, error_handler, message_handler) register struct wnn_env_int *env; char *dic_name; char *hindo_name; int prio; int rw, hrw, rev; char *pwd_dic, *pwd_hindo; int (*error_handler)(), (*message_handler)(); { char tmp[256]; char pwd[WNN_PASSWD_LEN], hpwd[WNN_PASSWD_LEN]; int fid, hfid = -1; register int ret; if(file_exist(env, dic_name) == -1) { /* failed, try to access compressed dictionary, but this may cause error */ char t_dic_name[1024]; char *t_dic_ext = ".gz"; char t_dic_name2[1024]; char *t_dic_ext2 = ".Z"; strcpy(t_dic_name, dic_name); strcat(t_dic_name, t_dic_ext); strcpy(t_dic_name2, dic_name); strcat(t_dic_name2, t_dic_ext2); if( (file_exist(env, t_dic_name) == -1) && (file_exist(env, t_dic_name2) == -1) ) { env_wnn_errorno_copy(env); if (env_wnn_errorno_eql == WNN_JSERVER_DEAD) { jl_disconnect_body(env); return(-1); } if((int)error_handler == WNN_NO_CREATE || (rw == WNN_DIC_RDONLY)){ LockMutex(&msg_lock); sprintf(tmp, "%s \"%s\" %s", msg_get(wnn_msg_cat, 200, NULL, env->orig.lang, NULL), dic_name, msg_get(wnn_msg_cat, 201, NULL, env->orig.lang, NULL)); /* "¼­½ñ¥Õ¥¡¥¤¥ë \"%s\" ¤¬Ìµ¤¤¤è¡£", */ message_out(message_handler, tmp); UnlockMutex(&msg_lock); env_wnn_errorno_set = WNN_NO_EXIST; return(-1); } LockMutex(&msg_lock); sprintf(tmp, "%s \"%s\" %s%s", msg_get(wnn_msg_cat, 200, NULL, env->orig.lang, NULL), dic_name, msg_get(wnn_msg_cat, 201, NULL, env->orig.lang, NULL), msg_get(wnn_msg_cat, 202, NULL, env->orig.lang, NULL)); /* "¼­½ñ¥Õ¥¡¥¤¥ë \"%s\" ¤¬Ìµ¤¤¤è¡£ºî¤ë?(Y/N)", */ UnlockMutex(&msg_lock); if((int)error_handler == WNN_CREATE || call_error_handler(error_handler, tmp, env)){ if(create_file(env, dic_name,JISHO, rw, pwd_dic, (hindo_name && *hindo_name)? "": pwd_hindo, error_handler, message_handler) == -1) { env_wnn_errorno_copy(env); return(-1); } }else{ env_wnn_errorno_set = WNN_NO_EXIST; return(-1); } } } if((fid = file_read(env, dic_name)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } if(hindo_name && *hindo_name){ if(file_exist(env, hindo_name) == -1) { env_wnn_errorno_copy(env); if(env_wnn_errorno_eql == WNN_JSERVER_DEAD) { jl_disconnect_body(env); return(-1); } if((int)error_handler == WNN_NO_CREATE || (hrw == WNN_DIC_RDONLY)){ LockMutex(&msg_lock); sprintf(tmp, "%s \"%s\" %s", msg_get(wnn_msg_cat, 203, NULL, env->orig.lang, NULL), hindo_name, msg_get(wnn_msg_cat, 201, NULL, env->orig.lang, NULL)); /* "ÉÑÅÙ¥Õ¥¡¥¤¥ë \"%s\" ¤¬Ìµ¤¤¤è¡£", */ message_out(message_handler, tmp); UnlockMutex(&msg_lock); env_wnn_errorno_set = WNN_NO_EXIST; return(-1); } LockMutex(&msg_lock); sprintf(tmp, "%s \"%s\" %s%s", msg_get(wnn_msg_cat, 203, NULL, env->orig.lang, NULL), hindo_name, msg_get(wnn_msg_cat, 201, NULL, env->orig.lang, NULL), msg_get(wnn_msg_cat, 202, NULL, env->orig.lang, NULL)); /* "ÉÑÅÙ¥Õ¥¡¥¤¥ë \"%s\" ¤¬Ìµ¤¤¤è¡£ºî¤ë?(Y/N)", */ UnlockMutex(&msg_lock); if((int)error_handler == WNN_CREATE || call_error_handler(error_handler, tmp, env)){ if(create_file(env, hindo_name, HINDO, fid, "", pwd_hindo, error_handler, message_handler) == -1) { env_wnn_errorno_copy(env); return(-1); } }else{ env_wnn_errorno_set = WNN_NO_EXIST; return(-1); } } if((hfid = file_read(env, hindo_name)) == -1){ env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } } /* Hideyuki Kishiba (Dec. 3, 1994) ¥°¥ë¡¼¥×¼­½ñ¤Î¾ì¹ç¤Ï read write¡¢¥Þ¡¼¥¸¼­½ñ¤Î¾ì¹ç¤Ï read only ¤Ç dic_add ¤ò¹Ô¤¦ */ if(rw == WNN_DIC_GROUP) rw = WNN_DIC_RW; else if(rw == WNN_DIC_MERGE) rw = WNN_DIC_RDONLY; if(get_pwd(pwd_dic, pwd, env) == -1)return(-1); if(get_pwd(pwd_hindo, hpwd, env) == -1)return(-1); if((ret = js_dic_add(env, fid, hfid, rev, prio, rw, hrw, pwd, hpwd)) < 0) { env_wnn_errorno_copy(env); if(env_wnn_errorno_eql == WNN_JSERVER_DEAD){ jl_disconnect_body(env); return(-1); }else if(env_wnn_errorno_eql == WNN_HINDO_NO_MATCH){ if((int)error_handler == WNN_NO_CREATE){ return(-1); } LockMutex(&msg_lock); sprintf(tmp, msg_get(wnn_msg_cat, 204, NULL, env->orig.lang, NULL), hindo_name); /* "ÉÑÅÙ¥Õ¥¡¥¤¥ë \"%s\" ¤¬»ØÄꤵ¤ì¤¿¼­½ñ¤ÎÉÑÅÙ¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ºî¤êľ¤·¤Þ¤¹¤«?(Y/N)", */ UnlockMutex(&msg_lock); if(!((int)error_handler == WNN_CREATE || call_error_handler(error_handler, tmp, env))){ return(-1); } if(file_discard(env, hfid) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } if(file_remove(env->orig.js_id, hindo_name, hpwd) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } if(create_file(env,hindo_name, HINDO, fid, NULL, pwd_hindo, WNN_CREATE, message_handler) == -1) { env_wnn_errorno_copy(env); return(-1); } if((hfid = file_read(env, hindo_name)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } if((ret = js_dic_add(env, fid, hfid, rev, prio, rw, hrw, pwd, hpwd))< 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } } } return(ret); } int jl_dic_add_e(env,dic_name,hindo_name,rev, prio,rw, hrw, pwd_dic, pwd_hindo, error_handler, message_handler) register struct wnn_env *env; char *dic_name; char *hindo_name; int prio; int rw, hrw, rev; char *pwd_dic, *pwd_hindo; int (*error_handler)(), (*message_handler)(); { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_dic_add_e_body((WNN_ENV_INT *)env, dic_name, hindo_name, rev, prio, rw, hrw, pwd_dic, pwd_hindo, error_handler, message_handler); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_dic_add(buf, dic_name, hindo_name, rev, prio, rw, hrw, pwd_dic, pwd_hindo, error_handler, message_handler) register struct wnn_buf *buf; char *dic_name; char *hindo_name; int prio; int rw, hrw, rev; char *pwd_dic, *pwd_hindo; int (*error_handler)(), (*message_handler)(); { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_dic_add_e_body((WNN_ENV_INT *)buf->env, dic_name, hindo_name, rev, prio, rw, hrw, pwd_dic, pwd_hindo, error_handler, message_handler); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } /*:::DOC_START * * Function Name: jl_fi_dic_add_e_body * Description : jl_fi_dic_add[_e] ¤Î¥µ¥Ö¥ë¡¼¥Á¥ó´Ø¿ô * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * dic_name : (In) £Æ£É´Ø·¸¼­½ñ¥Õ¥¡¥¤¥ë̾ * hindo_name : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë̾ * suflag : (In) ¥·¥¹¥Æ¥à¼­½ñ£ï£ò¥æ¡¼¥¶¼­½ñ * rw : (In) ¼­½ñ¹¹¿·¤¬²Äǽ£ï£òÉÔ²Äǽ * hrw : (In) ÉÑÅÙ¹¹¿·¤¬²Äǽ£ï£òÉÔ²Äǽ * pwd_dic : (In) £Æ£É´Ø·¸¼­½ñ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¥ï¡¼¥É * pwd_hindo : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¥ï¡¼¥É * error_handler : (In) ¥¨¥é¡¼¥Ï¥ó¥É¥é¡Ý * message_handler : (In) ¥á¥Ã¥»¡¼¥¸¥Ï¥ó¥É¥é¡¼ * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñÈÖ¹æ * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int jl_fi_dic_add_e_body(env, dic_name, hindo_name, suflag, rw, hrw, pwd_dic, pwd_hindo, error_handler, message_handler) register struct wnn_env_int *env; char *dic_name; char *hindo_name; int suflag; int rw, hrw; char *pwd_dic, *pwd_hindo; int (*error_handler)(), (*message_handler)(); { char tmp[256]; char pwd[WNN_PASSWD_LEN], hpwd[WNN_PASSWD_LEN]; int fid, hfid = -1; register int ret; if(file_exist(env, dic_name) == -1) { /* £Æ£É´Ø·¸¼­½ñ¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤ */ env_wnn_errorno_copy(env); if (env_wnn_errorno_eql == WNN_JSERVER_DEAD) { /* jserver ¤¬»à¤ó¤Ç¤¤¤ë */ jl_disconnect_body(env); return(-1); } if((int)error_handler == WNN_NO_CREATE) { LockMutex(&msg_lock); sprintf(tmp, "%s \"%s\" %s", msg_get(wnn_msg_cat, 200, NULL, env->orig.lang, NULL), dic_name, msg_get(wnn_msg_cat, 201, NULL, env->orig.lang, NULL)); /* "¼­½ñ¥Õ¥¡¥¤¥ë \"%s\" ¤¬Ìµ¤¤¤è¡£", */ message_out(message_handler, tmp); UnlockMutex(&msg_lock); env_wnn_errorno_set = WNN_NO_EXIST; return(-1); } LockMutex(&msg_lock); sprintf(tmp, "%s \"%s\" %s%s", msg_get(wnn_msg_cat, 200, NULL, env->orig.lang, NULL), dic_name, msg_get(wnn_msg_cat, 201, NULL, env->orig.lang, NULL), msg_get(wnn_msg_cat, 202, NULL, env->orig.lang, NULL)); /* "¼­½ñ¥Õ¥¡¥¤¥ë \"%s\" ¤¬Ìµ¤¤¤è¡£ºî¤ë?(Y/N)", */ UnlockMutex(&msg_lock); if((int)error_handler == WNN_CREATE || call_error_handler(error_handler, tmp, env)){ /* £Æ£É´Ø·¸¼­½ñ¤ÎºîÀ® */ if(create_file(env, dic_name, FI_JISHO, -1, /* -1 is dummy */ pwd_dic, (hindo_name && *hindo_name)? "": pwd_hindo, error_handler, message_handler) == -1) { env_wnn_errorno_copy(env); return(-1); } }else{ env_wnn_errorno_set = WNN_NO_EXIST; return(-1); } } /* £Æ£É´Ø·¸¼­½ñ¤ÎÆÉ¤ß¹þ¤ß */ if((fid = file_read(env, dic_name)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } if(hindo_name && *hindo_name){ if(file_exist(env, hindo_name) == -1) { /* £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤ */ env_wnn_errorno_copy(env); if(env_wnn_errorno_eql == WNN_JSERVER_DEAD) { /* jserver ¤¬»à¤ó¤Ç¤¤¤ë */ jl_disconnect_body(env); return(-1); } if((int)error_handler == WNN_NO_CREATE || (hrw == WNN_DIC_RDONLY)){ LockMutex(&msg_lock); sprintf(tmp, "%s \"%s\" %s", msg_get(wnn_msg_cat, 203, NULL, env->orig.lang, NULL), hindo_name, msg_get(wnn_msg_cat, 201, NULL, env->orig.lang, NULL)); /* "ÉÑÅÙ¥Õ¥¡¥¤¥ë \"%s\" ¤¬Ìµ¤¤¤è¡£", */ message_out(message_handler, tmp); UnlockMutex(&msg_lock); env_wnn_errorno_set = WNN_NO_EXIST; return(-1); } LockMutex(&msg_lock); sprintf(tmp, "%s \"%s\" %s%s", msg_get(wnn_msg_cat, 203, NULL, env->orig.lang, NULL), hindo_name, msg_get(wnn_msg_cat, 201, NULL, env->orig.lang, NULL), msg_get(wnn_msg_cat, 202, NULL, env->orig.lang, NULL)); /* "ÉÑÅÙ¥Õ¥¡¥¤¥ë \"%s\" ¤¬Ìµ¤¤¤è¡£ºî¤ë?(Y/N)", */ UnlockMutex(&msg_lock); if((int)error_handler == WNN_CREATE || call_error_handler(error_handler, tmp, env)){ /* £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¤ÎºîÀ® */ if(create_file(env, hindo_name, FI_HINDO, fid, "", pwd_hindo, error_handler, message_handler) == -1) { env_wnn_errorno_copy(env); return(-1); } }else{ env_wnn_errorno_set = WNN_NO_EXIST; return(-1); } } /* £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß */ if((hfid = file_read(env, hindo_name)) == -1){ env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } } /* ¥Ñ¥¹¥ï¡¼¥É¤Î¼èÆÀ */ if(get_pwd(pwd_dic, pwd, env) == -1)return(-1); if(get_pwd(pwd_hindo, hpwd, env) == -1)return(-1); /* £Æ£É´Ø·¸¼­½ñ¤ÈÉÑÅÙ¤ÎÀ°¹çÀ­¥Á¥§¥Ã¥¯ */ if((ret = js_fi_dic_add(env, fid, hfid, suflag, rw, hrw, pwd, hpwd)) < 0) { env_wnn_errorno_copy(env); if(env_wnn_errorno_eql == WNN_JSERVER_DEAD){ /* jserver ¤¬»à¤ó¤Ç¤¤¤ë */ jl_disconnect_body(env); return(-1); }else if(env_wnn_errorno_eql == WNN_HINDO_NO_MATCH){ /* ¼­½ñ¤ÈÉÑÅÙ¤ÎÀ°¹çÀ­¤¬Ìµ¤¤ */ if((int)error_handler == WNN_NO_CREATE){ return(-1); } LockMutex(&msg_lock); sprintf(tmp, msg_get(wnn_msg_cat, 204, NULL, env->orig.lang, NULL), hindo_name); /* "ÉÑÅÙ¥Õ¥¡¥¤¥ë \"%s\" ¤¬»ØÄꤵ¤ì¤¿¼­½ñ¤ÎÉÑÅÙ¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ºî¤êľ¤·¤Þ¤¹¤«?(Y/N)", */ UnlockMutex(&msg_lock); if(!((int)error_handler == WNN_CREATE || call_error_handler(error_handler, tmp, env))){ return(-1); } /* ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Î¥á¥â¥ê²òÊü */ if(file_discard(env, hfid) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } /* ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Î¥Ç¥£¥¹¥¯¤«¤é¤Îºï½ü */ if(file_remove(env->orig.js_id, hindo_name, hpwd) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } /* £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¤ÎºîÀ® */ if(create_file(env,hindo_name, FI_HINDO, fid, NULL, pwd_hindo, WNN_CREATE, message_handler) == -1) { env_wnn_errorno_copy(env); return(-1); } /* £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß */ if((hfid = file_read(env, hindo_name)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } /* £Æ£É´Ø·¸¼­½ñ¤ÈÉÑÅÙ¤ÎÀ°¹çÀ­¥Á¥§¥Ã¥¯ */ if((ret = js_fi_dic_add(env, fid, hfid, suflag, rw, hrw, pwd, hpwd))< 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } } } return(ret); } /* End of jl_fi_dic_add_e_body */ /*:::DOC_START * * Function Name: jl_fi_dic_add_e * Description : ´Ä¶­¤Ë£Æ£É¼­½ñ¤òÄɲ乤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * dic_name : (In) £Æ£É´Ø·¸¼­½ñ¥Õ¥¡¥¤¥ë̾ * hindo_name : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë̾ * suflag : (In) ¥·¥¹¥Æ¥à¼­½ñ£ï£ò¥æ¡¼¥¶¼­½ñ * rw : (In) ¼­½ñ¹¹¿·¤¬²Äǽ£ï£òÉÔ²Äǽ * hrw : (In) ÉÑÅÙ¹¹¿·¤¬²Äǽ£ï£òÉÔ²Äǽ * pwd_dic : (In) £Æ£É´Ø·¸¼­½ñ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¥ï¡¼¥É * pwd_hindo : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¥ï¡¼¥É * error_handler : (In) ¥¨¥é¡¼¥Ï¥ó¥É¥é¡Ý * message_handler : (In) ¥á¥Ã¥»¡¼¥¸¥Ï¥ó¥É¥é¡¼ * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñÈÖ¹æ * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_fi_dic_add_e(env, dic_name, hindo_name, suflag ,rw, hrw, pwd_dic, pwd_hindo, error_handler, message_handler) register struct wnn_env *env; char *dic_name; char *hindo_name; int suflag; int rw, hrw; char *pwd_dic, *pwd_hindo; int (*error_handler)(), (*message_handler)(); { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; /* ¥µ¥Ö¥ë¡¼¥Á¥ó´Ø¿ô¤Î¥³¡¼¥ë */ x = jl_fi_dic_add_e_body((WNN_ENV_INT *)env, dic_name, hindo_name, suflag, rw, hrw, pwd_dic, pwd_hindo, error_handler, message_handler); UnlockMutex(&ENV_LOCK(env)); return x; } /* End of jl_fi_dic_add_e */ /*:::DOC_START * * Function Name: jl_fi_dic_add * Description : ¥Ð¥Ã¥Õ¥¡¤Ë£Æ£É¼­½ñ¤òÄɲ乤ë * Parameter : * buf : (In) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * dic_name : (In) £Æ£É´Ø·¸¼­½ñ¥Õ¥¡¥¤¥ë̾ * hindo_name : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë̾ * suflag : (In) ¥·¥¹¥Æ¥à¼­½ñ£ï£ò¥æ¡¼¥¶¼­½ñ * rw : (In) ¼­½ñ¹¹¿·¤¬²Äǽ£ï£òÉÔ²Äǽ * hrw : (In) ÉÑÅÙ¹¹¿·¤¬²Äǽ£ï£òÉÔ²Äǽ * pwd_dic : (In) £Æ£É´Ø·¸¼­½ñ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¥ï¡¼¥É * pwd_hindo : (In) £Æ£É´Ø·¸ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¥ï¡¼¥É * error_handler : (In) ¥¨¥é¡¼¥Ï¥ó¥É¥é¡Ý * message_handler : (In) ¥á¥Ã¥»¡¼¥¸¥Ï¥ó¥É¥é¡¼ * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñÈÖ¹æ * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_fi_dic_add(buf, dic_name, hindo_name, suflag, rw, hrw, pwd_dic, pwd_hindo, error_handler, message_handler) register struct wnn_buf *buf; char *dic_name; char *hindo_name; int suflag; int rw, hrw; char *pwd_dic, *pwd_hindo; int (*error_handler)(), (*message_handler)(); { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; /* ¥µ¥Ö¥ë¡¼¥Á¥ó´Ø¿ô¤Î¥³¡¼¥ë */ x = jl_fi_dic_add_e_body((WNN_ENV_INT *)buf->env, dic_name, hindo_name, suflag, rw, hrw, pwd_dic, pwd_hindo, error_handler, message_handler); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } /* End of jl_fi_dic_add */ static int jl_dic_delete_e_body(env, dic_no) register struct wnn_env_int *env; register int dic_no; { WNN_DIC_INFO dic; if(js_dic_info(env,dic_no,&dic) < 0){ env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } if(js_dic_delete(env, dic_no) < 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } /* dic Body */ if (file_discard(env,dic.body) < 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } /* dic hindo */ if(dic.hindo != -1){ if (file_discard(env,dic.hindo) < 0){ env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } } return(0); } int jl_dic_delete_e(env, dic_no) register struct wnn_env *env; register int dic_no; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_dic_delete_e_body((WNN_ENV_INT *)env, dic_no); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_dic_delete(buf, dic_no) register struct wnn_buf *buf; register int dic_no; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_dic_delete_e_body((WNN_ENV_INT *)buf->env, dic_no); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static int get_pwd(pwd_dic, pwd, env) register char *pwd_dic, *pwd; ARGS *env; { FILE *fp; if(pwd_dic && *pwd_dic){ if((fp = fopen(pwd_dic, "r")) == NULL){ env_wnn_errorno_set = WNN_CANT_OPEN_PASSWD_FILE; return(-1); } fgets(pwd, WNN_PASSWD_LEN, fp); fclose(fp); }else { pwd[0] = 0; } return(0); } static int create_pwd_file(env, pwd_file, error_handler, message_handler) register struct wnn_env_int *env; char *pwd_file; int (*error_handler)(), (*message_handler)(); { FILE *fp; char gomi[256]; if(pwd_file == NULL || *pwd_file == 0) return(0); if(access(pwd_file, F_OK) != -1) return(0); LockMutex(&msg_lock); sprintf(gomi, "%s \"%s\" %s%s", msg_get(wnn_msg_cat, 205, NULL, env->orig.lang, NULL), pwd_file, msg_get(wnn_msg_cat, 201, NULL, env->orig.lang, NULL), msg_get(wnn_msg_cat, 202, NULL, env->orig.lang, NULL)); /* "password_file \"%s\" ¤¬Ìµ¤¤¤è¡£ºî¤ë?(Y/N)", */ UnlockMutex(&msg_lock); /* error_handler != WNN_CREATE ¤Î¥Á¥§¥Ã¥¯¤¬È´¤±¤Æ¤¤¤¿¤Î¤ÇÄɲà */ if((int)error_handler != WNN_CREATE && call_error_handler(error_handler,gomi, env) == 0){ env_wnn_errorno_set = WNN_NO_EXIST; return(-1); } if((fp = fopen(pwd_file, "w")) == NULL){ env_wnn_errorno_set = WNN_CANT_OPEN_PASSWD_FILE; message_out(message_handler, wnn_perror_lang(env->orig.lang, env)); return(-1); } #ifdef SYSVR2 srand(time(0)+getuid()); fprintf(fp,"%d\n",rand()); #else srandom(time(0)+getuid()); fprintf(fp,"%d\n",random()); #endif fclose(fp); #define MODE_PWD (0000000 | 0000400) chmod(pwd_file,MODE_PWD); return(0); } /** jl_fuzokugo_set **/ static int jl_fuzokugo_set_e_body(env,fname) struct wnn_env_int *env; char *fname; { register int fid, orgfid; int ret; orgfid = js_fuzokugo_get(env); /* If orgfid == -1, it must be because no fuzokugo_file is set to the env */ if((fid=file_read(env,fname)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } if ((ret = js_fuzokugo_set(env,fid)) < 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(ret); } if(fid != orgfid && orgfid != -1){ js_file_discard(env, orgfid); } return(ret); } int jl_fuzokugo_set_e(env,fname) struct wnn_env *env; char *fname; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_fuzokugo_set_e_body((WNN_ENV_INT *)env,fname); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_fuzokugo_set(buf, fname) register struct wnn_buf *buf; char *fname; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_fuzokugo_set_e_body((WNN_ENV_INT *)buf->env, fname); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } /** jl_fuzokugo_get **/ static int jl_fuzokugo_get_e_body(env, fname) register struct wnn_env_int *env; char *fname; { WNN_FILE_INFO_STRUCT file; int fid; char *c; fname[0] = 0; if((fid = js_fuzokugo_get(env)) < 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } if (js_file_info(env,fid,&file) < 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } LockMutex(&envs_lock); c = find_file_name_from_id(env, fid); if(c == NULL){ c = file.name; } strcpy(fname, c); UnlockMutex(&envs_lock); return(fid); } int jl_fuzokugo_get_e(env, fname) register struct wnn_env *env; char *fname; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_fuzokugo_get_e_body((WNN_ENV_INT *)env, fname); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_fuzokugo_get(buf, fname) register struct wnn_buf *buf; char *fname; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_fuzokugo_get_e_body((WNN_ENV_INT *)buf->env, fname); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } /** jl_dic_save **/ static int jl_dic_save_e_body(env,dic_no) register struct wnn_env_int *env; int dic_no; { WNN_DIC_INFO dic; WNN_FILE_INFO_STRUCT file; char *c; if(js_dic_info(env,dic_no,&dic) < 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } /* dic Body */ LockMutex(&envs_lock); c = find_file_name_from_id(env, dic.body); if(c == NULL){ if(dic.localf){ c = dic.fname; }else{ UnlockMutex(&envs_lock); env_wnn_errorno_set=WNN_FILE_NOT_READ_FROM_CLIENT; return(-1); } } if(c[0] != C_LOCAL){ if (js_file_write(env,dic.body,c) < 0) { env_wnn_errorno_copy(env); if (env_wnn_errorno_eql == WNN_JSERVER_DEAD) { UnlockMutex(&envs_lock); jl_disconnect_if_server_dead_body(env); return(-1); } } }else{ if (js_file_receive(env,dic.body,c + 1) < 0) { env_wnn_errorno_copy(env); if (env_wnn_errorno_eql == WNN_JSERVER_DEAD) { UnlockMutex(&envs_lock); jl_disconnect_if_server_dead_body(env); return(-1); } } } /* dic hindo */ if(dic.hindo != -1){ if (js_file_info(env,dic.hindo,&file) < 0) { UnlockMutex(&envs_lock); env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } c = find_file_name_from_id(env, file.fid); if(c == NULL){ if(dic.hlocalf){ c = dic.hfname; }else{ UnlockMutex(&envs_lock); env_wnn_errorno_set=WNN_FILE_NOT_READ_FROM_CLIENT; return(-1); } } if(c[0] != C_LOCAL){ if (js_file_write(env,dic.hindo,c) < 0) { UnlockMutex(&envs_lock); env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } }else{ if (js_file_receive(env,dic.hindo,c + 1) < 0) { UnlockMutex(&envs_lock); env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } } } UnlockMutex(&envs_lock); return(0); } int jl_dic_save_e(env,dic_no) register struct wnn_env *env; int dic_no; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_dic_save_e_body((WNN_ENV_INT *)env,dic_no); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_dic_save(buf, dic_no) register struct wnn_buf *buf; int dic_no; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_dic_save_e_body((WNN_ENV_INT *)buf->env, dic_no); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static int jl_dic_save_all_e_body(env) struct wnn_env_int *env; { register WNN_DIC_INFO *dic; register int k; char *c; register int cnt; register unsigned long dmask = 0; /* ¥Æ¥ó¥Ý¥é¥ê¼­½ñ°Ê³°¤Î¼­½ñ¾ðÊó¤òÆÀ¤ë */ dmask |= WNN_DIC_ALL_MASK & ~WNN_DIC_TEMPORARY_MASK; if((cnt = js_fi_dic_list(env, dmask, &dicrb)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } dic = (WNN_DIC_INFO *)dicrb.buf; LockMutex(&envs_lock); for(k = 0 ; k < cnt ; k++, dic++){ if((c = find_file_name_from_id(env, dic->body)) == NULL){ if(dic->localf){ c = dic->fname; }else{ env_wnn_errorno_set=WNN_FILE_NOT_READ_FROM_CLIENT; } } if(c){ if(c[0] != C_LOCAL){ if (js_file_write(env,dic->body,c) < 0) { env_wnn_errorno_copy(env); if (env_wnn_errorno_eql == WNN_JSERVER_DEAD) { UnlockMutex(&envs_lock); jl_disconnect_if_server_dead_body(env); return(-1); } } }else{ if (js_file_receive(env,dic->body,c + 1) < 0) { env_wnn_errorno_copy(env); if (env_wnn_errorno_eql == WNN_JSERVER_DEAD) { UnlockMutex(&envs_lock); jl_disconnect_if_server_dead_body(env); return(-1); } } } } /* dic hindo */ if(dic->hindo != -1){ c = find_file_name_from_id(env, dic->hindo); if(c == NULL){ if(dic->hlocalf){ c = dic->hfname; }else{ env_wnn_errorno_set=WNN_FILE_NOT_READ_FROM_CLIENT; } } if(c){ if(c[0] != C_LOCAL){ if (js_file_write(env,dic->hindo,c) < 0) { env_wnn_errorno_copy(env); if (env_wnn_errorno_eql == WNN_JSERVER_DEAD) { UnlockMutex(&envs_lock); if_dead_disconnect(env); return(-1); } } }else{ if (js_file_receive(env,dic->hindo,c + 1) < 0) { env_wnn_errorno_copy(env); if (env_wnn_errorno_eql == WNN_JSERVER_DEAD) { UnlockMutex(&envs_lock); if_dead_disconnect(env); return(-1); } } } } } } UnlockMutex(&envs_lock); env_wnn_errorno_copy(env); if(env_wnn_errorno_eql) return(-1); else return(0); } int jl_dic_save_all_e(env) struct wnn_env *env; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_dic_save_all_e_body((WNN_ENV_INT *)env); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_dic_save_all(buf) register struct wnn_buf *buf; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_dic_save_all_e_body((WNN_ENV_INT *)buf->env); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } /* * * bun manipulate routines * */ static void free_sho(buf, wbp) register struct wnn_buf_mt *buf; WNN_BUN **wbp; { register WNN_BUN *wb, *wb1; wb = *wbp; if(--wb->ref_cnt <= 0){ for(wb1 = wb; wb;){ if((wb1 == wb) && (wb->hinsi_list != NULL)) { free((char *)(wb->hinsi_list)); wb->hinsi_list = NULL; } wb->free_next = buf->orig.free_heap; buf->orig.free_heap = wb; wb = wb->next; } } *wbp = NULL; } static void free_zenkouho(buf) register struct wnn_buf_mt *buf; { register int k; for(k = 0 ; k < buf->orig.zenkouho_suu; k++){ free_sho(buf, &buf->orig.zenkouho[k]); } buf->orig.zenkouho_suu = 0; buf->orig.zenkouho_dai_suu = 0; buf->orig.c_zenkouho = -1; buf->orig.zenkouho_bun = -1; buf->orig.zenkouho_end_bun = -1; } static void free_bun(buf, bun_no, bun_no2) struct wnn_buf_mt *buf; register int bun_no, bun_no2; { register int k; for(k = bun_no; k < bun_no2; k++){ free_sho(buf, &buf->orig.bun[k]); } } static void free_down(buf, bun_no, bun_no2) struct wnn_buf_mt *buf; int bun_no, bun_no2; { register WNN_BUN **wbp, **wbp1; int k; for(k = bun_no; k < bun_no2; k++){ for(wbp = &buf->orig.down_bnst[k]; *wbp; wbp = wbp1){ wbp1 = &(*wbp)->down; free_sho(buf, wbp); } } } static WNN_BUN * get_new_bun(buf) register struct wnn_buf_mt *buf; { register WNN_BUN *wb; if(buf->orig.free_heap == NULL){ if(alloc_heap(buf, INCREMENT) == -1)return(NULL); } wb = buf->orig.free_heap; buf->orig.free_heap = wb->free_next; wb->free_next = NULL; wb->daihyoka = -1; return(wb); } static WNN_BUN * get_sho(buf, sb, zenp, daip, fuku, nhinsi, hlist) struct wnn_buf_mt *buf; struct wnn_sho_bunsetsu *sb; int zenp, daip, fuku, nhinsi, *hlist; { register w_char *c, *end, *s; register WNN_BUN *wb; WNN_BUN *wb1; int where = 1; int len; if((wb = get_new_bun(buf)) == NULL) return(NULL); wb->jirilen = sb->jiriend - sb->start + 1; wb->dic_no = sb->dic_no; wb->entry = sb->entry; wb->kangovect = sb->kangovect; wb->hinsi = sb->hinsi; wb->hindo = sb->hindo; wb->ima = sb->ima; wb->hindo_updated = 0; wb->bug = 0; wb->dai_top = 0; wb->nobi_top = 0; wb->ref_cnt = 1; wb->hyoka = sb->hyoka; wb->down = NULL; wb->from_zenkouho = daip << 1 | zenp; len = wnn_Strlen(sb->fuzoku); wb->yomilen = wnn_Strlen(sb->yomi) + len; wb->real_kanjilen = wnn_Strlen(sb->kanji); wb->kanjilen = wb->real_kanjilen + len; wb->fukugou = fuku; wb->num_hinsi = nhinsi; if(nhinsi) { int hsize = abs(nhinsi) * sizeof(int); if((wb->hinsi_list = (int *)malloc(hsize)) == NULL) return(NULL); bcopy(hlist, wb->hinsi_list, hsize); } else wb->hinsi_list = NULL; /* wb->dai_top = (sb->status == WNN_CONNECT)? 0:1; ÂçʸÀá¤ÎÀèÆ¬°Ê³°¤Î¾®Ê¸Àá¤Ë´Ø¤·¤Æ¤Ï¡¢status ¤Ï¤¤¤¤²Ã¸º¤ÊÃͤ¬Æþ¤Ã¤Æ¤¤¤ë¡£ */ s = sb->yomi; for(wb1 = wb; ;){ if(wb1 == wb) c = wb1->yomi; else c = (w_char *)wb1; end = (w_char *)&wb1->next; for(; c < end;) { if((*c++ = *s++) == 0){ if(where == 1){ where = 3; c--; s = sb->fuzoku; }else if(where == 3){ where = 0; s = sb->kanji; }else if(where == 0){ where = 4; c--; s = sb->fuzoku; }else{ goto out; } } } wb1->next = get_new_bun(buf); wb1 = wb1->next; } out: wb1->next = NULL; return(wb); } static void make_space_for(buf, zenp, bun_no, bun_no2, cnt) register struct wnn_buf_mt *buf; int bun_no, bun_no2, zenp; int cnt; { switch(zenp){ case BUN: make_space_for_bun(buf,bun_no, bun_no2, cnt); break; case ZENKOUHO: make_space_for_zenkouho(buf,bun_no, bun_no2, cnt); } } static void make_space_for_bun(buf, bun_no, bun_no2, cnt) register struct wnn_buf_mt *buf; int bun_no, bun_no2; int cnt; { int newsize; register int k; newsize = buf->orig.bun_suu + cnt - (bun_no2 - bun_no); #define Realloc(a, b) realloc((char *)(a), (unsigned)(b)) if(newsize > buf->orig.msize_bun){ buf->orig.bun = (WNN_BUN **)Realloc(buf->orig.bun, newsize * sizeof(WNN_BUN *)); buf->orig.down_bnst = (WNN_BUN **)Realloc(buf->orig.down_bnst, newsize * sizeof(WNN_BUN *)); buf->orig.msize_bun = newsize; } for(k = buf->orig.bun_suu; k < newsize; k++){ buf->orig.down_bnst[k] = NULL; } bcopy((char *)&buf->orig.bun[bun_no2], (char *)&buf->orig.bun[bun_no + cnt], (buf->orig.bun_suu - bun_no2) * sizeof(WNN_BUN *)); bcopy((char *)&buf->orig.down_bnst[bun_no2], (char *)&buf->orig.down_bnst[bun_no + cnt], (buf->orig.bun_suu - bun_no2) * sizeof(WNN_BUN *)); if(bun_no2 < bun_no + cnt){ bzero((char *)&buf->orig.down_bnst[bun_no2], (bun_no + cnt - bun_no2) * sizeof(WNN_BUN *)); } buf->orig.bun_suu = newsize; } static void make_space_for_zenkouho(buf, bun_no, bun_no2, cnt) struct wnn_buf_mt *buf; int bun_no, bun_no2; register int cnt; { register int newsize; newsize = buf->orig.zenkouho_suu + cnt - (bun_no2 - bun_no); if(newsize > buf->orig.msize_zenkouho){ buf->orig.zenkouho = (WNN_BUN **)Realloc(buf->orig.zenkouho, newsize * sizeof(WNN_BUN *)); buf->orig.zenkouho_dai = (int *)Realloc(buf->orig.zenkouho_dai, (1 + newsize) * sizeof(int *)); buf->orig.msize_zenkouho = newsize; } bcopy((char *)&buf->orig.zenkouho[bun_no2], (char *)&buf->orig.zenkouho[bun_no + cnt], (buf->orig.zenkouho_suu - bun_no2) * sizeof(WNN_BUN *)); buf->orig.zenkouho_suu = newsize; } static int insert_sho(buf, zenp, bun_no, bun_no2, sp, cnt, uniq_level, fuku, nhinsi, hlist) struct wnn_buf_mt *buf; int bun_no, bun_no2; register struct wnn_sho_bunsetsu *sp; int cnt; int zenp; /* daip */ int uniq_level; /* uniq is only supported when bun_no = -1 and zenp == ZENKOUHO */ int fuku, nhinsi, *hlist; { register WNN_BUN **b; register int k; if(bun_no == -1){ bun_no = bun_no2 = (zenp == BUN)? buf->orig.bun_suu: buf->orig.zenkouho_suu; } /* It will make too big space when uniq_level > 0, but That's OK! */ make_space_for(buf, zenp, bun_no, bun_no2, cnt); b = ((zenp == BUN)? buf->orig.bun: buf->orig.zenkouho) + bun_no; for(k = bun_no ; k < bun_no + cnt ; k++, sp++){ /* ÉÊ»ì»ØÄêÊÑ´¹¤ÎºÝ¤Ï¡¢find_same_kouho() ¤ò¤·¤Æ¡¢ ¼¡¸õÊä¥ê¥¹¥È¤Î¥À¥Ö¥ê¤òËɤ° */ if(uniq_level && ((k < bun_no + cnt - 2) || nhinsi)){ if(find_same_kouho(sp, buf->orig.zenkouho, b,uniq_level))continue; } *b = get_sho(buf, sp, zenp, SHO, fuku, nhinsi, hlist); (*b)->dai_top = (sp->status == WNN_CONNECT)? 0:1; if(zenp != BUN){ if(buf->orig.zenkouho_endvect != -1){ (*b)->dai_end = (sp->status_bkwd == WNN_CONNECT_BK)? 0:1; }else{ (*b)->dai_end = 1; } } b++; } if(uniq_level && zenp == ZENKOUHO){ buf->orig.zenkouho_suu = b - buf->orig.zenkouho; } return(cnt + bun_no); } /* for zenkouho, assume bun_no = bun_no2 = zenkouho_suu */ static int insert_dai(buf, zenp, bun_no, bun_no2, dp, dcnt, uniq_level, fuku, nhinsi, hlist) struct wnn_buf_mt *buf; int bun_no, bun_no2; struct wnn_dai_bunsetsu *dp; int dcnt; int zenp; int uniq_level; int fuku, nhinsi, *hlist; { register WNN_BUN **b, **b0; register int k, l, m; register int cnt = 0; struct wnn_sho_bunsetsu *sp, *sp1; if(bun_no == -1){ bun_no = bun_no2 = (zenp == BUN)? buf->orig.bun_suu: buf->orig.zenkouho_suu; } for(k = 0; k < dcnt ; k++){ cnt += dp[k].sbncnt; } make_space_for(buf, zenp, bun_no, bun_no2, cnt); /* zenkouho_dai_suu must not be initialized */ b = ((zenp == BUN)? buf->orig.bun: buf->orig.zenkouho) + bun_no; for(k = 0, m = buf->orig.zenkouho_dai_suu ; k < dcnt; k++){ /* ÉÊ»ì»ØÄêÊÑ´¹¤ÎºÝ¤Ï¡¢find_same_kouho_dai() ¤ò¤·¤Æ¡¢ ¼¡¸õÊä¥ê¥¹¥È¤Î¥À¥Ö¥ê¤òËɤ° */ if(uniq_level && ((k < dcnt - 2) || nhinsi)){ if(find_same_kouho_dai(&dp[k], buf, m, uniq_level)) continue; } sp = dp[k].sbn; if(zenp == ZENKOUHO){ buf->orig.zenkouho_dai[m++] = b - buf->orig.zenkouho; } b0 = b; sp1 = sp; for(l = 0 ; l < dp[k].sbncnt; l++){ *b = get_sho(buf, sp, zenp, DAI, fuku, nhinsi, hlist); if(zenp == ZENKOUHO){ if (l == dp[k].sbncnt -1){ if(buf->orig.zenkouho_endvect != -1){ (*b)->dai_end = (sp->status_bkwd == WNN_CONNECT_BK)? 0:1; }else{ (*b)->dai_end = 0; } }else{ (*b)->dai_end = 0; } } b++; sp++; } (*b0)->dai_top = (sp1->status == WNN_CONNECT)? 0:1; (*b0)->daihyoka = dp[k].hyoka; } if(zenp == ZENKOUHO){ buf->orig.zenkouho_dai[m] = b - buf->orig.zenkouho; buf->orig.zenkouho_suu = b - buf->orig.zenkouho; buf->orig.zenkouho_dai_suu = m; } return(cnt + bun_no); } static void set_sho(b, p) register WNN_BUN *b; register WNN_BUN **p; { b->ref_cnt++; *p = b; } static void set_dai(b, p, n) register WNN_BUN **b; register WNN_BUN **p; register int n; { for(;n;n--){ (*b)->ref_cnt++; *p++ = *b++; } } static int get_c_jikouho_from_zenkouho(buf, dest) struct wnn_buf_mt *buf; WNN_BUN *dest; { register int k; w_char area[LENGTHKANJI]; w_char area1[LENGTHKANJI]; register WNN_BUN *b; wnn_area(dest, area, WNN_KANJI); for(k = 0; k < buf->orig.zenkouho_suu; k++){ b = buf->orig.zenkouho[k]; if(b->entry == dest->entry && b->dic_no == dest->dic_no){ wnn_area(b, area1, WNN_KANJI); if(wnn_Strcmp(area, area1) == 0){ return(k); } } } return(-1); } static int get_c_jikouho_from_zenkouho_dai(buf, dest) struct wnn_buf_mt *buf; WNN_BUN *dest; { register int k; w_char area[LENGTHKANJI]; w_char area1[LENGTHKANJI]; register WNN_BUN *b; register int l; wnn_area(dest, area, WNN_KANJI); for(k = 0; k < buf->orig.zenkouho_dai_suu; k++){ b = buf->orig.zenkouho[buf->orig.zenkouho_dai[k]]; for(l = 0 ; l < buf->orig.zenkouho_dai[k + 1]; l++, dest++, b++){ if(b->entry != dest->entry || b->dic_no != dest->dic_no) break; wnn_area(b, area1, WNN_KANJI); if(wnn_Strcmp(area, area1) != 0){ break; } } if(l == buf->orig.zenkouho_dai[k + 1]){ return(k); } } return(-1); } static int get_c_jikouho(sp, cnt, dest) struct wnn_sho_bunsetsu *sp; int cnt; WNN_BUN *dest; { register int k; register int len; w_char area[LENGTHKANJI]; wnn_area(dest, area, WNN_KANJI); for(k = 0; k < cnt; k++,sp++){ if(sp->entry == dest->entry && sp->dic_no == dest->dic_no && sp->kangovect == dest->kangovect){ if(wnn_Strncmp(area, sp->kanji, len = wnn_Strlen(sp->kanji)) == 0 && wnn_Strcmp(area + len, sp->fuzoku) == 0){ return(k); } } } return(-1); } static int get_c_jikouho_dai(dp, cnt, dest, bun_no) struct wnn_dai_bunsetsu *dp; int cnt; WNN_BUN **dest; int bun_no; { register int k, l; register int len; w_char area[LENGTHKANJI]; register struct wnn_sho_bunsetsu *sp; for(k = 0; k < cnt; k++,dp++){ sp = dp->sbn; for(l = 0 ; l < dp->sbncnt; l++, sp++){ if(sp->entry != (dest[bun_no + l])->entry || sp->kangovect != (dest[bun_no + l])->kangovect || sp->dic_no != (dest[bun_no + l])->dic_no){ break; } wnn_area(dest[bun_no + l], area, WNN_KANJI); if(wnn_Strncmp(area, sp->kanji, len = wnn_Strlen(sp->kanji)) != 0 || wnn_Strcmp(area + len, sp->fuzoku) != 0){ break; } } if(l == dp->sbncnt) return(k); } return(-1); } static int find_same_kouho(sp, st, end, level) struct wnn_sho_bunsetsu *sp; register WNN_BUN **st, **end; int level; { register int len; w_char area[LENGTHKANJI]; register WNN_BUN *b; if(level == WNN_UNIQ){ for(; st < end; st++){ b = *st; if(sp->hinsi == b->hinsi){ wnn_area(b, area, WNN_KANJI); if(wnn_Strncmp(area, sp->kanji, len = wnn_Strlen(sp->kanji)) == 0 && wnn_Strcmp(area + len, sp->fuzoku) == 0){ return(1); } } } }else{ /* level = WNN_UNIQ_KNJ */ for(; st < end; st++){ b = *st; wnn_area(b, area, WNN_KANJI); if(wnn_Strncmp(area, sp->kanji, len = wnn_Strlen(sp->kanji)) == 0 && wnn_Strcmp(area + len, sp->fuzoku) == 0){ return(1); } } } return(0); } static int find_same_kouho_dai(dp, buf, top, level) struct wnn_dai_bunsetsu *dp; struct wnn_buf_mt *buf; int top; int level; { int len; register int k, l; w_char area[LENGTHKANJI]; WNN_BUN *b; register struct wnn_sho_bunsetsu *sp; for(k = 0 ; k < top ; k++){ for(l = 0,sp = dp->sbn ; l < dp->sbncnt; l++, sp++){ b = buf->orig.zenkouho[buf->orig.zenkouho_dai[k] + l]; if(sp->end - sp->start + 1 != b->yomilen) break;/* From: tsuiki */ if(level != WNN_UNIQ_KNJ){ if(sp->hinsi != b->hinsi) break; } wnn_area(b, area, WNN_KANJI); if(wnn_Strncmp(area, sp->kanji, len = wnn_Strlen(sp->kanji)) != 0 || wnn_Strcmp(area + len, sp->fuzoku) != 0){ break; } } if(l == dp->sbncnt) return(1); } return(0); } int wnn_cnt_free(buf) struct wnn_buf *buf; { register int n; register WNN_BUN *b; for(n = 0, b = buf->free_heap;b;n++, b = b->free_next); return(n); } static struct wnn_jdata * jl_word_info_e_body(env, dic_no, entry) register struct wnn_env_int *env; int dic_no, entry; { struct wnn_jdata *x; if (js_word_info(env,dic_no, entry, &wordrb) < 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(NULL); } x = (struct wnn_jdata *)(wordrb.buf); return x; } struct wnn_jdata * jl_word_info_e(env, dic_no, entry) register struct wnn_env *env; int dic_no, entry; { struct wnn_jdata *x; if(!env) return(NULL); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_word_info_e_body((WNN_ENV_INT *)env, dic_no, entry); UnlockMutex(&ENV_LOCK(env)); return x; } struct wnn_jdata * jl_word_info(buf, dic_no, entry) register struct wnn_buf *buf; int dic_no, entry; { struct wnn_jdata *x; if(!buf || !(buf->env)) return(NULL); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_word_info_e_body((WNN_ENV_INT *)buf->env, dic_no, entry); if(x == NULL) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } /*:::DOC_START * * Function Name: jl_dic_list_e_body * Description : ¼­½ñ¾ðÊó¼èÆÀ¤Î¥µ¥Ö¥ë¡¼¥Á¥ó * Parameter : * env : (InOut) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * dmask : (In) ¼­½ñ·²ÀßÄê¥Þ¥¹¥¯ * dicinfo : (Ont) ¥Ç¡¼¥¿¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñ¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int jl_dic_list_e_body(env, dmask, dicinfo) struct wnn_env_int *env; unsigned long dmask; WNN_DIC_INFO **dicinfo; { WNN_DIC_INFO *info; int cnt; register int k; register char *c; if(dmask == 0) cnt = js_dic_list(env, &dicrb); else cnt = js_fi_dic_list(env, dmask, &dicrb); if (cnt < 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } info = (WNN_DIC_INFO *)(dicrb.buf); /* If the file is loaded from this client, change the file name to the one used in loading it. */ LockMutex(&envs_lock); for(k = 0 ; k < cnt ; k++){ c = find_file_name_from_id(env, info[k].body); if(c != NULL){ strcpy(info[k].fname, c); } c = find_file_name_from_id(env, info[k].hindo); if(c != NULL){ strcpy(info[k].hfname, c); } } *dicinfo = info; UnlockMutex(&envs_lock); return(cnt); } /* End of jl_dic_list_e_body */ /*:::DOC_START * * Function Name: jl_dic_list_e * Description : ´Ä¶­¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë£×£î£î¼­½ñ¾ðÊó¤òÆÀ¤ë * Parameter : * env : (InOut) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * dicinfo : (Ont) ¥Ç¡¼¥¿¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñ¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_dic_list_e(env, dicinfo) struct wnn_env *env; WNN_DIC_INFO **dicinfo; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_dic_list_e_body((WNN_ENV_INT *)env, 0, dicinfo); UnlockMutex(&ENV_LOCK(env)); return x; } /* End of jl_dic_list_e */ /*:::DOC_START * * Function Name: jl_dic_list * Description : ´Ä¶­¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë£×£î£î¼­½ñ¾ðÊó¤òÆÀ¤ë * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * dip : (Ont) ¥Ç¡¼¥¿¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñ¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_dic_list(buf, dip) register struct wnn_buf *buf; WNN_DIC_INFO **dip; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_dic_list_e_body((WNN_ENV_INT *)buf->env, 0, dip); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } /* End of jl_dic_list */ /*:::DOC_START * * Function Name: jl_fi_dic_list_e * Description : ´Ä¶­¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¼­½ñ¤ÎÆâ¡¢»ØÄꤷ¤¿¼­½ñ·²¤Î * ¾ðÊó¤òÆÀ¤ë * Parameter : * env : (InOut) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * dmask : (In) ¼­½ñ·²ÀßÄê¥Þ¥¹¥¯ * dicinfo : (Ont) ¥Ç¡¼¥¿¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñ¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_fi_dic_list_e(env, dmask, dicinfo) struct wnn_env *env; unsigned long dmask; WNN_DIC_INFO **dicinfo; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_dic_list_e_body((WNN_ENV_INT *)env, dmask, dicinfo); UnlockMutex(&ENV_LOCK(env)); return x; } /* End of jl_fi_dic_list_e */ /*:::DOC_START * * Function Name: jl_fi_dic_list * Description : ´Ä¶­¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¼­½ñ¤ÎÆâ¡¢»ØÄꤷ¤¿¼­½ñ·²¤Î * ¾ðÊó¤òÆÀ¤ë * Parameter : * buf : (InOut) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * dmask : (In) ¼­½ñ·²ÀßÄê¥Þ¥¹¥¯ * dip : (Ont) ¥Ç¡¼¥¿¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : -1==ERROR, else ÅÐÏ¿¼­½ñ¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_fi_dic_list(buf, dmask, dip) register struct wnn_buf *buf; unsigned long dmask; WNN_DIC_INFO **dip; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_dic_list_e_body((WNN_ENV_INT *)buf->env, dmask, dip); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } /* End of jl_fi_dic_list */ /*:::DOC_START * * Function Name: jl_fuzokugo_list_e_body * Description : ÉÕ°¸ì¾ðÊó¼èÆÀ¤Î¥µ¥Ö¥ë¡¼¥Á¥ó * Parameter : * env : (InOut) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * curfzk : (Out) ¸½ºß»ÈÍÑ¥Õ¥¡¥¤¥ë¼±ÊÌ»Ò * fzkinfo : (Out) ÉÕ°¸ì¾ðÊó¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : -1==ERROR, else ÆÉ¹þ¤ßÉÕ°¸ì¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int jl_fuzokugo_list_e_body(env, curfzk, fzkinfo) struct wnn_env *env; int *curfzk; WNN_FZK_INFO **fzkinfo; { int cnt; if((cnt = js_fuzokugo_list(env, curfzk, fzkinfo)) < 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } return(cnt); } /* End of jl_fuzokugo_list_e_body */ /*:::DOC_START * * Function Name: jl_fuzokugo_list_e * Description : »ØÄꤵ¤ì¤¿¥µ¡¼¥Ð¤ËÆÉ¤ß¹þ¤Þ¤ì¤Æ¤¤¤ëÁ´ÉÕ°¸ì¾ðÊó¤È * ´Ä¶­¤Ë¸½ºßÀßÄꤵ¤ì¤Æ¤¤¤ë¾ðÊó¤Î¼±Ê̻ҤòÊÖ¤¹ * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * curfzk : (Out) ¸½ºß»ÈÍÑ¥Õ¥¡¥¤¥ë¼±ÊÌ»Ò * fzkinfo : (Out) ¥Ç¡¼¥¿¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : -1==ERROR, else ÆÉ¹þ¤ßÉÕ°¸ì¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_fuzokugo_list_e(env, curfzk, fzkinfo) struct wnn_env *env; int *curfzk; WNN_FZK_INFO **fzkinfo; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_fuzokugo_list_e_body((WNN_ENV_INT *)env, curfzk, fzkinfo); UnlockMutex(&ENV_LOCK(env)); return x; } /* End of jl_fuzokugo_list_e */ /*:::DOC_START * * Function Name: jl_fuzokugo_list * Description : »ØÄꤵ¤ì¤¿¥µ¡¼¥Ð¤ËÆÉ¤ß¹þ¤Þ¤ì¤Æ¤¤¤ëÁ´ÉÕ°¸ì¾ðÊó¤È * ´Ä¶­¤Ë¸½ºßÀßÄꤵ¤ì¤Æ¤¤¤ë¾ðÊó¤Î¼±Ê̻ҤòÊÖ¤¹ * Parameter : * buf : (In) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * curfzk : (Out) ¸½ºß»ÈÍÑ¥Õ¥¡¥¤¥ë¼±ÊÌ»Ò * fzkp : (Out) ¥Ç¡¼¥¿¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : -1==ERROR, else ÆÉ¹þ¤ßÉÕ°¸ì¿ô * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_fuzokugo_list(buf, curfzk, fzkp) register struct wnn_buf *buf; int *curfzk; WNN_FZK_INFO **fzkp; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_fuzokugo_list_e_body((WNN_ENV_INT *)buf->env, curfzk, fzkp); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } /* End of jl_fuzokugo_list */ /*:::DOC_START * * Function Name: jl_free * Description : ÊÑ´¹ÉÊ»ì¾ðÊó¡¢ÉÕ°¸ì¾ðÊó¤ò free ¤¹¤ë * Parameter : * ptr : Âоݥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_free(ptr) char *ptr; { free(ptr); return(0); } /* End of jl_free */ static int sort_func_ws(a,b) register char *a, *b; { int ah, bh, ai, bi, iah, ibh, iai, ibi; ah = ((struct wnn_jdata *)a)->hindo; bh = ((struct wnn_jdata *)b)->hindo; iah = ((struct wnn_jdata *)a)->int_hindo; ibh = ((struct wnn_jdata *)b)->int_hindo; ai = ((struct wnn_jdata *)a)->ima; bi = ((struct wnn_jdata *)b)->ima; iai = ((struct wnn_jdata *)a)->int_ima; ibi = ((struct wnn_jdata *)b)->int_ima; if(ai == WNN_IMA_OFF && ah == WNN_ENTRY_NO_USE) return(1); if(bi == WNN_IMA_OFF && bh == WNN_ENTRY_NO_USE) return(-1); if(iai == WNN_IMA_OFF && iah == WNN_ENTRY_NO_USE) return(1); if(ibi == WNN_IMA_OFF && ibh == WNN_ENTRY_NO_USE) return(-1); if(ai != bi){ if(ai < bi) return(1); return(-1); } if(iah >= 0){ ah += iah; bh += ibh; } if(ah > bh)return(-1); if(ah < bh)return(1); return(0); } static int jl_word_search_e_body(env,dic_no, yomi, jdp) register struct wnn_env_int *env; int dic_no; w_char *yomi; struct wnn_jdata **jdp; { register int cnt; struct wnn_jdata *jd; if ((cnt = js_word_search(env,dic_no, yomi, &wordrb)) < 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } jd = (struct wnn_jdata *)wordrb.buf; qsort((char *)jd,cnt,sizeof(struct wnn_jdata),sort_func_ws); *jdp = jd; return(cnt); } int jl_word_search_e(env,dic_no, yomi, jdp) register struct wnn_env *env; int dic_no; w_char *yomi; struct wnn_jdata **jdp; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_word_search_e_body((WNN_ENV_INT *)env,dic_no, yomi, jdp); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_word_search(buf, dic_no, yomi, jdp) register struct wnn_buf *buf; int dic_no; w_char *yomi; struct wnn_jdata **jdp; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_word_search_e_body((WNN_ENV_INT *)buf->env, dic_no, yomi, jdp); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static int jl_word_search_by_env_e_body(env, yomi, jdp) register struct wnn_env_int *env; struct wnn_jdata **jdp; w_char *yomi; { register int cnt; struct wnn_jdata *jd; if ((cnt = js_word_search_by_env(env, yomi, &wordrb)) < 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } jd = (struct wnn_jdata *)wordrb.buf; qsort((char *)jd,cnt,sizeof(struct wnn_jdata),sort_func_ws); *jdp = jd; return(cnt); } int jl_word_search_by_env_e(env, yomi, jdp) register struct wnn_env *env; struct wnn_jdata **jdp; w_char *yomi; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_word_search_by_env_e_body((WNN_ENV_INT *)env, yomi, jdp); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_word_search_by_env(buf, yomi, jdp) register struct wnn_buf *buf; struct wnn_jdata **jdp; w_char *yomi; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_word_search_by_env_e_body((WNN_ENV_INT *)buf->env, yomi, jdp); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static void add_down_bnst(buf, k, b) register struct wnn_buf_mt *buf; register int k; register WNN_BUN *b; { if(b->down) return; /* In order to prevent roop! */ if(b == buf->orig.down_bnst[k]) return; /* In order to prevent roop! */ /* It occurs when Zenkouho-->Nobi-conv */ b->down = buf->orig.down_bnst[k]; buf->orig.down_bnst[k] = b; b->ref_cnt ++; } #define REAL_PARAM(x) (strcmp(x, "-")) /** wnnrc ¤ò¸«¤Æ¤Î¥Ñ¥é¥á¡¼¥¿¤ÎÀßÄê */ int jl_set_env_wnnrc(env, wnnrc_n, error_handler, message_handler) register struct wnn_env *env; char *wnnrc_n; int (*error_handler)(), (*message_handler)(); { int level = 0; int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; if((int)error_handler == WNN_CREATE){ confirm_state = CREATE_WITHOUT_CONFIRM; }else if((int)error_handler == WNN_NO_CREATE){ confirm_state = NO_CREATE; }else{ confirm_state = CONFIRM; } x = jl_set_env_wnnrc1_body((WNN_ENV_INT *)env, wnnrc_n, error_handler, message_handler, level, 0); confirm_state = 0; UnlockMutex(&ENV_LOCK(env)); return(x); } static int jl_set_env_wnnrc1_body(env, wnnrc_n, error_handler, message_handler, level, local) register struct wnn_env_int *env; char *wnnrc_n; int (*error_handler)(), (*message_handler)(); int level; int local; { register int num, rev, prio; char s[20][EXPAND_PATH_LENGTH]; char code[EXPAND_PATH_LENGTH]; char tmp[1024]; int tmplen; register FILE *fp; unsigned long vmask = 0; int *flag; struct wnn_henkan_env henv; int (*error_handler1)() = (int (*)())0; char *p; extern char *getenv(); if(level > MAXINCLUDE){ LockMutex(&msg_lock); message_out(message_handler, msg_get(wnn_msg_cat, 206, NULL, env->orig.lang, NULL)); /* "include ¤Î¥ì¥Ù¥ë¤¬Â¿²á¤®¤Þ¤¹¡£" */ UnlockMutex(&msg_lock); return(-1); } if (!strcmp(wnnrc_n, DEFAULT_RC_NAME)) { /* * ¥Ç¥Õ¥©¥ë¥È¤Îwnnenvrc¤òõ¤·¤Ë¹Ô¤¯ */ if(!(p = getenv("HOME"))) goto Default_WNVRC; tmplen = sizeof(tmp); strncpy(tmp, p, tmplen - 1); tmp[tmplen - 1] = 0; if (strlen(tmp) + strlen(FIWNN_DIR) >= tmplen) goto Default_WNVRC; strcat(tmp, FIWNN_DIR); if (strlen(tmp) + strlen(ENVRCFILE) >= tmplen) goto Default_WNVRC; strcat(tmp, ENVRCFILE); if ((fp = fopen(tmp, "r")) == NULL) { Default_WNVRC: /* * ¥æ¡¼¥¶¤Î¥Ç¥Õ¥©¥ë¥È¥Õ¥¡¥¤¥ë¤¬Ìµ¤«¤Ã¤¿¤Î¤Ç¡¢¥·¥¹¥Æ¥à¤Î¥Ç¥Õ¥©¥ë¥È¤ò * ¸«¤Ë¹Ô¤¯ */ sprintf(tmp, "%s/%s%s", LIBDIR, WNN_DEFAULT_LANG, ENVRCFILE); /* /usr/local/lib/wnn/ja_JP/wnnenvrc */ if((fp = fopen(tmp, "r")) == NULL) { /* * ¥·¥¹¥Æ¥à¤Î¥Ç¥Õ¥©¥ë¥È¤â¤Ê¤«¤Ã¤¿¤Î¤Ç¥¨¥é¡¼¤Ë¤¹¤ë */ message_out(message_handler, msg_get(wnn_msg_cat, 111, NULL, env->orig.lang, NULL)); UnlockMutex(&msg_lock); return(-1); } } } else { if((fp = fopen(wnnrc_n, "r")) == NULL){ LockMutex(&msg_lock); /* * »ØÄꤵ¤ì¤¿wnnennvrc¤¬¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤ */ message_out(message_handler, msg_get(wnn_msg_cat, 207, NULL, env->orig.lang, NULL), wnnrc_n); UnlockMutex(&msg_lock); return(-1); } } while(fgets(tmp,1024,fp ) != NULL){ num = sscanf(tmp, "%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s",code, s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9],s[10], s[11],s[12],s[13],s[14],s[15],s[16],s[17],s[18],s[19]) ; if (num <= 0) { continue; } if(code[0] == ';'){ continue; }else if (strcmp(code, "include") == 0){ expand_expr_all(s[0], env); if(jl_set_env_wnnrc1_body(env, s[0], error_handler, message_handler, level + 1, local) == -1){ fclose(fp); return(-1); } continue; } switch (code[0]) { case 'a': if (!strcmp(code, "autosave")) env->orig.autosave = atoi(s[0]); break; case 'k': if (!strcmp(code, "kutouten")) { /* ¶çÆÉÅÀ */ if (num < 2) goto _Err_happend; vmask |= WNN_ENV_KUTOUTEN_MASK; flag = &henv.kutouten_flag; goto _set_flag; } else if (!strcmp(code, "kakko")) { /* ³ç¸Ì */ if (num < 2) goto _Err_happend; vmask |= WNN_ENV_KAKKO_MASK; flag = &henv.kakko_flag; goto _set_flag; } else if (!strcmp(code, "kigou")) { /* µ­¹æ */ if (num < 2) goto _Err_happend; vmask |= WNN_ENV_KIGOU_MASK; flag = &henv.kigou_flag; goto _set_flag; } } if (local == 0) { switch (code[0]) { case 'b': if (!strcmp(code, "bunsetsugiri_gakusyuu")) { int dic_no, mode, type; AUTO_LEARNING: if (num < 6) goto _Err_happend; if (!strcmp(code, "muhenkan_gakusyuu")) { type = WNN_MUHENKAN_LEARNING; } else { type = WNN_BUNSETSUGIRI_LEARNING; } if (((dic_no = js_get_autolearning_dic(env, type)) == -1) && env_wnn_errorno_eql) { if (env_wnn_errorno_eql != WNN_JSERVER_DEAD) { message_out(message_handler, "%s :%s\n", s[0], wnn_perror_lang(env->orig.lang, env)); } else message_out(message_handler, "%s\n", wnn_perror_lang(env->orig.lang, env)); goto _Err_happend; } expand_expr_all(s[0], env); mode = atoi(s[1]); if ((mode > 2) || (mode < 0)) goto _Err_happend; if (!REAL_PARAM(s[3])) { s[3][0] = '\0'; } else { expand_expr_all(s[3], env); } if (dic_no == WNN_NO_LEARNING) { /* ¤Þ¤À¼­½ñ¤ò¥í¡¼¥É¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢¥í¡¼¥É¤¹¤ë */ prio = REAL_PARAM(s[2])? atoi(s[2]) : WNN_DIC_PRIO_DEFAULT; rev = REAL_PARAM(s[4])? atoi(s[4]) : 0; /* ¼«Æ°³Ø½¬¤Î¼­½ñ¤Ï¾¡¼ê¤Ëºî¤ë */ if (((dic_no = jl_dic_add_e_body(env, s[0], NULL, rev, prio, 0, 0, NULL, NULL, (int (*)())WNN_CREATE, message_handler)) == -1) && (env_wnn_errorno_eql != 0)) { if (env_wnn_errorno_eql != WNN_JSERVER_DEAD) { message_out(message_handler, "%s :%s\n", s[0], wnn_perror_lang(env->orig.lang, env)); } else message_out(message_handler, "%s\n", wnn_perror_lang(env->orig.lang, env)); goto _Err_happend; } js_set_autolearning_dic(env, type, dic_no); } if (!js_is_loaded_temporary_dic(env)) { /* ¤Þ¤À¥Æ¥ó¥Ý¥é¥ê¼­½ñ¤ò¥í¡¼¥É¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢ ¥í¡¼¥É¤¹¤ë */ if ((js_temporary_dic_add(env, rev) == -1) && (env_wnn_errorno_eql != 0)){ if (env_wnn_errorno_eql == WNN_NOT_SUPPORT_PACKET){ message_out(message_handler, msg_get(wnn_msg_cat, 211, "You can not temporary dictionary because server's version is old.", env->orig.lang, NULL)); continue; } else if (env_wnn_errorno_eql != WNN_JSERVER_DEAD) { message_out(message_handler, "%s :%s\n", s[0], wnn_perror_lang(env->orig.lang, env)); } else message_out(message_handler, "%s\n", wnn_perror_lang(env->orig.lang, env)); goto _Err_happend; } } /* ³Ø½¬¤Î¥â¡¼¥É¤òÀßÄꤹ¤ë */ if (type == WNN_MUHENKAN_LEARNING) { henv.muhenkan_flag = mode; vmask |= WNN_ENV_MUHENKAN_LEARN_MASK; } else { henv.bunsetsugiri_flag = mode; vmask |= WNN_ENV_BUNSETSUGIRI_LEARN_MASK; } } break; case 'c': if (!strcmp(code, "confirm")){ confirm_state = CONFIRM; } else if (!strcmp(code, "confirm1")) { confirm_state = CONFIRM1; } else if (!strcmp(code, "create_without_confirm")) { confirm_state = CREATE_WITHOUT_CONFIRM; } break; case 'f': if (!strcmp(code, "fi_hindo_kakuritu")) { /* £×£î£î¡¿£Æ£É´Ø·¸ÉÑÅپ徺³ÎΨ´Ø¿ô */ int is_wnn; HINDO_KAKURITU: if(!strcmp(code, "hindo_kakuritu")) { flag = &henv.freq_func_flag; is_wnn = 1; } else { flag = &henv.fi_freq_func_flag; is_wnn = 0; } switch (s[0][0]) { case 'n': case 'N': if(!strncmp(s[0], "not", 3) || !strncmp(s[0], "NOT", 3)) { /* ÉÑÅٳؽ¬¤·¤Ê¤¤ */ *flag = WNN_HINDO_NOT; } else { /* ÉáÄ̳ؽ¬ */ *flag = WNN_HINDO_NORMAL; } break; case 'a': case 'A': /* ɬ¤ºÉÑÅٳؽ¬¤¹¤ë */ *flag = WNN_HINDO_ALWAYS; break; case 'h': case 'H': /* °ìÌëÄÒ¤±³Ø½¬ */ *flag = WNN_HINDO_HIGH; break; case 'l': case 'L': /* ¤¸¤ï¤¸¤ï³Ø½¬ */ *flag = WNN_HINDO_LOW; break; default: goto _Err_happend; } if(is_wnn) vmask |= WNN_ENV_FREQ_FUNC_MASK; else vmask |= WNN_ENV_FI_FREQ_FUNC_MASK; break; } else if (!strcmp(code, "fukugou_yuusen")) { /* Ê£¹ç¸ìÍ¥ÀèÊÑ´¹ */ if (num < 2) goto _Err_happend; vmask |= WNN_ENV_COMPLEX_CONV_MASK; flag = &henv.complex_flag; goto _set_flag; } break; case 'g': if (!strcmp(code, "giji_number")) { /* µ¿»÷¿ô»ú¤Î½é´üɽ¼¨ÊýË¡ */ switch (s[0][0]) { case 'k': case 'K': if(!strcmp(s[0], "kansuuji")|| !strcmp(s[0], "KANSUUJI")) { henv.numeric_flag = WNN_NUM_KANSUUJI; } else if(!strcmp(s[0], "kanold") || !strcmp(s[0], "KANOLD")) { henv.numeric_flag = WNN_NUM_KANOLD; } else if(!strcmp(s[0], "kan") || !strcmp(s[0], "KAN")) { henv.numeric_flag = WNN_NUM_KAN; } break; case 'h': case 'H': if(!strcmp(s[0], "hancan") || !strcmp(s[0], "HANCAN")) { henv.numeric_flag = WNN_NUM_HANCAN; } else if(!strcmp(s[0], "han") || !strcmp(s[0], "HAN")) { henv.numeric_flag = WNN_NUM_HAN; } break; case 'z': case 'Z': if(!strcmp(s[0], "zencan") || !strcmp(s[0], "ZENCAN")) { henv.numeric_flag = WNN_NUM_ZENCAN; } else if(!strcmp(s[0], "zen") || !strcmp(s[0], "ZEN")) { henv.numeric_flag = WNN_NUM_ZEN; } break; default: goto _Err_happend; } vmask |= WNN_ENV_NUMERIC_MASK; } else if (!strcmp(code, "giji_eisuu")) { /* µ¿»÷¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤Î½é´üɽ¼¨ÊýË¡ */ switch (s[0][0]) { case 'h': case 'H': henv.alphabet_flag = WNN_ALP_HAN; break; case 'z': case 'Z': henv.alphabet_flag = WNN_ALP_ZEN; break; default: goto _Err_happend; } vmask |= WNN_ENV_ALPHABET_MASK; } else if (!strcmp(code, "giji_kigou")) { /* µ¿»÷µ­¹æ¤Î½é´üɽ¼¨ÊýË¡ */ switch (s[0][0]) { case 'h': case 'H': henv.symbol_flag = WNN_KIG_HAN; break; case 'j': case 'J': henv.symbol_flag = WNN_KIG_JIS; break; case 'a': case 'A': henv.symbol_flag = WNN_KIG_ASC; break; default: goto _Err_happend; } vmask |= WNN_ENV_SYMBOL_MASK; } break; case 'h': if (!strcmp(code, "hindo_kakuritu")) { goto HINDO_KAKURITU; } else if (strcmp(code, "hanyou_gakusyu") == 0) { /* ÈÆÍÑ¸ì³Ø½¬ */ if (num < 2) goto _Err_happend; vmask |= WNN_ENV_COMMON_LAERN_MASK; flag = &henv.common_learn_flag; goto _set_flag; } break; case 'm': if (!strcmp(code, "muhenkan_gakusyuu")) { goto AUTO_LEARNING; } break; case 'n': if (strcmp(code, "no_create") == 0){ confirm_state = NO_CREATE; } break; case 'o': if (strcmp(code, "okuri_gakusyu") == 0) { /* Á÷¤ê´ð½à³Ø½¬ */ if (num < 2) goto _Err_happend; vmask |= WNN_ENV_OKURI_LEARN_MASK; flag = &henv.okuri_learn_flag; goto _set_flag; } else if (strcmp(code, "okuri_kijun") == 0) { /* Á÷¤ê´ð½à½èÍý */ switch (s[0][0]) { case 'r': case 'R': /* Ëܧ */ henv.okuri_flag = WNN_OKURI_REGULATION; break; case 'n': case 'N': /* Á÷¤é¤Ê¤¤ */ henv.okuri_flag = WNN_OKURI_NO; break; case 'y': case 'Y': /* Á÷¤ë */ henv.okuri_flag = WNN_OKURI_YES; break; default: goto _Err_happend; } vmask |= WNN_ENV_OKURI_MASK; } break; case 'r': if (strcmp(code, "rendaku") == 0) { /* Ï¢Âù½èÍý */ if (num < 2) goto _Err_happend; vmask |= WNN_ENV_RENDAKU_MASK; flag = &henv.rendaku_flag; goto _set_flag; } break; case 's': if (!strcmp(code, "setdic")){ /* dic_add */ int rdonly, hrdonly; expand_expr_all(s[0], env); if(num < 3 || !REAL_PARAM(s[1])){ s[1][0] = 0; }else{ expand_expr_all(s[1], env); } prio = (num >= 4 && REAL_PARAM(s[2]))? atoi(s[2]) : WNN_DIC_PRIO_DEFAULT; rdonly = (num >= 5 && REAL_PARAM(s[3]))? atoi(s[3]) : 0; hrdonly = (num >= 6 && REAL_PARAM(s[4]))? atoi(s[4]) : 0; if(num < 7 || !REAL_PARAM(s[5])) s[5][0] = 0; if(num < 8 || !REAL_PARAM(s[6])) s[6][0] = 0; rev = (num >= 9 && REAL_PARAM(s[7]))? atoi(s[7]) : 0; switch (confirm_state) { case CONFIRM: case CONFIRM1: error_handler1 = error_handler; break; case CREATE_WITHOUT_CONFIRM: error_handler1 = (int (*)())WNN_CREATE; break; case NO_CREATE: error_handler1 = (int (*)())WNN_NO_CREATE; break; } if((jl_dic_add_e_body(env, s[0], s[1], rev, prio, rdonly, hrdonly, s[5], s[6], error_handler1, message_handler) == -1) && (env_wnn_errorno_eql != 0)) { if (env_wnn_errorno_eql != WNN_JSERVER_DEAD) message_out(message_handler, "%s (%s) :%s\n", s[0], s[1], wnn_perror_lang(env->orig.lang, env)); else message_out(message_handler, "%s\n", wnn_perror_lang(env->orig.lang, env)); goto _Err_happend; } break; }else if (!strcmp(code, "setfuzokugo") || !strcmp(code, "setgrammar")) { /* fuzokugo_set */ expand_expr_all(s[0], env); if(jl_fuzokugo_set_e_body(env,s[0]) == -1){ if (env_wnn_errorno_eql != WNN_JSERVER_DEAD) message_out(message_handler, "%s :%s\n", s[0], wnn_perror_lang(env->orig.lang, env)); else message_out(message_handler, "%s\n", wnn_perror_lang(env->orig.lang, env)); goto _Err_happend; } break; } else if (!strcmp(code, "setparam")){ struct wnn_param para; /* setparam --- set parameter */ change_ascii_to_int(s[0], ¶.n); change_ascii_to_int(s[1], ¶.nsho); change_ascii_to_int(s[2], ¶.p1); change_ascii_to_int(s[3], ¶.p2); change_ascii_to_int(s[4], ¶.p3); change_ascii_to_int(s[5], ¶.p4); change_ascii_to_int(s[6], ¶.p5); change_ascii_to_int(s[7], ¶.p6); change_ascii_to_int(s[8], ¶.p7); change_ascii_to_int(s[9], ¶.p8); change_ascii_to_int(s[10], ¶.p9); change_ascii_to_int(s[11], ¶.p10); change_ascii_to_int(s[12], ¶.p11); change_ascii_to_int(s[13], ¶.p12); change_ascii_to_int(s[14], ¶.p13); change_ascii_to_int(s[15], ¶.p14); change_ascii_to_int(s[16], ¶.p15); if (js_param_set(env,¶) < 0) { fclose(fp); LockMutex(&msg_lock); message_out(message_handler, msg_get(wnn_msg_cat, 208, NULL, env->orig.lang, NULL), wnnrc_n); /* * "¥Õ¥¡¥¤¥ë \"%s\" ¤Ç´Ä¶­ÀßÄêÃæ¤Ë¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿ * ¤¿¤á¤Ë¡¢ÀßÄê¤òÃæ»ß¤·¤Þ¤¹¡£\n", */ UnlockMutex(&msg_lock); env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } break; } else if (!strcmp(code, "saisyu_siyou")) { /* ºÇ½ª»ÈÍѺÇÍ¥Àè */ if (num < 2) goto _Err_happend; vmask |= WNN_ENV_LAST_IS_FIRST_MASK; flag = &henv.last_is_first_flag; goto _set_flag; } else if (!strcmp(code, "settou_gakusyu")) { /* ÀÜÆ¬¸ì³Ø½¬ */ if (num < 2) goto _Err_happend; vmask |= WNN_ENV_PREFIX_LEARN_MASK; flag = &henv.prefix_learn_flag; goto _set_flag; } else if (!strcmp(code, "settou_kouho")) { /* ÀÜÆ¬¸ì¸õÊä */ switch (s[0][0]) { case 'h': case 'H': /* ¤Ò¤é¤¬¤Ê¡Ê¤ª¡Ë*/ vmask |= WNN_ENV_PREFIX_MASK; henv.prefix_flag = WNN_KANA_KOUHO; break; case 'k': case 'K': /* ´Á»ú¡Ê¸æ¡Ë*/ vmask |= WNN_ENV_PREFIX_MASK; henv.prefix_flag = WNN_KANJI_KOUHO; break; default: break; } break; } else if (strcmp(code, "setubi_gakusyu") == 0) { /* ÀÜÈø¸ì³Ø½¬ */ if (num < 2) goto _Err_happend; vmask |= WNN_ENV_SUFFIX_LEARN_MASK; flag = &henv.suffix_learn_flag; goto _set_flag; /* * Hideyuki Kishiba (Jul. 12, 1994) * £Æ£É´Ø·¸¥·¥¹¥Æ¥à¼­½ñ¤È£Æ£É´Ø·¸¥æ¡¼¥¶¼­½ñ¤ÎÀßÄê */ } else if (strcmp(code, "set_fi_system_dic") == 0) { char nul = 0; int hrdonly; /* ¥Õ¥¡¥¤¥ë̾¤Î @, ~ ¤òŸ³«¤¹¤ë */ expand_expr_all(s[0], env); if(num < 3 || !REAL_PARAM(s[1])){ s[1][0] = 0; }else{ expand_expr_all(s[1], env); } /* £Æ£É´Ø·¸ÉÑÅÙ¤Ï R_ONLY or R/W ¤«¡© */ hrdonly = (num >= 4 && REAL_PARAM(s[2]))? atoi(s[2]) : WNN_DIC_RDONLY; /* £Æ£É´Ø·¸ÉÑÅ٤Υѥ¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë */ if(num < 5 || !REAL_PARAM(s[3])) s[3][0] = 0; switch (confirm_state) { case CONFIRM: case CONFIRM1: error_handler1 = error_handler; break; case CREATE_WITHOUT_CONFIRM: error_handler1 = (int (*)())WNN_CREATE; break; case NO_CREATE: error_handler1 = (int (*)())WNN_NO_CREATE; break; } if((jl_fi_dic_add_e_body(env, s[0], s[1], WNN_FI_SYSTEM_DICT, WNN_DIC_RDONLY, hrdonly, &nul, s[3], error_handler1, message_handler) == -1) && (env_wnn_errorno_eql != 0)) { if (env_wnn_errorno_eql != WNN_JSERVER_DEAD) message_out(message_handler, "%s (%s) :%s\n", s[0], s[1], wnn_perror_lang(env->orig.lang, env)); else message_out(message_handler, "%s\n", wnn_perror_lang(env->orig.lang, env)); goto _Err_happend; } } else if (!strcmp(code, "set_fi_user_dic")) { int rdonly, hrdonly; /* ¥Õ¥¡¥¤¥ë̾¤Î @, ~ ¤òŸ³«¤¹¤ë */ expand_expr_all(s[0], env); /* £Æ£É´Ø·¸¼­½ñ¤Ï R_ONLY or R/W ¤«¡© */ rdonly = (num >= 3 && REAL_PARAM(s[1]))? atoi(s[1]) : WNN_DIC_RDONLY; /* £Æ£É´Ø·¸¼­½ñ¤Î¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë */ if(num < 4 || !REAL_PARAM(s[2])) s[2][0] = 0; switch (confirm_state) { case CONFIRM: case CONFIRM1: error_handler1 = error_handler; break; case CREATE_WITHOUT_CONFIRM: error_handler1 = (int (*)())WNN_CREATE; break; case NO_CREATE: error_handler1 = (int (*)())WNN_NO_CREATE; break; } if((jl_fi_dic_add_e_body(env, s[0], NULL, WNN_FI_USER_DICT, rdonly, WNN_DIC_RDONLY, s[2], NULL, error_handler1, message_handler) == -1) && (env_wnn_errorno_eql != 0)) { if (env_wnn_errorno_eql != WNN_JSERVER_DEAD) message_out(message_handler, "%s (%s) :%s\n", s[0], s[1], wnn_perror_lang(env->orig.lang, env)); else message_out(message_handler, "%s\n", wnn_perror_lang(env->orig.lang, env)); goto _Err_happend; } henv.fi_relation_learn_flag = rdonly; vmask |= WNN_ENV_FI_RELATION_LEARN_MASK; } break; case 'u': if (!strcmp(code, "use_hinsi") || !strcmp(code, "unuse_hinsi")) { /* ÊÑ´¹»ÈÍÑ¡¦ÉÔ»ÈÍÑÉÊ»ì */ int ii, *hlist, nhinsi = num - 1; w_char whname[64]; if(nhinsi) { if(!(hlist = (int *)malloc(nhinsi * sizeof(int)))) goto _Err_happend; for(ii = 0; ii < nhinsi; ii++) { _Sstrcpy(whname, s[ii]); if((hlist[ii] = jl_hinsi_number_e_body(env, whname)) == -1) { free((char *)hlist); goto _Err_happend; } } if(strcmp(code, "unuse_hinsi") == 0) nhinsi *= -1; if(js_set_henkan_hinsi(env, 1, nhinsi, hlist) < 0) { free((char *)hlist); goto _Err_happend; } free((char *)hlist); } } break; case 'y': if (strcmp(code, "yuragi") == 0) { /* Ĺ²»¡¦Íɤ®½èÍý */ if (num < 2) goto _Err_happend; vmask |= WNN_ENV_YURAGI_MASK; flag = &henv.yuragi_flag; goto _set_flag; } break; } continue; _set_flag: switch (s[0][0]) { case 't': case 'T': *flag = True; break; case 'f': case 'F': *flag = False; break; default: goto _Err_happend; } } } if(vmask) { if(js_set_henkan_env(env, vmask, &henv) < 0) goto _Err_happend; } fclose(fp); return(0); _Err_happend: LockMutex(&msg_lock); message_out(message_handler, "%s set Error!!\n", code); message_out(message_handler, msg_get(wnn_msg_cat, 208, NULL, env->orig.lang, NULL), wnnrc_n); /* * "¥Õ¥¡¥¤¥ë \"%s\" ¤Ç´Ä¶­ÀßÄêÃæ¤Ë¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤¿¤á¤Ë¡¢ * ÀßÄê¤òÃæ»ß¤·¤Þ¤¹¡£\n", */ UnlockMutex(&msg_lock); fclose(fp); return(-1); } int jl_set_env_wnnrc1(env, wnnrc_n, error_handler, message_handler, level) register struct wnn_env *env; char *wnnrc_n; int (*error_handler)(), (*message_handler)(); int level; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_set_env_wnnrc1_body((WNN_ENV_INT *)env, wnnrc_n, error_handler, message_handler, level, 0); UnlockMutex(&ENV_LOCK(env)); return x; } static int expand_expr_all(s, env) struct wnn_env_int *env; register char *s; { register char *c; for(c = s; *c; c++){ if(*c == '~' || *c == '@'){ if(expand_expr(c, env) == -1) return(-1); } } return(0); } /* copy of js.c */ static char * getlogname() { extern struct passwd *getpwuid(); struct passwd *p; if ((p = getpwuid(getuid())) == NULL) return(NULL); return(p->pw_name); } static int expand_expr(s, env) struct wnn_env_int *env; /** ~user¡¢@HOME¡¢@LIBDIR @ENV @USR ¤ÎŸ³«(⤷¡¢Ê¸»úÎó¤ÎÀèÆ¬¤Î¤ß)¡£ ¤Ç¤­¤Ê¤¤»þ¤Ï-1¤¬ Ê֤ꡢ¤½¤Î¾ì¹çs¤ÎÃæ¿È¤ÏÃ塹¤È¤½¤Î¤Þ¤ó¤Þ¡£s¤ÎŤµ¡ã256¤È²¾Äꤷ¤Æ¤ë¡£*/ register char *s; { char *p, *s1; char tmp[EXPAND_PATH_LENGTH]; char buf[EXPAND_PATH_LENGTH]; int noerr, expandsuc; struct passwd *u; extern char *getenv(); extern struct passwd *getpwnam(); #ifdef SYSVR2 #ifndef AIXV3 extern char * strchr(); #endif /* AIXV3 */ #endif if(*s != '~' && *s != '@') return(0); if((int)strlen(s) >= EXPAND_PATH_LENGTH) return(-1); s1 = s; #ifdef BSD42 if(NULL != (p = index(++s1, '/'))){ #else if(NULL != (p = strchr(++s1, '/'))){ #endif strcpy(tmp, p); *p = '\0'; } else *tmp = '\0'; /* ¤³¤³¤Þ¤Ç¤Ï½àÈ÷¡£s¡ÄÀèÆ¬¡¢s1¡Ä£²Ê¸»úÌÜ¡¢p¡ÄºÇ½é¤Î'/'¤Î¤¢¤Ã¤¿¤È¤³¤í ¡Ê¤³¤³¤Ç°ìöÀÚ¤ë¡Ë¡¢tmp¡Ä¤½¤ì°Ê¸å¤Î¥³¥Ô¡¼¡£*/ if(*s == '~'){ if(*s1){ noerr = expandsuc = (NULL != (u = getpwnam(s1)) && (int)strlen(p = u -> pw_dir) + (int)strlen(tmp) < EXPAND_PATH_LENGTH ); } else { noerr = expandsuc = (NULL != (p = getenv("HOME")) && (int)strlen(p) + (int)strlen(tmp) < EXPAND_PATH_LENGTH); } } else { /* then, *s must be '@' */ if(!strcmp(s1, "HOME")){ noerr = expandsuc = (NULL != (p = getenv("HOME")) && (int)strlen(p) + (int)strlen(tmp) < EXPAND_PATH_LENGTH); }else if(!strcmp(s1, "WNN_DIC_DIR")){ noerr = expandsuc = (NULL != (p = getenv("HOME")) && (int)strlen(p) + (int)strlen(tmp) < EXPAND_PATH_LENGTH); if (expandsuc) { strcpy(buf, p); if (strlen(buf) + strlen("/") < sizeof(buf)) { strcat(buf, "/"); p = getenv("WNN_DIC_DIR"); if (!p) p = "Wnn"; if (strlen(buf) + strlen(p) < sizeof(buf)) { strcat(buf, p); p = buf; } else noerr = expandsuc = 0; } else noerr = expandsuc = 0; } } else if (!strcmp(s1, "LIBDIR")){ noerr = expandsuc = ((int)strlen(p= LIBDIR)+ (int)strlen(tmp) < EXPAND_PATH_LENGTH); } else if (!strcmp(s1, "ENV")){ /* Added */ noerr = expandsuc = (NULL != (p = env_name(env)) && (int)strlen(p)+ (int)strlen(tmp) < EXPAND_PATH_LENGTH); }else if (!strcmp(s1, "USR")){ noerr = expandsuc = (NULL != (p = getlogname()) && (int)strlen(p)+ (int)strlen(tmp) < EXPAND_PATH_LENGTH); } else { /* @HOME, @LIBDIR @ENV igai ha kaenai */ noerr = 1; expandsuc = 0; } } if(expandsuc) strcpy(s, p); strcat(s, tmp); return(noerr ? 0 : -1); } static int change_ascii_to_int(st,dp) register char *st; int *dp; { register int total,flag; total = 0; flag = 0; while(*st != NULL){ if (isdigit(*st)){ total = total * 10 + (*st - '0'); } else if (*st == '+') { if (flag != 0) { return(-1); } flag = 1; } else if (*st == '-') { if (flag != 0) { return(-1); } flag = -1; } else { return(-1); } st++; } if (flag == 0){ flag = 1; } *dp = total * flag; return(1); } static int file_exist(env, n) struct wnn_env_int *env; char *n; { if(n[0] == C_LOCAL){ return(access(n + 1, 4)); }else{ return(js_access(env,n,4)); } } static int create_file(env,n, d, fid, pwd_dic, pwd_hindo, error_handler, message_handler) register struct wnn_env_int *env; char *n; int d; int fid; char *pwd_dic, *pwd_hindo; int (*error_handler)(), (*message_handler)(); { char pwd[WNN_PASSWD_LEN], hpwd[WNN_PASSWD_LEN]; int rev_dict_type; int x; /* result for creating file Hideyuki Kishiba (Jul. 7, 1994) */ if( make_dir_rec1(env, n, error_handler, message_handler) == -1){ env_wnn_errorno_set = WNN_MKDIR_FAIL; return(-1); } if(d == HINDO || d == FI_HINDO){ /* * Hideyuki Kishiba (Jul. 7, 1994) * £Æ£É´Ø·¸ÉÑÅ٤κîÀ®½èÍý¤òÄɲà */ if(create_pwd_file(env, pwd_hindo, error_handler, message_handler) == -1)return(-1); if(get_pwd(pwd_hindo, hpwd, env) == -1)return(-1); if(n[0] == C_LOCAL){ /* * Hideyuki Kishiba (Jul. 7, 1994) * ¥¯¥é¥¤¥¢¥ó¥È¦¤ËÉÑÅÙ¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë */ if(d == HINDO) x = js_hindo_file_create_client(env, fid, n + 1, NULL, hpwd); else x = js_fi_hindo_file_create_client(env, fid, n + 1, NULL, hpwd); if(x == -1){ message_out(message_handler, wnn_perror_lang(env->orig.lang, env)); if_dead_disconnect(env); return(-1); }else{ LockMutex(&msg_lock); message_out(message_handler, "%s \"%s\" %s", msg_get(wnn_msg_cat, 203, NULL, env->orig.lang, NULL), n, msg_get(wnn_msg_cat, 209, NULL, env->orig.lang, NULL)); /* "ÉÑÅÙ¥Õ¥¡¥¤¥ë \"%s\" ¤òºî¤ê¤Þ¤·¤¿¡£", */ UnlockMutex(&msg_lock); chown(n + 1, getuid(), -1); /* H.T. */ return(0); } }else{ /* * Hideyuki Kishiba (Jul. 7, 1994) * ¥µ¡¼¥Ð¦¤ËÉÑÅÙ¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë */ if(d == HINDO) x = js_hindo_file_create(env, fid, n, NULL, hpwd); else x = js_fi_hindo_file_create(env, fid, n, NULL, hpwd); if(x == -1){ message_out(message_handler, wnn_perror_lang(env->orig.lang, env)); if_dead_disconnect(env); return(-1); }else{ LockMutex(&msg_lock); message_out(message_handler, "%s \"%s\" %s", msg_get(wnn_msg_cat, 203, NULL, env->orig.lang, NULL), n, msg_get(wnn_msg_cat, 209, NULL, env->orig.lang, NULL)); /* "ÉÑÅÙ¥Õ¥¡¥¤¥ë \"%s\" ¤òºî¤ê¤Þ¤·¤¿¡£", */ UnlockMutex(&msg_lock); return(0); } } } else { if(create_pwd_file(env, pwd_hindo, error_handler, message_handler) == -1)return(-1); if(get_pwd(pwd_hindo, hpwd, env) == -1)return(-1); if(create_pwd_file(env, pwd_dic, error_handler, message_handler) == -1)return(-1); if(get_pwd(pwd_dic, pwd, env) == -1)return(-1); /* * Hideyuki Kishiba (Jul. 7, 1994) * £Æ£É´Ø·¸¼­½ñ¤ÎºîÀ®½èÍý¤òÄɲà */ if(d == JISHO) { #ifdef CONVERT_with_SiSheng if(!strncmp(js_get_lang(env), WNN_C_LANG, 5) || !strncmp(js_get_lang(env), WNN_T_LANG, 5)) rev_dict_type = CWNN_REV_DICT; else #endif /* Hideyuki Kishiba (Dec. 3, 1994) dic_add »þ¤Î rw ¥Õ¥é¥°¤Ë¤è¤ê¡¢¥°¥ë¡¼¥×¼­½ñ¡¢¥Þ¡¼¥¸¼­½ñ¤Î ºîÀ®¤ò¹Ô¤¦¤è¤¦¤Ë¤¹¤ë */ { if(fid == WNN_DIC_GROUP) rev_dict_type = WNN_GROUP_DICT; else if(fid == WNN_DIC_MERGE) rev_dict_type = WNN_MERGE_DICT; else rev_dict_type = WNN_REV_DICT; } } else rev_dict_type = WNN_FI_USER_DICT; if(n[0] == C_LOCAL){ if(js_dic_file_create_client(env, n + 1, rev_dict_type, NULL, pwd, hpwd) == -1){ message_out(message_handler, wnn_perror_lang(env->orig.lang, env)); if_dead_disconnect(env); return(-1); }else{ LockMutex(&msg_lock); message_out(message_handler, "%s \"%s\" %s", msg_get(wnn_msg_cat, 200, NULL, env->orig.lang, NULL), n, msg_get(wnn_msg_cat, 209, NULL, env->orig.lang, NULL)); /* "¼­½ñ¥Õ¥¡¥¤¥ë \"%s\" ¤òºî¤ê¤Þ¤·¤¿¡£", */ UnlockMutex(&msg_lock); chown(n + 1, getuid(), -1); return(0); } }else{ if(js_dic_file_create(env, n, rev_dict_type, NULL, pwd, hpwd)== -1){ message_out(message_handler, wnn_perror_lang(env->orig.lang, env)); if_dead_disconnect(env); return(-1); }else{ LockMutex(&msg_lock); message_out(message_handler, "%s \"%s\" %s", msg_get(wnn_msg_cat, 200, NULL, env->orig.lang, NULL), n, msg_get(wnn_msg_cat, 209, NULL, env->orig.lang, NULL)); /* "¼­½ñ¥Õ¥¡¥¤¥ë \"%s\" ¤òºî¤ê¤Þ¤·¤¿¡£", */ UnlockMutex(&msg_lock); return(0); } } } } static int make_dir_rec1(env, path, error_handler, message_handler) struct wnn_env_int *env; register char *path; int (*error_handler)(), (*message_handler)(); { char gomi[128]; register char *c; for(c = path;*c;c++){ if(*c == '/'){ strncpy(gomi,path,c - path); gomi[c - path] = 0; if(make_dir1(env, gomi, error_handler, message_handler) == -1){ return(-1); } } } return(0); } static int make_dir1(env, dirname, error_handler, message_handler) register struct wnn_env_int *env; register char *dirname; int (*error_handler)(), (*message_handler)(); { char gomi[128]; if(dirname[0] == C_LOCAL){ if(*(dirname + 1) == 0) return(0); if(access(dirname + 1 , 0) == 0){ /* check for existence */ return(0); /* dir already exists */ } }else{ if(*dirname == 0) return(0); if(js_access(env, dirname , 0) == 0){ /* check for existence */ return(0); /* dir already exists */ } } if((int)error_handler != WNN_CREATE){ LockMutex(&msg_lock); sprintf(gomi, "%s \"%s\" %s%s", msg_get(wnn_msg_cat, 210, NULL, env->orig.lang, NULL), dirname, msg_get(wnn_msg_cat, 201, NULL, env->orig.lang, NULL), msg_get(wnn_msg_cat, 202, NULL, env->orig.lang, NULL)); /* "directry \"%s\" ¤¬Ìµ¤¤¤è¡£ºî¤ë?(Y/N)", */ UnlockMutex(&msg_lock); if(call_error_handler(error_handler,gomi, env) == 0){ env_wnn_errorno_set = WNN_MKDIR_FAIL; return(-1); } } if(dirname[0] == C_LOCAL){ /* Create Directory */ #define MODE (0000000 | 0000777) uid_t euid; int ret; euid = geteuid(); seteuid(getuid()); ret = mkdir(dirname + 1 , MODE ); seteuid(euid); if (ret != 0 ) { env_wnn_errorno_set=WNN_MKDIR_FAIL; return(-1); } }else{ if(js_mkdir(env, dirname)){ if_dead_disconnect(env); return(-1); } } return(0); } static int call_error_handler(error_handler, c, env) int (*error_handler)(); char *c; ARGS *env; { register int x; x = error_handler(c); if(confirm_state == CONFIRM1){ if(x) confirm_state = CREATE_WITHOUT_CONFIRM; else confirm_state = NO_CREATE; } return(x); } static void message_out(message_handler, format, s1, s2, s3, s4, s5, s6, s7, s8) int (*message_handler)(); char *format; char *s1, *s2, *s3, *s4, *s5, *s6, *s7, *s8; { char buf[256]; if(message_handler){ sprintf(buf, format, s1, s2, s3, s4, s5, s6, s7, s8); (*message_handler)(buf); } } static int jl_yomi_len_body(buf, bun_no, bun_no2) struct wnn_buf_mt *buf; register int bun_no, bun_no2; { register int len = 0; if(bun_no2 >= buf->orig.bun_suu || bun_no2 < 0) bun_no2 = buf->orig.bun_suu; for(;bun_no < bun_no2;bun_no++){ len += buf->orig.bun[bun_no]->yomilen; } return(len); } int jl_yomi_len(buf, bun_no, bun_no2) struct wnn_buf *buf; register int bun_no, bun_no2; { int x; if(!buf) return(0); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; x = jl_yomi_len_body((WNN_BUF_MT *)buf, bun_no, bun_no2); UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_kanji_len(buf, bun_no, bun_no2) struct wnn_buf *buf; register int bun_no, bun_no2; { register int len = 0; if(!buf) return(0); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(bun_no < 0) { UnlockMutex(&BUF_LOCK(buf)); return(0); } if(bun_no2 >= buf->bun_suu || bun_no2 < 0) bun_no2 = buf->bun_suu; for(;bun_no < bun_no2;bun_no++){ len += buf->bun[bun_no]->kanjilen; } UnlockMutex(&BUF_LOCK(buf)); return(len); } int wnn_word_use_initial_hindo = 0; static int jl_word_use_e_body(env, dic_no, entry) register struct wnn_env_int *env; int dic_no, entry; { register struct wnn_jdata *jd; if(js_word_info(env,dic_no,entry, &env_rb) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } jd = (struct wnn_jdata *)(env_rb.buf); if(jd->hindo != -1){ if(js_hindo_set(env, dic_no, entry,WNN_IMA_OFF, WNN_ENTRY_NO_USE) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } }else{ if(js_hindo_set(env, dic_no, entry, (wnn_word_use_initial_hindo & 0x80) ? WNN_IMA_ON : WNN_IMA_OFF , wnn_word_use_initial_hindo & 0x7f) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } } return(0); } int jl_word_use_e(env, dic_no, entry) register struct wnn_env *env; int dic_no, entry; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_word_use_e_body((WNN_ENV_INT *)env, dic_no, entry); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_word_use(buf, dic_no, entry) register struct wnn_buf *buf; int dic_no, entry; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_word_use_e_body((WNN_ENV_INT *)buf->env, dic_no, entry); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } void jl_env_set(buf, env) register struct wnn_env *env; register struct wnn_buf *buf; { if(!buf) return; LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; buf->env = env; UnlockMutex(&BUF_LOCK(buf)); } struct wnn_env * jl_env_get(buf) register struct wnn_buf *buf; { struct wnn_env *x; if(!buf) return(NULL); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; x = buf->env; UnlockMutex(&BUF_LOCK(buf)); return x; } static int jl_param_set_e_body(env, para) register struct wnn_env_int *env; struct wnn_param *para; { register int x; if((x = js_param_set(env, para)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } return (x); } int jl_param_set_e(env, para) register struct wnn_env *env; struct wnn_param *para; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_param_set_e_body((WNN_ENV_INT *)env, para); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_param_set(buf, para) register struct wnn_buf *buf; struct wnn_param *para; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_param_set_e_body((WNN_ENV_INT *)buf->env, para); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static int jl_set_henkan_env_e_body(env, valuemask, henv) register struct wnn_env_int *env; unsigned long valuemask; struct wnn_henkan_env *henv; { register int x; if((x = js_set_henkan_env(env, valuemask, henv)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } return (x); } int jl_set_henkan_env_e(env, valuemask, henv) register struct wnn_env *env; unsigned long valuemask; struct wnn_henkan_env *henv; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_set_henkan_env_e_body((WNN_ENV_INT *)env, valuemask, henv); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_set_henkan_env(buf, valuemask, henv) register struct wnn_buf *buf; unsigned long valuemask; struct wnn_henkan_env *henv; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_set_henkan_env_e_body((WNN_ENV_INT *)buf->env, valuemask, henv); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static int jl_set_henkan_hinsi_e_body(env, mode, nhinsi, hname) register struct wnn_env_int *env; int mode, nhinsi; char **hname; { int x, i, hsize, *hno = NULL; w_char tmp[32]; if(nhinsi) { hsize = abs(nhinsi); hno = (int *)malloc(hsize * sizeof(int)); for(i = 0; i < hsize; i++) { _Sstrcpy(tmp, hname[i]); if((hno[i] = jl_hinsi_number_e_body(env, tmp)) == -1) { free((char *)hno); return(-1); } } } if((x = js_set_henkan_hinsi(env, mode, nhinsi, hno)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); if(nhinsi) free((char *)hno); return(-1); } if(nhinsi) free((char *)hno); return (x); } int jl_set_henkan_hinsi_e(env, mode, nhinsi, hname) register struct wnn_env *env; int mode, nhinsi; char **hname; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_set_henkan_hinsi_e_body((WNN_ENV_INT *)env, mode, nhinsi, hname); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_set_henkan_hinsi(buf, mode, nhinsi, hname) register struct wnn_buf *buf; int mode, nhinsi; char **hname; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_set_henkan_hinsi_e_body((WNN_ENV_INT *)buf->env, mode, nhinsi, hname); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static int jl_param_get_e_body(env, para) struct wnn_env_int *env; struct wnn_param *para; { register int x; if((x = js_param_get(env, para)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } return (x); } int jl_param_get_e(env, para) struct wnn_env *env; struct wnn_param *para; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_param_get_e_body((WNN_ENV_INT *)env, para); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_param_get(buf, para) register struct wnn_buf *buf; struct wnn_param *para; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_param_get_e_body((WNN_ENV_INT *)buf->env, para); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } /*:::DOC_START * * Function Name: jl_get_henkan_env_e_body * Description : ¥µ¡¼¥ÐÆâ¤ÎÊÑ´¹´Ä¶­¤òÆÀ¤ë¥µ¥Ö¥ë¡¼¥Á¥ó * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * henv : (Out) ÊÑ´¹´Ä¶­¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * local : (In) ÊÑ´¹´Ä¶­¤òÆÀ¤ëÂоݥե饰 * ¡Ê0 == jserver, else client¡Ë * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int jl_get_henkan_env_e_body(env, henv, local) struct wnn_env_int *env; struct wnn_henkan_env *henv; int local; { register int x; if ((local && ((x = js_get_henkan_env_local(env, henv)) == -1)) || (!local && ((x = js_get_henkan_env(env, henv)) == -1))) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } return (x); } /*:::DOC_START * * Function Name: jl_get_henkan_env_e * Description : ¥µ¡¼¥ÐÆâ¤ÎÊÑ´¹´Ä¶­¤òÆÀ¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * henv : (Out) ÊÑ´¹´Ä¶­¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_get_henkan_env_e(env, henv) struct wnn_env *env; struct wnn_henkan_env *henv; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_get_henkan_env_e_body((WNN_ENV_INT *)env, henv, 0); UnlockMutex(&ENV_LOCK(env)); return x; } /* End of jl_get_henkan_env_e */ /*:::DOC_START * * Function Name: jl_get_henkan_env * Description : ¥µ¡¼¥ÐÆâ¤ÎÊÑ´¹´Ä¶­¤òÆÀ¤ë * Parameter : * buf : (In) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * henv : (Out) ÊÑ´¹´Ä¶­¼õ¤±¼è¤êÍѹ½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_get_henkan_env(buf, henv) register struct wnn_buf *buf; struct wnn_henkan_env *henv; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_get_henkan_env_e_body((WNN_ENV_INT *)buf->env, henv, 0); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } /* End of jl_get_henkan_env */ /*:::DOC_START * * Function Name: jl_get_henkan_env_local_e * Description : ÊÑ´¹´Ä¶­¤ÎÆâ¡¤¥é¥¤¥Ö¥é¥ê¤Ë¤¢¤ë¤â¤Î¤ò¼è¤ë * ¶çÆÉÅÀ¡¤³ç¸Ì¡¤µ­¹æ * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * henv : (Out) ÊÑ´¹´Ä¶­¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS,-1==ERROR * * Author : Seiji KUWARI * * Revision history: * *:::DOC_END */ int jl_get_henkan_env_local_e(env, henv) struct wnn_env *env; struct wnn_henkan_env *henv; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_get_henkan_env_e_body((WNN_ENV_INT *)env, henv, 1); UnlockMutex(&ENV_LOCK(env)); return x; } /*:::DOC_START * * Function Name: jl_get_henkan_env_local * Description : ÊÑ´¹´Ä¶­¤ÎÆâ¡¤¥é¥¤¥Ö¥é¥ê¤Ë¤¢¤ë¤â¤Î¤ò¼è¤ë * ¶çÆÉÅÀ¡¤³ç¸Ì¡¤µ­¹æ * Parameter : * buf : (In) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * henv : (Out) ÊÑ´¹´Ä¶­¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿ * * Return value : 0==SUCCESS,-1==ERROR * * Author : Seiji KUWARI * * Revision history: * *:::DOC_END */ int jl_get_henkan_env_local(buf, henv) register struct wnn_buf *buf; struct wnn_henkan_env *henv; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_get_henkan_env_e_body((WNN_ENV_INT *)buf->env, henv, 1); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } /*:::DOC_START * * Function Name: jl_get_henkan_hinsi_e_body * Description : ÊÑ´¹¤Ë¡Ê»ÈÍÑ¡¿ÉÔ»ÈÍѡˤ¹¤ëÉʻ췲¤òÆÀ¤ë¥µ¥Ö¥ë¡¼¥Á¥ó * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * nhinsi : (Out) ÀßÄêÉÊ»ì¿ô¡ÊÉé == ÉÔ»ÈÍÑ, Àµ »ÈÍÑ¡Ë * hlist : (Out) ÀßÄêÉÊ»ì¥ê¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ static int jl_get_henkan_hinsi_e_body(env, nhinsi, hlist) struct wnn_env_int *env; int *nhinsi, **hlist; { register int x; if((x = js_get_henkan_hinsi(env, nhinsi, hlist)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } return (x); } /* End of jl_get_henkan_hinsi_e_body */ /*:::DOC_START * * Function Name: jl_get_henkan_hinsi_e * Description : ÊÑ´¹¤Ë¡Ê»ÈÍÑ¡¿ÉÔ»ÈÍѡˤ¹¤ëÉʻ췲¤òÆÀ¤ë * Parameter : * env : (In) ´Ä¶­¤Ø¤Î¥Ý¥¤¥ó¥¿ * nhinsi : (Out) ÀßÄêÉÊ»ì¿ô¡ÊÉé == ÉÔ»ÈÍÑ, Àµ »ÈÍÑ¡Ë * hlist : (Out) ÀßÄêÉÊ»ì¥ê¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_get_henkan_hinsi_e(env, nhinsi, hlist) struct wnn_env *env; int *nhinsi, **hlist; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_get_henkan_hinsi_e_body((WNN_ENV_INT *)env, nhinsi, hlist); UnlockMutex(&ENV_LOCK(env)); return x; } /* End of jl_get_henkan_hinsi_e */ /*:::DOC_START * * Function Name: jl_get_henkan_hinsi * Description : ÊÑ´¹¤Ë¡Ê»ÈÍÑ¡¿ÉÔ»ÈÍѡˤ¹¤ëÉʻ췲¤òÆÀ¤ë * Parameter : * env : (In) ¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ * nhinsi : (Out) ÀßÄêÉÊ»ì¿ô¡ÊÉé == ÉÔ»ÈÍÑ, Àµ »ÈÍÑ¡Ë * hlist : (Out) ÀßÄêÉÊ»ì¥ê¥¹¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ * * Return value : 0==SUCCESS, -1==ERROR * * Author : Hideyuki Kishiba * * Revision history: * *:::DOC_END */ int jl_get_henkan_hinsi(buf, nhinsi, hlist) register struct wnn_buf *buf; int *nhinsi, **hlist; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_get_henkan_hinsi_e_body((WNN_ENV_INT *)buf->env, nhinsi, hlist); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } /* End of jl_get_henkan_hinsi */ static int jl_dic_use_e_body(env, dic_no, flag) struct wnn_env_int *env; int dic_no,flag; { register int x; if((x = js_dic_use(env, dic_no, flag)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } return (x); } int jl_dic_use_e(env, dic_no, flag) struct wnn_env *env; int dic_no,flag; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_dic_use_e_body((WNN_ENV_INT *)env, dic_no, flag); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_dic_use(buf, dic_no, flag) register struct wnn_buf *buf; int dic_no,flag; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_dic_use_e_body((WNN_ENV_INT *)buf->env, dic_no, flag); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static int jl_word_add_e_body(env, dic_no, yomi, kanji, comment, hinsi, init_hindo) struct wnn_env_int *env; int dic_no; w_char *yomi,*kanji,*comment; int hinsi,init_hindo; { register int x; if((x = js_word_add(env, dic_no, yomi, kanji, comment, hinsi, init_hindo)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } return (x); } int jl_word_add_e(env, dic_no, yomi, kanji, comment, hinsi, init_hindo) struct wnn_env *env; int dic_no; w_char *yomi,*kanji,*comment; int hinsi,init_hindo; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_word_add_e_body((WNN_ENV_INT *)env, dic_no, yomi, kanji, comment, hinsi, init_hindo); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_word_add(buf, dic_no, yomi, kanji, comment, hinsi, init_hindo) register struct wnn_buf *buf; int dic_no; w_char *yomi,*kanji,*comment; int hinsi,init_hindo; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_word_add_e_body((WNN_ENV_INT *)buf->env, dic_no, yomi, kanji, comment, hinsi, init_hindo); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static int jl_word_delete_e_body(env, dic_no, entry) struct wnn_env_int *env; int dic_no; int entry; { register int x; if((x = js_word_delete(env, dic_no, entry)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } return (x); } int jl_word_delete_e(env, dic_no, entry) struct wnn_env *env; int dic_no; int entry; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_word_delete_e_body((WNN_ENV_INT *)env, dic_no, entry); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_word_delete(buf, dic_no, entry) register struct wnn_buf *buf; int dic_no; int entry; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_word_delete_e_body((WNN_ENV_INT *)buf->env, dic_no, entry); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static int file_read(env, fname) struct wnn_env_int *env; char *fname; { register int fid; if(fname[0] == C_LOCAL){ fid = js_file_send(env, fname + 1); }else{ fid = js_file_read(env, fname); } if(fid >= 0){ add_file_to_env(env, fid, fname); } return(fid); } static int file_remove(server, fname, pwd) register WNN_JSERVER_ID *server; char *fname; char *pwd; { if(fname[0] == C_LOCAL){ return(js_file_remove_client(server, fname + 1, pwd)); }else{ return(js_file_remove(server, fname, pwd)); } } static int file_discard(env, fid) register struct wnn_env_int *env; register int fid; { delete_file_from_env(env, fid); return(js_file_discard(env, fid)); } static int jl_hinsi_number_e_body(env, name) register struct wnn_env_int *env; w_char *name; { register int x; if((x = js_hinsi_number(env->orig.js_id, name)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } return (x); } int jl_hinsi_number_e(env, name) register struct wnn_env *env; w_char *name; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_hinsi_number_e_body((WNN_ENV_INT *)env, name); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_hinsi_number(buf, name) register struct wnn_buf *buf; w_char *name; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_hinsi_number_e_body((WNN_ENV_INT *)buf->env, name); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static w_char *jl_hinsi_name_e_body(env, no) register struct wnn_env_int *env; register int no; { w_char *x; if(js_hinsi_name(env->orig.js_id, no, &env_rb) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(NULL); } x = (w_char *)(env_rb.buf); return x; } w_char *jl_hinsi_name_e(env, no) register struct wnn_env *env; register int no; { w_char *x; if(!env) return(NULL); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_hinsi_name_e_body((WNN_ENV_INT *)env, no); UnlockMutex(&ENV_LOCK(env)); return x; } w_char * jl_hinsi_name(buf, no) register struct wnn_buf *buf; register int no; { w_char *x; if(!buf || !(buf->env)) return(NULL); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_hinsi_name_e_body((WNN_ENV_INT *)buf->env, no); if(x == NULL) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static int jl_hinsi_list_e_body(env, dic_no, name, area) register struct wnn_env_int *env; int dic_no; w_char *name; w_char ***area; { int x; if((x = js_hinsi_list(env, dic_no, name, &env_rb)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } *area = (w_char **)(env_rb.buf); return(x); } int jl_hinsi_list_e(env, dic_no, name, area) register struct wnn_env *env; int dic_no; w_char *name; w_char ***area; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_hinsi_list_e_body((WNN_ENV_INT *)env, dic_no, name, area); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_hinsi_list(buf, dic_no, name, area) register struct wnn_buf *buf; int dic_no; w_char *name; w_char ***area; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_hinsi_list_e_body((WNN_ENV_INT *)buf->env, dic_no, name, area); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static int jl_hinsi_dicts_e_body(env, no, area) register struct wnn_env_int *env; int no; int **area; { int x; if((x = js_hinsi_dicts(env, no, &env_rb)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } *area = (int *)(env_rb.buf); return(x); } int jl_hinsi_dicts_e(env, no, area) register struct wnn_env *env; int no; int **area; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_hinsi_dicts_e_body((WNN_ENV_INT *)env, no, area); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_hinsi_dicts(buf, no, area) register struct wnn_buf *buf; int no; int **area; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_hinsi_dicts_e_body((WNN_ENV_INT *)buf->env, no, area); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static int jl_word_comment_set_e_body(env, dic_no, entry, comment) register struct wnn_env_int *env; int dic_no,entry; w_char *comment; { register int x; if((x = js_word_comment_set(env, dic_no, entry, comment)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } return (x); } int jl_word_comment_set_e(env, dic_no, entry, comment) register struct wnn_env *env; int dic_no,entry; w_char *comment; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_word_comment_set_e_body((WNN_ENV_INT *)env, dic_no, entry, comment); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_word_comment_set(buf, dic_no, entry, comment) register struct wnn_buf *buf; int dic_no,entry; w_char *comment; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_word_comment_set_e_body((WNN_ENV_INT *)buf->env, dic_no, entry, comment); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } static int jl_dic_comment_set_e_body(env, dic_no, comment) register struct wnn_env_int *env; int dic_no; w_char *comment; { register int x; WNN_DIC_INFO dic; WNN_FILE_INFO_STRUCT file; if(js_dic_info(env,dic_no,&dic) < 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } /* dic Body */ if (js_file_info(env,dic.body,&file) < 0) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } if((x = js_file_comment_set(env, file.fid, comment)) == -1) { env_wnn_errorno_copy(env); if_dead_disconnect(env); return(-1); } return (x); } int jl_dic_comment_set_e(env, dic_no, comment) register struct wnn_env *env; int dic_no; w_char *comment; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; x = jl_dic_comment_set_e_body((WNN_ENV_INT *)env, dic_no, comment); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_dic_comment_set(buf, dic_no, comment) register struct wnn_buf *buf; int dic_no; w_char *comment; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_dic_comment_set_e_body((WNN_ENV_INT *)buf->env, dic_no, comment); if(x == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_bun_suu(buf) register struct wnn_buf *buf; { int x; if(!buf) return(0); LockMutex(&BUF_LOCK(buf)); x = buf->bun_suu; UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_zenkouho_suu(buf) register struct wnn_buf *buf; { int x; if(!buf) return(0); LockMutex(&BUF_LOCK(buf)); if(buf->zenkouho_daip) x = buf->zenkouho_dai_suu; else x = buf->zenkouho_suu; UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_zenkouho_bun(buf) register struct wnn_buf *buf; { int x; if(!buf) return(0); LockMutex(&BUF_LOCK(buf)); x = buf->zenkouho_bun; UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_c_zenkouho(buf) register struct wnn_buf *buf; { int x; if(!buf) return(0); LockMutex(&BUF_LOCK(buf)); x = buf->c_zenkouho; UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_zenkouho_daip(buf) register struct wnn_buf *buf; { int x; if(!buf) return(0); LockMutex(&BUF_LOCK(buf)); x = buf->zenkouho_daip; UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_dai_top(buf, k) register struct wnn_buf *buf; int k; { int x; if(!buf) return(0); LockMutex(&BUF_LOCK(buf)); x = buf->bun[k]->dai_top; UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_jiri_len(buf, k) register struct wnn_buf *buf; int k; { int x; if(!buf) return(0); LockMutex(&BUF_LOCK(buf)); x = buf->bun[k]->jirilen; UnlockMutex(&BUF_LOCK(buf)); return x; } struct wnn_env * jl_env(buf) register struct wnn_buf *buf; { struct wnn_env *x; if(!buf) return(NULL); LockMutex(&BUF_LOCK(buf)); x = buf->env; UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_get_wnn_errorno_env(env) register struct wnn_env *env; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); x = env_wnn_errorno_eql; UnlockMutex(&ENV_LOCK(env)); return x; } int jl_get_wnn_errorno_buf(buf) register struct wnn_buf *buf; { int x; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); x = buf_wnn_errorno_eql; UnlockMutex(&BUF_LOCK(buf)); return x; } struct wnn_jdata * jl_inspect(buf, bun_no) register struct wnn_buf *buf; int bun_no; { struct wnn_jdata *x; if(!buf || !(buf->env)) return(NULL); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = jl_word_info_e_body((WNN_ENV_INT *)buf->env, buf->bun[bun_no]->dic_no, buf->bun[bun_no]->entry); if(x == NULL) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_env_sticky_e(env) register struct wnn_env *env; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); env_wnn_errorno_set = 0; if((x = js_env_sticky(env)) == -1) env_wnn_errorno_copy((WNN_ENV_INT *)env); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_env_sticky(buf) register struct wnn_buf *buf; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; if((x = jl_env_sticky_e((WNN_ENV_INT *)buf->env)) == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } int jl_env_un_sticky_e(env) register struct wnn_env *env; { int x; if(!env) return(-1); LockMutex(&ENV_LOCK(env)); if((x = js_env_un_sticky(env)) == -1) env_wnn_errorno_copy((WNN_ENV_INT *)env); UnlockMutex(&ENV_LOCK(env)); return x; } int jl_env_un_sticky(buf) register struct wnn_buf *buf; { int x; if(!buf || !(buf->env)) return(-1); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; if((x = jl_env_un_sticky_e((WNN_ENV_INT *)buf->env)) == -1) buf_wnn_errorno_copy((WNN_BUF_MT *)buf); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } char * jl_get_lang(buf) register struct wnn_buf *buf; { char *x; if(!buf || !(buf->env)) return(NULL); LockMutex(&BUF_LOCK(buf)); LockMutex(&(envmt->env_lock)); buf_wnn_errorno_set = 0; x = js_get_lang((WNN_ENV_INT *)buf->env); UnlockMutex(&(envmt->env_lock)); UnlockMutex(&BUF_LOCK(buf)); return x; } /* ¥Ñ¥é¥á¡¼¥¿¥ª¡¼¥È¥Á¥å¡¼¥Ë¥ó¥° */ typedef struct _InfoShoRec { int hindo; int ima; int jirilength; int bunlength; int dictnice; int hyoka; int daihyoka; int dai_top; w_char *yomi; int serial; int kangovect; struct _InfoShoRec *next; } InfoShoRec; typedef struct _InfoDaiRec { int n; int hindo; int ima; int jirilength; int sholength; int dictnice; int dailength; struct _InfoDaiRec *next; } InfoDaiRec; typedef InfoDaiRec InfoTotalRec; typedef struct _WnnAutoTune { InfoDaiRec *s_dai_info; InfoDaiRec *e_dai_info; InfoShoRec *s_sho_info; InfoShoRec *e_sho_info; InfoTotalRec *s_total_info; InfoTotalRec *e_total_info; struct wnn_param new_param; struct wnn_param get_param; } WnnAutoTune; static int Giji_Hinsi_Check(info) InfoShoRec *info; { InfoShoRec *p = info; for (; p; p = p->next) { if ((p->serial == -11) || (p->serial == -1)) { return(0); } } return(1); } static int Chval(h, o) int h, o; { if (h > o) return(-1); if (h == o) return(0); return(1); } static int Sho_Info(buf, bun_no, info) struct wnn_buf *buf; int bun_no; InfoShoRec *info; { WNN_BUN *data = NULL; WNN_DIC_INFO dic; w_char *yomi; if (!buf || !buf->bun || !(data = buf->bun[bun_no])) return(-1); if (js_dic_info(buf->env, data->dic_no, &dic) < 0) return(-1); if (!(yomi = (w_char *)malloc(sizeof(w_char) * (data->yomilen + 1)))) return(-1); wnn_Strncpy(yomi, data->yomi, data->yomilen); yomi[data->yomilen] = (w_char)0; info->yomi = yomi; info->serial = data->entry; info->hindo = data->hindo; info->dictnice = dic.nice; info->ima = data->ima; info->hyoka = data->hyoka; info->daihyoka = data->daihyoka; info->kangovect = data->kangovect; info->dai_top = data->dai_top; info->jirilength = data->jirilen; info->bunlength = data->kanjilen; return(0); } static InfoShoRec * Atume(buf) register struct wnn_buf *buf; { int max = jl_bun_suu(buf); int i; InfoShoRec *info, *prev; if (max <= 0) return(NULL); if (!(info = (InfoShoRec *)malloc(sizeof(InfoShoRec) * max))) return(NULL); bzero((char *)info, sizeof(InfoShoRec) * max); for (i = 0; i < max; i++) { if (Sho_Info(buf, i, &info[i]) < 0) { free((char *)info); return(NULL); } info[i].next = NULL; if (i > 0) prev->next = &info[i]; prev = &info[i]; } return(info); } static InfoTotalRec * Total(p) InfoDaiRec *p; { int nn; InfoTotalRec *info; if (!p) return(NULL); if (!(info = (InfoTotalRec *)malloc(sizeof(InfoTotalRec)))) return(NULL); bzero((char *)info, sizeof(InfoTotalRec)); for (; p; p = p->next) { nn = p->n; info->n += nn; info->hindo += p->hindo/nn; info->ima += p->ima/nn; info->jirilength += p->jirilength/nn; info->sholength += p->sholength/nn; info->dictnice += p->dictnice/nn; info->dailength += p->dailength; } return(info); } static InfoDaiRec * Dai_Info(sho_p) InfoShoRec *sho_p; { int cnt, i; InfoShoRec *p = sho_p; InfoDaiRec *d, *info, *prev; for (cnt = 0; p; p = p->next) { if (p->dai_top) cnt++; } if (cnt <= 0) return(NULL); if (!(info = (InfoDaiRec *)malloc(sizeof(InfoDaiRec) * cnt))) return(NULL); bzero((char *)info, sizeof(InfoDaiRec) * cnt); d = &info[0]; for (i = 0, p = sho_p; p; p = p->next) { if (p->dai_top) { d = &info[i]; if (i > 0) prev->next = d; prev = d; i++; } d->n++; d->hindo += p->hindo; d->ima += p->ima; d->jirilength += p->jirilength; d->sholength += p->bunlength; d->dictnice += p->dictnice; d->dailength = d->sholength; } return(info); } static int wnn_set_area_body(buf, bun_no, area, kanjip) struct wnn_buf_mt *buf; register int bun_no; w_char *area; int kanjip; { register WNN_BUN *wb, *wb1; w_char *c, *end, *area1 = area; int len; if ((kanjip != WNN_KANJI ) || (bun_no < 0) || !(wb = buf->orig.bun[bun_no])) { return(0); } for(wb1 = wb; ;){ if(wb1 != wb) c = (w_char *)wb1; else c = wb1->yomi; end = (w_char *)&wb1->next; for(;c < end;){ if(!kanjip){ if((*c++ = *area++) == 0){ area--; goto out;} }else{ if(*c++ == 0) kanjip--; } } if (!*end) { wb1->next = get_new_bun(buf); } wb1 = wb1->next; } out: wb1->next = NULL; /* 95/6/13 waya */ len = area - area1; wb->kanjilen = wb->real_kanjilen = len; wb->jirilen = wb->yomilen; return 0; } int wnn_set_area(buf, bun_no, area, kanjip) struct wnn_buf *buf; register int bun_no; w_char *area; int kanjip; { int x; if(!buf) return(0); LockMutex(&BUF_LOCK(buf)); x = wnn_set_area_body((WNN_BUF_MT *)buf, bun_no, area, kanjip); UnlockMutex(&BUF_LOCK(buf)); return x; } /* --------------- for ikeiji ---------- */ extern int js_ikeiji_with_data(); int jl_zenikeiji_dai_with_hinsi_name(); /*:::DOC_START * * Function Name: jl_zenikeiji_dai * Description : * do ikeiji-henkan with some conditions * * Parameter : * buf : (InOut) kanji buffer * bun_no : (In) staring bun no. * bun_no2 : (In) ending bun no. (exclusive) * use_maep : (In) connective info. * uniq_level : (In) unique level * * Return value : no. of dai-bunsetsu * * Author : fujimori * * Revision history: * 20-Dec-94: initial release * *:::DOC_END */ int jl_zenikeiji_dai(buf, bun_no, bun_no2, use_maep, uniq_level) register struct wnn_buf *buf; int bun_no, bun_no2, use_maep, uniq_level; { int nhinsi = 1; char hname[32]; char * p_hname = &hname[0]; int x; strcpy(hname, "°Û·Á»ú"); x = jl_zenikeiji_dai_with_hinsi_name(buf, bun_no, bun_no2, use_maep, uniq_level, nhinsi, &p_hname ); return x; } /*:::DOC_START * * Function Name: zen_conv_dai_ikeiji1 * Description : * do ikeiji-henkan with some conditions * * Parameter : * buf : (InOut) kanji buffer * bun_no : (In) staring bun no. * bun_no2 : (In) ending bun no. (exclusive) * use_maep : (In) connective info. * uniq_level : (In) unique level * fuku : (In) fukugou-go * nhinsi : (In) no. of hinsi * hlist : (In) hinsi-list * * Return value : no. of dai-bunsetsu * * Author : fujimori * * Revision history: * 20-Dec-94: initial release * *:::DOC_END */ static int zen_conv_dai_ikeiji1(buf, bun_no, bun_no2, use_maep, uniq_level, fuku, nhinsi, hlist) register struct wnn_buf *buf; int bun_no, bun_no2, use_maep, uniq_level, fuku, nhinsi, *hlist; { register struct wnn_buf_mt *buf_m = (WNN_BUF_MT *)buf; int cnt; w_char yomi[LENGTHBUNSETSU], yomi1[LENGTHBUNSETSU]; struct wnn_dai_bunsetsu *dp; int tmp; register int k; int x; int nobi_top; w_char yomi_orig[LENGTHBUNSETSU]; if(bun_no2 > (tmp = dai_end(buf_m, bun_no)) || bun_no2 < 0) bun_no2 = tmp; jl_get_kanji_body(buf_m, bun_no, bun_no2, yomi); jl_get_yomi_body(buf_m, bun_no, bun_no2, yomi_orig); if(bun_no == buf->zenkouho_bun && buf->zenkouho_daip == IKEIJI){ x = buf->c_zenkouho; return x; } if (use_maep & WNN_USE_MAE && bun_no > 0) { dumbhinsi = buf->bun[bun_no - 1]->hinsi; jl_get_yomi_body(buf_m, bun_no - 1, bun_no, yomi1); mae_fzk = yomi1 + buf->bun[bun_no - 1]->jirilen; } else { dumbhinsi = WNN_BUN_SENTOU; mae_fzk = (w_char *)0; } if(use_maep & WNN_USE_ATO && bun_no2 < buf->bun_suu){ syuutanv = buf->bun[bun_no2]->kangovect; syuutanv1 = WNN_VECT_KANZEN; buf->zenkouho_endvect = syuutanv; }else{ syuutanv = WNN_VECT_KANZEN; syuutanv1 = WNN_VECT_NO; if(bun_no2 < buf->bun_suu){ buf->bun[bun_no2]->dai_top = 1; } buf->zenkouho_endvect = -1; } if(!(buf->env)) return(-1); LockMutex(&(envmt->env_lock)); if(fuku == 0 && nhinsi == 0) { /* ?? error for this henkan */ #if 0 if(buf->bun[bun_no]->fukugou == 0 && buf->bun[bun_no]->num_hinsi == 0) { if((cnt = js_kanzen_dai(buf->env, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, &buf_rb)) < 0){ buf_wnn_errorno_copy(buf_m); if_dead_disconnect_b(buf_m); UnlockMutex(&(envmt->env_lock)); return(-1); } } else { if((cnt = js_ikeiji_with_data(buf->env, buf->bun[bun_no]->fukugou, buf->bun[bun_no]->num_hinsi, buf->bun[bun_no]->hinsi_list, WNN_IKEIJI_DAI, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, WNN_VECT_BUNSETSU, /* need fugokugo-len, hinsi, etc */ buf->bun[bun_no], yomi_orig, &buf_rb)) < 0) { buf_wnn_errorno_copy(buf_m); if_dead_disconnect_b(buf_m); UnlockMutex(&(envmt->env_lock)); return(-1); } } #else /* ?? need set buf_wnn_errorno_copy(buf_m); */ if_dead_disconnect_b(buf_m); UnlockMutex(&(envmt->env_lock)); return(-1); #endif /* 0 */ } else { if((cnt = js_ikeiji_with_data(buf->env, fuku, nhinsi, hlist, WNN_IKEIJI_DAI, yomi, dumbhinsi, mae_fzk, syuutanv, syuutanv1, WNN_VECT_BUNSETSU, /* need fugokugo-len, hinsi, etc */ buf->bun[bun_no], yomi_orig, &buf_rb)) < 0) { buf_wnn_errorno_copy(buf_m); if_dead_disconnect_b(buf_m); UnlockMutex(&(envmt->env_lock)); return(-1); } } dp = (struct wnn_dai_bunsetsu *)buf_rb.buf; free_zenkouho(buf_m); /* Wander if it is OK, that is, only when all the * zenkouho's are got from zenkouho_dai, we need not move * the current dai-bunsetsu to the top of zenkouho's */ for(k = bun_no; k < bun_no2; k++){ if(buf->bun[k]->from_zenkouho != ZENKOUHO_IKEIJI_DAI)break; } nobi_top = buf->bun[k]->nobi_top; if(k != bun_no2){ /* move the current to the top. */ make_space_for(buf_m, ZENKOUHO, buf->zenkouho_suu, buf->zenkouho_suu, bun_no2 - bun_no); set_dai(&buf->bun[bun_no], &buf->zenkouho[0], bun_no2 - bun_no); buf->zenkouho_dai[0] = 0; buf->zenkouho_dai[1] = bun_no2 - bun_no; buf->zenkouho_dai_suu = 1; buf->zenkouho_suu = bun_no2 - bun_no; k = get_c_jikouho_dai(dp, cnt, buf->bun, bun_no); if(k >= 0){ buf->zenkouho[0]->dai_top = (dp[k].sbn->status == WNN_CONNECT)? 0:1; buf->zenkouho[bun_no2-bun_no-1]->dai_end = (dp[k].sbn[dp[k].sbncnt-1].status_bkwd == WNN_CONNECT_BK)? 0:1; /* KURI *//* USO*?*/ } else if (cnt == 0) { /* ¡Ö¡¦¡×¤Ï¸õÊä¿ô¤¬ 0 ¤Ê¤Î¤Ç¡¢dai_top, dai_end ¤ò ¶¯À©Åª¤Ë 1 ¤Ë¤¹¤ë */ buf->zenkouho[0]->dai_top = 1; buf->zenkouho[bun_no2-bun_no-1]->dai_end = 1; } if(uniq_level || k < 0){ insert_dai_or_ikeiji(buf_m, ZENKOUHO, -1, -1, dp, cnt, uniq_level, 0, 0, NULL, IKEIJI); }else{ insert_dai_or_ikeiji(buf_m, ZENKOUHO, -1, -1, dp, k, uniq_level, 0, 0, NULL, IKEIJI); insert_dai_or_ikeiji(buf_m, ZENKOUHO, -1, -1, dp + k + 1, cnt - k - 1, uniq_level, 0, 0, NULL, IKEIJI); } buf->c_zenkouho = 0; }else{ insert_dai_or_ikeiji(buf_m, ZENKOUHO, -1, -1, dp, cnt, uniq_level, 0, 0, NULL, IKEIJI); k = get_c_jikouho_from_zenkouho_dai(buf_m, buf->bun[bun_no]); if(k < 0){ k = 0; /* Only when the kouho has been removed from dict. */ } buf->c_zenkouho = k; } buf->zenkouho_bun = bun_no; buf->zenkouho_end_bun = bun_no2; buf->zenkouho_daip = IKEIJI; for(k = 0 ; k < buf->zenkouho_suu; k++){ if(buf->zenkouho[k]->ima && buf->zenkouho[k]->dic_no != -1){ add_down_bnst(buf_m, bun_no, buf->zenkouho[k]); } /* * ʸÀá¿­¤Ð¤·/½Ì¤á¤ò¹Ô¤Ã¤¿¸å¼¡¸õÊä¤ò¼è¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¼¡¸õÊä¤ÎʸÀá¾ðÊó * ¤Ë¤âʸÀá¿­¤Ð¤·/½Ì¤á¤Î¾ðÊó¤ò¤Ä¤±¤Æ¤ª¤¯¡£Ê¸ÀáÀÚ¤ê³Ø½¬¤Ç»ÈÍѤ¹¤ë¡£ */ if (nobi_top) buf->zenkouho[k]->nobi_top = 1; } x = buf->c_zenkouho; UnlockMutex(&(envmt->env_lock)); return x; } /*:::DOC_START * * Function Name: jl_zenikeiji_dai_with_hinsi_name * Description : * do ikeiji-henkan with some conditions * * Parameter : * buf : (InOut) kanji buffer * bun_no : (In) staring bun no. * bun_no2 : (In) ending bun no. (exclusive) * use_maep : (In) connective info. * uniq_level : (In) unique level * nhinsi : (In) no. of hinsi-name * hname : (In) hinsi name-list * * Return value : no. of dai-bunsetsu * * Author : fujimori * * Revision history: * 20-Dec-94: initial release * *:::DOC_END */ int jl_zenikeiji_dai_with_hinsi_name(buf, bun_no, bun_no2, use_maep, uniq_level, nhinsi, hname) register struct wnn_buf *buf; int bun_no, bun_no2, use_maep, uniq_level, nhinsi; char **hname; { int x, i, hsize, *hno = NULL; w_char tmp[64]; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; /* if(strncmp(js_get_lang(buf->env), WNN_J_LANG, 5) || nhinsi == 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } */ if(nhinsi){ hsize = abs(nhinsi); hno = (int *)malloc(hsize * sizeof(int)); for(i = 0; i < hsize; i++) { _Sstrcpy(tmp, hname[i]); if((hno[i] = jl_hinsi_number_e(buf->env, tmp)) == -1) { free((char *)hno); UnlockMutex(&BUF_LOCK(buf)); return(-1); } } } x = zen_conv_dai_ikeiji1(buf, bun_no, bun_no2, use_maep, uniq_level, 0, nhinsi, hno); if(nhinsi) free((char *)hno); UnlockMutex(&BUF_LOCK(buf)); return x; } /* end of jl_zenikeiji_dai_with_hinsi_name */ /*:::DOC_START * * Function Name: insert_dai_or_ikeiji * Description : * insert dai-bunsetsu in to kanji-buffer * * Parameter : * buf : (InOut) kanji buffer * zenp : (In) zen-kouho type. * bun_no : (In) staring bun no. * bun_no2 : (In) ending bun no. (exclusive) * dp : (In) dai-bunsetsu * dcnt : (In) no. of dai-bunsetsu * uniq_level : (In) unique level * fuku : (In) fukugou-go * nhinsi : (In) no. of hinsi * hlist : (In) hinsi list * daip : (In) henkan type * * Return value : no. of dai-bunsetsu * * Author : fujimori * * Revision history: * 20-Dec-94: initial release * *:::DOC_END */ /* from insert_dai */ /* for zenkouho, assume bun_no = bun_no2 = zenkouho_suu */ static int insert_dai_or_ikeiji(buf, zenp, bun_no, bun_no2, dp, dcnt, uniq_level, fuku, nhinsi, hlist, daip) struct wnn_buf_mt *buf; int bun_no, bun_no2; struct wnn_dai_bunsetsu *dp; int dcnt; int zenp; int uniq_level; int fuku, nhinsi, *hlist; int daip; { register WNN_BUN **b, **b0; register int k, l, m; register int cnt = 0; struct wnn_sho_bunsetsu *sp, *sp1; if(bun_no == -1){ bun_no = bun_no2 = (zenp == BUN)? buf->orig.bun_suu: buf->orig.zenkouho_suu; } for(k = 0; k < dcnt ; k++){ cnt += dp[k].sbncnt; } make_space_for(buf, zenp, bun_no, bun_no2, cnt); /* zenkouho_dai_suu must not be initialized */ b = ((zenp == BUN)? buf->orig.bun: buf->orig.zenkouho) + bun_no; for(k = 0, m = buf->orig.zenkouho_dai_suu ; k < dcnt; k++){ /* °Û·Á»úÊÑ´¹¤ÎºÝ¤Ï¡¢find_same_kouho_dai() ¤ò¤·¤Æ¡¢ ¼¡¸õÊä¥ê¥¹¥È¤Î¥À¥Ö¥ê¤òËɤ° */ if(uniq_level){ if(find_same_kouho_dai(&dp[k], buf, m, uniq_level)) continue; } sp = dp[k].sbn; if(zenp == ZENKOUHO){ buf->orig.zenkouho_dai[m++] = b - buf->orig.zenkouho; } b0 = b; sp1 = sp; for(l = 0 ; l < dp[k].sbncnt; l++){ *b = get_sho(buf, sp, zenp, daip, fuku, nhinsi, hlist); if(zenp == ZENKOUHO){ if (l == dp[k].sbncnt -1){ if(buf->orig.zenkouho_endvect != -1){ (*b)->dai_end = (sp->status_bkwd == WNN_CONNECT_BK)? 0:1; }else{ (*b)->dai_end = 0; } }else{ (*b)->dai_end = 0; } } b++; sp++; } (*b0)->dai_top = (sp1->status == WNN_CONNECT)? 0:1; (*b0)->daihyoka = dp[k].hyoka; } if(zenp == ZENKOUHO){ buf->orig.zenkouho_dai[m] = b - buf->orig.zenkouho; buf->orig.zenkouho_suu = b - buf->orig.zenkouho; buf->orig.zenkouho_dai_suu = m; } return(cnt + bun_no); } /*:::DOC_START * * Function Name: jl_set_ikeiji_dai * Description : * set current kouho * * Parameter : * buf : (InOut) kanji buffer * offset : (In) target bun no. * * Return value : current bun no. * * Author : fujimori * * Revision history: * 20-Dec-94: initial release * *:::DOC_END */ /* ?? need, identical jl_set_jikouho_dai */ int jl_set_ikeiji_dai(buf, offset) register struct wnn_buf *buf; int offset; { register int st, end, bun, k; if(!buf) return(-1); LockMutex(&BUF_LOCK(buf)); buf_wnn_errorno_set = 0; if(buf->zenkouho_suu <= 0) { UnlockMutex(&BUF_LOCK(buf)); return(-1); } if(buf->zenkouho_daip == SHO){ UnlockMutex(&BUF_LOCK(buf)); return(-1); } offset = (offset + buf->zenkouho_dai_suu) % buf->zenkouho_dai_suu; if(buf->zenkouho_end_bun < buf->bun_suu && buf->zenkouho_endvect != -1) buf->bun[buf->zenkouho_end_bun]->dai_top = buf->zenkouho[buf->zenkouho_dai[offset+1]-1]->dai_end; free_bun((WNN_BUF_MT *)buf, buf->zenkouho_bun, buf->zenkouho_end_bun); st = buf->zenkouho_dai[offset]; end = buf->zenkouho_dai[offset + 1]; make_space_for((WNN_BUF_MT *)buf, BUN, buf->zenkouho_bun, buf->zenkouho_end_bun, end - st); for(bun = buf->zenkouho_bun, k = st; k < end;){ set_sho(buf->zenkouho[k++], &buf->bun[bun++]); } buf->zenkouho_end_bun = buf->zenkouho_bun + end - st; buf->c_zenkouho = offset; UnlockMutex(&BUF_LOCK(buf)); return(offset); } wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/Imakefile0000644000000000000000000000112407153676737017063 0ustar rootrootXCOMM XCOMM $Id: Imakefile,v 2.16 1999/02/17 08:15:52 kaneda Exp $ XCOMM #define IHaveSubdirs #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' WNNOWNER= wnn #if BuildJlib JLIBDIR = romkan jlib SUBDIRS = $(JLIBDIR) #endif MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) install:: mkwnndir MakeDirectory(mkwnndir, $(DESTDIR)$(WNNWNNDIR)) MakeDirectory(mkwnndir, $(DESTDIR)$(JWNNWNNDIR)) checkwnnid:: @A=`egrep "^$(WNNOWNER):" /etc/passwd | cat` ;\ if [ -z "$$A" ] ;\ then \ echo "!! Stop install" ;\ echo "!! Please make an entry of 'wnn' id in /etc/passwd" ;\ exit 1 ;\ fi wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/romkan/0002755000000000000000000000000007153676737016545 5ustar rootrootwnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/romkan/rk_modread.c0000644000000000000000000010533407153676737021024 0ustar rootroot/* * $Id: rk_modread.c,v 2.10.2.1 2000/08/04 05:37:28 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /********************************************************************** rk_modread.c 88. 6.16 ²þ Àµ 93.10.19 ¥â¡¼¥ÉÄêµÁɽ¤ÎÆÉ¤ß¹þ¤ß¤òôÅö¤¹¤ë¥×¥í¥°¥é¥à¡£ ***********************************************************************/ /* Version 3.0 */ #include "rk_multi.h" #ifdef WNNDEFAULT # include "config.h" /* ¥Þ¥¯¥íLIBDIR¤ÎÄêµÁ¡Ê¤Î¤¿¤á¤À¤±¡Ë¡£¥³¥ó¥Ñ¥¤¥ë»þ¤Ï¡¢¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î ¥µ¡¼¥Á¥Ñ¥¹¤Ë¡¢Wnn¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Î¤¢¤ê¤«¤òÀßÄꤷ¤Æ¤ª¤¯¤³¤È¡£*/ #endif #include #define Terminator 0 /* int¤ÎÎó¡Ênaibu[]¡Ë¤Î½ª»ß¥³¡¼¥É */ char *getenv(); #if defined(uniosu) extern struct passwd *getpwnam(); #endif extern char *chrcat(), *strend(), *ename(); extern void romkan_clear_body(); char *modhyopath; static void cond_evl(), mystrcpy(), rd_bcksla(), rd_ctrl(), hyouse(), look_choose(); void choosehyo(); static int mystrcmp(), read1tm(), mod_evl(), fnmsrc_tourk(), dspnamsrc_tourk(), scan1tm(), modsrc_tourk(), chk_get_int(), pathsrc_tourk(), modnamchk(), ctov(), look_cond(), evlcond(), chkchar_getc(); static char codeeval(); extern void ERRMOD(), ERMOPN(), BUGreport(); extern int filnamchk(); struct kwdpair { /* ¥­¡¼¥ï¡¼¥É¤È¤½¤ÎÆâÉôɽ¸½¤ÎÂбþ¤òÍ¿¤¨¤ë¹½Â¤ÂΡ£ÆâÉôɽ¸½¤ò »ý¤¿¤Ê¤¤¤â¤Î¤ËÂФ·¤Æ¤Ï0¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤ë¡£*/ char *name; int code; } modfn[] = { { "defmode", 0 }, { "if", XY2INT(2, 0) }, { "when", XY2INT(2, 1) }, { "path", 0 }, { "search", 0 }, { "on_dispmode", XY2INT(5, 0) }, { "off_dispmode", XY2INT(5, 1) }, { "on_unchg", XY2INT(6, 0) }, { "off_unchg", XY2INT(6, 1) }, { NULL, 0} }; /* ²¼¤ò¸«¤è ¥­¡¼¥ï¡¼¥ÉÄêµÁɽ¤Ï¤Þ¤À¤¢¤ÈÆó¤Ä¤¢¤ë¤Î¤À */ struct kwdpair modcond[] = { { "not", XY2INT(3, 0) }, { "and", XY2INT(3, 1) }, { "or", XY2INT(3, 2) }, { "true", XY2INT(3, 3) }, { "false", XY2INT(3, 4) }, { "=", XY2INT(3, 5) }, { "!=", XY2INT(3, 6) }, { "<", XY2INT(3, 7) }, { ">", XY2INT(3, 8) }, { NULL, 0} }; int condarg[] = {1, 2, 2, 0, 0, 2, 2, 2, 2}; /* ¾ò·ïȽÃÇ´Ø¿ô¤Î°ú¿ô¸Ä¿ô */ struct kwdpair swstat[] = { { "on", 0 }, { "off", 0 }, { "r", 0 }, { "nr", 0 }, { NULL, 0 } }; /* 1¡ß2^24Âå¤Ï¥â¡¼¥É̾¡¢4¡ß2^24Âå¤Ï¥â¡¼¥Éɽ¼¨Ê¸»úÎó¡¢7¡ß2^24Âå¤Ï¥â¡¼¥É¾õÂÖÄê ¿ô¤ÎÆâÉôɽ¸½¤Ë»È¤Ã¤Æ¤¤¤ë */ /** ¥­¡¼¥ï¡¼¥É¡Êif, and¤Ê¤É¡Ë¤¬ÀµÅö¤Ê¤â¤Î¤«¥Á¥§¥Ã¥¯¤·¡¢¤½¤ÎÈÖ¹æ¤òÊÖ¤¹ */ static int kwdsrc(hyo, wd, cur_rk) struct kwdpair *hyo; /* ¤É¤Î¥­¡¼¥ï¡¼¥Éɽ¤ò»È¤¦¤« */ char *wd; /* ¥Á¥§¥Ã¥¯¤µ¤ì¤ë¥­¡¼¥ï¡¼¥É */ ARGS *cur_rk; { int i; for(i = 0; hyo[i] . name != NULL; i++) if(!mystrcmp(hyo[i] . name, wd)) return(i); ERRMOD(9, cur_rk); /*NOTREACHED*/ return(0); } /** ¥â¡¼¥Éɽ¤ÎÆÉ¤ß¹þ¤ß */ void readmode(modfname, cur_rk) char *modfname; /* ¥â¡¼¥Éɽ¤Î̾ */ ARGS *cur_rk; { char buf[MDHMAX], *bufp; #ifdef RKMODPATH char *genv, *pathenv, *pathp; #endif mcurread = buf; /* ¥¨¥é¡¼½èÍýÍÑ */ #ifdef RKMODPATH if(!fixednamep(modfname) && NULL != (pathenv = genv = getenv(RKMODPATH)) && *genv != '\0'){ /* PATH¤Ë¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¥µ¡¼¥Á¥Ñ¥¹¤¬¤¢¤ë¾ì¹ç */ for(;;){ /* ¥µ¡¼¥Á¥Ñ¥¹¤Î³Æ¡¹¤òÆþ¤ì¤ëÎΰè¤Ë¤Ï¡¢pathmeimem¤ò¼ÚÍÑ ¤·¤Æ¤¤¤ë¡£¸å¤Ç¡¢¥µ¡¼¥Á¥Ñ¥¹¤ÎÀèÆ¬¤Ë¡¢¥â¡¼¥Éɽ¤Î¤¢¤ë ¥Ç¥£¥ì¥¯¥È¥ê¤òÀßÄꤹ¤ë¤Î¤Ç¡¢¤½¤ÎÊØµ¹¤Î¤¿¤á¤â¤¢¤ë*/ for(pathp = pathmeimem; *genv != ':' && *genv; genv++) *pathp++ = *genv; *pathp = '\0'; if(*(strend(pathmeimem)) != KUGIRI) *pathp++ = KUGIRI; /* path¤Î¶èÀÚ¤ê¤ÏDG¡ÊMV¡Ë¤Ç¤¢¤Ã¤Æ¤â'/' */ strcpy(pathp, modfname); if(NULL != (modefile = fopen(pathmeimem, "r"))){ /* Now Mode-hyo found */ if(flags & RK_VERBOS) fprintf(stderr, "romkan: using Mode-hyo %s ...\r\n", pathmeimem); curdir = pathmeimem; /* ¤³¤Î»þÅÀ¤Ç¤Ï¥Õ¥¡¥¤¥ë̾ ¹þ¤ß¤À¤¬¡¢¤¢¤È¤Ç¥Ñ¥¹Ì¾¤À¤±¤Ë¤Ê¤ë */ curfnm = ename(modfname); break; } if(*genv != ':'){ /* Mode-hyo not found */ if(flags & RK_VERBOS){ fprintf(stderr, "no %s in ",modfname); for(genv = pathenv; *genv; genv++){ fputc((*genv == ':' ? ' ' : *genv), stderr); } fprintf(stderr, ".\n"); } ERMOPN(0, cur_rk); } else genv++; /* coutinues searching Mode-hyo */ } } else #endif { if(NULL == (modefile = fopen(modfname, "r"))) ERMOPN(0, cur_rk); if(flags & RK_VERBOS) fprintf(stderr, "romkan: using Mode-hyo %s ...\r\n", modfname); strcpy(pathmeimem, modfname); } /* ¥µ¡¼¥Á¥Ñ¥¹¤ÎÀèÆ¬¤Ë¡¢¥â¡¼¥Éɽ¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤òÀßÄꤷ¤Æ¤¤¤ë¡£*/ *(ename(pathmeimem)) = '\0'; modhyopath = *pathmeiptr++ = pathmeimem; *pathmeiptr = NULL; strtail(pathmeimem); *(pathareaorg = ++pathmeimem) = '\0'; /* pathareaorg¤Ï¡¢pathmeimem_[]¤Î¤¦¤Á¥â¡¼¥Éɽ¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê̾¤ò ³ÊǼ¤·¤¿»Ä¤ê¤ÎÉôʬ¤ÎÀèÆ¬¤ò»Ø¤¹¡£*/ while(bufp = buf, read1tm(&bufp, 0, cur_rk)) mod_evl(buf, cur_rk); fclose(modefile); } /** ¸ÇÄꤵ¤ì¤¿¡Ê¥µ¡¼¥Á¥Ñ¥¹¤ò¸«¤ëɬÍפΤʤ¤¡Ë¥Õ¥¡¥¤¥ë̾¤ËÂФ·¤Æ¤ÏÈó0¤ò ÊÖ¤¹¡£¸½ºß¤Î¤È¤³¤í¡¢ / ./ ../ ¤Î¤É¤ì¤«¤Ç»Ï¤Þ¤ë¤â¤Î¤È¤·¤Æ¤¤¤ë¤¬¡Êºî¼Ô¤Î ÆÈÃǡˡ¢Å¬Åö¤ËÊѤ¨¤Æ¤è¤¤¡£strchr(s,'/')!=NULL ¤È¤¹¤ëÊý¤¬Îɤ¤¤«¤â */ int fixednamep(s) char *s; { return(!strncmp("/",s,1)|| !strncmp("./",s,2)|| !strncmp("../",s,3)); } /** ¥â¡¼¥Éɽ¤Î°ì¤«¤¿¤Þ¤ê¡Ê¥ê¥¹¥È¡¢¥Õ¥¡¥¤¥ë̾¡¢¥â¡¼¥Éɽ¼¨Ê¸»úÎó¡Ë¤ò ²ò¼á¤¹¤ë¡£ÊÖ¤¹Ãͤϡ¢defmode,searchµÚ¤Ópath¤Î»þ0¡¢¤½¤ì°Ê³°¤Ê¤é1¡£*/ static int mod_evl(s, cur_rk) char *s; /* ¥â¡¼¥Éɽ¤ÎÆâÉôɽ¸½¤ÎÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ */ ARGS *cur_rk; { char md1[MDT1LN], *bgn, *end; int num, romkan_ret, retval = 1; if(*s != '('){ if(*s != '"'){ num = fnmsrc_tourk(s, cur_rk); *naibu++ = XY2INT(4, num); } else { s++; if(*(end = strend(s)) != '"') ERRMOD(10, cur_rk); *end = '\0'; num = dspnamsrc_tourk(s, cur_rk); *naibu++ = XY2INT(5, 0); *naibu++ = num; } } else { s++; scan1tm(&s, md1, 1, cur_rk); switch(num = kwdsrc(modfn, md1, cur_rk)){ case 0: /* defmode */ retval = 0; scan1tm(&s, md1, 1, cur_rk); /* modename */ num = modsrc_tourk(md1, 0, cur_rk); if(scan1tm(&s, md1, 0, cur_rk) == 0){ /* ½é´üon-off¤Ë¤Ä¤¤¤Æ²¿¤â½ñ¤¤¤Æ¤Ê¤¤»þ¤Î default¤Ïoff */ modesw[num] . moderng = 2; modesw[num] . curmode = 0; break; } if(*md1 == '('){ char tmp[MDT1LN], *s; unsigned int i, j; s = md1 + 1; scan1tm(&s, tmp, 1, cur_rk); if(chk_get_int(tmp, &i, 0) != 0) ERRMOD(8, cur_rk); modesw[num] . moderng = i; scan1tm(&s, tmp, 1, cur_rk); if(chk_get_int(tmp, &j, modesw[num] . moderng) != 0) ERRMOD(8, cur_rk); modesw[num] . curmode = j; if( #ifdef ModeNotInt modesw[num] . moderng != i || modesw[num] . curmode != j || #endif i == 1 || (i != 0 && j >= i)){ ERRMOD(8, cur_rk); } scan1tm(&s, tmp, 2, cur_rk); } else { switch(kwdsrc(swstat, md1, cur_rk)){ case 0: modesw[num] . curmode = 1; break; case 1: modesw[num] . curmode = 0; break; /* New mode for Wnn6 xwnmo */ case 2: case 3: break; } modesw[num] . moderng = 2; /* skip mode data for Wnn6 xwnmo */ romkan_ret = scan1tm(&s, md1, 0, cur_rk); if(romkan_ret) scan1tm(&s, md1, 2, cur_rk); /* ¤¢¤ì¤Ðerr */ } break; case 1: /* if */ case 2: /* when */ *naibu++ = modfn[num] . code; scan1tm(&s, md1, 1, cur_rk); /* condition */ cond_evl(md1, cur_rk); while(scan1tm(&s, md1, 0, cur_rk)){ if(mod_evl(md1, cur_rk) == 0) ERRMOD(17, cur_rk); } *naibu++ = Terminator; break; case 3: /* path */ *(pathmeimem = pathareaorg) = '\0'; *(pathmeiptr = pathmeiorg) = NULL; case 4: /* search */ retval = 0; if(hyomeiptr != hyomeiorg) ERRMOD(11, cur_rk); /* ¥µ¡¼¥Á¥Ñ¥¹¤Î»ØÄê¤Ï¥Õ¥¡¥¤¥ë̾¤Î½Ð¸½¤è¤ê Àè¹Ô¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤È¤·¤Æ¤ª¤¯¡£*/ while(scan1tm(&s, md1, 0, cur_rk)){/* find pathname */ pathsrc_tourk(md1, cur_rk); } break; case 5: /* on_dispmode */ case 6: /* off_dispmode */ *naibu++ = modfn[num] . code; scan1tm(&s, md1, 1, cur_rk); /* dispmode string */ if(*(bgn = md1) != '"') ERRMOD(12, cur_rk); bgn++; if(*(end = strend(bgn)) != '"') ERRMOD(10, cur_rk); *end = '\0'; *naibu++ = dspnamsrc_tourk(bgn, cur_rk); scan1tm(&s, md1, 2, cur_rk); /* ¤¢¤ì¤Ðerr */ break; case 7: /* on_unchg */ case 8: /* off_unchg */ *naibu++ = modfn[num] . code; scan1tm(&s, md1, 2, cur_rk); /* ¤¢¤ì¤Ðerr */ break; } } *naibu = Terminator; return(retval); } /** ¾ò·ï¼°¡Ê¥â¡¼¥É̾ Ëô¤Ïnot,and¤Ê¤É¤Î¼°¡Ë°ì¤Ä¤ò²ò¼á */ static void cond_evl(cod, cur_rk) char *cod; /* ¾ò·ï¼°¤ÎÆâÉôɽ¸½¤ÎÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ */ ARGS *cur_rk; { char md1[MDT1LN]; unsigned int num; int i; if(is_digit(*cod) || *cod == '-'){ *naibu++ = XY2INT(7, 0); if(0 != chk_get_int(cod, &num, 0)) ERRMOD(4, cur_rk); *naibu++ = num; } else if(*cod != '('){ num = modsrc_tourk(cod, 1, cur_rk); *naibu++ = XY2INT(1, num); } else { cod++; scan1tm(&cod, md1, 1, cur_rk); /* not;and;or */ num = kwdsrc(modcond, md1, cur_rk); *naibu++ = XY2INT(3, num); for(i = condarg[num]; i; i--){ scan1tm(&cod, md1, 0, cur_rk); cond_evl(md1, cur_rk); } scan1tm(&cod, md1, 2, cur_rk); } *naibu = Terminator; } /** s¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤¬´ûÅÐÏ¿¤«Ãµ¤·¡¢¤Ê¤±¤ì¤ÐÅÐÏ¿¡£Ã¢¤·¡¢´ûÅÐÏ¿¤« ¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯¤Ï¸·Ì©¤Ç¤Ï¤Ê¤¤¤¬¡ÊÎ㤨¤Ð¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¤Ç¤â¡¢ ¥Ñ¥¹Ì¾ÉÕ¤­¤È̵¤·¤È¤Ç¤Ï¡¢Æ±¤¸¤È¸«¤Ê¤¤¡Ë¡¢¥Õ¥¡¥¤¥ë̾¤¬´ûÅÐÏ¿¤«¤É¤¦¤« ¥Á¥§¥Ã¥¯¤¹¤ë¤Î¤Ï¡¢¥á¥â¥êÀáÌó¤Î¤¿¤á¤ËƱ¤¸É½¤òÆÉ¤ß¹þ¤à¤Î¤òËɤ°¤¿¤á ¤À¤±¤Ê¤Î¤Ç¡¢¤½¤ì°Ê³°¤Ë¤ÏÊ̤˺¤¤ëÅÀ¤Ï¤Ê¤¤¡£*/ static int fnmsrc_tourk(s, cur_rk) char *s; ARGS *cur_rk; { int n; for(n = 0; hyomeiorg[n] != NULL; n++) if(!mystrcmp(hyomeiorg[n], s)) return(n); if(hyomeiorg + n != hyomeiptr) BUGreport(101); *hyomeiptr++ = hyomeimem; *hyomeiptr = NULL; mystrcpy(hyomeimem, s); if(!(hyoshu[n] = filnamchk(hyomeimem))) ERRMOD(3, cur_rk); strtail(hyomeimem); *++hyomeimem = '\0'; return(n); } /** s¤Ç»ØÄꤵ¤ì¤¿¥µ¡¼¥Á¥Ñ¥¹Ì¾¤¬´ûÅÐÏ¿¤«Ãµ¤·¡¢¤Ê¤±¤ì¤ÐÅÐÏ¿¡£Ã¢¤·¡¢fnmsrc_ tourk()ƱÍÍ¡¢´ûÅÐÏ¿¤«¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯¤Ï¸·Ì©¤Ç¤Ï¤Ê¤¤¤¬ÌäÂê¤Ê¤¤¡£*/ static int pathsrc_tourk(s, cur_rk) char *s; ARGS *cur_rk; { int n; char fnm_addsla[MDT1LN]; mystrcpy(fnm_addsla, s); if( !(*fnm_addsla == '\0' || *(strend(fnm_addsla)) == KUGIRI)) chrcat(fnm_addsla, KUGIRI); /* ¥Ñ¥¹Ì¾¤¬'/'¤Ç½ª¤ï¤Ã¤Æ¤Ê¤±¤ì¤Ð¡¢¤½¤ì¤òÉղ乤롣*/ for(n = 0; pathmeiorg[n] != NULL; n++) if(!strcmp(pathmeiorg[n], fnm_addsla)) return(n); if(pathmeiorg + n != pathmeiptr) BUGreport(104); *pathmeiptr++ = pathmeimem; *pathmeiptr = NULL; strcpy(pathmeimem, fnm_addsla); strtail(pathmeimem); *++pathmeimem = '\0'; return(n); } /** s¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥Éɽ¼¨Ê¸»úÎ󤬴ûÅÐÏ¿¤«Ãµ¤·¡¢¤Ê¤±¤ì¤ÐÅÐÏ¿ */ static int dspnamsrc_tourk(s, cur_rk) char *s; ARGS *cur_rk; { int n; for(n = 0; dspnambgn[n] != NULL; n++) if(!mystrcmp(dspnambgn[n], s)) return(n); if(dspnambgn + n != dspnamptr) BUGreport(103); *dspnamptr++ = dspcod; *dspnamptr = NULL; mystrcpy(dspcod, s); strtail(dspcod); *++dspcod = '\0'; return(n); } /** ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥â¡¼¥É̾¤ÎÃæ¤«¤é¡¢s¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥É̾¤òõ¤¹¡£*np ¤Ë ¥â¡¼¥ÉÈֹ椬Æþ¤ë¡£¸«¤Ä¤«¤é¤Ê¤¤¤È¸½¥â¡¼¥É̾¤ÎÁí¿ô¤¬Æþ¤ë¡£¤½¤Î¾ì¹ç ÊÖÃͤÏ0¡£*/ static int modnam_src(s, np, cur_rk) char *s; int *np; ARGS *cur_rk; { for(*np = 0; modmeibgn[*np] != NULL; (*np)++ ) if(!mystrcmp(modmeibgn[*np], s)) return(1); return(0); } /** s¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥É̾¤òõ¤·¡¢¤Ê¤±¤ì¤ÐÅÐÏ¿¡£Ã¢¤·¡¢flg¤¬Èó0¤Ê¤é¡¢ ¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð¥¨¥é¡¼ */ static int modsrc_tourk(s, flg, cur_rk) char *s; int flg; ARGS *cur_rk; { int n; if(modnam_src(s, &n, cur_rk)) return(n); if(flg) ERRMOD(5, cur_rk); if(modmeibgn + n != modmeiptr) BUGreport(102); *modmeiptr++ = modmeimem; *modmeiptr = NULL; mystrcpy(modmeimem, s); if(!modnamchk(modmeimem)) ERRMOD(4, cur_rk); strtail(modmeimem); *++modmeimem = '\0'; return(n); } /** ¥Õ¥¡¥¤¥ë¤«¤é°ìʸ»úÆÉ¤à¡Ê¶õÇòʸ»ú¤ÏÈô¤Ð¤¹¡Ë¡£ÆÉ¤ó¤Àʸ»ú¤¬EOF¤Ê¤é0¤òÊÖ¤¹ */ static char fspcpass(cur_rk) ARGS *cur_rk; { register int c; while(EOF != (c = chkchar_getc(modefile, cur_rk)) && is_nulsp(c)); return(c == EOF ? '\0' : c); } /** ¥â¡¼¥Éɽ¤Ë¤Ï¶õÇòʸ»ú°Ê³°¤Î¥³¥ó¥È¥í¡¼¥ëʸ»ú¤ÏÀ¸¤Ç¤Ïº®¤¸¤é¤Ê¤¤¤â¤Î¤È ¤¹¤ë¡£º®¤¸¤Ã¤Æ¤¤¤¿¾ì¹ç¤Ï¥Á¥§¥Ã¥¯¤·¤Ä¤Ä¡¢getc¤ò¹Ô¤¦¡£*/ static int chkchar_getc(f, cur_rk) FILE *f; ARGS *cur_rk; { register int c; c = getc(f); if(is_cntrl(c) && !isspace(c)){ sprintf(mcurread, "\\%03o", c); ERRMOD(16, cur_rk); } return(c); } static int modehyo_getc(cur_rk) ARGS *cur_rk; { return(chkchar_getc(modefile, cur_rk)); } static int modehyo_ungetc(c, cur_rk) register int c; ARGS *cur_rk; { return(ungetc(c, modefile)); } /** soc¤Î̾¤Î¥æ¡¼¥¶¤Î¥í¥°¥¤¥ó¡¦¥Ç¥£¥ì¥¯¥È¥ê̾¤òdest¤ËÆþ¤ì¡¢*dest¤Ë¤½¤Î ËöÈø¤ò»Ø¤µ¤»¤ë¡£Ã¢¤·soc¤¬¶õÎó¤Ê¤é¼«Ê¬¤Î¥í¥°¥¤¥ó¡¦¥Ç¥£¥ì¥¯¥È¥ê̾¡¢ NULL¤Ê¤é¼«Ê¬¤Î¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê̾¡£¤¤¤º¤ì¤Î¾ì¹ç¤â¡¢ÉÔÀ®¸ù»þ¤Ï ²¿¤â¤·¤Ê¤¤¡£ÊÖÃͤϡ¢ÉÔÀ®¸ù»þ-1¡Êgetenv("HOME")¼ºÇÔ»þ¤À¤±¤Ï-2¡Ë¡£*/ static int get_hmdir(dest, soc) char **dest, *soc; { struct passwd *usr; char *p; if(soc == NULL){ if(NULL == (p = getenv("HOME"))) return(-2); } else { if(NULL == (usr = (*soc? getpwnam(soc) : getpwuid(getuid())))) return(-1); p = usr -> pw_dir; } strcpy(*dest, p); strtail(*dest); return(0); } /** ¥â¡¼¥Éɽ¡¦ÂбþÉ½Ãæ¤Î¡¢¥Õ¥¡¥¤¥ë̾¤ÎÉôʬ¤ÎÆÉ¤ß¹þ¤ß¡£ÀèÆ¬¤¬ @ Ëô¤Ï ~ ¤Î »þ¤Ï¡¢ÆÃ¼ì½èÍý¤ò¹Ô¤¦¡£°ú¿ô¤Ï¡¢°ì»úÆÉ¤ß¹þ¤ß¡¦°ì»úÌᤷ¡¦Ê¸»úÎó¼è¤ê½Ð¤·¤Î ´Ø¿ô¤È¡¢·ë²Ì¤òÆþ¤ì¤ë¥¨¥ê¥¢¤ÎÈÖÃϤؤΥݥ¤¥ó¥¿¡¢¼¡¤ËÆÉ¤Þ¤ì¤ëʸ»ú¤òÆþ¤ì¤ë ¥Ý¥¤¥ó¥¿¡£ÊÖÃͤϡ¢Àµ¾ï½ªÎ»»þ0¡¢@HOME¤Ç¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê¤¬¼è¤ì¤Ê¤¤»þ 1¡¢@¤Î¤¢¤È¤ËÊѤʤâ¤Î¤¬Í褿¤é2¡¢~¤Ç¼«Ê¬¤Î¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê¤¬¼è¤ì¤Ê¤¤ »þ3¡¢~¤Î¤¢¤È¤Ë¸ºß¤·¤Ê¤¤¥æ¡¼¥¶Ì¾¤¬Í褿¤é4¡£*/ int readfnm(readchar_func, unreadc_func, readstr_func, areap, lastcptr, cur_rk) register int (*readchar_func)(), (*unreadc_func)(), (*readstr_func)(); char **areap; int *lastcptr; ARGS *cur_rk; { char *head; register int c; c = (*readchar_func)(cur_rk); if(c == '@'){ /* @HOME, @MODEDIR, @LIBDIR */ *(*areap)++ = c; head = *areap; (*readstr_func)(areap, 1, cur_rk); if(mystrcmp("HOME", head) == 0){ *areap = --head; if(get_hmdir(areap, (char *)NULL) != 0){ *areap = head; return(1); } } else if(mystrcmp("MODEDIR", head) == 0){ strcpy(*areap = --head, modhyopath); if(KUGIRI== *(*areap= strend(*areap))) **areap = '\0'; } else #ifdef WNNDEFAULT if(mystrcmp("LIBDIR", head) == 0){ strcpy(*areap = --head, LIBDIR); strtail(*areap); } else #endif { *areap = --head; return(2); } } else if(c == '~'){ /* ~user */ int err; *(*areap)++ = c; head = *areap; (*readstr_func)(areap, 1, cur_rk); mystrcpy(head, head); *areap = head - 1; if((err = get_hmdir(areap, (*head ? head : NULL)))!= 0){ *areap = --head; return(err == -2 ? 3 : 4); } } else { (*unreadc_func)(c, cur_rk); } *lastcptr = (*readstr_func)(areap, 0, cur_rk); return(0); } /** ¥â¡¼¥Éɽ¤«¤é°ìʸ»úʬ¼è¤ê½Ð¤¹ºî¶È¤ò¡¢¶õÇò¡¦³ç¸Ì¤Î¤É¤ì¤« Ëô¤ÏEOF¤¬Íè¤ë¤Þ¤Ç³¤±¤ë¡£flg & 01¤¬Èó0¤Ê¤é¡¢'/'¤¬Íè¤Æ¤â ½ª¤ï¤ë¡£ÊÖÃͤϡ¢¼¡¤ËÆÉ¤Þ¤ì¤ëʸ»ú¡£*/ static int rd_string(readfile, sptr, flg, cur_rk) register FILE *readfile; char **sptr; int flg; ARGS *cur_rk; { int c; while(EOF != (c = chkchar_getc(readfile, cur_rk)) && !(is_nulsp(c) || c == '(' || c == ')') && !(flg & 01 && c == KUGIRI)){ switch(c){ case '\\': rd_bcksla(readfile, sptr, cur_rk); break; case '^': rd_ctrl(readfile, sptr, cur_rk); break; default: *(*sptr)++ = c; } } **sptr = '\0'; return(ungetc(c, readfile)); } static int rd_str_from_modefile(sptr, flg, cur_rk) char **sptr; int flg; ARGS *cur_rk; { return(rd_string(modefile, sptr, flg, cur_rk)); } /** ¥â¡¼¥Éɽ¤«¤é¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å·Á¼°¤Î°ìʸ»úʬ¤ò¼è¤ê½Ð¤·¡¢'\¡Ê8¿Ê¡Ë;' ¤Î·Á¤Ëľ¤¹¡£Ã¢¤·¡¢ÀèÆ¬¤Î'\\'¤Ï´û¤ËÆÉ¤Þ¤ì¤¿¤¢¤È¡£*/ static void rd_bcksla(readfile, sptr, cur_rk) register FILE *readfile; char **sptr; ARGS *cur_rk; { int c, code = 0, digflg = 0; switch(c = chkchar_getc(readfile, cur_rk)){ case 'n': code = '\n'; digflg = 1; break; case 't': code = '\t'; digflg = 1; break; case 'b': code = '\b'; digflg = 1; break; case 'r': code = '\r'; digflg = 1; break; case 'f': code = '\f'; digflg = 1; break; case 'e': case 'E': code = ESCCHR; digflg = 1; break; case 'o': while(c = chkchar_getc(readfile, cur_rk), is_octal(c)){ code <<= 3; code += ctov(c); digflg = 1; } if(c != ';') ungetc(c, readfile); break; case 'd': while(c = chkchar_getc(readfile, cur_rk), is_digit(c)){ code *= 10; code += ctov(c); digflg = 1; } if(c != ';') ungetc(c, readfile); break; case 'x': while(c = chkchar_getc(readfile, cur_rk), is_xdigit(c)){ code <<= 4; code += ctov(c); digflg = 1; } if(c != ';') ungetc(c, readfile); break; default: if(is_octal(c)){ digflg = 1; code = ctov(c); while(c= chkchar_getc(readfile, cur_rk), is_octal(c)){ code <<= 3; code += ctov(c); } if(c != ';') ungetc(c, readfile); } else { code = c; digflg = 1; } } if(digflg == 0) ERRMOD(7, cur_rk); sprintf(*sptr, "\\%o;", code); strtail(*sptr); } /** ¥â¡¼¥Éɽ¤«¤é¥³¥ó¥È¥í¡¼¥ë¥³¡¼¥É·Á¼°¤Î°ìʸ»úʬ¤ò¼è¤ê½Ð¤·¡¢ '\¡Ê8¿Ê¡Ë;' ¤Î·Á¤Ëľ¤¹¡£Ã¢¤·¡¢ÀèÆ¬¤Î'^'¤Ï´û¤ËÆÉ¤Þ¤ì¤¿¤¢¤È¡£*/ static void rd_ctrl(readfile, sptr, cur_rk) register FILE *readfile; char **sptr; ARGS *cur_rk; { int c; if(!(' ' <= (c = chkchar_getc(readfile, cur_rk)) && c < '\177')) ERRMOD(7, cur_rk); if(c == '?') c = '\177'; else c &= 0x1f; sprintf(*sptr, "\\%o;", c); strtail(*sptr); } /** ¥â¡¼¥Éɽ¤Î°ì¤«¤¿¤Þ¤ê¡Ê¥ê¥¹¥È¡¢¥Õ¥¡¥¤¥ë̾¡¢¥â¡¼¥Éɽ¼¨Ê¸»úÎó¡Ë¤ò ÀÚ¤ê½Ð¤¹¡£¤½¤ÎºÝ¡¢ÆÃ¼ì¤Êɽµ­¡Ê'^','\'¤Ë¤è¤ë¡Ë¤Ï¡¢'\¡Ê8¿Ê¡Ë;' ¤Î ·Á¤Ëľ¤¹¡£flg¤¬Èó0¤Ê¤é¡¢EOF¤Ç¥¨¥é¡¼¤òµ¯¤³¤·¡¢')'¤Ç0¤òÊÖ¤¹¡£*/ static int read1tm(sptr, flg, cur_rk) char **sptr; /* ¥â¡¼¥Éɽ¤ÎÆâÉôɽ¸½¤ÎÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ rd_bcksla()¡¢rd_ctrl()¡¢codeeval()¤Ç¤âƱÍÍ */ int flg; ARGS *cur_rk; { int c, err, retval = 1; char *s; s = *sptr; while((c = fspcpass(cur_rk)) == ';'){ /* Ãí¼áʸ¤ò¸¡½Ð¤·¤¿¤é¡¢¹ÔËö¤Þ¤Ç¤È¤Ð¤·¤ÆºÆ»î¹Ô¡£*/ while((c = chkchar_getc(modefile, cur_rk)) != '\n' && c != EOF); } switch(c){ case '\0': /* EOF¤òɽ¤¹ */ if(flg) ERRMOD(0, cur_rk); else retval = 0; break; case ')': if(flg) retval = 0; else ERRMOD(1, cur_rk); break; case '(': *s++ = c; *s++ = ' '; while(read1tm(&s, 1, cur_rk)) *s++ = ' '; *s++ = ')'; break; case '"': *s++ = c; while((c = chkchar_getc(modefile, cur_rk)) != '"'){ switch(c){ case EOF : ERRMOD(0, cur_rk); case '\\': rd_bcksla(modefile, &s, cur_rk); break; case '^' : rd_ctrl(modefile, &s, cur_rk); break; default : *s++ = c; } } *s++ = '"'; break; default: ungetc(c, modefile); /* ÀèÆ¬¤¬ @ Ëô¤Ï ~ ¤Î»þ¤Ï¡¢ÆÃ¼ì½èÍý¡£*/ err = readfnm(modehyo_getc, modehyo_ungetc, rd_str_from_modefile, &s, &c, cur_rk); if(err){ mcurread = s; switch(err){ case 1: case 3: ERRMOD(13, cur_rk); case 2: ERRMOD(14, cur_rk); case 4: ERRMOD(15, cur_rk); } } if(c == EOF && flg) ERRMOD(0, cur_rk); if(c == ')' && !flg) ERRMOD(1, cur_rk); } *s = '\0'; *sptr = s; return(retval); } /** 8¡¦10¡¦16¿Ê¥³¡¼¥ÉÍѤΥ­¥ã¥é¥¯¥¿¤ò¼ÂºÝ¤Î¥³¡¼¥É¤Ëľ¤¹¡£ÆþÎϤΥÁ¥§¥Ã¥¯¤Ï ¤·¤Ê¤¤¡£*/ static int ctov(c) char c; { if(is_upper(c)) return(c - 'A' + 10); if(is_lower(c)) return(c - 'a' + 10); return(c - '0'); } /** ¥ê¥¹¥È¤ÎÃæ¿È¤Îscan¤ËÀìÍÑ¡£')'¤Ç0¤òÊÖ¤¹¡£EOL¤ÏÍè¤Ê¤¤¤Ï¤º¡£ flg == 1 ¤Î¤È¤­¡¢¼è¤ê½Ð¤·¤Ë¼ºÇÔ¤·¤¿¤é¥¨¥é¡¼¡£ flg == 2 ¤Î¤È¤­¡¢¼è¤ê½Ð¤·¤ËÀ®¸ù¤·¤¿¤é¥¨¥é¡¼¡£ ÆÃ¼ì¤Ê¥³¡¼¥Éɽµ­¤Ï´û¤ËÁ´¤Æ '\¡Ê8¿Ê¡Ë;' ¤Î·Á¤Ëľ¤Ã¤Æ¤¤¤ëȦ¡£*/ static int scan1tm(socp, dest, flg, cur_rk) char **socp, *dest; /* socp¤Î»Ø¤·¤Æ¤¤¤ë¥Ý¥¤¥ó¥¿¤¬»Ø¤·¤Æ¤¤¤ë½ê¤«¤é¼è¤ê½Ð¤·¤Ædest¤ËÆþ¤ì¤ë¡£ ¤½¤Î¸å¡¢socp¤¬»Ø¤·¤Æ¤¤¤ë¥Ý¥¤¥ó¥¿¤ò¿Ê¤á¤ë¡£*/ int flg; ARGS *cur_rk; { char c; int retval = 1; while(c = *(*socp)++, is_nulsp(c)) if(c == '\0') ERRMOD(6, cur_rk); switch(c){ case ')': retval = 0; break; case '(': *dest++ = c; *dest++ = ' '; while(scan1tm(socp, dest, 0, cur_rk)){ strtail(dest); *dest++ = ' '; } *dest++ = ')'; break; case '"': *dest++ = c; while((c = *dest++ = *(*socp)++) != '"'){ if(c == '\\'){ /* '\¡Ê8¿Ê¡Ë;'¤Î²ò¼á */ while(c = *dest++ = *(*socp)++, is_octal(c)); } } break; default: *dest++ = c; while(!is_nulsp(**socp)) *dest++ = *(*socp)++; } *dest = '\0'; if(((flg == 1) && (retval == 0)) || ((flg == 2) && (retval == 1))) ERRMOD(6, cur_rk); return(retval); } /** ¥â¡¼¥É̾¤È¤·¤ÆÀµÅö¤«¥Á¥§¥Ã¥¯¡£±Ñ¿ô»ú¤«¤é¤Ê¤Ã¤Æ¤¤¤ì¤Ð¤¤¤¤ */ static int modnamchk(s) char *s; { if(is_digit(*s)) return(0); for(; *s; s++) if(!is_alnum(*s) && *s != '_') return(0); return(1); } #define modu1(a, b) ((b) ? ((a) % (b)) : (a)) #define curmod(num) (modesw[num] . curmode) #define modrng(num) (modesw[num] . moderng) /** numÈÖÌܤΥ⡼¥É¤ò¥Á¥§¥ó¥¸¤·¡¢ÊÑ´¹É½¤òÁªÂò¤·Ä¾¤¹¡£°ú¿ô mode ¤ÎÃͤ¬0¤Ê¤é ¥â¡¼¥É¤òoff¡¢1¤Ê¤éon¤¹¤ë¤³¤È¤Ë¤Ê¤ë¡£¤Ê¤ª¡¢µìmode¤ÎÃͤòÊÖ¤¹¡£*/ modetyp chgmod(num, mode, cur_rk) int num; modetyp mode; ARGS *cur_rk; { modetyp oldmod; oldmod = curmod(num); curmod(num) = modu1(mode, modrng(num)); choosehyo(cur_rk); return(oldmod); } /** Á´¥â¡¼¥É¤ò¤Þ¤È¤á¤ÆÀÚ¤êÂØ¤¨¤ë */ void allchgmod(mode, cur_rk) modetyp mode; ARGS *cur_rk; { int i; for(i = 0; modmeibgn[i] != NULL; i++){ curmod(i) = modu1(mode, modrng(i)); } choosehyo(cur_rk); } /** numÈÖÌܤΥ⡼¥É¤ò»ØÄꤷ¤¿¿ô¤À¤±¥¤¥ó¥¯¥ê¥á¥ó¥È¤·¡¢µìmode¤ÎÃͤòÊÖ¤¹¡£*/ modetyp incmod(num, dmode, cur_rk) int num; modetyp dmode; ARGS *cur_rk; { modetyp oldmod, newmod; newmod = oldmod = curmod(num); newmod += dmode; if(oldmod > newmod) newmod -= modrng(num); return(chgmod(num, newmod, cur_rk)); } /** numÈÖÌܤΥ⡼¥É¤ò»ØÄꤷ¤¿¿ô¤À¤±¥Ç¥¯¥ê¥á¥ó¥È¤·¡¢µìmode¤ÎÃͤòÊÖ¤¹¡£ÅÔ¹ç ¤Ë¤è¤ê¡¢incmod¤È¤ÏÊ̤ËÍѰդ·¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£*/ modetyp decmod(num, dmode, cur_rk) int num; modetyp dmode; ARGS *cur_rk; { modetyp oldmod, newmod; newmod = oldmod = curmod(num); newmod -= dmode; if(oldmod < newmod) newmod += modrng(num); return(chgmod(num, newmod, cur_rk)); } /** name¤Î̾¤Î¥â¡¼¥É¤¬¤Ê¤±¤ì¤ÐÈó0¤òÊÖ¤·¡¢¤¢¤ì¤Ð¤½¤Î¥â¡¼¥ÉÈֹ桦µÚ¤Ó¤½¤Î ¾õÂ֤κÇÂçÃ͡ܣ±¤È¸½ºß¤Î¾õÂÖ¤ò¼è¤Ã¤Æ¤¯¤ë */ int romkan_getmode_body(name, nump, modep, moderngp, cur_rk) char *name; int *nump; modetyp *modep, *moderngp; ARGS *cur_rk; { if(!modnam_src(name, nump, cur_rk)) { return(-1); } *modep = curmod(*nump); *moderngp = modrng(*nump); return(0); } int romkan_getmode(name, nump, modep, moderngp) char *name; int *nump; modetyp *modep, *moderngp; { int x; ARGS *cur_rk = NULL; LockMutex(&(cur_rk->rk_lock)); x = romkan_getmode_body(name, nump, modep, moderngp, cur_rk); UnlockMutex(&(cur_rk->rk_lock)); return x; } /** name¤Î̾¤Î¥â¡¼¥É¤¬¤Ê¤±¤ì¤ÐÈó0¤òÊÖ¤·¡¢¤¢¤ì¤Ð¤½¤Î¾õÂÖ¤ò¥»¥Ã¥È¤·¤Æ ÊÑ´¹É½¤òºÆÁªÂò¤Î¸å¡¢µì¾õÂÖ¤ò¼è¤ê¹þ¤ó¤Ç0¤òÊÖ¤¹¡£*/ int romkan_setmode_body(name, modep, cur_rk) char *name; modetyp *modep; ARGS *cur_rk; { modetyp oldmode, moderng; int modenum; if(romkan_getmode_body(name, &modenum, &oldmode, &moderng, cur_rk)!= 0) { return(-1); } chgmod(modenum, *modep, cur_rk); *modep = oldmode; return(0); } int romkan_setmode(name, modep) char *name; modetyp *modep; { int x; ARGS *cur_rk = NULL; LockMutex(&(cur_rk->rk_lock)); x = romkan_setmode_body(name, modep, cur_rk); UnlockMutex(&(cur_rk->rk_lock)); return x; } /** ÊÑ´¹É½¤Î¥¯¥ê¥¢ */ void romkan_reset_body(cur_rk) ARGS *cur_rk; { naibu_[0] = Terminator; choosehyo(cur_rk); romkan_clear_body(cur_rk); } void romkan_reset() { ARGS *cur_rk = NULL; LockMutex(&(cur_rk->rk_lock)); romkan_reset_body(cur_rk); UnlockMutex(&(cur_rk->rk_lock)); } /** ÊÑ´¹Âбþɽ¤ÎÁªÂò¤ò¹Ô¤¦ */ void choosehyo(cur_rk) ARGS *cur_rk; { int *naibup, i; naibup = naibu_; usemaehyo[0] = usehyo[0] = useatohyo[0] = -1; for(i = 0; i < 2; i++){ dspmod[1][i] = dspmod[0][i]; dspmod[0][i] = NULL; } look_choose(&naibup, 1, cur_rk); } /** ¥â¡¼¥Éɽ¤ÎÆâÉô·Á¼°¤ò½ç¼¡¸«¤Æ¤¤¤­¡¢»ÈÍÑɽ¤ÎÁªÂòµÚ¤Ó¥â¡¼¥Éɽ¼¨Ê¸»úÎó¤Î ÁªÂò¤ò¹Ô¤Ã¤Æ¤¤¤¯¡£Ã¢¤·flg¤¬0¤Ê¤é¥¹¥­¥Ã¥×¤¹¤ë¤À¤± */ static void look_choose(naibupp, flg, cur_rk) int **naibupp; /* ¥â¡¼¥Éɽ¤ÎÆâÉôɽ¸½¤ÎÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¡£ look_cond()¡¢evlcond()¤Ç¤âƱÍÍ */ int flg; ARGS *cur_rk; { int *naibup, naibu1, naibu2, branch, lcrsl; naibup = *naibupp; while((naibu1 = *naibup++) != Terminator){ switch(SHUBET(naibu1)){ case 4: /* ɽ̾ */ if(flg) hyouse(LWRMSK(naibu1), cur_rk); break; case 2: /* ¾ò·ï¼° */ branch = LWRMSK(naibu1); /* if;when */ lcrsl = look_cond(&naibup, flg, cur_rk); if(branch == 0 && lcrsl) flg = 0; break; case 5: /* romkan¤¬on¡¦off»þ¤½¤ì¤¾¤ì¤Î ¥â¡¼¥Éɽ¼¨Ê¸»úÎó */ naibu2 = *naibup++; if(flg) dspmod[0][LWRMSK(naibu1)] = dspnambgn[naibu2]; break; case 6: /* romkan¤¬¤½¤ì¤¾¤ìon¡¦off»þ¤Î¥â¡¼¥Éɽ¼¨ ʸ»úÎó¤òÁ°¤Î¤Þ¤Þ¤Ë */ if(flg) dspmod[0][LWRMSK(naibu1)] = dspmod[1][LWRMSK(naibu1)]; break; default: BUGreport(6); } } *naibupp = naibup; } /** *naibupp ¤¬¡¢ÆâÉôɽ¸½¤ÎÎó¤Ç¾ò·ï¼°¤òɽ¤¹¤È¤³¤í¤ò»Ø¤·¤Æ¤¤¤ëȦ¤Ê¤Î¤Ç¡¢ ¤½¤ì¤òɾ²Á¤·¡¢¿¿¤Ê¤é¤½¤Î³¤­¤ò²ò¼á¤·¤Ë¤¤¤¯¡£µ¶¤Ê¤éÆÉ¤ßÈô¤Ð¤¹¡£ ÊÖÃͤϡ¢ºÇ½é¤Ëɾ²Á¤·¤¿¾ò·ï¼°¤Î¿¿µ¶ÃÍ¡£*/ static int look_cond(naibupp, flg, cur_rk) int **naibupp, flg; ARGS *cur_rk; { int *naibup, condrsl; naibup = *naibupp; condrsl = evlcond(&naibup, cur_rk); /* ɬ¤ºÉ¾²Á¤·¤Ê¤¤¤È¤¤¤±¤Ê¤¤¤¿¤á */ flg = flg && condrsl; look_choose(&naibup, flg, cur_rk); *naibupp = naibup; return(flg); } /** ¾ò·ï¼°¤Î¿¿µ¶ÃͤÎɾ²Á ÊÖÃͤÏ0¤«1¤È¤Ï¸Â¤é¤ó¤¾ */ static int evlcond(naibupp, cur_rk) int **naibupp; ARGS *cur_rk; { int *naibup, naibu1, retval = -1, tmpval[ARGMAX], i, imax; naibup = *naibupp; naibu1 = *naibup++; switch(SHUBET(naibu1)){ case 7: /* ¿ôÃÍ */ retval = *naibup++; break; case 1: /* ¥â¡¼¥É̾ */ retval = modesw[LWRMSK(naibu1)] . curmode; break; case 3: /* and¤Ê¤É */ imax = condarg[LWRMSK(naibu1)]; for(i = 0; i < imax; i++) tmpval[i] = evlcond(&naibup, cur_rk); switch(LWRMSK(naibu1)){ /* ¾å¤«¤é½ç¤Ëtrue,false,not,and,or */ case 0: retval = !tmpval[0]; break; case 1: retval = tmpval[0]&& tmpval[1]; break; case 2: retval = tmpval[0]|| tmpval[1]; break; case 3: retval = 1; break; case 4: retval = 0; break; case 5: retval = (tmpval[0] == tmpval[1]); break; case 6: retval = (tmpval[0] != tmpval[1]); break; case 7: retval = ((unsigned int)tmpval[0] < (unsigned int)tmpval[1]); break; case 8: retval = ((unsigned int)tmpval[0] > (unsigned int)tmpval[1]); break; } break; } *naibupp = naibup; return(retval); } /** numÈÖÌܤÎɽ¤ò¡¢»ÈÍѤ¹¤ë¤â¤Î¤È¤·¤ÆÅÐÏ¿¤¹¤ë¡£Á°¡¦ËÜ¡¦¸å½èÍý¤Î¶èÊ̤⤹¤ë */ static void hyouse(num, cur_rk) int num; ARGS *cur_rk; { int *ptr; switch(hyoshu[num]){ case 1: ptr = usemaehyo; break; case 2: ptr = usehyo; break; case 3: ptr = useatohyo; break; default: BUGreport(11); return; } for(; *ptr != -1; ptr++) if(*ptr == num) return; *ptr = num; *++ptr = -1; } /** strcmp¤ÈƱÅù ⤷¡¢'\¡Ê8¿Ê¡Ë;'¤â²ò¼á¤¹¤ë¡£*/ static int mystrcmp(s1, s2) char *s1, *s2; { char c1, c2; while((c1 = codeeval(&s1)) == (c2 = codeeval(&s2))) if(c1 == '\0') return(0); return(c1 > c2 ? 1 : -1); } /** strcpy¤ÈƱÅù ⤷'\¡Ê8¿Ê¡Ë;'¤â²ò¼á¤¹¤ë¡£s1 <= s2¤Ê¤éÀµ¾ïưºî¤¹¤ë¤Ï¤º */ static void mystrcpy(s1, s2) char *s1, *s2; { while((*s1++ = codeeval(&s2))); } /** °ìʸ»ú¤Î²ò¼á¤ò¹Ô¤¦¡£ÉáÄ̤Îʸ»ú¤Ï¤½¤Î¤Þ¤Þ¡¢'\¡Ê8¿Ê¡Ë;'¤Ï¼ÂºÝ¤Î¥³¡¼¥É¤Ë ľ¤¹¡£¤½¤Î¸å¡¢Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò°ìʸ»úʬ¿Ê¤á¤Æ¤ª¤¯¡Ê¾¯¤Ê¤¯¤È¤â £±¥Ð¥¤¥Èʬ¿Ê¤à¤³¤È¤¬Êݾڤµ¤ì¤ë¤Ï¤º¡Ë¡£*/ static char codeeval(sptr) register char **sptr; { register char c; char code = 0; if((c = *(*sptr)++) != '\\') return(c); while(c = *(*sptr)++, is_octal(c)){ code <<= 3; code += ctov(c); } if(c != ';') BUGreport(12); return(code); } /** romkan¤¬on»þ¤Î¥â¡¼¥Éɽ¼¨Ê¸»úÎó¤òÊÖ¤¹´Ø¿ô¡£Ìµ»ØÄê¤Ç¤¢¤Ã¤ÆRK_DSPNIL¥Õ¥é¥°¤¬ Ω¤Ã¤Æ¤¤¤ë»þ¤Ï¶õʸ»úÎó¤òÊÖ¤¹¡£*/ char * romkan_dispmode_body(cur_rk) ARGS *cur_rk; { char *x; if(dspmod[0][0] == NULL && (flags & RK_DSPNIL)) x = nulstr; else x = dspmod[0][0]; return x; } char * romkan_dispmode() { char *x; ARGS *cur_rk = NULL; LockMutex(&(cur_rk->rk_lock)); x = romkan_dispmode_body(cur_rk); UnlockMutex(&(cur_rk->rk_lock)); return x; } /** romkan¤¬off»þ¤Î¥â¡¼¥Éɽ¼¨Ê¸»úÎó¤òÊÖ¤¹´Ø¿ô¡£Ìµ»ØÄê¤Ç¤¢¤Ã¤ÆRK_DSPNIL¥Õ¥é¥° ¤¬Î©¤Ã¤Æ¤¤¤ë»þ¤Ï¶õʸ»úÎó¤òÊÖ¤¹¡£*/ char * romkan_offmode_body(cur_rk) ARGS *cur_rk; { char *x; if(dspmod[0][1] == NULL && (flags & RK_DSPNIL)) x = nulstr; else x = dspmod[0][1]; return x; } char * romkan_offmode() { char *x; ARGS *cur_rk = NULL; LockMutex(&(cur_rk->rk_lock)); x = romkan_offmode_body(cur_rk); UnlockMutex(&(cur_rk->rk_lock)); return x; } /** ʸ»úÎó¤¬10¿ÊÀ°¿ô¤Ê¤é¤½¤Î²ò¼á¤ò¤·¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÈó0¤òÊÖ¤¹ */ static int chk_get_int(p, ip, range) char *p; unsigned int *ip; modetyp range; { int sgn = 1; modetyp out; if(*p == '-'){ p++; sgn = -1; } for(out = 0; *p; p++){ if(!is_digit(*p)) return(-1); #if defined(UX386) || defined(sun386) out = out * 10; #else out *= 10; #endif out += ctov(*p); } if(range != 0) out %= range; if(sgn == -1 && out != 0) out = range - out; *ip = out; return(0); } wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/romkan/rk_header.h0000644000000000000000000002204007153676737020636 0ustar rootroot/* * $Id: rk_header.h,v 2.3.2.1 2000/08/04 05:37:27 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /*********************************************************************** rk_header.h 88. 5.20 Äû Êä rk_main.c rk_read.c rk_modread.c rk_bltinfn.c¤Î¶¦Ḁ̈إåÀ¡£ Ãæ¤Ç¼è¤Ã¤Æ¤¤¤ëÇÛÎó¤ÎÂ礭¤µ¤Ê¤É¤òÄêµÁ¡£ ***********************************************************************/ /* Version 3.0 */ /* make»þ¤ËɬÍפÊdefine BSD42 BSD¤Ë¤Æstrings.h¤ò»ÈÍÑ¡Êstring.h¤ò»È¤¦¾ì¹ç¤ÏÉÔÍ×¡Ë SYSVR2 System V¤Ë¤ÆÄêµÁ°è¤ÎÀ©¸Â¤µ¤ì¤¿toupper¡¦tolower¤ò»ÈÍÑ ¡Ê¤Ê¤¯¤Æ¤âư¤¯¡Ë MVUX ECLIPSE MV¤Ç¤Î±¿Å¾»þ¤Ëdefine IKIS¤¬¼«Æ°define¤µ¤ì¤ë RKMODPATH="ʸ»úÎó" ¤½¤Îʸ»úÎó¤ò¥â¡¼¥ÉÄêµÁɽ¤Î¥µ¡¼¥Á¥Ñ¥¹¤Î´Ä¶­ÊÑ¿ô¤Î ̾Á°¤Ë¤¹¤ë WNNDEFAULT ¡Ö@LIBDIR¡×¤Çɸ½àÀßÄêɽ¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤òɽ¤»¤ë ¤è¤¦¤Ë¤¹¤ë IKIS Ⱦ³Ñ²¾Ì¾¤Î£±¥Ð¥¤¥ÈÌܤò0xA8¡Ê¥Ç¥Õ¥©¥ë¥È¤Ï0x8E¡Ë¤Ë¤¹¤ë ¤³¤Î¾ ¥Ç¥Ð¥Ã¥°»þ¤ÏɬÍפ˱þ¤¸¤Æ KDSP¡¢CHMDSP¤òdefine */ #ifdef MVUX # define IKIS #endif #include #ifdef BSD42 # include # define strchr index # define strrchr rindex #else # include #endif #include "rk_macros.h" #define ESCCHR '\033' #define BASEMX (26 + 10) #define REALFN 200 /* ɽ¤Î¥Õ¥ë¥Í¡¼¥à¤ÎºÇÂçĹ */ #ifdef KOREAN #define LINALL 30000 /* ÂбþɽÁ´Éô¤Î¹Ô¿ô¹ç·× */ #define SIZALL 300000 /* Âбþɽ¤ÎÆâÉôɽ¸½¤ÎºÇÂ祵¥¤¥º*/ #else #define LINALL 2000 /* ÂбþɽÁ´Éô¤Î¹Ô¿ô¹ç·× */ #define SIZALL 20000 /* Âбþɽ¤ÎÆâÉôɽ¸½¤ÎºÇÂ祵¥¤¥º¡¦ ɽ°ì¤Ä¤ÎÊÑ¿ô¤ÎÊѰèĹ¤Î¹ç·×¤È¤·¤Æ¤â»È¤Ã¤Æ¤ë */ #endif #define LINSIZ 1000 /* Âбþɽ¤Î°ì¹Ô¤ÎºÇÂ祵¥¤¥º */ #define TRMSIZ 500 /* Âбþɽ¤Î°ì¹àÌܤκÇÂ祵¥¤¥º¡¦ ¥â¡¼¥É̾¤ÎºÇĹ¤È¤·¤Æ¤â»È¤Ã¤Æ¤ë */ #define KBFSIZ 100 /* ËܽèÍý¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º */ #define DSPLIN 256 /* ¥Ç¥Ð¥Ã¥°ÍÑ */ #define OUTSIZ 200 /* ½ÐÎϥХåե¡¤Î¥µ¥¤¥º */ #define RSLMAX 20 /* ´Ø¿ô¤ÎÃͤȤ·¤ÆÊÖ¤ëʸ»úÎó¤ÎºÇĹ */ #define VARMAX 50 /* ɽ°ì¸Ä¤ÎÊÑ¿ô¸Ä¿ô */ #define VARTOT 2000 /* Á´É½¤ÎÊÑ¿ô¸Ä¿ô·× */ #define VARLEN 500 /* ÊÑ¿ô̾¤ÎŤµ¤Î·× */ #define FILNST 20 /* rk_modread.c¤Ç»È¤¦define */ #define HYOMAX 40 /* ÊÑ´¹Âбþɽ¤ÎºÇÂç¸Ä¿ô */ #define HYOMEI 500 /* ɽ̾¤Îʸ»ú¿ô·× */ #define PTHMAX 30 /* ¥µ¡¼¥Á¥Ñ¥¹¤ÎºÇÂç¸Ä¿ô */ #define PTHMEI 800 /* ¥µ¡¼¥Á¥Ñ¥¹Ì¾¤Îʸ»ú¿ô·× */ #define MODMAX 50 /* ¥â¡¼¥É¤Î¼ïÎà¿ô */ #define MODMEI 300 /* ¥â¡¼¥É¤ÎÁ´Ê¸»ú¿ô */ #define DMDMAX 40 /* ¥â¡¼¥Éɽ¼¨¤Î¼ïÎà¿ô */ #define DMDCHR 250 /* ¥â¡¼¥Éɽ¼¨¤ÎÁ´Ê¸»ú¿ô */ #define MDHMAX 2500 /* ¥â¡¼¥Éɽ¤ÎºÇÂ祵¥¤¥º */ /* ¥â¡¼¥Éɽ¤ÎºÇ½é¤Îlistscan¤Î»þ¤Ï¡¢¥¨¥é¡¼¤ò¹Íθ¤·¤Æ¡¢¥ê¥¹¥È1¸Ä¤Îbuffer¤Ë ɽ¤Î¥µ¥¤¥ºÊ¬¼è¤Ã¤Æ¤ª¤¯¡£*/ #define MDT1LN 200 /* ¥â¡¼¥ÉÀßÄê¥ê¥¹¥È1¸Ä¤ÎºÇÂçĹ */ #define NAIBMX 400 /* ¥â¡¼¥ÉÄêµÁɽ¤ÎÆâÉôɽ¸½¤ÎºÇÂ祵¥¤¥º */ /* Change KURI 200 --> 400 */ #define ARGMAX 2 /* ¾ò·ïȽÃÇ´Ø¿ô¤Î°ú¿ô¤ÎºÇÂç¸Ä¿ô */ /* ¥Ç¥£¥ì¥¯¥È¥ê̾¤Î¶èÀÚ¤ê¤Îdefine¡ÊUNIXÍѡˡ£UNIX°Ê³°¤Î´Ä¶­¤Ç»È¤¦¤Ë¤Ï ¤³¤ì¤È¡¢fixednamep()¤âÊѹ¹¤ÎɬÍפ¬¤¢¤ë¡Êreadmode()¤Îgetenv´Ø·¸¤âÌÞÏÀ¡Ë¡£*/ #define KUGIRI '/' /* ¥¨¥é¡¼½èÍýÍÑ */ #ifndef _WNN_SETJMP #define _WNN_SETJMP #include #endif wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/romkan/rk_read.c0000644000000000000000000011530207153676737020320 0ustar rootroot/* * $Id: rk_read.c,v 2.5.2.1 2000/08/04 05:37:29 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /*********************************************************************** rk_read.c 88. 6.11 ²þ Àµ 93.10.19 rk_main.c ¤ÎÉôÉÊ¡£ÊÑ´¹Âбþɽ¤ÎÆÉ¤ß¹þ¤ß¤òôÅö¡£ ***********************************************************************/ /* Version 3.0 */ #include "rk_multi.h" #include #include letter onescan(); char *ename(); extern letter *ltrgrow(), *ltrend(), letterpick(), *ltr1cut(); extern char *chrcat(), *strend(); static int termsscan(), evalandcpy(), eval1cpy(), partscan(), atermscan(), serfun(), hensrc_tourk(), blankpass(), modsrcL(), chkL_get_int(); static void ERRLIN(), ERHOPN(), ltr1tostr(), ERRHYO(), vchk(), rangeset(), de_bcksla(), listscan(), singleqscan(), doubleqscan(); static void readhyo(); static int evlis(); letter *rangekettei(); extern void BUGreport(), choosehyo(), readmode(); extern int ltrcmp(), ltrstrcmp(), readfnm(), fixednamep(); #define IHENSU (1 << 24) /* ÆâÉôɽ¸½¤Î¾å°Ì£±¥Ð¥¤¥È¤Ç¡¢ÊÑ¿ô¤òɽ¤¹ */ #define IKANSU (2 << 24) /* ¡· ´Ø¿ô¤òɽ¤¹ */ #define IMODNM (3 << 24) /* ¡· ¥â¡¼¥É̾¤òɽ¤¹ */ #define ENDOF_NestFileArea ((FILE *)~0) /** include¥Õ¥¡¥¤¥ë¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿³ÊǼ¥¨¥ê¥¢¤Î¥¨¥ó¥É¥Þ¡¼¥¯*/ /** °ì¹ÔÆÉ¤ß¹þ¤ß¡£°ì»ú¤âÆÉ¤ß¹þ¤Þ¤Ê¤¤¤¦¤Á¤ËEOF¤Ë¤Ä¤­¤¢¤¿¤Ã¤¿¤é0¤òÊÖ¤¹¡£ ⤷include¤ò¹Íθ¤·¤Æ¤¤¤ë¡£Âбþɽ¤Ë¤Ï¶õÇòʸ»ú°Ê³°¤Î¥³¥ó¥È¥í¡¼¥ëʸ»ú¤Ï À¸¤Ç¤Ïº®¤¸¤é¤Ê¤¤¤â¤Î¤È¤·¡¢º®¤¸¤Ã¤Æ¤¤¤¿¤é¥Á¥§¥Ã¥¯¤¹¤ë¡£*/ int readln(buf, cur_rk) uns_chr *buf; ARGS *cur_rk; { register uns_chr *p; register int c; if(NULL == *base){ *buf = '\0'; return(0); } p = buf; while(1){ while(EOF == (c = getc(*base))){ fclose(*base); if(NULL == *--base){ c = EOF; break; } } if(c == EOF || c == '\n') break; if(is_cntrl(c) && !isspace(c)){ sprintf(hcurread, "\\%03o", c); ERRLIN(21, cur_rk); } *p++ = c; } *p = '\0'; return(p != buf || c != EOF); } letter *memptr, *ltrbufptr, *hensumei, *hen_iki, *term, **henptr; letter *dummy; struct dat *datptr; struct hensuset { unsigned regdflg : 1; /* ´ûÅÐÏ¿¤ÎÊÑ¿ô¤òɽ¤¹ */ unsigned curlinflg : 1; /* ¸½ºß¹Ô¤Ë´û½Ð¤ÎÊÑ¿ô¤òɽ¤¹ */ unsigned constflg : 1; /* Äê¿ô¤È¤·¤ÆÄêµÁ¤µ¤ì¤¿¤³¤È¤òɽ¤¹ */ letter *name; letter *range; } *hentourkptr, *henorg; /** Í¿¤¨¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ê¤éÈó0¤òÊÖ¤¹ */ int isdir(fnm) char *fnm; { struct stat statbuf; /* return(stat(fnm, &statbuf) == 0 && (statbuf.st_mode & S_IFDIR)); */ return(stat(fnm, &statbuf) == 0 && ((statbuf.st_mode & S_IFMT) == S_IFDIR)); } /** name¤ÇÍ¿¤¨¤é¤ì¤¿Ì¾¤ÎÊÑ´¹Âбþɽ¤ò¥ª¡¼¥×¥ó¤¹¤ë¡£¸ÇÄê̾¤È¸«¤Ê¤µ¤ì¤Ê¤¤ ̾Á°¡Êfixednamep()»²¾È¡Ë¤ËÂФ·¤Æ¤Ï¡¢¥µ¡¼¥Á¥Ñ¥¹¤ò¸«¤ë¡£¤½¤Î¾ì¹ç¡¢ ¥ª¡¼¥×¥ó¤ËÀ®¸ù¤·¤¿¤é¡¢¥Ñ¥¹Ì¾¤ò *dirnamptr¤ËÆþ¤ì¤ÆÊ֤롣¤½¤Î¾¤Î¾ì¹ç¤Ï *dirnamptr¤Ë¶õʸ»úÎ󤬯þ¤ë¡£*errcod¤Ë¤Ï¼¡¤Î¥¨¥é¡¼¥³¡¼¥É¤¬Æþ¤ë¡£ Í¿¤¨¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î»þ1¡Ê¥µ¡¼¥Á¥Ñ¥¹¤òõ¤·¤¿»þ¤Ï3¡Ë¡¢ ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤»þ2¡ÊƱ4¡Ë¡£*/ FILE * trytoopen(name, dirnamptr, errptr, cur_rk) char *name, **dirnamptr; int *errptr; ARGS *cur_rk; { char **src, taio_fnm[REALFN]; FILE *opened; *dirnamptr = nulstr; *errptr = 0; if(fixednamep(name)){ if(isdir(name)){ *errptr = 1; return(NULL); } if(NULL == (opened = fopen(name, "r"))){ *errptr = 2; return(NULL); } if(flags & RK_VERBOS){ fprintf(stderr, "romkan: using Taio-hyo %s ...\r\n", name); } return(opened); } else { for(src = pathmeiorg; *src != NULL; src++){ strcpy(taio_fnm, (*dirnamptr = *src)); strcat(taio_fnm, name); if(isdir(taio_fnm)){ *errptr = 3; return(NULL); } if(NULL == (opened = fopen(taio_fnm, "r"))) continue; /* Now Taio-hyo found */ if(flags & RK_VERBOS) fprintf(stderr, "romkan: using Taio-hyo %s ...\r\n", taio_fnm); return(opened); } if(flags & RK_VERBOS){ /* Taio-hyo not found */ char *p, *q; fprintf(stderr, "no %s in", name); for(src = pathmeiorg; *src != NULL; src++){ fputc(' ', stderr); q = *src; if(*q == KUGIRI && *(q + 1) == '\0') q++; else q = strend(q); for(p = *src; p < q; p++) fputc(*p, stderr); } fprintf(stderr, ".\n"); } *dirnamptr = nulstr; *errptr = 4; return(NULL); } } /** ɽÁ´Éô¤ÎÆÉ¤ß¹þ¤ß */ void readdata(memory, data, hensudefhyo, modf, cur_rk) letter *memory; /* Âбþɽ¤ÎÆâÉôɽ¸½¤òÆþ¤ì¤ëÇÛÎó¤ÎÀèÆ¬ÈÖÃϤòÅϤµ¤ì¤ë */ struct dat *data; /* Âбþɽ¤Î¹Ô¤´¤È¤Î¥Ç¡¼¥¿¤òÆþ¤ì¤ëÇÛÎó¤ÎÈÖÃÏ */ letter **hensudefhyo; /* ÊÑ¿ôÄêµÁ¤Î¥Ç¡¼¥¿¤òÆþ¤ì¤ëÇÛÎó¤ÎÈÖÃÏ */ char *modf; /* ¥â¡¼¥ÉÄêµÁɽ¤Î̾Ëô¤Ï¤½¤Î¥Ñ¥¹Ì¾¤¬Æþ¤Ã¤Æ¤¤¤ë */ ARGS *cur_rk; { int i, j; char *hyomeibgn[HYOMAX]; /* ɽ¤Î̾¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÆþ¤ì¤ëÇÛÎó */ char hyomeimem_[HYOMEI]; /* ɽ¤Î̾¤Î¼ÂºÝ¤Îʸ»úÎó¤òÆþ¤ì¤ëÇÛÎó */ char *pathmeibgn[PTHMAX]; /* ¥µ¡¼¥Á¥Ñ¥¹Ì¾¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÆþ¤ì¤ëÇÛÎó */ char pathmeimem_[PTHMEI]; /* ¥µ¡¼¥Á¥Ñ¥¹Ì¾¤Î¼ÂºÝ¤Îʸ»úÎó¤òÆþ¤ì¤ëÇÛÎó */ char modfnm[REALFN]; /* ¥â¡¼¥Éɽ¤Î¥Õ¥¡¥¤¥ë̾¤ò¤³¤³¤Ø¥³¥Ô¤ë ¤Î¤Á¤Ë¤Ï¤½¤Î¥Ñ¥¹Ì¾¤¬Æþ¤ë */ memptr = memory; datptr = data; henptr = hensudefhyo; *(pathmeiptr = pathmeiorg = pathmeibgn) = NULL; *(pathmeimem = pathmeimem_) = '\0'; *(hyomeiptr = hyomeiorg = hyomeibgn) = NULL; *(hyomeimem = hyomeimem_) = '\0'; *(modmeiptr = modmeibgn) = NULL; *(modmeimem = modmeimem_) = '\0'; *(dspnamptr = dspnambgn) = NULL; *(dspcod = dspcod_) = '\0'; *(naibu = naibu_) = '\0'; strcpy(modfnm, modf); /* modfnm¤¬Í¿¤¨¤¿¥Õ¥¡¥¤¥ë̾¡£¥Ñ¥¹Ì¾¤À¤±Í¿¤¨¤é¤ì¤¿¤é¡¢¥Ç¥Õ¥©¥ë¥È¤Î ¥â¡¼¥Éɽ̾"mode"¤ò¤Ä¤Ê¤°¡£KUGIRI¡á¥Ç¥£¥ì¥¯¥È¥ê¤Î¶èÀÚ¤êʸ»ú */ if(*modfnm == '\0' || *(strend(modfnm)) == KUGIRI){ strcat(modfnm, "mode"); } else if(isdir(modfnm)){ chrcat(modfnm, KUGIRI); strcat(modfnm, "mode"); } curdir = nulstr; readmode(curfnm = modfnm, cur_rk); for(i = 0; hyomeiorg[i] != NULL; i++){ int err; for(j = 0; j < FILNST; j++) nestfile[j] = NULL; nestfile[FILNST - 1] = ENDOF_NestFileArea; base = nestfile + 1; *base = trytoopen(curfnm = hyomeiorg[i], &curdir, &err, cur_rk); if(err){ switch(err){ case 1: case 3: ERHOPN(1, cur_rk); case 2: case 4: ERHOPN(0, cur_rk); } } readhyo(i, cur_rk); } hyo_n[i] . data = NULL; choosehyo(cur_rk); } /** ¥Õ¥¡¥¤¥ë̾¤«¤é¥Ñ¥¹Ì¾¤ò½ü¤¤¤¿Éôʬ¤ÎÀèÆ¬¤òÊÖ¤¹¡£*/ char *ename(s) char *s; { char *p; p = strrchr(s, KUGIRI); return(p == NULL ? s : p + 1); } /** ¥Õ¥¡¥¤¥ë̾¤Î¥Á¥§¥Ã¥¯¡£ÀèÆ¬¡Ê¥Ñ¥¹Ì¾¤Ï½ü¤¯¡Ë¤¬'1'¡Á'3'¤Ç¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£ ÀµÅö¤Ê¤â¤Î¤Ê¤é1¡Á3¡ÊÁ°¡¦ËÜ¡¦¸å½èÍýɽ¤Î¶èÊ̤òɽ¤¹¡Ë¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤¤¤È 0¤òÊÖ¤¹¡£*/ int filnamchk(s) char *s; { char c; c = *(ename(s)) - '0'; return((1 <= c && c <= 3) ? c : 0); } /** linbuf¤ËÆþ¤Ã¤Æ¤¤¤ëunsigned char¤ÎÎó¤òletter¤ÎÎó¤Ë¤·¤Æltrbuf¤ËÆþ¤ì¤ë¡£ ¥¨¥ó¥É¥Þ¡¼¥¯¤ÏEOLTTR¤Ë¤Ê¤ë¡£flg¤¬Èó0¤Î»þ¤Ï¡¢ÀèÆ¬¤Î¶õÇòʸ»ú¤ÏÈô¤Ð¤¹¡£*/ void ustrtoltr(linbuf, ltrbuf, flg, cur_rk) uns_chr *linbuf; int flg; register letter *ltrbuf; ARGS *cur_rk; { register letter l; if(flg){ while(l = letterpick(&linbuf, cur_rk), is_eolsp(l)){ if(l == EOLTTR){ *ltrbuf = EOLTTR; return; } } *ltrbuf++ = l; } while((*ltrbuf++ = letterpick(&linbuf, cur_rk)) != EOLTTR); } /** letter¤ÎÎó¤òʸ»úÎó¤Ë¥³¥ó¥Ð¡¼¥È¡£Æó¤Ä¤Î¥Ý¥¤¥ó¥¿¤¬Æ±°ìÈÖÃϤǤ¢¤Ã¤Æ¤â ưºî¤òÊݾڤ¹¤ë¤³¤È¡£*/ void ltrtostr(ltrbuf, linbuf) char *linbuf; letter *ltrbuf; { letter l; while((l = *ltrbuf++) != EOLTTR) ltr1tostr(l, &linbuf); *linbuf = '\0'; } /** letter¤òʸ»úÎó¤Ë¥³¥ó¥Ð¡¼¥È */ static void ltr1tostr(l, sptr) char **sptr; letter l; { int i; for(i = 0; i < 3 && 0 == (l & (0xff000000)); i++) l <<= 8; for(; i < 4; i++){ *(*sptr)++ = (char)(l >> 24); l <<= 8; } } /** ÊÑ¿ô¤Î¡Ö¸½ºß¹Ô´û½Ð¥Õ¥é¥°¡×¤òÁ´¤Æ¥¯¥ê¥¢ */ void hen_useflgclr(hensu) struct hensuset *hensu; { for(; hensu -> name != NULL; hensu++) hensu -> curlinflg = 0; /* ¸½ºß¹Ô¤Ë̤½Ð */ } /** Âбþɽ°ì¤ÄÆÉ¤ß¹þ¤ß */ static void readhyo(n, cur_rk) int n; ARGS *cur_rk; { uns_chr linbuf[LINSIZ]; letter ltrbuf[LINSIZ], *lp; letter termbuf[SIZALL]; /* ¥¨¥é¡¼¤ò¹Íθ¤·¤Æ¡¢É½¤Î¥µ¥¤¥ºÊ¬¼è¤Ã¤Æ¤ª¤¯*/ letter dummybuf[TRMSIZ], hensumei_[VARLEN], hen_iki_[SIZALL]; struct hensuset hensu[VARMAX]; int m, hyosw, rsltyp[3]; hcurread = (char *)linbuf; /* ¥¨¥é¡¼½èÍýÍÑ */ ltrbufbgn = ltrbuf; *(hensumei = hensumei_) = EOLTTR; *(hen_iki = hen_iki_) = EOLTTR; (henorg = hentourkptr = hensu) -> name = NULL; dummy = dummybuf; hyo_n[n] . hensudef = henptr; hyo_n[n] . data = datptr; hyosw = hyoshu[n]; while(readln(linbuf, cur_rk)){ hen_useflgclr(henorg); ustrtoltr(linbuf, ltrbuf, 1, cur_rk); ltrbufptr = ltrbuf; for(m = 0; termsscan(<rbufptr, term = termbuf, 1, cur_rk); m++){ /* m¤Ï¡¢²¿ÈÖÌܤιàÌܤò¸«¤Æ¤¤¤ë¤«¤òɽ¤¹ */ if(*term == ';') break; /* Ãí¼á¹Ô */ if(m == 3) ERRLIN(15, cur_rk); if(m != 0 && rsltyp[0] == 4) ERRLIN(12, cur_rk); datptr -> code[m] = memptr; if((rsltyp[m] = evalandcpy(&term, m, cur_rk)) == 4){ if(m) ERRLIN(14, cur_rk); /* Àë¸À¤ÏºÇ½é¤Î¹àÌܤˤ·¤«Íè¤ì¤Ê¤¤¡£ funstr[]¤Îappear¥Õ¥é¥°¤Ç¤â¥Á¥§¥Ã¥¯¤·¤Æ¤¤¤ë¤¬ ¾­Íè¤Î¤¿¤á¤Ë°ì±þ¤³¤³¤Ë¤â¥Á¥§¥Ã¥¯¤òÆþ¤ì¤Æ¤ª¤¯¡£*/ } else { /* Àë¸À¤Î»þ¤Ë¤ÏÆâÉôɽ¸½¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï¿Ê¤á¤Ê¤¤ */ totail(memptr); memptr++; } } if(m != 0 && rsltyp[0] != 4){ for( /* m=? */ ; m < 3; m++){ datptr -> code[m] = nil; rsltyp[m] = -1; /* doesn't exist */ } datptr++; /* rsltyp: 0=ʸ»ú¹à 1=ʸ»úÎóÏ¢ 2=¥Ç¡¼¥¿Ï¢ 3=µ¡Ç½¹à 4=Àë¸À¹à -1=¸ºß¤»¤º */ switch(hyosw){ /* Á°¡¦¸å½èÍý¤Ï¡¢É½¤ÎÆâÍÆ¤ËÀ©¸Â¤¬¤¢¤ë¡£¤½¤ì¤ò¸¡ºº */ case 1: if(!(rsltyp[0] == 0 && rsltyp[1] == 0 && rsltyp[2] == -1 )) ERRLIN(17, cur_rk); break; case 2: if(rsltyp[1] == 3 && rsltyp[2] != -1) ERRLIN(19, cur_rk); break; case 3: if(!(rsltyp[0] == 0 && (rsltyp[1] == 0 || rsltyp[1] == 1) && rsltyp[2] == -1 )) ERRLIN(18, cur_rk); break; default: BUGreport(10); } } } (datptr++) -> code[0] = NULL; /* ÊÑ¿ôÅÐÏ¿¤³¤³¤Ç¤Þ¤È¤á¤Æ¤¹¤ë */ for(lp = hen_iki_; lp < hen_iki; ) *memptr++ = *lp++; for(hentourkptr = henorg; hentourkptr -> name != NULL; hentourkptr++){ if(hentourkptr -> regdflg == 0) ERRHYO(0, cur_rk); *henptr++ = memptr - (lp - hentourkptr -> range); } *henptr++ = NULL; /* ¤³¤³¤Ç fclose(*base); ¤ÏÉÔÍס£readlnÆâ¤Ç¤¹¤ó¤Ç¤¤¤ë */ } /** ÊÑ´¹Âбþɽ¤Î¹àÌܰì¤Ä¤ò¡¢²ò¼á¤·¤Æ¡¢ÆâÉô·Á¼°¤Î¥Ç¡¼¥¿¥¨¥ê¥¢¤Ë¥³¥Ô¡¼¤¹¤ë¡£ ÊÖ¤¹Ãͤϡ¢²ò¼á¤·¤¿¹àÌܤ¬Ê¸»ú¹à¤Ê¤é0¡¢¤½¤ì°Ê³°¤Çʸ»úÎóÏ¢¤Ê¤é1¡¢¤½¤ì°Ê³° ¤Ç¥Ç¡¼¥¿Ï¢¤Ê¤é2¡¢µ¡Ç½¹à¤Ê¤é3¡¢Àë¸À¹à¤Ê¤é4¡£¤½¤ì°Ê³°¤Ï¥¨¥é¡¼¡£*/ static int evalandcpy(socp, m, cur_rk) register letter **socp; /* ¹àÌܤؤΥݥ¤¥ó¥¿¡Ê¤Ø¤Î¥Ý¥¤¥ó¥¿¡Ë*/ int m; /* Âбþɽ¤Î²¿ÈÖÌܤιàÌܤò¸«¤Æ¤¤¤ë¤«¤òɽ¤¹¡£ÆþÎÏ¥³¡¼¥ÉÉô¤ò ¸«¤Æ¤¤¤ë¤È¤­¤Ï0¡¢½ÐÎÏ¥³¡¼¥ÉÉô¤Ê¤é1¡¢¥Ð¥Ã¥Õ¥¡»Ä¤êÉô¤Ê¤é2 */ ARGS *cur_rk; { #define TYPMAX 5 char exist[TYPMAX], total; /* exist¤Ï¡¢¤½¤ì¤¾¤ì¥¿¥¤¥×0¡Á4¤Î¹à¤Î½Ð¸½¤Î¥Õ¥é¥°¡Êeval1cpy()»²¾È¡Ë¡£ total¤ÏÁ´ÂΤȤ·¤Æ¤Î½Ð¸½¥Õ¥é¥°¡£¤É¤Á¤é¤â¡¢1=̤½Ð 2=°ì²ó½Ð ¤½¤Î¾¤Î »þ¤Ï²¼2¥Ó¥Ã¥È0 */ int type; #define TIME_0(flag) ((flag) == 1) #define TIME_1(flag) ((flag) == 2) #define TIME_n(flag) (((flag) & 3) == 0) total = 1; for(type = 0; type < TYPMAX; type++) exist[type] = 1; while(!is_eolsp(**socp)){ if(!(0 <= (type = eval1cpy(socp, m, 0, cur_rk)) && type < TYPMAX)) BUGreport(3); exist[type] <<= 1; total <<= 1; } if(TIME_0(total)) BUGreport(13); /* ¹àÌܤ¬¶õ¤Ê¤éevalandcpy¤Ï¼Â¹Ô¤·¤Ê¤¤È¦ */ if(!TIME_0(exist[3]) || !TIME_0(exist[4])){ if(TIME_n(total)) ERRLIN(9, cur_rk); return(type); /* 3Ëô¤Ï4¡£type¤¬ÃͤòÊÝ»ý¤·¤Æ¤¤¤ëȦ */ } if(TIME_1(total) && TIME_1(exist[0])) return(0); return(!TIME_0(exist[2]) ? 2 : 1); } /** Âбþɽ¤Î¹àÌܤÎÃæ¤Î¹à°ì¤Ä¤ò²ò¼á¤·¡¢ÆâÉô·Á¼°¤Î¥Ç¡¼¥¿¥¨¥ê¥¢¤Ë¥³¥Ô¡¼¤·¡¢ ¤½¤ì¤Î¥¿¥¤¥×¡Êʸ»ú¹à=0 ʸ»úÎó¹à=1 ÆÃ¼ì´Ø¿ô¹à=2 µ¡Ç½¹à=3 Àë¸À¹à=4¡Ë¤ò ÊÖ¤¹¡£flg¤¬Èó0¤Ê¤é¡¢ºÆµ¢Åª¤Ë¸Æ¤Ð¤ì¤¿¤³¤È¤ò°ÕÌ£¤·¡¢¤½¤Î¾ì¹ç¡¢ ¸½ºß¹Ô¤Ë̤½Ð¤ÎÊÑ¿ô¤ò¸¡½Ð¤·¤¿¤é¥¨¥é¡¼¡£¤Þ¤¿¡¢m¤¬Èó0¤Î¤È¤­¡ÊÆþÎÏ¥³¡¼¥ÉÉô °Ê³°¤Î½ê¤ò¸«¤Æ¤¤¤ë»þ¡Ë¤â¡¢¸½ºß¹Ô¤Ë̤½Ð¤ÎÊÑ¿ô¤ò¸¡½Ð¤·¤¿¤é¥¨¥é¡¼¡£*/ static int eval1cpy(socp, m, flg, cur_rk) letter **socp; /* flg°Ê³°¤Î°ú¿ô¤Î°ÕÌ£¤Ïevalandcpy¤ÈƱ¤¸ */ int m, flg; ARGS *cur_rk; { letter t1buf[TRMSIZ], *t1bufp; t1bufp = t1buf; *memptr = EOLTTR; switch(partscan(socp, t1bufp, cur_rk)){ case 1: /* ñʸ»ú */ memptr = ltrgrow(memptr, t1bufp); *memptr = EOLTTR; return(0); case 2: /* °úÍÑʸ»ú */ t1bufp++; *memptr++ = onescan(&t1bufp, dummy, cur_rk); *memptr = EOLTTR; return(0); case 3: /* °úÍÑʸ»úÎó */ t1bufp++; while(*t1bufp != '"'){ *memptr++ = onescan(&t1bufp, dummy, cur_rk); } *memptr = EOLTTR; return(1); case 0: /* ¥ê¥¹¥È */ return(evlis(m, &t1bufp, flg, cur_rk)); /* evlisÆâ¤Ç *memptr = EOLTTR; ¤ò¤·¤Æ¤¤¤ë¡£*/ default: BUGreport(4); return(-1); /*NOTREACHED*/ } /*NOTREACHED*/ } #define bitchk(x, n) ((x) & (1 << (n))) #define get_ltr(lp) (*(lp)++) #define unget_ltr(l, lp) (*--(lp) = (l)) /** global¤Ê¥Ý¥¤¥ó¥¿¤«¤é»Ø¤µ¤ì¤Æ¤¤¤ëletterÎ󤫤é°ìʸ»ú¼è¤Ã¤Æ¤¯¤ë¡£*/ letter get1ltr(cur_rk) ARGS *cur_rk; { return(get_ltr(lptr)); } letter unget1ltr(l, cur_rk) letter l; ARGS *cur_rk; { return(unget_ltr(l, lptr)); } int int_get1ltr(cur_rk) ARGS *cur_rk; { return((int)(get1ltr(cur_rk))); } int int_unget1ltr(c, cur_rk) letter c; ARGS *cur_rk; { return((int)(unget1ltr((letter) c, cur_rk))); } /** ±ø¤¤¤³¤È¤³¤Î¾å¤Ê¤·¡ª¤Ê¤¼´Ø¿ô¤Î·¿¤Îcast¤¬¤Ç¤­¤Ê¤¤¤Î¡© ¡Ö(int ()) get1ltr¡×¤È½ñ¤­¤¿¤¤¡ª */ /** include¥Õ¥¡¥¤¥ë̾¤ÎletterÎó¤òstring¤Ë¼è¤ê½Ð¤¹ºî¶È¤ò¡¢letterÎó¤Î½ª¤ï¤ê ¤Þ¤Ç³¤±¤ë¡£flg & 01¤¬Èó0¤Ê¤é¡¢'/'¤Ç¤â½ªÎ»¡£*/ letter getfrom_dblq(socp, destp, flg, cur_rk) letter **socp; char **destp; int flg; ARGS *cur_rk; { letter l; while(**socp != EOLTTR && !(flg & 01 && **socp == KUGIRI)){ if (**socp == '\\') *(*destp)++ = '\\'; l = onescan(socp, dummy, cur_rk); ltr1tostr(l, destp); } *(*destp)++ = '\0'; return(**socp); } int getfrom_lptr(sptr, flg, cur_rk) char **sptr; int flg; ARGS *cur_rk; { return((int)getfrom_dblq(&lptr, sptr, flg, cur_rk)); } /** ¥ê¥¹¥È¤ò²ò¼á¤·¤ÆÆâÉôɽ¸½¤Ë¤¹¤ë¡£ÊÖÃͤϡ¢¤½¤Î¥ê¥¹¥È¤Î¥¿¥¤¥×¤òɽ¤¹¿ô¡£ ʸ»úÊÑ¿ô¹àËô¤Ïʸ»ú´Ø¿ô¹à:0 ʸ»úÎó´Ø¿ô¹à:1 ÆÃ¼ì´Ø¿ô¹à:2 µ¡Ç½¹à:3 Àë¸À¹à:4 */ static int evlis(m, socp, flg, cur_rk) letter **socp; /* °ú¿ô¤Î°ÕÌ£¤Ïeval1cpy¤ò»²¾È */ int m, flg; ARGS *cur_rk; { int fnnum, hennum, i; letter t1buf[TRMSIZ]; (*socp)++; /* '('¤ò¥¹¥­¥Ã¥× */ atermscan(socp, t1buf, 3, cur_rk); fnnum = serfun(t1buf); if(fnnum != -1 && !bitchk(func[fnnum] . appear, m)) ERRLIN(14, cur_rk); /* m¤ÎÃͤˤè¤Ã¤Æ¡¢¸½¤ì¤Æ¤Ï¤¤¤±¤Ê¤¤½ê¤Ø¤Î½Ð¸½¤«¤É¤¦¤«¸«¤Æ¤¤¤ë¡£*/ switch(fnnum){ /* default¤Î½ê°Ê³°¤Ï func[fnnum].argnum¤ò»È¤Ã¤Æ¤Ê¤¤ */ case -1: /* ÊÑ¿ô */ vchk(t1buf, cur_rk); atermscan(socp, dummy, 2, cur_rk); /* ¤¢¤ì¤ÐERR */ hennum = hensrc_tourk(t1buf, ((m==0 && !flg)? 0 : 1), cur_rk); *memptr++ = (henorg[hennum] . constflg ? *(henorg[hennum].range) : hennum|IHENSU); break; case 0: /* fn No.0 defvar */ atermscan(socp, t1buf, 3, cur_rk); if(*t1buf == '('){ letter *soc2, t1buf2[TRMSIZ], t1buf3[TRMSIZ]; letter *common_hen; atermscan(socp, t1buf3, 3, cur_rk); soc2 = t1buf + 1; /* skip '(' */ atermscan(&soc2, t1buf2, 3, cur_rk); vchk(t1buf2, cur_rk); if(-1 != serfun(t1buf2)) ERRLIN(11, cur_rk); hennum = hensrc_tourk(t1buf2, 2, cur_rk); common_hen = rangekettei(hennum, t1buf3, cur_rk); while(atermscan(&soc2, t1buf2, 0, cur_rk)){ vchk(t1buf2, cur_rk); if(-1 != serfun(t1buf2)) ERRLIN(11, cur_rk); hennum = hensrc_tourk(t1buf2, 2, cur_rk); rangeset(hennum, common_hen, cur_rk); } } else { vchk(t1buf, cur_rk); if(-1 != serfun(t1buf)) ERRLIN(11, cur_rk); hennum = hensrc_tourk(t1buf, 2, cur_rk); /* defvar¡¦defconst¤ÎÊÑ¿ô̾¤Î½ÅÊ£¤òÈò¤±¤ë¤¿¤á */ atermscan(socp, t1buf, 3, cur_rk); rangekettei(hennum, t1buf, cur_rk); } atermscan(socp, dummy, 2, cur_rk); break; case 36: /* fn No.36 defconst */ atermscan(socp, t1buf, 3, cur_rk); vchk(t1buf, cur_rk); if(-1 != serfun(t1buf)) ERRLIN(11, cur_rk); hennum = hensrc_tourk(t1buf, 6, cur_rk); /* defvar¡¦defconst¤ÎÊÑ¿ô̾½ÅÊ£¤òÈò¤±¤ë¤¿¤á */ rangeset(hennum, hen_iki, cur_rk); blankpass(socp, 1, cur_rk); if(*(*socp)++ != '\'') ERRLIN(8, cur_rk); *hen_iki++ = onescan(socp, dummy, cur_rk); (*socp)++; /*¡Ö'¡×¤¬ÊĤ¸¤Æ¤¤¤ë¤³¤È¤Î¸¡ºº¤ÏºÑ¤ó¤Ç¤¤¤ë*/ *hen_iki++ = EOLTTR; /* needed? */ *hen_iki = EOLTTR; atermscan(socp, dummy, 2, cur_rk); break; case 1: /* fn No.1 include */ { char fnmtmparea[REALFN], *s, *dirnamptr; int dummyc = 0, err; blankpass(socp, 1, cur_rk); if(3 != partscan(socp, t1buf, cur_rk)) ERRLIN(22, cur_rk); atermscan(socp, dummy, 2, cur_rk); /* ;ʬ¤Ë¤¢¤ì¤ÐERR */ ltr1cut(lptr = t1buf + 1); *(s = fnmtmparea) = '\0'; err = readfnm(int_get1ltr, int_unget1ltr, getfrom_lptr, &s, &dummyc, cur_rk); if(err){ hcurread = s; switch(err){ case 1: case 3: ERRLIN(25, cur_rk); case 2: ERRLIN(26, cur_rk); case 4: ERRLIN(27, cur_rk); } } de_bcksla(fnmtmparea, fnmtmparea); if(*++base == ENDOF_NestFileArea){ base--; ERRLIN(23, cur_rk); } *base= trytoopen(fnmtmparea, &dirnamptr,&err, cur_rk); if(err){ switch(err){ case 1: case 3: case 2: case 4: base--; ERRLIN(24, cur_rk); } } } break; /* ¥â¡¼¥É̾°ì¤Ä¤ò°ú¿ô¤Ë¼è¤ë¤â¤Î */ case 4: /* fn No.4¡Á6 off,on,switch */ case 5: case 6: case 20: /* fn No.20,21 if,unless */ case 21: *memptr++ = fnnum | IKANSU; atermscan(socp, t1buf, 3, cur_rk); *memptr++ = modsrcL(t1buf, cur_rk) | IMODNM; atermscan(socp, t1buf, 2, cur_rk); break; /* ¥â¡¼¥É̾¤Èʸ»ú °ì¤Ä¤º¤Ä¤ò°ú¿ô¤Ë¼è¤ë¤â¤Î */ case 37: /* fn No.37¡Á43 setmode¤Ê¤É */ case 38: case 39: case 40: case 41: case 42: case 43: { int err, n; modetyp stat; *memptr++ = fnnum | IKANSU; atermscan(socp, t1buf, 3, cur_rk); *memptr++ = (n = modsrcL(t1buf, cur_rk))| IMODNM; atermscan(socp, t1buf, 3, cur_rk); err = chkL_get_int(t1buf, &stat, modesw[n] . moderng); if(err != 0) ERRLIN(29, cur_rk); *memptr++ = stat; atermscan(socp, t1buf, 2, cur_rk); break; } /* ÉáÄ̡ʰú¿ô¤ò¼è¤é¤Ê¤¤¤â¤Î¤ò´Þ¤à¡Ë */ default: /* toupper,tolower¡Ä */ *memptr++ = fnnum | IKANSU; *memptr = EOLTTR; for(i = 0; i < func[fnnum] . argnum; i++){ blankpass(socp, 1, cur_rk); if(eval1cpy(socp, m, 1, cur_rk) != 0) ERRLIN(13, cur_rk); } atermscan(socp, dummy, 2, cur_rk); /* ;ʬ¤Ë¤¢¤ì¤ÐERR */ break; } *memptr = EOLTTR; return(fnnum == -1 ? 0 : func[fnnum] . fntype); } /** ʸ»úÎóÃæ¤Î¡Ö\¡×¤òÈ´¤¯ */ static void de_bcksla(s, r) char *s, *r; { for(; *s; *r++ = *s++) if(*s == '\\') s++; *r = '\0'; } /** defvar¤ÎÂèÆó°ú¿ô¡Êshiki¤ËÆþ¤ë¡Ë¤ò²ò¼á¤·¤Æ¡¢¤½¤ÎÊÑ¿ô¤ÎÊѰè¤ò·èÄꤹ¤ë¡£ ÊÑ¿ôÎó¤ÎºÇ¸å¤Ë¥¨¥ó¥É¥Þ¡¼¥¯¤â¤Á¤ã¤ó¤ÈÆþ¤ë¡£ÊÖÃͤϡ¢ÊѰè¤ò³ÊǼ¤·¤¿ ½ê¤Ø¤Î¥Ý¥¤¥ó¥¿¡£*/ letter * rangekettei(num, shiki, cur_rk) letter *shiki; int num; /* ÊѰè¤ò·èÄꤷ¤Ä¤Ä¤¢¤ëÊÑ¿ô¤ÎÆâÉôÈÖ¹æ */ ARGS *cur_rk; { letter hyoukabuf[TRMSIZ]; rangeset(num, hen_iki, cur_rk); *hen_iki = EOLTTR; if(*shiki++ != '(') ERRLIN(8, cur_rk); atermscan(&shiki, hyoukabuf, 1, cur_rk); if(!ltrstrcmp(hyoukabuf, "all")){ *hen_iki++ = VARRNG; *hen_iki++ = 0; *hen_iki++ = LTRHUG; /* ÊѰè¤ÏÁ´Ê¸»ú */ *hen_iki++ = EOLTTR; *hen_iki = EOLTTR; atermscan(&shiki, dummy, 2, cur_rk); /* ;ʬ¤Ë¤¢¤ì¤ÐERR */ } else if(!ltrstrcmp(hyoukabuf, "between")){ int i; *hen_iki++ = VARRNG; while(blankpass(&shiki, 1, cur_rk), *shiki != ')'){ for(i = 1; i <= 2; i++){ switch(*shiki){ case '\'': shiki++; *hen_iki++ = onescan(&shiki, dummy, cur_rk); shiki++; break; case ')': case '"': case '(': ERRLIN(8, cur_rk); default: *hen_iki++ = *shiki++; } if(i < 2){ if(!is_eolsp(*shiki)) ERRLIN(8, cur_rk); blankpass(&shiki, 1, cur_rk); } } } *hen_iki++ = EOLTTR; *hen_iki = EOLTTR; } else if(!ltrstrcmp(hyoukabuf, "list")){ while(blankpass(&shiki, 1, cur_rk), *shiki != ')'){ switch(*shiki){ case '"': case '(': ERRLIN(8, cur_rk); case '\'': shiki++; *hen_iki++ = onescan(&shiki, dummy, cur_rk); shiki++; /* ËÜÅö¤Ë¡Ö'¡×¤¬ÊĤ¸¤Æ¤¤¤ë¤« ¤É¤¦¤«¤Î¸¡ºº¤Ï¤â¤¦ºÑ¤ó¤Ç¤¤¤ë¡£*/ break; default: *hen_iki++ = *shiki++; } if(!is_eolsp(*shiki)) ERRLIN(8, cur_rk); } *hen_iki++ = EOLTTR; *hen_iki = EOLTTR; } else { ERRLIN(8, cur_rk); /* ¾­Íè¤Ï¤³¤Î¾¤Î¹½Ê¸¤âµö¤¹Í½Äê¤Ç¤¢¤Ã¤¿ */ } return(henorg[num] . range); } /** numÈÖÌܤÎÊÑ¿ô¤ÎÊѰè¤ò»Ø¤¹¤Ù¤­¥Ý¥¤¥ó¥¿¤Î»Ø¤·Àè¤ò·èÄꤷ¡¢¤½¤ÎÊÑ¿ô¤ò ´ûÅÐÏ¿¾õÂ֤ˤ¹¤ë¡£*/ static void rangeset(num, range, cur_rk) letter *range; /* ÊѰè¤ÎÆþ¤ë¾ì½ê¤Î¥Ý¥¤¥ó¥¿ */ int num; ARGS *cur_rk; { henorg[num] . range = range; henorg[num] . regdflg = 1; } /** name¤Ç»ØÄꤵ¤ì¤¿Ì¾¤ÎÊÑ¿ô¤òõ¤·¡¢¤Ê¤±¤ì¤ÐÅÐÏ¿¡£ÊÑ¿ô̾¤ÎºÇ¸å¤Ë ¥¨¥ó¥É¥Þ¡¼¥¯¤â¤Á¤ã¤ó¤ÈÆþ¤ë¡£ flg & 01¤¬Èó0¤Î»þ¡¢¤½¤Î̾¤ÎÊÑ¿ô¤¬¸½ºß¹Ô¤Ë̤½Ð¤Ê¤é¥¨¥é¡¼¡Êconst¤È¤·¤Æ ´ûÅÐÏ¿¤Î»þ¤ò½ü¤¯¡Ë¡£¤Þ¤¿ flg & 02¤¬Èó0¤Î»þ¡¢¤½¤Î̾¤ÎÊÑ¿ô¤¬´ûÄêµÁ¤Ê¤é ¥¨¥é¡¼¡Êdefvar¤Î½ÅÊ£¥Á¥§¥Ã¥¯Íѡˡ£flg & 04¤¬Èó0¤Ê¤éconst¤È¤·¤ÆÅÐÏ¿¡£*/ static int hensrc_tourk(name, flg, cur_rk) letter *name; int flg; ARGS *cur_rk; { int i; for(i = 0; henorg[i] . name != NULL; i++){ if(ltrcmp(henorg[i] . name, name)) continue; /* found */ if(flg & 04) ERRLIN(28, cur_rk); if(flg & 02 && henorg[i] . regdflg != 0) ERRLIN(10, cur_rk); if(flg & 01 && henorg[i] . curlinflg == 0 && henorg[i] . constflg == 0) ERRLIN(5, cur_rk); henorg[i] . curlinflg = 1; return(i); } if(henorg + i != hentourkptr) BUGreport(5); /* ¤³¤³¤ØÍ褿¤È¤¤¤¦¤³¤È¤Ï¡¢½é½Ð¤ÎÊÑ¿ô¤È¤¤¤¦¤³¤È¡£ÅöÁ³¡¢flg & 01¤¬ Èó0¤Ê¤é¥¨¥é¡¼¡£*/ if(flg & 01) ERRLIN(5, cur_rk); hentourkptr -> name = hensumei; hentourkptr -> curlinflg = 1; hentourkptr -> regdflg = 0; /* ½é½Ð¤À¤«¤érange¤Îdef¤Ï̤¤À¤ÎȦ */ hentourkptr -> constflg = ((flg & 04) != 0); (++hentourkptr) -> name = NULL; hensumei = ltrgrow(hensumei, name); *++hensumei = EOLTTR; return(i); } /** ÁȤ߹þ¤ß´Ø¿ô¡¦µ¡Ç½Ì¾¤ËÂФ·¤Æ¤Ï¤½¤ÎÈÖ¹æ¤ò¡¢¤½¤¦¤Ç¤Ê¤¤¤â¤Î¤Ê¤é-1¤òÊÖ¤¹ */ static int serfun(lp) register letter *lp; /* ´Ø¿ô¡¦µ¡Ç½Ì¾¤â¤·¤¯¤ÏÊÑ¿ô̾ */ { register int i; for(i = 0; func[i] . fnname != NULL; i++){ if(! ltrstrcmp(lp, func[i] . fnname)) return(i); } return(-1); } /** ÊÑ¿ô¤Î̾Á°¤Î¥Á¥§¥Ã¥¯ ¤ª¤«¤·¤¤¤È¥¨¥é¡¼ */ static void vchk(lp, cur_rk) letter *lp; ARGS *cur_rk; { if(is_digit(*lp)) ERRLIN(3, cur_rk); for(; *lp != EOLTTR; lp++){ /* if(is_lower(*lp)) *lp = to_upper(*lp); */ if(!is_alnum(*lp) && *lp != '_') ERRLIN(3, cur_rk); } } /** °ì¹àÌܤò¼è¤ê½Ð¤¹¡£¼è¤ê½Ð¤·¤ËÀ®¸ù¤¹¤ë¤È1¤òÊÖ¤¹¡£flg¤¬Èó0¤Î»þ¤Ï¡¢')'¤¬ ¸«¤Ä¤«¤ë¤È¥¨¥é¡¼¡¢';'¤Ï¤½¤ì¤À¤±¤Ç°ì¹àÌܰ·¤¤¡£*/ static int termsscan(socp, dest, flg, cur_rk) register letter **socp, *dest; /* socp¤Î»Ø¤·¤Æ¤¤¤ë¥Ý¥¤¥ó¥¿¤¬»Ø¤·¤Æ¤¤¤ë½ê¤«¤é¼è¤ê½Ð¤·¤Ædest¤ËÆþ¤ì¤ë¡£ ¤½¤Î¸å¡¢socp¤¬»Ø¤·¤Æ¤¤¤ë¥Ý¥¤¥ó¥¿¤ò¿Ê¤á¤ë¡£¤³¤Î¥Õ¥¡¥¤¥ë¤Î **scan() ¤È¤¤¤¦´Ø¿ô¤ÏÁ´¤Æ¤½¤¦¤Ê¤Ã¤Æ¤ë¡£*/ int flg; ARGS *cur_rk; { letter *bgn; bgn = dest; if(blankpass(socp, 0, cur_rk) == 0){ if(flg && **socp == ';'){ *dest++ = *(*socp)++; } else while(!is_eolsp(**socp)){ if(**socp == ')'){ if(flg) ERRLIN(0, cur_rk); break; } else { partscan(socp, dest, cur_rk); totail(dest); } } } *dest = EOLTTR; return(bgn != dest); } /** ¥ê¥¹¥È°ì¤Ä¤«¡¢Ã±½ã¹à¤Î°ì¤Þ¤È¤Þ¤ê¤ò¼è¤ê½Ð¤¹¡£À®¸ù¤·¤¿¤é1¤òÊÖ¤¹¡£ flg¤¬1¤Î¤È¤­¡¢')'¤¬¸«¤Ä¤«¤ë¤È¥¨¥é¡¼¡£ flg¤¬2¤Î¤È¤­¡¢¼è¤ê½Ð¤·¤ËÀ®¸ù¤·¤¿¤é¥¨¥é¡¼¡£ flg¤¬3¤Î¤È¤­¡¢¼è¤ê½Ð¤·¤Ë¼ºÇÔ¤·¤¿¤é¥¨¥é¡¼¡£*/ static int atermscan(socp, dest, flg, cur_rk) register letter **socp, *dest; int flg; ARGS *cur_rk; { letter *bgn; int found; bgn = dest; if(blankpass(socp, 0, cur_rk) == 0){ if(**socp == '('){ listscan(socp, dest, cur_rk); totail(dest); } else { while(!is_eolsp(**socp) && **socp != '('){ if(**socp == ')'){ if(flg == 1) ERRLIN(0, cur_rk); break; } else { partscan(socp, dest, cur_rk); totail(dest); } } } } *dest = EOLTTR; found = (bgn != dest); if((!found && (flg == 3)) || (found && (flg == 2))) ERRLIN(7, cur_rk); return(found); } /** ¹à°ì¤Ä¤ò¼è¤ê½Ð¤¹¡£¼è¤ê½Ð¤·¤¿¤â¤Î¤¬¥ê¥¹¥È¤Ê¤éÊÖÃͤÏ0¡¢Ã±Ê¸»ú¤Ê¤é1¡¢ °úÍÑʸ»ú¤Ê¤é2¡¢°úÍÑʸ»úÎó¤Ê¤é3¡£*/ static int partscan(socp, dest, cur_rk) register letter **socp, *dest; ARGS *cur_rk; { switch(**socp){ case '(': listscan(socp, dest, cur_rk); return(0); case '\'': singleqscan(socp, dest, cur_rk); return(2); case '"': doubleqscan(socp, dest, cur_rk); return(3); default: *dest++ = *(*socp)++; *dest = EOLTTR; return(1); } } /** ¥·¥ó¥°¥ë¥¯¥©¡¼¥Èɽ¸½°ì¤Ä¤ò¼è¤ê½Ð¤¹¡£*/ static void singleqscan(socp, dest, cur_rk) letter **socp, *dest; ARGS *cur_rk; { *dest++ = *(*socp)++; onescan(socp, dest, cur_rk); totail(dest); if((*dest++ = *(*socp)++) != '\'') ERRLIN(1, cur_rk); *dest = EOLTTR; } /** ¥À¥Ö¥ë¥¯¥©¡¼¥Èɽ¸½°ì¤Ä¤ò¼è¤ê½Ð¤¹¡£*/ static void doubleqscan(socp, dest, cur_rk) letter **socp, *dest; ARGS *cur_rk; { *dest++ = *(*socp)++; while(**socp != '"'){ if(**socp == EOLTTR) ERRLIN(1, cur_rk); onescan(socp, dest, cur_rk); totail(dest); } *dest++ = *(*socp)++; *dest = EOLTTR; } /** 8¡¦10¡¦16¿Ê¥³¡¼¥ÉÍÑ¥­¥ã¥é¥¯¥¿¤ò¼ÂºÝ¤Î¥³¡¼¥É¤Ëľ¤¹¡£ÆþÎϤΥÁ¥§¥Ã¥¯¤Ï ¤»¤º¡¢±Ñʸ»ú¤È¿ô»ú°Ê³°¤ÎÆþÎϤËÂФ·¤Æ¤Ïñ¤Ë0¤òÊÖ¤¹¡£*/ int ltov(l) letter l; { if(is_upper(l)) return(l - 'A' + 10); if(is_lower(l)) return(l - 'a' + 10); if(is_digit(l)) return(l - '0'); else return(0); } /** ltov¤ÎµÕ */ letter vtol(l) letter l; { if(BASEMX <= l) return('*'); return(l + (l < 10 ? '0' : 'A' - 10)); } /** ¥·¥ó¥°¥ë¡¦¥À¥Ö¥ë¥¯¥©¡¼¥È¤ÎÃæ¤Ç¤Î°ìʸ»ú¼è¤ê½Ð¤·¡£ ¡Ö^¡×¤Ë¤è¤ë¥³¥ó¥È¥í¡¼¥ë¥³¡¼¥Éɽ¸½¡¢¡Ö\¡×¤Ë¤è¤ë8¡¦10¡¦16¿Êɽ¸½¤Ë¤â Âбþ¡£¡Ö\¡×ɽ¸½¤Ï¡¢¡Ö\¡ÎoËô¤ÏdËô¤Ïx¡Ï¿ô»ú¤ÎʤӡÎ;¡Ï¡×¤Ç¤¢¤ë¡£*/ letter onescan(socp, dest, cur_rk) letter **socp, *dest; ARGS *cur_rk; { letter l, realcode; int digflg; switch(realcode = *dest++ = *(*socp)++){ case '^': if(!(' ' <= (l = *(*socp)++) && l < '\177')) ERRLIN(2, cur_rk); realcode = ((*dest++ = l) == '?' ? '\177' : l & 0x1f); break; case '\\': digflg = 0; switch(**socp){ case 'n': *dest++ = *(*socp)++; realcode = '\n'; break; case 't': *dest++ = *(*socp)++; realcode = '\t'; break; case 'b': *dest++ = *(*socp)++; realcode = '\b'; break; case 'r': *dest++ = *(*socp)++; realcode = '\r'; break; case 'f': *dest++ = *(*socp)++; realcode = '\f'; break; case 'e': case 'E': *dest++ = *(*socp)++; realcode=ESCCHR; break; case 'o': *dest++ = *(*socp)++; for(realcode = 0; is_octal(**socp);){ digflg = 1; realcode <<= 3; realcode += ltov (*dest++ = *(*socp)++); } if(!digflg) ERRLIN(2, cur_rk); if(**socp== ';') *dest++ = *(*socp)++; break; case 'x': *dest++ = *(*socp)++; for(realcode = 0; is_xdigit(**socp);){ digflg = 1; realcode <<= 4; realcode += ltov (*dest++ = *(*socp)++); } if(!digflg) ERRLIN(2, cur_rk); if(**socp== ';') *dest++ = *(*socp)++; break; case 'd': *dest++ = *(*socp)++; for(realcode = 0; is_digit(**socp);){ digflg = 1; realcode *= 10; realcode += ltov (*dest++ = *(*socp)++); } if(!digflg) ERRLIN(2, cur_rk); if(**socp== ';') *dest++ = *(*socp)++; break; default: if(is_octal(**socp)){ for(realcode = 0; is_octal(**socp);){ realcode <<= 3; realcode += ltov( *dest++ = *(*socp)++); } if(**socp == ';') *dest++ = *(*socp)++; } else { realcode= *dest++= *(*socp)++; } } break; default: ; } *dest = EOLTTR; return(realcode); } /** letter¤ÎÎó¤ÎÀèÆ¬¤Ë¤¢¤ë¶õÇò¤ò¥¹¥­¥Ã¥×¤¹¤ë¡£ ¹ÔËö¤Ë㤷¤¿¤é¡¢flg¤¬0¤Î¤È¤­¤Ï1¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤¤¤È¥¨¥é¡¼¡£*/ static int blankpass(pptr, flg, cur_rk) register letter **pptr; /* letter¤ÎÎó¤Î¥Ý¥¤¥ó¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¡£¤³¤ì¤¬»Ø¤·¤Æ¤¤¤ë¤â¤Î¤ò¿Ê¤á¤ë */ int flg; ARGS *cur_rk; { while(is_eolsp(**pptr)){ if(EOLTTR == **pptr){ if(flg) ERRLIN(4, cur_rk); return(1); } (*pptr)++; } return(0); } /** ¥ê¥¹¥È°ì¸Ä¼è¤ê½Ð¤· */ static void listscan(socp, dest, cur_rk) register letter **socp, *dest; ARGS *cur_rk; { int eofreach; *dest++ = *(*socp)++; /* = '(' */ *dest++ = ' '; while(eofreach = blankpass(socp, 0, cur_rk), **socp != ')'){ if(eofreach){ if(! readln((uns_chr *)hcurread, cur_rk)) ERRLIN(20, cur_rk); ustrtoltr((uns_chr *)hcurread, (*socp= ltrbufbgn), 1, cur_rk); /* list¤ÎÃæ¤Ç¹Ô¤¬ÀÚ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢°ì¹ÔÄÉ²ÃÆÉ¤ß¹þ¤ß¤ò ¤¹¤ë¡£uns_chrÍѤΥХåե¡¤â¡¢letterÍѤΤâ¤Î¤â¡¢ °ÊÁ°¤Îʪ¤òÀèÆ¬¤«¤éºÆÍøÍѤ·¤Æ¤¤¤ë¤Î¤ÇÃí°Õ¡£¤Þ¤¿¡¢ ¥¨¥é¡¼¤¬µ¯¤­¤¿¾ì¹ç¡¢ ¥¨¥é¡¼¤Î°ÌÃ֤ˤ«¤«¤ï¤é¤º¡¢ ¸½ºß¹Ô¤È¤·¤ÆÉ½¼¨¤µ¤ì¤ë¤Î¤Ï¡¢ºÇ¸å¤ËÆÉ¤Þ¤ì¤¿¹Ô¤Î¤ß*/ } else { termsscan(socp, dest, 0, cur_rk); totail(dest); *dest++ = ' '; } } *dest++ = *(*socp)++; /* = ')' */ *dest = EOLTTR; } /** lp¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥É̾¤òõ¤¹¡£¸«¤Ä¤«¤é¤Ê¤¤¤È¥¨¥é¡¼ */ static int modsrcL(lp, cur_rk) letter *lp; ARGS *cur_rk; { int n; for(n = 0; modmeibgn[n] != NULL; n++) if(!ltrstrcmp(lp, modmeibgn[n])) return(n); ERRLIN(16, cur_rk); /*NOTREACHED*/ return(-1); } /** chk_get_int¡Êrk_modread.c¡Ë¤ÎletterÈÇ */ static int chkL_get_int(lp, ip, range) letter *lp; modetyp *ip; modetyp range; { int sgn = 1; modetyp out; if(*lp == '-'){ lp++; sgn = -1; } for(out = 0; *lp != EOLTTR; lp++){ if(!is_digit(*lp)) return(-1); #if defined(UX386) || defined(sun386) out = out * 10; #else out *= 10; #endif out += ltov(*lp); } if(range != 0) out %= range; if(sgn == -1 && out != 0) out = range - out; *ip = out; return(0); } /** ¤³¤ÎÀè¤Ï¡¢É½ÆÉ¤ß¹þ¤ß¤Ç¥¨¥é¤Ã¤¿»þ¤Ë·Ù¹ð¤¹¤ë¥ë¡¼¥Á¥ó¡£n¤Ï¥¨¥é¡¼¥³¡¼¥É¡£ ¤Þ¤¿¤³¤ì¤é¤ÏÁ´¤Æ¡¢romkan_init¤Î¥¨¥é¡¼¥³¡¼¥É¤È¤·¤Æ¡¢longjmp·Ðͳ¤Ç 1¤òÊÖ¤¹¡£*/ void ERMOPN(n, cur_rk) /* ¥â¡¼¥ÉÄêµÁɽ¤¬¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤ */ unsigned int n; ARGS *cur_rk; { static char *ermes[] = { /* 0 */ "Can't open Mode-hyo", "Unprintable error" }; if(n >= numberof(ermes)) n = 1; fprintf(stderr, "\r\nMode-hyo %s ---\r\n", curfnm); fprintf(stderr, "%d: %s.\r\n", n, ermes[n]); longjmp(env0, 1); } static void ERHOPN(n, cur_rk) /* ÊÑ´¹Âбþɽ¤¬¥ª¡¼¥×¥ó¤Ç¤­¤Ê¤¤ */ unsigned int n; ARGS *cur_rk; { static char *ermes[] = { /* 0 */ "Can't open Taio-hyo", "Is a directory", "Unprintable error" }; if(n >= numberof(ermes)) n = 2; fprintf(stderr, "\r\nTaio-hyo %s%s ---\r\n", curdir, curfnm); fprintf(stderr, "%d: %s.\r\n", n, ermes[n]); longjmp(env0, 1); } void ERRMOD(n, cur_rk) /* ¥â¡¼¥ÉÄêµÁɽ¤Î¥¨¥é¡¼ */ unsigned int n; ARGS *cur_rk; { static char *ermes[] = { /* 0 */ "Table incomplete", "')' mismatch", "Unprintable error", "Illegal filename", "Illegal modename", /* 5 */ "Undefined mode", "Illegal content(s) of list", "Illegal ^,\\o,\\x or \\d expression", "Illegal defmode", "Unrecognized keyword", /* 10 */ "Incomplete string", "Search path specified after filename", "Argument must be a string", "Can't get home directory", "Illegal @-keyword", /* 15 */ "User doesn't exist", "Illegal character", "Defmode or set-path placed wrong" }; if(n >= numberof(ermes)) n = 2; fprintf(stderr, "\r\nMode-hyo %s%s ---\r\n%s\r\n", curdir, curfnm, mcurread); fprintf(stderr, "%d: %s.\r\n", n, ermes[n]); fclose(modefile); longjmp(env0, 1); } static void ERRLIN(n, cur_rk) /* ÊÑ´¹Âбþɽ¤Î¥¨¥é¡¼ */ unsigned int n; ARGS *cur_rk; { static char *ermes[] = { /* 0 */ "')' mismatch", "Incomplete single-quote or double-quote expression", "Illegal ^,\\o,\\x or \\d expression", "Illegal variable name", "Incomplete line", /* 5 */ "Evaluation of unbound variable", "Unprintable error", "Too many or too few contents of list", "Illegal defvar/defconst", "Faculity or declaration joined other item(s)", /* 10 */ "Duplicate defvar/defconst", "Variable/constant name conflicts with Function name", "A line contains both declaration and other output item(s)", "Argument isn't a letter", "Function, faculity or declaration in illegal place", /* 15 */ "More than 3 items", "Undefined mode", "Against the restriction of pre-transform table", "Against the restriction of after-transform table", "Item comes after faculity", /* 20 */ "Incomplete list", "Illegal character", "Illegal include", "Too many levels of 'include' nest", "Can't open include file", /* 25 */ "Can't get home directory", "Illegal @-keyword", "User doesn't exist", "Constant must be defined before used", "Illegal mode status" }; if(n >= numberof(ermes)) n = 6; fprintf(stderr, "\r\nTaio-hyo %s%s ---\r\n%s\r\n", curdir, curfnm, hcurread); fprintf(stderr, "%d: %s.\r\n", n, ermes[n]); while(NULL != *base) fclose(*base--); longjmp(env0, 1); } static void ERRHYO(n, cur_rk) /* ERRLIN¤ÈƱÍÍ¡¢Âбþɽ¤Î¥¨¥é¡¼¤À¤¬¡¢°ì¹Ô¤À¤±¤Î¸í¤ê¤Ç¤Ê¤¯ Á´ÂΤò¸«¤Ê¤¤¤È¤ï¤«¤é¤Ê¤¤¸í¤ê¡£º£¤Î½ê¡¢¡Ö̤ÄêµÁÊÑ¿ô¤Î½Ð¸½¡×¤Î¤ß¡£*/ unsigned int n; ARGS *cur_rk; { static char *ermes[] = { /* 0 */ "Undefined variable was found", "Unprintable error" }; if(n >= numberof(ermes)) n = 1; fprintf(stderr, "\r\nTaio-hyo %s%s ---\r\n", curdir, curfnm); fprintf(stderr, "%d: %s.\r\n", n, ermes[n]); while(NULL != *base) fclose(*base--); longjmp(env0, 1); } wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/romkan/rk_extvars.h0000644000000000000000000001772007153676737021113 0ustar rootroot/* * $Id: rk_extvars.h,v 2.2.2.1 2000/08/04 05:37:27 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /*********************************************************************** rk_extvars.h 88. 6.16 Äû Êä 93.10.19 Æó¤Ä°Ê¾å¤Î¥Õ¥¡¥¤¥ë¤Ë¤Þ¤¿¤¬¤Ã¤Æ»È¤ï¤ì¤ëÊÑ¿ô¤ÎexternÀë¸À¡£ ËÜÂΤÏrk_vars.c¤ÇÄêµÁ¡£ ***********************************************************************/ /* Version 3.0 */ extern char rk_errstat; extern int flags; extern jmp_buf env0; extern FILE *modefile; extern char nulstr[]; extern char *hcurread, *mcurread, *curfnm, *curdir; extern letter *ltrbufbgn; extern FILE *nestfile[], **base; extern struct modestat { modetyp moderng; /* ¥â¡¼¥É¤Î¾õÂ֤κÇÂçÃ͡ܣ± */ modetyp curmode; /* ¥â¡¼¥É¤Î¾õÂÖ */ } modesw[]; extern char hyoshu[]; extern char **modmeiptr, *modmeibgn[], *modmeimem, modmeimem_[]; extern char **dspnamptr, *dspnambgn[], *dspcod, dspcod_[], *dspmod[][2]; extern char **hyomeiorg, **hyomeiptr, *hyomeimem; extern char **pathmeiorg, **pathmeiptr, *pathareaorg, *pathmeimem; extern int usemaehyo[], usehyo[], useatohyo[], naibu_[], *naibu; extern letter *lptr; extern letter rk_input, disout[], rk_output[], keybuf[], urabuf[]; extern int lastoutlen, lastkbflen; extern letter oneletter[], nil[]; extern int hyonum; extern struct funstr /* ÁȤ߹þ¤ß´Ø¿ô¤ÎÀ­¼Á¤òÊÝ»ý¤¹¤ëstruct */ { char *fnname; /* ´Ø¿ô̾ */ char appear; /* ÆþÎÏ¥³¡¼¥ÉÉô¡¦½ÐÎÏ¥³¡¼¥ÉÉô¡¦¥Ð¥Ã¥Õ¥¡»Ä¤êÉô ¤Ë½ñ¤±¤ë¤«¤É¤¦¤«¤Î¥Õ¥é¥°£³¥Ó¥Ã¥È */ char argnum; /* °ú¿ô¤Î¸Ä¿ô */ char fntype; /* ·ë²Ì¤Î¥¿¥¤¥× */ } rk_funstr; extern struct dat /* ÆþÎÏ¡¦½ÐÎÏ¡¦¥Ð¥Ã¥Õ¥¡»Ä¤êÉô¤Ø¤Î¥Ý¥¤¥ó¥¿ */ { letter *code[3]; } rk_dat; extern struct hyo /* °ì¤Ä¤ÎÂбþɽ¤Î¡¢ÊÑ´¹¥Ç¡¼¥¿µÚ¤Ó³ÆÊÑ¿ô¤ÎÊѰè¤Î¡¢³ÊǼ¾ì½ê¤Ø¤Î¥Ý¥¤¥ó¥¿¡£*/ { struct dat *data; letter **hensudef; } rk_hyo; extern struct funstr func[]; extern struct hyo hyo_n[]; wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/romkan/Imakefile0000644000000000000000000000116007153676737020352 0ustar rootrootXCOMM XCOMM $Id: Imakefile,v 2.4 1999/02/24 02:50:52 kaneda Exp $ XCOMM #ifdef NEED_DEFINE_LIB #define DoNormalLib YES #define DoSharedLib NO #define DoDebugLib NO #define DoProfileLib NO #endif #include #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' INCLUDES = -I$(WNNINCLUDESRC) DEFINES = $(WNNDEFINES) -DWNNDEFAULT $(WNNLANGDEF) LINTLIBS = SRCS= rk_bltinfn.c \ rk_main.c \ rk_modread.c \ rk_read.c \ rk_vars.c \ rk_multi.c OBJS= rk_bltinfn.o \ rk_main.o \ rk_modread.o \ rk_read.o \ rk_vars.o \ rk_multi.o LibraryObjectRule() AllTarget($(OBJS)) DependTarget() wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/romkan/rk_macros.h0000644000000000000000000002064607153676737020704 0ustar rootroot/* * $Id: rk_macros.h,v 2.1.2.1 2000/08/04 05:37:27 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /*********************************************************************** rk_macros.h 87.11.17 ²þ Àµ ËÜÊÑ´¹¤Ç»È¤Ã¤Æ¤¤¤ë¥Þ¥¯¥í´Ø¿ô·²¡£rk_header.h ¤Ëinclude¤µ¤ì¤Æ¤¤¤ë¡£ ¤³¤ì¤òinclude¤¹¤ë¤È¡¢¼«Æ°Åª¤Ërk_spclval.h¤âinclude¤µ¤ì¤ë¡£¥æ¡¼¥¶¤Î ¥×¥í¥°¥é¥à¤Ç¤³¤ì¤òinclude¤¹¤ì¤Ð¡¢to_upper¤Ê¤É¤Î¥Þ¥¯¥í¤¬»È¤¨¤ë¡£ ***********************************************************************/ /* Version 3.0 */ #ifndef RKMCRO #define RKMCRO #include "rk_spclval.h" /* ctype.h¤ò»È¤ï¤Ê¤¤¥Þ¥¯¥í¤Ï¡¢¤³¤ÎÃæ¤ÇÄêµÁ¤·¤Æ¤¢¤ë */ #ifndef MVUX # include #endif /* ¥Þ¥¯¥í´Ø¿ô·²¡Ê°ú¿ô¤òÊ£¿ô²óɾ²Á¤¹¤ë¤â¤Î¤â¿¤¤¤Î¤ÇÃí°Õ¡Ë*/ /* 7¥Ó¥Ã¥È¥³¡¼¥ÉcharÍÑ¥Þ¥¯¥í */ #define isoctal(c) (isdigit(c) && (c) < '8') /* 8¿Ê¤Î¿ô»ú¤« */ #define isnulsp(c) (isspace(c) || (c) == '\0') /* EOLËô¤Ï¶õÇòʸ»ú¤Ç¤¢¤ë¤« */ /* Âçʸ»ú¢«¢ª¾®Ê¸»úÊÑ´¹¡£ÄêµÁ°è¤Ï SYSVR2ÄêµÁ»þ toupdown 7¥Ó¥Ã¥Èchar¡Êisascii¤ÎÀ®¤êΩ¤ÄÈÏ°Ï¡Ë _toupdown ±Ñʸ»ú¡Êisalpha¤ÎÀ®¤êΩ¤ÄÈÏ°Ï¡Ë ¤½¤Î¾¤Î¾ì¹ç toupdown ¡· */ #ifdef SYSVR2 # define _toupdown(c) (isupper(c) ? _tolower(c) : _toupper(c)) # define toupdown(c) (isupper(c) ? _tolower(c) : toupper(c)) #else # define toupdown(c) (isupper(c) ? tolower(c) : toupper(c)) #endif /* ctype¥Þ¥¯¥í¤ÎÄêµÁ°è¤ò³ÈÄ¥¤·¤¿¤â¤Î¡£letter·¿°ú¤­¿ô¤Ë¤âŬÍѲġ£ is_eolsp¤À¤±¤ÏÆÈ¼«¤Î¤â¤Î¡£*/ #define is_lower(l) (isascii(l) && islower(l)) #define is_upper(l) (isascii(l) && isupper(l)) #define is_alpha(l) (isascii(l) && isalpha(l)) #define is_alnum(l) (isascii(l) && isalnum(l)) #define is_digit(l) (isascii(l) && isdigit(l)) #define is_octal(l) (isascii(l) && isoctal(l)) #define is_xdigit(l) (isascii(l) && isxdigit(l)) #define is_space(l) (isascii(l) && isspace(l)) #define is_cntrl(l) (isascii(l) && iscntrl(l)) #define is_nulsp(l) (isascii(l) && isnulsp(l)) #define is_eolsp(l) (is_space(l) || (l) == EOLTTR) #ifdef SYSVR2 # define to_upper(l) (is_lower(l) ? _toupper(l) : (l)) # define to_lower(l) (is_upper(l) ? _tolower(l) : (l)) # define to_updown(l) (is_alpha(l) ? _toupdown(l) : (l)) #else # define to_upper(l) (is_lower(l) ? toupper(l) : (l)) # define to_lower(l) (is_upper(l) ? tolower(l) : (l)) # define to_updown(l) (is_alpha(l) ? toupdown(l) : (l)) #endif #endif /* RKMCRO */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/romkan/rk_bltinfn.c0000644000000000000000000003453507153676737021051 0ustar rootroot/* * $Id: rk_bltinfn.c,v 2.7.2.1 2000/08/04 05:37:26 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /*********************************************************************** rk_bltinfn.c 87.12. 6 Äû Êä 93.10.19 ÊÑ´¹ÍѤÎÁȤ߹þ¤ß´Ø¿ô¤Î¤¦¤ÁÊ£»¨¤Ê¤â¤Î¤òÄêµÁ¤·¤Æ¤¢¤ë¡£ Á´³Ñ¢«¢ªÈ¾³Ñ¤ÎÊÑ´¹¤¬¼çÂΡ£ ***********************************************************************/ /* Version 3.0 */ #include "commonhd.h" #include "config.h" #include "rk_multi.h" /* Ⱦ³Ñʸ»ú¤Î¥³¡¼¥É¤Îdefine */ #define HKCHOU (HNKAK1 * 0x100 + 0xB0) /* ް */ #define HKDKTN (HNKAK1 * 0x100 + 0xDE) /* ŽÞ */ #define HKHNDK (HNKAK1 * 0x100 + 0xDF) /* Žß */ #define HKMARU (HNKAK1 * 0x100 + 0xA1) /* Ž¡ */ #define HKHRKG (HNKAK1 * 0x100 + 0xA2) /* Ž¢ */ #define HKTJKG (HNKAK1 * 0x100 + 0xA3) /* Ž£ */ #define HKTTEN (HNKAK1 * 0x100 + 0xA4) /* ޤ */ #define HKNKPT (HNKAK1 * 0x100 + 0xA5) /* Ž¥ */ /* Á´³Ñʸ»ú¤Î¥³¡¼¥É¤Îdefine */ #define CHOUON (0xA1BC) /* ¡¼ */ #define DAKUTN (0xA1AB) /* ¡« */ #define HNDAKU (0xA1AC) /* ¡¬ */ #define MNMARU (0xA1A3) /* ¡£ */ /* ̾Á°¤Ï MaNMARU¡Ê¤Þ¤ó¤Þ¤ë¡Ë¤Îά */ #define HRKKAG (0xA1D6) /* ¡Ö */ #define TJIKAG (0xA1D7) /* ¡× */ #define TOUTEN (0xA1A2) /* ¡¢ */ #define NKPOTU (0xA1A6) /* ¡¦ */ static char _lang[6]; void romkan_set_lang_body(lang, cur_rk) char *lang; ARGS *cur_rk; { strncpy(_lang, lang, 5); _lang[5] = 0; } void romkan_set_lang(lang) char *lang; { ARGS *cur_rk = NULL; LockMutex(&(cur_rk->rk_lock)); romkan_set_lang_body(lang, cur_rk); UnlockMutex(&(cur_rk->rk_lock)); } /** ASCIIʸ»ú¢ªÁ´³Ñ */ letter to_zenalpha(l, cur_rk) letter l; ARGS *cur_rk; { letter retval; static uns_chr *data = (uns_chr *) "¡¡¡ª¡É¡ô¡ð¡ó¡õ¡Ç¡Ê¡Ë¡ö¡Ü¡¤¡Ý¡¥¡¿£°£±£²£³£´£µ£¶£·£¸£¹¡§¡¨¡ã¡á¡ä¡©\ ¡÷£Á£Â£Ã£Ä£Å£Æ£Ç£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡Î¡ï¡Ï¡°¡²¡®£á£â£ã£ä£å\ £æ£ç£è£é£ê£ë£ì£í£î£ï£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡Ð¡Ã¡Ñ¡±"; #ifdef CHINESE static uns_chr *data_cn = (uns_chr *) "¡¡£¡¡±££¡ç£¥£¦£§£¨£©¡ù£«£¬¡ª£®£¯£°£±£²£³£´£µ£¶£·£¸£¹£º£»¡´£½¡µ£¿\ £À£Á£Â£Ã£Ä£Å£Æ£Ç£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú£Û£¤£Ý£Þ£ß£à£á£â£ã£ä£å\ £æ£ç£è£é£ê£ë£ì£í£î£ï£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú£û£ü£ý£þ"; #endif /* CHINESE */ #ifdef KOREAN static uns_chr *data_ko = (uns_chr *) "¡¡£¡£¢£££¤£¥£¦£§£¨£©£ª£«£¬£­£®£¯£°£±£²£³£´£µ£¶£·£¸£¹£º£»£¼£½£¾£¿\ £À£Á£Â£Ã£Ä£Å£Æ£Ç£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú£Û£Ü£Ý£Þ£ß£à£á£â£ã£ä£å\ £æ£ç£è£é£ê£ë£ì£í£î£ï£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú£û£ü£ý£þ"; #endif /* KOREAN */ if(' ' <= l && l <= '~') { l = (l - ' ') << 1; #ifdef CHINESE if(!strcmp(_lang, WNN_C_LANG) || !strcmp(_lang, WNN_T_LANG)){ retval = data_cn[l] << 8; retval += data_cn[++l]; } else #endif #ifdef KOREAN if(!strcmp(_lang, WNN_K_LANG)){ retval = data_ko[l] << 8; retval += data_ko[++l]; } else #endif /* KOREAN */ { retval = data[l] << 8; retval += data[++l]; } return(retval); } else return(l); } static char *hankdata[] = { "ާ","ޱ","ލ","޲","Ž©","޳","Žª","Ž´","Ž«","޵", "޶","޶ŽÞ","Ž·","Ž·ŽÞ","ޏ","ޏŽÞ","޹","޹ŽÞ","Žº","ŽºŽÞ", "Ž»","Ž»ŽÞ","޼","޼ŽÞ","޽","޽ŽÞ","޾","޾ŽÞ","Ž¿","Ž¿ŽÞ", "ŽÀ","ŽÀŽÞ","ŽÁ","ŽÁŽÞ","ޝ","ŽÂ","ŽÂŽÞ","ŽÃ","ŽÃŽÞ","ŽÄ","ŽÄŽÞ", "ŽÅ","ŽÆ","ŽÇ","ŽÈ","ŽÉ", "ŽÊ","ŽÊŽÞ","ŽÊŽß","ŽË","ŽËŽÞ","ŽËŽß","ŽÌ","ŽÌŽÞ","ŽÌŽß", "ŽÍ","ŽÍŽÞ","ŽÍŽß","ŽÎ","ŽÎŽÞ","ŽÎŽß", "ŽÏ","ŽÐ","ŽÑ","ŽÒ","ŽÓ", "ެ","ŽÔ","Ž­","ŽÕ","Ž®","ŽÖ", "Ž×","ŽØ","ŽÙ","ŽÚ","ŽÛ", "¥î","ŽÜ","¥ð","¥ñ","ަ","ŽÝ", "޳ŽÞ","¥õ","¥ö" }; /* Á´³Ñ¤¬º®¤¸¤Ã¤Æ¤ë¤Î¤ÇÃí°Õ */ /** ¾å¤Îhankdata¤¬¡¢¼ÂºÝ¤Ë»È¤¦È¾³Ñ¥³¡¼¥É¤òɽ¤·¤Æ¤¤¤Ê¤¤¤È¤­¡¢¼ÂºÝ¤Î¤â¤Î¤Ë ½¤Àµ¤¹¤ë¡£½é´üÀßÄê»þ¤Ë°ì²ó¤À¤±¸Æ¤Ö */ void hank_setup() { int i; char *s, orig_hnkak1; orig_hnkak1 = *hankdata[0]; /* *hankdata[] ¤Ç¤ÎȾ³Ñʸ»ú¤Î£±¥Ð¥¤¥È¤á¡£È¾³Ñʸ»ú¤Î£±¥Ð¥¤¥È¤á¤À¤±¤¬°Û¤Ê¤ë ¤è¤¦¤Ê¾µ¡¼ï¤Ë°Ü¿¢¤¹¤ë¤È¤­¤Ï¡¢HNKAK1¤Îdefine¤òÊѤ¨¤ì¤ÐOK¡£Ã¢¤·romkan¤Î ¥½¡¼¥¹Ãæ¤ÎȾ³Ñʸ»ú¡Ê¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Î¤ß¸ºß¡Ë¤â¥³¥ó¥Ð¡¼¥È¤·¤Æ¡¢¤½¤Îµ¡¼ï ¤Ë¹ç¤ï¤»¤ë¤Û¤¦¤¬Ë¾¤Þ¤·¤¤¡£¤·¤«¤·¡¢¥¨¥Ç¥£¥¿¤Ç¤³¤Î¥Õ¥¡¥¤¥ë¤ò½¤Àµ¤·¤¿¤ê ¤¹¤ë¾ì¹ç¤Ë¡¢È¾³Ñʸ»ú¤Î°·¤¤¤¬¤¦¤Þ¤¯¤¤¤«¤Ê¤¤¾ì¹ç¤¬¤¢¤ë¤Î¤Ç¡¢ÆÃ¤Ë ¥³¥ó¥Ð¡¼¥È¤ò¤·¤Ê¤¯¤È¤âưºî¤¹¤ë¤è¤¦¤Ë½èÃ֤Ϥ·¤Æ¤¢¤ë¡£¤½¤ì¤¬¡¢¤³¤Î hank_setup()¤Ç¤¢¤ë¡£hankdata¤Ï¡¢½é´üÀßÄê»þ¤Ë hank_setup()¤Ë¤è¤Ã¤Æ ¼ÂºÝ¤ÎȾ³Ñ¥³¡¼¥É¤Ëľ¤µ¤ì¤ë¡£*/ if(orig_hnkak1 == (char)HNKAK1) return; for(i = 0; i < numberof(hankdata); i++){ for(s = hankdata[i]; *s; s += 2) if(*s == orig_hnkak1) *s = HNKAK1; } } /** ¤«¤Ê¢ªÈ¾³Ñ¥«¥¿¥«¥Ê¡£·ë²Ì¤¬Æóʸ»ú¤Ë¤Ê¤ë¤³¤È¤â¤¢¤ë¡£*/ void to_hankata(in, outp) letter in, **outp; { uns_chr *p, c; letter *out; int n; out = *outp; switch(in){ case CHOUON: *out++ = HKCHOU; break; case DAKUTN: *out++ = HKDKTN; break; case HNDAKU: *out++ = HKHNDK; break; case MNMARU: *out++ = HKMARU; break; case HRKKAG: *out++ = HKHRKG; break; case TJIKAG: *out++ = HKTJKG; break; case TOUTEN: *out++ = HKTTEN; break; case NKPOTU: *out++ = HKNKPT; break; default: if(is_kata(in)){ for(p = (uns_chr *)hankdata[in - KATBGN]; (c = *p); p++) *out++ = (c << 8) + *++p; } else if(is_hira(in)){ for(p = (uns_chr *)hankdata[in - HIRBGN]; (c = *p); p++) *out++ = (c << 8) + *++p; } else { *out++ = in; } } *out = EOLTTR; *outp = out; } /** Ⱦ³Ñ¥«¥¿¥«¥Ê¢ª¤Ò¤é¤¬¤Ê¡£Ã¢¤·¡¢ÂùÅÀ¤ò»ý¤Äʸ»ú¤ò°ì¤Ä¤Ë¤Þ¤È¤á¤Æ¤Ï ¤¯¤ì¤Ê¤¤¤Î¤ÇÃí°Õ¡£*/ letter to_zenhira(l, cur_rk) letter l; ARGS *cur_rk; { letter retval; static uns_chr *data = (uns_chr *) "¡£¡Ö¡×¡¢¡¦¤ò¤¡¤£¤¥¤§¤©¤ã¤å¤ç¤Ã¡¼¤¢¤¤¤¦¤¨¤ª¤«¤­¤¯¤±¤³¤µ¤·¤¹¤»¤½¤¿\ ¤Á¤Ä¤Æ¤È¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ò¤Õ¤Ø¤Û¤Þ¤ß¤à¤á¤â¤ä¤æ¤è¤é¤ê¤ë¤ì¤í¤ï¤ó¡«¡¬"; #ifdef CHINESE static uns_chr *data_cn = (uns_chr *) "¡£¡¸¡¹¡¢¡¤¤ò¤¡¤£¤¥¤§¤©¤ã¤å¤ç¤Ã¡¼¤¢¤¤¤¦¤¨¤ªÂ𤭤¯¤±¤³¶È¤·¤¹¤»¤½¤¿\ ¤Á¤Ä¤Æ¤È¤Ê¤Ë¤Ì¤ÍµÄ¤Ï¤Ò¤Õ¤Ø¤Û¤Þ¤ß¤à¤áÒ²¤ä¤æ¤è¤é¤ê¤ë¤ì¤í¤ï¤ó¡å¡ã"; #endif /* CHINESE */ if(is_hankata(l)){ l = (l - HKKBGN) << 1; #ifdef CHINESE if(!strcmp(_lang, WNN_C_LANG) || !strcmp(_lang, WNN_T_LANG)){ retval = data_cn[l] << 8; retval += data_cn[++l]; } else #endif { retval = data[l] << 8; retval += data[++l]; } return(retval); } else return(l); } /** Ⱦ³Ñ¥«¥¿¥«¥Ê¢ªÁ´³Ñ¡£Ã¢¤·¡¢ÂùÅÀ¤ò»ý¤Äʸ»ú¤ò°ì¤Ä¤Ë¤Þ¤È¤á¤Æ¤Ï ¤¯¤ì¤Ê¤¤¤Î¤ÇÃí°Õ¡£*/ letter to_zenkata(l, cur_rk) letter l; ARGS *cur_rk; { return(is_hankata(l) ? (l = to_zenhira(l, cur_rk), to_kata(l)) : l); } /* ¥Ó¥Ã¥È¥Ù¥¯¥¿¤Î¹½À® */ #define bitvec(b0, b1, b2, b3, b4, b5, b6, b7) ( \ (char)b0 | ((char)b1 << 1) | ((char)b2 << 2) | ((char)b3 << 3) | ((char)b4 << 4) | ((char)b5 << 5) | \ ((char)b6 << 6) | ((char)b7 << 7) \ ) /** char¤ÎÇÛÎó h ¤ò¥Ó¥Ã¥È¥Ù¥¯¥¿¤È¸«¤Æ¤½¤ÎÂèi¥Ó¥Ã¥È¤ò¥Á¥§¥Ã¥¯¤¹¤ë */ #define bitlook(h, i) (h[(i) >> 3] & (1 << ((i) & 7))) #define KATRPT 0xA1B3 /* ¡³ */ #define HIRRPT 0xA1B5 /* ¡µ */ #define KATA_U 0xA5A6 /* ¥¦ */ #define KAT_VU 0xA5F4 /* ¥ô */ #define HIR_KA 0xA4AB /* ¤« */ #define HIR_HO 0xA4DB /* ¤Û */ #define KAT_KA 0xA5AB /* ¥« */ #define KAT_HO 0xA5DB /* ¥Û */ #define HIR_HA 0xA4CF /* ¤Ï */ #define KAT_HA 0xA5CF /* ¥Ï */ /** ¸å¤í¤ËȾÂùÅÀ¤ò¤¯¤Ã¤Ä¤±¤ë¡£·ë²Ì¤Ï°ìËô¤ÏÆóʸ»ú¡£*/ void handakuadd(in, outp) letter in, **outp; { if((HIR_HA <= in && in <= HIR_HO) ? 0 == (in - HIR_HA) % 3 : (KAT_HA <= in && in <= KAT_HO && 0 == (in - KAT_HA) % 3)){ *(*outp)++ = in + 2; } else { *(*outp)++ = in; *(*outp)++ = HNDAKU; } **outp = EOLTTR; } /** ¸å¤í¤ËÂùÅÀ¤ò¤¯¤Ã¤Ä¤±¤ë¡£·ë²Ì¤Ï°ìËô¤ÏÆóʸ»ú¡£*/ void dakuadd(in, outp) letter in, **outp; { static char flgbit[] = { bitvec(1, 0, 1, 0, 1, 0, 1, 0), /* ¤«¤¬¤­¤®¤¯¤°¤±¤² */ bitvec(1, 0, 1, 0, 1, 0, 1, 0), /* ¤³¤´¤µ¤¶¤·¤¸¤¹¤º */ bitvec(1, 0, 1, 0, 1, 0, 1, 0), /* ¤»¤¼¤½¤¾¤¿¤À¤Á¤Â */ bitvec(0, 1, 0, 1, 0, 1, 0, 0), /* ¤Ã¤Ä¤Å¤Æ¤Ç¤È¤É¤Ê */ bitvec(0, 0, 0, 0, 1, 0, 0, 1), /* ¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò */ bitvec(0, 0, 1, 0, 0, 1, 0, 0), /* ¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú */ bitvec(1, 0, 0, 0, 0, 0, 0, 0) /* ¤Û */ }; letter c; if((HIR_KA <= in && in <= HIR_HO) ? (c = in - HIR_KA, 1) : (KAT_KA <= in && in <= KAT_HO && (c = in - KAT_KA, 1))){ if(bitlook(flgbit, c)){ *(*outp)++ = in + 1; } else { *(*outp)++ = in; *(*outp)++ = DAKUTN; } } else switch(in){ case KATRPT: case HIRRPT: *(*outp)++ = in + 1; break; case KATA_U: *(*outp)++ = KAT_VU; break; default: *(*outp)++ = in; *(*outp)++ = DAKUTN; } **outp = EOLTTR; } /** in¤ÇÍ¿¤¨¤é¤ì¤¿¥³¡¼¥É¤òbase¿Ê¤Î¿ô»ú¤Ë¤·¤Æoutp¤ËÆþ¤ì¤ë¡£*/ void to_digit(in, lbase, outp) letter in, lbase, **outp; { letter c, vtol(); if(c = in, c /= lbase) to_digit(c, lbase, outp); *(*outp)++ = vtol(in % lbase); **outp = EOLTTR; } wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/romkan/rk_spclval.h0000644000000000000000000002736707153676737021073 0ustar rootroot/* * $Id: rk_spclval.h,v 2.2.2.1 2000/08/04 05:37:30 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /*********************************************************************** rk_spclval.h 88. 6. 9 Äû Êä 93.10.19 ËÜÊÑ´¹¤Ç»È¤Ã¤Æ¤¤¤ëÆÃ¼ì¤ÊÃͤÎÄêµÁ¡Ê³°Éô¤Ë¤â½Ð¤¹¡Ë¡£¥Þ¥¯¥í ´Ø¿ô¤â¡¢ctype.h¤ò»È¤¦¤â¤Î°Ê³°¤Ï¤³¤Á¤é¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ rk_macros.h ¤Ëinclude¤µ¤ì¤Æ¤¤¤ë¡£ ***********************************************************************/ /* Version 3.0 */ #ifndef EOLTTR typedef unsigned int letter; /* ʸ»ú¤Ï°ìÈ̤ˤ³¤Î·¿¤Çɽ¤¹ */ typedef unsigned char uns_chr; typedef unsigned char modetyp; #define ModeNotInt /* ¾å¤Çmodetyp¤¬unsigned int¤è¤ê¾®¤µ¤¤·¿¤Ëtypedef¤µ¤ì¤Æ ¤¤¤¿¤é¤³¤ì¤òdefine¤·¤Æ²¼¤µ¤¤¡£*/ /* #define ModeHasBuf */ #define LTRHUG (~(0xff000000)) /* ÆâÉôɽ¸½ µÚ¤Óµ¶Ê¸»ú¤ò½ü¤¯¡¢letter¤Î¼è¤êÆÀ¤ëºÇÂçÃÍ */ /* °Ê²¼¤ËÄêµÁ¤¹¤ëÃͤϡ¢ºÇ¾å°Ì¥Ð¥¤¥È¤¬255¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ ¤³¤ì¤é¤Î¤¦¤Á¡¢³°¤Ë½Ð¤ë¤Î¤Ï EOLTTR¡¢CHMSIG¡¢NISEBP¡¢LTREOF¡¢REDRAW¤È SENDCH¡Êµ¶¥Ç¥ê¡¼¥È¤È¤·¤ÆNISEDL¤ò»È¤¦¾ì¹ç¤ÏNISEDL¤â¡Ë¡£*/ #define EOLTTR ((letter)-1) /* ʸ»úÎó¤Î½ªÃ¼¤òɽ¤¹¥³¡¼¥É */ /* ¥­¡¼ÆþÎϤ¬¤¢¤Ã¤¿¤éɬ¤º²¿¤«¥³¡¼¥É¤òÊÖ¤¹¾õÂ֤ˤ·¤Æ ¤ª¤¯¤È¡¢ÆÃ¤ËÊÖ¤¹¤Ù¤­¤â¤Î¤¬¤Ê¤¤»þ¤Ï¤³¤ì¤òÊÖ¤¹¡£*/ #define ERRCOD ((letter)-2) /* (error)¤òɽ¤¹ÆâÉô¥³¡¼¥É */ #define CHMSIG ((letter)-3) /* ¥â¡¼¥É¥Á¥§¥ó¥¸¤òɽ¤¹¥³¡¼¥É */ #define NISEBP ((letter)-4) /* ¥¨¥é¡¼·Ù¹ðÍѤε¶BEL¥³¡¼¥É */ #define VARRNG ((letter)-5) /* ÊѰ褬Æó¤Ä¤Îʸ»ú¤Î´Ö¤Ç¤¢¤ë¤Î¤ò¼¨¤¹ÆâÉô¥³¡¼¥É*/ #define UNUSDC ((letter)-6) /* ¥Þ¥Ã¥Á¤ò¼ºÇÔ¤µ¤»¤ë¤¿¤á¤ÎÆâÉô¥³¡¼¥É */ #define REASIG ((letter)-7) /* ɽ¤ÎºÆÀßÄê¤òÍ׵᤹¤ë¤¿¤á¤ÎÆâÉô¥³¡¼¥É */ #define URBFCL ((letter)-8) /* ΢¥Ð¥Ã¥Õ¥¡¤ÎÌÀ¼¨Åª¥¯¥ê¥¢¤òÍ׵᤹¤ëÆâÉô¥³¡¼¥É*/ #define LTREOF ((letter)-9) /* romkan_next()¡¢Æ±getc()¤¬EOF¤ÎÂå¤ï¤ê¤ËÊÖ¤¹¤â¤Î ¡Ê¤Ç¤­¤ì¤ÐEOF¤ÈƱ¤¸¤Ë¤·¤¿¤¤¤¬¡Ä¡Ë*/ #define REDRAW ((letter)-10)/* Wnn¤ËÊÑ´¹¹Ô¤Îredraw¤òÍ׵᤹¤ëÆÃ¼ì¥³¡¼¥É */ #define NISEDL ((letter)-11)/* µ¶¥Ç¥ê¡¼¥È¤È¤·¤ÆÄê¿ô¤ò»È¤¤¤¿¤¤¿Í¤Î¤¿¤á¤Ë½àÈ÷ ¤µ¤ì¤¿Äê¿ô¡Ê⤷¡¢»È¤¤¤¿¤¯¤Ê¤±¤ì¤Ð»È¤ï¤Ê¤¯¤Æ¤â ¤¤¤¤¡Ë¡£ÊÑ¿ônisedl¤Ë¥»¥Ã¥È¤·¤Æ»È¤¦ */ #define SENDCH ((letter)-12)/* ÊÑ´¹¥Ð¥Ã¥Õ¥¡¤¬¶õ¤Ê¤é¡¢¼¡¤Îʸ»ú¤ò̵¾ò·ï¤Ë ¾å¤ËÁ÷¤ë¤è¤¦Wnn¤ËÍ׵᤹¤ë¥¨¥¹¥±¡¼¥×¥³¡¼¥É¡£*/ /* romkan_init3()¤Î°ú¿ô¤Î¥Õ¥é¥°¤Ë»È¤¦ÃÍ */ #define RK_CHMOUT 0x1 /* ¥â¡¼¥É¥Á¥§¥ó¥¸¤òÃΤ餻¤ë¥³¡¼¥É¤òÊÖ¤¹¤«¡© */ #define RK_KEYACK 0x2 /* ¥­¡¼¥¤¥ó¤ËÂФ·É¬¤º²¿¤«¤òÊÖ¤¹¤« */ #define RK_DSPNIL 0x4 /* ¥â¡¼¥Éɽ¼¨Ê¸»úÎó̵»ØÄê¤Î»þ¤Ë¶õʸ»úÎó¤òÊÖ¤¹¤«¡Ê¥Ç¥Õ ¥©¥ë¥È¤ÏNULL¡Ë¡£¸ß´¹À­ÊÝ»ý¤Î¤¿¤á */ #define RK_NONISE 0x8 /* µ¶¥³¡¼¥É¤ò½Ð¤µ¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤« */ #define RK_REDRAW 0x10 /* WnnÍÑÆÃ¼ì¥Õ¥é¥°¡ÊredrawÍѤΥե饰¤ò½Ð¤¹¤«¤É¤¦¤«¡Ë*/ #define RK_SIMPLD 0x20 /* delete¤Îưºî¤òñ½ã¤Ë¤¹¤ë¤« */ #define RK_VERBOS 0x40 /* »ÈÍѤ¹¤ëɽ¤Î°ìÍ÷¤ò¥ê¥Ý¡¼¥È¤¹¤ë¤« */ /* ¥³¡¼¥É¤Î¶èÊ̤˻Ȥ¦¥Þ¥¯¥í */ #define HG1BIT (0x80000000) /* ºÇ¾å°Ì¥Ó¥Ã¥È¤À¤è */ #define SHUBET(X) ((letter)(X) >> (int)24) /* ÆâÉôɽ¸½¤Ç¡¢¾å£±¥Ð¥¤¥È¤ò¼ïÊÌɽ¸½¤Ë»È¤Ã¤Æ¤ë */ #define LWRMSK(X) ((X) & ~(0xff000000)) /* ¾å£±¥Ð¥¤¥È¤ò¼è¤ê½ü¤¯ */ #define LWRCUT(X) ((X) &= ~(0xff000000)) /* ¾å£±¥Ð¥¤¥È¤ò¼è¤ê½ü¤¯ */ #define XY2INT(X, Y) (((X) << (int)24) | (Y)) /* ¤³¤ì¤¬£±²ó¤·¤«Y¤òɾ²Á¤·¤Ê¤¤¤³¤È¤Ë °Í¸¤·¤Æ½ñ¤¤¤Æ¤¢¤ë²Õ½ê¤¬¤¢¤ë Ãí°Õ¡ª */ #define is_HON(X) (SHUBET(X) == 0) /* ËÜʪ¤Îʸ»ú¤« */ #define NAIBEX(X) (0 < SHUBET(X) && SHUBET(X) < 0x80) /* ÆâÉôɽ¸½¤ò¼¨¤¹Ãͤ« */ #define isNISE(X) (SHUBET(X) == 0x80) /* µ¶Êª¤Îʸ»ú¤«¡ÊºÇ¾å°Ì¥Ó¥Ã¥È¤¬Î©¤Ä¡Ë */ #define isSPCL(X) (SHUBET(X) == 0xff) /* rk_spclval.h¤ÇÄêµÁ¤µ¤ì¤ëÃͤ«¤É¤¦¤«*/ /* NISEDL¤Ê¤É¤ò´Þ¤á¤¿µ¶¤Îʸ»ú¤Ç¤¢¤ë¤«¤É¤¦¤«¤òȽÄꤹ¤ë¤Ë¤Ï¡¢~is_HON(X) ¤«¡¢ isNISE(X) || isSPCL(X) ¤È¤·¤ÆÈ½Äꤷ¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£*/ #define toNISE(X) ((X) | HG1BIT) #define to_HON(X) ((X) & ~HG1BIT) /* ¸ß´¹À­¤Î¤¿¤áÍѰդ·¤Æ¤¢¤ëÊÌ̾ */ #define REALCD(X) is_HON(X) #define NISECD(X) isNISE(X) #define SPCLCD(X) isSPCL(X) /** Ⱦ³Ñʸ»ú¤Î¥³¡¼¥É¤Îdefine */ #ifndef HNKAK1 # ifdef IKIS # define HNKAK1 0xA8 # else # define HNKAK1 0x8E # endif #endif /** rk_bltinfn.c ¤ÎÊä´°¤Î¤¿¤á¤Î¥Þ¥¯¥í ¡Ê°ú¿ô¤òÊ£¿ô²óɾ²Á¤¹¤ë¤â¤Î¤â¿¤¤¤Î¤ÇÃí°Õ¡Ë*/ #define HKKBGN (HNKAK1 * 0x100 + 0xA1) /* Ⱦ³Ñ¥«¥Ê¤Î¶çÅÀ */ #define HKKEND (HNKAK1 * 0x100 + 0xDF) /* ¡· ȾÂùÅÀ */ #define HIRBGN (0xA4A1) /* ¤¡ */ #define HIREND (0xA4F3) /* ¤ó */ /* ¤Ò¤é¤¬¤Ê¡§"¤¡"¡Á"¤ó" */ #define KATBGN (0xA5A1) /* ¥¡ */ #define KATEND (0xA5F6) /* ¥ö */ /* ¥«¥¿¥«¥Ê¡§"¥¡"¡Á"¥ó"¡Á"¥ö" */ #define _to_kata(l) ((l) + (KATBGN - HIRBGN)) /** ¥«¥¿¥«¥Ê¤Ø¡ÊÄêµÁ°èÀ©¸Â¡Ë*/ #define _to_hira(l) ((l) - (KATBGN - HIRBGN)) /** ¤Ò¤é¤¬¤Ê¤Ø¡ÊÄêµÁ°èÀ©¸Â¡Ë*/ #define is_hira(l) (HIRBGN <= (l) && (l) <= HIREND) /** ¤Ò¤é¤¬¤Ê¤«¡© */ #define is_kata(l) (KATBGN <= (l) && (l) <= KATEND) /** ¥«¥¿¥«¥Ê¤«¡© */ #define is_kata2(l) (_to_kata(HIRBGN) <= (l) && (l) <= _to_kata(HIREND)) /** Âбþ¤¹¤ë¤Ò¤é¤¬¤Ê¤Î¤¢¤ë¥«¥¿¥«¥Ê¤«¡© */ #define to_kata(l) (is_hira(l) ? _to_kata(l) : (l)) /** ¥«¥¿¥«¥Ê¤Ø */ #define to_hira(l) (is_kata2(l) ? _to_hira(l) : (l)) /** ¤Ò¤é¤¬¤Ê¤Ø¡£¡Ö¥ô¥õ¥ö¡×¤Ï¥«¥¿¥«¥Ê¤Î¤Þ¤Þ»Ä¤ë¡£*/ #define is_hankata(l) (HKKBGN <= (l) && (l) <= HKKEND) /** Ⱦ³Ñ¥«¥Ê¡Ê¶çÅÀ¤Ê¤É¤ò´Þ¤à¡Ë¤«¡© */ /* ¤½¤Î¾¤Î¥Þ¥¯¥í´Ø¿ô·²¡Ê°ú¿ô¤òÊ£¿ô²óɾ²Á¤¹¤ë¤â¤Î¤â¿¤¤¤Î¤ÇÃí°Õ¡Ë*/ #define numberof(array) (sizeof(array) / sizeof(*array)) /* ¥Ý¥¤¥ó¥¿¤òletter¤ÎÎó¤ÎËöÈø¤Ø¤â¤Ã¤Æ¤¤¤¯¡£letter *lp */ #define totail(lp) {while(*(lp) != EOLTTR) (lp)++;} /* ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò¤½¤Îʸ»úÎó¤ÎºÇ¸åÈø¤Ø¡£totail¤ÎcharÈÇ¡£char *sp */ #define strtail(sp) {while(*(sp)) (sp)++;} /* ¸ÂÄêÈÇromkan_init3 */ #define romkan_init4(pathname, delchr, nisedl, keyin, bytecount, flg) \ romkan_init3(pathname, delchr, nisedl, EOLTTR, \ keyin, bytecount, bytecount, 0, flg) #define romkan_init5(pathname, delchr, keyin, bytecount, flg) \ romkan_init4(pathname, delchr, toNISE(delchr), keyin, bytecount, flg) #endif /* of ifndef EOLTTR */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/romkan/rk_multi.c0000644000000000000000000001476007153676737020545 0ustar rootroot/* * $Id: rk_multi.c,v 2.3.2.1 2000/08/04 05:37:29 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /*********************************************************************** rk_multi.c 93.10.14 ºîÀ® ***********************************************************************/ /* Version 1.0 93.10.14 H.KISHIBA */ #include "rk_multi.h" wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/romkan/rk_main.c0000644000000000000000000013051607153676737020335 0ustar rootroot/* * $Id: rk_main.c,v 2.5.2.1 2000/08/04 05:37:28 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /*********************************************************************** rk_main.c 88. 6.10 ²þ Àµ 93.10.19 ¥í¡¼¥Þ»ú¤«¤ÊÊÑ´¹¡¦¤½¤Î¾¡¢ÆþÎÏ¥³¡¼¥É¤òÊÑ´¹¤¹¤ë¥×¥í¥°¥é¥à¡£ ASCII¥³¡¼¥É»ÈÍѤò¡¢Á°Äó¤È¤·¤Æ¤¤¤ë¡£ ¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢ÊÑ´¹¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó¡£ ***********************************************************************/ /* Version 3.0 */ #include "rk_multi.h" #include "rk_fundecl.h" struct matchpair /* ¸½ºß¥Þ¥Ã¥Á¤µ¤ì¤Æ¤¤¤ëÊÑ¿ô¤ÎÈÖ¹æ¤È¡¢¥Þ¥Ã¥Á¤·¤¿Ê¸»ú¤Î ÁȤòÊÝ»ý¡£*/ { int hennum; letter ltrmch; }; letter memory[SIZALL]; /* ÊÑ´¹Âбþɽ¤ä¡¢ÊÑ¿ô¤ÎÊѰè¤Ê¤É¤òÆþ¤ì¤ëÎΰè */ struct dat dat_data[LINALL]; /* Âбþɽ¤Î°ì¹Ô¤´¤È¤Î¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿ */ letter *hensudefhyo[VARTOT]; /* ÊÑ¿ô¤´¤È¤ÎÊѰè¥Ç¡¼¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿ */ struct matchpair henmatch[VARTOT]; /* ÊÑ¿ô¤Î¥Þ¥Ã¥Á¾õ¶·¤ò¤¿¤á¤Æ¤ª¤¯ */ #ifdef KDSP # ifdef MVUX letter displine[DSPLIN]; /* ¥Ç¥Ð¥Ã¥°ÍÑ É½¼¨¤Î°ì¹Ôʬ¤òµ­²± */ # endif #endif letter *curdis; int codein_len; letter *codeout, *remainkbf; letter ungetc_buf = EOLTTR; /* romkan_ungetc¤¬°ìʸ»úÂàÈò¤·¤Æ¤ª¤¯¥Ð¥Ã¥Õ¥¡ */ letter unnext_buf = EOLTTR; /* romkan_unnext¤¬ ¡· */ letter (*keyin_method)(); /* ¥­¡¼¥¤¥ó´Ø¿ô¤Î¥¢¥É¥ì¥¹ */ int (*bytcnt_method)(); /* ¥Ð¥¤¥È¥«¥¦¥ó¥È´Ø¿ô¤Î¥¢¥É¥ì¥¹ */ int (*kbytcnt_method)(); /* ¥­¡¼ÆþÎϲò¼áÍѥХ¤¥È¥«¥¦¥ó¥È´Ø¿ô¤Î¥¢¥É¥ì¥¹ */ char prv_modfnm[REALFN] = "\0"; /* ¥â¡¼¥Éɽ̾¡ÊËô¤Ï¤½¤Î¥Ñ¥¹Ì¾¡Ë¤òÊݸ */ /* ½é´üÀßÄ꤬¤¤¤¤²Ã¸º! */ #define DISOUT ((flags & RK_NONISE) ? rk_output : disout) /* ¥Õ¥é¥°¤ÎÃͤÏromkan_init3()¤ÎÃæ¤ÇÀßÄꤵ¤ì¡¢¤½¤ÎRK_NONISE¤Î¥Ó¥Ã¥È¤ÎÃͤΠɸ½à¤Ï0¡£½¾¤Ã¤ÆDISOUT¤Îɸ½àÃͤÏdisout¡£¤³¤ì¤òrk_output¤ËÊѤ¨¤ë¤È¡¢µ¶¥³¡¼¥É ¡Ê½ü¡§LTREOF¡Ë¤ò°ìÀڽФµ¤Ê¤¤¡Ê⤷¡¢¥­¡¼ÆþÎϤ¬¤¢¤ì¤Ðɬ¤º²¿¤«¤òÊÖ¤¹¤è¤¦¤Ë ¤·¤Æ¤¢¤ë»þ¤Ë¸Â¤ê¡¢EOLTTR¤ò¤âÊÖ¤¹¡Ë¡£*/ char eofflg; /* romkan_next()¤«¤éLTREOF¤¬Í褿¤È¤­¤Ë¡¢romkan_henkan()Æâ¤Ç1 ¤Ë¤¹¤ë¡£¤³¤ì¤ÎÃͤ¬Èó0¤Ê¤éÊÑ´¹Âбþɽ¤Î(error)¤ò̵»ë¤·¤Æ¡¢ ËܽèÍý¥Ð¥Ã¥Õ¥¡Æâ¤Î̤³ÎÄꥳ¡¼¥É¤â¡¢¶¯À©Åª¤ËÊÑ´¹¤µ¤»¤ë¡£¹¹¤Ë LTREOF¤¬Í褿»þ¤ËÆÃÊ̤ˤ¢¤ë½ÐÎϤò½Ð¤¹¤è¤¦¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð ¤½¤Î½èÍý¤â¹Ô¤¦¡Ê⤷¡¢¤½¤Î½èÍý¤ÏµÞ¤´¤·¤é¤¨¤ÇÉÔ´°Á´¡Ë¡£¤½¤Î ½èÍýÃæ¤Ïeofflg¤Ï2¡£*/ letter evalbuf[2][2][OUTSIZ]; char ebf_sw = '\0'; letter saishu_out[OUTSIZ]; letter delchr, delchr2 = EOLTTR, nisedl; /* DEL¤Î¥­¥ã¥é¥¯¥¿¤ÏÆó¸Ä¤Þ¤Ç»ý¤Æ¤ë*/ modetyp chgmod(), incmod(), decmod(); /* letter¤òÊÖ¤¹´Ø¿ô¤ÎÄêµÁµÚ¤ÓÀë¸À¡Ê°ìÉô¤Ë¤Ïchar¤Î¤â¤Î¤âº®¤¸¤Ã¤Æ¤¤¤ë¡Ë */ static letter mchedsrc(); letter romkan_next(), romkan_unnext(); letter romkan_getc(), romkan_ungetc(), *romkan_henkan(); letter *romkan_henkan_body(); letter to_zenalpha(), to_zenhira(), to_zenkata(); /* to_zenhira;kata ¤ÏÂùÅÀ¤ò»ý¤Äʸ»ú¤ò°ì¤Þ¤È¤á¤Ë¤·¤Ê¤¤¡£*/ void BUGreport(); static void maeato_henkan(), add_at_eof(), rk_delete(), set_rubout(), mchevl(), codeout_chg(), ltrevlcpy(); int match(); static int p_eq(), hen_ikisrc(), henkan_ok(), rk_rst(), head_bytecount(); extern void readdata(), romkan_reset_body(), hank_setup(), to_hankata(), to_digit(), dakuadd(), handakuadd(), allchgmod(); extern int ltov(); static letter *ltrcpy(lp1, lp2) letter *lp1, *lp2; { letter *org; org = lp1; while((*lp1++ = *lp2++) != EOLTTR); return(org); } #ifdef notuse letter *ltrncpy(lp1, lp2, n) /* ËöÈø¤Ë'EOLTTR'¤ò¥»¥Ã¥È */ letter *lp1, *lp2; int n; { letter *org; org = lp1; for(; n; --n) if(EOLTTR == (*lp1++ = *lp2++)) return(org); *lp1 = EOLTTR; return(org); } #endif /** letter¤ÎÎó¤ÎËöÈø¤Ë°ìʸ»ú¤Ä¤Ê¤²¤ë */ static letter *ltr1cat(lp, l) letter *lp, l; { letter *org; org = lp; totail(lp); *lp++ = l; *lp = EOLTTR; return(org); } /** ʸ»úÎó¤ÎËöÈø¤Ë°ìʸ»ú¤Ä¤Ê¤²¤ë¡£ltr1cat¤ÎcharÈÇ */ char *chrcat(s, c) char *s, c; { char *org; org = s; strtail(s); *s++ = c; *s = '\0'; return(org); } static letter *ltrcat(lp1, lp2) letter *lp1, *lp2; { letter *org; org = lp1; totail(lp1); ltrcpy(lp1, lp2); return(org); } /** letter¤ÎÎólp2¤Î³ÆÍ×ÁǤκǾå°Ì¥Ó¥Ã¥È¤òΩ¤Æ¤Æ¤«¤é¡¢lp1¤Î¸å¤í¤Ë¤Ä¤Ê¤²¤ë¡£*/ static letter *bitup_ltrcat(lp1, lp2) letter *lp1, *lp2; { letter *org; org = lp1; totail(lp1); while((*lp1 = *lp2++) != EOLTTR) *lp1++ |= HG1BIT; /** lp2 ¤ÎÍ×ÁÇÁ´¤Æ¤ÎºÇ¾å°Ì¥Ó¥Ã¥È¤òΩ¤Æ¤ë¡£*lp2¤¬NISEBP(rk_spclval.h ¤Çdefine)¤Ê¤É¤Î¤È¤­¤ÏºÇ½é¤«¤éºÇ¾å°Ì¤¬Î©¤Ã¤Æ¤ë¤«¤é¤è¤¤ */ return(org); } /** ltrcat¤·¤¿¤¢¤È¡¢·ë²Ì¤Îʸ»úÎó¤ÎËöÈø¤Ë¥Ý¥¤¥ó¥¿¤ò¤â¤Ã¤Æ¤¤¤¯¡£*/ letter *ltrgrow(lp1, lp2) letter *lp1, *lp2; { totail(lp1); while((*lp1 = *lp2++) != EOLTTR) lp1++; return(lp1); } static int ltrlen(lp) letter *lp; { letter *org; for(org = lp; *lp != EOLTTR; lp++); return(lp - org); } /** letter¤ÎÎó¤ÎºÇ¸å¤Îʸ»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£Ã¢¤·¶õʸ»úÎó¤ËÂФ·¤Æ¤Ï ¤½¤Î¤Þ¤ÞÊÖ¤¹¡£*/ letter *ltrend(lp) letter *lp; { return((*lp != EOLTTR) ? (lp + ltrlen(lp) - 1) : lp); } /** ʸ»úÎó¤ÎºÇ¸å¤Îʸ»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£ltrend()¤ÎcharÈÇ¡£ltrend()¤È ƱÍÍ¡¢¶õʸ»úÎó¤Î¤È¤­¤ÏÆÃÎ㤬¤¢¤ë¡£*/ char *strend(s) char *s; { return(*s ? (s + strlen(s) - 1) : s); } int ltrcmp(lp1, lp2) letter *lp1, *lp2; { for(; *lp1 == *lp2; lp1++, lp2++) if(*lp1 == EOLTTR) return(0); return(*lp1 > *lp2 ? 1 : -1); } #ifdef notuse int ltrncmp(lp1, lp2, n) letter *lp1, *lp2; int n; { for(; n && *lp1 == *lp2; n--, lp1++, lp2++) if(*lp1 == EOLTTR) return(0); return(n == 0 ? 0 : (*lp1 > *lp2 ? 1 : -1)); } letter *ltr_index(lp, l) letter l, *lp; { for(; *lp != EOLTTR; lp++) if(*lp == l) return(lp); return(NULL); } #endif static letter *ltr_rindex(lp, l) letter l, *lp; { letter *lp2; for(lp += ltrlen(lp2 = lp); lp2 != lp; ) if(*--lp == l) return(lp); return(NULL); } /** ʸ»úÎó¤ÎËöÈø°ìʸ»ú¤ò¥«¥Ã¥È¤¹¤ë¡£*/ letter *ltr1cut(lp) letter *lp; { int l; if(0 == (l = ltrlen(lp))) BUGreport(0); /* Illegal POP */ *(lp + --l) = EOLTTR; return(lp); } /** letter¤Î°ìʸ»ú¤òŤµ£±¤Îʸ»úÎó¤ËÊÑ´¹¤¹¤ë */ static letter *ltr_to_ltrseq(lp, l) letter *lp, l; { *lp++ = l; *lp-- = EOLTTR; return(lp); } /** char¤ÎÎ󤫤életter¤ò°ì¤Ä¼è¤ê½Ð¤¹¡£Ã¢¤·'\0'¤ÏEOLTTR¤ËÊѤ¨¤ë */ letter letterpick(lbfpptr, cur_rk) uns_chr **lbfpptr; ARGS *cur_rk; { letter l = 0; register int i; for(i = (*bytcnt_method)(*lbfpptr); i; i--) l = (l << 8) + *(*lbfpptr)++; return(l == 0 ? EOLTTR : l); } /** ÆþÎϤµ¤ì¤¿¥³¡¼¥É¤òʸ»úñ°Ì¤Ë¤Þ¤È¤á¤ë¡£Ã¢¤·EOF¤ÏLTREOF¡Êrk_spclval.h ¤Ë¤ÆÄêµÁ¡Ë¤ËÊѤ¨¤ë¡£*/ letter romkan_next_body(cur_rk) ARGS *cur_rk; { letter in; int i, n; uns_chr c; /* unnext¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤½¤ì¤ò¼è¤ê½Ð¤¹¡£*/ if(unnext_buf != EOLTTR) return(in = unnext_buf, unnext_buf = EOLTTR, in); if( (letter)EOF == (in = (*keyin_method)() )) return(LTREOF); c = (in &= 0xff); n = (*kbytcnt_method)(&c); for(i = 1; i < n; i++) in = (in << 8) + ((*keyin_method)() & 0xff); return(in); } letter romkan_next() { ARGS *cur_rk = NULL; letter x; LockMutex(&(cur_rk->rk_lock)); x = romkan_next_body(cur_rk); UnlockMutex(&(cur_rk->rk_lock)); return x; } /* letter¤Îʸ»ú l ¤Èchar¤Îʸ»ú c ¤ÎÈæ³Ó¡£¥¨¥ó¥É¥Þ¡¼¥¯Æ±»Î¡ÊletterÎó¤Î ¥¨¥ó¥É¥Þ¡¼¥¯¤ÏEOLTTR¡¢charÎó¤Î¤Ï'\0'¡Ë¤â°ìÃפȤߤʤ¹¡£*/ #define ltrchreq(l, c) ((l) == ((c) != 0 ? (c) : EOLTTR)) /** letter¤Îʸ»úÎó¤Èchar¤Îʸ»úÎó¤ÎÈæ³Ó ⤷Âç¾®Èæ³Ó¤ÏÉ乿¤Ê¤·¤È¤·¤Æ¤ä¤ë */ int ltrstrcmp(l, s) register letter *l; register char *s; { for(; ltrchreq(*l, *s); l++, s++) if(*s == 0) return(0); return((*l < (uns_chr)*s || *l == EOLTTR)? -1 : 1); } /** ºÇ¸å¤Ë¥Þ¥Ã¥Á¤·¤¿Ê¸»ú ¤Ä¤Þ¤êurabuf¤ÎºÇ¸å¡£urabuf¤¬¶õ¤À¤ÈEOLTTR¤òÊÖ¤¹ */ static letter lastmch(cur_rk) ARGS *cur_rk; { return(*(ltrend(urabuf))); } /* end of 'letter' functions */ #ifdef OMAKE /** ¤ª ¤Þ ¤± £Ô£Ö¥¢¥Ë¥á¤Î¤´°ÆÆâ¡Ê°ìÉôÆÃ»£¤ò´Þ¤à¡Ë¡£°ú¿ô¤¬ÈóÉéÀ°¿ô¤Î»þ¤Ï¤É¤ì¤«°ì¤Ä¡¢ -1¤Ê¤éÁ´¤Æ¤ò½ÐÎϤ·¡¢¤½¤ì°Ê³°¤Ê¤é²¿¤â½ÐÎϤ·¤Ê¤¤¡£¤¤¤º¤ì¤Î¾ì¹ç¤â¡¢¥Ç¡¼¥¿ ¤Î¸Ä¿ô¤òÊÖ¤¹¡£*/ takeoka(i) int i; { #define OPIMAX (numberof(opinion)) static char *opinion[] = { "¡ÖËâË¡¤Î¥¢¥¤¥É¥ë ¥Ñ¥¹¥Æ¥ë¥æ¡¼¥ß¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£byÃݲ¬", "¡Öµ¡Æ°Àï»Î¥¬¥ó¥À¥à¦¦¦¦¡×¤ÎÃϵåÊÔ¤ÏÎɤ¤ÈÖÁȤÀ¡£byÉþÉô", "¡ÖËâË¡¤Î¥¹¥¿¡¼ ¥Þ¥¸¥«¥ë¥¨¥ß¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£byÃݲ¬", "¡Ê»²¹Í°Õ¸«¡Ë¡Ö¥Þ¥¸¥«¥ë¥¨¥ß¡ÌÀæ»þ±«¡Í¡×¤ÏÎɤ¤¥¢¥Ë¥á¤À¡£by¿¹Åç", "¡ÖËâË¡¤ÎÅ·»È ¥¯¥ê¥£¥ß¡¼¥Þ¥ß¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£byÃݲ¬", "¡Ö¥µ¥¶¥¨¤µ¤ó¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£byÎëÌÚ", "¡Ö¥à¡¼¥ß¥ó¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£byÎëÌÚ", "¡Ö¥Þ¥ó¥¬ÂçºîÀï¡×¤Î¥í¡¼¥É¥é¥ó¥Ê¡¼¥·¥ê¡¼¥º¤ÏÎɤ¤ÈÖÁȤÀ¡£by¿·½Ð", "¡Ö¥¹¥×¡¼¥ó¤ª¤Ð¤µ¤ó¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£by³û", "¡Ö¤Ï¤¸¤á¿Í´Ö¥®¥ã¡¼¥È¥ë¥º¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£byÉÙ±Ê", "¡Ö±§Ãè¤Îµ³»Î¥Æ¥Ã¥«¥Þ¥ó¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£by¶ðÍò", "¡ÖÍŲø¿Í´Ö¥Ù¥à¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£by³û", "¡Ö¥¢¥ë¥×¥¹¤Î¾¯½÷¥Ï¥¤¥¸¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£byÉÙ±Ê", "¡Ö¤È¤­¤á¤­¥È¥¥¥Ê¥¤¥È¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£by¶ðÍò", "¡Ö¤¢¤·¤¿¤Î¥¸¥ç¡¼¡×¤ÏÎɤ¤ÈÖÁȤÀ¤Ã¤¿¤Í¡£byΩÌڡʤĤ¤¤­¡Ë", "¡Ö¤­¤Þ¤°¤ì¥ª¥ì¥ó¥¸¡¦¥í¡¼¥É¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£by»°¹¥¡¦ÉþÉô", "¡Ö¥²¥Ã¥¿¡¼¥í¥Ü¡×¡Ê¡Ö¥²¥Ã¥¿¡¼¥í¥Ü£Ç¡×¤ò´Þ¤à¡Ë¤ÏÎɤ¤ÈÖÁȤÀ¡£by¿·½Ð", "¡Ö¥Æ¥Ã¤Á¤ã¤ó¡×¡Ê¡Ö¤¸¤ã¤ê¥ó»Ò¥Á¥¨¡×¤Î¤³¤È¡Ë¤ÏÎɤ¤ÈÖÁȤÀ¡£by¾¾ÅÄ", "¡Ö¥Á¥­¥Á¥­¥Þ¥·¥óÌԥ졼¥¹¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£byÉþÉô", "¡Ö¾®¸ø½÷¥»¡¼¥é¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£by¿¹Åç", "¡ÖÈëÌ©ÀïÂ⥴¥ì¥ó¥¸¥ã¡¼¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£by¿·½Ð", "¡ÊÇò¹õ»þÂå¤Î¡Ë¡ÖÅ´¿Í28¹æ¡×¤ÏÎɤ¤ÈÖÁȤÀ¡£byºùÀî" }; if(i >= 0) printf("%s\n", opinion[i % OPIMAX]); else if(i == -1) for(i= 0; i< OPIMAX; i++) printf("%s\n",opinion[i]); return(OPIMAX); } #endif /* OMAKE */ /** ÊÑ´¹¥Ð¥Ã¥Õ¥¡¤Î¥¯¥ê¥¢ */ void romkan_clear_body(cur_rk) ARGS *cur_rk; { #ifdef KDSP # ifdef MVUX *displine = EOLTTR; # endif #endif ungetc_buf = *keybuf = *urabuf = *disout = *rk_output = EOLTTR; curdis = DISOUT; lastoutlen = lastkbflen = 0; } void romkan_clear() { ARGS *cur_rk = NULL; LockMutex(&(cur_rk->rk_lock)); romkan_clear_body(cur_rk); UnlockMutex(&(cur_rk->rk_lock)); } /** ɽ¤òÆÉ¤ß¹þ¤ó¤ÇÊÑ´¹¤Î½é´üÀßÄê¤ò¤¹¤ë¡£¡Êpart 1¡Ë*/ int romkan_init (modhyo, delchr_, chmoutf, keyinfn, bytcntfn) char *modhyo, chmoutf; letter delchr_; letter (*keyinfn)(); int (*bytcntfn)(); /* °ú¿ô¤Î¾ÜºÙ¤Ïromkan_init3¤ò»²¾È */ { return( romkan_init2 (modhyo, delchr_, chmoutf, keyinfn, bytcntfn, 0, 0, 0)); } #define ifflg(a, b) ((a) ? (b) : 0) /** ɽ¤òÆÉ¤ß¹þ¤ó¤ÇÊÑ´¹¤Î½é´üÀßÄê¤ò¤¹¤ë¡£¡Êpart 2: ¥­¡¼ÆþÎϤËÂФ·É¬¤º²¿¤« ÊÖ¤¹¤è¤¦¤Ë¤¹¤ë¤«¡¢¥­¡¼¥Ð¥Ã¥Õ¥¡¤ò¥¯¥ê¥¢¤¹¤ë¤«¤É¤¦¤«¤Ê¤É¤â»ØÄê²Ä¡Ë*/ int romkan_init2 (modhyo, delchr_, chmoutf, keyinfn, bytcntfn, keyackf, restartf, nonisecodf) char *modhyo, chmoutf, keyackf, restartf, nonisecodf; letter delchr_; letter (*keyinfn)(); int (*bytcntfn)(); /* °ú¿ô¤Î¾ÜºÙ¤Ïromkan_init3¤ò»²¾È */ { return( romkan_init3 (modhyo, delchr_, toNISE(delchr_), EOLTTR, keyinfn, bytcntfn, (int (*)())NULL, restartf, ifflg(chmoutf, RK_CHMOUT) | ifflg(keyackf, RK_KEYACK) | ifflg(nonisecodf, RK_NONISE) | RK_DSPNIL)); } /** ɽ¤òÆÉ¤ß¹þ¤ó¤ÇÊÑ´¹¤Î½é´üÀßÄê¤ò¤¹¤ë¡£¡Êpart 3¡Ë*/ int romkan_init3 (modhyo, delchr_, nisedl_, delchr2_, keyinfn, bytcntfn, kbytcntfn, restartf, flags_) char *modhyo; /* ¥â¡¼¥ÉÄêµÁɽ¤Î̾Ëô¤Ï¤½¤Î¥Ñ¥¹Ì¾ */ letter delchr_; /* DEL¤È¤·¤Æ»È¤¦¥³¡¼¥É */ letter nisedl_; /* µ¶DEL¤È¤·¤Æ»È¤¦¥³¡¼¥É */ letter delchr2_; /* DEL¤È¤·¤Æ»È¤¦¥³¡¼¥É¤¬Æó¤Ä¤¢¤ë¾ì¹ç¤½¤Î¤â¤¦°ìÊý */ letter (*keyinfn)(); /* ¥­¡¼¥¤¥ó´Ø¿ô */ int (*bytcntfn)(); /* ¥Ð¥¤¥È¥«¥¦¥ó¥È´Ø¿ô */ int (*kbytcntfn)(); /* ¥­¡¼¥¤¥ó¤Î²ò¼áÍѥХ¤¥È¥«¥¦¥ó¥È´Ø¿ô¡£NULL»ØÄê¤Î»þ¤Ï bytcntfn¤ÈƱ¤¸¤â¤Î¤¬»È¤ï¤ì¤ë */ char restartf; /* rk_rst()Æâ¤«¤é¸Æ¤Ð¤ì¤¿»þ¤ËΩ¤Ä¥Õ¥é¥°¡£¤³¤ì¤¬Î©¤Ä¤È¡¢¥Ð¥Ã¥Õ¥¡¤ò¥¯¥ê¥¢ ¤»¤º¤ËºÑ¤Þ¤¹¡£¤³¤Î»þ¤Ï¥¨¥é¡¼¸¡½Ð»þ¤Î¥á¥Ã¥»¡¼¥¸¤â¾¯¤·°Û¤Ê¤ë */ int flags_; /* °Ê²¼¤Î¥Õ¥é¥°¤¬ÍøÍѲġ£¤³¤ì¤é¤Ïrk_spclval.h¤Ë¤ÆÄêµÁ¡£ RK_CHMOUT:¥â¡¼¥É¥Á¥§¥ó¥¸¤òÃΤ餻¤ë¥³¡¼¥É¤òÊÖ¤¹¤«¡© RK_KEYACK:¥­¡¼¥¤¥ó¤ËÂФ·É¬¤º²¿¤«¤òÊÖ¤¹¤« RK_DSPNIL:romkan_disp(off)mode¤Î¥Ç¥Õ¥©¥ë¥È¤ò¶õʸ»úÎó¤Ë¤¹¤ë¤« RK_NONISE:µ¶¥³¡¼¥É¤ò½Ð¤µ¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤« RK_REDRAW:WnnÍÑÆÃ¼ì¥Õ¥é¥°¡ÊredrawÍѤΥե饰¤ò½Ð¤¹¤«¤É¤¦¤«¡Ë RK_SIMPLD:delete¤Îưºî¤òñ½ã¤Ë¤¹¤ë¤« RK_VERBOS:verbose¥â¡¼¥É¤Çµ¯¤³¤¹¤« */ { int errcod; /* º£¤Î½ê1¤Î¤ß */ ARGS *cur_rk; DoOnce( &once, _InitMutexs ); LockMutex(&open_lock); cur_rk = NULL; /* µ¶¥³¡¼¥É¤ò½Ð¤¹¤«¤ÎÀßÄê¤Ïromkan_clear¤Ç»È¤¦¤Î¤Ç¡¢¥Õ¥é¥°¤ÎÀßÄê¤ò Àè¤Ë¤ä¤Ã¤Æ¤ª¤«¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£*/ if((flags = flags_) & RK_VERBOS){ fprintf(stderr, "romkan_init invoked.\r\n"); fflush(stderr); } #ifdef OMAKE if(modhyo == NULL) takeoka(-1); /* ¤ª¤Þ¤±¡¨Ä̾ï¤Ï¼Â¹Ô¤µ¤ì¤Ê¤¤ */ #endif /* OMAKE */ keyin_method = keyinfn; bytcnt_method = (bytcntfn == NULL ? head_bytecount : bytcntfn); kbytcnt_method = (kbytcntfn == NULL ? bytcnt_method : kbytcntfn); strcpy(prv_modfnm, modhyo); delchr = delchr_; nisedl = nisedl_; delchr2 = delchr2_; /** ¼Â¤ÏDEL¤Î¥­¥ã¥é¥¯¥¿¤òÆó¸Ä¤Þ¤Ç»ý¤Æ¤ë¡£Æó¸ÄÌÜ¡§delchr2¤Ï¡¢Ì¤ÀßÄê¤Î ¤È¤­¡ÊÃͤ¬EOLTTR¡Ë¤Ï̵»ë¤µ¤ì¤ë¡£¤½¤ì°Ê³°¤Ï¡¢delchr2¤¬ÆþÎϤµ¤ì¤ë¤È delchr¤¬ÆþÎϤµ¤ì¤¿¤Î¤ÈƱ¤¸¿¶¤ëÉñ¤¤¤ò¤¹¤ë¡£*/ if((errcod = setjmp(env0)) != 0){ fprintf(stderr,"romkan_init failed."); if(!restartf){ romkan_reset_body(cur_rk); /* fprintf(stderr, "No conversion is currently performed."); */ fprintf(stderr, "\r\n"); } else { fprintf(stderr, "Conversion method was unchanged.\r\n"); } } else { readdata(memory, dat_data, hensudefhyo, modhyo, cur_rk); if(!restartf){ romkan_clear_body(cur_rk); hank_setup(); } } if(!errcod && (flags & RK_VERBOS)){ fprintf(stderr, "romkan_init finished.\r\n"); fflush(stderr); } UnlockMutex(&open_lock); return(errcod); /* Àµ¾ï½ªÎ»¤Ê¤é0 */ } /** ¥Ð¥¤¥È¥«¥¦¥ó¥È´Ø¿ô¤Î¥Ç¥Õ¥©¥ë¥È¡£s¤Î»Ø¤·¤Æ¤¤¤ë½ê¤ËÆþ¤Ã¤Æ¤¤¤ë¤Î¤¬ ²¿¥Ð¥¤¥È¥³¡¼¥É¤«¤òÊÖ¤¹¡£ romkan_next¤ËÃí°Õ¡£¤½¤Á¤é¤Ç¤Ï¡¢¥Ð¥¤¥È¥«¥¦¥ó¥È´Ø¿ô¤ÎÃÍ¤Ï °ú¿ô¤Î°ìʸ»úÌܤˤΤ߰͸¤¹¤ë¤È²¾Äꤷ¤Æ¤¤¤ë¡£*/ static int head_bytecount(s) uns_chr *s; { #ifdef IKIS return((*s <= 0xa0 || *s == 0xff)? 1 : 2); #else return((((*s <= 0xa0) && (*s != HNKAK1)) || (*s == 0xff))? 1 : 2); #endif } /** ÊÑ´¹¤µ¤ì¤¿Ê¸»ú¤ò½ç¼¡ÊÖ¤¹ */ letter romkan_getc_body(cur_rk) ARGS *cur_rk; { letter l; /* ungetc¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤½¤ì¤ò¼è¤ê½Ð¤¹¡£*/ if(ungetc_buf != EOLTTR) return(l = ungetc_buf, ungetc_buf = EOLTTR, l); while(*curdis == EOLTTR){ /* romkan_next()¤ÎÃͤ¬LTREOF¤Î»þ¤â¡¢¤½¤Î¤Þ¤ÞÁ÷¤ì¤ÐÎɤ¤¡£*/ curdis = romkan_henkan_body(romkan_next_body(cur_rk), cur_rk); /* keyackflg¤¬Èó0¤Ê¤é¡¢¥­¡¼¥¤¥ó¤¬¤¢¤ì¤Ðɬ¤º²¿¤«ÊÖ¤¹¡£¤½¤Î ¤¿¤á¡¢ÊÖ¤¹¤Ù¤­¤â¤Î¤¬¤Ê¤¤»þ¤ÏEOLTTR¤òÊÖ¤¹¤³¤È¤Ë¤¹¤ë¡£*/ if(flags & RK_KEYACK) break; } if(EOLTTR != (l = *curdis)) curdis++; return(l); /* µ¶Êª¤Îʸ»ú¤Ê¤é¡¢HG1BIT¤¬Î©¤Ã¤Æ¤¤¤ë¡£*/ /* ÆÃÊ̤ʥ³¡¼¥É(Î㤨¤Ðµ¶¤ÎBEEP¤È¤·¤ÆNISEBP)¤òÊÖ¤¹¤È¤­¤¬¤¢¤ë¡£¤½¤ì¤é¤Ï rk_spclval.h¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£*/ } letter romkan_getc() { letter x; ARGS *cur_rk = NULL; LockMutex(&(cur_rk->rk_lock)); x = romkan_getc_body(cur_rk); UnlockMutex(&(cur_rk->rk_lock)); return x; } /** romkan_getc¤Î²¼°Ì´Ø¿ô¤È¤·¤Æ¡¢ÆþÎϤò°ìʸ»ú¼õ¤±¼è¤Ã¤Æ ÊÑ´¹·ë²Ì¤Îʸ»úÎó¤ò½ÐÎϤ¹¤ë¡£*/ letter * romkan_henkan_body(mae_in, cur_rk) letter mae_in; ARGS *cur_rk; { letter mae_out[2], *p, *x; /* if(*curdis != EOLTTR){p = curdis; curdis = nil; return(p);} */ /* ¢¬¤³¤ì¤Ç¤Ïmae_in¤¬Ìµ»ë¤µ¤ì¤ë */ curdis = nil; /* Á°¡¦¸å½èÍý¤Ø¤ÎÆþÎϤϾï¤Ë¤¿¤À°ìʸ»ú */ mae_out[0] = mae_out[1] = EOLTTR; eofflg = rk_errstat = 0; *rk_output = *disout = EOLTTR; maeato_henkan(mae_in, mae_out, usemaehyo, cur_rk); rk_input = *mae_out; if(rk_input == LTREOF){ /* LTREOF¤¬Í褿¾ì¹ç¡¢(error)¤ò̵»ë¤·¡¢ËܽèÍý¥Ð¥Ã¥Õ¥¡¤ÎËöÈøËø ¶¯À©ÊÑ´¹¤¹¤ë¡£¤½¤Î¤¿¤á¤Ëeofflg¤ò1¤Ë¤¹¤ë¡£¤½¤Î¸å¡¢·ë²Ì¤Î ËöÈø¤Ë¡¢LTREOF¤¬Í褿»þ¤ÎÆÃÊÌ¥³¡¼¥É¡Ê»ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡Ë¤È¡¢ LTREOF¤ò¤Ä¤Ê¤°¡£*/ eofflg = 1; match(cur_rk); eofflg = 2; add_at_eof(cur_rk); /* codeout¤Ë¡¢LTREOF¤¬Í褿»þ½Ð¤¹¥³¡¼¥É¤¬Æþ¤ë¡£*/ ltr1cat(codeout, LTREOF); ltrcat(disout, codeout); ltrcat(rk_output, codeout); } else if(rk_input == EOLTTR){ /* EOLTTR¤¬Í褿¾ì¹ç¤â¡¢¾å¤ÈƱÍͤνèÍý¤ò¹Ô¤¦¤¬¡¢LTREOF¤Ï ¤Ä¤Ê¤¬¤Ê¤¤¡£¤Ê¤ª¡¢¤³¤ì¤Ïromkan_getc()¤ò¸Æ¤ó¤Ç¤¤¤ë»þ¤Ï µ¯¤³¤é¤Ê¤¤¡Êromkan_next()¤¬EOLTTR¤òÊÖ¤µ¤Ê¤¤¤«¤é¡Ë¡£*/ eofflg = 1; match(cur_rk); } else if(rk_input == delchr || rk_input == delchr2){ /* delchr2¤¬Ì¤ÀßÄê¤Ê¤é¤½¤ÎÃͤÏEOLTTR¤Ê¤Î¤Çrk_input¤ÈÅù¤·¤¯¤Ê¤¤¡£*/ rk_delete(rk_input, cur_rk); } else { ltr1cat(keybuf, rk_input); ltr1cat(disout, toNISE(rk_input)); match(cur_rk); } if(!(flags & RK_CHMOUT)){ /* chmoutflg¤¬0¤Î»þ¤Ï¡¢CHMSIG¤ò½Ð¤µ¤Ê¤¤¡£*/ for(p = DISOUT; ; p++){ while(*p == CHMSIG) ltrcpy(p, p + 1); if(*p == EOLTTR) break; } } if((flags & RK_REDRAW) && NULL != (p = ltr_rindex(disout, nisedl))){ for(p++; *p != EOLTTR || (ltr1cat(disout, REDRAW), 0); p++) if(!isSPCL(*p)) break; } /* wnn¤Îredraw¤Î¥Õ¥é¥°¤¬Î©¤Ã¤Æ¤¤¤Æ¡¢disout¤¬nisedl°Ê¸åÆÃ¼ì¥³¡¼¥É¤Î¤ß ¤Ç½ª¤ï¤Ã¤Æ¤¤¤¿¤é¡¢REDRAW¤ò½Ð¤·¤Æ¡¢Wnn¤ËÊÑ´¹¹Ô¤Îredraw¤ò¤µ¤»¤ë¡£*/ x = DISOUT; return x; } letter * romkan_henkan(mae_in) letter mae_in; { letter *x; ARGS *cur_rk = NULL; LockMutex(&(cur_rk->rk_lock)); x = romkan_henkan_body(mae_in, cur_rk); UnlockMutex(&(cur_rk->rk_lock)); return x; } /* ¥Ç¥Ð¥Ã¥°ÍÑ´Ø¿ô */ #ifdef KDSP # ifdef MVUX void pridbg2(a, b, c) char *a, *c; letter *b; { printf("%s", a); dump_fordbg(b); printf("%s", c); } int ltr_displen(l) letter l; { while(l >= 256) l >>= 8; if(l == 0) return(0); if(l < ' ') return(0); if(168 <= l && l <= 170) return(1); return(l > 160 ? 2 : 1); } void dump_fordbg(lp) letter *lp; { while(*lp != EOLTTR) printf("%x/", *lp++); } void print_fordbg(lp) letter *lp; { while(*lp != EOLTTR) putletter(*lp++ & ~HG1BIT); } void print_ltrseq(lp, cur_rk) letter *lp; ARGS *cur_rk; { while(*lp != EOLTTR) print_ltr(*lp++ & ~HG1BIT, cur_rk); } void print_ltr(l, cur_rk) letter l; ARGS *cur_rk; { letter *disptail; int i; if(!isSPCL(l)) l &= ~HG1BIT; if(l == CHMSIG) #ifdef CHMDSP printf("...mode=%s\n",romkan_dispmode_body(cur_rk)) #endif ; else #define BEEPCH '\007' #define NEWLIN '\n' if(l == BEEPCH || l == NISEBP) putchar(BEEPCH); else if(l == NEWLIN){ *displine = *keybuf = *urabuf = EOLTTR; lastoutlen = lastkbflen = 0; putchar(l); } else if(l == delchr || l == nisedl){ if(*displine == EOLTTR) putchar(BEEPCH); else { disptail = ltrend(displine); for(i = ltr_displen(*disptail); i; i--) printf("\031 \031"); *disptail = EOLTTR; } } else { ltr1cat(displine, l); putletter(l); } } # endif /* of #ifdef MVUX */ #endif /* ¥Ç¥Ð¥Ã¥°ÍÑ´Ø¿ô½ª¤ï¤ê */ /** DEL¤¬ÆþÎϤµ¤ì¤¿¤È¤­¤Î½èÍý¤ò¤¹¤ë */ static void rk_delete(input_del, cur_rk) letter input_del; ARGS *cur_rk; { if(ltrlen(keybuf) > ((flags & RK_SIMPLD) ? 0 : lastkbflen)){ ltr1cut(keybuf); set_rubout(disout, 1, nisedl); } else { if(*urabuf != EOLTTR && !(flags & RK_SIMPLD)){ ltr1cut(ltrcpy(keybuf, urabuf)); *urabuf = EOLTTR; set_rubout(rk_output, lastoutlen, input_del); set_rubout(disout, lastkbflen, nisedl); bitup_ltrcat(ltrcat(disout, rk_output), keybuf); lastkbflen = lastoutlen = 0; } else { set_rubout(disout, 1, input_del); set_rubout(rk_output, 1, input_del); } } } /** letter¤ÎÎó lp1 ¤È lp2 ¤Î¥Þ¥Ã¥Á¤ò»î¤ß¤ë¡£ÊÖÃͤϡ¢lp1¤¬lp2¤ÎƬÉô¤È °ìÃפλþ -1¡¢lp1¤Þ¤¿¤Ï¤½¤ÎƬÉô¤Èlp2¤¬°ìÃפΤȤ­¤Ï°ìÃ×Ĺ¡Êlp2¤¬ ¶õʸ»úÎó¤Î»þ¤ò´Þ¤à¡£¤³¤Î¾ì¹çÊÖÃͤÏ0¡Ë¡¢¤½¤ì°Ê³°¤Ï -2¡£ lp2¦¤Ë¼°¤¬´Þ¤Þ¤ì¤Æ¤¤¤¿¤éɾ²Á¤ò¤¹¤ë¡£lp1¦¤Ë¤Ï¼°¤ò´Þ¤ó¤Ç¤Ï¤À¤á */ static int prefixp(lp1, lp2, cur_rk) letter *lp1, *lp2; ARGS *cur_rk; { /* 1¹Ô¥Þ¥Ã¥Á¤µ¤»¤ë¤´¤È¤Ë¡¢¤Þ¤ºmatch¾ðÊó¤ò¥¯¥ê¥¢¤·¤Æ¤«¤é¡£ ¤Ä¤Þ¤ê¡¢henmatch[0] . ltrmch = EOLTTR; ¤È¤·¤Æ¤ª¤¯¡£*/ register int mch_len = 0, d_len; for(;;){ if(*lp2 == EOLTTR) return(mch_len); if(*lp1 == EOLTTR) return(-1); if((d_len = p_eq(&lp2, &lp1, cur_rk)) < 0) return(d_len); mch_len += d_len; } } /** numÈÖÌܤÎÊÑ¿ô¤¬´û¤Ë¤¢¤ëʸ»ú¤È¥Þ¥Ã¥Á¤·¤Æ¤¤¤ë¤È²¾Äꤷ¤Æ¡¢¤½¤Îʸ»ú¤òÊÖ¤¹ */ static letter mchedsrc(num, cur_rk) int num; ARGS *cur_rk; { struct matchpair *pairptr; for(pairptr = henmatch; pairptr -> ltrmch != EOLTTR; pairptr++){ if(num == pairptr -> hennum) return(pairptr -> ltrmch); } return(BUGreport(8), 0); } /** numÈÖÌܤÎÊÑ¿ô¤¬Ê¸»ú l ¤È¥Þ¥Ã¥Á¤¹¤ë¤«Ä´¤Ù¤ë¡£¤½¤ÎÊÑ¿ô¤¬unbound¤À¤Ã¤¿ ¾ì¹ç¤Ï l ¤Ëbind¤¹¤ë¡£¥Þ¥Ã¥Á¤·¤¿¤é(bind¤Î»þ¤ò´Þ¤à)1¡¢¤·¤Ê¤¤¤È0¤òÊÖ¤¹ */ static int mchsrc(num, l, cur_rk) int num; letter l; ARGS *cur_rk; { struct matchpair *pairptr; if(hen_ikisrc(num, l, cur_rk) == 0) return(0); for(pairptr = henmatch; pairptr -> ltrmch != EOLTTR; pairptr++){ if(num == pairptr -> hennum) return(pairptr -> ltrmch == l); } pairptr -> ltrmch = l; pairptr -> hennum = num; (++pairptr) -> ltrmch = EOLTTR; return(1); } /** l1p¤«¤é°ìñ°Ì¤ò¼è¤Ã¤ÆÉ¾²Á¤·¡¢Ê¸»úl2¤È°ìÃפ¹¤ë¤«¤É¤¦¤«¤òÊÖ¤¹¡£É¾²Á¤·¤¿ ·ë²Ì¤¬°ìʸ»ú¤Ë¤Ê¤é¤Ê¤«¤Ã¤¿¤é¡¢ÅöÁ³°ìÃפ·¤Ê¤¤¡£*/ static int l_eq(l1p, l2, cur_rk) letter *l1p, l2; ARGS *cur_rk; { letter evlrsl[RSLMAX]; switch(SHUBET(*l1p)){ case 0: return(*l1p == l2); case 1: return(mchsrc((int)LWRMSK(*l1p), l2, cur_rk)); case 2: mchevl(&l1p, evlrsl, cur_rk); return(evlrsl[0] == l2 && evlrsl[1] == EOLTTR); default: return(BUGreport(1), 0); } } /** prefixpÆâ¤Ç»ÈÍÑ Ã¢¤·°ú¿ô¤Î½ç½ø¤ÏµÕ¡¢¤¹¤Ê¤ï¤Á¼°¤¬´Þ¤Þ¤ì¤¦¤ë¤Î¤Ïl1pp¦ ¤Î¤ß¡£l1pp¤«¤é°ìñ°Ì¤Ö¤ó¼è¤Ã¤ÆÉ¾²Á¤·¤¿¤â¤Î¤Èl2pp¤Î¥Þ¥Ã¥Á¤ò»î¤ß¤ë¡£¤½¤ì ¤¬l2pp¤Þ¤¿¤Ï¤½¤ÎƬÉô¤È¥Þ¥Ã¥Á¤¹¤ì¤Ð°ìÃ׍òÊÖ¤·¡Êl1pp¤Îɾ²Á·ë²Ì¤¬¶õʸ»ú Îó¤Î»þ¤ò´Þ¤à¡£¤³¤Î¾ì¹çÊÖÃͤÏ0¡Ë¡¢µÕ¤Ël1pp¤Îɾ²Á·ë²Ì¤ÎƬÉô¤Èl2pp¤¬¥Þ¥Ã ¥Á¤·¤¿»þ¤Ï -1¤òÊÖ¤¹¡£¥Þ¥Ã¥Á¤¬¼ºÇÔ¤·¤¿¤éÊÖÃÍ¤Ï -2¡£*/ static int p_eq(l1pp, l2pp, cur_rk) register letter **l1pp, **l2pp; ARGS *cur_rk; { int num; letter evlrsl[RSLMAX], *rslptr; register int retval = -2; /* l2pp¦¤Ë¤Ï¼°¤ò´Þ¤Þ¤Ê¤¤È¦ */ if(!is_HON(**l2pp)){ /* if(is_HON(**l1pp)) retval = p_eq(l2pp, l1pp); else */ BUGreport(9); } else { switch(SHUBET(**l1pp)){ case 0: /* ʸ»úƱ»Î */ retval = (*(*l1pp)++ == *(*l2pp)++ ? 1 : -2); break; case 1: /* ÊÑ¿ô¤Èʸ»ú */ num = LWRMSK(*(*l1pp)++); retval = (mchsrc(num, *(*l2pp)++, cur_rk) ? 1 : -2); break; case 2: /* ¼°¤Èʸ»ú */ mchevl(l1pp, rslptr = evlrsl, cur_rk); for(retval = 0; *rslptr != EOLTTR; retval++){ if(**l2pp == EOLTTR){ retval = -1; break; } else if(*rslptr++ != *(*l2pp)++){ retval = -2; break; } } break; default: BUGreport(2); } } return(retval); } /** l1p¤«¤é°ìñ°Ìɾ²Á¤·¤Æl2p¤ËÆþ¤ì¤ë */ static void mchevl(l1pp, l2p, cur_rk) letter **l1pp, *l2p; ARGS *cur_rk; { letter *l1p, tmpevl[RSLMAX]; l1p = *l1pp; switch(SHUBET(*l1p)){ case 0: *l2p++ = *l1p++; break; case 1: *l2p++ = mchedsrc((int)LWRMSK(*l1p++), cur_rk); break; case 2: /* toupper, tolower, error, ¡Ä */ switch(LWRMSK(*l1p++)){ case 2: mchevl(&l1p, tmpevl, cur_rk); *l2p++ = to_upper(*tmpevl); break; case 3: mchevl(&l1p, tmpevl, cur_rk); *l2p++ = to_lower(*tmpevl); break; case 4: *l2p++ = CHMSIG; *l2p++ = LWRMSK(*l1p++); *l2p++ = 0; break; /* EOL¤Ç¤Ï¤Ê¤¤ */ case 5: *l2p++ = CHMSIG; *l2p++ = LWRMSK(*l1p++); *l2p++ = 1; break; case 6: *l2p++ = CHMSIG; *l2p++ = XY2INT(2, LWRMSK(*l1p++)); *l2p++ = 1; break; case 7: mchevl(&l1p, tmpevl, cur_rk); *l2p++ = to_updown(*tmpevl); break; case 8: mchevl(&l1p, tmpevl, cur_rk); *l2p++ = to_zenalpha(*tmpevl, cur_rk); break; case 9: mchevl(&l1p, tmpevl, cur_rk); *l2p++ = to_hira(*tmpevl); break; case 10: mchevl(&l1p, tmpevl, cur_rk); *l2p++ = to_kata(*tmpevl); break; case 11: mchevl(&l1p, tmpevl, cur_rk); to_hankata(*tmpevl, &l2p); break; /* ÆÃ¼ì */ case 12: mchevl(&l1p, tmpevl, cur_rk); *l2p++ = to_zenhira(*tmpevl, cur_rk); break; case 13: mchevl(&l1p, tmpevl, cur_rk); *l2p++ = to_zenkata(*tmpevl, cur_rk); break; case 14: mchevl(&l1p, tmpevl, cur_rk); *l2p = *tmpevl; mchevl(&l1p, tmpevl, cur_rk); *l2p += *tmpevl; LWRCUT(*l2p++); break; case 15: mchevl(&l1p, tmpevl, cur_rk); *l2p = *tmpevl; mchevl(&l1p, tmpevl, cur_rk); *l2p -= *tmpevl; LWRCUT(*l2p++); break; case 16: mchevl(&l1p, tmpevl, cur_rk); *l2p = *tmpevl; mchevl(&l1p, tmpevl, cur_rk); *l2p *= *tmpevl; LWRCUT(*l2p++); break; case 17: mchevl(&l1p, tmpevl, cur_rk); *l2p = *tmpevl; mchevl(&l1p, tmpevl, cur_rk); if(! *tmpevl) *l2p = LTRHUG; else *l2p /= *tmpevl; LWRCUT(*l2p++); break; case 18: mchevl(&l1p, tmpevl, cur_rk); *l2p = *tmpevl; mchevl(&l1p, tmpevl, cur_rk); if(! *tmpevl) *l2p = LTRHUG; else *l2p %= *tmpevl; LWRCUT(*l2p++); break; /* 19¡Á21¡¦30¤Ï¡¢¾ò·ï¤òËþ¤¿¤¹¤È¶õʸ»úÎó¡¢ ¤½¤¦¤Ç¤Ê¤¤¤ÈUNUSDC¤òʸ»úÎó¤È¤·¤ÆÊÖ¤¹¡£*/ case 19: mchevl(&l1p, tmpevl, cur_rk); if(lastmch(cur_rk) != *tmpevl) *l2p++ = UNUSDC; break; case 20: if(! modesw[LWRMSK(*l1p++)] . curmode) *l2p++ = UNUSDC; break; case 21: if(modesw[LWRMSK(*l1p++)] . curmode) *l2p++ = UNUSDC; break; case 22: *l2p++ = REASIG; break; case 23: *l2p++ = delchr; break; case 24: *l2p++ = CHMSIG; *l2p++ = XY2INT(1, 0); /* ¤³¤ì¤Ç¡Öall¡×¤òɽ¤¹ */ *l2p++ = 0; break; case 25: *l2p++ = CHMSIG; *l2p++ = XY2INT(1, 0); *l2p++ = 1; break; case 26: mchevl(&l1p, tmpevl, cur_rk); *l2p = *tmpevl; mchevl(&l1p, tmpevl, cur_rk); *l2p &= *tmpevl; LWRCUT(*l2p++); break; case 27: mchevl(&l1p, tmpevl, cur_rk); *l2p = *tmpevl; mchevl(&l1p, tmpevl, cur_rk); *l2p |= *tmpevl; LWRCUT(*l2p++); break; case 28: mchevl(&l1p, tmpevl, cur_rk); *l2p = ~(*tmpevl); LWRCUT(*l2p++); break; case 29: *l2p++ = URBFCL; break; case 30: if(eofflg != 2 || *keybuf != EOLTTR) *l2p++ = UNUSDC; break; case 31: { letter code, basenum; mchevl(&l1p, tmpevl, cur_rk); code = *tmpevl; mchevl(&l1p, tmpevl, cur_rk); if((basenum = *tmpevl) <= 1 || BASEMX < basenum) basenum = 10; to_digit(code, basenum, &l2p); } break; case 32: mchevl(&l1p, tmpevl, cur_rk); dakuadd(*tmpevl, &l2p); break; /* ÆÃ¼ì */ case 33: mchevl(&l1p, tmpevl, cur_rk); handakuadd(*tmpevl, &l2p); break; /* ÆÃ¼ì */ case 34: mchevl(&l1p, tmpevl, cur_rk); *l2p++ = ltov(*tmpevl); break; case 35: *l2p++ = ERRCOD; break; /* case 36: omitted */ case 37: *l2p++ = CHMSIG; *l2p++ = LWRMSK(*l1p++); *l2p++ = *l1p++; break; case 38: *l2p++ = CHMSIG; *l2p++ = XY2INT(2, LWRMSK(*l1p++)); *l2p++ = *l1p++; break; case 39: *l2p++ = CHMSIG; *l2p++ = XY2INT(3, LWRMSK(*l1p++)); *l2p++ = *l1p++; break; case 40: { letter modnum; modnum = LWRMSK(*l1p++); if(modesw[modnum] . curmode != *l1p++) *l2p++ = UNUSDC; break; } case 41: { letter modnum; modnum = LWRMSK(*l1p++); if(modesw[modnum] . curmode == *l1p++) *l2p++ = UNUSDC; break; } case 42: { letter modnum; modnum = LWRMSK(*l1p++); if(modesw[modnum] . curmode >= *l1p++) *l2p++ = UNUSDC; break; } case 43: { letter modnum; modnum = LWRMSK(*l1p++); if(modesw[modnum] . curmode <= *l1p++) *l2p++ = UNUSDC; break; } case 44: mchevl(&l1p, tmpevl, cur_rk); *l2p++ = SENDCH; *l2p++ = *tmpevl; break; default:/* case 0µÚ¤Ó¾åµ­°Ê³° */; BUGreport(7); } } *l2p = EOLTTR; *l1pp = l1p; } /** numÈÖÌܤÎÊÑ¿ô¤ÎÊѰ褬ʸ»ú l ¤ò´Þ¤à¤«¤É¤¦¤«¤òÊÖ¤¹ */ static int hen_ikisrc(num, l, cur_rk) int num; letter l; ARGS *cur_rk; { letter *defptr; defptr = hyo_n[hyonum] . hensudef[num]; if(*defptr == VARRNG){ for(defptr++; *defptr != EOLTTR; ) if(*defptr++ <= l && l <= *defptr++) return(1); return(0); } for(; *defptr != EOLTTR; defptr++){ if(l == *defptr) return(1); } return(0); } /** ÊÑ´¹¤Î¥á¥¤¥ó¥ë¡¼¥Á¥ó¡£ËܽèÍý¤ò¹Ô¤¦¤¬¡¢¤Ä¤¤¤Ç¤Ë¸å½èÍý¤â¤ä¤Ã¤Æ¤¤¤ë¡£ ¤Á¤Ê¤ß¤ËÁ°½èÍý¤Ï¡¢romkan_getc¤Î²¼°Ì´Ø¿ôromkan_henkan¤ÎÃæ¤Ç¡¢ ¤³¤Î´Ø¿ô¤ò¸Æ¤ÖÁ°¤Ë¤ä¤Ã¤Æ¤¤¤ë¡£ ¤³¤Î´Ø¿ô¤Ï¡¢romkan_next¤«¤é°ìʸ»úÍè¤ëÅ٤˸ƤФì¤ë¡£¸Æ¤Ó½Ð¤µ¤ì¤¿Ä¾¸å¤Ï output¤Ï¶õʸ»úÎó¡¢disout¤Ë¤ÏÆþÎÏ¥³¡¼¥É°ìʸ»ú¤¬Æþ¤Ã¤Æ¤¤¤ë¡£ ¤³¤Î´Ø¿ô¤ÇÆÀ¤é¤ì¤ëʸ»ú¤ÎÎ󤬡¢romkan_henkan¤ËÅϤꡢ romkan_getc¤Ï¡¢¤½¤ì¤òʸ»ú¤´¤È¤Ëʬ²ò¤·¤ÆÊÖ¤¹¡£ (error)¤Ç¥¨¥é¡¼¤¬°ú¤­µ¯¤³¤µ¤ì¤¿¾ì¹ç¤Ï0¤òÊÖ¤·¡¢Àµ¾ï½ªÎ»»þ¤Ï1¤òÊÖ¤¹ */ int match(cur_rk) ARGS *cur_rk; { int henkanflg = 0, okcode = 0, chm_exist; letter *p; letter urabufcreate[KBFSIZ], orgkeybuf[KBFSIZ], kbftail[KBFSIZ]; letter *urabufjunbi, *outcutptr, *dis_end; if(*keybuf == EOLTTR){ *urabuf = EOLTTR; return(1); } ltrcpy(urabufjunbi = orgkeybuf, keybuf); outcutptr = rk_output; while((okcode = henkan_ok(cur_rk)) > 0){ henkanflg = 1; codeout_chg(cur_rk); ltrcat(rk_output, codeout); ltrcpy(kbftail, keybuf + codein_len); ltrcat(ltrcpy(keybuf, remainkbf), kbftail); if(okcode == 2){ ltrcpy(urabufjunbi = urabufcreate, keybuf); totail(outcutptr); } } if(okcode == 0){ ltr1cut(ltrcpy(keybuf, orgkeybuf)); ltr_to_ltrseq(disout, NISEBP); *rk_output = EOLTTR; return(0); } if(henkanflg){ ltrcpy(urabuf, urabufjunbi); set_rubout(disout, ltrlen(orgkeybuf) - 1, nisedl); dis_end = disout; totail(dis_end); ltrcpy(dis_end, rk_output); /* ¥â¡¼¥É¥Á¥§¥ó¥¸¤òľ¤Á¤ËÃΤ餻¤ë¤¿¤á CHMSIG¤ò½ÐÎÏ ¡ÊflagsÃæ¤ÎRK_CHMOUT¤¬Î©¤Ã¤Æ¤Ê¤¤¤È¡¢¤¢¤È¤Ç°ìʸ»ú¤º¤Ä¤Ë ʬ²ò¤¹¤ë»þÅÀ¤Ç¡¢CHMSIG¤ò¥«¥Ã¥È¡Ë¡£ ⤷¡¢rk_output¤«¤é¤Ï¡¢CHMSIG¤òÈ´¤¯¡£ ¤Þ¤¿¡¢CHMSIG¤ÏËöÈø¤Ë£±²ó¤·¤«½ÐÎϤ·¤Ê¤¤ ¡Ê£²²ó°Ê¾å¤¢¤Ã¤Æ¤â¡¢£±²ó¤Ë¤Þ¤È¤á¤Æ¡¢ËöÈø¤ËÃÖ¤¯¡Ë¡£*/ for(chm_exist = 0, p = rk_output; ; p++){ while(*p == CHMSIG){ chm_exist = 1; if(ltrcpy(p, p + 1) < outcutptr) outcutptr--; } if(*p == EOLTTR) break; } if(chm_exist){ /* CHMSIG¤ò£±¤Ä¤Ë¤Þ¤È¤á¤¿¤â¤Î¤òdis_end¤Ë¤Ä¤Ê¤²Ä¾¤¹¡£ ¤³¤Îifʸ¤ò¥«¥Ã¥È¤¹¤ì¤Ð¡¢CHMSIG¤Î¤È¤ê¤Þ¤È¤á¤Ï¤ä¤é¤Ê¤¤ */ ltr1cat(ltrcpy(dis_end, rk_output), CHMSIG); } bitup_ltrcat(disout, keybuf); lastoutlen = ltrlen(outcutptr); lastkbflen = ltrlen(keybuf); } return(1); } /** LTREOF¤¬Æþ¤Ã¤¿¤È¤­¤Ë¡¢²¿¤«½Ð¤¹¤è¤¦¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¤«Ä´¤Ù¤Æ¡¢ codeout¤ò¤½¤Î·ë²Ì¤Îʸ»úÎó¡Ê»ØÄ꤬¤Ê¤«¤Ã¤¿¤éÅöÁ³¶õ¡Ë¤Ë¥Ý¥¤¥ó¥È¤¹¤ë¡£ ĶµÞ¤´¤·¤é¤¨¤Ç¡¢ÆÃ¼ì¥³¡¼¥ÉÅù¤Ï°ìÀÚ̵»ë¤¹¤ë¡£*/ static void add_at_eof(cur_rk) ARGS *cur_rk; { register struct dat *datptr; register int i; int hyoseq; letter evlrsl[RSLMAX], *p; for(hyoseq = 0; (hyonum = usehyo[hyoseq]) != -1; hyoseq++){ for(i = 0, datptr = hyo_n[hyonum] . data; NULL != (p = datptr[i] . code[0]); i++){ henmatch[0] . ltrmch = EOLTTR; while(*p != EOLTTR){ switch(SHUBET(*p)){ case 0: /* ʸ»ú */ case 1: /* ÊÑ¿ô */ /* ¤³¤ì¤é¤¬¤¢¤ë¾ì¹ç¤Ï¡¢NULL¤È¤Ï ¥Þ¥Ã¥Á¤·ÆÀ¤Ê¤¤¡£*/ goto Pass; case 2: /* ¼° */ mchevl(&p, evlrsl, cur_rk); if(*evlrsl != EOLTTR) goto Pass; /* ÆþÎÏ¥³¡¼¥ÉÉô¤Ë¡¢É¾²Á¤¹¤ë¤È ¶õʸ»úÎó¤Ë¤Ê¤ë¤â¤Î¤¬¡¢Â¾¤Ë¤Ï¤Ê¤¤ ¤³¤È¤¬Á°Äó¡£*/ } } ltrevlcpy(codeout = p = evalbuf[0][0], datptr[i] . code[1], cur_rk); while(*p != EOLTTR){ if(isSPCL(*p)) ltrcpy(p, p + 1); else p++; } codeout_chg(cur_rk); return; Pass: ; } } codeout = nil; } /** °ì²ó¥Þ¥Ã¥Á¤ò»î¤ß¤ë¡£ÊÖÃͤϡ¢¥Þ¥Ã¥Á¤·¤Æ³ÎÄꤷ¤¿¾ì¹ç1¡Ê¥â¡¼¥É¥Á¥§¥ó¥¸¤¬ º®¤¸¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï2¡Ë¡¢¥Þ¥Ã¥Á¤·¤¿¤¬Ì¤³ÎÄê¤Î»þ-1¡¢¥Þ¥Ã¥Á¤·¤Ê¤«¤Ã¤¿¤é0¡£ ¼Â¹ÔÃæ¤Ï¡¢ÊÑ¿ô l ¤Ë¡¢¤½¤ì¤Þ¤Ç¤Ë°ìÃפ·¤¿Ä¹¤µ¤ÎºÇ¹âµ­Ï¿¤òÆþ¤ì¤Æ¤ª¤ê¡¢ ¤è¤êŤ¯°ìÃפ¹¤ë¤â¤Î¤¬¸«¤Ä¤«¤ë¤´¤È¤Ë¡¢¤³¤ì¤ò¹¹¿·¤¹¤ë¡£l¤ÎÃͤϡ¢¥Þ¥Ã¥Á ¤·¤Æ¤¤¤Æ¤â0¤Ë¤Ê¤ë¤³¤È¤â¤¢¤ë¡£p_eq() µÚ¤Ó prefixp() ¤ÎÃí¼áʸ¤ò»²¾È¡£*/ static int henkan_ok(cur_rk) ARGS *cur_rk; { register struct dat *datptr; register int i, k; int l, j, hyoseq; char urabuf_clrf; /* ¥â¡¼¥É¥Á¥§¥ó¥¸¤Ê¤É¤Ç¡¢urabuf¤ò¥¯¥ê¥¢¤¹¤ëɬÍפ¬ À¸¤¸¤¿¾ì¹ç¤Ï¤³¤ì¤¬Î©¤Á¡¢¤½¤Î·ë²Ì¡¢henkan_ok() ¤¬1¤òÊÖ¤¹¤Ù¤­¤È¤³¤í¤Ç2¤òÊÖ¤¹¡£¤½¤ì¤ò¸«¤Æ¡¢ match()¤¬urabuf¤Ê¤É¤ÎÄ´À°¤ò¤¹¤ë¡£*/ register letter *p; if(*keybuf == EOLTTR) return(-1); for(l = -1, hyoseq = 0; (hyonum = usehyo[hyoseq]) != -1; hyoseq++){ for(i = 0, datptr = hyo_n[hyonum] . data; NULL != (p = datptr[i] . code[0]); i++){ henmatch[0] . ltrmch = EOLTTR; switch(k = prefixp(keybuf, p, cur_rk)){ case -2: break; case -1: if(eofflg != 0) break; /* eofflg¤¬Î©¤Ã¤Æ¤¤¤¿¤é¡¢Ì¤³ÎÄê¤Î²ÄǽÀ­¤Ï ¼Î¤Æ¤ë¡£*/ return(-1); default: if(k > l){ ebf_sw = !ebf_sw; for(j = 1; j <= 2; j++){ ltrevlcpy( evalbuf[(int)ebf_sw][j-1], datptr[i] . code[j], cur_rk); } l = k; } } } } if(l >= 0){ codein_len = l; codeout = evalbuf[(int)ebf_sw][0]; remainkbf = evalbuf[(int)ebf_sw][1]; for(urabuf_clrf = 0, p = codeout; *p != EOLTTR;){ switch(*p){ case CHMSIG: p++; /* codeout¤Î1¥Ð¥¤¥ÈÌܤ˴ؿô¤Î¥¹¥¤¥Ã¥Á¤È¥â¡¼¥ÉÈֹ桢 2¥Ð¥¤¥ÈÌܤ˥⡼¥É¤Î¿·¾õÂÖ¤¬Æþ¤Ã¤Æ¤ë */ switch(SHUBET(*p)){ case 0: chgmod((int)*p, (modetyp)*(p + 1), cur_rk); break; case 1: allchgmod((modetyp) *(p + 1), cur_rk); break; case 2: incmod((int)LWRMSK(*p) ,(modetyp)*(p + 1), cur_rk); break; case 3: decmod((int)LWRMSK(*p) ,(modetyp)*(p + 1), cur_rk); break; } ltrcpy(p, p + 2); /* CHMSIG¤À¤±»Ä¤·¤Æ1,2¥Ð¥¤¥ÈÌÜcut */ urabuf_clrf = 1; break; case URBFCL: /* urabuf¤Î¥¯¥ê¥¢¤òÌÀ¼¨Åª¤Ë»ØÄꤹ¤ë */ urabuf_clrf = 1; ltrcpy(p, p + 1); break; default: p++; } } if(*codeout == ERRCOD){ if(eofflg == 0){ rk_errstat = 1; return(0); } /* (error)¤Ç¤¢¤Ã¤Æ¡¢¤·¤«¤âeofflg¤¬Î©¤Ã¤Æ¤¿¤é¡¢keybuf ¤ÎËöÈø¤Þ¤Ç¡¢¤½¤Î¤Þ¤Þ½Ð¤¹¡£*/ codein_len = ltrlen(keybuf); codeout = ltrcpy(evalbuf[(int)ebf_sw][0], keybuf); remainkbf = nil; rk_errstat = 2; return(1); } /* (error)¤ÏñÆÈ¤Ç¤·¤«½ñ¤±¤Ê¤¤¤Î¤Ç¡¢¥¨¥é¡¼¸¡½Ð¤Ï¤³¤ì¤Ç½½Ê¬¡£*/ if(*codeout == REASIG){ *codeout = (rk_rst(cur_rk) != 0 ? EOLTTR : CHMSIG); /* ºÆread¤Ç¥¨¥é¤Ã¤¿¤é¥â¡¼¥É¥Á¥§¥ó¥¸¤ÎÄÌÃΤϤ·¤Ê¤¤ */ urabuf_clrf = 1; } /* ɽ¤ÎºÆread¡£Ã¢¤·¡¢¤³¤ì¤¬µ¯¤³¤Ã¤¿¤³¤È¤ò³°¤ËÃΤ餻¤ë¤Î¤ÏCHMSIG¤Ç ¤³¤Î¥³¡¼¥É¤½¤Î¤â¤Î¤Ï³°¤Ø½Ð¤Ê¤¤¡£(restart)¤Ï¡¢(error)ƱÍÍ¡¢ ñÆÈ¤Ç¤·¤«½ñ¤±¤Ê¤¤¤Î¤Ç¡¢¸¡½Ð¤Ï¤³¤ì¤Ç½½Ê¬¡£*/ return(urabuf_clrf ? 2 : 1); } /* ɽ¤Ë¸½¤ì¤Æ¤¤¤Ê¤¤¥³¡¼¥É¤Ï¤½¤Î¤Þ¤ÞÊÖ¤¹ */ codein_len = 1; *(codeout = oneletter) = *keybuf; remainkbf = nil; return(1); } /* rk_rstÆâ¤Ç»È¤¦¥Þ¥¯¥í */ #define taihi(X, Y, N) {for(i = 0; i < N; i++) X[i] = Y[i];} #define recov(X, Y, N) {for(i = 0; i < N; i++) Y[i] = X[i];} /** ɽ¤ÎưŪºÆÆÉ¤ß¹þ¤ß¤ò¤¹¤ë¡£¸½ºß¤ÎÆâÉôɽ¸½¤òÁ´¤ÆÂàÈò¤·¡¢Á°¤ÈƱ¤¸ ¥Ç¥£¥ì¥¯¥È¥ê¡Ê¤Ë¡¢¸½ºß¤Î¤È¤³¤í¸ÂÄê¡Ë¤«¤éɽ¤òÆÉ¤ß¹þ¤à¡£¤â¤·¡¢ ÆÉ¤ß¹þ¤ßÃæ¤Ë¥¨¥é¡¼¤ò¸¡½Ð¤¹¤ì¤Ð¡¢¤â¤È¤ÎÆâÉô¥Ç¡¼¥¿¤òÉü³è¤·Èó0¤òÊÖ¤¹¡£*/ static int rk_rst(cur_rk) ARGS *cur_rk; { register int i; int j; letter memoryt[SIZALL]; struct dat datat[LINALL]; struct hyo hyo_nt[HYOMAX]; letter *hensudefhyot[VARTOT]; struct modestat modeswt[MODMAX]; char hyoshut[HYOMAX]; char *modmeibgnt[MODMAX], modmeimem_t[MODMEI]; char *dspnambgnt[DMDMAX], dspcod_t[DMDCHR]; int usemaehyot[HYOMAX], usehyot[HYOMAX], useatohyot[HYOMAX]; int naibu_t[NAIBMX]; char *dspmodt[2][2]; taihi(memoryt, memory, SIZALL); taihi(datat, dat_data, LINALL); taihi(hyo_nt, hyo_n, HYOMAX); taihi(hensudefhyot, hensudefhyo, VARTOT); taihi(modeswt, modesw, MODMAX); taihi(hyoshut, hyoshu, HYOMAX); taihi(modmeibgnt, modmeibgn, MODMAX); taihi(modmeimem_t, modmeimem_, MODMEI); taihi(dspnambgnt, dspnambgn, DMDMAX); taihi(dspcod_t, dspcod_, DMDCHR); taihi(usemaehyot, usemaehyo, HYOMAX); taihi(usehyot, usehyo, HYOMAX); taihi(useatohyot, useatohyo, HYOMAX); taihi(naibu_t, naibu_, NAIBMX); for(i = 0; i < 2; i++) for(j = 0; j < 2; j++) dspmodt[i][j] = dspmod[i][j]; if(0 == romkan_init3(prv_modfnm, delchr, nisedl, delchr2, keyin_method, bytcnt_method, kbytcnt_method, 1, flags & ~RK_VERBOS)) { return(0); /* Àµ¾ï½ªÎ» */ } recov(memoryt, memory, SIZALL); recov(datat, dat_data, LINALL); recov(hyo_nt, hyo_n, HYOMAX); recov(hensudefhyot, hensudefhyo, VARTOT); recov(modeswt, modesw, MODMAX); recov(hyoshut, hyoshu, HYOMAX); recov(modmeibgnt, modmeibgn, MODMAX); recov(modmeimem_t, modmeimem_, MODMEI); recov(dspnambgnt, dspnambgn, DMDMAX); recov(dspcod_t, dspcod_, DMDCHR); recov(usemaehyot, usemaehyo, HYOMAX); recov(usehyot, usehyo, HYOMAX); recov(useatohyot, useatohyo, HYOMAX); recov(naibu_t, naibu_, NAIBMX); for(i = 0; i < 2; i++) for(j = 0; j < 2; j++) dspmod[i][j] = dspmodt[i][j]; return(1); } /** lp2¤«¤éɾ²Á¤·¤ÆÆÀ¤¿Ê¸»úÎó¤òlp1¤Ë¥³¥Ô¡¼ */ static void ltrevlcpy(lp1, lp2, cur_rk) letter *lp1, *lp2; ARGS *cur_rk; { while(*lp2 != EOLTTR){ mchevl(&lp2, lp1, cur_rk); totail(lp1); } *lp1 = EOLTTR; } static void set_rubout(lp, n, del) /** lp¤Ë ¡Ödel¡×n¸Ä¤ÎÎó¤ò¥»¥Ã¥È¤¹¤ë¡£¤³¤³¤Ë del ¤Ï 'delchr'¤«'nisedl' */ letter *lp, del; int n; { for(; n; n--) *lp++ = del; *lp = EOLTTR; } /** ¤³¤ì¤¬¼Â¹Ô¤µ¤ì¤¿¤é¥Ð¥°¡£Ã¢¤·¼Â¹Ô¤Ï¤½¤Î¤Þ¤Þ³¤¯ */ void BUGreport(n) int n; { fprintf(stderr, "\r\nromkan-Bug%d!!\r\n", n); } /** Á°½èÍý(mae_in¢ªmae_out)Ëô¤Ï¸å½èÍý(ato_in¢ªato_out)¤ò¹Ô¤¦¡£*/ static void maeato_henkan(in, outp, m_a_hyo, cur_rk) letter in; /* ÆþÎϤΰìʸ»ú */ letter *outp; /* ½ÐÎϤϤ³¤³¤ËÆþ¤ë */ int *m_a_hyo; /* ¤É¤ÎÁ°¡¦¸å½èÍýɽ¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ë¤«¤Î¾ðÊó */ ARGS *cur_rk; { struct dat *datptr; int i, hyoseq; letter *curdat; if(isSPCL(in)){ /* LTREOF¤äCHMSIG¤¬Í褦¤ë¤Î¤Ç¡¢ÆÃ¼ì¥³¡¼¥É¤Ï¤½¤Î¤Þ¤ÞÊÖ¤¹¤è¤¦¤Ë ºÙ¹©¤·¤Æ¤ª¤«¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£*/ ltr_to_ltrseq(outp, in); return; } for(hyoseq = 0; (hyonum = m_a_hyo[hyoseq]) != -1; hyoseq++){ for(i = 0, datptr = hyo_n[hyonum] . data; NULL != (curdat = datptr[i] . code[0]); i++){ henmatch[0] . ltrmch = EOLTTR; if(!l_eq(curdat, in, cur_rk)) continue; ltrevlcpy(outp, datptr[i] . code[1], cur_rk); return; } } ltr_to_ltrseq(outp, in); } /** ¸å½èÍý */ static void codeout_chg(cur_rk) ARGS *cur_rk; { letter *saishu_outp; *(saishu_outp = saishu_out) = EOLTTR; for(; *codeout != EOLTTR; codeout++){ maeato_henkan(*codeout, saishu_outp, useatohyo, cur_rk); totail(saishu_outp); } codeout = saishu_out; } /** °ìʸ»ú¥×¥Ã¥·¥å¡¦¥Ð¥Ã¥¯ */ letter romkan_ungetc_body(l, cur_rk) letter l; ARGS *cur_rk; { ungetc_buf = l; return l; } letter romkan_ungetc(l) letter l; { letter x; ARGS *cur_rk = NULL; LockMutex(&(cur_rk->rk_lock)); x = romkan_ungetc_body(l, cur_rk); UnlockMutex(&(cur_rk->rk_lock)); return x; } /** romkan_next¤ËÂФ·°ìʸ»ú¥×¥Ã¥·¥å¡¦¥Ð¥Ã¥¯ */ letter romkan_unnext_body(l, cur_rk) letter l; ARGS *cur_rk; { unnext_buf = l; return l; } letter romkan_unnext(l) letter l; { letter x; ARGS *cur_rk = NULL; LockMutex(&(cur_rk->rk_lock)); x = romkan_unnext_body(l, cur_rk); UnlockMutex(&(cur_rk->rk_lock)); return x; } /** delete¤È¤·¤Æ»È¤¦¥­¥ã¥é¥¯¥¿¤ÎÀßÄê¡Êµ¶delete¤â¡Ë¡£¤³¤ì¤ò¼Â¹Ô¸å¤Ï romkan_clear¤ò¼Â¹Ô¤·¤Æ¤ª¤«¤Ê¤¤¤Èº®Íð¤Î¤â¤È¤Ë¤Ê¤ê¤Þ¤¹¡£*/ /* ¡ÊÇÑ»ß¡Ë void romkan_setdel(delchr_, nisedl_) letter delchr_, nisedl_; { LockMutex(&(cur_rk->rk_lock)); delchr = delchr_; nisedl = nisedl_; UnlockMutex(&(cur_rk->rk_lock)); } */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/romkan/rk_multi.h0000644000000000000000000001516007153676737020545 0ustar rootroot/* * $Id: rk_multi.h,v 2.5.2.1 2000/08/04 05:37:29 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /*********************************************************************** rk_multi.h 93.10.08 ºîÀ® ***********************************************************************/ /* Version 1.0 93.10.08 H.KISHIBA */ #include "rk_header.h" #include "rk_extvars.h" #include "jd_sock.h" #include "jslib.h" #include "jllib.h" #include "mt_jlib.h" #define ARGS char wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/romkan/rk_fundecl.h0000644000000000000000000001562607153676737021042 0ustar rootroot/* * $Id: rk_fundecl.h,v 2.3.2.1 2000/08/04 05:37:27 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /*********************************************************************** rk_fundecl.h 87.10. 9 ³« ¶È 93.10.19 ¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î·¿Àë¸À½¸¡£¥æ¡¼¥¶¤Ë³«Êü¤µ¤ì¤ëinclude ¥Õ¥¡¥¤¥ë¤Ï¡¢¤³¤ì¤Èrk_macros.h¡¢µÚ¤Órk_spclval.h¡£ ***********************************************************************/ /* Version 3.0 */ extern letter *ltrncpy(); extern int ltrcmp(), ltrncmp(); extern int romkan_init(), romkan_init2(), romkan_init3(); extern letter romkan_getc(), *romkan_henkan(), romkan_next(); extern letter romkan_ungetc(), romkan_unnext(); extern void romkan_clear(); extern char *romkan_dispmode(); extern char rk_errstat; /* ¤³¤ì¤Ï´Ø¿ô¤Ç¤Ï¤Ê¤¯ÊÑ¿ô */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/romkan/rk_vars.c0000644000000000000000000003065407153676737020366 0ustar rootroot/* * $Id: rk_vars.c,v 2.3.2.1 2000/08/04 05:37:30 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /*********************************************************************** rk_vars.c 88. 6.16 Äû Êä 93.10.19 ¥×¥í¥°¥é¥àÆâ¤ÇÆó¤Ä°Ê¾å¤Î¥Õ¥¡¥¤¥ë¤Ë¤Þ¤¿¤¬¤Ã¤Æ»È¤¦ÊÑ¿ô¤ò ¤Þ¤È¤á¤ÆÄêµÁ¤·¤Æ¤¤¤ë¡£ ***********************************************************************/ /* Version 3.0 */ #include "rk_header.h" #include "rk_extvars.h" char rk_errstat = 0; /* (error)¤Ë¤è¤Ã¤Æ¥¨¥é¡¼¤¬°ú¤­µ¯¤³¤µ¤ì¤¿»þ1¡Ê⤷ (eofflg)¤¬Î©¤Ã¤Æ¤¤¤¿¤¿¤áËöÈø¤Þ¤Ç¤Î¶¯À©½ÐÎϽèÍý¤¬ µ¯¤³¤Ã¤¿¾ì¹ç¤Ï2¡Ë¤Ë¤Ê¤ë¡£romkan_henkan()¼Â¹Ô¤´¤È¤Ë ¹¹¿·¤µ¤ì¤ë¡£¤³¤ì¤Ï¥æ¡¼¥¶¤Ë¤â³«Êü¡£*/ int flags = 0; /* °Ê²¼¤Î¥Õ¥é¥°¤ÎOR¡£ RK_CHMOUT ¥â¡¼¥É¥Á¥§¥ó¥¸¤òÃΤ餻¤ë¤«¤Î¥Õ¥é¥° RK_KEYACK ¥­¡¼¥¤¥ó¤ËÂФ·É¬¤º²¿¤«ÊÖ¤¹¤«¤Î¥Õ¥é¥° RK_DSPNIL romkan_disp(off)mode¤ÎÊÖÃͤΥǥե©¥ë¥È¤¬¶õʸ»úÎó¤Ç¤¢¤ë¤«¤Î ¥Õ¥é¥°¡£Î©¤¿¤Ê¤±¤ì¤Ð¥Ç¥Õ¥©¥ë¥È¤ÏNULL¡£¸ß´¹À­¤Î¤¿¤áromkan_ init2¤Þ¤Ç¤Ï¤³¤ì¤¬Î©¤Ä¡£ RK_NONISE µ¶¥³¡¼¥É¤ò½Ð¤µ¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤«¤Î¥Õ¥é¥° RK_REDRAW Wnn¤Ç»È¤¦ÆÃ¼ì¤Ê¥Õ¥é¥°¡£¤³¤ì¤¬Î©¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢romkan_henkan ¤Î·ë²Ì¤È¤·¤Ædisout¤Ënisedl¡Êµ¶Êª¤Îdel¡Ë°Ê¸å¤¬ÆÃ¼ì¥³¡¼¥É¤Î¤ß ¤Ç½ª¤ï¤ëʸ»úÎó¤¬Ê֤äƤ­¤¿¤é¡¢¤½¤Î¸å¤í¤ËREDRAW¤ò¤Ä¤Ê¤°¡£Wnn ¤ÇÊÑ´¹¹Ô¤Îredraw¤ò¤¹¤ë¤¿¤á¤ËɬÍפÊÁ¼ÃÖ¡£ RK_SIMPLD delete¤Îưºî¤òñ½ã¤Ë¤¹¤ë¤«¤Î¥Õ¥é¥° RK_VERBOS verbose¤Çµ¯¤³¤¹¤«¤Î¥Õ¥é¥° */ jmp_buf env0; FILE *modefile; /* ¥â¡¼¥ÉÄêµÁɽ¤Î¥Õ¥¡¥¤¥ë */ char nulstr[1] = {'\0'}; char *hcurread, *mcurread; /* ÊÑ´¹É½¡¦¥â¡¼¥Éɽ¤Î¸½ºß¹Ôbuf¤Ø¤Î¥Ý¥¤¥ó¥¿ */ char *curfnm, *curdir; /* ¸½ºßÆÉ¤ó¤Ç¤ëÊÑ´¹É½¡¦¥â¡¼¥Éɽ¤Î̾¤È¥Ç¥£¥ì¥¯¥È¥ê¡£ ⤷curdir¤Ï¡¢¥µ¡¼¥Á¥Ñ¥¹¤òÁܤ·¤Æ¤«¤Äɽ¤Î¥ª¡¼¥×¥ó¤ËÀ®¸ù¤·¤¿»þ¤Î¤ßÍ­¸ú */ letter *ltrbufbgn; /* »ÈÍÑÃæ¤Îletter¤Î¥Ð¥Ã¥Õ¥¡¤ÎÀèÆ¬¤ò»Ø¤¹ */ /* ¤³¤ì¤é¸Þ¤Ä¤Ï¡¢readdata()¤Ê¤É¤Î´Ø¿ôÆâ¤Ç¥í¡¼¥«¥ë¤ËÄêµÁ¤¹¤ëÇÛÎó¤ÎÀèÆ¬¤ò»Ø ¤¹¡£½¾¤Ã¤Æ¡¢¤½¤Î´Ø¿ô¤òÈ´¤±¤¿¸å¤Ç¤³¤ì¤é¤ÎÃͤò»È¤ï¤Ê¤¤¤è¤¦½½Ê¬Ãí°Õ¡£ÆÃ¤Ë¡¢ ¥¨¥é¡¼·Ù¹ð¥ë¡¼¥Á¥ó¤Ê¤É¤Ç¤Ï¡¢longjmp¤ÇÌá¤ë¤è¤êÁ°¤Ë¤³¤ì¤é¤Îprint¤ò¹Ô¤¦¤³¤È ¡Ê¥¨¥é¡¼½èÍýÍѤ˻ȤäƤ¤¤ë¤Î¤Ï¡¢¾å¤«¤é»Í¸Ä¤Þ¤Ç¡Ë¡£*/ FILE *nestfile[FILNST], **base; /* ÊÑ´¹Âбþɽ¤Î¥Õ¥¡¥¤¥ë */ struct modestat modesw[MODMAX]; char hyoshu[HYOMAX]; /* ɽ¤Î¼ïÊÌ¡ÊÁ°¡¦ËÜ¡¦¸å½èÍýɽ¤Î¶èÊ̡ˤòÆþ¤ì¤ëÇÛÎó */ char **modmeiptr, *modmeibgn[MODMAX]; /* ¥â¡¼¥É̾¤ËÂФ¹¤ë¾å¤ÈƱÍͤΥǡ¼¥¿*/ char *modmeimem, modmeimem_[MODMEI]; /* ¡· */ char **dspnamptr, *dspnambgn[DMDMAX]; /* ¥â¡¼¥Éɽ¼¨Ê¸»úÎó¤ËÂФ¹¤ëƱÍͤΥǡ¼¥¿ */ char *dspcod, dspcod_[DMDCHR]; /* ¡· */ char *dspmod[2][2] = {{NULL, NULL}, {NULL, NULL}}; /* ¸½ºßµÚ¤Ó°ì¤ÄÁ°¤Î¡¢romkan¤ò¤½¤ì¤¾¤ìon¡¦off¤·¤Æ¤¤¤ë»þ¤Î¥â¡¼¥Éɽ¼¨ ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¡£romkan_dispmode()¤ÇÊÖ¤ëÃͤÏdspmod[0][0]¡£*/ char **hyomeiorg, **hyomeiptr; /* ɽ¤Î̾¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÆþ¤ì¤ëÇÛÎó *hyomeibgn[HYOMAX] ¤ò readdata() ¤Ç »È¤¦¤¬¡¢¤½¤ÎÀèÆ¬µÚ¤ÓÆÃÄê¤ÎÍ×ÁǤؤΥݥ¤¥ó¥¿ */ char *hyomeimem; /* ɽ¤Î̾¤Î¼ÂºÝ¤Îʸ»úÎó¤òÆþ¤ì¤ëÇÛÎó hyomeimem_[HYOMEI] ¤ò readdata() ¤Ç»È¤¦¤¬¡¢¤½¤ÎÆÃÄê¤ÎÍ×ÁǤؤΥݥ¤¥ó¥¿ */ char **pathmeiorg, **pathmeiptr; /* Âбþɽ¤Î¥µ¡¼¥Á¥Ñ¥¹Ì¾¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÆþ¤ì¤ëÇÛÎó *pathmeibgn[PTHMAX]¤ò readdata() ¤Ç»È¤¦¤¬¡¢¤½¤ÎÀèÆ¬µÚ¤ÓÆÃÄê¤ÎÍ×ÁǤؤΥݥ¤¥ó¥¿ */ char *pathareaorg, *pathmeimem; /* ¾åµ­¥µ¡¼¥Á¥Ñ¥¹Ì¾¤Î¼ÂºÝ¤Îʸ»úÎó¤òÆþ¤ì¤ëÇÛÎó pathmeimem_[PTHMEI] ¤ò readdata() ¤Ç»È¤¦¤¬¡¢¤½¤ÎÀèÆ¬µÚ¤ÓÆÃÄê¤ÎÍ×ÁǤؤΥݥ¤¥ó¥¿¡£ ⤷pathmeimem_¤ÎÀèÆ¬¤Ë¤Ï¥â¡¼¥Éɽ¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î̾¤¬Æþ¤ê¡¢¸å ¤Ç»È¤¦¤Î¤Ç¡¢pathareaorg¤Ë¤Ï¤½¤Î³¤­¤Î¥¨¥ê¥¢¤ÎÀèÆ¬¤ÎÈÖÃϤ¬Æþ¤ë¡£*/ int usemaehyo[HYOMAX], usehyo[HYOMAX], useatohyo[HYOMAX]; /* Á°¡¦ËÜ¡¦¸å½èÍýɽ¤Î¤É¤ì¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ë¤«¤Î¥Ç¡¼¥¿ */ int naibu_[NAIBMX], *naibu; /* ¥â¡¼¥Éɽ¤ÎÆâÉôɽ¸½¤òÆþ¤ì¤ëÇÛÎó */ letter *lptr; /* letter¤Ø¤ÎÈÆÍѥݥ¤¥ó¥¿ */ letter rk_input; /* ÆþÎÏ¡£3¥Ð¥¤¥È¤Þ¤Ç¤ÏÊѹ¹¤Ê¤·¤ËÂбþ²Ä */ letter disout[OUTSIZ]; /* ËܽèÍý¤«¤é¤Î½ÐÎϤΥХåե¡ */ letter rk_output[OUTSIZ]; /* ¸å½èÍý¤«¤é¤Î½ÐÎϡʺǽª½ÐÎϡˤΥХåե¡ */ letter keybuf[KBFSIZ], urabuf[KBFSIZ]; /* ËܽèÍý¥Ð¥Ã¥Õ¥¡¤È¤½¤ÎÂàÈòÎΰè */ int lastoutlen, lastkbflen; letter oneletter[2] = {EOLTTR, EOLTTR}, nil[1] = {EOLTTR}; int hyonum; struct hyo hyo_n[HYOMAX]; /* ɽ¤´¤È¤ÎÊѰ衦Âбþ¥Ç¡¼¥¿¤Î³«»ÏÈÖÃÏ */ #define bit3(x, y, z) ((x) | ((y) << 1) | ((z) << 2)) struct funstr func[] = /* ´Ø¿ô¤ÎÄɲäˤϤ³¤³¤È mchevl(), evlis() ¤ò¤¤¤¸¤ë */ { /* °ú¿ô¤Î¿ô¡Ê-1¡Ä¤³¤ÎÃÍ̤»ÈÍÑ¡Ë Ì¾ ½Ð¸½ ¡Ã ¥¿¥¤¥×¡Ä0:ʸ»ú´Ø¿ô 1:ʸ»úÎó´Ø¿ô ¢­ ¢­ ¢­ ¢­ 2:ÆÃ¼ì´Ø¿ô 3:µ¡Ç½ 4:Àë¸À */ { "defvar", bit3(1,0,0), -1, 4 }, /* 0 */ { "include", bit3(1,0,0), -1, 4 }, { "toupper", bit3(1,1,1), 1, 0 }, { "tolower", bit3(1,1,1), 1, 0 }, { "off", bit3(0,1,0), -1, 2 }, { "on", bit3(0,1,0), -1, 2 }, /* 5 */ { "switch", bit3(0,1,0), -1, 2 }, { "toupdown", bit3(1,1,1), 1, 0 }, { "tozenalpha", bit3(1,1,1), 1, 0 }, { "tohira", bit3(1,1,1), 1, 0 }, { "tokata", bit3(1,1,1), 1, 0 }, /* 10 */ { "tohankata", bit3(1,1,1), 1, 1 }, { "tozenhira", bit3(1,1,1), 1, 0 }, { "tozenkata", bit3(1,1,1), 1, 0 }, { "+", bit3(1,1,1), 2, 0 }, { "-", bit3(1,1,1), 2, 0 }, /* 15 */ { "*", bit3(1,1,1), 2, 0 }, { "/", bit3(1,1,1), 2, 0 }, { "%", bit3(1,1,1), 2, 0 }, { "last=", bit3(1,0,0), 1, 2 }, /* ľÁ°¤Î¥Þ¥Ã¥Á¥³¡¼¥É==°ú¿ô¤«? */ { "if", bit3(1,0,0), -1, 2 }, /* 20 */ { "unless", bit3(1,0,0), -1, 2 }, { "restart", bit3(0,1,0), 0, 3 }, { "delchr", bit3(1,1,1), 0, 0 }, /* delchr¤òÊÖ¤¹¡£±£¤·¥³¥Þ¥ó¥É */ { "alloff", bit3(0,1,0), 0, 2 }, /* Á´¥â¡¼¥É¤ò¤¤¤Ã¤Ú¤ó¤ËOFF */ { "allon", bit3(0,1,0), 0, 2 }, /* 25 */ { "bitand", bit3(1,1,1), 2, 0 }, { "bitor", bit3(1,1,1), 2, 0 }, { "bitnot", bit3(1,1,1), 1, 0 }, { "!", bit3(0,1,0), 0, 2 }, /* ΢¥Ð¥Ã¥Õ¥¡¤ÎÌÀ¼¨Åª¥¯¥ê¥¢ */ { "atEOF", bit3(1,0,0), 0, 2 }, /* 30 */ { "todigit", bit3(1,1,1), 2, 1 }, { "dakuadd", bit3(1,1,1), 1, 1 }, /* ÂùÅÀ¤ÎÉղà */ { "handakuadd", bit3(1,1,1), 1, 1 }, /* ȾÂùÅÀ¤ÎÉղà */ { "value", bit3(1,1,1), 1, 0 }, { "error", bit3(0,1,0), 0, 3 }, /* 35 */ { "defconst", bit3(1,0,0), -1, 4 }, { "setmode", bit3(0,1,0), -1, 2 }, { "mode+", bit3(0,1,0), -1, 2 }, { "mode-", bit3(0,1,0), -1, 2 }, { "mode=", bit3(1,0,0), -1, 2 }, /* 40 */ { "mode!=", bit3(1,0,0), -1, 2 }, { "mode<", bit3(1,0,0), -1, 2 }, { "mode>", bit3(1,0,0), -1, 2 }, { "send", bit3(0,1,0), 1, 1 }, /* »îºî */ { NULL, 0, 0, 0 } }; /* last=¡Áunless¡Ä ÆþÎÏ¥³¡¼¥É¤Î°ÌÃ֤ˤ·¤«ÃÖ¤±¤º¡¢Ê¸»úÎó´Ø¿ô°·¤¤¤Ê¤Î¤Ç ËܽèÍýɽ¤Ë¤·¤«½ñ¤±¤Ê¤¤¡£*/ /* +,-,*,/,bitand,bitor,bitnot¡Ä 3¥Ð¥¤¥Èʬ¤Î±é»»¤ò¹Ô¤¦¡£*/ /* atEOF¡Ä ¥Õ¥¡¥¤¥ëËöÈø¤Ç¤ÎÆÃÊÌÆ°ºî¤ò»ØÄꤹ¤ë¤¿¤á¤Î¤â¤Î¡£Ã¢¤·¡¢¤½¤Î ưºî¤ÏÉÔ´°Á´¡£*/ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/0002755000000000000000000000000007153676736016700 5ustar rootrootwnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/cplib.h0000644000000000000000000002311707153676736020144 0ustar rootroot/* * $Id: cplib.h,v 2.2.2.1 2000/08/04 05:37:12 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /** cWnn Version 1.1 **/ #ifndef _CPLIB_H_ #define _CPLIB_H_ #ifndef min #define min(a,b) ((int)(a) > (int)(b)? (b):(a)) #endif #define YIN_LEN 10 #define PY_LEN 10 /* 'ChuangŽÀ', 'ZhuangŽÀ' */ #define PY_LEN_W 7 /* for w_char */ #define PY_MARK 'P' /* for PinYincode: to know if need to change to */ #define ZY_MARK 'Z' /* for PinYincode: to know if need to change to */ #define CWNN_PINYIN 0 /* For Pinyin */ #define CWNN_ZHUYIN 1 /* For Zhuyin */ #define PY_EOF 0x8ec0 /* PY_EOF is end charactor of one PinYin must be a 2 bytes code. HUANG */ #define ZY_EOF_0 0x8ec0 /* ZhuYin end character(no sisheng): 'ŽÀ' */ #define ZY_EOF_1 0x8ec1 /* ZhuYin end character(sisheng 1 ): 'ŽÁ' */ #define ZY_EOF_2 0x8ec2 /* ZhuYin end character(sisheng 2 ): 'ŽÂ' */ #define ZY_EOF_3 0x8ec3 /* ZhuYin end character(sisheng 3 ): 'ŽÃ' */ #define ZY_EOF_4 0x8ec4 /* ZhuYin end character(sisheng 4 ): 'ŽÄ' */ #define isZY_EOF(X) ( ((int)(X) >= ZY_EOF_0 && (int)(X) <= ZY_EOF_4 )? 1 : 0 ) #define PY_NUM_SHENGMU 24 /* ShengMu table size of PinYin */ #define PY_NUM_YUNMU 39 /* YunMu table size of PinYin */ #define ZY_NUM_SHENGMU 24 /* ShengMu table size of ZhuYin */ #define ZY_NUM_YUNMU 41 /* YunMu table size of ZhuYin */ #define EMPTY_SHENG_RAW 0 /* position of ShengMu EMPTY in ShengMu table */ #define EMPTY_YUN_RAW 0 /* position of YunMu EMPTY in YunMu table */ #define X_SHENG_RAW 20 /* position of ShengMu X in ShengMu table */ /* YINcode creating is based on PinYin */ /* isyincod_d(): Check it is in the domain of Pinyin. To check if it is a Pinyin, you need to use cp_isyincod() wihich checks the PinYin table */ #define _cwnn_isyincod_d(c) ( ((c & 0x80) && \ (!(c & 0x8000)) && \ (c & 0x7f) >= 0x20 && \ (((int)c >> (int)8) & 0x7f) >= 0x20 ) \ ?1:0 ) /* if is in YINcode's limite */ #define _cwnn_sisheng(YINcod) ( ((YINcod & 0x100) == 0x100)? \ ((YINcod & 0x03 ) + 1): 0 ) #define _cwnn_yincod_0(YINcod) ((YINcod) & 0xfefc) /* Shengraw based on PinYin table */ #define Shengraw(YINcod) (((int)((YINcod - 0x20a0) & 0x7c)>>(int)2) + 0x01) /* Yunraw based on PinYin table */ #define Yunraw(YINcod) ((int)(((YINcod) - 0x20a0) & 0x7e00) >> (int)9) /* to see if the char is a start char of a pinyin without sisheng */ #define py0_first_ch(X) (((int)(X)>'A' && (int)(X)<='Z' && \ (X)!='E' && (X)!='O'&& \ (X)!='I' && (X)!='U' && (X)!='V') || \ (X)=='a'||(X)=='e'||(X)=='o' || (X)=='n'? 1: 0) /* to see if the char is a start char of a zhuyin */ /* for sisheng */ #define S_S_YOMI(X) ( ((int)(X&0xff)>=0xa1)&&((int)(X&0xff)<=0xbf))||((int)(X>>8)==0x8e) #define py_first_ch(X) ( py0_first_ch(X) || S_S_YOMI(X) ) #define zy_first_ch(X) ( ((int)(X&0xff) >= 0xc0 && (int)(X&0xff) <= 0xe9 && \ ((int)(X>>(int)8)) == 0x8e) ) #define _cwnn_has_sisheng(YINcod) ( (( (YINcod)& 0x0100) != 0 ) ?1:0) extern unsigned char last_mark; extern char *py_shengmu_tbl[]; /* PinYin ShengMu table */ extern char *py_yunmu_tbl[]; /* PinYin YunMu table */ extern char *zy_shengmu_tbl[]; /* ZhuYin ShengMu table */ extern char *zy_yunmu_tbl[]; /* ZhuYin YunMu table */ extern int pinyin_tbl[]; /* PinYin table */ extern int zhuyin_tbl[]; /* ZhuYin table */ #endif /* _CPLIB_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/demcom.h0000644000000000000000000002463007153676736020320 0ustar rootroot/* * $Id: demcom.h,v 2.21.2.1 2000/08/04 05:37:12 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ /* demcom.h entry functions definitions */ #ifndef _DEMCOM_H_ #define _DEMCOM_H_ #define JLIB_VERSION 0x4F00 /* For FI-Wnn */ /* * Demon Commands */ #define JS_VERSION 0x00 #define JS_OPEN 0x01 /* #define JS_OPEN_IN 0x02 */ #define JS_CLOSE 0x03 #define JS_CONNECT 0x05 #define JS_DISCONNECT 0x06 #define JS_ENV_EXIST 0x07 #define JS_ENV_STICKY 0x08 #define JS_ENV_UN_STICKY 0x09 #define JS_KANREN 0x11 #define JS_KANTAN_SHO 0x12 #define JS_KANZEN_SHO 0x13 #define JS_KANTAN_DAI 0x14 #define JS_KANZEN_DAI 0x15 #define JS_HINDO_SET 0x18 #define JS_DIC_ADD 0x21 #define JS_DIC_DELETE 0x22 #define JS_DIC_USE 0x23 #define JS_DIC_LIST 0x24 #define JS_DIC_INFO 0x25 #define JS_FUZOKUGO_SET 0x29 #define JS_FUZOKUGO_GET 0x30 #define JS_WORD_ADD 0x31 #define JS_WORD_DELETE 0x32 #define JS_WORD_SEARCH 0x33 #define JS_WORD_SEARCH_BY_ENV 0x34 #define JS_WORD_INFO 0x35 #define JS_WORD_COMMENT_SET 0x36 #define JS_PARAM_SET 0x41 #define JS_PARAM_GET 0x42 #define JS_MKDIR 0x51 #define JS_ACCESS 0x52 #define JS_WHO 0x53 #define JS_ENV_LIST 0x55 #define JS_FILE_LIST_ALL 0x56 #define JS_DIC_LIST_ALL 0x57 #define JS_FILE_READ 0x61 #define JS_FILE_WRITE 0x62 #define JS_FILE_SEND 0x63 #define JS_FILE_RECEIVE 0x64 #define JS_HINDO_FILE_CREATE 0x65 #define JS_DIC_FILE_CREATE 0x66 #define JS_FILE_REMOVE 0x67 #define JS_FILE_LIST 0x68 #define JS_FILE_INFO 0x69 #define JS_FILE_LOADED 0x6A #define JS_FILE_LOADED_LOCAL 0x6B #define JS_FILE_DISCARD 0x6C #define JS_FILE_COMMENT_SET 0x6D #define JS_FILE_PASSWORD_SET 0x6E /* 89/9/8 */ #define JS_FILE_STAT 0x6F #define JS_KILL 0x70 #define JS_HINDO_FILE_CREATE_CLIENT 0x71 #define JS_HINSI_LIST 0x72 #define JS_HINSI_NAME 0x73 #define JS_HINSI_NUMBER 0x74 #define JS_HINSI_DICTS 0x75 #define JS_HINSI_TABLE_SET 0x76 /* * Hideyuki Kishiba (Jul. 8, 1994) * Start packets are added from 4.F00(FI-Wnn). * All packets have 0xF00000 as offset. */ #define JS_VERSION_OFFSET_OF_FIWNN 0xF00000 /* Access Control packets */ #define JS_ACCESS_ADD_HOST (JS_VERSION_OFFSET_OF_FIWNN|0x11) #define JS_ACCESS_ADD_USER (JS_VERSION_OFFSET_OF_FIWNN|0x12) #define JS_ACCESS_REMOVE_HOST (JS_VERSION_OFFSET_OF_FIWNN|0x13) #define JS_ACCESS_REMOVE_USER (JS_VERSION_OFFSET_OF_FIWNN|0x14) #define JS_ACCESS_ENABLE (JS_VERSION_OFFSET_OF_FIWNN|0x15) #define JS_ACCESS_DISABLE (JS_VERSION_OFFSET_OF_FIWNN|0x16) #define JS_ACCESS_GET_INFO (JS_VERSION_OFFSET_OF_FIWNN|0x17) /* Temprary registration for Katakana and BunsetsuGiri packet */ #define JS_TEMPORARY_DIC_ADD (JS_VERSION_OFFSET_OF_FIWNN|0x21) #define JS_TEMPORARY_DIC_DELETE (JS_VERSION_OFFSET_OF_FIWNN|0x22) #define JS_AUTOLEARNING_WORD_ADD (JS_VERSION_OFFSET_OF_FIWNN|0x23) #define JS_SET_AUTOLEARNING_DIC (JS_VERSION_OFFSET_OF_FIWNN|0x24) #define JS_GET_AUTOLEARNING_DIC (JS_VERSION_OFFSET_OF_FIWNN|0x25) #define JS_IS_LOADED_TEMPORARY_DIC (JS_VERSION_OFFSET_OF_FIWNN|0x26) #define JS_TEMPORARY_WORD_ADD (JS_VERSION_OFFSET_OF_FIWNN|0x27) /* For Wnn5 */ #define JS_SET_HENKAN_ENV (JS_VERSION_OFFSET_OF_FIWNN|0x31) #define JS_GET_HENKAN_ENV (JS_VERSION_OFFSET_OF_FIWNN|0x32) #define JS_SET_HENKAN_HINSI (JS_VERSION_OFFSET_OF_FIWNN|0x33) #define JS_GET_HENKAN_HINSI (JS_VERSION_OFFSET_OF_FIWNN|0x34) #define JS_HENKAN_WITH_DATA (JS_VERSION_OFFSET_OF_FIWNN|0x35) /* For FI-Wnn */ #define JS_FI_DIC_ADD (JS_VERSION_OFFSET_OF_FIWNN|0x61) #define JS_FI_HINDO_FILE_CREATE (JS_VERSION_OFFSET_OF_FIWNN|0x62) #define JS_FI_HINDO_FILE_CREATE_CLIENT (JS_VERSION_OFFSET_OF_FIWNN|0x63) #define JS_DIC_FILE_CREATE_CLIENT (JS_VERSION_OFFSET_OF_FIWNN|0x64) #define JS_FI_KANREN (JS_VERSION_OFFSET_OF_FIWNN|0x65) #define JS_SET_FI_PRIORITY (JS_VERSION_OFFSET_OF_FIWNN|0x66) #define JS_OPTIMIZE_FI (JS_VERSION_OFFSET_OF_FIWNN|0x67) /* For FI-Wnn ikeiji */ #define JS_HENKAN_IKEIJI (JS_VERSION_OFFSET_OF_FIWNN|0x6f) /* For wnnoffline */ #define JS_LOCK (JS_VERSION_OFFSET_OF_FIWNN|0x71) #define JS_UNLOCK (JS_VERSION_OFFSET_OF_FIWNN|0x72) /* For dictutil */ #define JS_FI_DIC_LIST (JS_VERSION_OFFSET_OF_FIWNN|0x81) #define JS_FI_DIC_LIST_ALL (JS_VERSION_OFFSET_OF_FIWNN|0x82) #define JS_FUZOKUGO_LIST (JS_VERSION_OFFSET_OF_FIWNN|0x83) #endif /* _DEMCOM_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/jslib.h0000644000000000000000000006412607153676737020164 0ustar rootroot/* * $Id: jslib.h,v 2.40.2.1 2000/08/04 05:37:15 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ /* Nihongo Henkan Library Header File */ #ifndef _JSLIB_H_ #define _JSLIB_H_ #ifndef _WNN_SETJMP #define _WNN_SETJMP #include #endif #ifndef w_char #define w_char unsigned short #endif /* w_char */ /* Á°Ã¼¥Ù¥¯¥¿(ÉÊ»ìÈÖ¹æ)¤ÎÄêµÁ */ #define WNN_BUN_SENTOU -1 /* ÂçʸÀá¤ÎÀèÆ¬¤Ë¤Ê¤ì¤ëÅÛ */ #define WNN_ALL_HINSI -2 /* ¤Ê¤ó¤Ç¤â¤¨¤¨¤è */ /* ½ªÃ¼¥Ù¥¯¥¿¤ÎÄêµÁ */ #define WNN_VECT_KANREN 0 /* ϢʸÀáÊÑ´¹¤Î½ªÃ¼¥Ù¥¯¥¿¡¼ */ #define WNN_VECT_KANTAN 1 /* ñʸÀáÊÑ´¹¤Î½ªÃ¼¥Ù¥¯¥¿¡¼ */ #define WNN_VECT_KANZEN 1 /* Á´¸õÊä¼è½Ð¤·¤Î½ªÃ¼¥Ù¥¯¥¿¡¼ ñʸÀáÊÑ´¹»þ¤Î¤â¤Î¤ÈÅù¤·¤¤¡£*/ #define WNN_VECT_BUNSETSU 2 /* ϢʸÀáÊÑ´¹»þ¤Î¡¢³ÆÊ¸Àá¤Î½ªÃ¼¥Ù¥¯¥¿¡¼*/ #define WNN_VECT_NO -1 /* ½ªÃ¼¥Ù¥¯¥¿1 ̵¤· */ /* ʸÀá¤Î½ªÃ¼¤ÎÀܳ¾ðÊó */ #define WNN_CONNECT_BK 1 /* »ØÄꤵ¤ì¤¿½ªÃ¼¥Ù¥¯¥¿¡¼¤ËÀܳ¤Ç¤­¤¿¡£*/ #define WNN_NOT_CONNECT_BK 0 /* */ /* ʸÀá¤ÎÁ°Ã¼¤ÎÀܳ¾ðÊó */ #define WNN_CONNECT 1 /* »ØÄꤵ¤ì¤¿(Éʻ졢ÉÕ°¸ì)¤ËÀܳ¤Ç¤­¤¿¡£*/ #define WNN_SENTOU 2 /* ÂçʸÀá¤ÎÀèÆ¬ */ #define WNN_NOT_CONNECT 3 /* ÀèÆ¬¤Ë¤Ê¤ì¤Ê¤¤¤·¡¢Á°¤ËÀܳ¤Ç¤­¤Ê¤¤ */ #define WNN_GIJI 4 /* µ¿»÷ʸÀá¤òºî¤Ã¤¿¡£*/ /* µ¿»÷ʸÀá¤ÎľÁ°¤ËÁªÂò¤·¤¿¸õÊä */ #define WNN_HIRAGANA -1 /* ¤Ò¤é¤¬¤Ê *//* ÆÉ¤ß¤Î¤Þ¤Þ */ #define WNN_KATAKANA -11 /* ¥«¥¿¥«¥Ê */ #define WNN_IKEIJI_ENTRY -50 /* °Û·Á»ú */ /* ¿ô»ú */ #define WNN_NUM_HAN -2 /* Ⱦ³Ñ¿ô»ú *//* ÆÉ¤ß¤Î¤Þ¤Þ */ #define WNN_NUM_ZEN -12 /* Á´³Ñ¿ô»ú *//* £±£²£³ */ #define WNN_NUM_KAN -13 /* ´Á¿ô»ú *//* °ìÆó»° */ #define WNN_NUM_KANSUUJI -15 /* ´Á¿ô»ú *//* É´Æó½½»° */ #define WNN_NUM_KANOLD -16 /* ´Á¿ô»ú *//* °íÉ´Æõ½¦»² */ #define WNN_NUM_HANCAN -17 /* Ⱦ³Ñ¿ô»ú *//* 1,234 */ #define WNN_NUM_ZENCAN -18 /* Á´³Ñ¿ô»ú *//* £±¡¤£²£³£´ */ /* ±Ñ¿ô */ #define WNN_ALP_HAN -4 /* Ⱦ³Ñ *//* ÆÉ¤ß¤Î¤Þ¤Þ */ #define WNN_ALP_ZEN -30 /* Á´³Ñ */ /* µ­¹æ */ #define WNN_KIG_HAN -5 /* Ⱦ³Ñ *//* ÆÉ¤ß¤Î¤Þ¤Þ */ #define WNN_KIG_JIS -40 /* Á´³Ñ(JIS) */ #define WNN_KIG_ASC -41 /* Á´³Ñ(ASC) */ /* Á÷¤ê´ð½à */ #define WNN_OKURI_REGULATION -1 /* Ëܧ */ #define WNN_OKURI_NO 0 /* Á÷¤é¤Ê¤¤ */ #define WNN_OKURI_YES 1 /* Á÷¤ë */ /* ÊÑ´¹¸õÊä */ #define WNN_KANA_KOUHO 0 /* ¤Ò¤é¤¬¤Ê */ #define WNN_KANJI_KOUHO 1 /* ´Á»ú */ /* ÊÑ´¹¼ïÊÌ */ #define WNN_KANREN 0 #define WNN_KANTAN_DAI 1 #define WNN_KANZEN_DAI 2 #define WNN_KANTAN_SHO 3 #define WNN_KANZEN_SHO 4 /* °Û·Á»ú ÊÑ´¹¼ïÊÌ */ #define WNN_IKEIJI_DAI (WNN_KANZEN_SHO+1) #define WNN_FT_DICT_FILE 1 #define WNN_FT_HINDO_FILE 2 #define WNN_FT_FUZOKUGO_FILE 3 /* * Hideyuki Kishiba (Jul. 8, 1994) * New file type for FI-Wnn */ #define WNN_FT_FI_DICT_FILE 4 #define WNN_FT_FI_HINDO_FILE 5 #define WNN_STATIC_DICT 1 /* static dict */ #define WNN_UD_DICT 2 /* updatable dict */ #define WNN_REV_DICT 3 /* Updatable Dictonary with Reverse Index */ #define WNN_REG_DICT 4 /* Regular Expressino Dictonary */ /* * Hideyuki Kishiba (Jul. 8, 1994) * New dictionary type for FI-Wnn */ #define WNN_COMPACT_DICT 5 /* ¥³¥ó¥Ñ¥¯¥È¼­½ñ */ #define WNN_FI_SYSTEM_DICT 6 /* £Æ£É´Ø·¸¥·¥¹¥Æ¥à¼­½ñ */ #define WNN_FI_USER_DICT 7 /* £Æ£É´Ø·¸¥æ¡¼¥¶¼­½ñ */ #define WNN_FI_HINDO_FILE 8 /* £Æ£É´Ø·¸ÉÑÅÙ */ #define WNN_GROUP_DICT 9 /* ¥°¥ë¡¼¥×¼­½ñ */ #define WNN_MERGE_DICT 10 /* ¥Þ¡¼¥¸¼­½ñ */ #define WNN_SYSTEM_DICT 0x80000000 /* * Seiji KUWARI (Dec. 14, 1994) * Numbers of special dictionaries */ #define WNN_MAEKAKUTEI_DIC -2 #define WNN_MUHENKAN_DIC -3 #define WNN_BUNSETSUGIRI_DIC -4 /* for CHINESE PIN-IN : with Si Sheng (»ÍÀ¼) */ #define CWNN_REV_DICT 0x103 /* Updatable with Reverse Index */ /* for CHINESE: Bi Xing (É®·Á) */ #define BWNN_REV_DICT 0x203 /* Updatable with Reverse Index */ #define WNN_DIC_MERGE 4 /* for merge dic */ #define WNN_DIC_GROUP 3 /* for group dic */ #define WNN_DIC_TEMPORARY 2 #define WNN_DIC_RDONLY 1 #define WNN_DIC_RW 0 #define WNN_DIC_ADD_REV 1 /* µÕÊÑ´¹ */ #define WNN_DIC_ADD_NOR 0 /* Ä̾ï¤ÎÊÑ´¹ */ /* header file for dic_syurui */ #define WNN_FILE_NOT_EXIST -1 #define WNN_NOT_A_JISHO 0 /* KURI #define WNN_USER_DIC 1 #define WNN_SYSTEM_DIC 3 */ #define WNN_HINDO_FILE 4 #define WNN_FUZOKUGO_FILE 5 /* set_hindo operation */ #define WNN_HINDO_NOP -2 #define WNN_IMA_ON -3 #define WNN_IMA_OFF -4 #define WNN_HINDO_INC -3 #define WNN_HINDO_DECL -4 #define WNN_ENTRY_NO_USE -1 /* set hindo probability */ #define WNN_HINDO_NOT 0 #define WNN_HINDO_ALWAYS 1 #define WNN_HINDO_HIGH 2 #define WNN_HINDO_NORMAL 3 #define WNN_HINDO_LOW 4 /* Auto learning operation */ #define WNN_MUHENKAN_LEARNING 1 #define WNN_BUNSETSUGIRI_LEARNING 2 #define WNN_NO_LEARNING -1 #define WNN_TEMPORARY_LEARNING -2 /* Wnn constant */ #define WNN_HOSTLEN 16 #define WNN_ENVNAME_LEN 32 /* js_who */ #define WNN_MAX_ENV_OF_A_CLIENT 32 struct wnn_jwho { int sd; /* jserver Æâ¤Î¥½¥±¥Ã¥È¥Ç¥£¥¹¥¯¥ê¥×¥¿*/ char user_name[64]; /* ¥æ¡¼¥¶Ì¾ */ char host_name[64]; /* ¥Û¥¹¥È̾ */ int env[WNN_MAX_ENV_OF_A_CLIENT]; /* ¤³¤Î¥¯¥é¥¤¥¢¥ó¥È¤¬»ÈÍѤ·¤Æ¤¤¤ë ´Ä¶­ÈÖ¹æ¤ÎÎó¡£¶õ¤¤¤Æ¤¤¤ë¤È¤³¤í¤Ë¤Ï¡¢-1 ¤¬Æþ¤ë */ }; typedef struct wnn_jwho WNN_JWHO; /* js_env_list */ #define WNN_MAX_JISHO_OF_AN_ENV 30 #define WNN_MAX_FILE_OF_AN_ENV 60 struct wnn_env_info { int env_id; /* ´Ä¶­ÈÖ¹æ */ char env_name[WNN_ENVNAME_LEN]; /* ´Ä¶­Ì¾ */ int ref_count; /* »²¾È¿ô */ /* struct wnn_param; */ int fzk_fid; /* ÉÕ°¸ì¤Î¥Õ¥¡¥¤¥ëÈÖ¹æ */ int jishomax; /* »ÈÍѤ·¤Æ¤¤¤ë¼­½ñ¤Î¸Ä¿ô */ int jisho[WNN_MAX_JISHO_OF_AN_ENV]; /* »ÈÍѤ·¤Æ¤¤¤ë¼­½ñ¤Î¼­½ñÈֹ档 ºÇ½é¤Îjishomax¸Ä¤À¤±°ÕÌ£¤¬¤¢¤ë */ int file[WNN_MAX_FILE_OF_AN_ENV]; /* ¤³¤Î´Ä¶­¤Ë¤Ä¤Ê¤¬¤Ã¤Æ¤¤¤ë ¥Õ¥¡¥¤¥ëÈÖ¹æ(¶õ¤¤¤Æ¤¤¤ë¤È¤³¤í¤Ë¤Ï¡¢-1 ¤¬Æþ¤ë) */ }; typedef struct wnn_env_info WNN_ENV_INFO; #define WNN_COMMENT_LEN 512 /* jisho no comment no nagasa */ #define WNN_F_NAMELEN 256 #define WNN_PASSWD_LEN 16 /* File Passwd Length */ struct wnn_dic_info { int dic_no; /* ¼­½ñÈÖ¹æ */ int body; /* ¼­½ñËÜÂΤΥե¡¥¤¥ëÈÖ¹æ */ int hindo; /* ÉÑÅ٤Υե¡¥¤¥ëÈÖ¹æ */ int rw; /* ¼­½ñ¤¬ÅÐÏ¿²Äǽ¤«¤É¤¦¤« (WNN_DIC_RW, WNN_DIC_RDONLY) */ int hindo_rw; /* ÉÑÅÙ¤¬¹¹¿·²Äǽ¤«¤É¤¦¤« (WNN_DIC_RW, WNN_DIC_RDONLY) */ int enablef; /* ¼­½ñ¤¬»ÈÍÑÃæ¤«¤É¤¦¤« (1 = »ÈÍÑÃæ, 0 = »ÈÍÑÃæÃÇ) */ int nice; /* ¼­½ñ¤ÎÊÑ´¹»þ¤ÎÍ¥ÀèÅÙ */ int rev; /* µÕÊÑ´¹¤«¡¢¤É¤¦¤«(1 = µÕÊÑ´¹, 0 = ÀµÊÑ´¹) */ /* added H.T */ w_char comment[WNN_COMMENT_LEN]; /* ¼­½ñ¤Î¥³¥á¥ó¥È */ char fname[WNN_F_NAMELEN]; /* ¼­½ñ¤Î¥Õ¥¡¥¤¥ë̾ */ char hfname[WNN_F_NAMELEN]; /* ÉÑÅ٤Υե¡¥¤¥ë̾ */ char passwd[WNN_PASSWD_LEN]; /* ¼­½ñ¤Î¥Ñ¥¹¥ï¡¼¥É */ char hpasswd[WNN_PASSWD_LEN]; /* ÉÑÅ٤Υѥ¹¥ï¡¼¥É */ int type; /* ¼­½ñ¤Î¼ïÎà(WNN_UD_DICT,WNN_STATIC_DICT) */ int gosuu; /* ¼­½ñ¤Î¸ì¿ô */ int localf; int hlocalf; }; typedef struct wnn_dic_info WNN_DIC_INFO; /* Hideyuki Kishiba (Dec. 1, 1994) ÉÕ°¸ì¥Õ¥¡¥¤¥ë¾ðÊó¼õ¼èÍѹ½Â¤ÂÎ */ struct wnn_fzk_info { w_char comment[WNN_COMMENT_LEN]; /* ÉÕ°¸ì¤Î¥³¥á¥ó¥È */ char fname[WNN_F_NAMELEN]; /* ÉÕ°¸ì¤Î¥Õ¥¡¥¤¥ë̾ */ }; typedef struct wnn_fzk_info WNN_FZK_INFO; struct wnn_file_stat { int type; /* ¥Õ¥¡¥¤¥ë¤Î¼ïÎà WNN_STATIC_DICT ¸ÇÄê·Á¼°¼­½ñ WNN_UD_DICT ÅÐÏ¿²Äǽ·Á¼°¼­½ñ WNN_HINDO_FILE ÉÑÅÙ¥Õ¥¡¥¤¥ë WNN_FUZOKUGO_FILE ÉÕ°¸ì¥Õ¥¡¥¤¥ë WNN_NOT_A_JISHO ¤½¤Î¾ */ }; typedef struct wnn_file_stat WNN_FILE_STAT; /* */ extern int wnn_errorno; /* Wnn¤Î¥¨¥é¡¼¤Ï¤³¤ÎÊÑ¿ô¤ËÊó¹ð¤µ¤ì¤ë */ extern char *wnn_dic_types[]; /* "¸ÇÄê","ÅÐÏ¿","µÕÊÑ´¹","Àµµ¬" */ extern char *cwnn_dic_types[]; /* "¸ÇÄê","ÅÐÏ¿","µÕÊÑ´¹","Àµµ¬" */ extern char *bwnn_dic_types[]; /* "¸ÇÄê","ÅÐÏ¿","µÕÊÑ´¹","Àµµ¬" */ #define FILE_ALREADY_READ -2 /* ¤³¤Î¹½Â¤ÂΤϡ¢¥é¥¤¥Ö¥é¥êÆâÉô¤ÇÍѤ¤¤é¤ì¤ë */ struct wnn_jserver_id { int sd; char js_name[40]; int js_dead; jmp_buf js_dead_env; /* ¥µ¡¼¥Ð¤¬»à¤ó¤À»þ¤ËÈô¤ó¤Ç¤¤¤¯env */ int js_dead_env_flg; /* jd_server_dead_env¤¬Í­¸ú¤«Èݤ« */ }; typedef struct wnn_jserver_id WNN_JSERVER_ID; /* ¤³¤Î¹½Â¤ÂΤϡ¢¥é¥¤¥Ö¥é¥êÆâÉô¤ÇÍѤ¤¤é¤ì¤ë */ struct wnn_env { int env_id; WNN_JSERVER_ID *js_id; char lang[16]; /* for exsample "ja_JP" */ int muhenkan_mode; int bunsetsugiri_mode; int kutouten_mode; int kakko_mode; int kigou_mode; int autotune; int autosave; }; typedef struct wnn_env WNN_ENV; struct wnn_param { int n; /* £Î(Âç)ʸÀá²òÀϤΣΠ*/ int nsho; /* ÂçʸÀáÃæ¤Î¾®Ê¸Àá¤ÎºÇÂç¿ô */ int p1; /* ¼«Î©¸ì¤ÎÉÑÅ٤Υѥé¥á¡¼¥¿ */ int p2; /* ¾®Ê¸ÀáĹ¤Î¥Ñ¥é¥á¡¼¥¿ */ int p3; /* ¼«Î©¸ìĹ¤Î¥Ñ¥é¥á¡¼¥¿ */ int p4; /* º£»È¤Ã¤¿¤è¥Ó¥Ã¥È¤Î¥Ñ¥é¥á¡¼¥¿ */ int p5; /* ¼­½ñ¤Î¥Ñ¥é¥á¡¼¥¿ */ int p6; /* ¾®Ê¸Àá¤Îɾ²ÁÃͤΥѥé¥á¡¼¥¿ */ int p7; /* ÂçʸÀáĹ¤Î¥Ñ¥é¥á¡¼¥¿ */ int p8; /* ¾®Ê¸Àá¿ô¤Î¥Ñ¥é¥á¡¼¥¿ */ int p9; /* µ¿»÷ÉÊ»ì ¿ô»ú¤ÎÉÑÅÙ */ int p10; /* µ¿»÷ÉÊ»ì ¥«¥Ê¤ÎÉÑÅÙ *//* CWNN:±Ñ¿ô¤ÎÉÑÅÙ */ int p11; /* µ¿»÷ÉÊ»ì ±Ñ¿ô¤ÎÉÑÅÙ *//* CWNN:µ­¹æ¤ÎÉÑÅÙ */ int p12; /* µ¿»÷ÉÊ»ì µ­¹æ¤ÎÉÑÅÙ *//* CWNN:³«³ç¸Ì¤ÎÉÑÅÙ */ int p13; /* µ¿»÷ÉÊ»ì Êijç¸Ì¤ÎÉÑÅÙ *//* CWNN:Êijç¸Ì¤ÎÉÑÅÙ */ int p14; /* µ¿»÷ÉÊ»ì ÉÕ°¸ì¤ÎÉÑÅÙ *//* BWNN:No of koho */ int p15; /* µ¿»÷ÉÊ»ì ³«³ç¸Ì¤ÎÉÑÅÙ *//* CWNN:Not used */ }; #define WNN_ENV_LAST_IS_FIRST_MASK (1<<0) #define WNN_ENV_COMPLEX_CONV_MASK (1<<1) #define WNN_ENV_OKURI_LEARN_MASK (1<<2) #define WNN_ENV_OKURI_MASK (1<<3) #define WNN_ENV_PREFIX_LEARN_MASK (1<<4) #define WNN_ENV_PREFIX_MASK (1<<5) #define WNN_ENV_SUFFIX_LEARN_MASK (1<<6) #define WNN_ENV_COMMON_LAERN_MASK (1<<7) #define WNN_ENV_FREQ_FUNC_MASK (1<<8) #define WNN_ENV_NUMERIC_MASK (1<<9) #define WNN_ENV_ALPHABET_MASK (1<<10) #define WNN_ENV_SYMBOL_MASK (1<<11) #define WNN_ENV_YURAGI_MASK (1<<12) #define WNN_ENV_RENDAKU_MASK (1<<13) #define WNN_ENV_BUNSETSUGIRI_LEARN_MASK (1<<14) #define WNN_ENV_MUHENKAN_LEARN_MASK (1<<15) #define WNN_ENV_FI_RELATION_LEARN_MASK (1<<16) #define WNN_ENV_FI_FREQ_FUNC_MASK (1<<17) #define WNN_ENV_KUTOUTEN_MASK (1<<18) #define WNN_ENV_KAKKO_MASK (1<<19) #define WNN_ENV_KIGOU_MASK (1<<20) struct wnn_henkan_env { int last_is_first_flag; /* ºÇ½ª»ÈÍѺÇÍ¥Àè */ int complex_flag; /* Ê£¹ç¸ìÍ¥Àè */ int okuri_learn_flag; /* Á÷¤ê´ð½à³Ø½¬ */ int okuri_flag; /* Á÷¤ê´ð½à½èÍý */ int prefix_learn_flag; /* ÀÜÆ¬¸ì³Ø½¬ */ int prefix_flag; /* ÀÜÆ¬¸ì¸õÊä */ int suffix_learn_flag; /* ÀÜÈø¸ì³Ø½¬ */ int common_learn_flag; /* ÈÆÍÑ¸ì³Ø½¬ */ int freq_func_flag; /* ÉÑÅپ徺³ÎΨ´Ø¿ô */ int numeric_flag; /* µ¿»÷¿ô»ú¤Î½é´üɽ¼¨ÊýË¡ */ int alphabet_flag; /* µ¿»÷¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤Î½é´üɽ¼¨ÊýË¡ */ int symbol_flag; /* µ¿»÷µ­¹æ¤Î½é´üɽ¼¨ÊýË¡ */ /* * FI-Wnn ÄɲÃʬ * WATANABE Yasuhisa (Oct. 14, 1994) */ int yuragi_flag; /* Ĺ²»¡¦¤æ¤é¤®½èÍý */ int rendaku_flag; /* Ï¢Âù½èÍý */ int bunsetsugiri_flag; /* ʸÀáÀÚ¤ê³Ø½¬ */ int muhenkan_flag; /* ̵ÊÑ´¹³Ø½¬ */ int fi_relation_learn_flag; /* £Æ£É´Ø·¸³Ø½¬ */ int fi_freq_func_flag; /* £Æ£É´Ø·¸ÉÑÅپ徺³ÎΨ´Ø¿ô */ /* * FI-Wnn ÄɲÃʬ * Seiji KUWARI (Nov. 28, 1994) */ int kutouten_flag; /* ¶çÆÉÅÀ */ int kakko_flag; /* ³ç¸Ì */ int kigou_flag; /* µ­¹æ */ }; /* dictionary type bit mask for js_fi_dic_list[_all] */ #define WNN_DIC_WNN_SYSTEM_MASK (1<<0) #define WNN_DIC_WNN_USER_MASK (1<<1) #define WNN_DIC_FI_SYSTEM_MASK (1<<2) #define WNN_DIC_FI_USER_MASK (1<<3) #define WNN_DIC_BUNSETSU_MASK (1<<4) #define WNN_DIC_MUHENKAN_MASK (1<<5) #define WNN_DIC_TEMPORARY_MASK (1<<6) #define WNN_DIC_NO_AUTOLEARN_MASK \ (WNN_DIC_WNN_SYSTEM_MASK | WNN_DIC_WNN_USER_MASK) #define WNN_DIC_AUTOLEARN_MASK \ (WNN_DIC_BUNSETSU_MASK | WNN_DIC_MUHENKAN_MASK | WNN_DIC_TEMPORARY_MASK) #define WNN_DIC_WNN_ALL_MASK \ (WNN_DIC_NO_AUTOLEARN_MASK | WNN_DIC_AUTOLEARN_MASK) #define WNN_DIC_FI_ALL_MASK \ (WNN_DIC_FI_SYSTEM_MASK | WNN_DIC_FI_USER_MASK) #define WNN_DIC_ALL_MASK \ (WNN_DIC_WNN_ALL_MASK | WNN_DIC_FI_ALL_MASK) struct wnn_file_info_struct { int fid; /* ¥Õ¥¡¥¤¥ëÈÖ¹æ */ char name[WNN_F_NAMELEN]; /* ¥Õ¥¡¥¤¥ë̾ */ int localf; /* ¥µ¡¼¥Ð¡¦¥µ¥¤¥È¤Î¥Õ¥¡¥¤¥ë¤«¤É¤¦¤« 1: ¥µ¡¼¥Ð¡¦¥µ¥¤¥È 0: ¥¯¥é¥¤¥¢¥ó¥È¡¦¥µ¥¤¥È */ int type; /* ¥Õ¥¡¥¤¥ë¤Î¼ïÎà */ int ref_count; /* (´Ä¶­¤«¤é¤Î)»²¾È¿ô */ }; typedef struct wnn_file_info_struct WNN_FILE_INFO_STRUCT; #define WNN_VECT_L ((256+8*4-1)/(8*4) + 5) /***** !!!!! ****/ struct wnn_sho_bunsetsu { int end; /* ¸õÊäʸÀá¤Î end char index */ int start; /* ¸õÊäʸÀá¤Î top char index */ int jiriend; /* ¸õÊäʸÀá¤Î¼«Î©¸ì end char index */ int dic_no; /* ¼«Î©¸ì¤Î¼­½ñÆâ¤Î¥¨¥ó¥È¥êÈÖ¹æ */ int entry; /* ¸õÊäʸÀá¤Î¼«Î©¸ì¼­½ñ entry */ int hinsi; /* ¼«Î©¸ìÉÊ»ì */ int status; /* ÂçʸÀá¤ÎÀèÆ¬¤« */ int status_bkwd; /* usiro ¤ÎʸÀá¤ËÀܳ¤Ç¤­¤ë¤« */ int hindo; /* ¸õÊ伫Ω¸ì¤ÎÉÑÅÙ */ int ima; /* ¸õÊ伫Ω¸ì¤Îº£»È¤Ã¤¿¤è¥Ó¥Ã¥È */ int kangovect; /* Àܳ¥Ù¥¯¥È¥ë¥Æ¡¼¥Ö¥ë¤Ø¤Î¥Ý¥¤¥ó¥¿ */ int hyoka; /* ¾®Ê¸Àáɾ²ÁÃÍ */ w_char *kanji; /* ¼«Î©¸ìʸ»úÎó */ w_char *yomi; /* ¼«Î©¸ì¤ÎÆÉ¤ßʸ»úÎó */ w_char *fuzoku; /* ÉÕ°¸ìʸ»úÎó */ /* *ÉÑÅ٤ˤĤ¤¤Æ¤Ï¡¢ÉÑÅÙ¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë»þ¤Ï¡¢ *hindo = ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Î(¼Â)ÉÑÅÙÃÍ + ¼­½ñÆâ¤Î(¼Â)ÉÑÅÙÃÍ *ima = ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Îº£»È¤Ã¤¿¤è¥Ó¥Ã¥È * *ÉÑÅÙ¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤»þ¤Ë¤Ï¡¢ *hindo = ¼­½ñÆâ¤Î(¼Â)ÉÑÅÙÃÍ¡¢ima = ¼­½ñÆâ¤Îº£»È¤Ã¤¿¤è¥Ó¥Ã¥È *¤Ç¤¢¤ë¡£¤³¤³¤Ç¡¢¼ÂÉÑÅÙÃͤȤϡ¢·×»»µ¡Æâ¤Ç7¥Ó¥Ã¥È¤Ë°µ½Ì¤µ¤ì¤¿ÃͤǤ¢¤ë¡£ *²¾ÁÛÉÑÅÙÃͤǤϤʤ¯¼ÂÉÑÅÙÃͤòÊÖ¤¹¤Î¤Ï¡¢ÊÑ´¹·ë²Ì¤Î¥Ç¥Ð¥Ã¥°¤Î¤¿¤á¤Ç¤¢¤ë¡£ */ }; struct wnn_dai_bunsetsu { int end; /* ¸õÊäʸÀá¤Î end char index */ int start; /* ¸õÊäʸÀá¤Î top char index */ struct wnn_sho_bunsetsu *sbn; /* ¾®Ê¸Àá²òÀÏ·ë²Ì¤Ø¤Î¥Ý¥¤¥ó¥¿ */ int hyoka; /* ÂçʸÀáɾ²ÁÃÍ */ int sbncnt; /* ¾®Ê¸Àá¿ô (¼¡¸õÊä¤Î¾ì¹ç¤Ï¡¢¼¡¸õÊä¿ô) DSD_SBN¤Ï¡¢*sbn ¤«¤é sbncnt ¤À¤±¤¢¤ë */ }; struct wnn_jdata { int dic_no; /* ¼­½ñÈÖ¹æ */ int serial; /* ¼­½ñÆâ¤Î¥¨¥ó¥È¥êÈÖ¹æ */ int hinshi; /* ÉÊ»ìÈÖ¹æ(ÉÊ»ìÈÖ¹æ¤ÈÉÊ»ì̾¤ÎÂбþ¤Ï¡¢manual/etc ¤Î²¼¤ò»²¾È) */ int hindo; /* ÉÑÅÙ */ int ima; /* º£»È¤Ã¤¿¤è¥Ó¥Ã¥È */ int int_hindo; /* ¼­½ñÆâÉÑÅÙ */ int int_ima; /* ¼­½ñÆâ¡¢º£»È¤Ã¤¿¤è¥Ó¥Ã¥È */ w_char *yomi; /* ÆÉ¤ß¤Îʸ»úÎó */ w_char *kanji; /* ´Á»úʸ»úÎó */ w_char *com; /* ¥¨¥ó¥È¥ê¤Î¥³¥á¥ó¥Èʸ»úÎó */ /* *ÉÑÅ٤ˤĤ¤¤Æ¤Ï¡¢ÉÑÅÙ¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë»þ¤Ï¡¢ *hindo = ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Î(²¾ÁÛ)ÉÑÅÙÃÍ¡¢ima = ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Îº£»È¤Ã¤¿¤è¥Ó¥Ã¥È *int_hindo = ¼­½ñÆâ¤Î(²¾ÁÛ)ÉÑÅÙÃÍ¡¢int_ima = ¼­½ñÆâ¤Îº£»È¤Ã¤¿¤è¥Ó¥Ã¥È * *ÉÑÅÙ¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤»þ¤Ë¤Ï¡¢ *hindo = ¼­½ñÆâ¤Î(²¾ÁÛ)ÉÑÅÙÃÍ¡¢ima = ¼­½ñÆâ¤Îº£»È¤Ã¤¿¤è¥Ó¥Ã¥È *int_hindo = -1¡¢int_ima = -1 * *¤¿¤À¤·¡¢¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢¥¨¥ó¥È¥ê¤¬»ÈÍÑÃæ»ß¤Î¾õÂ֤λþ¤Ë¤Ï¡¢ *hindo = -1, ima = 0 ¤¢¤ë¤¤¤Ï¡¢ *int_hindo = -1, int_ima = 0 ¤È¤Ê¤ë¡£ *¤³¤³¤Ç¡¢(²¾ÁÛ)ÉÑÅÙÃͤȤϡ¢·×»»µ¡Æâ¤Ç7¥Ó¥Ã¥È¤Ë°µ½Ì¤µ¤ì¤¿ÉÑÅÙÃͤ«¤é¡¢ *¼ÂºÝ¤ÎÃͤòÁÛÄꤷ¤¿ÃͤǤ¢¤ë¡£ */ }; struct wnn_ret_buf { int size; /* buf ¤«¤é alloc ¤µ¤ì¤Æ¤¤¤ëÂ礭¤µ */ char *buf; /* malloc ¤Ê¤É¤Ç¤È¤é¤ì¤¿Îΰè */ }; /* * Hideyuki Kishiba (Sep. 20, 1994) * »ÈÍѣƣɴط¸ÂåÆþÍѹ½Â¤ÂΤòÄêµÁ¤¹¤ë */ struct fi_rel_data { int fi_dic_no; /* £Æ£É´Ø·¸¼­½ñ¤Î¼­½ñÈÖ¹æ */ int dic_no; /* ÀܳÄêµÁ¼­½ñ¤Î¼­½ñÈÖ¹æ */ int entry; /* ÀܳÄêµÁ¸õÊä¤Î¥¨¥ó¥È¥êÈÖ¹æ */ int offset; /* £Æ£É´Ø·¸¥Ç¡¼¥¿¤Î¥ª¥Õ¥»¥Ã¥ÈÈÖ¹æ */ int fi_hindo; /* £Æ£É´Ø·¸ÀܳÉÑÅÙ¤ÎÀßÄêÃÍ */ int fi_ima; /* £Æ£É´Ø·¸Àܳº£¥Ó¥Ã¥È¤ÎÀßÄêÃÍ */ }; typedef struct fi_rel_data FI_PRIO_DATA; /* * Hideyuki Kishiba (Sep. 20, 1994) * »ÈÍѣƣɴط¸Á÷¼õ¿®Íѹ½Â¤ÂΤòÄêµÁ¤¹¤ë */ struct wnn_fi_rel_buf { int size; /* alloc ¤µ¤ì¤Æ¤¤¤ë£Æ£É´Ø·¸¥Ç¡¼¥¿¿ô */ int num; /* Í­¸ú£Æ£É´Ø·¸¥Ç¡¼¥¿¿ô */ struct fi_rel_data *fi_buf; /* £Æ£É´Ø·¸¥Ç¡¼¥¿¹½Â¤ÂÎÇÛÎó¤Ø¤Î¥Ý¥¤¥ó¥¿ */ }; /* * Hideyuki Kishiba (Nov. 24, 1994) * Á°³ÎÄê£Æ£ÉÊÑ´¹Íѹ½Â¤ÂΤòÄêµÁ¤¹¤ë */ #define WNN_PREV_BUN_SUU 2 /* ³Ð¤¨¤Æ¤ª¤¯Ä¾Á°³ÎÄêʸÀá¿ô */ /* ľÁ°¤Ë³ÎÄꤷ¤¿Ê¸Àá¤Î³Æ¾ðÊó¤ò³Ð¤¨¤Æ¤ª¤¯¹½Â¤ÂÎ */ struct wnn_prev_bun { int dic_no; /* Wnn ¼­½ñÈÖ¹æ */ int entry; /* ¥¨¥ó¥È¥êÈÖ¹æ */ int real_kanjilen; /* ¸õÊäʸ»ú¿ô¡ÊÉÕ°¸ì¤Ê¤·¡Ë*/ w_char kouho[256]; /* ¸õÊäʸ»úÎó¡ÊÉÕ°¸ì¤¢¤ê¡Ë 256 == LENGTHKANJI */ int jirilen; /* ¼«Î©¸ìÆÉ¤ßĹ */ int hinsi; /* ÉÊ»ì */ }; #define WNN_F_UNIQ_LEN (sizeof(struct wnn_file_uniq)) /* hinsi name used in jlib and jserver */ #define WNN_HINSI_MEISI "̾»ì" #define WNN_HINSI_TANKAN "ñ´Á»ú" #define WNN_HINSI_SUUSI "¿ô»ì" #define WNN_HINSI_SETTOUO "ÀÜÆ¬¸ì(¤ª)" #define WNN_HINSI_SETSUBI "ÀÜÈø¸ì" #define WNN_HINSI_RENDAKU "Ï¢Âù" #define WNN_HINSI_TELNO "ÅÅÏÃÈÖ¹æ" #define WNN_HINSI_ZIPCODE "Í¹ÊØÈÖ¹æ" #define WNN_ROOT_HINSI_NODE "/" #define WNN_UNUSE_HINSI 9 /* ¤³¤Î¹½Â¤ÂΤϡ¢¥é¥¤¥Ö¥é¥êÆâÉô¤ÇÍѤ¤¤é¤ì¤ë */ struct wnn_file_head { struct wnn_file_uniq{ int time; int dev; int inode; char createhost[WNN_HOSTLEN]; } file_uniq; struct wnn_file_uniq file_uniq_org; int file_type; char file_passwd[WNN_PASSWD_LEN]; }; #define WNN_HINSI_NAME_LEN 64 #define WNN_FILE_HEADER_LEN (WNN_PASSWD_LEN + 8 + WNN_FILE_STRING_LEN + \ sizeof(struct wnn_file_uniq) * 2 + 4) /* 8 is for future use 4 is for file_type. */ /* JSLIB function declaration */ #define js_open(server, timeout) js_open_lang(server, "ja_JP", timeout) #define js_connect(server,env_name) js_connect_lang(server, env_name, "ja_JP") extern WNN_JSERVER_ID *js_open_lang(); extern unsigned int dispname_to_ipaddr(); extern int js_close(); extern WNN_JSERVER_ID *js_change_current_jserver(); extern struct wnn_env *js_connect_lang(); extern int js_disconnect(); extern int js_env_list(); extern int js_param_set(); extern int js_param_get(); extern char *js_get_lang(); /**************************************/ extern int js_access(); extern int js_dic_add(); extern int js_dic_delete(); extern int js_dic_file_create(); extern int js_dic_file_create_client(); extern int js_dic_info(); extern int js_dic_list(); extern int js_dic_list_all(); extern int js_dic_use(); extern int js_env_exist(); extern int js_env_sticky(); extern int js_env_un_sticky(); extern int js_file_comment_set(); extern int js_file_discard(); extern int js_file_info(); extern int js_file_list(); extern int js_file_list_all(); extern int js_file_loaded(); extern int js_file_loaded_local(); extern int js_file_password_set(); extern int js_file_read(); extern int js_file_receive(); extern int js_file_remove(); extern int js_file_remove_client(); extern int js_file_send(); extern int js_file_stat(); extern int js_file_write(); extern void js_flush(); extern int js_fuzokugo_get(); extern int js_fuzokugo_set(); extern int js_hindo_file_create(); extern int js_hindo_file_create_client(); extern int js_hindo_set(); extern int js_hinsi_dicts(); extern int js_hinsi_list(); extern int js_hinsi_name(); extern int js_hinsi_number(); extern int js_hinsi_table_set(); extern int js_isconnect(); extern int js_kanren(); extern int js_kantan_dai(); extern int js_kantan_sho(); extern int js_kanzen_dai(); extern int js_kanzen_sho(); extern int js_kill(); extern int js_mkdir(); extern int js_version(); extern int js_who(); extern int js_word_add(); extern int js_word_comment_set(); extern int js_word_delete(); extern int js_word_info(); extern int js_word_search(); extern int js_word_search_by_env(); extern int js_access_add_host(); extern int js_access_remove_host(); extern int js_access_add_user(); extern int js_access_remove_user(); extern int js_access_enable(); extern int js_access_disable(); extern char **js_access_get_info(); extern int js_is_loaded_temporary_dic(); extern int js_temporary_dic_add(); extern int js_temporary_dic_delete(); extern int js_autolearning_word_add(); extern int js_temporary_word_add(); extern int js_set_autolearning_dic(); extern int js_get_autolearning_dic(); extern int js_set_henkan_env(); extern int js_get_henkan_env(); extern int js_get_henkan_env_local(); extern int js_set_henkan_hinsi(); extern int js_get_henkan_hinsi(); extern int js_henkan_with_data(); /* * Hideyuki Kishiba (Jul. 8, 1994) * New js_lib functions for FI-Wnn */ extern int js_fi_dic_add(); extern int js_fi_hindo_file_create(); extern int js_fi_hindo_file_create_client(); extern int js_fi_kanren(); extern int js_set_fi_priority(); extern int js_optimize_fi(); extern int js_fi_dic_list(); extern int js_fi_dic_list_all(); extern int js_fuzokugo_list(); #endif /* _JSLIB_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/config.h0000644000000000000000000002551207153676736020321 0ustar rootroot/* * $Id: config.h,v 2.29.2.1 2000/08/04 05:37:11 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ #ifndef _CONFIG_H_ #define _CONFIG_H_ #ifndef LIBDIR #define LIBDIR "/usr/local/lib/wnn6" #endif /* LIBDIR */ #ifdef TAIWANESE #ifndef CHINESE #define CHINESE #endif #endif #define WNN_USERNAME_ENV "WNNUSER" #define WNN_JSERVER_ENV "JSERVER" #define WNN_CSERVER_ENV "CSERVER" #define WNN_KSERVER_ENV "KSERVER" #define WNN_TSERVER_ENV "TSERVER" #define WNN_J_LANG "ja_JP" #define WNN_C_LANG "zh_CN" #define WNN_K_LANG "ko_KR" #define WNN_T_LANG "zh_TW" #ifdef JAPANESE #define WNN_DEFAULT_LANG WNN_J_LANG #define WNN_DEF_SERVER_ENV WNN_JSERVER_ENV #else /* JAPANESE */ #ifdef CHINESE #ifdef TAIWANESE #define WNN_DEFAULT_LANG WNN_T_LANG #define WNN_DEF_SERVER_ENV WNN_TSERVER_ENV #else /* TAIWANESE */ #define WNN_DEFAULT_LANG WNN_C_LANG #define WNN_DEF_SERVER_ENV WNN_CSERVER_ENV #endif /* TAIWANESE */ #else /* CHINESE */ #ifdef KOREAN #define WNN_DEFAULT_LANG WNN_K_LANG #define WNN_DEF_SERVER_ENV WNN_KSERVER_ENV #else /* KOREAN */ #define WNN_DEFAULT_LANG WNN_J_LANG #define WNN_DEF_SERVER_ENV WNN_JSERVER_ENV #endif /* KOREAN */ #endif /* CHINESE */ #endif /* JAPANESE */ #define WNN_UUM_ENV "UUMRC" #define WNN_KEYBOARD_ENV "KEYBOARD" #define WNN_COUNTDOWN_ENV "UUM_COUNTDOWN" #define PATHNAMELEN 256 /* for jserver */ #ifndef SERVER_INIT_FILE # ifdef JAPANESE # define SERVER_INIT_FILE "/ja_JP/jserverrc" # else /* JAPANESE */ # ifdef CHINESE # ifdef TAIWANESE # define SERVER_INIT_FILE "/zh_TW/tserverrc" # else /* TAIWANESE */ # define SERVER_INIT_FILE "/zh_CN/cserverrc" # endif /* TAIWANESE */ # else /* CHINESE */ # ifdef KOREAN # define SERVER_INIT_FILE "/ko_KR/kserverrc" # else /* KOREAN */ # define SERVER_INIT_FILE "/ja_JP/jserverrc" /* Default */ # endif /* KOREAN */ # endif /* CHINESE */ # endif /* JAPANESE */ #endif #define JSERVER_DIR "/usr/local/lib/dic" #define WNN_ACCESS_FILE "wnnhosts" /* for uum */ #define RCFILE "/uumrc" /* LIBDIR/@LANG/RCFILE */ #define USR_UUMRC "/.uumrc" #define RKFILE "/rk/mode" /* LIBDIR/@LANG/RKFILE */ #define CPFILE "/uumkey" /* LIBDIR/@LANG/CPFILE */ #define MESSAGEFILE "/message_file" #define RKFILE_ATOK8 "/rk/mode.atok8" #define CPFILE_ATOK8 "/uumkey.atok8" #define RKFILE_EGBRIDGE "/rk/mode.egbridge" #define CPFILE_EGBRIDGE "/uumkey.egbridge" #define RKFILE_WNN4 "/rk/mode.wnn4" #define CPFILE_WNN4 "/uumkey.wnn4" #define RKFILE_WNN6 "/rk/mode.eitango" #define CPFILE_WNN6 "/uumkey.wnn6" #ifdef ATOK7 #define RKFILE_ATOK7 "/rk/mode.atok7" #define CPFILE_ATOK7 "/uumkey.atok7" #endif /* ATOK7 */ #ifdef VJEDELTA #define RKFILE_VJEDELTA "/rk/mode.vjedelta" #define CPFILE_VJEDELTA "/uumkey.vjedelta" #endif /* VJEDELTA */ #ifdef WXII #define RKFILE_WXII "/rk/mode.wxii" #define CPFILE_WXII "/uumkey.wxii" #endif /* WXII */ #ifdef MSIME #define RKFILE_MSIME "/rk/mode.msime" #define CPFILE_MSIME "/uumkey.msime" #endif /* MSIME */ #define CONVERT_FILENAME "/cvt_key_tbl" #define ENVRCFILE "/wnnenvrc" #ifndef HINSIDATA_FILE # define HINSIDATA_FILE "/ja_JP/hinsi.data" #endif /* HINSIDATA_FILE */ #define USR_DIC_DIR_VAR "@USR" #define FIWNN_DIR "/.Wnn6" /* Path under the home directory of user */ #define DEFAULT_RC_NAME "@DEFAULT" /* if you wish to do flow control active for your tty, define FLOW_CONTROL to 1. note that this 'tty' means the tty from which wnn is invoked. */ #define FLOW_CONTROL 0 #define C_LOCAL '!' /* For Local File Name. Local File Name is send as "Hostname!Filename" when C_LOCAL is '!'. It is also used in jl_library to specify local file-name, that is, file-names which start with this character are considered to be local. */ /* define default kanji code system for your 'tty' side and 'pty' side. 'tty' side (TTY_KCODE) means 'your terminal's code'. 'pty' side (PTY_KCODE) means 'application's code'. */ #define TTY_KCODE J_EUJIS #define PTY_KCODE J_EUJIS #define TTY_CCODE C_EUGB #define PTY_CCODE C_EUGB #define TTY_TCODE C_BIG5 #define PTY_TCODE C_BIG5 #define TTY_HCODE K_EUKSC #define PTY_HCODE K_EUKSC /* OPTIONS defines what options are available. define it by modifying ALL_OPTIONS string. if you wish to make some option abailable, leave that character unchanged. else turn that character some non-option character, ex. '*'. TAKE CARE NOT TO MOVE CHARACTER POSITION, ORDER, ETC!! see sdefine.h for precise definition of ALL_OPTIONS. defines below may be incorrect. #define GETOPTSTR "hHujsUJSPxXk:c:r:l:D:n:vL:" #define ALL_OPTIONS "hHujsUJSPxXkcrlDnvL" #ifndef OPTIONS #define OPTIONS ALL_OPTIONS #endif */ #define WNN_TIMEOUT 5 /* connect ¤ÎºÝ¤Ë£µÉÃÂԤĤó¤À¤è */ #define WNN_DISP_MODE_LEN 5 /* ¥â¡¼¥Éɽ¼¨¤ËɬÍפÊcolumn¿ô */ #endif /* _CONFIG_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/wnn_string.h0000644000000000000000000001554407153676737021251 0ustar rootroot/* * $Id: wnn_string.h,v 2.2.2.2 2000/08/04 05:37:17 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ #ifndef _WNN_STRING_H_ #define _WNN_STRING_H_ extern int wnn_sStrcpy(); extern int wnn_Sstrcpy(); extern void wnn_Sreverse(); extern char * wnn_Stos(); extern char *wnn_sStrncpy(); extern w_char *wnn_Sstrncpy(); extern w_char *wnn_Strcat(); extern w_char *wnn_Strncat(); extern int wnn_Strcmp(); extern int wnn_Substr(); extern int wnn_Strncmp(); extern w_char *wnn_Strncpy(); extern int wnn_Strlen(); extern w_char *wnn_Strcpy(); extern void wnn_delete_w_ss2(); extern int wnn_byte_count(); #ifndef JS extern int check_pwd(); #endif #ifdef CHINESE extern int wnn_Sstrcat(); #endif #endif /* _WNN_STRING_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/copyright.h0000644000000000000000000001437607153676736021072 0ustar rootroot/* * $Id: copyright.h,v 2.1.2.1 2000/08/04 05:37:11 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/jdata.h0000644000000000000000000003251707153676737020143 0ustar rootroot/* * $Id: jdata.h,v 2.7.2.1 2000/08/04 05:37:13 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ #ifndef _JDATA_H_ #define _JDATA_H_ /* * Hideyuki Kishiba (Jul. 20, 1994) * £Æ£É´Ø·¸¾ðÊó¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î include */ #include "fi_jdata.h" #ifndef JS struct jdata { int kanji1; short kanji2; /* */ short which ; /* gyaku henkan? */ int serial; /* index is a serial number of the first entry which is stored in this entry*/ int kosuu; /* this means the number of elements in this entry */ int jishono; /* jishono in which these entries are stored */ struct jdata *jptr; /* pointer to another jdata which points out a jdata of the same yomi but (always)different jishono*/ unsigned short *hinsi; #ifdef CONVERT_with_SiSheng /* Don't warry. Only use in server and jutil */ /* It's only use CWNN : »ÍÀ¼ */ unsigned short *sisheng; unsigned short sisheng_int; #endif UCHAR *hindo; /* ÉÑÅÙ */ UCHAR *hindo_in; /* ÆâÉôÉÑÅÙ */ UCHAR *gakusyu; /* ³Ø½¬¾ðÊó */ /* * Hideyuki Kishiba (Jul. 20, 1994) * £Æ£É´Ø·¸¾ðÊ󸡺÷·ë²Ì¤Î¼­½ñ¥¿¥¤¥×¤È¥Ý¥¤¥ó¥¿¤òÆþ¤ì¤ë */ int fi_data_type; struct fi_dic_data **fi_ddata; struct fi_hindo_data **fi_hdata; }; #endif /* JS */ struct JT { unsigned int total; /* ¥È¡¼¥¿¥ëÉÑÅÙ */ int gosuu; char hpasswd[WNN_PASSWD_LEN]; int syurui; int maxcomment; int maxhinsi_list; int maxserial; int maxtable; /* For UD Dic */ int maxhontai; /* For UD Dic and Static Dic */ int maxkanji; int maxri1[2]; /* For Rev Dic */ int maxri2; /* For Rev Dic, is equal to maxserial */ w_char *comment; w_char *hinsi_list; UCHAR *hindo; /* ÉÑÅÙ */ #ifdef CONVERT_with_SiSheng /* Don't warry. Only use in server and jutil */ /* It's only use CWNN : »ÍÀ¼ */ unsigned short *sisheng; unsigned short sisheng_int; #endif unsigned short *hinsi; /* bunpou data is stored here */ UCHAR *kanji; /* kanji data is stored here */ struct uind1 *table; /* anothe tablefile for user jisho */ UCHAR *hontai; /* the tablefile (index-file) */ struct rind1 *ri1[2]; /* For Rev Dic */ struct rind2 *ri2; /* For Rev Dic */ short dirty; short hdirty; /* ¤³¤³¤«¤é4¤Ä¤Ï¡¢ ÅÐÏ¿²Äǽ¼­½ñ¡¢µÕÊÑ´¹²Äǽ¼­½ñ¤Ë¤Î¤ß´Ø·¸¤¹¤ë */ int bufsize_kanji; /* ´Á»úÎΰè¤ÎÂ礭¤µ */ int bufsize_serial; /* ʸˡ¡¢ÉÑÅÙÎΰè¤ÎÂ礭¤µ */ int bufsize_hontai; /* ¥¤¥ó¥Ç¥Ã¥¯¥¹(hontai)¤ÎÎΰè¤ÎÂ礭¤µ*/ int bufsize_table; /* ¥¤¥ó¥Ç¥Ã¥¯¥¹(table)¤ÎÎΰè¤ÎÂ礭¤µ*/ int bufsize_ri1[2]; /* µÕÊÑ´¹²Äǽ¼­½ñ¤Î table ¤ÎÎΰè¤ÎÂ礭¤µ */ /* hinsi_list wo kakunou suru */ int maxnode; struct wnn_hinsi_node *node; #ifdef CONVERT_by_STROKE /* Don't warry. Only use in server and jutil */ /* Used for Bixing dic */ struct b_node *bind; /* index for yomi <--> kanji search*/ int max_bnode; /* Max num of tuple */ int bufsize_bnode; /* BUFFER size of the b_node */ #endif int is_compressed; /* for compact dictionary */ }; /* for compact dictionary */ /* should be union-ed, but ,, */ #define cd_block_size maxtable #define cd_data_length maxhontai #define cd_data_area kanji #define cd_index hontai #define cd_data_area_size bufsize_kanji #define cd_index_size bufsize_hontai struct cd_index_layout { /* for compact dictionary */ long serial; union { UCHAR uc4[4]; long l; } yomi; }; struct HJT { struct wnn_file_uniq dic_file_uniq; int maxcomment; int maxserial; /* Max num in dictionary */ int hindo_area; /* Current num of hindo data area */ unsigned char *curserial; /* Current num sets hindo in a area */ w_char *comment; unsigned int **hindo; short hdirty; short *bufsize_serial; }; /* * structures concerning UD dicts */ #define AL_INT(x) ((int)((char *)(x) + 3) & ~0x3) #define ENDPTR 0 /* The end of (int) pointer list in uind2->next */ #define RD_ENDPTR 0xffffffff /* The end of (int) pointer list in rind2->next */ struct uind1 { int pter1; /* pointer to uind1 */ int pter; /* pinter to uind2 */ unsigned int yomi1; unsigned int yomi2; }; struct uind2 { int next; /* pointer to uind2 */ int serial; int kanjipter; w_char kosuu; w_char yomi[1]; /* actually it is variable length */ }; /* MAXTABLE MAX... ha user file no ookisani kuwaete touroku no tame ni totteoku ookisa*/ #define MAXTABLE 100 /* you can touroku MAXTABLE element without realloc the jisho*/ #define MAXHONTAI MAXTABLE * 4 * 4 #define MAXKANJI MAXTABLE * 10 #define MAXSERIAL MAXTABLE #define MAXBIND MAXTABLE * 4 /* hindo data area size */ #define MAX_HINDO_DATA_AREA 256 /* * structures concerning REV dicts. */ struct rind1 { int pter1; /* pointer to rind1 */ int pter; /* pinter to rind2 */ }; struct rind2 { int next[2]; /* pointer to rind2 */ int kanjipter; }; /* * Reverse Dict ni kansite, dotira wo hikuka? */ #define D_YOMI 0 #define D_KANJI 1 #define KANJI_str1(pter, which) (((which) == D_YOMI)?((w_char *)((pter) + 2)):\ ((w_char *)((pter) + 2) + Strlen((w_char *)((pter) + 2)) + 1)) #define KANJI_str(p, which) ((*((p) + 1) & FORWARDED)? \ KANJI_str1(((*(w_char *)((p) + 2)) << 16 | (*(w_char *)((p) + 4))) \ + (p),which): \ KANJI_str1((p), which)) #define Get_kanji_len(pter, which) (Strlen(KANJI_str(pter, which))) /* * structures concerning SD dicts. */ #define ST_NORMAL 1 #define ST_NOENT 2 #define ST_NOPTER 3 #define ST_SMALL 4 #define ST_TABLE 5 /* *Concerning HINSI. But these may not be used. */ #define SAKUJO_HINSI 0xfffe /* sakujo sareta tango no hinsi */ #define NANDEMO_EEYO 0xfffd /* nandemo maeni koreru to iu hinsi */ /* *Concerning KANJI and COMMENT. */ #define HAS_YOMI 1 #define HAS_COMMENT 2 #define FORWARDED 4 /* #define SEPARATE_CHAR '\0'*/ /* Choose character which do not appear as the first byte of w_char */ #define DIC_YOMI_CHAR 1 #define DIC_COMMENT_CHAR 2 #define DIC_HIRAGANA "\\y" #define DIC_KATAKANA "\\k" /*#define DIC_HANKAKU "\\h" *//* Ⱦ³Ñ *//* ÆÉ¤ß¤Î¤Þ¤Þ */ #define DIC_ZENKAKU "\\z" /* Á´³Ñ *//* £±£²£³ */ #define DIC_NUM_KAN "\\chan" /* ´Á¿ô»ú *//* °ìÆó»° */ #define DIC_NUM_KANSUUJI "\\chas" /* ´Á¿ô»ú *//* É´Æó½½»° */ #define DIC_NUM_KANOLD "\\chao" /* ´Á¿ô»ú *//* °íÉ´Æõ½¦»² */ #define DIC_NUM_HANCAN "\\nhc" /* Ⱦ³Ñ¿ô»ú *//* 1,234 */ #define DIC_NUM_ZENCAN "\\nzc" /* Á´³Ñ¿ô»ú *//* £±¡¤£²£³£´ */ #define DIC_HEX "\\X" /* \Xa4a2 */ #define DIC_HEXc "\\x" /* \xa4a2 */ #define DIC_OCT "\\0" /* \040 */ #define DIC_ESC "\\\\" /* \\ = \ */ #define DIC_OKURI_KIJUN "\\r" #define DIC_OKURI_FUKUGOU "\\f" #define DIC_SETTOU_GAKUSYU "\\t" #define DIC_SETUBI_GAKUSYU "\\b" #define DIC_HANYOU_GAKUSYU "\\h" #define DIC_KUGIRI_CHAR '\\' #ifdef notuse /* ±Ñ¿ô */ #define WNN_ALP_HAN -4 /* Ⱦ³Ñ *//* ÆÉ¤ß¤Î¤Þ¤Þ */ #define WNN_ALP_ZEN -30 /* Á´³Ñ */ /* µ­¹æ */ #define WNN_KIG_HAN -5 /* Ⱦ³Ñ *//* ÆÉ¤ß¤Î¤Þ¤Þ */ #define WNN_KIG_JIS -40 /* Á´³Ñ(JIS) */ #define WNN_KIG_ASC -41 /* Á´³Ñ(ASC) */ #endif #ifdef CONVERT_by_STROKE struct b_node{ short pter; /* Point to Indix-2 */ short pter_son; /* Ptr to first son */ short pter_next; /* Ptr to next brother */ }; struct b_koho { struct b_koho *previou; int value; w_char *p_yomi; w_char *p_kanji; unsigned short *p_hinsi; UCHAR *p_hindo; UCHAR *p_gakusyu; int serial; int dic_no; }; #endif #endif /* _JDATA_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/mt_jserver.h0000644000000000000000000001521307153676737021232 0ustar rootroot/* * $Id: mt_jserver.h,v 2.3.2.1 2000/08/04 05:37:16 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ #ifndef _MT_JSERVER_H_ #define _MT_JSERVER_H_ #define ARGS char #define MARGS char #define DS_THREAD_CREATE(a, b, c, d) #define DS_THREAD_DETACH(a) #define DS_THREAD_EXIT(a) #define DS_MUTEX_INIT(a, b) #define DS_MUTEX_LOCK(a) #define DS_MUTEX_UNLOCK(a) #define DS_COND_INIT(a, b) #define DS_COND_WAIT(a, b) #define DS_COND_SIGNAL(a) #define DS_COND_BROADCAST(a) #endif /* _MT_JSERVER_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/hinsi_file.h0000644000000000000000000001671607153676737021174 0ustar rootroot/* * $Id: hinsi_file.h,v 2.2.2.1 2000/08/04 05:37:13 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ /* ÉÊ»ì¥Õ¥¡¥¤¥ë¤Ë´Ø¤¹¤ë¡¢ÄêµÁ */ #ifndef _HINSI_FILE_H_ #define _HINSI_FILE_H_ #define MAXHINSI 256 #define MAXFUKUGOU 256 #define MAXNODE 256 #define FUKUGOU_START 0xffff - RESERVE_FUKUGOU_USIRO #define HEAP_LEN (10 * (MAXHINSI + MAXFUKUGOU)) /* 10 bytes for each hinsi */ #define WHEAP_LEN (10 * MAXFUKUGOU * sizeof(short)) /* 10 bytes for each fukugou hinsi */ #define RESERVE_FUKUGOU_USIRO 512 /* fukugou hinsi no usiro ni koredake reserve wo site oku */ /* hitoru ha delete sareta to iu jouhou no ta me*/ #define TERMINATE 0xffff #define HINSI_ERR -2 #define WNN_NODE_SUFFIX '/' #define NODE_CHAR '|' #define COMMENT_CHAR ';' #define DEVIDE_CHAR '$' #define HINSI_SEPARATE_CHAR ':' #define IGNORE_CHAR1 ' ' #define IGNORE_CHAR2 '\t' #define YOYAKU_CHAR '@' #define CONTINUE_CHAR '\\' struct wnn_fukugou{ w_char *name; /* Ê£¹çÉÊ»ì¤Î̾Á° */ /* fukugou hinsi is held as a string */ unsigned short *component; /* Ê£¹çÉÊ»ì¤Î¹½À®Í×ÁǤȤʤëÉÊ»ì¤ÎÈÖ¹æ¤ÎÇÛÎó (ºÇ¸å¤Ï 0xffff ¤Ç½ª¤ë) */ }; struct wnn_hinsi_node{ w_char *name; /* ÉÊ»ì¥Î¡¼¥É¤Î̾Á° */ int kosuu; /* »Ò¤É¤â¤Î¿ô */ w_char *son; /* ºÇ½é¤Î»Ò¤É¤â¤Ø¤Î¥Ý¥¤¥ó¥¿ */ }; #endif /* _HINSI_FILE_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/Imakefile0000644000000000000000000000050607153676736020510 0ustar rootrootXCOMM XCOMM $Id: Imakefile,v 2.2 1996/08/26 06:10:00 yamasita Exp $ XCOMM INSTALLFLAGS = $(INSTINCFLAGS) HEADERS = jllib.h \ jslib.h \ rk_spclval.h \ wnnerror.h \ commonhd.h \ cplib.h \ msg.h all:: #if InstallHeader instlib:: install InstallMultipleDest(install, $(HEADERS),$(JWNNINCDIR)) #endif depend:: clean:: wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/commonhd.h0000644000000000000000000002633207153676736020661 0ustar rootroot/* * $Id: commonhd.h,v 2.30.2.3 2000/08/04 05:37:11 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ /**************** * Common header ****************/ #ifndef _COMMONHD_H_ #define _COMMONHD_H_ #include #ifdef linux #include #endif #define JSERVER_VERSION 0xF101 /* minor version */ #define _SERVER_VERSION "Wnn6 R2.22" /* other */ #include "wnnerror.h" #ifndef JS typedef unsigned int UINT; typedef unsigned char UCHAR; #ifndef w_char # define w_char unsigned short #endif /* w_char */ #endif /*JS */ #ifdef TAIWANESE #ifndef CHINESE #define CHINESE #endif #endif #ifdef CHINESE #define CONVERT_from_TOP #define CONVERT_by_STROKE /* É®·Á(Bi Xing) */ #define CONVERT_with_SiSheng /* »ÍÀ¼(Si Sheng) */ #define NO_FZK /* ÉÕ°¸ì¤Ï¡¢¤Ê¤¤ */ #define NO_KANA /* ¤Ò¤é¤¬¤Ê(ÆÉ¤ß¤ÈƱ¤¸¸õÊä)¤Ï¡¢¤Ê¤¤ */ #endif #ifdef KOREAN #define CONVERT_from_TOP #define NO_FZK #endif #ifdef luna #ifdef uniosu # ifndef SYSVR2 # define SYSVR2 # endif # ifndef TERMINFO # define TERMINFO # endif #else /* if defined(MACH) || defined(uniosb) */ # ifndef BSD42 # define BSD42 # endif # ifndef BSD43 # define BSD43 # endif # if defined(luna68k) # ifndef BSD44 # define BSD44 # endif # endif /* defined(luna68k) */ # ifndef TERMCAP # define TERMCAP # endif #endif #else /* defined(luna) */ #if defined(sun) && !defined(SVR4) # ifndef BSD42 # define BSD42 # endif # ifndef TERMCAP # define TERMCAP # endif #else /* sun else */ #if defined(DGUX) || defined(linux) # ifndef SYSVR2 # define SYSVR2 # endif # ifndef TERMCAP # define TERMCAP # endif #else #if defined(SVR4) || defined(hpux) || defined(AIXV3) || defined(SGI) # ifndef SYSVR2 # define SYSVR2 # endif # ifndef TERMINFO # define TERMINFO # endif # if (defined solaris || defined SOLARIS) # define BSD_COMP # endif #else # ifndef BSD43 # define BSD43 # endif # ifndef BSD42 # define BSD42 # endif # ifndef TERMCAP # define TERMCAP # endif #endif /* defined(SVR4) || defined(hpux) */ #endif /* DGUX */ #endif /* sun */ #endif /* luna */ #if defined(SYSVR2) || defined(sun) # define SRAND48 #endif #if defined(SVR4) || defined(hpux) #ifndef F_OK #define F_OK 0 #endif #ifndef R_OK #define R_OK 4 #endif #endif #define MAXBUNSETSU 80 #define LIMITBUNSETSU 600 #define MAXJIKOUHO 600 #define J_IUJIS 0 #define J_EUJIS 1 #define J_JIS 2 #define J_SJIS 3 #define C_IUGB 0 #define C_EUGB 1 #define C_ICNS11643 0 #define C_ECNS11643 1 #define C_BIG5 2 #define K_IUKSC 0 #define K_EUKSC 1 #define K_KSC 2 #ifndef True #define True 1 #endif #ifndef False #define False 0 #endif #define KANJI(x) ((x) & 0x80) #define Ctrl(X) ((X) & 0x1f) #define NEWLINE Ctrl('J') #define CR Ctrl('M') #define ESC '\033' /* rubout_code ¤¬ 0x08 ¤Ç¤¢¤ë¤³¤È¤¬Á°Äó¤Çºî¤é¤ì¤Æ¤¤¤ëÍͤʤΤÇÊѹ¹¤·¤¿ */ #define RUBOUT 0x08 #if 0 #ifdef luna #ifdef uniosu #define RUBOUT 0x08 /* BS */ #else #define RUBOUT '\177' #endif #else #define RUBOUT '\177' #endif #endif #define SPACE ' ' #define JSPACE 0xa1a1 #ifdef KOREAN #define BAR 0xA1aa /* ¡¼ */ #else #define BAR 0xA1BC /* ¡¼ */ #endif #define KUTEN_NUM 0xA1A3 /* ¡£ */ #define TOUTEN_NUM 0xA1A2 /* ¡¢ */ #define S_NUM 0xA3B0 /* £° */ #define E_NUM 0xA3B9 /* £¹ */ #ifdef KOREAN #define S_HIRA 0xAAA1 /* ¤¡ */ #define E_HIRA 0xAAF3 /* ¤ó */ #define S_KATA 0xABA1 /* ¥¡ */ #define E_KATA 0xABF6 /* ¥ö */ #else #define S_HIRA 0xA4A1 /* ¤¡ */ #define E_HIRA 0xA4F3 /* ¤ó */ #define S_KATA 0xA5A1 /* ¥¡ */ #define E_KATA 0xA5F6 /* ¥ö */ #endif #define S_HANKATA 0x00A1 /* ¼£ */ #define E_HANKATA 0x00DF /* ¼á */ #ifdef KOREAN #define S_JUMO 0xa4a1 /* ¤¡ */ #define E_JUMO 0xa4fe /* ¤þ */ #define S_HANGUL 0xb0a1 /* °¡ */ #define E_HANGUL 0xc8fe /* Èþ */ #define S_HANJA 0xcaa1 /* Ê¡ */ #define E_HANJA 0xfdfe /* ýþ */ #define ishanja(x) ((unsigned)((x) - S_HANJA) <= (E_HANJA - S_HANJA)) #define ishangul(x) ((unsigned)((x) - S_HANGUL) <= (E_HANGUL - S_HANGUL)) #endif #define HIRAP(X) ((X) >= S_HIRA && (X) <= E_HIRA) #define KATAP(X) (((X) >= S_KATA && (X) <= E_KATA) || ((X) == BAR)) #define ASCIIP(X) ((X) < 0x7f) #define KANJIP(X) (!(HIRAP(X) || KATAP(X) || ASCIIP(X))) #define YOMICHAR(X) ((HIRAP(X)) || \ ('0'<=(X)&&'9'>=(X)) || \ ('A'<=(X)&&'Z'>=(X)) || \ ('a'<=(X)&&'z'>=(X)) || \ (BAR == X) \ ) #define HIRA_OF(X) ((KATAP(X) && !(BAR == (X)))? ((X) & ~0x0100) : (X)) #ifdef CONVERT_by_STROKE # define Q_MARK '?' #endif /* CONVERT_by_STROKE */ #define LENGTHYOMI 256 /* jisho ni touroku suru yomi no nagasa */ #define LENGTHKANJI 256 /* jisho ni touroku suru kanji no nagasa */ #define LENGTHBUNSETSU 264 /* ʸÀá¤ÎºÇÂçĹ */ #define LENGTHCONV 512 /* ÊÑ´¹²ÄǽºÇÂçʸ»ú¿ô */ #define JISHOKOSUU 20 #define DIC_RDONLY 1 /* ¼­½ñ¤¬¥ê¡¼¥É¡¦¥ª¥ó¥ê¡¼¤Ç¤¢¤ë¡£*/ /* Ê£¿ô¤Î¥Õ¥¡¥¤¥ë¤Ë¤Þ¤¿¤¬¤Ã¤ÆÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ÎÄêµÁ */ #define EXPAND_PATH_LENGTH 256 /* expand_expr()¤¬ÍѤ¤¤ë¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º */ #define WNN_FILE_STRING "£×£î£î¤Î¥Õ¥¡¥¤¥ë" #define WNN_FILE_STRING_LEN 16 #define F_STAMP_NUM 64 #define FILE_ALREADY_READ -2 #define FILE_NOT_READ -3 #endif /* _COMMONHD_H_ */ /* Local Variables: kanji-flag: t End: */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/jd_sock.h0000644000000000000000000002145507153676737020473 0ustar rootroot/* * $Id: jd_sock.h,v 2.17.2.1 2000/08/04 05:37:13 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ /* jd_sock.h jslib header file */ #ifdef UX386 #undef AF_UNIX #include #else #include #endif /* UX386 */ #include #ifdef AF_UNIX #include #endif /* AF_UNIX */ #ifdef UX386 #include #else #include #endif /* UX386 */ #if defined(uniosu) || defined(UX386) #include /* SX */ #else #include /* SUN or BSD SYSV*/ #endif /*uniosu */ #ifdef TAIWANESE #ifndef CHINESE #define CHINESE #endif #endif #define ERROR -1 # define WNN_PORT_IN_ORIG (0x5701) # define WNN_DSPORT_IN_ORIG (0x6660) # define WNN_JJPORT_OFFSET (4191) # define WNN_DMPORT_IN (0x6860) # define DMSERVERNAME "wnn6_DM" #ifdef JAPANESE /* Japanese */ # define WNN_PORT_IN WNN_PORT_IN_ORIG # define WNN_DSPORT_IN WNN_DSPORT_IN_ORIG # define UNIX_SOCKET_NAME "/tmp/jd_sockV6" /* for jserver */ # define LANG_NAME "ja_JP" # define SERVERNAME "wnn6" # define DSSERVERNAME "wnn6_DS" # define MESSAGE_FILE "jserver.msg" #else /* JAPANESE */ #ifdef CHINESE #ifdef TAIWANESE /* Traditional Chinese */ # define WNN_PORT_IN WNN_PORT_IN_ORIG + 0x30 # define WNN_DSPORT_IN WNN_DSPORT_IN_ORIG + 0x30 # define UNIX_SOCKET_NAME "/tmp/td_sockV6" /* for tserver */ # define LANG_NAME "zh_TW" # define SERVERNAME "wnn6_Tw" # define DSSERVERNAME "wnn6_TwDS" # define MESSAGE_FILE "tserver.msg" #else /* TAIWANESE */ /* Simplified Chinese */ # define WNN_PORT_IN WNN_PORT_IN_ORIG + 0x10 # define WNN_DSPORT_IN WNN_DSPORT_IN_ORIG + 0x10 # define UNIX_SOCKET_NAME "/tmp/cd_sockV6" /* for cserver */ # define LANG_NAME "zh_CN" # define SERVERNAME "wnn6_Cn" # define DSSERVERNAME "wnn6_CnDS" # define MESSAGE_FILE "cserver.msg" #endif /* TAIWANESE */ #else /* CHINESE */ #ifdef KOREAN /* Korean */ # define WNN_PORT_IN WNN_PORT_IN_ORIG + 0x20 # define WNN_DSPORT_IN WNN_DSPORT_IN_ORIG + 0x20 # define UNIX_SOCKET_NAME "/tmp/kd_sockV6" /* for kserver */ # define LANG_NAME "ko_KR" # define SERVERNAME "wnn6_Kr" # define DSSERVERNAME "wnn6_KrDS" # define MESSAGE_FILE "kserver.msg" #else /* KOREAN */ # define WNN_PORT_IN WNN_PORT_IN_ORIG # define WNN_DSPORT_IN WNN_DSPORT_IN_ORIG # define UNIX_SOCKET_NAME "/tmp/jd_sockV6" /* for jserver */ # define LANG_NAME "ja_JP" # define SERVERNAME "wnn6" # define DSSERVERNAME "wnn6_DS" # define MESSAGE_FILE "jserver.msg" #endif /* KOREAN */ #endif /* CHINESE */ #endif /* JAPANESE */ #define S_BUF_SIZ 1024 /* NEVER change this */ #define R_BUF_SIZ 1024 /* NEVER change this */ /* usually defined in */ #ifndef INADDR_NONE #define INADDR_NONE 0xffffffff #endif wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/jh.h0000644000000000000000000001701407153676737017454 0ustar rootroot/* * $Id: jh.h,v 2.2.2.1 2000/08/04 05:37:14 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ /* header file for jisho structure program. */ #ifndef _JH_H_ #define _JH_H_ /* The following defin and structure definition * are concerned with ASCII (UJIS) files. */ #define COMMENT "\\comment" #define TOTAL "\\total" #define ASC_GIJI "\\giji" #define HINSI "\\hinsi" #ifdef CHINESE #define CHINSI "\\cixing" #define PINYIN "\\Pinyin" #define ZHUYIN "\\Zhuyin" #define BIXING "\\BiXing" #endif #define DIC_NO "\\dic_no" #define REV_NORMAL 2 #define REVERSE 1 #define NORMAL 0 #ifndef JS struct je { w_char *yomi; w_char *kan; /* Historically kanji is used so use kan. */ w_char *comm; UCHAR *kanji; unsigned int hinsi; #ifdef CONVERT_with_SiSheng unsigned int ss; #endif unsigned int hindo; int serial; /* Only used for rev_dic */ }; extern struct je **jeary; #endif /* JS */ extern w_char file_comment[]; extern w_char hinsi_list[]; /* * Used in atod and others parameters. */ #define HEAP_PER_LINE 10 /* avelage of kanji + comment bytes */ #define YOMI_PER_LINE 3 /* avelage of yomi length(in w_char)*/ #define LINE_SIZE 1024 #define BADLMAX 3 #define YOMI_KINDS (1 << 16) /* Yomi characters Maximal */ #define MAX_ENTRIES 70000 /* default of max-entries for atod */ #define DEF_ENTRIES 10000 #define HEAPINC 1000 #endif /* _JH_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/jlib.h0000644000000000000000000002210407153676737017767 0ustar rootroot/* * $Id: jlib.h,v 2.6.2.1 2000/08/04 05:37:14 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 3.0 */ /* Nihongo Henkan Library Header File 08/Jul/1987 (wnn_errorno) 24/Apr/1987 09/Mar/1987 (update server_dead) 25/Feb/1987 (update wchar_t) 18/Feb/1987 (update Comment) 28/Nov/1986 23/Oct/1986 */ #ifndef _JLIB_H_ #define _JLIB_H_ #include #ifndef w_char #define w_char unsigned short #endif /* w_char */ #ifndef WCHAR_T #define wchar_t w_char #define wchar w_char #define WCHAR_T #if defined(SOLARIS) || defined(SGI) #define _WCHAR_T #endif #endif /* WCHAR_T */ #define JLIB #define S_BUF_SIZ 1024 /* NEVER change this */ #define R_BUF_SIZ 1024 /* NEVER change this */ struct kouho_entry { int s_ichi; /* ¤«¤Ê¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥ª¥Õ¥»¥Ã¥È */ int jl; /* ¼«Î©¸ì¤ÎŤµ */ int fl; /* ÉÕ°¸ì¤ÎŤµ */ int pl; /* ¥Ç¥£¥¹¥×¥ì¥¤»þ¤ÎŤµ */ int jishono; /* ¼«Î©¸ì¤Î¼­½ñÈÖ¹æ */ int serial; /* ¼«Î©¸ì¤ÎÈÖ¹æ */ w_char *k_data; /* ´Á»ú¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ */ }; #define KOUHO_ENT struct kouho_entry struct jikouho_entry { int jl; /* ¼«Î©¸ì¤ÎŤµ */ int jishono; /* ¼«Î©¸ì¤Î¼­½ñÈÖ¹æ */ int serial; /* ¼«Î©¸ì¤ÎÈÖ¹æ */ w_char *k_data; /* ´Á»ú¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ */ }; #define JIKOUHO_ENT struct jikouho_entry struct bunjoho { w_char *kana_buf; /* ¤«¤Ê¥Ð¥Ã¥Õ¥¡ */ int kana_size; /* ¤«¤Ê¥Ð¥Ã¥Õ¥¡¤ÎŤµ */ KOUHO_ENT *klist; /* ¸õÊä¥ê¥¹¥È¡¦¥Ð¥Ã¥Õ¥¡ */ int klist_size; /* ¸õÊä¥ê¥¹¥È¡¦¥Ð¥Ã¥Õ¥¡¤ÎŤµ */ w_char *kanji_buf; /* ´Á»ú¥Ð¥Ã¥Õ¥¡ */ int kanji_buf_size; /* ´Á»ú¥Ð¥Ã¥Õ¥¡ ¤ÎŤµ */ }; struct jikouhojoho{ JIKOUHO_ENT *jlist; /* ¼¡¸õÊä¥Ð¥Ã¥Õ¥¡ */ int jlist_size; /* ¼¡¸õÊä¥Ð¥Ã¥Õ¥¡¤ÎŤµ */ w_char *kanji_buf; /* ´Á»ú¥Ð¥Ã¥Õ¥¡ */ int kanji_buf_size; /* ´Á»ú¥Ð¥Ã¥Õ¥¡¤ÎŤµ */ }; #define JIKOUHOJOHO struct jikouhojoho struct jishojoho{ w_char *k_data; /* ´Á»ú¥Ð¥Ã¥Õ¥¡¤Ø¤Î¥Ý¥¤¥ó¥¿ */ int bumpo; /* ʸˡ¾ðÊó */ int hindo; /* ÉÑÅÙ */ int jisho; /* ¼­½ñÈÖ¹æ */ int serial; /* ¹àÌÜÈÖ¹æ */ }; #define JISHOJOHO struct jishojoho struct dicinfo{ int dic_no; /* ¼­½ñÈÖ¹æ */ int dic_size; /* ñ¸ì¿ô */ int ttl_hindo; /* ÉÑÅÙÁí¿ô */ int dic_type; /* 1:¥æ¡¼¥¶,2:¥·¥¹¥Æ¥à */ int udp; /* 0:»ÈÍÑÃæ¤Ç¤Ê¤¤,1:»ÈÍÑÃæ */ int prio; /* ¼­½ñ¥×¥é¥¤¥ª¥ê¥Æ¥£ */ int rdonly; /* 0:¥é¥¤¥È²Äǽ,1:¥ê¡¼¥É¥ª¥ó¥ê¡¼ */ char *file_name; /* ¼­½ñ¥Õ¥¡¥¤¥ë̾ */ char *h_file_name; /* ÉÑÅÙ¥Õ¥¡¥¤¥ë̾ */ }; #define DICINFO struct dicinfo extern jmp_buf jd_server_dead_env; /* ¥µ¡¼¥Ð¤¬»à¤ó¤À»þ¤ËÈô¤ó¤Ç¤¤¤¯env */ extern int jd_server_dead_env_flg; /* jd_server_dead_env¤¬Í­¸ú¤«Èݤ« */ extern int wnn_errorno; /* Wnn¤Î¥¨¥é¡¼¤Ï¤³¤ÎÊÑ¿ô¤ËÊó¹ð¤µ¤ì¤ë */ /* header file for dic_syurui */ #define NO_EXIST -1 #define NOT_A_JISHO 0 #define USER_DIC 1 #define SYSTEM_DIC 3 struct jwho { int sd; /* socket discripter in jserver */ char *user_name; /* user name */ char *host_name; /* host name */ }; #define JWHO struct jwho #endif /* _JLIB_H_ */ /* Local Variables: kanji-flag: t End: */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/wnnerror.h0000644000000000000000000003137707153676737020737 0ustar rootroot/* * $Id: wnnerror.h,v 2.13.2.1 2000/08/04 05:37:17 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ #ifndef _WNNERROR_H_ #define _WNNERROR_H_ /* file ´Ø·¸¤Î¥¨¥é¡¼ */ #define WNN_FILE_READ_ERROR 90 /* ¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ */ #define WNN_FILE_WRITE_ERROR 91 /* ¥Õ¥¡¥¤¥ë¤ò½ñ¤­½Ð¤¹¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ */ #define WNN_FID_ERROR 92 /* ¥¯¥é¥¤¥¢¥ó¥È¤ÎÆÉ¤ß¹þ¤ó¤À¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ */ #define WNN_NO_MORE_FILE 93 /* ¤³¤ì°Ê¾å¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£*/ #define WNN_INCORRECT_PASSWD 94 /* ¥Ñ¥¹¥ï¡¼¥É¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹¡£ */ #define WNN_FILE_IN_USE 95 /* ¥Õ¥¡¥¤¥ë¤¬ÆÉ¤ß¹þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£ */ #define WNN_UNLINK 96 /* ¥Õ¥¡¥¤¥ë¤¬ºï½ü¤Ç¤­¤Þ¤»¤ó¡£ */ #define WNN_FILE_CREATE_ERROR 97 /* ¥Õ¥¡¥¤¥ë¤¬ºîÀ®½ÐÍè¤Þ¤»¤ó¡£*/ #define WNN_NOT_A_FILE 98 /*£×£î£î¤Î¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¤Þ¤»¤ó¡£*/ #define WNN_INODE_CHECK_ERROR 99 /* ¥Õ¥¡¥¤¥ë¤ÎI-node¤ÈFILE_UNIQ¤ò°ìÃפµ¤»¤ë»ö¤¬¤Ç¤­¤Þ¤»¤ó¡£ */ /* V3 */ /* ¼­½ñÄɲôط¸¤Î¥¨¥é¡¼ */ #define WNN_NO_EXIST 1 /*¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£*/ #define WNN_MALLOC_ERR 3 /* ¥á¥â¥ê¤ò³ÎÊݤǤ­¤Þ¤»¤ó¡£ */ #define WNN_NOT_A_DICT 5 /*¼­½ñ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£*/ #define WNN_NOT_A_HINDO_FILE 6 /*ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£*/ #define WNN_NOT_A_FUZOKUGO_FILE 7 /*ÉÕ°¸ì¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£*/ #define WNN_JISHOTABLE_FULL 9 /*¼­½ñ¥Æ¡¼¥Ö¥ë¤¬°ìÇդǤ¹¡£*/ #define WNN_HINDO_NO_MATCH 10 /*ÉÑÅÙ¥Õ¥¡¥¤¥ë¤¬¡¢»ØÄꤵ¤ì¤¿¼­½ñ¤Î ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£*/ #define WNN_OPENF_ERR 16 /*¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤Ç¤­¤Þ¤»¤ó¡£*/ #define WNN_NOT_HINDO_FILE 17 /*Àµ¤·¤¤ÉÑÅÙ¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¤Þ¤»¤ó¡£*/ #define WNN_NOT_FZK_FILE 18 /*Àµ¤·¤¤ÉÕ°¸ì¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¤Þ¤»¤ó¡£*/ #define WNN_FZK_TOO_DEF 19 /*ÉÕ°¸ì¤Î¸Ä¿ô¡¢¥Ù¥¯¥¿Ä¹¤µ¤Ê¤É¤¬ ¿²á¤®¤Þ¤¹*/ /* ¼­½ñºï½ü´Ø·¸¤Î¥¨¥é¡¼ */ #define WNN_DICT_NOT_USED 20 /*¤½¤ÎÈÖ¹æ¤Î¼­½ñ¤Ï¡¢»È¤ï¤ì¤Æ¤¤¤Þ¤»¤ó¡£*/ /* ÊÑ´¹»þ¤Î¥¨¥é¡¼ */ #define WNN_BAD_FZK_FILE 24 /*ÉÕ°¸ì¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó*/ #define WNN_GIJI_HINSI_ERR 25 /*µ¿»÷ÉÊ»ìÈֹ椬°Û¾ï¤Ç¤¹ hinsi.data¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó*/ #define WNN_NO_DFE_HINSI 26 /*̤ÄêµÁ¤ÎÉʻ줬Á°Ã¼ÉÊ»ì¤È¤·¤Æ ÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹ Not Used*/ #define WNN_FZK_FILE_NO_LOAD 27 /*ÉÕ°¸ì¥Õ¥¡¥¤¥ë¤¬ÆÉ¤ß¹þ¤Þ¤ì¤Æ¤¤¤Þ¤»¤ó*/ /* jishobiki.c */ #define WNN_DIC_ENTRY_FULL 30 /*¼­½ñ¤Î¥¨¥¤¥ó¥È¥ê¤¬Â¿²á¤®¤Þ¤¹¡£*/ #define WNN_LONG_MOJIRETSU 31 /*ÊÑ´¹¤·¤è¤¦¤È¤¹¤ëʸ»úÎó¤¬Ä¹²á¤®¤Þ¤¹¡£*/ #define WNN_WKAREA_FULL 32 /*ÉÕ°¸ì²òÀÏÎΰ褬ÉÔ­¤·¤Æ¤¤¤Þ¤¹¡£*/ #define WNN_JKTAREA_FULL 34 /* ¸õÊ䤬¿²á¤®¤Æ¼¡¸õÊ䤬¼è¤ê½Ð¤»¤Þ¤»¤ó¡£ */ #define WNN_NO_KOUHO 35 /*¸õÊ䤬 1 ¤Ä¤âºî¤ì¤Þ¤»¤ó¤Ç¤·¤¿*/ /* ñ¸ìÅÐÏ¿»þ¤Î¥¨¥é¡¼ */ #define WNN_YOMI_LONG 40 /*ÆÉ¤ß¤¬Ä¹²á¤®¤Þ¤¹¡£*/ #define WNN_KANJI_LONG 41 /*´Á»ú¤¬Ä¹²á¤®¤Þ¤¹¡£*/ #define WNN_NOT_A_UD 42 /*»ØÄꤵ¤ì¤¿¼­½ñ¤Ï¡¢ÅÐÏ¿²Äǽ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£*/ #define WNN_NO_YOMI 43 /*ÆÉ¤ß¤ÎŤµ¤¬0¤Ç¤¹¡£*/ #define WNN_NOT_A_REV 44 /*»ØÄꤵ¤ì¤¿¼­½ñ¤Ï¡¢µÕ°ú¤­²Äǽ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£*/ #define WNN_RDONLY 45 /*¥ê¡¼¥É¥ª¥ó¥ê¡¼¤Î¼­½ñ¤ËÅÐÏ¿¤·¤è¤¦¤È¤·¤Þ¤·¤¿¡£*/ #define WNN_DICT_NOT_IN_ENV 46 /*´Ä¶­¤Ë¸ºß¤·¤Ê¤¤¼­½ñ¤ËÅÐÏ¿¤·¤è¤¦¤È¤·¤Þ¤·¤¿¡£*/ /* ÉÑÅÙ¹¹¿·¤Î¥¨¥é¡¼ */ #define WNN_RDONLY_HINDO 49 /* ¥ê¡¼¥É¥ª¥ó¥ê¡¼¤ÎÉÑÅÙ¤òÊѹ¹¤·¤è¤¦¤È¤·¤Þ¤·¤¿¡£ */ /* ñ¸ìºï½ü»þ¡¢ÉÊ»ìºï½ü»þ¤Î¥¨¥é¡¼ */ /* WNN_RDONLY */ #define WNN_WORD_NO_EXIST 50 /*»ØÄꤵ¤ì¤¿Ã±¸ì¤¬Â¸ºß¤·¤Þ¤»¤ó¡£*/ /* ½é´ü²½¤Î»þ¤Î¥¨¥é¡¼ */ #define WNN_MALLOC_INITIALIZE 60 /* ¥á¥â¥ê¤ò³ÎÊݤǤ­¤Þ¤»¤ó¡£ */ /* * Errors are supported from 4.004 */ #define WNN_ACCESS_DENIED 61 #define WNN_NOT_SUPPORT_PACKET 62 #define WNN_NOT_SUPPORT_EXTENSION 63 #define WNN_ACCESS_NO_HOST 64 #define WNN_ACCESS_NO_USER 65 #define WNN_NO_JSERVER 66 #define WNN_SOME_ERROR 68 /* ²¿¤«¤Î¥¨¥é¡¼¤¬µ¯¤³¤ê¤Þ¤·¤¿¡£*/ #define WNN_SONOTA 69 /*¥Ð¥°¤¬È¯À¸¤·¤Æ¤¤¤ëÌÏÍͤǤ¹¡£Not Used*/ #define WNN_JSERVER_DEAD 70 /*¥µ¡¼¥Ð¤¬Æ°ºî¤·¤Æ¤¤¤Þ¤»¤ó¡£(jlib)*/ #define WNN_ALLOC_FAIL 71 /*¥á¥â¥ê¤ò³ÎÊݤǤ­¤Þ¤»¤ó(jlib)*/ #define WNN_SOCK_OPEN_FAIL 72 /*jd_begin¤Çsocket¤Îopen¤Ë¼ºÇÔ(jlib)*/ #define WNN_BAD_VERSION 73 /*ÄÌ¿®¥×¥í¥È¥³¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤¬¹ç¤Ã¤Æ¤¤¤Þ¤»¤ó¡£*/ #define WNN_BAD_ENV 74 /*¥¯¥é¥¤¥¢¥ó¥È¤ÎÀ¸À®¤·¤¿´Ä¶­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£*/ #define WNN_MKDIR_FAIL 80 /* ¥Ç¥£¥ì¥¯¥È¥ê¤òºî¤ê»¤Ê¤Ã¤¿ */ /*ÉÊ»ì¥Õ¥¡¥¤¥ë */ #define WNN_TOO_BIG_HINSI_FILE 100 /*ÉÊ»ì¥Õ¥¡¥¤¥ë¤¬Â礭²á¤®¤Þ¤¹¡£*/ #define WNN_TOO_LONG_HINSI_FILE_LINE 101 /*ÉÊ»ì¥Õ¥¡¥¤¥ë¤¬Â礭²á¤®¤Þ¤¹¡£*/ #define WNN_NO_HINSI_DATA_FILE 102 /*ÉÊ»ì¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ */ #define WNN_BAD_HINSI_FILE 103 /*ÉÊ»ì¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹¡£*/ #define WNN_HINSI_NOT_LOADED 105 /* ÉÊ»ì¥Õ¥¡¥¤¥ë¤¬ÆÉ¤ß¹þ¤Þ¤ì¤Æ¤¤¤Þ¤»¤ó¡£*/ #define WNN_BAD_HINSI_NAME 106 /* ÉÊ»ì̾¤¬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹ */ #define WNN_BAD_HINSI_NO 107 /* ÉÊ»ìÈֹ椬´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹ */ #define NOT_SUPPORTED_OPERATION 109 /*¤½¤ÎÁàºî¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤óNot Used*/ /* * * jl ¡Ê¹â¿å½à¥é¥¤¥Ö¥é¥ê¡Ë¤Î¥¨¥é¡¼ * */ #define WNN_CANT_OPEN_PASSWD_FILE 110 /* ¥Ñ¥¹¥ï¡¼¥É¤ÎÆþ¤Ã¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬ ¥ª¡¼¥×¥ó¤Ç¤­¤Þ¤»¤ó(jl) */ /* ½é´ü²½»þ¤Î¥¨¥é¡¼ */ #define WNN_RC_FILE_NO_EXIST 111 /* uumrc¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó(jl) Not Used*/ #define WNN_RC_FILE_BAD_FORMAT 112 /* uumrc¥Õ¥¡¥¤¥ë¤Î·Á¼°¤¬¸í¤Ã¤Æ¤¤¤Þ¤¹(jl)Not Used */ #define WNN_NO_MORE_ENVS 113 /* ¤³¤ì°Ê¾å´Ä¶­¤òºî¤ë¤³¤È¤Ï½ÐÍè¤Þ¤»¤ó¡£*/ #define WNN_FILE_NOT_READ_FROM_CLIENT 114 /* ¤³¤Î¥¯¥é¥¤¥¢¥ó¥È¤¬ÆÉ¤ß¹þ¤ó¤À¥Õ¥¡¥¤¥ë¤Ç¤¢¤ê¤Þ¤»¤ó¡£*/ #define WNN_NO_HINDO_FILE 115 /* ¼­½ñ¤ËÉÑÅÙ¥Õ¥¡¥¤¥ë¤¬¤Ä¤¤¤Æ¤¤¤Þ¤»¤ó¡£*/ #define WNN_CANT_CREATE_PASSWD_FILE 116 /*¥Ñ¥¹¥ï¡¼¥É¤Î¥Õ¥¡¥¤¥ë¤¬ºîÀ®½ÐÍè¤Þ¤»¤ó¡£*/ /* * Errors are supported from 4.F00 */ #define WNN_TEMPORARY_ALREADY_ADD 500 /* The temporary dic is already added */ #define WNN_TEMPORARY_ADD_FAILED 501 /* Addition of temporary dic failed */ #define WNN_TEMPORARY_DELETE_FAILED 502 /* Deletion of temporary dic failed */ /* * WNNDS */ /* Errors about connection */ #define WNN_DS_DEAD 1001 /* WNNDS is died */ #define WNN_DS_BAD_VERSION 1002 /* dserver denied access */ #define WNN_DS_ACCESS_DENIED 1003 /* dserver denied access */ /* * WNNDM */ #define WNN_DM_DEAD 2001 /* WNNDM is died */ #define WNN_DM_BAD_VERSION 2002 /* * Hideyuki Kishiba (Jul. 8, 1994) * New error number for FI-Wnn */ /* ¼­½ñÄɲôط¸¤Î¥¨¥é¡¼ */ #define WNN_NOT_A_FI_DICT 3001 /* £Æ£É´Ø·¸¼­½ñ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó */ #define WNN_NOT_A_FI_HINDO 3002 /* £Æ£É´Ø·¸¼­½ñ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó */ #define WNN_NOT_A_FI_SYSTEM 3003 /* »ØÄꤵ¤ì¤¿¼­½ñ¤Ï¡¢£Æ£É´Ø·¸¥·¥¹¥Æ¥à¼­½ñ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó */ #define WNN_NOT_A_FI_USER 3004 /* »ØÄꤵ¤ì¤¿¼­½ñ¤Ï¡¢£Æ£É´Ø·¸¥æ¡¼¥¶¼­½ñ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó */ #define WNN_USE_OLD_FZK 3005 /* ¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤ÎÉÕ°¸ì¥Õ¥¡¥¤¥ë¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Þ¤¹ */ #define NOT_SHARE_HINDO_FILE 3006 /* £±¤Ä¤ÎÉÑÅÙ¥Õ¥¡¥¤¥ë¤ò°Û¤Ê¤ë¼­½ñ´Ö¤Ç¶¦ÍѤ·¤è¤¦¤È¤·¤Þ¤·¤¿ */ /* offline ³Ø½¬»þ¤Î¥¨¥é¡¼ */ #define WNN_LOCKED 3010 /* ¥µ¡¼¥Ð¡¼¤¬¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Þ¤¹ */ /* license server */ #define WNN_NOT_LICENSE 3011 /* ¥é¥¤¥»¥ó¥¹¤¬¼èÆÀ¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿ */ #endif /* _WNNERROR_H_ */ /* Local Variables: kanji-flag: t End: */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/rk_spclval.h0000644000000000000000000002737307153676737021224 0ustar rootroot/* * $Id: rk_spclval.h,v 2.3.2.1 2000/08/04 05:37:16 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /*********************************************************************** rk_spclval.h 87.12. 3 ²þ Àµ ËÜÊÑ´¹¤Ç»È¤Ã¤Æ¤¤¤ëÆÃ¼ì¤ÊÃͤÎÄêµÁ¡Ê³°Éô¤Ë¤â½Ð¤¹¡Ë¡£¥Þ¥¯¥í ´Ø¿ô¤â¡¢ctype.h¤ò»È¤¦¤â¤Î°Ê³°¤Ï¤³¤Á¤é¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£ rk_macros.h ¤Ëinclude¤µ¤ì¤Æ¤¤¤ë¡£ ***********************************************************************/ /* Version 3.0 */ #ifndef _RK_SPCLVAL_H_ #define _RK_SPCLVAL_H_ #ifndef EOLTTR typedef unsigned int letter; /* ʸ»ú¤Ï°ìÈ̤ˤ³¤Î·¿¤Çɽ¤¹ */ typedef unsigned char uns_chr; #define LTRHUG (~(0xff000000)) /* ÆâÉôɽ¸½ µÚ¤Óµ¶Ê¸»ú¤ò½ü¤¯¡¢letter¤Î¼è¤êÆÀ¤ëºÇÂçÃÍ */ /* °Ê²¼¤ËÄêµÁ¤¹¤ëÃͤϡ¢ºÇ¾å°Ì¥Ð¥¤¥È¤¬255¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ ¤³¤ì¤é¤Î¤¦¤Á¡¢³°¤Ë½Ð¤ë¤Î¤Ï EOLTTR¡¢CHMSIG¡¢NISEBP¡¢LTREOF¤È REDRAW¡Êµ¶¥Ç¥ê¡¼¥È¤È¤·¤ÆNISEDL¤ò»È¤¦¾ì¹ç¤ÏNISEDL¤â¡Ë¡£*/ #define EOLTTR ((letter)-1) /* ʸ»úÎó¤Î½ªÃ¼¤òɽ¤¹¥³¡¼¥É */ /* ¥­¡¼ÆþÎϤ¬¤¢¤Ã¤¿¤éɬ¤º²¿¤«¥³¡¼¥É¤òÊÖ¤¹¾õÂ֤ˤ·¤Æ ¤ª¤¯¤È¡¢ÆÃ¤ËÊÖ¤¹¤Ù¤­¤â¤Î¤¬¤Ê¤¤»þ¤Ï¤³¤ì¤òÊÖ¤¹¡£*/ #define ERRCOD ((letter)-2) /* (error)¤òɽ¤¹ÆâÉô¥³¡¼¥É */ #define CHMSIG ((letter)-3) /* ¥â¡¼¥É¥Á¥§¥ó¥¸¤òɽ¤¹¥³¡¼¥É */ #define NISEBP ((letter)-4) /* ¥¨¥é¡¼·Ù¹ðÍѤε¶BEL¥³¡¼¥É */ #define VARRNG ((letter)-5) /* ÊѰ褬Æó¤Ä¤Îʸ»ú¤Î´Ö¤Ç¤¢¤ë¤Î¤ò¼¨¤¹ÆâÉô¥³¡¼¥É*/ #define UNUSDC ((letter)-6) /* ¥Þ¥Ã¥Á¤ò¼ºÇÔ¤µ¤»¤ë¤¿¤á¤ÎÆâÉô¥³¡¼¥É */ #define REASIG ((letter)-7) /* ɽ¤ÎºÆÀßÄê¤òÍ׵᤹¤ë¤¿¤á¤ÎÆâÉô¥³¡¼¥É */ #define URBFCL ((letter)-8) /* ΢¥Ð¥Ã¥Õ¥¡¤ÎÌÀ¼¨Åª¥¯¥ê¥¢¤òÍ׵᤹¤ëÆâÉô¥³¡¼¥É*/ #define LTREOF ((letter)-9) /* romkan_next()¡¢Æ±getc()¤¬EOF¤ÎÂå¤ï¤ê¤ËÊÖ¤¹¤â¤Î ¡Ê¤Ç¤­¤ì¤ÐEOF¤ÈƱ¤¸¤Ë¤·¤¿¤¤¤¬¡Ä¡Ë*/ #define REDRAW ((letter)-10)/* Wnn¤ËÊÑ´¹¹Ô¤Îredraw¤òÍ׵᤹¤ëÆÃ¼ì¥³¡¼¥É */ #define NISEDL ((letter)-11)/* µ¶¥Ç¥ê¡¼¥È¤È¤·¤ÆÄê¿ô¤ò»È¤¤¤¿¤¤¿Í¤Î¤¿¤á¤Ë½àÈ÷ ¤µ¤ì¤¿Äê¿ô¡Ê⤷¡¢»È¤¤¤¿¤¯¤Ê¤±¤ì¤Ð»È¤ï¤Ê¤¯¤Æ¤â ¤¤¤¤¡Ë¡£ÊÑ¿ônisedl¤Ë¥»¥Ã¥È¤·¤Æ»È¤¦ */ /* romkan_init3()¤Î°ú¿ô¤Î¥Õ¥é¥°¤Ë»È¤¦ÃÍ */ #define RK_CHMOUT 01 /* ¥â¡¼¥É¥Á¥§¥ó¥¸¤òÃΤ餻¤ë¥³¡¼¥É¤òÊÖ¤¹¤«¡© */ #define RK_KEYACK 02 /* ¥­¡¼¥¤¥ó¤ËÂФ·É¬¤º²¿¤«¤òÊÖ¤¹¤« */ #define RK_DSPNIL 04 /* ¥â¡¼¥Éɽ¼¨Ê¸»úÎó̵»ØÄê¤Î»þ¤Ë¶õʸ»úÎó¤òÊÖ¤¹¤«¡Ê¥Ç¥Õ ¥©¥ë¥È¤ÏNULL¡Ë¡£¸ß´¹À­ÊÝ»ý¤Î¤¿¤á */ #define RK_NONISE 010 /* µ¶¥³¡¼¥É¤ò½Ð¤µ¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤« */ #define RK_REDRAW 020 /* WnnÍÑÆÃ¼ì¥Õ¥é¥°¡ÊredrawÍѤΥե饰¤ò½Ð¤¹¤«¤É¤¦¤«¡Ë*/ #define RK_SIMPLD 040 /* delete¤Îưºî¤òñ½ã¤Ë¤¹¤ë¤« */ #define RK_VERBOS 0100 /* »ÈÍѤ¹¤ëɽ¤Î°ìÍ÷¤ò¥ê¥Ý¡¼¥È¤¹¤ë¤« */ /* ¥³¡¼¥É¤Î¶èÊ̤˻Ȥ¦¥Þ¥¯¥í */ #define HG1BIT (0x80000000) /* ºÇ¾å°Ì¥Ó¥Ã¥È¤À¤è */ #define SHUBET(X) ((letter)(X) >> (int)24) /* ÆâÉôɽ¸½¤Ç¡¢¾å£±¥Ð¥¤¥È¤ò¼ïÊÌɽ¸½¤Ë»È¤Ã¤Æ¤ë */ #define LWRMSK(X) ((X) & ~(0xff000000)) /* ¾å£±¥Ð¥¤¥È¤ò¼è¤ê½ü¤¯ */ #define LWRCUT(X) ((X) &= ~(0xff000000)) /* ¾å£±¥Ð¥¤¥È¤ò¼è¤ê½ü¤¯ */ #define is_HON(X) (SHUBET(X) == 0) /* ËÜʪ¤Îʸ»ú¤« */ #define NAIBEX(X) (0 < SHUBET(X) && SHUBET(X) < 0x80) /* ÆâÉôɽ¸½¤ò¼¨¤¹Ãͤ« */ #define isNISE(X) (SHUBET(X) == 0x80) /* µ¶Êª¤Îʸ»ú¤«¡ÊºÇ¾å°Ì¥Ó¥Ã¥È¤¬Î©¤Ä¡Ë */ #define isSPCL(X) (SHUBET(X) == 0xff) /* rk_spclval.h¤ÇÄêµÁ¤µ¤ì¤ëÃͤ«¤É¤¦¤«*/ /* NISEDL¤Ê¤É¤ò´Þ¤á¤¿µ¶¤Îʸ»ú¤Ç¤¢¤ë¤«¤É¤¦¤«¤òȽÄꤹ¤ë¤Ë¤Ï¡¢~is_HON(X) ¤«¡¢ isNISE(X) || isSPCL(X) ¤È¤·¤ÆÈ½Äꤷ¤Ê¤¤¤È¤¤¤±¤Ê¤¤¡£*/ #define toNISE(X) ((X) | HG1BIT) #define to_HON(X) ((X) & ~HG1BIT) /* ¸ß´¹À­¤Î¤¿¤áÍѰդ·¤Æ¤¢¤ëÊÌ̾ */ #define REALCD(X) is_HON(X) #define NISECD(X) isNISE(X) #define SPCLCD(X) isSPCL(X) /** Ⱦ³Ñʸ»ú¤Î¥³¡¼¥É¤Îdefine */ #ifndef HNKAK1 # ifdef IKIS # define HNKAK1 0xA8 # else # define HNKAK1 0x8E # endif #endif /** rk_bltinfn.c ¤ÎÊä´°¤Î¤¿¤á¤Î¥Þ¥¯¥í ¡Ê°ú¿ô¤òÊ£¿ô²óɾ²Á¤¹¤ë¤â¤Î¤â¿¤¤¤Î¤ÇÃí°Õ¡Ë*/ #define HKKBGN (HNKAK1 * 0x100 + 0xA1) /* Ⱦ³Ñ¥«¥Ê¤Î¶çÅÀ */ #define HKKEND (HNKAK1 * 0x100 + 0xDF) /* ¡· ȾÂùÅÀ */ #define HIRBGN (0xA4A1) /* ¤¡ */ #define HIREND (0xA4F3) /* ¤ó */ /* ¤Ò¤é¤¬¤Ê¡§"¤¡"¡Á"¤ó" */ #define KATBGN (0xA5A1) /* ¥¡ */ #define KATEND (0xA5F6) /* ¥ö */ /* ¥«¥¿¥«¥Ê¡§"¥¡"¡Á"¥ó"¡Á"¥ö" */ #define _to_kata(l) ((l) + (KATBGN - HIRBGN)) /** ¥«¥¿¥«¥Ê¤Ø¡ÊÄêµÁ°èÀ©¸Â¡Ë*/ #define _to_hira(l) ((l) - (KATBGN - HIRBGN)) /** ¤Ò¤é¤¬¤Ê¤Ø¡ÊÄêµÁ°èÀ©¸Â¡Ë*/ #define is_hira(l) (HIRBGN <= (l) && (l) <= HIREND) /** ¤Ò¤é¤¬¤Ê¤«¡© */ #define is_kata(l) (KATBGN <= (l) && (l) <= KATEND) /** ¥«¥¿¥«¥Ê¤«¡© */ #define is_kata2(l) (_to_kata(HIRBGN) <= (l) && (l) <= _to_kata(HIREND)) /** Âбþ¤¹¤ë¤Ò¤é¤¬¤Ê¤Î¤¢¤ë¥«¥¿¥«¥Ê¤«¡© */ #define to_kata(l) (is_hira(l) ? _to_kata(l) : (l)) /** ¥«¥¿¥«¥Ê¤Ø */ #define to_hira(l) (is_kata2(l) ? _to_hira(l) : (l)) /** ¤Ò¤é¤¬¤Ê¤Ø¡£¡Ö¥ô¥õ¥ö¡×¤Ï¥«¥¿¥«¥Ê¤Î¤Þ¤Þ»Ä¤ë¡£*/ #define is_hankata(l) (HKKBGN <= (l) && (l) <= HKKEND) /** Ⱦ³Ñ¥«¥Ê¡Ê¶çÅÀ¤Ê¤É¤ò´Þ¤à¡Ë¤«¡© */ /* ¤½¤Î¾¤Î¥Þ¥¯¥í´Ø¿ô·²¡Ê°ú¿ô¤òÊ£¿ô²óɾ²Á¤¹¤ë¤â¤Î¤â¿¤¤¤Î¤ÇÃí°Õ¡Ë*/ #define numberof(array) (sizeof(array) / sizeof(*array)) /* ¥Ý¥¤¥ó¥¿¤òletter¤ÎÎó¤ÎËöÈø¤Ø¤â¤Ã¤Æ¤¤¤¯¡£letter *lp */ #define totail(lp) {while(*(lp) != EOLTTR) (lp)++;} /* ʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò¤½¤Îʸ»úÎó¤ÎºÇ¸åÈø¤Ø¡£totail¤ÎcharÈÇ¡£char *sp */ #define strtail(sp) {while(*(sp)) (sp)++;} /* ¸ÂÄêÈÇromkan_init3 */ #define romkan_init4(pathname, delchr, nisedl, keyin, bytecount, flg) \ romkan_init3(pathname, delchr, nisedl, EOLTTR, \ keyin, bytecount, bytecount, 0, flg) #define romkan_init5(pathname, delchr, keyin, bytecount, flg) \ romkan_init4(pathname, delchr, toNISE(delchr), keyin, bytecount, flg) /* romkan_init3 for Multi-threaded */ #define romkan_init4_mt(pathname, delchr, nisedl, keyin, bytecount, flg) \ romkan_init3_mt(pathname, delchr, nisedl, EOLTTR, \ keyin, bytecount, bytecount, 0, flg) #define romkan_init5_mt(pathname, delchr, keyin, bytecount, flg) \ romkan_init4_mt(pathname, delchr, toNISE(delchr), keyin, bytecount, flg) #endif /* of ifndef EOLTTR */ #endif /* _RK_SPCLVAL_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/dslib.h0000644000000000000000000002342707153676737020155 0ustar rootroot/* * $Id: dslib.h,v 2.15.2.1 2000/08/04 05:37:12 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ /* Modified Feb.14,1993 tna@kyoto-sr.co.jp Feb.15,1993 tna@kyoto-sr.co.jp */ /* Nihongo Henkan Library Header File */ #ifndef _DSLIB_H_ #define _DSLIB_H_ #ifndef _WNN_SETJMP #define _WNN_SETJMP #include #endif #ifndef w_char #define w_char unsigned short #endif /* w_char */ #include "jslib.h" /* Wnn constant */ #define WNN_IPADDRLEN 40 #define DS_S_BUF_SIZ 9216 /* NEVER change this */ #define DS_R_BUF_SIZ 9216 /* NEVER change this */ #define DM_S_BUF_SIZ 256 #define DM_R_BUF_SIZ 256 #define JJ_MAX 3 #define JS_FILES_ALLOC_SIZE 64 #define DS_FILES_ALLOC_SIZE 128 struct serv_addr { char addr[WNN_IPADDRLEN]; int addrlen; int addrtype; int portno; int jserver; }; typedef struct serv_addr SERV_ADDR; struct wnn_dserver_id { int sd; SERV_ADDR ad; int ds_dead; jmp_buf ds_dead_env; /* ¥µ¡¼¥Ð¤¬»à¤ó¤À»þ¤ËÈô¤ó¤Ç¤¤¤¯env */ int ds_dead_env_flg; /* dd_server_dead_env¤¬Í­¸ú¤«Èݤ« */ int rbc; int rbp; unsigned char rcv_buf[DS_R_BUF_SIZ]; }; typedef struct wnn_dserver_id WNN_DSERVER_ID; #define MAX_WNNDS_NUM 64 #define MAX_SERVER_LIST 4 #define WNNDEFS "/wnndefs" #define WNNDEFS_DATA 512 struct wnn_dic_file_info { int file_type; char passwd[ WNN_PASSWD_LEN ]; char hpasswd[ WNN_PASSWD_LEN ]; struct wnn_file_uniq funiq; int maxserial; int gosuu; int maxcomment; w_char comment[WNN_COMMENT_LEN]; }; typedef struct wnn_dic_file_info WNN_DIC_FILE_INFO; struct wnn_hindo_info_struct { int file_type; char passwd[ WNN_PASSWD_LEN ]; struct wnn_file_uniq funiq; }; typedef struct wnn_hindo_info_struct WNN_HINDO_INFO_STRUCT; struct ds_jdata { /* struct jdata is modified for dslib */ w_char *yomi,*kanji,*comment; short which ; /* gyaku henkan? */ int serial; /* index is a serial number of the first entry which is stored in this entry*/ int kosuu; /* this means the number of elements in this entry */ struct ds_jdata *jptr; /* pointer to another jdata which points out a jdata of the same yomi but (always)different jishono*/ unsigned short *hinsi; unsigned char *hindo; /* ÉÑÅÙ */ unsigned char *hindo_in; /* ÆâÉôÉÑÅÙ */ }; struct ds_inspect_struct { w_char *yomi; /* struct ds_jdata *jd; D.K 5/4 */ struct jdata *jd; }; struct ds_word_search_struct { int match_len; /* maxmum matching length */ int total; /* total words : don't need? */ /* struct ds_jdata **jd; D.K 5/4 */ struct jdata **jd; }; struct alloc_data { unsigned char *data; int alloc_max; struct alloc_data *next; }; #define ALLOC_DATA_SIZE 1024 /* * Macros added by D.K * */ #define DS_FILE_UNLOAD -2 #define DS_FILE_LOADED_JSERVER -1 #define DS_FILE_LOADED_DEFAULT 0 #define GET_WNN_DSERVER_ID(ds_id) \ (&dserver_id_table[(ds_id)]) #define GET_WNN_DSERVER_ID_FID(fid) \ (&dserver_id_table[files[(fid)].ds_id]) #define LOADED_ON_JSERVER_P(fid) \ (files[(fid)].ds_id == DS_FILE_LOADED_JSERVER) #define handler_of_dserver_dead(err_val) \ { \ if (current_ds) { \ if(current_ds->ds_dead || setjmp(current_dserver_dead)) { \ wnn_errorno=WNN_DS_DEAD; \ return err_val; \ } \ wnn_errorno = 0; /* here initialize wnn_errorno; */ \ } \ } #endif /* _DSLIB_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/serverdefs.h0000644000000000000000000001524507153676737021227 0ustar rootroot/* * $Id: serverdefs.h,v 2.2.2.1 2000/08/04 05:37:16 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ #ifndef _SERVERDEFS_H_ #define _SERVERDEFS_H_ #ifndef SERVERDEFS_FILE # define SERVERDEFS_FILE "/serverdefs" #endif /* SERVERDEFS_FILE */ extern char *wnn_get_machine_of_serverdefs(); extern char *wnn_get_unixdomain_of_serverdefs(); extern char *wnn_get_service_of_serverdefs(); extern int wnn_get_port_num_of_serverdefs(); extern char *wnn_get_serverenv_of_serverdefs(); #endif /* _SERVERDEFS_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/fi_jdata.h0000644000000000000000000002352107153676737020614 0ustar rootroot/* * $Id: fi_jdata.h,v 2.8.2.1 2000/08/04 05:37:13 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ #ifndef _FI_JDATA_H_ #define _FI_JDATA_H_ /* * fi_jdata.h * * Description: * FI dictionary and FI hindo format */ /* FI index table size */ #define MAX_FI_INDEX_TABLE 256 /* * FI dictionary data format */ struct fi_dic_data { unsigned int dic_entry; /* jishono and entry */ unsigned char jirilen; /* ¼«Î©¸ìĹ */ unsigned char ppp_id; /* ½õ»ì£É£Ä */ unsigned char hindo; /* Àܳ´Ø·¸ÉÑÅÙ */ unsigned char bitdata; /* ¥Ó¥Ã¥È¥Ç¡¼¥¿Éô */ }; /* * FI hindo data format */ struct fi_hindo_data { unsigned char hindo; /* Àܳ´Ø·¸ÉÑÅÙ */ unsigned char bitdata; /* ¥Ó¥Ã¥È¥Ç¡¼¥¿Éô */ }; /* * secondary index table for FI dictionary */ struct fi_second { unsigned char *entry; /* ¥¨¥ó¥È¥êÈÖ¹æ */ union fi_data { struct fi_dic_data **dic; /* FI dictionary data ¥Ý¥¤¥ó¥¿ÇÛÎó */ struct fi_hindo_data **hindo; /*FI hindo data ¥Ý¥¤¥ó¥¿ÇÛÎó */ } fi_data; }; /* * primary index table for FI dictionary */ struct fi_primary { int primary; /* primary table entry ¿ô */ unsigned char *secondary; /* secondary table entry ¿ô¤ÎÇÛÎó */ struct fi_second **stable; /* secondary table ¤Ø¤Î¥Ý¥¤¥ó¥¿ */ }; /* * FI dictionary memory format */ struct FI_JT { char hpasswd[WNN_PASSWD_LEN]; /* ÉÑÅÙÉôʬ¤Î¥Ñ¥¹¥ï¡¼¥É */ int syurui; /* £Æ£É´Ø·¸¼­½ñ¥¿¥¤¥× (system or user) */ int maxcomment; /* ¥³¥á¥ó¥Èʸ»ú¿ô */ w_char *comment; /* ¥³¥á¥ó¥Èʸ»úÎó */ short dirty; /* ¼­½ñ¥Ç¡¼¥¿Êѹ¹¥Õ¥é¥° */ unsigned char maxjisho; /* ÀܳÄêµÁ£×£î£î¼­½ñ¿ô */ struct wnn_file_uniq *jisho_uniq; /* ÀܳÄêµÁ£×£î£î¼­½ñ f_uniq_org ÇÛÎó */ struct fi_primary **ptable; /* ³Æ primary index table ¤Ø¤Î¥Ý¥¤¥ó¥¿ */ }; /* * FI hindo memory format */ struct FI_HJT { struct wnn_file_uniq fi_dic_uniq; /* Âбþ£Æ£É´Ø·¸¼­½ñ f_uniq_org */ int maxcomment; /* ¥³¥á¥ó¥Èʸ»ú¿ô */ w_char *comment; /* ¥³¥á¥ó¥Èʸ»úÎó */ unsigned char maxjisho; /* ÀܳÄêµÁ£×£î£î¼­½ñ¿ô */ short hdirty; /* ÉÑÅ٥ǡ¼¥¿Êѹ¹¥Õ¥é¥° */ struct fi_primary **ptable; /* ³Æ primary index table ¤Ø¤Î¥Ý¥¤¥ó¥¿ */ }; typedef struct { struct fi_primary *dic_1i; /* fi dic primary index table pointer */ struct fi_second *dic_2i; /* fi dic secondary index table pointer */ struct fi_primary *hin_1i; /* fi hindo primary index table pointer */ struct fi_second *hin_2i; /* fi hindo secondary index table pointer */ int bb; /* binary search breaked point */ } FI_DICD_FOR_GROW_UP; /* * FI set priority structure */ typedef struct { int fi_dicid; /* FI internal relation dic ID */ int entry; /* FI entry for B */ int offset; /* FI relation data offset */ int imaop; /* FI ima-bit operation flag */ int hinop; /* FI hindo operation flag */ } FI_SET_PRIORITY; /* * FI write fi data structure */ typedef struct { int dic_id; /* ¤½¤ÎʸÀá¤Î»ÈÍѤµ¤ì¤¿Wnn¼­½ñID */ int entry_id; /* ¤½¤ÎʸÀá¤ÎWnn¼­½ñÆâ¤Ç¤Î¥¨¥ó¥È¥ê¡¼ID */ int fisysdic; /* Wnn¼­½ñID¤ËÂбþ¤·¤¿FIsys¼­½ñ´Ø·¸ÄêµÁÎΰèÈÖ¹æ */ int fiusrdic; /* Wnn¼­½ñID¤ËÂбþ¤·¤¿FIusr¼­½ñ´Ø·¸ÄêµÁÎΰèÈÖ¹æ */ } FII_BUN_ST; typedef struct { short mode; /* FI´Ø·¸¥â¡¼¥É */ short auto_reverse; /* ¼«Æ°µÕžFI´Ø·¸ flag */ short RERU_bit; /* ¤ì¤ë¡Ê¤é¤ì¤ë¡Ë bit */ short SERU_bit; /* ¤»¤ë¡Ê¤µ¤»¤ë¡Ë bit */ FII_BUN_ST a; /* ʸÀá A¤Î identifier */ unsigned char a_yomi_len; /* ʸÀá A¤Î ÆÉ¤ß¼«Î©¸ìĹ */ FII_BUN_ST b; /* ʸÀá B¤Î identifier */ unsigned char b_yomi_len; /* ʸÀá B¤Î ÆÉ¤ß¼«Î©¸ìĹ */ } FII_DIC_DATA; #endif /* _FI_JDATA_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/mt_jlib.h0000644000000000000000000001575207153676737020502 0ustar rootroot/* * $Id: mt_jlib.h,v 2.13.2.1 2000/08/04 05:37:15 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ #ifndef _MT_JLIB_H_ #define _MT_JLIB_H_ /* * The following definitions can be used for locking requests * in multi-threaded address spaces. */ #define LockMutex(mutex) #define UnlockMutex(mutex) #define DoOnce(once,func) #define InitMutex(mutex) /* structure for J-library */ typedef struct _wnn_extension_set { int id; char *name; } wnn_extension_set; struct wnn_jserver_id_int { struct wnn_jserver_id orig; int version; wnn_extension_set *extensions; }; typedef struct wnn_jserver_id_int WNN_JSERVER_ID_INT; struct wnn_env_int { struct wnn_env orig; }; typedef struct wnn_env_int WNN_ENV_INT; struct wnn_buf_mt { struct wnn_buf orig; }; typedef struct wnn_buf_mt WNN_BUF_MT; #endif /* _MT_JLIB_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/wnn_os.h0000644000000000000000000001702507153676737020360 0ustar rootroot/* * $Id: wnn_os.h,v 2.10.2.1 2000/08/04 05:37:16 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ #ifndef _WNN_OS_ #define _WNN_OS_ /* OS dependent */ #include #include #ifdef SYSVR2 #include #include #ifndef AIXV3 #define index strchr #endif /* AIXV3 */ #ifndef re_signal # define re_signal(x, y) signal((x), (y)) #endif #else # define re_signal(x, y) #endif #if defined(SYSVR2) || defined(UX386) #include #ifndef SVR4 /* for Solaris2.x */ #define getdtablesize() (NOFILE) /* sys/param.h must be included */ #endif /* SVR4 */ #ifndef SIGCHLD # define SIGCHLD SIGCLD #endif #endif #include #include #ifdef BSD42 #include #endif #ifdef TERMINFO #include #include #endif #ifdef HAS_SETLOCALE #include #endif /* if your system has wait3() system call define HAVE_WAIT3. wait3() doesn't have to be fully supported. uum uses only NULL for the 3rd parameter rusage. */ #if !defined(UX386) && !defined(SVR4) && !defined(hpux) && !defined(AIXV3) #define HAVE_WAIT3 #endif #if defined(luna) && !defined(SIGNALRETURNSINT) #define SIGNALRETURNSINT #endif #ifndef SIGNALRETURNSINT typedef void intfntype; #define SIGNAL_RETURN return #else typedef int intfntype; #define SIGNAL_RETURN return(0) #endif typedef intfntype (*intfnptr)(); #endif /* _WNN_OS_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/msg.h0000644000000000000000000001531607153676737017644 0ustar rootroot/* * $Id: msg.h,v 2.6.2.1 2000/08/04 05:37:15 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ #ifndef _WNN_MSG_H_ #define _WNN_MSG_H_ struct msg_bd { int msg_id; char *msg; }; struct msg_cat { char lang[32]; char name[64]; char nlspath[256]; int msg_cnt; struct msg_cat *nextp; struct msg_bd *msg_bd; /*int encoding;*/ }; #define DEF_MSG "Message not found.\n" /* #define DEF_LANG "C" */ #define DEF_LANG "ja_JP" extern struct msg_cat *msg_open(); extern char *msg_get(); extern void msg_close(); #endif /* _WNN_MSG_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/Wnn/include/jllib.h0000644000000000000000000003476707153676737020165 0ustar rootroot/* * $Id: jllib.h,v 2.22.2.1 2000/08/04 05:37:14 kaneda Exp $ */ /* WNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995,1998,2000 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995,1998,2000 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: */ /* Version 4.0 */ /* Nihongo Henkan Library Header File */ #ifndef _JLLIB_H_ #define _JLLIB_H_ #include "jslib.h" /* ¥æ¡¼¥¶¡¼¥×¥í¥°¥é¥à¤Ï¡¢Ä¾Àܤ³¤Î¹½Â¤ÂÎ¤ÎÆâÍÆ¤ò¥¢¥¯¥»¥¹¤¹¤ëɬÍפÏ̵¤¤¤Ï¤º¡£ ¥é¥¤¥Ö¥é¥ê´Ø¿ô¤òÍѤ¤¤ë¤³¤È¡£ */ #define WNN_YOMI_SIZE 10 typedef struct wnn_jl_bun WNN_BUN; struct wnn_jl_bun { int jirilen; /* ¸õÊäʸÀá¤Î¼«Î©¸ì */ int dic_no; int entry; int kangovect; /* Àܳ¥Ù¥¯¥È¥ë¥Æ¡¼¥Ö¥ë¤Ø¤Î¥Ý¥¤¥ó¥¿ */ int hinsi; /* ÉÊ»ì */ int fukugou; /* Ê£¹ç¸ìÍ¥ÀèÊÑ´¹ */ int num_hinsi; /* ÉÊ»ì»ØÄêÊÑ´¹¤Ç»ÈÍѤ·¤¿ÉÊ»ì¤Î¿ô */ int *hinsi_list; /* ÉÊ»ì»ØÄêÊÑ´¹¤Ç»ÈÍѤ·¤¿ÉÊ»ìÈÖ¹æ¥ê¥¹¥È */ int hindo :16; /* ÉÑÅÙ(²¾ÁÛÃÍ) */ int ref_cnt :4; /* ʸÀá¥ê¥¹¥È¤Ë»È¤ï¤ì¤Æ¤¤¤ë */ /* BUG FIX signed --> unsigned */ unsigned int ima :1; /* º£»È¤Ã¤¿¤è¥Ó¥Ã¥È */ unsigned int hindo_updated :1; /* ¤³¤ÎʸÀá¤ÎÉÑÅ٤Ϲ¹¿·¤µ¤ì¤Æ¤¤¤ë */ unsigned int nobi_top :1; /* ¿­¤Ð¤·½Ì¤ß¤ò¹Ô¤Ã¤¿¤«¤ò¼¨¤¹¡£*/ /* egg ¤ß¤¿¤¤¤Ë¿­¤Ð¤·½Ì¤ß¤ò·«¤êÊÖ¤·¹Ô¤¦»þ¤Ë¡¢ÅÓÃæ¤Ë¸½¤ì¤ë¸õÊä¤Îº£ »È¤Ã¤¿¤è ¥Ó¥Ã¥È¤ò Íî¤È¤·¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£*/ unsigned int dai_top :1; /* ÂçʸÀá¤ÎÀèÆ¬ */ unsigned int dai_end :1; /* ÂçʸÀá¤Îsaigo *//* ¼¡¸õÊä nomi */ unsigned int from_zenkouho :3; /*¼¡¸õÊ䤫¤éÁªÂò¤µ¤ì¤¿Ê¸Àᤫ¤É¤¦¤« */ unsigned int bug :1; /* BUG FIX ¤È¤ê¤¢¤¨¤º */ /* BUG FIX signed --> unsigned */ int hyoka; int daihyoka; short yomilen; short kanjilen; short real_kanjilen; WNN_BUN *down; /* º£»È¤Ã¤¿¤è¥Ó¥Ã¥È¤òÍî¤È¤¹ÂоݤÎʸÀá */ w_char yomi[WNN_YOMI_SIZE]; /* ÆÉ¤ß¡¢´Á»ú¤¬Æþ¤ë¡£Æþ¤êÀÚ¤é¤Ê¤¤»þ¤Ë¤Ï ¼¡¤Ë¤Ä¤Ê¤²¤ë */ WNN_BUN *next; /* ¼¡¤Î¥¹¥È¥é¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ */ WNN_BUN *free_next; /* ¼¡¤Î¥¹¥È¥é¥¯¥È¤Ø¤Î¥Ý¥¤¥ó¥¿ */ }; struct wnn_buf { struct wnn_env *env; /* ´Ä¶­ */ int bun_suu; /* ʸÀá¿ô */ int zenkouho_suu; /* Á´¸õÊä¤Î¿ô */ WNN_BUN **bun; /* ʸÀá¤Ø¤Î¥Ý¥¤¥ó¥¿ */ WNN_BUN **down_bnst; /* º£»È¤Ã¤¿¤è¥Ó¥Ã¥È¤òÍî¤È¤¹ÂоݤÎʸÀá */ WNN_BUN **zenkouho; /* Á´¸õÊ䤨¤Î¥Ý¥¤¥ó¥¿ */ int *zenkouho_dai; /* daibunsetsu zenkouho */ int zenkouho_dai_suu; /* daibunsetsu zenkouho suu */ short c_zenkouho; /* Á´¸õÊäÃæ¡¢ÃíÌܤ·¤Æ¤¤¤ë¸õÊä */ short zenkouho_daip; int zenkouho_bun; /* Á´¸õÊä¤ò¼è¤Ã¤Æ¤¤¤ëʸÀá */ int zenkouho_end_bun; /* Á´¸õÊä(dai)¤ò¼è¤Ã¤Æ¤¤¤ëºÇ¸å¤ÎʸÀá */ int zenkouho_endvect; /* Á´¸õÊä¤ò¼è¤Ã¤¿ endvect *//* ADD KURI */ WNN_BUN *free_heap; char *heap; /* linked list of alloced area */ int msize_bun; int msize_zenkouho; struct _WnnAutoTune *at; /* * Hideyuki Kishiba (Sep. 20, 1994) * »ÈÍѣƣɴط¸Á÷¼õ¿®Íѹ½Â¤ÂΤò¥á¥ó¥Ð¤Ë²Ã¤¨¤ë */ struct wnn_fi_rel_buf fi_rb; /* * Hideyuki Kishiba (Nov. 24, 1994) * ľÁ°¤Ë³ÎÄꤷ¤¿Ê¸Àá¾ðÊó¤ò³Ð¤¨¤Æ¤ª¤¯ */ struct wnn_prev_bun prev_bun[WNN_PREV_BUN_SUU]; }; #define WNN_SHO 0 #define WNN_DAI 1 #define WNN_IKEIJI 2 #define WNN_ZIP 1 #define WNN_TEL 2 #define WNN_TANKAN 3 #define WNN_NO_USE 0 #define WNN_USE_MAE 1 #define WNN_USE_ATO 2 #define WNN_USE_ZENGO (WNN_USE_MAE | WNN_USE_ATO) /* #define WNN_ZENGO_YUUSEN 4 */ #define WNN_UNIQ_KNJ 2 #define WNN_UNIQ 1 #define WNN_NO_UNIQ 0 #define WNN_NO_CREATE 0 #define WNN_CREATE (-1) #define WNN_DIC_PRIO_DEFAULT 5 #define WNN_YOMI 0 #define WNN_KANJI 1 #define WNN_KATAKANA_LEARNING_LEN 3 /* minimum length of auto learning katakana */ #define jl_next(buf) jl_set_jikouho((buf), (buf)->c_zenkouho + 1) #define jl_previous(buf) jl_set_jikouho((buf), (buf)->c_zenkouho - 1) #define jl_next_dai(buf) jl_set_jikouho_dai((buf), (buf)->c_zenkouho + 1) #define jl_previous_dai(buf) jl_set_jikouho_dai((buf), (buf)->c_zenkouho - 1) #define jl_get_kanji(buf, bun_no, bun_no2, area)\ wnn_get_area(buf, bun_no, bun_no2, area, WNN_KANJI) #define jl_get_yomi(buf, bun_no, bun_no2, area)\ wnn_get_area(buf, bun_no, bun_no2, area, WNN_YOMI) #define jl_fuzoku_len(buf, k) \ (jl_yomi_len((buf), k, k+1) - jl_jiri_len((buf), k)) #define jl_jiri_kanji_len(buf, k) \ (jl_kanji_len((buf), k, k+1) - jl_fuzoku_len((buf), k)) /* Macros to create library functions from "_e" libraries */ /* for select server by useing $LANG */ #define jl_open(env_n, server_n, wnnrc_n, error_handler, message_handler, timeout) \ jl_open_lang(env_n, server_n, NULL, wnnrc_n, error_handler, message_handler, timeout) #define jl_connect(env_n, server_n, wnnrc_n, error_handler, message_handler, timeout) \ jl_connect_lang(env_n, server_n, NULL, wnnrc_n, error_handler, message_handler, timeout) /* extern function defines */ extern struct wnn_buf *jl_open_lang(); extern struct wnn_env *jl_connect_lang(); extern struct wnn_env *jl_env_get(); extern struct wnn_jdata *jl_word_info_e(); extern w_char *jl_hinsi_name_e(); extern void jl_close(); extern int jl_dic_add_e(); extern int jl_dic_comment_set_e(); extern int jl_dic_delete_e(); extern int jl_dic_list_e(); extern int jl_dic_save_all_e(); extern int jl_dic_save_e(); extern int jl_dic_use_e(); extern void jl_disconnect(); extern void jl_disconnect_if_server_dead(); extern void jl_env_set(); extern int jl_fuzokugo_get_e(); extern int jl_fuzokugo_set_e(); extern void jl_get_zenkouho_kanji(); extern int jl_hinsi_dicts_e(); extern int jl_hinsi_list_e(); extern int jl_hinsi_number_e(); extern int jl_isconnect_e(); extern int jl_kanji_len(); extern int jl_kill(); extern int jl_nobi_conv(); extern int jl_nobi_conv_e2(); extern int jl_param_get_e(); extern int jl_param_set_e(); extern int jl_ren_conv(); extern int jl_set_env_wnnrc(); extern int jl_set_env_wnnrc1(); extern int jl_set_jikouho(); extern int jl_set_jikouho_dai(); extern int jl_tan_conv(); extern int jl_update_hindo(); extern int jl_word_add_e(); extern int jl_word_comment_set_e(); extern int jl_word_delete_e(); extern int jl_word_search_by_env_e(); extern int jl_word_search_e(); extern int jl_word_use_e(); extern int jl_yomi_len(); extern int jl_zenkouho(); extern int jl_zenkouho_dai(); extern int wnn_get_area(); extern int jl_isconnect(); extern int jl_dic_add(); extern int jl_dic_delete(); extern int jl_fuzokugo_set(); extern int jl_fuzokugo_get(); extern int jl_dic_save(); extern int jl_dic_save_all(); extern struct wnn_jdata *jl_word_info(); extern int jl_dic_list(); extern int jl_word_search(); extern int jl_word_search_by_env(); extern int jl_word_use(); extern int jl_param_set(); extern int jl_param_get(); extern int jl_dic_use(); extern int jl_word_add(); extern int jl_word_delete(); extern int jl_hinsi_number(); extern w_char *jl_hinsi_name(); extern int jl_hinsi_list(); extern int jl_hinsi_dicts(); extern int jl_word_comment_set(); extern int jl_dic_comment_set(); extern struct wnn_jdata *jl_inspect(); extern int jl_env_sticky_e(); extern int jl_env_sticky(); extern int jl_env_un_sticky_e(); extern int jl_env_un_sticky(); extern char *jl_get_lang(); extern int jl_bun_suu(); extern int jl_zenkouho_suu(); extern int jl_zenkouho_bun(); extern int jl_c_zenkouho(); extern int jl_zenkouho_daip(); extern int jl_dai_top(); extern int jl_jiri_len(); extern struct wnn_env *jl_env(); extern int jl_get_wnn_errorno_env(); extern int jl_get_wnn_errorno_buf(); extern int jl_tan_conv_hinsi_flag(); extern int jl_nobi_conv_hinsi_flag(); extern int jl_zenkouho_hinsi_flag(); extern int jl_zenkouho_dai_hinsi_flag(); extern int jl_ren_conv_with_hinsi_name(); extern int jl_tan_conv_with_hinsi_name(); extern int jl_nobi_conv_with_hinsi_name(); extern int jl_zenkouho_with_hinsi_name(); extern int jl_zenkouho_dai_with_hinsi_name(); extern int jl_set_henkan_env_e(); extern int jl_set_henkan_env(); extern int jl_get_henkan_env_e(); extern int jl_get_henkan_env(); extern int jl_get_henkan_env_local_e(); extern int jl_get_henkan_env_local(); extern int jl_set_henkan_hinsi_e(); extern int jl_set_henkan_hinsi(); extern int jl_get_henkan_hinsi_e(); extern int jl_get_henkan_hinsi(); /* * Hideyuki Kishiba (Jul. 8, 1994) * New jl_lib functions for FI-Wnn */ extern int jl_fi_dic_add_e(); extern int jl_fi_dic_add(); extern int jl_fi_ren_conv(); extern int jl_fi_nobi_conv(); extern int jl_optimize_fi(); extern int jl_reset_prev_bun(); extern int jl_fi_dic_list_e(); extern int jl_fi_dic_list(); extern int jl_fuzokugo_list_e(); extern int jl_fuzokugo_list(); extern int jl_free(); extern char *wnn_perror(); extern char *wnn_perror_lang(); #ifdef CONVERT_by_STROKE extern void jl_get_zenkouho_yomi(); #endif extern int jl_zenikeiji_dai(); extern int jl_set_ikeiji_dai(); #endif /* _JLLIB_H_ */ wnn6-sdk-1.0.0/contrib/im/Xsi/README0000644000000000000000000001500107153676737015367 0ustar rootrootWNN6 CLIENT LIBRARY--SOFTWARE LICENSE TERMS AND CONDITIONS Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995, 1998 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995, 1998 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 Preamble These Wnn6 Client Library--Software License Terms and Conditions (the "License Agreement") shall state the conditions under which you are permitted to copy, distribute or modify the software which can be used to create Wnn6 Client Library (the "Wnn6 Client Library"). The License Agreement can be freely copied and distributed verbatim, however, you shall NOT add, delete or change anything on the License Agreement. OMRON Corporation and OMRON Software Co., Ltd. (collectively referred to as "OMRON") jointly developed the Wnn6 Software (development code name is FI-Wnn), based on the Wnn Software. Starting from November, 1st, 1998, OMRON publishes the source code of the Wnn6 Client Library, and OMRON permits anyone to copy, distribute or change the Wnn6 Client Library under the License Agreement. Wnn6 Client Library is based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 1. Definition. "Source Code" means the embodiment of the computer code, readable and understandable by a programmer of ordinary skills. It includes related source code level system documentation, comments and procedural code. "Object File" means a file, in substantially binary form, which is directly executable by a computer after linking applicable files. "Library" means a file, composed of several Object Files, which is directly executable by a computer after linking applicable files. "Software" means a set of Source Code including information on its use. "Wnn6 Client Library" the computer program, originally supplied by OMRON, which can be used to create Wnn6 Client Library. "Executable Module" means a file, created after linking Object Files or Library, which is directly executable by a computer. "User" means anyone who uses the Wnn6 Client Library under the License Agreement. Article 2. Copyright 2.1 OMRON Corporation and OMRON Software Co., Ltd. jointly own the Wnn6 Client Library, including, without limitation, its copyright. 2.2 Following words followed by the above copyright notices appear in all supporting documentation of software based on Wnn6 Client Library: This software is based on the original version of Wnn6 Client Library developed by OMRON Corporation and OMRON Software Co., Ltd. and also based on the original version of Wnn developed by Kyoto University Research Institute for Mathematical Sciences (KURIMS), OMRON Corporation and ASTEC Inc. Article 3. Grant 3.1 A User is permitted to make and distribute verbatim copies of the Wnn6 Client Library, including verbatim of copies of the License Agreement, under the License Agreement. 3.2 A User is permitted to modify the Wnn6 Client Library to create Software ("Modified Software") under the License Agreement. A User is also permitted to make or distribute copies of Modified Software, including verbatim copies of the License Agreement with the following information. Upon modifying the Wnn6 Client Library, a User MUST insert comments--stating the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks of using the Modified Software if they are known--right after the end of the License Agreement (or the last comment, if comments are inserted already). 3.3 A User is permitted to create Library or Executable Modules by modifying the Wnn6 Client Library in whole or in part under the License Agreement. A User is also permitted to make or distribute copies of Library or Executable Modules with verbatim copies of the License Agreement under the License Agreement. Upon modifying the Wnn6 Client Library for creating Library or Executable Modules, except for porting a computer, a User MUST add a text file to a package of the Wnn6 Client Library, providing information on the name of the User, the reason for the modifications, the date of the modifications, additional terms and conditions on the part of the modifications if there is any, and potential risks associated with using the modified Wnn6 Client Library, Library or Executable Modules if they are known. 3.4 A User is permitted to incorporate the Wnn6 Client Library in whole or in part into another Software, although its license terms and conditions may be different from the License Agreement, if such incorporation or use associated with the incorporation does NOT violate the License Agreement. Article 4. Warranty THE WNN6 CLIENT LIBRARY IS PROVIDED BY OMRON ON AN "AS IS" BAISIS. OMRON EXPRESSLY DISLCIAMS ANY AND ALL WRRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. IN NO EVENT SHALL OMRON BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES OF ANY KIND WHATSOEVER IN CONNECTION WITH THE WNN6 CLIENT LIBRARY OR THE USE OR OTHER DEALING IN THE WNN6 CLIENT LIBRARY. *************************************************************************** Wnn6 Client Library : (C) Copyright OMRON Corporation. 1995, 1998 all rights reserved. (C) Copyright OMRON Software Co., Ltd. 1995, 1998 all rights reserved. Wnn Software : (C) Copyright Kyoto University Research Institute for Mathematical Sciences 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1993 (C) Copyright ASCTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992, 1993 *************************************************************************** Comments on Modifications: *************************************************************************** To build Wnn6 Client Library you should use the following commands: % cd Xsi edit Makefile.ini and adjust CONFIGSRC for your system. % make World -f Makefile.ini You can use following files for designing Wnn6 clients. - Wnn/include/* - Wnn/jlib/libwnn6_fromsrc.a wnn6-sdk-1.0.0/contrib/im/Xsi/Dics/0002755000000000000000000000000007153676736015375 5ustar rootrootwnn6-sdk-1.0.0/contrib/im/Xsi/Dics/IwanamiDic/0002755000000000000000000000000007153676736017402 5ustar rootrootwnn6-sdk-1.0.0/contrib/im/Xsi/Dics/IwanamiDic/hinsi.data0000644000000000000000000002440507153676736021352 0ustar rootroot;;; ;;; ÉÊ»ì´ÉÍý¥Õ¥¡¥¤¥ë(hinsifile) ;;; ;;; ;;; $Id: hinsi.data,v 1.15 1995/02/21 10:25:48 kishiba Exp $ ;;; (Original Id: hinsi.data,v 1.21 1993/05/27 06:11:57 eiji Exp ) ;;; ; ¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢´´¸ìÉÊ»ì¤Ë´Ø¤¹¤ë¾ðÊó¤ò´ÉÍý¤¹¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¹¡£ ; ´´¸ìÉÊ»ì¤Ë´Ø¤¹¤ë¾ðÊó¤Ï¡¢Á´¤Æ¤Î¼­½ñ¤ÈÀܳ¾ðÊó¥Õ¥¡¥¤¥ë¤Î´Ö¤Ç¶¦Ä̤Ǥʤ¤¤È ; ¤¤¤±¤Ê¤¤¤Î¤Ç¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤ò¾¡¼ê¤Ë¥¨¥Ç¥£¥Ã¥È¤¹¤ë¤³¤È¤Ïµö¤µ¤ì¤Þ¤»¤ó¡£ ; ¡Ê¸Å¤¤ÉÊ»ì´ÉÍý¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤ÆºîÀ®¤·¤¿¼­½ñµÚ¤ÓÀܳ¾ðÊó¥Õ¥¡¥¤¥ë¤Î ; ÉÊ»ìÈÖ¹æ¤Î°ÕÌ£¤¬¡¢°Û¤Ê¤Ã¤¿¤â¤Î¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£¡Ë ; ¤³¤Î¥Õ¥¡¥¤¥ë¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë½çÈ֤ˡ¢Éʻ졢ʣ¹çÉÊ»ì¤ËÈֹ椬³ä¤ê ; Åö¤Æ¤é¤ì¡¢¤½¤ÎÈÖ¹æ¤Ï¡¢¼­½ñ¡¢ÉÊ»ì¥Õ¥¡¥¤¥ë¤òºî¤ë»þ¡¢µÚ¤Ó¥µ¡¼¥Ð¡¢ ; ¥¯¥é¥¤¥¢¥ó¥È¤ÇÈֹ椫¤éÉÊ»ì̾¤ò°ú¤¯¤¿¤á¡¢µÚ¤Ó¡¢ ; Ê£¹çÉÊ»ì¤ËÂФ·¤½¤ì¤ò¹½À®¤¹¤ëÉÊ»ì¤Î½¸¹ç¤ò°ú¤¯¤¿¤á¤Ë ; ÍѤ¤¤é¤ì¤Þ¤¹¡£ ; ¤³¤Î¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æµö¤µ¤ì¤ëÁàºî¤Ï¡¢¿·¤·¤¤ÉÊ»ìµÚ¤ÓÊ£¹çÉÊ»ì¤ò ; ¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤ËÉÕ¤±²Ã¤¨¤ë¤³¤È¤È¡¢¡É@¡É¤Î¤ß¤«¤é¤Ê¤ë¹Ô¤ò ; ¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡° ; Éʻ졢ʣ¹çÉÊ»ì¤ÎÄêµÁ¤ËÃÖ¤­´¹¤¨¤ë¤³¤È¤À¤±¤Ç¤¹¡£ ; ¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡° ; ¥¨¥ó¥È¥ê¤Îºï½ü¤Ï·è¤·¤Æ¤·¤Ê¤¤¤Ç²¼¤µ¤¤¡£ ; ¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡°¡° ; ¡É@¡É¤Ï¡¢¤½¤³¤ÎÉÊ»ì̾¤ÏÄê¤á¤Ê¤¤¤¬¡¢¼è¤ê´º¤¨¤ºÎΰè¤ò¼è¤Ã¤Æ¤ª ; ¤¯¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£ ; ¤³¤Î¥Õ¥¡¥¤¥ë¤Î³Æ¹Ô¤ÏÉÊ»ì¤ÎÄêµÁ ;ÉÊ»ì ; ¤¢¤ë¤¤¤Ï¡¢Ê£¹çÉÊ»ì¤ÎÄêµÁ ;Ê£¹çÉÊ»ì$ÉÊ»ì:ÉÊ»ì:...:ÉÊ»ì ; ¤È¤¤¤¦·Á¼°¤ò¤·¤Æ¤¤¤Þ¤¹¡£¤¿¤À¤·¡¢Ê£¹çÉÊ»ì¤ÎÄêµÁ¤Ç¸½¤ì¤ëÉÊ»ì¤Ï¡¢ ; ¤½¤ì¤è¤êÁ°¤ËÉÊ»ì¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£¤¿¡¢Æ±¤¸ ; ̾Á°¤ò»ý¤ÄÉʻ졢°¿¤¤¤ÏÊ£¹çÉʻ줬¸ºß¤·¤Æ¤¤¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£ ; ¡É;¡É¤Ë½Ð¹ç¤¦¤È¡¢¹ÔËö¤Þ¤Ç¥³¥á¥ó¥È¤È¤·¤ÆÌµ»ë¤µ¤ì¤Þ¤¹¡£ ; ¤³¤Î¥Õ¥¡¥¤¥ë¤Ë´Ø¤¹¤ë¾ðÊó(ÉÊ»ìÈֹ椫¤éÉÊ»ì̾¤ò°ú¤¯¡¢¤¢¤ë¤¤¤Ï¡¢ ; Ê£¹çÉÊ»ì¤ËÂФ·¤½¤Î¹½À®Í×ÁǤò°ú¤¯¡Ë¤Ï¡¢¥é¥¤¥Ö¥é¥ê¤Ë¤è¤Ã¤ÆÄ󶡤µ ; ¤ì¤Þ¤¹¤Î¤Ç¡¢¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥»¥¹¤«¤é»²¾È¤Ç¤­¤Þ¤¹¡£ ;;;; ;;;; ÉÊ»ì¤Ï¡¢³¬ÁØÅª¤ËʬÎव¤ì¤Æ¤¤¤Þ¤¹¡£ ;;;; ¥ë¡¼¥È¤Î¥Î¡¼¥É¤Ï¡¢"/"¤È¤¤¤¦Ì¾Á°¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£ ;;;; ¥ê¡¼¥Õ¤¬ËÜÅö¤ÎÉÊ»ì¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ ;;;; ¥Î¡¼¥É¤Ï¡¢ ;;;; ¥Î¡¼¥É̾|ÉÊ»ì1:ÉÊ»ì2:... ;;;; ¤È½ñ¤«¤ì¤Þ¤¹¡£ /|ÉáÄÌ̾»ì/:¸Çͭ̾»ì/:ư»ì/:ÆÃ¼ì¤Êư»ì/:ư»ì°Ê³°¤ÎÍѸÀ/\ :¤½¤Î¾¤ÎÆÈΩ¸ì/:ÀÜÆ¬¸ì,ÀÜÈø¸ì/:ñ´Á»ú:µ¿»÷ÉÊ»ì/:¤½¤Î¾¤ÎÆÃ¼ìÉÊ»ì/ ÉáÄÌ̾»ì/|̾»ì:¥µ¹Ô(¤¹¤ë)&̾»ì:°ìÃÊ&̾»ì:¤éÈ´¤­°ìÃÊ&̾»ì:·ÁÍÆÆ°»ì&̾»ì\ :¿ô»ì:¿ô»ì&̾»ì\ :¥¶¹Ô(¤º¤ë)&̾»ì:·Áư&¤¹¤ë&̾»ì:·ÁÍÆÆ°»ì(¤¿¤ë)&̾»ì\ :Éû»ì&̾»ì:Éû»ì&¤¹¤ë&̾»ì:½õ¿ô»ì&̾»ì\ :½õ¿ô»ì&¤¹¤ë&̾»ì:ÀÜÆ¬½õ¿ô»ì&̾»ì:̾»ì(¸æ¤Ê¤·) ¸Çͭ̾»ì/|¿Í̾:ÃÏ̾:¿Í̾&ÃÏ̾:¸Çͭ̾»ì\ :À«:̾:´ë¶È:À«&ÃÏ̾:̾&ÃÏ̾:ÃÏ̾&¿Í̾ ư»ì/|°ìÃÊ:°ìÃÊ&̾»ì:¤éÈ´¤­°ìÃÊ:¤éÈ´¤­°ìÃÊ&̾»ì\ :¥«¹Ô¸ÞÃÊ:¥¬¹Ô¸ÞÃÊ:¥µ¹Ô¸ÞÃÊ:¥¿¹Ô¸ÞÃÊ:¥Ê¹Ô¸ÞÃÊ:¥Ï¹Ô¸ÞÃÊ\ :¥Ð¹Ô¸ÞÃÊ:¥Þ¹Ô¸ÞÃÊ:¥é¹Ô¸ÞÃÊ:¥ï¹Ô¸ÞÃÊ\ :¥µ¹Ô(¤¹¤ë):¥µ¹Ô(¤¹¤ë)&̾»ì:¥¶¹Ô(¤º¤ë)\ :¥¶¹Ô(¤º¤ë)&̾»ì:·Áư&¤¹¤ë&̾»ì:Éû»ì&¤¹¤ë\ :Éû»ì&¤È&¤¹¤ë:Éû»ì&¤¹¤ë&̾»ì:½õ¿ô»ì&¤¹¤ë&̾»ì ÆÃ¼ì¤Êư»ì/|¥«¹Ô(¹Ô¤¯):¥é¹Ô(²¼¤µ¤¤)\ :Íè(¤³):Íè(¤­):Íè(¤¯):°Ù(¤·):°Ù(¤¹):°Ù(¤»)\ :°Ù(¤µ) ư»ì°Ê³°¤ÎÍѸÀ/|·ÁÍÆ»ì:·ÁÍÆÆ°»ì:·ÁÍÆÆ°»ì&̾»ì:·ÁÍÆÆ°»ì(¤¿¤ë)\ :·ÁÍÆ»ì(¤¤¤¤):·ÁÍÆ»ìÏ¢ÍÑ·Á¤¦:·Áư&¤¹¤ë&̾»ì:·ÁÍÆÆ°»ì&Éû»ì\ :·ÁÍÆÆ°»ì(¤¿¤ë)&̾»ì:·ÁÍÆÆ°»ì(¤¿¤ë)&Éû»ì ¤½¤Î¾¤ÎÆÈΩ¸ì/|Éû»ì:Ï¢Âλì:Àܳ»ì,´¶Æ°»ì\ :·ÁÍÆÆ°»ì(¤¿¤ë)&Éû»ì\ :Éû»ì&̾»ì:Éû»ì&¤¹¤ë:Éû»ì&¤È&¤¹¤ë:Éû»ì&¤¹¤ë&̾»ì ÀÜÆ¬¸ì,ÀÜÈø¸ì/|ÀÜÆ¬¸ì:ÀÜÈø¸ì:ÀÜÈø¿Í̾:ÀÜÆ¬ÃÏ̾:ÀÜÈøÃÏ̾\ :ÀÜÆ¬¿ô»ì:½õ¿ô»ì:ÀÜÆ¬½õ¿ô»ì:ÀÜÈø½õ¿ô»ì\ :·ÁÍÆÆ°»ì²½ÀÜÈø¸ì:¥µ¹Ô(¤¹¤ë)&̾»ì²½ÀÜÈø¸ì:ÀÜÈøÆ°»ì:·ÁÍÆ»ì²½ÀÜÈøÆ°»ì\ :ÀÜÆ¬¸ì(¤ª):ÀÜÆ¬¸ì(³Æ)\ :ÀÜÆ¬¿Í̾:½õ¿ô»ì&̾»ì:½õ¿ô»ì&¤¹¤ë&̾»ì:½õ¿ô»ì&ÀÜÈø½õ¿ô»ì:ÀÜÆ¬½õ¿ô»ì&̾»ì\ :ÀÜÈøÀ«:ÀÜÈøÌ¾:ưºîÀÜÈø¸ì µ¿»÷ÉÊ»ì/|¿ô»ú:¥«¥Ê:±Ñ¿ô:µ­¹æ:Êijç¸Ì:³«³ç¸Ì:ÉÕ°¸ì ¤½¤Î¾¤ÎÆÃ¼ìÉÊ»ì/|ÆÃ¼ì½õ¿ô»ì/:ÆÃ¼ì¿ô»ì/:¿ô½õ¿ô»ì/:ÆÃ¼ìÀÜÆ¬¿ô»ì/:ÆÃ¼ìñÆÈ¸ì/\ :Í¹ÊØÈÖ¹æ:ÅÅÏÃÈÖ¹æ:Ï¢Âù:°Û·Á»ú ÆÃ¼ì½õ¿ô»ì/|½õ¿ô»ì(²»ÆÉ):½õ¿ô»ì(²»ÆÉ)&¤¹¤ë&̾»ì:½õ¿ô»ì(²»ÆÉ)&ÀÜÈø½õ¿ô»ì\ :½õ¿ô»ì(²»ÆÉ)&̾»ì\ :½õ¿ô»ì(¶¦ÄÌ):½õ¿ô»ì(¶¦ÄÌ)&̾»ì\ :½õ¿ô»ì(¿ô»ú):½õ¿ô»ì(¿ô»ú)&¤¹¤ë&̾»ì:½õ¿ô»ì(¿ô»ú)&¤¹¤ë&̾»ì(¸æ¤Ê¤·)\ :½õ¿ô»ì(¿ô»ú)&̾»ì:½õ¿ô»ì(¿ô»ú)&̾»ì(¸æ¤Ê¤·) ÆÃ¼ì¿ô»ì/|¿ô»ì(°ì):¿ô»ì(·±ÆÉ):¿ô»ìA:¿ô»ìA&̾»ì:¿ô»ìA(°ìÈÌ):¿ô»ìA(¾Ú½ñ)\ :¿ô»ìB:¿ô»ìB&̾»ì:¿ô»ìB(°ìÈÌ):¿ô»ìB(°ìÈÌ)&̾»ì:¿ô»ìB(¾Ú½ñ)\ :¿ô»ìB(¾Ú½ñ)&̾»ì\ :¿ô»ìC:¿ô»ìC&̾»ì:¿ô»ìC(°ìÈÌ):¿ô»ìC(¾Ú½ñ) ¿ô½õ¿ô»ì/|¿ô½õ¿ô»ìA(°ìÈÌ):¿ô½õ¿ô»ìB:¿ô½õ¿ô»ìC:¿ô½õ¿ô»ìC&½õ¿ô»ì(¿ô»ú)&̾»ì\ :¿ô½õ¿ô»ìC&½õ¿ô»ì(¿ô»ú)&̾»ì(¸æ¤Ê¤·) ÆÃ¼ìÀÜÆ¬¿ô»ì/|ÀÜÆ¬¿ô»ìA:ÀÜÆ¬¿ô»ìA(¿ô»ú)\ :ÀÜÆ¬¿ô»ìB:ÀÜÆ¬¿ô»ìB(°ìÈÌ):ÀÜÆ¬¿ô»ìB(¾Ú½ñ) ÆÃ¼ìñÆÈ¸ì/|ñÆÈ¸ì:ñÆÈÀÜÆ¬¸ì:ñÆÈÀÜÈø¸ì ; ; ³Æ¼­½ñ¤«¤éÉÊ»ì¤ò»ØÄꤹ¤ë¤¿¤á (»ÃÄêÁ¼ÃÖ) ; ;´ðËܸì×Ã(pubdic)/|ÉáÄÌ̾»ì/:ư»ì/:ư»ì°Ê³°¤ÎÍѸÀ/:¤½¤Î¾¤ÎÆÈΩ¸ì/ ;ÃÏ̾(pubdic)/|ÃÏ̾ ;¿Í̾(pubdic)/|¿Í̾ ;¿Í̾ÃÏ̾°Ê³°¤Î¸Çͭ̾»ì(pubdic)/|¸Çͭ̾»ì ;ÀÜÆ¬ÀÜÈø¸ì(pubdic)/|ÀÜÆ¬¸ì:ÀÜÈø¸ì:ÀÜÈø¿Í̾:ÀÜÆ¬ÃÏ̾:ÀÜÈøÃÏ̾\ ; :ÀÜÆ¬¿ô»ì:½õ¿ô»ì:ÀÜÆ¬½õ¿ô»ì:ÀÜÈø½õ¿ô»ì:¿ô»ì\ ; :·ÁÍÆÆ°»ì²½ÀÜÈø¸ì:¥µ¹Ô(¤¹¤ë)&̾»ì²½ÀÜÈø¸ì:ÀÜÈøÆ°»ì:·ÁÍÆ»ì²½ÀÜÈøÆ°»ì:/ ;µ­¹æ¤Î°ìÈÌŪ¸Æ¾Î(pubdic)/|µ­¹æ:½õ¿ô»ì ;ñ´Á»ú(pubdic)/|ñ´Á»ú ; ; µ¿»÷ÉÊ»ì ; ÀèÆ¬ ;ʸÀáÀèÆ¬ ¿ô»ú ;0123... ¥«¥Ê ;¥«¥¿¥«¥Ê ±Ñ¿ô ;ABCD... µ­¹æ ;!"#$%... Êijç¸Ì ; ) ] } ¤Ê¤É ÉÕ°¸ì ;ÉÕ°¸ì ³«³ç¸Ì ; ( [ { ¤Ê¤É µ¿»÷ ;¤½¤Î¾¤Îµ¿»÷ʸÀá @ ; ¤³¤³¤Þ¤Ç¤Î 10 ¸Ä¤ÎÉÊ»ì¤Î¸ì¤Ï¡¢¼­½ñ¤Ë¸ºß¤·¤Ê¤¯¤Æ¤âjserver ¤¬ ; Íý²ò¤·¤Æ¤¤¤Þ¤¹¡£ ; ; Ä̾ïÉÊ»ì ; ̾»ì ¿Í̾ ÃÏ̾ ¿Í̾&ÃÏ̾$¿Í̾:ÃÏ̾ ¸Çͭ̾»ì ¿ô»ì ¥«Æ°´´ ¥¬Æ°´´ ¥µÆ°´´ ¥¿Æ°´´ ¥Êư´´ ¥Ðư´´ ¥Þư´´ ¥éư´´ ¥ïư´´ °ìư´´ ¥µÊÑÆ°´´ ¥¶ÊÑÆ°´´ ¥«Æ°Ï¢ÍÑ´´ ¥¬Æ°Ï¢ÍÑ´´ ¥µÆ°Ï¢ÍÑ´´ ¥¿Æ°Ï¢ÍÑ´´ ¥ÊưϢÍÑ´´ ¥ÐưϢÍÑ´´ ¥ÞưϢÍÑ´´ ¥éưϢÍÑ´´ ¥ïưϢÍÑ´´ °ìưϢÍÑ´´ ¥µÊÑÆ°Ï¢ÍÑ´´ ¥¶ÊÑÆ°Ï¢ÍÑ´´ ¥«¹Ô¸ÞÃÊ$¥«Æ°´´:¥«Æ°Ï¢ÍÑ´´ ¥¬¹Ô¸ÞÃÊ$¥¬Æ°´´:¥¬Æ°Ï¢ÍÑ´´ ¥µ¹Ô¸ÞÃÊ$¥µÆ°´´:¥µÆ°Ï¢ÍÑ´´ ¥¿¹Ô¸ÞÃÊ$¥¿Æ°´´:¥¿Æ°Ï¢ÍÑ´´ ¥Ê¹Ô¸ÞÃÊ$¥Êư´´:¥ÊưϢÍÑ´´ ¥Ð¹Ô¸ÞÃÊ$¥Ðư´´:¥ÐưϢÍÑ´´ ¥Þ¹Ô¸ÞÃÊ$¥Þư´´:¥ÞưϢÍÑ´´ ¥é¹Ô¸ÞÃÊ$¥éư´´:¥éưϢÍÑ´´ ¥ï¹Ô¸ÞÃÊ$¥ïư´´:¥ïưϢÍÑ´´ °ìÃÊ$°ìư´´:°ìưϢÍÑ´´ °ìÃÊ&̾»ì$°ìư´´:°ìưϢÍÑ´´:̾»ì ¥«¹Ô(¹Ô¤¯) ;¡Ö¹Ô¤¯¡×¤Î¤ß Íè(¤³) Íè(¤­) Íè(¤¯) ¥µ¹Ô(¤¹¤ë)$¥µÊÑÆ°´´:¥µÊÑÆ°Ï¢ÍÑ´´ ¥¶¹Ô(¤º¤ë)$¥¶ÊÑÆ°´´:¥¶ÊÑÆ°Ï¢ÍÑ´´ ¥µ¹Ô(¤¹¤ë)&̾»ì °Ù(¤·) °Ù(¤¹) °Ù(¤») ¥é¹Ô(²¼¤µ¤¤) ·ÁÍÆ»ì ·ÁÍÆÆ°»ì ·ÁÍÆÆ°»ì&̾»ì$·ÁÍÆÆ°»ì:̾»ì ·ÁÍÆÆ°»ì(¤¿¤ë) Éû»ì Ï¢Âλì Àܳ»ì,´¶Æ°»ì ñ´Á»ú ÀÜÆ¬¸ì ÀÜÈø¸ì ÀÜÆ¬¿ô»ì ;¿ô»ì¤ÎÁ°¡ÖÌó¡×¡¢¡ÖÂè¡×¤Ê¤É ½õ¿ô»ì ÀÜÆ¬½õ¿ô»ì ;¿ô»ì¤È½õ¿ô»ì¤Î´Ö¡Ö¥ß¥ê¡×¡Ö¥­¥í¡×¤Ê¤É ÀÜÈø½õ¿ô»ì ;½õ¿ô»ì¤Î¸å¡ÖÂæ¡×¡Ö¶¯¡×¤Ê¤É¡£¿ô»ì¤¬Ä¾ÀÜÁ°¤ËÍè¤ë¤³¤È¤â¤¢¤ë ÀÜÈø¿Í̾ ;¿Í̾¤Î¸å ÀÜÆ¬ÃÏ̾ ;ÃÏ̾¤ÎÁ° ÀÜÈøÃÏ̾ ;ÃÏ̾¤Î¸å ;;;ÀÜÈø¿ÍÃÏ̾ ;¿Í̾,ÃÏ̾¤Î¸å ;;;ÀÜÈø¥µÊÑ̾ ;¥µÊÑ̾¤Î¸å ÀÜÆ¬¸ì(¤ª) ÀÜÆ¬¸ì(³Æ) ·ÁÍÆÆ°»ì²½ÀÜÈø¸ì ;̾»ì¤ËÉÕ¤­·ÁÍÆÆ°»ì¤È¤Ê¤ë¡£¡ÖŪ¡×¤Ê¤É ¥µ¹Ô(¤¹¤ë)&̾»ì²½ÀÜÈø¸ì ;̾»ì¤ËÉÕ¤­¥µÊÑ̾»ì¤È¤Ê¤ë¡£¡Ö²½¡×¤Ê¤É ÀÜÈøÆ°»ì ;ư»ìÏ¢ÍÑ·Á¤ËÉÕ¤­Ì¾»ì¤È¤Ê¤ë¡£¡ÖÊý¡×¤Ê¤É ·ÁÍÆ»ì²½ÀÜÈøÆ°»ì ;ư»ìÏ¢ÍÑ·Á¤ËÉÕ¤­·ÁÍÆ»ì¤È¤Ê¤ë¡£¡ÖÆñ¤¤¡×¤Ê¤É ;; ;; ¤³¤³¤«¤é£Ù£é£î£õÄɲÃʬ for Yinu Wnn dictionary ;; À« ̾ ´ë¶È ÃÏ̾&´ë¶È$ÃÏ̾:´ë¶È ÃÏ̾&¿Í̾$ÃÏ̾:À«:̾ À«&ÃÏ̾$À«:ÃÏ̾ ̾&ÃÏ̾$̾:ÃÏ̾ ¥¶¹Ô(¤º¤ë)&̾»ì °Ù(¤µ) ·ÁÍÆ»ì(¤¤¤¤) ·ÁÍÆ»ìÏ¢ÍÑ·Á¤¦ ·Áư&¤¹¤ë&̾»ì$¥µ¹Ô(¤¹¤ë)&̾»ì:·ÁÍÆÆ°»ì Éû»ì&̾»ì$Éû»ì:̾»ì Éû»ì&¤¹¤ë$¥µ¹Ô(¤¹¤ë)&̾»ì:Éû»ì Éû»ì&¤È&¤¹¤ë$¥µ¹Ô(¤¹¤ë)&̾»ì:Éû»ì Éû»ì&¤¹¤ë&̾»ì$¥µ¹Ô(¤¹¤ë)&̾»ì:Éû»ì ·ÁÍÆÆ°»ì&Éû»ì$·ÁÍÆÆ°»ì:Éû»ì ½õ¿ô»ì&̾»ì$½õ¿ô»ì:̾»ì ;±ß, ¥É¥ë ¤Ê¤É ½õ¿ô»ì&¤¹¤ë&̾»ì$½õ¿ô»ì:¥µ¹Ô(¤¹¤ë)&̾»ì ÀÜÆ¬¿Í̾ ;¿Í̾¤ÎÁ° ÀÜÈøÀ« ;À«¤Î¸å ÀÜÈøÌ¾ ;̾¤Î¸å ;;; add from 1.1j ¿Í̾&´ë¶È$À«:̾:´ë¶È ·ÁÍÆÆ°»ì(¤¿¤ë)&̾»ì$·ÁÍÆÆ°»ì(¤¿¤ë):̾»ì ·ÁÍÆÆ°»ì(¤¿¤ë)&Éû»ì$·ÁÍÆÆ°»ì(¤¿¤ë):Éû»ì ·Áư&Éû»ì&̾»ì$·ÁÍÆÆ°»ì:Éû»ì:̾»ì ¿ô»ì&̾»ì$¿ô»ì:̾»ì ½õ¿ô»ì&ÀÜÈø½õ¿ô»ì$½õ¿ô»ì:ÀÜÈø½õ¿ô»ì ÀÜÆ¬½õ¿ô»ì&̾»ì$ÀÜÆ¬½õ¿ô»ì:̾»ì Í¹ÊØÈÖ¹æ ;Í¹ÊØÈֹ漭½ñÍÑ ÅÅÏÃÈÖ¹æ ;ÅÅÏÃÈֹ漭½ñÍÑ ;; ;; ¤³¤³¤«¤é FI-Wnn ÄɲÃʬ ;; ¿ô»ìA(°ìÈÌ) ; ¡Ö°ì¡×¡ÖÆó¡×¡Ö»°¡× ¿ô»ìA(¾Ú½ñ) ; ¡Ö°í¡×¡ÖÆõ¡×¡Ö»²¡× ¿ô»ìA$¿ô»ìA(°ìÈÌ):¿ô»ìA(¾Ú½ñ) ; ¡Ö»Í¡×¡Ö¸Þ¡× ... ¡Ö¶å¡× ¿ô»ìB(°ìÈÌ) ; ¡Ö½½¡× ¿ô»ìB(¾Ú½ñ) ; ¡Ö½¦¡× ¿ô»ìB$¿ô»ìB(°ìÈÌ):¿ô»ìB(¾Ú½ñ) ; ¡ÖÉ´¡×¡ÖÀé¡× ¿ô»ìC(°ìÈÌ) ¿ô»ìC(¾Ú½ñ) ¿ô»ìC$¿ô»ìC(°ìÈÌ):¿ô»ìC(¾Ú½ñ) ; ¡ÖËü¡×¡Ö²¯¡×¡ÖÃû¡×¤Ê¤É ¿ô»ì(·±ÆÉ) ; ¡Ö°ì¡Ê¤Ò¤È¡Ë¡×¡ÖÆó¡Ê¤Õ¤¿¡Ë¡×¤Ê¤É ¿ô»ìA&̾»ì$¿ô»ìA(°ìÈÌ):¿ô»ìA(¾Ú½ñ):̾»ì ¿ô»ìB&̾»ì$¿ô»ìB(°ìÈÌ):¿ô»ìB(¾Ú½ñ):̾»ì ¿ô»ìB(¾Ú½ñ)&̾»ì$¿ô»ìB(¾Ú½ñ):̾»ì ¿ô»ìB(°ìÈÌ)&̾»ì$¿ô»ìB(°ìÈÌ):̾»ì ¿ô»ìC&̾»ì$¿ô»ìC(°ìÈÌ):¿ô»ìC(¾Ú½ñ):̾»ì ÀÜÆ¬¿ô»ìA ; ¡ÖÂè¡×¡ÖÁ´¡×¤Ê¤É¡¢¿ôÃͤÎÁ°¤Ë¤¯¤ë¤â¤Î ÀÜÆ¬¿ô»ìB(°ìÈÌ) ; ¡Ö²¿¡×¡Ö¿ô¡×¡Ö´ö¡×¤Ê¤É¡¢¿ô»ìA¤ÎÂå¤ê¤Ë»È¤ï¤ì¤ë¤â¤Î ÀÜÆ¬¿ô»ìB(¾Ú½ñ) ; ¡Ö²¿¡×¡Ö¿ô¡×¡Ö´ö¡×¤Ê¤É¡¢¿ô»ìA¤ÎÂå¤ê¤Ë»È¤ï¤ì¤ë¤â¤Î ÀÜÆ¬¿ô»ìB$ÀÜÆ¬¿ô»ìB(°ìÈÌ):ÀÜÆ¬¿ô»ìB(¾Ú½ñ) ½õ¿ô»ì(²»ÆÉ) ; ¡Ö¸ì¡×¡ÖÂæ¡×¤Ê¤É¡¢²»ÆÉ¿ô»ì¤Ë¤Î¤ßÀܳ²Äǽ¤Ê¤â¤Î ½õ¿ô»ì(¿ô»ú) ; ¡Ö¤Ä¡×¡ÖÆü¡×¤Ê¤É¡¢¿ô»ú¤Ë¤Î¤ßÀܳ²Äǽ¤Ê¤â¤Î ; ¡Ê¡Ö°ì¤Ä¡×¡ÖÆóÆü¡Ê¤Õ¤Ä¤«¡Ë¡×¤Ê¤É¤Ïñ¸ìÅÐÏ¿¤ÇÂбþ¡Ë ½õ¿ô»ì(¶¦ÄÌ) ; ¡Ö·¤¨¡×¡ÖÄ̤ê¡×¤Ê¤É¡¢¤É¤ó¤Ê¿ô»ì¤Ë¤âÀܳ²Äǽ ½õ¿ô»ì(²»ÆÉ)&̾»ì$½õ¿ô»ì(²»ÆÉ):̾»ì ½õ¿ô»ì(²»ÆÉ)&¤¹¤ë&̾»ì$½õ¿ô»ì(²»ÆÉ):¥µ¹Ô(¤¹¤ë)&̾»ì ½õ¿ô»ì(²»ÆÉ)&ÀÜÈø½õ¿ô»ì$½õ¿ô»ì(²»ÆÉ):ÀÜÈø½õ¿ô»ì ½õ¿ô»ì(¶¦ÄÌ)&̾»ì$½õ¿ô»ì(¶¦ÄÌ):̾»ì ñÆÈÀÜÆ¬¸ì ; ËÜÍèÀÜÆ¬¸ì¤À¤¬¾®Ê¸Àá´Ö¤ÎÀܳ¤ò¤·¤Ê¤¤¤â¤Î ñÆÈÀÜÈø¸ì ; ËÜÍèÀÜÈø¸ì¤À¤¬¾®Ê¸Àá´Ö¤ÎÀܳ¤ò¤·¤Ê¤¤¤â¤Î ;;; ¤³¤ì¤ÏËÜÍè¡¢¥¢¥ï¹Ô¸ÞÃʤε첾̾¤ÇÂбþ¤¹¤Ù¤­¤â¤Î¤À¤¬¡¢ ;;; ATOK8 ¼­½ñ¤Î¥³¥ó¥Ð¡¼¥È¤Î¤¿¤áÄɲà ¥Ïư´´ ; ATOK8 ¤È¤Î¸ß´¹À­¤Î¤¿¤á¡Ê¡ÖÇã¤Õ¡×¤Ê¤É¡Ë ¥ÏưϢÍÑ´´ ; ATOK8 ¤È¤Î¸ß´¹À­¤Î¤¿¤á¡Ê¡ÖÇã¤Õ¡×¤Ê¤É¡Ë ¥Ï¹Ô¸ÞÃÊ$¥Ïư´´:¥ÏưϢÍÑ´´ ; ATOK8 ¤È¤Î¸ß´¹À­¤Î¤¿¤á¡Ê¡ÖÇã¤Õ¡×¤Ê¤É¡Ë ;; ;; ¤éÈ´¤­Æ°»ìÍÑ ¤éÈ´¤­´´ ¤éÈ´¤­°ìÃÊ$°ìư´´:°ìưϢÍÑ´´:¤éÈ´¤­´´ ¤éÈ´¤­°ìÃÊ&̾»ì$°ìư´´:°ìưϢÍÑ´´:¤éÈ´¤­´´:̾»ì ;; ;; °Û·Á»úÊÑ´¹ÍÑ °Û·Á»ú ;; ¸µÀÜÆ¬ÀÜÈø¸ì´ØÏ¢ Ï¢Âù ; Âù²»²½¤·¤¿ÀÜÈø¸ì ñÆÈ¸ì ; ÀèÆ¬¤Ë¤Ê¤ì¤ëÆÈΩÀܼ­¡ÊÇѻߤ¹¤ëÀÜÆ¬ÀÜÈø¸ì¤ËÂå¤Ã¤Æ»ÈÍÑ¡Ë Æ°ºîÀÜÈø¸ì ; ¥µ¹Ô(¤¹¤ë)&̾»ì¤ËÀܳ¤¹¤ëÀÜÈø¸ì ;; ½õ¿ô»ì½èÍý¤Î¤¿¤á¤ÎÄɲÃʬ (from harima) ÀÜÆ¬¿ô»ìA(¿ô»ú) ; ASCII ¿ô»ú¤Ë¸åÊýÀܳ¤·¤¿¤È¤­¤Ë¤Î¤ß ÂçʸÀá¤È¤Ê¤ë¡£ ¿ô»ì(°ì) ; [¤¤¤Á|¤¤¤Ã] °ì ; ¿ô»ìA¤È¤Î °ã¤¤¤Ï¡¢¿ô»ìB and ¿ô»ìB(°ìÈÌ)¤È¸åÊýÀܳ¤·¤Ê¤¤¡£ ¿ô½õ¿ô»ìA(°ìÈÌ) ; ¿ô»ìA¤È½õ¿ô»ì¤ÎÊ£¹ç¸ì ; ¡ÊÎã¡§¤¤¤Á¤¢¤ó¤Ú¤¢¡¢ ....... ¤­¤å¤¦¤¢¤ó¤Ú¤¢ ; ¤¤¤Ã¤«¤¤ ¡¢ ....... ¤­¤å¤¦¤¢¤ó¤Ú¤¢ ¡Ë ; Á°ÊýÀܳ¤Ï ¿ô»ìA¤ÈƱ¤¸ ; ¸åÊýÀܳ¤Ï ½õ¿ô»ì¤ÈƱ¤¸ ¿ô½õ¿ô»ìB ; ¿ô»ìB¤È½õ¿ô»ì¤ÎÊ£¹ç¸ì ; ¡ÊÎã¡§¤¸¤å¤¦¤¢¤ó¤Ú¤¢¡¢ ¤Ò¤ã¤¯¤¢¤ó¤Ú¤¢¡¢ ¤»¤ó¤¢¤ó¤Ú¤¢ ; ¤¸¤å¤Ã¤«¤¤¡¢ ¤Ò¤ã¤Ã¤«¤¤¡¢ ¤»¤ó¤«¤¤ ¡Ë ; Á°ÊýÀܳ¤Ï ¿ô»ìB¤ÈƱ¤¸¡¢ ; ⤷¡¢¡Ö¿ô»ì(°ì)¡×¤È¤ÏÁ°ÊýÀܳ¤·¤Ê¤¤¡£ ; ¸åÊýÀܳ¤Ï ½õ¿ô»ì¤ÈƱ¤¸ ¿ô½õ¿ô»ìC ; ¤Þ¤ó¤¢¤ó¤Ú¤¢ ; Àܳ¤Ï¿ô½õ¿ô»ìB¤È¤Û¤ÜƱ¤¸¤Ç¤¢¤ë¤¬¡¢ ; Í£°ì¤Î°ã¤¤¤Ï¡¢¡Ö¿ô»ì(°ì)¡×¤È¤ÏÁ°ÊýÀܳ¤¹¤ë¡£ ½õ¿ô»ì(¿ô»ú)&̾»ì$½õ¿ô»ì(¿ô»ú):̾»ì ½õ¿ô»ì(¿ô»ú)&¤¹¤ë&̾»ì$½õ¿ô»ì(¿ô»ú):¥µ¹Ô(¤¹¤ë)&̾»ì ¿ô½õ¿ô»ìC&½õ¿ô»ì(¿ô»ú)&̾»ì$¿ô½õ¿ô»ìC:½õ¿ô»ì(¿ô»ú):̾»ì ̾»ì(¸æ¤Ê¤·) ; ÀÜÆ¬¸ì ¡Ö¸æ¡Ê¤ª¡Ë¡×¤È °ì½ï¤Ë»ÈÍѤ·¤Ê¤¤Ì¾»ì¡£ ¥µ¹Ô(¤¹¤ë)&̾»ì(¸æ¤Ê¤·) ; ÀÜÆ¬¸ì ¡Ö¸æ¡Ê¤ª¡Ë¡×¤È °ì½ï¤Ë»ÈÍѤ·¤Ê¤¤¥µ¹Ô(¤¹¤ë)&̾»ì¡£ ½õ¿ô»ì(¿ô»ú)&̾»ì(¸æ¤Ê¤·)$½õ¿ô»ì(¿ô»ú):̾»ì(¸æ¤Ê¤·) ½õ¿ô»ì(¿ô»ú)&¤¹¤ë&̾»ì(¸æ¤Ê¤·)$½õ¿ô»ì(¿ô»ú):¥µ¹Ô(¤¹¤ë)&̾»ì(¸æ¤Ê¤·) ¿ô½õ¿ô»ìC&½õ¿ô»ì(¿ô»ú)&̾»ì(¸æ¤Ê¤·)$¿ô½õ¿ô»ìC:½õ¿ô»ì(¿ô»ú):̾»ì(¸æ¤Ê¤·) ÀÜÆ¬½õ¿ô»ì&̾»ì(¸æ¤Ê¤·)$ÀÜÆ¬½õ¿ô»ì:̾»ì(¸æ¤Ê¤·) ;; ;; ¡ÖƱ¤¸¡×¡Ö¤¢¤ó¤Ê¡×¡Ö¤³¤ó¤Ê¡×¡Ö¤½¤ó¤Ê¡×¡Ö¤É¤ó¤Ê¡×ÆÃ¼ì·ÁÍÆÆ°»ì ;; ¡ÊÏ¢ÂηÁ¤Ë¡Ö¤Ê¡×¤¬¤Ä¤«¤Ê¤¤¡Ë ·Áư(Ï¢Âθ촴)´´ ·ÁÍÆÆ°»ì(Ï¢ÂÎ)$·ÁÍÆÆ°»ì:·Áư(Ï¢Âθ촴)´´ ;; ;; £Æ£ÉÀÜÈø¸ìÊÑ´¹ÍÑÉÊ»ì¡Ê¼ÂºÝ¤Î¼­½ñÃæ¤Ë¤Ï¸ºß¤·¤Æ¤Ï¤¤¤±¤Ê¤¤¡Ë ;; £Æ£ÉÀÜÈø £Æ£É´´¸ì