Last active
October 17, 2015 03:00
-
-
Save tsutsui/f36d746779b9fef9751d to your computer and use it in GitHub Desktop.
WIP patches for Canna-3.7pl3 (against pkgsrc HEAD)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a shell archive. Save it in a file, remove anything before | |
# this line, and then unpack it by entering "sh file". Note, it may | |
# create directories; files and directories will be owned by you and | |
# have default permissions. | |
# | |
# This archive contains: | |
# | |
# inputmethod/canna | |
# inputmethod/canna/Makefile | |
# inputmethod/canna/DESCR | |
# inputmethod/canna/files | |
# inputmethod/canna/files/canna.sh | |
# inputmethod/canna/files/dic-phono-filter.awk | |
# inputmethod/canna/Makefile.common | |
# inputmethod/canna/distinfo | |
# inputmethod/canna/patches | |
# inputmethod/canna/patches/patch-Canna.conf | |
# inputmethod/canna/patches/patch-Imakefile | |
# inputmethod/canna/patches/patch-canna_widedef.h | |
# inputmethod/canna/patches/patch-canuum_Imakefile | |
# inputmethod/canna/patches/patch-canuum_canna.c | |
# inputmethod/canna/patches/patch-canuum_config.h.in | |
# inputmethod/canna/patches/patch-canuum_configure.in | |
# inputmethod/canna/patches/patch-canuum_configure | |
# inputmethod/canna/patches/patch-canuum_jhlp.c | |
# inputmethod/canna/patches/patch-canuum_printf.c | |
# inputmethod/canna/patches/patch-canuum_termio.c | |
# inputmethod/canna/patches/patch-cmd_cmd.tmpl | |
# inputmethod/canna/patches/patch-lib_RK_dd.c | |
# inputmethod/canna/patches/patch-dic_phono_Imakefile | |
# inputmethod/canna/patches/patch-lib_RK_ncache.c | |
# inputmethod/canna/patches/patch-lib_RKC_convert.c | |
# inputmethod/canna-canuum | |
# inputmethod/canna-canuum/MESSAGE | |
# inputmethod/canna-canuum/DESCR | |
# inputmethod/canna-canuum/Makefile | |
# inputmethod/canna-canuum/PLIST | |
# inputmethod/canna-dict | |
# inputmethod/canna-dict/Makefile | |
# inputmethod/canna-dict/DESCR | |
# inputmethod/canna-dict/PLIST | |
# inputmethod/canna-lib | |
# inputmethod/canna-lib/Makefile | |
# inputmethod/canna-lib/DESCR | |
# inputmethod/canna-lib/PLIST | |
# inputmethod/canna-lib/buildlink3.mk | |
# inputmethod/canna-server | |
# inputmethod/canna-server/INSTALL | |
# inputmethod/canna-server/DESCR | |
# inputmethod/canna-server/MESSAGE | |
# inputmethod/canna-server/Makefile | |
# inputmethod/canna-server/PLIST | |
# | |
echo c - inputmethod/canna | |
mkdir -p inputmethod/canna > /dev/null 2>&1 | |
echo x - inputmethod/canna/Makefile | |
sed 's/^X//' >inputmethod/canna/Makefile << 'END-of-inputmethod/canna/Makefile' | |
X# $NetBSD: Makefile,v 1.11 2010/02/20 10:39:01 obache Exp $ | |
X | |
XMETA_PACKAGE= yes | |
X | |
X.include "Makefile.common" | |
X | |
XPKGNAME:= Canna-${CANNA_VERSION} | |
X | |
XDEPENDS+= Canna-server>=${CANNA_VERSION}:../../inputmethod/canna-server | |
XDEPENDS+= Canna-dict>=${CANNA_VERSION}:../../inputmethod/canna-dict | |
X | |
XCANNA_MODULE= meta-package | |
X | |
X.include "../../mk/bsd.pkg.mk" | |
END-of-inputmethod/canna/Makefile | |
echo x - inputmethod/canna/DESCR | |
sed 's/^X//' >inputmethod/canna/DESCR << 'END-of-inputmethod/canna/DESCR' | |
XCanna is a Japanese input method server/client. Canna supports | |
XEmacs/Mule (Multi-lingual extension Emacs), kinput2 X11 input methods, | |
Xcannum front end, and some others. | |
END-of-inputmethod/canna/DESCR | |
echo c - inputmethod/canna/files | |
mkdir -p inputmethod/canna/files > /dev/null 2>&1 | |
echo x - inputmethod/canna/files/canna.sh | |
sed 's/^X//' >inputmethod/canna/files/canna.sh << 'END-of-inputmethod/canna/files/canna.sh' | |
X#!@RCD_SCRIPTS_SHELL@ | |
X# | |
X# $NetBSD: canna.sh,v 1.2 2006/07/05 04:48:28 jlam Exp $ | |
X# | |
X# PROVIDE: canna | |
X# REQUIRE: DAEMON | |
X | |
X. /etc/rc.subr | |
X | |
Xname="canna" | |
Xrcvar=$name | |
Xcommand="@PREFIX@/sbin/cannaserver" | |
Xstart_precmd="canna_prestart" | |
Xstop_cmd="@PREFIX@/sbin/cannakill" | |
X | |
Xmkdir_perms() { | |
X dir="$1"; user="$2"; group="$3"; mode="$4" | |
X @TEST@ -d $dir || @MKDIR@ $dir | |
X @CHOWN@ $user $dir | |
X @CHGRP@ $group $dir | |
X @CHMOD@ $mode $dir | |
X} | |
X | |
Xcanna_prestart() | |
X{ | |
X mkdir_perms @CANNA_SPOOL@ @CANNA_USER@ @CANNA_GROUP@ 0755 | |
X mkdir_perms @IMDICTDIR@/canna @CANNA_USER@ @CANNA_GROUP@ 0775 | |
X mkdir_perms @IMDICTDIR@/canna/canna @CANNA_USER@ @CANNA_GROUP@ 0775 | |
X | |
X srcdictdir="@PREFIX@/libdata/canna" | |
X dictdir="@IMDICTDIR@/canna/canna" | |
X if @TEST@ -d $srcdictdir; then | |
X ( cd $srcdictdir; for f in *; do | |
X @TEST@ "$f" != "*" || continue | |
X @RM@ -f $dictdir/$f | |
X @LN@ -fs $srcdictdir/$f $dictdir/$f | |
X done ) | |
X fi | |
X} | |
X | |
Xload_rc_config $name | |
Xrun_rc_command "$1" | |
END-of-inputmethod/canna/files/canna.sh | |
echo x - inputmethod/canna/files/dic-phono-filter.awk | |
sed 's/^X//' >inputmethod/canna/files/dic-phono-filter.awk << 'END-of-inputmethod/canna/files/dic-phono-filter.awk' | |
XBEGIN { | |
X skip = 0 | |
X} | |
X | |
X/^#ifdef SHIFT/ { skip = 0 } | |
X/^#ifdef ASCII/ { skip = 1 } | |
X/^#ifndef SHIFT/ { skip = 1 } | |
X/^#ifndef ASCII/ { skip = 0 } | |
X/^#else/ { skip = !skip } | |
X/^#endif/ { skip = 0 } | |
X/^#/ { next; } | |
X | |
X{ if (!skip) print } | |
END-of-inputmethod/canna/files/dic-phono-filter.awk | |
echo x - inputmethod/canna/Makefile.common | |
sed 's/^X//' >inputmethod/canna/Makefile.common << 'END-of-inputmethod/canna/Makefile.common' | |
X# $NetBSD: Makefile.common,v 1.22 2015/06/29 11:06:47 ryoon Exp $ | |
X# | |
X# Canna common makefile. | |
X# | |
X# used by inputmethod/canna-canuum/Makefile | |
X# used by inputmethod/canna-dict/Makefile | |
X# used by inputmethod/canna-lib/Makefile | |
X# used by inputmethod/canna-server/Makefile | |
X | |
X# "Pkgsrc" version. | |
XCANNA_VERSION= 3.7pl3 | |
X | |
XDISTNAME= Canna${CANNA_VERSION:S|.||:S|pl|p|} | |
XPKGNAME= Canna-${CANNA_MODULE}-${CANNA_VERSION} | |
XCATEGORIES= japanese inputmethod | |
XMASTER_SITES= ${MASTER_SITE_OSDN:=canna/9565/} | |
XEXTRACT_SUFX= .tar.bz2 | |
X | |
XMAINTAINER= tech-pkg-ja@jp.NetBSD.org | |
XHOMEPAGE= http://canna.osdn.jp/ | |
XCOMMENT= Kana-Kanji conversion system (${CANNA_MODULE}) | |
X | |
XFILESDIR= ${.CURDIR}/../../inputmethod/canna/files | |
XDISTINFO_FILE= ${.CURDIR}/../../inputmethod/canna/distinfo | |
XPATCHDIR= ${.CURDIR}/../../inputmethod/canna/patches | |
X | |
XUSE_IMAKE= yes | |
XCANNA_SPOOL= ${VARBASE}/spool/canna | |
XCANNA_MODE= 0755 | |
X | |
XPKG_GROUPS_VARS+= CANNA_GROUP | |
XPKG_USERS_VARS+= CANNA_USER | |
X | |
XCANNA_ENV= CANNA_USER=${CANNA_USER} \ | |
X CANNA_GROUP=${CANNA_GROUP} \ | |
X CANNA_SPOOL=${CANNA_SPOOL} \ | |
X CANNA_MODE=${CANNA_MODE} \ | |
X IMDICTDIR=${IMDICTDIR} | |
XMAKE_ENV+= ${CANNA_ENV} | |
XSCRIPTS_ENV+= ${CANNA_ENV} | |
XPLIST_SUBST+= ${CANNA_ENV} | |
XFILES_SUBST+= ${CANNA_ENV} | |
X | |
XINSTALL_MAKE_FLAGS+= CHOWN=${TRUE} | |
XINSTALL_MAKE_FLAGS+= CHGRP=${TRUE} | |
XINSTALL_MAKE_FLAGS+= CHMOD=${TRUE} | |
END-of-inputmethod/canna/Makefile.common | |
echo x - inputmethod/canna/distinfo | |
sed 's/^X//' >inputmethod/canna/distinfo << 'END-of-inputmethod/canna/distinfo' | |
X$NetBSD: distinfo,v 1.11 2012/07/03 17:44:39 joerg Exp $ | |
X | |
XSHA1 (Canna37p3.tar.bz2) = e39eece7c70c669dd46dd74b26121a60a2496fde | |
XRMD160 (Canna37p3.tar.bz2) = 33e5eb9e2dc144835db838612897e652acbc60ed | |
XSize (Canna37p3.tar.bz2) = 1263065 bytes | |
XSHA1 (patch-Canna.conf) = 81b46285a2b91c07b8497dc6669eb26552391a6c | |
XSHA1 (patch-Imakefile) = a70dee63ce9ce392b29b76df70479fee45e1a2b9 | |
XSHA1 (patch-canna_widedef.h) = c52cbbe5b55fc4fca6a501eef50fbf5bb878e514 | |
XSHA1 (patch-canuum_Imakefile) = e651abd2bd2f10da6424599a98abcfe69ae10349 | |
XSHA1 (patch-canuum_canna.c) = a543a720fba9e2f770d6397d6b05352cfa58f300 | |
XSHA1 (patch-canuum_config.h.in) = 575a998c069dd6b6df9e14889af32c09afe58915 | |
XSHA1 (patch-canuum_configure) = 0900eb349792f9e3384894ec8273b63b1b1405f8 | |
XSHA1 (patch-canuum_configure.in) = ee344111779b4041afbbb1e3e469acda7c6dbc9e | |
XSHA1 (patch-canuum_jhlp.c) = f31199d2c6ce3746d5714eee26148da3ab12290c | |
XSHA1 (patch-canuum_printf.c) = c05ef114fae689855989d5d5eded2f734c62e12e | |
XSHA1 (patch-canuum_termio.c) = ae1ade40d66f7e3feb1abebde2f53cacf31192fe | |
XSHA1 (patch-cmd_cmd.tmpl) = f6ec97c273aa84eb84bdd24cbe16aaf7e696e041 | |
XSHA1 (patch-dic_phono_Imakefile) = 4e1210517317b57796cad5b350de41e1f0d8157d | |
XSHA1 (patch-lib_RKC_convert.c) = f196cfa3db3ef163c1869ca6bfd3f22170997aef | |
XSHA1 (patch-lib_RK_dd.c) = 8055a2a3902e7d4d0cc1d782295c2879311750ec | |
XSHA1 (patch-lib_RK_ncache.c) = f322d8b0c23e3b00b6d605ec2a044ac637a3cbfe | |
END-of-inputmethod/canna/distinfo | |
echo c - inputmethod/canna/patches | |
mkdir -p inputmethod/canna/patches > /dev/null 2>&1 | |
echo x - inputmethod/canna/patches/patch-Canna.conf | |
sed 's/^X//' >inputmethod/canna/patches/patch-Canna.conf << 'END-of-inputmethod/canna/patches/patch-Canna.conf' | |
X$NetBSD$ | |
X | |
X- Handle pkgsrc environments | |
X- Enable IPv6 support | |
X- Fix shlib options | |
X | |
X--- Canna.conf.orig 2004-05-19 15:48:47.000000000 +0000 | |
X+++ Canna.conf | |
X@@ -109,12 +109,12 @@ | |
X # define DefErrDir $(cannaPrefix)/log | |
X # define DefLibCannaDir $(cannaExecPrefix)/lib | |
X #else | |
X-# define DefCannaPrefix /usr/local/canna | |
X+# define DefCannaPrefix ${PREFIX} | |
X # ifdef ObsoleteInstallDir | |
X # define DefErrDir /usr/spool/canna | |
X # define DefLibCannaDir /usr/lib | |
X # else | |
X-# define DefErrDir /var/log | |
X+# define DefErrDir ${CANNA_SPOOL} | |
X # define DefLibCannaDir $(cannaExecPrefix)/lib | |
X # endif | |
X #endif | |
X@@ -148,7 +148,7 @@ XCOMM cannaLibDir = /var/lib/canna | |
X XCOMM cannaLibDir = /var/db/canna | |
X cannaLibDir = DefCannaLibDir | |
X XCOMM cannaManDir = $(cannaPrefix)/share/man | |
X-cannaManDir = $(cannaPrefix)/man | |
X+cannaManDir = $(cannaPrefix)/$(PKGMANDIR) | |
X cannaIncDir = $(cannaPrefix)/include/canna | |
X | |
X libCannaDir = DefLibCannaDir | |
X@@ -158,7 +158,7 @@ ErrDir = DefErrDir | |
X #define SupportOldWchar 1 | |
X | |
X /* IPv6¤òÍѤ¤¤ë¾ì¹ç¤Ï1¤ÈÄêµÁ¤·¤Æ¤¯¤À¤µ¤¤ */ | |
X-#define UseInet6 0 /* requires newer IPv6 implementation */ | |
X+#define UseInet6 1 /* requires newer IPv6 implementation */ | |
X | |
X /* 3.2·Ï¤«¤é3.6·Ï¤Þ¤Ç¤Î·Á¼°¤Î¼½ñ¤òºî¤ë¾ì¹ç¤Ï¤³¤ì¤òÄêµÁ¤·¤Æ¤¯¤À¤µ¤¤ */ | |
X /* #define DIC_3_6_COMPAT */ | |
X@@ -169,8 +169,8 @@ ErrDir = DefErrDir | |
X #define ModernElfLink NO /* experimental */ | |
X | |
X | |
X-cannaOwner = bin | |
X-cannaGroup = bin | |
X+cannaOwner = ${CANNA_USER} | |
X+cannaGroup = ${CANNA_GROUP} | |
X | |
X #ifdef InstallAsUser | |
X cannaOwnerGroup = | |
X@@ -235,7 +235,7 @@ cannaLight = 1 | |
X * ¥³¥Þ¥ó¥ÉÎà¤ò¥ê¥ó¥¯¤¹¤ë»þ¤Ï¡¢¼¡¤ò YES ¤Ë¤·¤Æ¤¯¤À¤¤¡£ | |
X */ | |
X /* #define UseInstalledLibCanna YES */ | |
X-#define UseInstalledLibCanna NO | |
X+#define UseInstalledLibCanna YES | |
X | |
X DicDir = $(cannaLibDir)/dic | |
X | |
X@@ -279,9 +279,9 @@ DicDir = $(cannaLibDir)/dic | |
X | |
X #if UseInstalledLibCanna | |
X DEPCANNALIB = $(libCannaDir)/CannaDepLibraryName(canna) | |
X-CANNALIB = -L$(libCannaDir) -lcanna $(DLLIB) | |
X+CANNALIB = -Wl,-rpath,$(libCannaDir) -L$(libCannaDir) -lcanna $(DLLIB) | |
X DEPCANNALIB16 = $(libCannaDir)/CannaDepLibraryName(canna16) | |
X-CANNALIB16 = -L$(libCannaDir) -lcanna16 $(DLLIB) | |
X+CANNALIB16 = -Wl,-rpath,$(libCannaDir) -L$(libCannaDir) -lcanna16 $(DLLIB) | |
X #else | |
X DEPCANNALIB = $(CANNASRC)/CannaDepLibraryName(canna) | |
X CANNALIB = -L$(CANNASRC) -lcanna $(DLLIB) | |
X@@ -330,7 +330,7 @@ UILIB_DEFINES = $(cannaDsoRevDef) $(CANN | |
X SCRIPTS_DEFINES = $(CANNA_DEFINES) | |
X | |
X #ifdef JAPANESEMAN | |
X-JMNLOCALE = ja | |
X+JMNLOCALE = ja_JP.EUC | |
X #endif | |
X | |
X /* USE_OBSOLETE_STYLE_FILENAME ¤òÄêµÁ¤¹¤ë¤¿¤á¤ÎÄêµÁ */ | |
END-of-inputmethod/canna/patches/patch-Canna.conf | |
echo x - inputmethod/canna/patches/patch-Imakefile | |
sed 's/^X//' >inputmethod/canna/patches/patch-Imakefile << 'END-of-inputmethod/canna/patches/patch-Imakefile' | |
X$NetBSD$ | |
X | |
XExplicitly install man pages. | |
X | |
X--- Imakefile.orig 2004-05-19 15:39:22.000000000 +0000 | |
X+++ Imakefile | |
X@@ -166,7 +166,7 @@ instserver:: | |
X for i in $(SERVERDIR) ;\ | |
X do \ | |
X (cd $$i ; echo "installing" "in $(CURRENT_DIR)/$$i..."; \ | |
X- $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install); \ | |
X+ $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install install.man); \ | |
X done | |
X | |
X instclient:: | |
X@@ -174,7 +174,7 @@ instclient:: | |
X for i in $(CLIENTDIR) ;\ | |
X do \ | |
X (cd $$i ; echo "installing" "in $(CURRENT_DIR)/$$i..."; \ | |
X- $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install); \ | |
X+ $(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install install.man); \ | |
X done | |
X | |
X instsgs:: | |
END-of-inputmethod/canna/patches/patch-Imakefile | |
echo x - inputmethod/canna/patches/patch-canna_widedef.h | |
sed 's/^X//' >inputmethod/canna/patches/patch-canna_widedef.h << 'END-of-inputmethod/canna/patches/patch-canna_widedef.h' | |
X$NetBSD: patch-ae,v 1.1 2005/12/29 15:29:12 joerg Exp $ | |
X | |
XDragonFly wchar_t support. | |
X | |
X--- canna/widedef.h.orig 2003-12-27 17:15:20.000000000 +0000 | |
X+++ canna/widedef.h | |
X@@ -36,7 +36,10 @@ | |
X # include <machine/ansi.h> | |
X #endif | |
X | |
X-#if (defined(__FreeBSD__) && __FreeBSD_version < 500000) \ | |
X+#if defined(__DragonFly__) | |
X+# include <wchar.h> | |
X+# define _WCHAR_T | |
X+#elif (defined(__FreeBSD__) && __FreeBSD_version < 500000) \ | |
X || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__) | |
X # ifdef _BSD_WCHAR_T_ | |
X # undef _BSD_WCHAR_T_ | |
END-of-inputmethod/canna/patches/patch-canna_widedef.h | |
echo x - inputmethod/canna/patches/patch-canuum_Imakefile | |
sed 's/^X//' >inputmethod/canna/patches/patch-canuum_Imakefile << 'END-of-inputmethod/canna/patches/patch-canuum_Imakefile' | |
X$NetBSD$ | |
X | |
XDisable obsolete libspt because openpty(3) is enough for us. | |
X | |
X--- canuum/Imakefile.orig 2004-05-19 15:39:22.000000000 +0000 | |
X+++ canuum/Imakefile | |
X@@ -17,9 +17,16 @@ TERMCAP_LIB = -ltermcap | |
X INSTUGIDFLAGS = | |
X CANNASRC = $(CANNAROOT)/lib/canna16 | |
X DEFINES = -DCANNA -DJAPANESE $(SIGNAL_DEFINES) -DHAVE_CONFIG_H \ | |
X- -DCONFIG_TERMINFO -DUSE_LIBSPT | |
X- INCLUDES = -I$(CANNAROOT)/include -I. `libspt-config --cflags` | |
X-SYS_LIBRARIES = $(TERMCAP_LIB) `libspt-config --libs` | |
X+ -DCONFIG_TERMINFO | |
X+ INCLUDES = -I$(CANNAROOT)/include -I. | |
X+SYS_LIBRARIES = $(TERMCAP_LIB) | |
X+ | |
X+XCOMM XXX required only for openpty(3) | |
X+#if defined(FreeBSDArchitecture) || defined(OpenBSDArchitecture) || \ | |
X+ (defined(LinuxArchitecture) && \ | |
X+ (LinuxCLibMajorVersion == 6) && (LinuxCLibMinorVersion < 1)) | |
X+SYS_LIBRARIES += -lutil | |
X+#endif | |
X | |
X SRCS = header.c printf.c termio.c termcap.c \ | |
X screen.c cursor.c jhlp.c xutoj.c canna.c | |
END-of-inputmethod/canna/patches/patch-canuum_Imakefile | |
echo x - inputmethod/canna/patches/patch-canuum_canna.c | |
sed 's/^X//' >inputmethod/canna/patches/patch-canuum_canna.c << 'END-of-inputmethod/canna/patches/patch-canuum_canna.c' | |
X$NetBSD: patch-an,v 1.2 2011/12/07 16:05:59 roy Exp $ | |
X | |
X- Appease prototype warnings. | |
X- Remove unnecessary ops. | |
X | |
X--- canuum/canna.c.orig 2003-09-17 08:50:52.000000000 +0000 | |
X+++ canuum/canna.c | |
X@@ -52,4 +52,16 @@ static char rcsid[] = "$Id: canna.c,v 1. | |
X #endif | |
X | |
X+#ifdef HAVE_CONFIG_H | |
X+# include <config.h> | |
X+#endif | |
X+ | |
X+#if STDC_HEADERS | |
X+# include <string.h> | |
X+#else | |
X+# if HAVE_STRINGS_H | |
X+# include <strings.h> | |
X+# endif | |
X+#endif /* STDC_HEADERS */ | |
X+ | |
X #include "commonhd.h" | |
X #include "sdefine.h" | |
X@@ -95,6 +107,4 @@ static char rcsid[] = "$Id: canna.c,v 1. | |
X #define NOREDRAW 0 | |
X | |
X-extern int errno; | |
X- | |
X static int maxmodelen; | |
X static int maxwidth = 0; | |
X@@ -1239,8 +1249,6 @@ int flag; | |
X | |
X #ifdef TERMINFO | |
X- int fd, res; | |
X | |
X- fd = open("/dev/null", O_WRONLY, &res); | |
X- setupterm(term, fd, (int *)0); | |
X+ setupterm(term, 0, NULL); | |
X | |
X cannakeyentry(key_f1, CANNA_KEY_F1); | |
X@@ -1271,5 +1279,4 @@ int flag; | |
X #endif | |
X | |
X- resetterm(); | |
X #endif | |
X | |
END-of-inputmethod/canna/patches/patch-canuum_canna.c | |
echo x - inputmethod/canna/patches/patch-canuum_config.h.in | |
sed 's/^X//' >inputmethod/canna/patches/patch-canuum_config.h.in << 'END-of-inputmethod/canna/patches/patch-canuum_config.h.in' | |
X$NetBSD$ | |
X | |
XCheck openpty(3) in libutil. | |
X | |
X--- canuum/config.h.in.orig 2004-05-19 15:48:58.000000000 +0000 | |
X+++ canuum/config.h.in | |
X@@ -83,6 +83,9 @@ | |
X /* Define to 1 if you have the `killpg' function. */ | |
X #undef HAVE_KILLPG | |
X | |
X+/* Define to 1 if you have the <libutil.h> header file. */ | |
X+#undef HAVE_LIBUTIL_H | |
X+ | |
X /* Define to 1 if you have the <malloc.h> header file. */ | |
X #undef HAVE_MALLOC_H | |
X | |
X@@ -98,6 +101,15 @@ | |
X /* Define to 1 if you have the `memset' function. */ | |
X #undef HAVE_MEMSET | |
X | |
X+/* Define to 1 if you have the openpty function. */ | |
X+#undef HAVE_OPENPTY | |
X+ | |
X+/* Define to 1 if you have the posix_openpt function. */ | |
X+#undef HAVE_POSIX_OPENPT | |
X+ | |
X+/* Define to 1 if you have the ptsname function. */ | |
X+#undef HAVE_PTSNAME | |
X+ | |
X /* Define to 1 if you have the <ncurses.h> header file. */ | |
X #undef HAVE_NCURSES_H | |
X | |
X@@ -200,12 +212,18 @@ | |
X /* Define to 1 if you have the <unistd.h> header file. */ | |
X #undef HAVE_UNISTD_H | |
X | |
X+/* Define to 1 if you have the <util.h> header file. */ | |
X+#undef HAVE_UTIL_H | |
X+ | |
X /* Define to 1 if you have the `vsyslog' function. */ | |
X #undef HAVE_VSYSLOG | |
X | |
X /* Define to 1 if you have the `wait3' function. */ | |
X #undef HAVE_WAIT3 | |
X | |
X+/* Define to 1 if you have the util library (-lutil). */ | |
X+#undef HAVE_LIBUTIL | |
X+ | |
X /* Define to the address where bug reports for this package should be sent. */ | |
X #undef PACKAGE_BUGREPORT | |
X | |
END-of-inputmethod/canna/patches/patch-canuum_config.h.in | |
echo x - inputmethod/canna/patches/patch-canuum_configure.in | |
sed 's/^X//' >inputmethod/canna/patches/patch-canuum_configure.in << 'END-of-inputmethod/canna/patches/patch-canuum_configure.in' | |
X$NetBSD$ | |
X | |
XCheck openpty(3) in libutil. | |
X | |
X--- canuum/configure.in.orig 2003-03-24 04:15:22.000000000 +0000 | |
X+++ canuum/configure.in | |
X@@ -378,6 +378,8 @@ AC_CHECK_LIB(socket, connect) | |
X AC_CHECK_LIB(bind, getservbyname) | |
X AC_CHECK_LIB(nsl, gethostbyname) | |
X ])dnl not CANNA | |
X+dnl libutil only needed by uum with openpty... (determine later) | |
X+AC_CHECK_LIB(util, openpty, [HAVE_LIBUTIL='have_libutil']) | |
X | |
X dnl | |
X dnl Checks for header files. | |
X@@ -390,7 +392,7 @@ AC_CHECK_HEADERS(fcntl.h sgtty.h syslog. | |
X sys/file.h sys/ioctl.h sys/time.h sys/types.h sys/param.h \ | |
X malloc.h strings.h memory.h \ | |
X curses.h ncurses.h term.h termio.h \ | |
X- termcap.h sgtty.h sys/termio.h termios.h | |
X+ termcap.h sgtty.h sys/termio.h termios.h libutil.h util.h | |
X ) | |
X dnl If you don't use ansidecl.h, use this (and modify Wnn/jserver/error.c) | |
X dnl AC_CHECK_HEADERS(stdarg.h varargs.h, break) | |
X@@ -508,7 +510,8 @@ dnl AC_FUNC_WAIT3 | |
X AC_CHECK_FUNCS(random drand48 fchmod getopt \ | |
X gethostname select socket closesocket setsockopt send recv \ | |
X FD_SET \ | |
X- getdtablesize getrlimit syslog vsyslog setenv snprintf) | |
X+ getdtablesize getrlimit syslog vsyslog setenv snprintf \ | |
X+ ptsname posix_openpt openpty) | |
X dnl for bcopy/index -> memcpy/strchr conversion (preparation): | |
X AC_CHECK_FUNCS(bcopy bzero bcmp index rindex \ | |
X memcpy memmove memset strchr strrchr) | |
X@@ -520,6 +523,14 @@ AC_CHECK_FUNCS(mkdir vasprintf, , | |
X [JS_SUPPORTOBJS="${JS_SUPPORTOBJS} ${ac_func}.o"]) | |
X AC_SUBST(JS_SUPPORTOBJS) | |
X | |
X+dnl | |
X+dnl File Existence | |
X+dnl Checking file at compile time may bring false result when cross- | |
X+dnl compiling. So, one have to check generated config.h and edit it | |
X+dnl if necessary after running configure. | |
X+dnl | |
X+dnl AC_CHECK_FILE(/dev/ptmx, AC_DEFINE(HAVE_DEV_PTMX, 1, [/dev/ptmx found]),) | |
X+AC_CHECK_FILES(/dev/ptmx,,) | |
X | |
X dnl | |
X dnl Creating Makefiles. | |
END-of-inputmethod/canna/patches/patch-canuum_configure.in | |
echo x - inputmethod/canna/patches/patch-canuum_configure | |
sed 's/^X//' >inputmethod/canna/patches/patch-canuum_configure << 'END-of-inputmethod/canna/patches/patch-canuum_configure' | |
X$NetBSD$ | |
X | |
XCheck openpty(3) in libutil. | |
X | |
X--- canuum/configure.orig 2004-05-19 15:48:55.000000000 +0000 | |
X+++ canuum/configure | |
X@@ -1001,6 +1001,46 @@ fi | |
X | |
X | |
X | |
X+echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6 | |
X+echo "configure:1006: checking for openpty in -lutil" >&5 | |
X+ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'` | |
X+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then | |
X+ echo $ac_n "(cached) $ac_c" 1>&6 | |
X+else | |
X+ ac_save_LIBS="$LIBS" | |
X+LIBS="-lutil $LIBS" | |
X+cat > conftest.$ac_ext <<EOF | |
X+#line 1014 "configure" | |
X+#include "confdefs.h" | |
X+/* Override any gcc2 internal prototype to avoid an error. */ | |
X+/* We use char because int might match the return type of a gcc2 | |
X+ builtin and then its argument prototype would still apply. */ | |
X+char openpty(); | |
X+ | |
X+int main() { | |
X+openpty() | |
X+; return 0; } | |
X+EOF | |
X+if { (eval echo configure:1025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then | |
X+ rm -rf conftest* | |
X+ eval "ac_cv_lib_$ac_lib_var=yes" | |
X+else | |
X+ echo "configure: failed program was:" >&5 | |
X+ cat conftest.$ac_ext >&5 | |
X+ rm -rf conftest* | |
X+ eval "ac_cv_lib_$ac_lib_var=no" | |
X+fi | |
X+rm -f conftest* | |
X+LIBS="$ac_save_LIBS" | |
X+ | |
X+fi | |
X+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then | |
X+ echo "$ac_t""yes" 1>&6 | |
X+ HAVE_LIBUTIL='have_libutil' | |
X+else | |
X+ echo "$ac_t""no" 1>&6 | |
X+fi | |
X+ | |
X | |
X # If we find X, set shell vars x_includes and x_libraries to the | |
X # paths, otherwise set no_x=yes. | |
X@@ -1421,7 +1461,7 @@ for ac_hdr in fcntl.h sgtty.h syslog.h u | |
X sys/file.h sys/ioctl.h sys/time.h sys/types.h sys/param.h \ | |
X malloc.h strings.h memory.h \ | |
X curses.h ncurses.h term.h termio.h \ | |
X- termcap.h sgtty.h sys/termio.h termios.h | |
X+ termcap.h sgtty.h sys/termio.h termios.h libutil.h util.h | |
X | |
X do | |
X ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` | |
X@@ -2079,10 +2119,11 @@ fi | |
X for ac_func in random drand48 fchmod getopt \ | |
X gethostname select socket closesocket setsockopt send recv \ | |
X FD_SET \ | |
X- getdtablesize getrlimit syslog vsyslog setenv snprintf | |
X+ getdtablesize getrlimit syslog vsyslog setenv snprintf \ | |
X+ ptsname posix_openpt openpty | |
X do | |
X echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 | |
X-echo "configure:2086: checking for $ac_func" >&5 | |
X+echo "configure:2127: checking for $ac_func" >&5 | |
X if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then | |
X echo $ac_n "(cached) $ac_c" 1>&6 | |
X else | |
END-of-inputmethod/canna/patches/patch-canuum_configure | |
echo x - inputmethod/canna/patches/patch-canuum_jhlp.c | |
sed 's/^X//' >inputmethod/canna/patches/patch-canuum_jhlp.c << 'END-of-inputmethod/canna/patches/patch-canuum_jhlp.c' | |
X$NetBSD$ | |
X | |
X--- canuum/jhlp.c.orig 2004-04-26 21:48:37.000000000 +0000 | |
X+++ canuum/jhlp.c | |
X@@ -11,9 +11,11 @@ | |
X * 1987, 1988, 1989, 1990, 1991, 1992 | |
X * Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999 | |
X * Copyright ASTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992 | |
X- * Copyright FreeWnn Project 1999, 2000, 2002 | |
X+ * Copyright FreeWnn Project 1999, 2000, 2002, 2003, 2006, 2009, 2013 | |
X+ * Copyright Canna Project 2002 | |
X+ * Copyright Taketo Kabe 2003 | |
X * | |
X- * Maintainer: FreeWnn Project <freewnn@tomo.gr.jp> | |
X+ * Maintainer: FreeWnn Project | |
X * | |
X * This program is free software; you can redistribute it and/or modify | |
X * it under the terms of the GNU General Public License as published by | |
X@@ -31,7 +33,7 @@ | |
X */ | |
X | |
X #ifndef lint | |
X-static char *rcs_id = "jhlp.c,v 1.13 2002/08/26 09:27:21 aono Exp"; | |
X+static char *rcs_id = "jhlp.c,v 1.26 2013/09/02 11:01:40 itisango Exp"; | |
X #endif /* lint */ | |
X | |
X #ifdef HAVE_CONFIG_H | |
X@@ -39,6 +41,7 @@ static char *rcs_id = "jhlp.c,v 1.13 200 | |
X #endif | |
X | |
X #include <stdio.h> | |
X+#include <sys/types.h> | |
X #include <setjmp.h> | |
X #include <signal.h> | |
X #if STDC_HEADERS | |
X@@ -54,12 +57,20 @@ static char *rcs_id = "jhlp.c,v 1.13 200 | |
X #endif /* STDC_HEADERS */ | |
X #include <errno.h> | |
X #include <sys/ioctl.h> | |
X+#include <sys/stat.h> | |
X #ifdef HAVE_SYS_PARAM_H | |
X # include <sys/param.h> | |
X #endif | |
X-#include <sys/stat.h> | |
X-#include <sys/time.h> | |
X-#include <sys/types.h> | |
X+#if TIME_WITH_SYS_TIME | |
X+# include <sys/time.h> | |
X+# include <time.h> | |
X+#else | |
X+# if HAVE_SYS_TIME_H | |
X+# include <sys/time.h> | |
X+# else | |
X+# include <time.h> | |
X+# endif /* HAVE_SYS_TIME_H */ | |
X+#endif /* TIME_WITH_SYS_TIME */ | |
X #if HAVE_FCNTL_H | |
X # include <fcntl.h> | |
X #endif | |
X@@ -67,56 +78,68 @@ static char *rcs_id = "jhlp.c,v 1.13 200 | |
X #ifdef HAVE_UNISTD_H | |
X # include <unistd.h> | |
X #endif | |
X+#if HAVE_SYS_WAIT_H | |
X+# include <sys/wait.h> | |
X+#endif | |
X+#ifdef HAVE_LIBUTIL_H | |
X+# include <libutil.h> | |
X+#endif | |
X+#ifdef HAVE_UTIL_H | |
X+#include <util.h> | |
X+#endif | |
X #ifdef UX386 | |
X #include <sys/kdef.h> | |
X #endif | |
X | |
X-#include "commonhd.h" | |
X-#include "sdefine.h" | |
X-#include "sheader.h" | |
X-#include "wnn_config.h" | |
X-#include "wnn_os.h" | |
X- | |
X- | |
X-jmp_buf kk_env; | |
X- | |
X- | |
X-#ifdef HAVE_WAIT3 | |
X-# include <sys/wait.h> | |
X-#endif /* HAVE_WAIT3 */ | |
X- | |
X-#ifdef USE_LIBSPT | |
X-# include <libspt.h> | |
X+/* Solaris 2.x needs termio.h , so include both. */ | |
X+#if HAVE_TERMIOS_H | |
X+# include <termios.h> | |
X+#endif | |
X+#if HAVE_TERMIO_H | |
X+# include <termio.h> | |
X #endif | |
X | |
X #if defined(HAVE_TERMIOS_H) | |
X-# include <termios.h> | |
X-# define USE_TERMIOS | |
X+/* # include <termios.h> */ | |
X+# define USE_TERMIOS 1 | |
X #elif defined(HAVE_TERMIO_H) | |
X-# include <termio.h> | |
X-# define USE_TERMIO | |
X+/* # include <termio.h> */ | |
X+# define USE_TERMIO 1 | |
X #elif defined(HAVE_SYS_TERMIO_H) | |
X-# include <sys/termio.h> | |
X-# define USE_TERMIO | |
X+# include <sys/termio.h> | |
X+# define USE_TERMIO 1 | |
X #elif defined(HAVE_SGTTY_H) | |
X-# include <sgtty.h> | |
X-# define USE_SGTTY | |
X+# include <sgtty.h> | |
X+# define USE_SGTTY | |
X #else | |
X-# error "No termio header." | |
X-#endif | |
X+# error "No termio header." | |
X+#endif /* HAVE_TERMIOS_H */ | |
X | |
X-#ifdef linux | |
X-/* # define USE_LINUX_TERM */ | |
X+#ifdef USE_LIBSPT | |
X+# include <libspt.h> | |
X #endif | |
X | |
X+/* | |
X+ * Enable old Linux specific code. | |
X+ * We hope you don't have to use this #define ... | |
X+ * (We will remove this #define and related code in near future.) | |
X+ */ | |
X+/* #define USE_LINUX_TERM */ | |
X+ | |
X+ | |
X+#include "sdefine.h" | |
X+ | |
X+#include "commonhd.h" | |
X+#include "sheader.h" | |
X+#include "wnn_config.h" | |
X+#include "wnn_os.h" | |
X+ | |
X #ifdef nec_ews_svr2 | |
X-#include <sys/jtermio.h> | |
X+# include <sys/jtermio.h> | |
X #endif /* nec_ews_svr2 */ | |
X- | |
X #if defined(uniosu) | |
X # include <sys/pty.h> | |
X #endif /* defined(uniosu) */ | |
X- | |
X #ifdef SVR4 | |
X #include <sys/stropts.h> | |
X #include <sys/euc.h> | |
X@@ -132,11 +155,12 @@ jmp_buf kk_env; | |
X | |
X #define ERROR -1 | |
X | |
X+jmp_buf kk_env; | |
X #ifdef TIOCSSIZE | |
X struct ttysize pty_rowcol; | |
X #endif /* TIOCSSIZE */ | |
X | |
X-int ttyfd; | |
X+int ttyfd; /* master tty */ | |
X | |
X char *tname; /* terminal name */ | |
X char *cmdnm = "csh"; /* char *cmdnm = "csh"; */ | |
X@@ -145,28 +169,33 @@ int child_id; | |
X char *prog; | |
X #ifdef USE_LIBSPT | |
X spt_handle *spth = NULL; | |
X-int need_utmp_clear = 0; | |
X #endif | |
X+int need_utmp_clear = 0; | |
X | |
X-extern char *optarg; | |
X-extern int optind; | |
X- | |
X-extern char *ttyname (); | |
X- | |
X-static void save_signals (); | |
X-static void restore_signals (); | |
X- | |
X-static RETSIGTYPE terminate_handler (); | |
X-static void do_end (), open_pty (), open_ttyp (), do_main (), exec_cmd (), parse_options (), setsize (), get_rubout (), usage (), change_size (), default_usage (); | |
X-static void j_term_save (), j_term_restore (), j_term_p_init (int); | |
X+static void save_signals (void); | |
X+static void restore_signals (void); | |
X+static RETSIGTYPE terminate_handler (int); | |
X+static void do_end (void); | |
X+static void open_pty (void); | |
X+static void open_pty_traditional (void); | |
X+static void open_ttyp (void); | |
X+static void do_main (void); | |
X+static void exec_cmd (char **); | |
X+static void parse_options (int, char **); | |
X+static void setsize (void); | |
X+static void get_rubout (void); | |
X+static void usage (char *); | |
X+static void change_size (void); | |
X+static void default_usage (void); | |
X+static void j_term_save (void); | |
X+static void j_term_restore (void); | |
X+static void j_term_p_init (int); | |
X+static unsigned char keyin0 (void); | |
X+static void uum_err (char *); | |
X | |
X-/** ¥á¥¤¥ó */ | |
X int | |
X-main (argc, argv) | |
X- int argc; | |
X- char **argv; | |
X+main (int argc, char **argv) | |
X { | |
X- | |
X char *name; | |
X char *p; | |
X char nlspath[64]; | |
X@@ -174,7 +203,7 @@ main (argc, argv) | |
X char *server_env; | |
X char errprefix[1024] = "error"; | |
X int i; | |
X- extern char *get_server_env (); | |
X+ extern char *get_server_env (char *); | |
X | |
X prog = argv[0]; | |
X flow_control = FLOW_CONTROL; | |
X@@ -344,7 +373,7 @@ main (argc, argv) | |
X } | |
X | |
X j_term_save (); | |
X- /* do_end() is allowed after here */ | |
X+ /* do_end () is allowed from here */ | |
X save_signals (); | |
X | |
X #ifdef TERMCAP | |
X@@ -377,6 +406,9 @@ main (argc, argv) | |
X | |
X ttyfd = 0; | |
X open_pty (); | |
X+/* It is normal to open tty here, before fork(). | |
X+ Don't know why linux is different. | |
X+ So temporally comment it out to make it as other OSes. */ | |
X #ifndef USE_LINUX_TERM | |
X open_ttyp (); | |
X #endif | |
X@@ -387,7 +419,7 @@ main (argc, argv) | |
X switch (init_uum ()) | |
X { /* initialize of kana-kanji henkan */ | |
X case -1: | |
X- terminate_handler (); | |
X+ terminate_handler (-1); | |
X break; | |
X case -2: | |
X epilogue (); | |
X@@ -399,7 +431,7 @@ main (argc, argv) | |
X | |
X if (j_term_init () == ERROR) | |
X { | |
X- err ("term initialize fault."); | |
X+ uum_err ("term initialize fault."); | |
X } | |
X | |
X #ifndef CANNA | |
X@@ -415,7 +447,7 @@ main (argc, argv) | |
X } | |
X flush (); | |
X } | |
X-#endif /* !CANNA */ | |
X+#endif /* CANNA */ | |
X | |
X puteustring (MSG_GET (1), | |
X /* | |
X@@ -434,6 +466,7 @@ main (argc, argv) | |
X #endif /* defined(uniosu) */ | |
X | |
X do_main (); | |
X+ return 0; | |
X } | |
X | |
X /* | |
X@@ -441,7 +474,7 @@ main (argc, argv) | |
X */ | |
X | |
X static int | |
X-do_h_opt () | |
X+do_h_opt (void) | |
X { | |
X henkan_off_flag = 1; | |
X defined_by_option |= OPT_WAKING_UP_MODE; | |
X@@ -449,7 +482,7 @@ do_h_opt () | |
X } | |
X | |
X static int | |
X-do_H_opt () | |
X+do_H_opt (void) | |
X { | |
X henkan_off_flag = 0; | |
X defined_by_option |= OPT_WAKING_UP_MODE; | |
X@@ -458,42 +491,42 @@ do_H_opt () | |
X | |
X #ifdef JAPANESE | |
X int | |
X-do_u_opt () | |
X+do_u_opt (void) | |
X { | |
X pty_c_flag = J_EUJIS; | |
X return 0; | |
X } | |
X | |
X int | |
X-do_j_opt () | |
X+do_j_opt (void) | |
X { | |
X pty_c_flag = J_JIS; | |
X return 0; | |
X } | |
X | |
X int | |
X-do_s_opt () | |
X+do_s_opt (void) | |
X { | |
X pty_c_flag = J_SJIS; | |
X return 0; | |
X } | |
X | |
X int | |
X-do_U_opt () | |
X+do_U_opt (void) | |
X { | |
X tty_c_flag = J_EUJIS; | |
X return 0; | |
X } | |
X | |
X int | |
X-do_J_opt () | |
X+do_J_opt (void) | |
X { | |
X tty_c_flag = J_JIS; | |
X return 0; | |
X } | |
X | |
X int | |
X-do_S_opt () | |
X+do_S_opt (void) | |
X { | |
X tty_c_flag = J_SJIS; | |
X return 0; | |
X@@ -502,28 +535,28 @@ do_S_opt () | |
X | |
X #ifdef CHINESE | |
X int | |
X-do_b_opt () | |
X+do_b_opt (void) | |
X { | |
X pty_c_flag = C_BIG5; | |
X return 0; | |
X } | |
X | |
X int | |
X-do_t_opt () | |
X+do_t_opt (void) | |
X { | |
X pty_c_flag = C_ECNS11643; | |
X return 0; | |
X } | |
X | |
X int | |
X-do_B_opt () | |
X+do_B_opt (void) | |
X { | |
X tty_c_flag = C_BIG5; | |
X return 0; | |
X } | |
X | |
X int | |
X-do_T_opt () | |
X+do_T_opt (void) | |
X { | |
X tty_c_flag = C_ECNS11643; | |
X return 0; | |
X@@ -532,14 +565,14 @@ do_T_opt () | |
X | |
X #ifdef KOREAN | |
X int | |
X-do_u_opt () | |
X+do_u_opt (void) | |
X { | |
X pty_c_flag = K_EUKSC; | |
X return 0; | |
X } | |
X | |
X int | |
X-do_U_opt () | |
X+do_U_opt (void) | |
X { | |
X tty_c_flag = K_EUKSC; | |
X return 0; | |
X@@ -547,14 +580,14 @@ do_U_opt () | |
X #endif /* KOREAN */ | |
X | |
X static int | |
X-do_P_opt () | |
X+do_P_opt (void) | |
X { | |
X sleep (20); | |
X return 0; | |
X } | |
X | |
X static int | |
X-do_x_opt () | |
X+do_x_opt (void) | |
X { | |
X flow_control = 0; | |
X defined_by_option |= OPT_FLOW_CTRL; | |
X@@ -562,7 +595,7 @@ do_x_opt () | |
X } | |
X | |
X static int | |
X-do_X_opt () | |
X+do_X_opt (void) | |
X { | |
X flow_control = 1; | |
X defined_by_option |= OPT_FLOW_CTRL; | |
X@@ -570,7 +603,7 @@ do_X_opt () | |
X } | |
X | |
X static int | |
X-do_k_opt () | |
X+do_k_opt (void) | |
X { | |
X strncpy(uumkey_name_in_uumrc, optarg, PATHNAMELEN-1); | |
X uumkey_name_in_uumrc[PATHNAMELEN-1] = '\0'; | |
X@@ -583,7 +616,7 @@ do_k_opt () | |
X } | |
X | |
X static int | |
X-do_c_opt () | |
X+do_c_opt (void) | |
X { | |
X strncpy(convkey_name_in_uumrc, optarg, PATHNAMELEN-1); | |
X convkey_name_in_uumrc[PATHNAMELEN-1] = '\0'; | |
X@@ -596,7 +629,7 @@ do_c_opt () | |
X } | |
X | |
X static int | |
X-do_r_opt () | |
X+do_r_opt (void) | |
X { | |
X strncpy(rkfile_name_in_uumrc, optarg, PATHNAMELEN-1); | |
X rkfile_name_in_uumrc[PATHNAMELEN-1] = '\0'; | |
X@@ -609,14 +642,14 @@ do_r_opt () | |
X } | |
X | |
X static int | |
X-do_l_opt () | |
X+do_l_opt (void) | |
X { | |
X conv_lines = atoi (optarg); | |
X return 0; | |
X } | |
X | |
X static int | |
X-do_D_opt () | |
X+do_D_opt (void) | |
X { | |
X strncpy(def_servername, optarg, PATHNAMELEN-1); | |
X def_servername[PATHNAMELEN-1] = '\0'; | |
X@@ -629,7 +662,7 @@ do_D_opt () | |
X } | |
X | |
X static int | |
X-do_n_opt () | |
X+do_n_opt (void) | |
X { | |
X strncpy(username, optarg, PATHNAMELEN-1); | |
X username[PATHNAMELEN-1] = '\0'; | |
X@@ -641,13 +674,13 @@ do_n_opt () | |
X } | |
X | |
X static int | |
X-do_v_opt () | |
X+do_v_opt (void) | |
X { | |
X defined_by_option |= OPT_VERBOSE; | |
X return 0; | |
X } | |
X | |
X-static int (*do_opt[]) () = | |
X+static int (*do_opt[]) (void) = | |
X { | |
X do_h_opt, /* 'h' : waking_up_in_henkan_mode */ | |
X do_H_opt, /* 'H' : waking_up_no_henkan_mode */ | |
X@@ -693,43 +726,31 @@ parse_options (argc, argv) | |
X /** tty ¤ËÂФ¹¤ë ioctl ¤Î¥»¥Ã¥È */ | |
X | |
X #ifdef USE_SGTTY | |
X-#if defined(BSD43) || defined(DGUX) /* should be "defined(LPASS8)"? */ | |
X-# define SET_PASS8 | |
X-#endif | |
X+# if defined(BSD43) || defined(DGUX) /* should be "defined(LPASS8)"? */ | |
X+# define SET_PASS8 1 | |
X+# endif | |
X+ | |
X struct sgttyb savetmio; | |
X-struct sgttyb ttyb_def = | |
X-{ B9600, B9600, 0x7f, 0x15, EVENP | ODDP | ECHO | CRMOD }; | |
X+struct sgttyb ttyb_def = { B9600, B9600, 0x7f, 0x15, | |
X+ EVENP | ODDP | ECHO | CRMOD }; | |
X int local_mode_def = LCRTBS | LCRTERA | LCRTKIL | LCTLECH | LPENDIN | LDECCTQ; | |
X- | |
X /* added later */ | |
X struct tchars tcharsv; | |
X struct ltchars ltcharsv; | |
X struct sgttyb ttyb; | |
X int local_mode; | |
X-#ifdef SET_PASS8 | |
X+# ifdef SET_PASS8 | |
X static int local_mode_sv; | |
X-#endif | |
X- | |
X+# endif | |
X | |
X static void | |
X-get_rubout () | |
X+get_rubout (void) | |
X { | |
X-#ifdef nodef | |
X- if (savetmio.sg_erase == UNDEF_STTY) | |
X- { | |
X- rubout_code = RUBOUT; | |
X- } | |
X- else | |
X- { | |
X-#endif | |
X- rubout_code = savetmio.sg_erase; | |
X-#ifdef nodef | |
X- } | |
X-#endif | |
X+ rubout_code = savetmio.sg_erase; | |
X } | |
X | |
X int | |
X-j_term_init () | |
X+j_term_init (void) | |
X { | |
X struct sgttyb buf; | |
X | |
X@@ -737,43 +758,42 @@ j_term_init () | |
X buf.sg_flags |= RAW; | |
X buf.sg_flags &= ~ECHO; | |
X ioctl (ttyfd, TIOCSETP, &buf); | |
X-#ifdef SET_PASS8 | |
X+# ifdef SET_PASS8 | |
X ioctl (ttyfd, TIOCLSET, &local_mode); | |
X-#endif | |
X+# endif | |
X | |
X return 0; | |
X } | |
X | |
X static void | |
X-j_term_save () | |
X+j_term_save (void) | |
X { | |
X ioctl (ttyfd, TIOCGETC, &tcharsv); | |
X ioctl (ttyfd, TIOCGLTC, <charsv); | |
X if (ioctl (ttyfd, TIOCGETP, &ttyb)) | |
X ttyb = ttyb_def; | |
X savetmio = ttyb; | |
X-#ifdef SET_PASS8 | |
X+# ifdef SET_PASS8 | |
X if (ioctl (ttyfd, TIOCLGET, &local_mode_sv)) | |
X local_mode_sv = local_mode_def; | |
X- local_mode = local_mode_sv | LPASS8; /* set PASS8 */ | |
X-#else /* !SET_PASS8 */ | |
X+ local_mode = local_mode_sv | LPASS8; /* set PASS8 */ | |
X+# else /* !SET_PASS8 */ | |
X if (ioctl (ttyfd, TIOCLGET, &local_mode)) | |
X local_mode = local_mode_def; | |
X-#endif /* !SET_PASS8 */ | |
X+# endif /* !SET_PASS8 */ | |
X } | |
X | |
X static void | |
X-j_term_restore () | |
X+j_term_restore (void) | |
X { | |
X ioctl (ttyfd, TIOCSETP, &savetmio); | |
X-#ifdef SET_PASS8 | |
X+# ifdef SET_PASS8 | |
X ioctl (ttyfd, TIOCLSET, &local_mode_sv); | |
X-#endif /* SET_PASS8 */ | |
X+# endif /* SET_PASS8 */ | |
X } | |
X | |
X static void | |
X-j_term_p_init (ttypfd) | |
X- int ttypfd; | |
X+j_term_p_init (int ttypfd) | |
X { | |
X int word; | |
X ioctl (ttypfd, TIOCSETC, &tcharsv); | |
X@@ -791,35 +811,33 @@ j_term_p_init (ttypfd) | |
X #if defined(USE_TERMIO) || defined(USE_TERMIOS) | |
X | |
X #ifdef USE_TERMIOS | |
X-# define TERMIO termios | |
X-# define GET_TERMATTR(fd, tio) tcgetattr(fd, tio) | |
X-# define SET_TERMATTR(fd, tio) tcsetattr(fd, TCSADRAIN, tio) | |
X-# define UNDEF_STTY _POSIX_VDISABLE | |
X-# define SET_ATTR_ERROR "error in tcsetattr.\n" | |
X-#else | |
X-# define TERMIO termio | |
X-# define GET_TERMATTR(fd, tio) ioctl(fd, TCGETA, tio) | |
X-# ifdef TCSETAW | |
X-# define SET_TERMATTR(fd, tio) ioctl(fd, TCSETAW, tio) | |
X-# else | |
X-# define SET_TERMATTR(fd, tio) ioctl(fd, TCSETA, tio) | |
X-# endif | |
X-# define UNDEF_STTY 0xff | |
X-# define SET_ATTR_ERROR "error in ioctl TCSETA.\n" | |
X-#endif | |
X+# define TERMIO termios | |
X+# define GET_TERMATTR(fd, tio) tcgetattr(fd, tio) | |
X+# define SET_TERMATTR(fd, tio) tcsetattr(fd, TCSADRAIN, tio) | |
X+# define UNDEF_STTY _POSIX_VDISABLE | |
X+# define SET_ATTR_ERROR "error in tcsetattr.\n" | |
X+#else /* !USE_TERMIOS */ | |
X+# define TERMIO termio | |
X+# define GET_TERMATTR(fd, tio) ioctl(fd, TCGETA, tio) | |
X+# ifdef TCSETAW | |
X+# define SET_TERMATTR(fd, tio) ioctl(fd, TCSETAW, tio) | |
X+# define SET_ATTR_ERROR "error in ioctl TCSETAW.\n" | |
X+# else | |
X+# define SET_TERMATTR(fd, tio) ioctl(fd, TCSETA, tio) | |
X+# define SET_ATTR_ERROR "error in ioctl TCSETA.\n" | |
X+# endif | |
X+# define UNDEF_STTY 0xff | |
X+#endif /* !USE_TERMIOS */ | |
X #ifdef CERASE | |
X-# define WNN_CERASE CERASE | |
X-#elif defined(CDEL) | |
X-# define WNN_CERASE CDEL | |
X+# define WNN_CERASE CERASE | |
X #else | |
X-# define WNN_CERASE 0x7f | |
X+# define WNN_CERASE 0x7f | |
X #endif | |
X | |
X struct TERMIO savetmio; | |
X | |
X static void | |
X-set_default_termio (terms) | |
X- struct TERMIO *terms; | |
X+set_default_termio (struct TERMIO *terms) | |
X { | |
X bzero (terms, sizeof *terms); | |
X terms->c_iflag = IGNBRK | ICRNL | IXON; | |
X@@ -839,12 +857,12 @@ set_default_termio (terms) | |
X terms->c_cc[VKILL] = 0x15; | |
X terms->c_cc[VEOF] = 0x4; | |
X terms->c_cc[VEOL] = _POSIX_VDISABLE; | |
X-#ifdef VEOL2 | |
X+# ifdef VEOL2 | |
X terms->c_cc[VEOL2] = _POSIX_VDISABLE; | |
X-#endif | |
X+# endif | |
X cfsetospeed (terms, B9600); | |
X cfsetispeed (terms, B9600); | |
X-#else | |
X+#else /* !USE_TERMIOS */ | |
X terms->c_line = 0; | |
X terms->c_cc[0] = 0x3; | |
X terms->c_cc[1] = 0x1c; | |
X@@ -854,7 +872,7 @@ set_default_termio (terms) | |
X terms->c_cc[5] = 0; | |
X terms->c_cc[6] = 0; | |
X terms->c_cc[7] = 0; | |
X-#endif | |
X+#endif /* !USE_TERMIOS */ | |
X } | |
X | |
X #if defined(uniosu) | |
X@@ -866,7 +884,7 @@ struct auxtermio auxterm = { | |
X #endif /* defined(uniosu) */ | |
X | |
X static void | |
X-get_rubout () | |
X+get_rubout (void) | |
X { | |
X if (savetmio.c_cc[VERASE] == UNDEF_STTY) | |
X { | |
X@@ -879,7 +897,7 @@ get_rubout () | |
X } | |
X | |
X int | |
X-j_term_init () | |
X+j_term_init (void) | |
X { | |
X struct TERMIO buf1; | |
X #if defined(uniosu) | |
X@@ -887,33 +905,37 @@ j_term_init () | |
X #endif /* defined(uniosu) */ | |
X | |
X buf1 = savetmio; | |
X-#ifdef USE_LINUX_TERM | |
X+#ifdef linux | |
X buf1.c_lflag &= ~(ECHONL | ECHOK | ECHOE | ECHO | XCASE | ICANON | ISIG); | |
X buf1.c_iflag = 0; | |
X buf1.c_oflag &= ~OPOST; | |
X buf1.c_cflag |= CS8; | |
X buf1.c_cc[VMIN] = 1; /* cf. ICANON */ | |
X buf1.c_cc[VTIME] = 0; | |
X-#else /* !USE_LINUX_TERM */ | |
X+ buf1.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IUCLC | IXON); | |
X+#else /* !linux */ | |
X buf1.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON); | |
X-#ifdef IUCLC | |
X- buf1.c_iflag &= IUCLC; | |
X-#endif | |
X+# ifdef IUCLC | |
X+ buf1.c_iflag &= ~(IUCLC); | |
X+# endif | |
X if (flow_control) | |
X { | |
X buf1.c_iflag |= IXON; | |
X } | |
X buf1.c_lflag &= ~(ECHONL | ECHOK | ECHOE | ECHO | ICANON | ISIG); | |
X-#ifdef XCASE | |
X- buf1.c_lflag &= XCASE; | |
X-#endif | |
X+# ifdef XCASE | |
X+ buf1.c_lflag &= ~(XCASE); | |
X+# endif | |
X+# ifdef IEXTEN | |
X+ buf1.c_lflag &= ~(IEXTEN); | |
X+# endif | |
X buf1.c_oflag = OPOST; | |
X-#ifdef USE_TERMIOS | |
X- buf1.c_cc[VMIN] = 1; /* cf. ICANON */ | |
X+# ifdef USE_TERMIOS | |
X+ buf1.c_cc[VMIN] = 1; | |
X buf1.c_cc[VTIME] = 0; | |
X cfsetispeed(&buf1, cfgetispeed(&savetmio)); | |
X cfsetospeed(&buf1, cfgetospeed(&savetmio)); | |
X-#else /* !USE_TERMIOS */ | |
X+# else /* !USE_TERMIOS */ | |
X buf1.c_cc[VEOF] = 1; /* cf. ICANON */ | |
X buf1.c_cc[VEOL] = 0; | |
X /* not needed? cf.ISIG*/ | |
X@@ -921,8 +943,8 @@ j_term_init () | |
X buf1.c_cc[VQUIT] = WNN_CERASE; | |
X buf1.c_cc[VERASE] = WNN_CERASE; | |
X buf1.c_cc[VKILL] = WNN_CERASE; | |
X-#endif /* !USE_TERMIOS */ | |
X-#endif /* !USE_LINUX_TERM */ | |
X+# endif /* !USE_TERMIOS */ | |
X+#endif /* !linux */ | |
X if (SET_TERMATTR (ttyfd, &buf1) < 0) | |
X { | |
X fprintf (stderr, SET_ATTR_ERROR); | |
X@@ -979,12 +1001,12 @@ j_term_init () | |
X } | |
X | |
X static void | |
X-j_term_save () | |
X+j_term_save (void) | |
X { | |
X if (GET_TERMATTR (ttyfd, &savetmio) < 0) | |
X- { | |
X- set_default_termio (&savetmio); | |
X- } | |
X+ { | |
X+ set_default_termio (&savetmio); | |
X+ } | |
X #if defined(uniosu) | |
X if (ioctl (ttyfd, JTERMGET, &savejtmio) < 0) | |
X { | |
X@@ -995,7 +1017,7 @@ j_term_save () | |
X } | |
X | |
X static void | |
X-j_term_restore () | |
X+j_term_restore (void) | |
X { | |
X if (SET_TERMATTR (ttyfd, &savetmio) < 0) | |
X { | |
X@@ -1013,8 +1035,7 @@ j_term_restore () | |
X } | |
X | |
X static void | |
X-j_term_p_init (ttypfd) | |
X- int ttypfd; | |
X+j_term_p_init (int ttypfd) | |
X { | |
X struct TERMIO buf1; | |
X #if defined(uniosu) | |
X@@ -1094,20 +1115,18 @@ j_term_p_init (ttypfd) | |
X #endif /* USE_TERMIO || USE_TERMIOS */ | |
X | |
X /** signal SIGCHLD ¤ò¼õ¤±¤¿¸å¤Î½èÍý¤ò¤¹¤ë¡£*/ | |
X-/* *INDENT-OFF* */ | |
X RETSIGTYPE | |
X-chld_handler () | |
X-/* *INDENT-ON* */ | |
X+chld_handler (int sig) | |
X { | |
X #ifdef HAVE_WAIT3 | |
X-#if !defined(_POSIX_VERSION) && defined(HAVE_UNION_WAIT) /* older way */ | |
X+#if !defined(_POSIX_VERSION) && defined(HAVE_UNION_WAIT) | |
X union wait status; | |
X #else /* POSIX */ | |
X int status; | |
X #endif | |
X int pid; | |
X | |
X- if ((pid = wait3(&status, WNOHANG | WUNTRACED, NULL)) == child_id) | |
X+ if ((pid = wait3 (&status, WNOHANG | WUNTRACED, NULL)) == child_id) | |
X { | |
X if (WIFSTOPPED (status)) | |
X { | |
X@@ -1156,7 +1175,7 @@ chld_handler () | |
X | |
X /** signal SIGTERM ¤ò¼õ¤±¤¿»þ¤Î½èÍý¤ò¤¹¤ë¡£*/ | |
X static RETSIGTYPE | |
X-terminate_handler () | |
X+terminate_handler (int sig) | |
X { | |
X signal (SIGCHLD, SIG_IGN); | |
X epilogue_no_close (); | |
X@@ -1169,10 +1188,8 @@ terminate_handler () | |
X } | |
X | |
X #ifdef SIGWINCH | |
X-/* *INDENT-OFF* */ | |
X RETSIGTYPE | |
X-resize_handler () | |
X-/* *INDENT-ON* */ | |
X+resize_handler (int sig) | |
X { | |
X re_signal (SIGWINCH, resize_handler); | |
X change_size (); | |
X@@ -1187,10 +1204,10 @@ resize_handler () | |
X /** ¥á¥¤¥ó¥ë¡¼¥× */ | |
X | |
X wnn_fd_set sel_ptn; | |
X-int ptyfd = -1; | |
X+int ptyfd; | |
X | |
X static void | |
X-do_main () | |
X+do_main (void) | |
X { | |
X #ifndef CANNA | |
X unsigned char *buf; | |
X@@ -1206,10 +1223,11 @@ do_main () | |
X epilogue (); | |
X do_end (); | |
X } | |
X-#else /* CANNA */ | |
X- extern void canna_mainloop(); | |
X+#else /* CANNA */ | |
X+ extern void canna_mainloop(void); | |
X #endif /* CANNA */ | |
X | |
X+ WNN_FD_ZERO (&sel_ptn); | |
X WNN_FD_SET(ptyfd, &sel_ptn); | |
X WNN_FD_SET(ttyfd, &sel_ptn); | |
X | |
X@@ -1221,23 +1239,19 @@ do_main () | |
X #ifndef CANNA | |
X for (;;) | |
X { | |
X- | |
X ml = kk (); | |
X- | |
X make_history (return_buf, ml); | |
X ml = (*code_trans[(internal_code << 2) | pty_c_flag]) (buf, return_buf, sizeof (w_char) * ml); | |
X if (ml > 0) | |
X write (ptyfd, buf, ml); | |
X } | |
X-#else /* CANNA */ | |
X+#else /* CANNA */ | |
X canna_mainloop(); | |
X #endif /* CANNA */ | |
X } | |
X | |
X-unsigned char keyin0 (); | |
X- | |
X int | |
X-keyin2 () | |
X+keyin2 (void) | |
X { | |
X int total, ret; | |
X unsigned char in; | |
X@@ -1259,15 +1273,14 @@ keyin2 () | |
X | |
X /** convert_key nomi okonau key-in function */ | |
X int | |
X-conv_keyin (inkey) | |
X- char *inkey; | |
X+conv_keyin (char *inkey) | |
X { | |
X return keyin1 (keyin2, inkey); | |
X } | |
X | |
X /** ¥¡¼ÆþÎÏ´Ø¿ô 1 */ | |
X int | |
X-keyin () | |
X+keyin (void) | |
X { | |
X char inkey[16]; | |
X return (conv_keyin (inkey)); | |
X@@ -1280,10 +1293,7 @@ keyin () | |
X */ | |
X | |
X static void | |
X-throughlike(dest, src, n) | |
X-w_char *dest; | |
X-unsigned char *src; | |
X-int n; | |
X+throughlike(w_char *dest, unsigned char *src, int n) | |
X { | |
X while (n-- > 0) { | |
X *dest++ = (w_char)*src++; | |
X@@ -1291,8 +1301,8 @@ int n; | |
X } | |
X | |
X /** ¥¡¼ÆþÎÏ´Ø¿ô 2 */ | |
X-unsigned char | |
X-keyin0 () | |
X+static unsigned char | |
X+keyin0 (void) | |
X { | |
X static unsigned char buf[BUFSIZ]; | |
X static unsigned char outbuf[BUFSIZ]; | |
X@@ -1341,7 +1351,7 @@ keyin0 () | |
X time_out.tv_sec = 0; | |
X time_out.tv_usec = 200 * 1000; /* 200 msec ´ÖÂԤĤΤÀ¥¾! */ | |
X for (rfds = sel_ptn; | |
X-#ifdef USE_LINUX_TERM | |
X+#ifdef linux | |
X (sel_ret = select (20, &rfds, 0, 0, NULL)) < 0 && errno == EINTR; | |
X #else | |
X (sel_ret = select (20, &rfds, 0, 0, &time_out)) < 0 && errno == EINTR; | |
X@@ -1392,7 +1402,8 @@ keyin0 () | |
X p += j; | |
X i -= j; | |
X } | |
X- WNN_FD_SET(ttyfd, &mask); | |
X+ WNN_FD_ZERO (&mask); | |
X+ WNN_FD_SET (ttyfd, &mask); | |
X select (32, 0, &mask, 0, 0); | |
X } | |
X pop_cursor (); | |
X@@ -1439,8 +1450,8 @@ keyin0 () | |
X #if defined(uniosu) | |
X /** pty ¤«¤é ioctl ¤¬¤«¤«¤Ã¤¿»þ¤Î½èÍý */ | |
X int | |
X-arrange_ioctl (jflg) | |
X- int jflg; /* jtermio ¤Î j_flg ¤ÎÊÑ´¹¥Õ¥é¥°¤¬¥ª¥Õ¤Î»þ 0 ¥ª¥ó¤Î»þ 1 */ | |
X+arrange_ioctl (int jflg) | |
X+/* jflg: jtermio ¤Î j_flg ¤ÎÊÑ´¹¥Õ¥é¥°¤¬¥ª¥Õ¤Î»þ 0 ¥ª¥ó¤Î»þ 1 */ | |
X { | |
X struct jtermio jbuf1; | |
X struct TERMIO frombuf; | |
X@@ -1511,11 +1522,10 @@ arrange_ioctl (jflg) | |
X | |
X /** »Ò¥×¥í¥»¥¹¤òµ¯¤³¤¹¡£*/ | |
X | |
X-int ttypfd = -1; | |
X+int ttypfd = -1; /* slave tty */ | |
X | |
X static void | |
X-exec_cmd (argv) | |
X- char **argv; | |
X+exec_cmd (char **argv) | |
X { | |
X int i; | |
X #if defined(USE_LIBSPT) && !defined(USE_LINUX_TERM) | |
X@@ -1525,21 +1535,20 @@ exec_cmd (argv) | |
X #ifdef BSD42 | |
X int pid; | |
X #endif | |
X-#ifdef USE_LINUX_TERM | |
X+#endif /* (!USE_LIBSPT && !HAVE_SETSID) || USE_LINUX_TERM */ | |
X+#if defined(SIGWINCH) && defined(TIOCSWINSZ) /* || defined(linux) */ | |
X struct winsize win; | |
X- extern Term_RowWidth, crow; | |
X+ extern int Term_RowWidth; | |
X #endif | |
X-#endif /* (!USE_LIBSPT && !HAVE_SETSID) || USE_LINUX_TERM */ | |
X | |
X child_id = fork (); | |
X if (child_id < 0) | |
X- err ("cannot fork."); | |
X+ uum_err ("cannot fork."); | |
X if (!child_id) | |
X { | |
X /* --- start changing controlling tty --- */ | |
X #if defined(USE_LIBSPT) && !defined(USE_LINUX_TERM) | |
X #if defined(SIGWINCH) && defined(TIOCSWINSZ) | |
X- struct winsize win; | |
X if (ioctl (ttyfd, TIOCGWINSZ, &win) == 0) | |
X ioctl (ttypfd, TIOCSWINSZ, &win); | |
X #endif /* SIGWINCH && TIOCSWINSZ */ | |
X@@ -1547,37 +1556,31 @@ exec_cmd (argv) | |
X spth = NULL; | |
X if (spt_detach_ctty () || spt_set_ctty2 (ttypfd)) | |
X { | |
X- err ("cannot change controlling tty."); | |
X+ uum_err ("cannot change controlling tty."); | |
X } | |
X | |
X #elif defined(HAVE_SETSID) && !defined(USE_LINUX_TERM) /* !USE_LIBSPT */ | |
X | |
X int fd; | |
X-#if defined(SIGWINCH) && defined(TIOCSWINSZ) | |
X- struct winsize win; | |
X+# if defined(SIGWINCH) && defined(TIOCSWINSZ) | |
X if (ioctl (ttyfd, TIOCGWINSZ, &win) == 0) | |
X ioctl (ttypfd, TIOCSWINSZ, &win); | |
X-#endif /* SIGWINCH && TIOCSWINSZ */ | |
X+# endif /* SIGWINCH && TIOCSWINSZ */ | |
X setsid (); | |
X-#ifdef TIOCSCTTY | |
X+# ifdef TIOCSCTTY | |
X ioctl (ttypfd, TIOCSCTTY, 0); | |
X-#else | |
X+# else | |
X close (open (ttyname (ttypfd), O_WRONLY, 0)); | |
X-#endif | |
X+# endif | |
X if ((fd = open("/dev/tty", O_WRONLY)) < 0) | |
X { | |
X- err ("cannot change controlling tty."); | |
X+ uum_err ("cannot change controlling tty."); | |
X } | |
X close (fd); | |
X /* disable utmp logging for now */ | |
X | |
X #else /* (!USE_LIBSPT && !HAVE_SETSID) || USE_LINUX_TERM */ | |
X | |
X-#if defined(SYSVR2) && !defined(USE_LINUX_TERM) | |
X- setpgrp (); | |
X- close (open (ttyname (ttypfd), O_WRONLY, 0)); | |
X-#endif /* SYSVR2 */ | |
X- | |
X #ifdef BSD42 | |
X #ifdef TIOCNOTTY | |
X /* set notty */ | |
X@@ -1601,18 +1604,28 @@ exec_cmd (argv) | |
X close (open (ttyname (ttypfd), O_WRONLY, 0)); | |
X setpgrp (0, pid); | |
X #endif /* BSD42 */ | |
X+#if defined(SYSVR2) && !defined(linux) | |
X+ setpgrp (); /* should setpgrp() AFTER fork() */ | |
X+ close (open (ttyname (ttypfd), O_WRONLY, 0)); | |
X+#endif /* SYSVR2 */ | |
X | |
X-#ifdef USE_LINUX_TERM | |
X+/* It is bizarre to open tty after fork(). | |
X+ So, try to do same as other os. | |
X+ If it does work, we can remove this. */ | |
X+# ifdef linux | |
X setsid (); | |
X open_ttyp (); | |
X close (ptyfd); | |
X- ioctl (ttyfd, TIOCGWINSZ, &win); | |
X ioctl (ttypfd, TCSETA, &savetmio); | |
X-#endif | |
X+# endif | |
X+# if defined(SIGWINCH) && defined(TIOCSWINSZ) /* || defined(linux) */ | |
X+ ioctl (ttyfd, TIOCGWINSZ, &win); | |
X+# endif | |
X+ | |
X #endif /* (!USE_LIBSPT && !HAVE_SETSID) || USE_LINUX_TERM */ | |
X /* --- finish changing controlling tty --- */ | |
X | |
X-#ifndef USE_LINUX_TERM | |
X+#ifndef linux | |
X setgid (getgid ()); | |
X setuid (getuid ()); | |
X #endif | |
X@@ -1626,7 +1639,7 @@ exec_cmd (argv) | |
X close (2); | |
X if (dup (ttypfd) != 0 || dup (ttypfd) != 1 || dup (ttypfd) != 2) | |
X { | |
X- err ("redirection fault."); | |
X+ uum_err ("redirection fault."); | |
X } | |
X #endif /* !HAVE_DUP2 */ | |
X for (i = WNN_NFD - 1; i > 2; i--) | |
X@@ -1646,15 +1659,18 @@ exec_cmd (argv) | |
X signal (SIGTTOU, SIG_IGN); | |
X #endif | |
X | |
X-#ifdef USE_LINUX_TERM | |
X+#if defined(SIGWINCH) && defined(TIOCSWINSZ) /* || defined(linux) */ | |
X crow = win.ws_row = Term_RowWidth = win.ws_row - conv_lines; | |
X ioctl (ttyfd, TIOCSWINSZ, &win); | |
X+#endif | |
X+#ifdef linux | |
X setgid (getgid ()); | |
X setuid (getuid ()); | |
X #endif | |
X execvp (cmdnm, argv); | |
X- err ("exec fault."); | |
X+ uum_err ("exec fault."); | |
X } | |
X+ | |
X /* parent */ | |
X #ifdef USE_LIBSPT | |
X ttynm = ttyname (0); | |
X@@ -1676,7 +1692,7 @@ exec_cmd (argv) | |
X { | |
X spt_perror ("exec_cmd (login_utmp)", r); | |
X } | |
X-#endif | |
X+#endif /* USE_LIBSPT */ | |
X } | |
X | |
X #if !(HAVE_SETENV) | |
X@@ -1687,10 +1703,7 @@ exec_cmd (argv) | |
X * The 3rd parameter is ignored. It is added for compatibility only. | |
X */ | |
X int | |
X-setenv (var, value, overwrite) | |
X- char *var; | |
X- char *value; | |
X- int overwrite; | |
X+setenv (char *var, char *value, int overwrite) | |
X { | |
X extern char **environ; | |
X char **newenv; | |
X@@ -1730,9 +1743,7 @@ setenv (var, value, overwrite) | |
X | |
X #ifdef SVR4 | |
X static int | |
X-euc_set (eucioc, ttyfd) | |
X- eucioc_t *eucioc; | |
X- int ttyfd; | |
X+euc_set (eucioc_t *eucioc, int ttyfd) | |
X { | |
X struct strioctl sb; | |
X | |
X@@ -1747,9 +1758,8 @@ euc_set (eucioc, ttyfd) | |
X return (0); | |
X } | |
X | |
X-static void | |
X-set_euc_term (ttyfd) | |
X- int ttyfd; | |
X+static int | |
X+set_euc_term (int ttyfd) | |
X { | |
X eucioc_t eucioc; | |
X | |
X@@ -1765,17 +1775,16 @@ set_euc_term (ttyfd) | |
X if (euc_set (&eucioc, ttyfd) != 0) | |
X { | |
X fprintf (stderr, "eucwidth set failed\n"); | |
X- return; | |
X+ return (1); | |
X } | |
X- return; | |
X+ return (0); | |
X } | |
X | |
X #endif /* SVR4 */ | |
X | |
X #ifdef nec_ews_svr2 | |
X static void | |
X-set_jterm (ttyfd, ttypfd) | |
X- int ttyfd, ttypfd; | |
X+set_jterm (int ttyfd, int ttypfd) | |
X { | |
X struct jtermio buf; | |
X | |
X@@ -1796,46 +1805,50 @@ set_jterm (ttyfd, ttypfd) | |
X | |
X #ifdef sony | |
X static void | |
X-set_sony_jterm(ttyfd, ttypfd) | |
X-int ttyfd, ttypfd; | |
X+set_sony_jterm (int ttyfd, int ttypfd) | |
X { | |
X #ifdef TIOCKGET | |
X int tmode, jmode = 0; | |
X struct jtchars jtc; | |
X | |
X- if (ioctl(ttyfd, TIOCKGET, &tmode) < 0) { | |
X- fprintf(stderr, "error in ioctl TIOCKGET.\n"); | |
X- exit(1); | |
X- } | |
X+ if (ioctl(ttyfd, TIOCKGET, &tmode) < 0) | |
X+ { | |
X+ fprintf(stderr, "error in ioctl TIOCKGET.\n"); | |
X+ exit (1); | |
X+ } | |
X jmode = tmode; | |
X tmode &= ~(KM_SYSCODE | KM_TTYPE); | |
X- switch (pty_c_flag) { | |
X- case J_EUJIS: | |
X- tmode |= KM_EUC | KM_SYSEUC; | |
X- break; | |
X- case J_JIS: | |
X- tmode |= KM_ASCII; | |
X- break; | |
X- case J_SJIS: | |
X- tmode |= KM_SJIS | KM_SYSSJIS; | |
X- break; | |
X- } | |
X- if (ioctl(ttypfd, TIOCKSET, &tmode) < 0) { | |
X- fprintf(stderr, "error in ioctl TIOCKSET.\n"); | |
X- exit(1); | |
X- } | |
X+ switch (pty_c_flag) | |
X+ { | |
X+ case J_EUJIS: | |
X+ tmode |= KM_EUC | KM_SYSEUC; | |
X+ break; | |
X+ case J_JIS: | |
X+ tmode |= KM_ASCII; | |
X+ break; | |
X+ case J_SJIS: | |
X+ tmode |= KM_SJIS | KM_SYSSJIS; | |
X+ break; | |
X+ } | |
X+ if (ioctl(ttypfd, TIOCKSET, &tmode) < 0) | |
X+ { | |
X+ fprintf(stderr, "error in ioctl TIOCKSET.\n"); | |
X+ exit (1); | |
X+ } | |
X #endif /* TIOCKGET */ | |
X | |
X #ifdef TIOCKGETC | |
X- if ((jmode & KM_TTYPE) == KM_JIS) { | |
X- ioctl(ttyfd, TIOCKGETC, &jtc); | |
X- jtc.t_ascii = 'B'; | |
X- jtc.t_kanji = 'B'; | |
X- if (ioctl(ttypfd, TIOCKSETC, &jtc) < 0) { | |
X- fprintf(stderr, "error in ioctl TIOCKSETC.\n"); | |
X- exit(1); | |
X+ if ((jmode & KM_TTYPE) == KM_JIS) | |
X+ { | |
X+ ioctl(ttyfd, TIOCKGETC, &jtc); | |
X+ jtc.t_ascii = 'B'; | |
X+ jtc.t_kanji = 'B'; | |
X+ if (ioctl(ttypfd, TIOCKSETC, &jtc) < 0) | |
X+ { | |
X+ fprintf(stderr, "error in ioctl TIOCKSETC.\n"); | |
X+ exit(1); | |
X+ } | |
X } | |
X- } | |
X #endif | |
X } | |
X #endif /* sony */ | |
X@@ -1843,132 +1856,233 @@ int ttyfd, ttypfd; | |
X /** ttyp ¤Î¥ª¡¼¥×¥ó */ | |
X | |
X #ifndef USE_LIBSPT | |
X-#define MAXPTYNO (0x10 * (('z' - 'p' + 1) + ('Z' - 'P' + 1))) | |
X-int ptyno; | |
X-char *ptynm = "/dev/pty"; | |
X-#ifdef sgi | |
X-extern char *_getpty (int *, int, mode_t, int); | |
X-char *ttypnm = "/dev/ttyqxxx"; | |
X-#else | |
X-char *ttypnm = "/dev/tty"; | |
X-#endif /* sgi */ | |
X+/* ways to get a pty' | |
X+ == Traditional | |
X+ Try opening each /dev/ptyXX and use the succeeded one | |
X+ == SGI IRIX | |
X+ use _getpty() | |
X+ == BSD? (HAVE_OPENPTY) | |
X+ use openpty() | |
X+ == STREAMS (Solaris) (HAVE_PTSNAME) | |
X+ use posix_openpt() (or open /dev/ptmx directly) and ptsname() | |
X+ (see pts(7D) for EXAMPLE) | |
X+*/ | |
X | |
X-#ifndef sgi | |
X-static void ptyname (); | |
X+#if !defined(sgi) && !defined(HAVE_PTSNAME) | |
X+char tty_master[32]; /*VVVV overflow?*/ | |
X+#endif | |
X+char tty_slave [32]; /*VVVV overflow?*/ | |
X+ | |
X+#if defined(BSD43) || defined(DGUX) /* FOR PASS8 */ | |
X+static int local_mode_sv; | |
X #endif | |
X #endif /* !USE_LIBSPT */ | |
X | |
X+/* open slave side of pty to ttypfd */ | |
X static void | |
X-open_ttyp () | |
X+open_ttyp (void) | |
X { | |
X- char nmbuf[20]; | |
X+#ifndef USE_LIBSPT /* && !defined(linux) ? */ | |
X+ struct stat tstat; | |
X+ char chown_failed = 0; | |
X+ const char *msg_insecure = "Your ttyp (%s) may be insecure from other users, but continue anyway ...\r\n"; | |
X+#endif /* !USE_LIBSPT */ | |
X | |
X #ifdef USE_LIBSPT | |
X if ((ttypfd = spt_open_slave(spth)) == ERROR) | |
X+#else /* USE_LIBSPT */ | |
X+# if defined(sgi) | |
X+ if ((ttypfd = open (tty_slave, O_RDWR)) == ERROR) | |
X+# elif defined(HAVE_PTSNAME) | |
X+ if ((ttypfd = open(tty_slave, O_RDWR)) == ERROR /* open slave */ | |
X+# if defined(I_PUSH) | |
X+ /* for systems that have STREAMS */ | |
X+ || ioctl (ttypfd, I_PUSH, "ptem") == ERROR /* push ptem */ | |
X+ || ioctl (ttypfd, I_PUSH, "ldterm") == ERROR /* push ldterm */ | |
X+# endif | |
X+ ) | |
X+# elif defined (HAVE_OPENPTY) | |
X+ if (ttypfd < 0) /* already open */ | |
X+# else | |
X+ if ((ttypfd = open (tty_slave, O_RDWR, 0)) == ERROR) /* old method */ | |
X+# endif /* sgi */ | |
X+#endif /* USE_LIBSPT */ | |
X { | |
X-#elif defined(sgi) | |
X- if ((ttypfd = open (ttypnm, O_RDWR)) == ERROR) | |
X- { | |
X-#else | |
X- ptyname (nmbuf, ttypnm, ptyno); | |
X- if ((ttypfd = open (nmbuf, O_RDWR, 0)) == ERROR) | |
X- { | |
X-#endif | |
X- err ("Can't open ttyp."); | |
X+ perror(tty_slave); /* debug */ | |
X+ uum_err ("Can't open ttyp."); | |
X } | |
X-#if !defined(USE_LINUX_TERM) && !defined(USE_LIBSPT) | |
X- chown (nmbuf, getuid (), getgid ()); | |
X- chmod (nmbuf, 0622); | |
X-#endif /* !USE_LINUX_TERM && !USE_LIBSPT */ | |
X #if defined(USE_LIBSPT) | |
X spt_init_slavefd(spth, ttypfd); | |
X-#elif defined(I_PUSH) && defined(SVR4) | |
X- ioctl(ttypfd, I_PUSH, "ptem"); | |
X- ioctl(ttypfd, I_PUSH, "ldterm"); | |
X- ioctl(ttypfd, I_PUSH, "ttcompat"); | |
X-#endif | |
X- | |
X+#else /* USE_LIBSPT */ | |
X+/* #if !defined(linux) */ | |
X+ if(fstat(ttypfd, &tstat)==0) { | |
X+ if(tstat.st_uid != getuid()) { | |
X+ if(chown (tty_slave, getuid (), getgid ())!=0) { | |
X+ perror("Can't change owner of ttyp."); | |
X+ fprintf(stderr, msg_insecure, tty_slave); | |
X+ chown_failed = 1; | |
X+ } | |
X+ } | |
X+ if((tstat.st_mode & (S_IWGRP | S_IWOTH)) != 0) { | |
X+ /* Ignore message if chown failed (chmod will fail also ...) */ | |
X+ if(chmod (tty_slave, 0622)!=0 && chown_failed == 0) { | |
X+ perror("Can't change permission of ttyp."); | |
X+ fprintf(stderr, msg_insecure, tty_slave); | |
X+ } | |
X+ } | |
X+ } else { | |
X+ perror("Can't stat ttyp."); | |
X+ fprintf(stderr, msg_insecure, tty_slave); | |
X+ } | |
X+/* #endif */ /* linux */ | |
X+#endif /* USE_LIBSPT */ | |
X+ | |
X /* | |
X * We save terminal settings in main() instead of here. | |
X- * When USE_LINUX_TERM open_ttyp() is invoked from child! | |
X+ * When defined(linux) open_ttyp() is invoked from child! | |
X */ | |
X #ifndef USE_LINUX_TERM | |
X j_term_p_init (ttypfd); | |
X #endif | |
X | |
X #ifdef TIOCSSIZE | |
X- pty_rowcol.ts_lines = crow; /* instead of lines */ | |
X- pty_rowcol.ts_cols = maxlength; /* instead of columns */ | |
X- ioctl(ttypfd, TIOCSSIZE, &pty_rowcol); | |
X+ pty_rowcol.ts_lines = crow; /* instead of lines */ | |
X+ pty_rowcol.ts_cols = maxlength; /* instead of columns */ | |
X+ ioctl (ttypfd, TIOCSSIZE, &pty_rowcol); | |
X #endif /* TIOCSSIZE */ | |
X | |
X #ifdef SVR4 | |
X set_euc_term(ttypfd); | |
X #endif | |
X- | |
X #if defined(nec_ews_svr2) | |
X set_jterm (ttyfd, ttypfd); | |
X #endif | |
X- | |
X #ifdef sony | |
X set_sony_jterm(ttyfd, ttypfd); | |
X #endif | |
X+} | |
X+ | |
X+#if defined(HAVE_PTSNAME) && ! defined(HAVE_POSIX_OPENPT) | |
X+/* Maybe harmless on defined(USE_LIBSPT) */ | |
X+#if !defined(HAVE__DEV_PTMX) | |
X+#warning "If not cross compile, you must check pts master device (other than /dev/ptmx)." | |
X+/* but continue anyway. */ | |
X+#endif | |
X | |
X+/* fallback function to posix_openpt */ | |
X+static int | |
X+posix_openpt (int flags) | |
X+{ | |
X+ return open("/dev/ptmx", flags); | |
X } | |
X+#endif /* HAVE_PTSNAME && !HAVE_POSIX_OPENPT */ | |
X | |
X /** pty ¤Î¥ª¡¼¥×¥ó */ | |
X-#if defined(USE_LIBSPT) | |
X+/* allocate a new pty master into int ptyfd */ | |
X static void | |
X-open_pty () | |
X+open_pty (void) | |
X { | |
X+#if defined(USE_LIBSPT) | |
X int r; | |
X r = spt_open_pty(&spth, &ptyfd, NULL, NULL); | |
X if (r != SPT_E_NONE && r != SPT_E_CHOWN_FAIL) | |
X- err ("Can't get pty."); | |
X- return; | |
X-} | |
X+ uum_err ("Can't get pty."); | |
X+ | |
X #elif defined(sgi) | |
X-static void | |
X-open_pty () | |
X-{ | |
X- char nmbuf[20]; | |
X char *tty_name_buff; | |
X+ extern char *_getpty (int *, int, mode_t, int); | |
X tty_name_buff = _getpty (&ptyfd, O_RDWR | O_NDELAY, 0600, 0); | |
X if (tty_name_buff == 0) | |
X- err ("Can't get pty."); | |
X- strcpy (ttypnm, tty_name_buff); | |
X- return; | |
X+ uum_err ("Can't get pty."); | |
X+ strcpy (tty_slave, tty_name_buff); | |
X+ | |
X+#elif defined(HAVE_PTSNAME) | |
X+ char *p; | |
X+ ptyfd = posix_openpt(O_RDWR); /* open master */ | |
X+ if (ptyfd < 0) | |
X+ uum_err ("Could not get a pty."); | |
X+ grantpt (ptyfd); /* change permission of slave */ | |
X+ unlockpt (ptyfd); /* unlock slave */ | |
X+ | |
X+ p = ptsname (ptyfd); /* get name of slave */ | |
X+ strcpy(tty_slave, p); | |
X+ /* you can't get path of the "master" by ttyname; | |
X+ * only the open filedes ptyfd is available. | |
X+ */ | |
X+ /* strcpy (tty_master, "/dev/ptm/x"); */ | |
X+ | |
X+#elif HAVE_OPENPTY | |
X+ if (openpty(&ptyfd, &ttypfd, tty_slave, NULL, NULL) == ERROR) | |
X+ uum_err ("Could not get a pty."); | |
X+ /* Note: slave tty is ALREADY OPEN as ttypfd */ | |
X+ strcpy(tty_master, ttyname(ptyfd)); | |
X | |
X-} | |
X #else | |
X+ /* Traditional method that search in /dev/ttyXX */ | |
X+ open_pty_traditional (); | |
X+#endif /* USE_LIBSPT */ | |
X+ | |
X+ return; | |
X+} | |
X+ | |
X+#if !(USE_LIBSPT) && !(sgi) && !(HAVE_PTSNAME) && !(HAVE_OPENPTY) | |
X static void | |
X-open_pty () | |
X+open_pty_traditional (void) | |
X { | |
X- char nmbuf[20]; | |
X+ int ptyno; | |
X | |
X- for (ptyno = 0; ptyno < MAXPTYNO; ptyno++) | |
X+#ifdef hpux | |
X+# define MAXPTYS (11*16) | |
X+# define PTYDEV ";/dev/ptym/pty" | |
X+# define TTYDEV "/dev/pty/tty" | |
X+#else | |
X+# define MAXPTYS 32 | |
X+# define PTYDEV "/dev/pty" | |
X+# define TTYDEV "/dev/tty" | |
X+#endif | |
X+ | |
X+ for (ptyno = 0; ptyno < MAXPTYS; ptyno++) /* sysconf? */ | |
X { | |
X- ptyname (nmbuf, ptynm, ptyno); | |
X- if ((ptyfd = open (nmbuf, O_RDWR, 0)) != ERROR) | |
X+/* | |
X+ * Change pseudo-devices. | |
X+ * Because FreeBSD's master pseudo-devices are pty[p-sP-S][0-9a-v]. | |
X+ * Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/20 | |
X+ */ | |
X+#if (defined(BSD) && (BSD >= 199306)) /* 4.4BSD-Lite by Taoka */ | |
X+# define PTXNAME(b, PFX, no) \ | |
X+ snprintf ((b), sizeof((b)), PFX "%1c%1c", "pqrsPQRS"[((no) >> 5)], "0123456789abcdefghijklmnopqrstuv"[(no) & 0x1f]) | |
X+#elif defined(hpux) | |
X+# define PTXNAME(b, PFX, no) \ | |
X+ sprintf ((b), PFX "%1c%1c", "zyxwvutsrqp"[(no)>>4], "fedcba9876543210"[(no)&0x0f]) | |
X+#else /* !4.4BSD-Lite, !hpux */ | |
X+# define PTXNAME(b, PFX, no) \ | |
X+ sprintf ((b), PFX "%1c%1c", 'p' + ((no) >> 4), "0123456789abcdef"[(no) & 0x0f]); | |
X+#endif /* !4.4BSD-Lite */ | |
X+#define PTMNAME(b, no) PTXNAME(b, PTYDEV, no) | |
X+#define PTSNAME(b, no) PTXNAME(b, TTYDEV, no) | |
X+ | |
X+ PTMNAME(tty_master, ptyno); | |
X+ fprintf(stderr, "trying master <%s>\n", tty_master); /* debug */ | |
X+ if ((ptyfd = open (tty_master, O_RDWR, 0)) != ERROR) | |
X { | |
X-#if defined(uniosu) | |
X+# if defined(uniosu) | |
X if (ioctl (ptyfd, PIOCPKT, 1) < 0) | |
X { /* packet mode on */ | |
X fprintf (stderr, "error in ioctl PIOCPKT.\n"); | |
X exit (1); | |
X } | |
X-#endif | |
X- return; | |
X+# endif /* uniosu */ | |
X+ PTSNAME(tty_slave, ptyno); | |
X+ return; | |
X } | |
X } | |
X- err ("Can't get pty."); | |
X+ uum_err ("Can't get pty."); | |
X } | |
X-#endif | |
X+#endif /* !(USE_LIBSPT) && !(sgi) && !(HAVE_PTSNAME) && !(HAVE_OPENPTY) */ | |
X | |
X /** ¥¨¥é¡¼¤À¤è¡£¤µ¤è¤¦¤Ê¤é¡£ */ | |
X void | |
X-err (s) | |
X- char *s; | |
X+uum_err (char *s) | |
X { | |
X puts (s); | |
X fclose (stdout); | |
X@@ -1979,12 +2093,10 @@ err (s) | |
X | |
X /** Ω¤ÄÄ»¸å¤òÂù¤µ¤º ½ª¤ï¤ê¤Î½èÍý */ | |
X static void | |
X-do_end () | |
X+do_end (void) | |
X { | |
X #ifdef USE_LIBSPT | |
X int r; | |
X-#else | |
X- char nmbuf[20]; | |
X #endif | |
X | |
X static int do_end_flg = 0; | |
X@@ -1994,29 +2106,28 @@ do_end () | |
X | |
X signal (SIGCHLD, SIG_DFL); | |
X fcntl (ttyfd, F_SETFL, 0); | |
X- | |
X j_term_restore (); | |
X | |
X #if !defined(USE_LIBSPT) && !defined(sgi) | |
X- ptyname (nmbuf, ptynm, ptyno); | |
X- if (chown (nmbuf, 0, 0) == ERROR) | |
X+# ifndef HAVE_PTSNAME | |
X+ if (chown (tty_master, 0, 0) == ERROR) | |
X { | |
X- perror (prog); | |
X+ perror ("Can't restore owner of tty_master."); | |
X } | |
X- if (chmod (nmbuf, 0666) == ERROR) | |
X+ if (chmod (tty_master, 0666) == ERROR) | |
X { | |
X- perror (prog); | |
X+ perror ("Can't restore permission of tty_master."); | |
X } | |
X | |
X- ptyname (nmbuf, ttypnm, ptyno); | |
X- if (chown (nmbuf, 0, 0) == ERROR) | |
X+ if (chown (tty_slave, 0, 0) == ERROR) | |
X { | |
X- perror (prog); | |
X+ perror ("Can't restore owner of ttyp."); | |
X } | |
X- if (chmod (nmbuf, 0666) == ERROR) | |
X+ if (chmod (tty_slave, 0666) == ERROR) | |
X { | |
X- perror (prog); | |
X+ perror ("Can't restore permission of ttyp."); | |
X } | |
X+# endif /* HAVE_PTSNAME */ | |
X | |
X #endif /* !USE_LIBSPT && !sgi */ | |
X close (ttyfd); | |
X@@ -2027,7 +2138,7 @@ do_end () | |
X spt_perror(NULL, r); | |
X #else | |
X close (ptyfd); | |
X-#endif | |
X+#endif /* USE_LIBSPT */ | |
X | |
X chdir ("/tmp"); /* to avoid making too many mon.out files */ | |
X | |
X@@ -2038,7 +2149,7 @@ do_end () | |
X #if defined(uniosu) | |
X /** ²¾Ì¾´Á»úÊÑ´¹¤ò ioctl ¤Ç¥ª¥Õ¤·¤¿»þ¤Î keyin ¤ËÂå¤ï¤ë´Ø¿ô */ | |
X int | |
X-ioctl_off () | |
X+ioctl_off (void) | |
X { | |
X static unsigned char buf[BUFSIZ]; | |
X int n; | |
X@@ -2086,44 +2197,15 @@ ioctl_off () | |
X } | |
X #endif /* defined(uniosu) */ | |
X | |
X- | |
X-#if !defined(USE_LIBSPT) && !defined(sgi) | |
X-static void | |
X-ptyname (b, pty, no) | |
X- char *b, *pty; | |
X-{ | |
X-/* | |
X- * Change pseudo-devices. | |
X- * Because FreeBSD's master pseudo-devices are pty[p-sP-S][0-9a-v]. | |
X- * Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/20 | |
X- */ | |
X-#if (defined(BSD) && (BSD >= 199306)) /* 4.4BSD-Lite by Taoka */ | |
X- sprintf (b, "%s%1c%1c", pty, "pqrsPQRS"[(no >> 5)], (((no & 0x1f) > 9) ? 'a' : '0') + (no & 0x1f)); | |
X-#else /* ! 4.4BSD-Lite */ | |
X- sprintf (b, "%s%1c%1x", pty, 'p' + (no >> 4), no & 0x0f); | |
X- if (no < 0x10 * ('z' - 'p' + 1)) | |
X- { | |
X- sprintf(b, "%s%1c%1x", pty, 'p' + (no >> 4), no & 0x0f); | |
X- } | |
X- else | |
X- { | |
X- no -= 0x10 * ('z' - 'p' + 1); | |
X- sprintf(b, "%s%1c%1x", pty, 'P' + (no >> 4), no & 0x0f); | |
X- } | |
X-#endif /* ! 4.4BSD-Lite */ | |
X-} | |
X-#endif /* !USE_LIBSPT && !sgi */ | |
X- | |
X static void | |
X-default_usage () | |
X+default_usage (void) | |
X { | |
X fprintf (stderr, "%s: Bad -L option\n", prog); | |
X exit (0); | |
X } | |
X | |
X static void | |
X-usage (optstr) | |
X- char *optstr; | |
X+usage (char *optstr) | |
X { | |
X printf ("usage: prog %s by lang \"%s\"\n", optstr, lang_dir); | |
X exit (0); | |
X@@ -2139,10 +2221,10 @@ intfnptr sigwinch; | |
X #endif /* SIGWINCH */ | |
X | |
X static void | |
X-save_signals () | |
X+save_signals (void) | |
X { | |
X sigpipe = signal (SIGPIPE, SIG_IGN); | |
X-#ifdef USE_LINUX_TERM /* XXX */ | |
X+#ifdef linux /* XXX */ | |
X sighup = signal (SIGHUP, SIG_IGN); | |
X #endif | |
X sighup = signal (SIGHUP, terminate_handler); | |
X@@ -2161,7 +2243,7 @@ save_signals () | |
X } | |
X | |
X static void | |
X-restore_signals () | |
X+restore_signals (void) | |
X { | |
X signal (SIGPIPE, sigpipe); | |
X signal (SIGHUP, sighup); | |
X@@ -2179,14 +2261,13 @@ restore_signals () | |
X #endif /* SIGTSTP */ | |
X } | |
X | |
X-/* should be "defined(SIGWINCH)"? */ | |
X #if defined(BSD43) || defined(DGUX) | |
X static void | |
X-setsize () | |
X+setsize (void) | |
X { | |
X- register int i; | |
X+ int i; | |
X struct winsize win; | |
X- extern Term_LineWidth, Term_RowWidth, maxlength, crow; | |
X+ extern int Term_LineWidth, Term_RowWidth, maxlength; | |
X | |
X if (ioctl (ttyfd, TIOCGWINSZ, &win) < 0) | |
X { | |
X@@ -2209,11 +2290,11 @@ setsize () | |
X | |
X #ifdef SIGWINCH | |
X static void | |
X-change_size () | |
X+change_size (void) | |
X { | |
X register int i; | |
X struct winsize win; | |
X- extern Term_LineWidth, Term_RowWidth, maxlength, crow; | |
X+ extern int Term_LineWidth, Term_RowWidth, maxlength; | |
X | |
X if (ioctl (ttyfd, TIOCGWINSZ, &win) < 0) | |
X { | |
END-of-inputmethod/canna/patches/patch-canuum_jhlp.c | |
echo x - inputmethod/canna/patches/patch-canuum_printf.c | |
sed 's/^X//' >inputmethod/canna/patches/patch-canuum_printf.c << 'END-of-inputmethod/canna/patches/patch-canuum_printf.c' | |
X$NetBSD$ | |
X | |
XAppease prototype warnings. | |
X | |
X--- canuum/printf.c.orig 2003-01-04 07:31:02.000000000 +0000 | |
X+++ canuum/printf.c | |
X@@ -29,8 +29,18 @@ | |
X * along with this program; if not, write to the Free Software | |
X * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
X */ | |
X+#ifdef HAVE_CONFIG_H | |
X+# include <config.h> | |
X+#endif | |
X | |
X #include <stdio.h> | |
X+#if STDC_HEADERS | |
X+# include <string.h> | |
X+#else | |
X+# if HAVE_STRINGS_H | |
X+# include <strings.h> | |
X+# endif | |
X+#endif /* STDC_HEADERS */ | |
X #include "commonhd.h" | |
X #include "sdefine.h" | |
X #include "sheader.h" | |
END-of-inputmethod/canna/patches/patch-canuum_printf.c | |
echo x - inputmethod/canna/patches/patch-canuum_termio.c | |
sed 's/^X//' >inputmethod/canna/patches/patch-canuum_termio.c << 'END-of-inputmethod/canna/patches/patch-canuum_termio.c' | |
X$NetBSD: patch-ap,v 1.1 2011/12/07 16:05:59 roy Exp $ | |
X | |
X- Appease prototype warnings. | |
X- Remove unnecessary ops. | |
X | |
X--- canuum/termio.c.orig 2003-12-27 17:15:21.000000000 +0000 | |
X+++ canuum/termio.c | |
X@@ -36,6 +36,11 @@ | |
X #include <stdio.h> | |
X #if STDC_HEADERS | |
X # include <stdlib.h> | |
X+# include <string.h> | |
X+#else | |
X+# if HAVE_STRINGS_H | |
X+# include <strings.h> | |
X+# endif | |
X #endif /* STDC_HEADERS */ | |
X | |
X #include "commonhd.h" | |
X@@ -73,7 +78,7 @@ openTermData () | |
X char errprefix[1024] = "error"; | |
X | |
X /* for convert_key --- added by Nide 10/3 */ | |
X- if (NULL == (cp = get_kbd_env ()) || 0 != convert_getterm (cp, (0 != verbose_option))) | |
X+ if (NULL == (cp = get_kbd_env ()) || NULL == newterm(cp, stdout, stdin) || 0 != convert_getterm (cp, (0 != verbose_option))) | |
X { | |
X fprintf (stderr, "Cannot get keyboard information.\n"); | |
X return (-1); | |
X@@ -96,13 +101,8 @@ openTermData () | |
X return (-1); | |
X } | |
X #endif /* CANNA */ | |
X- setupterm (0, 1, &status); | |
X- /* This seems needless and causes hangs on Solaris8 + ncurses */ | |
X- /* reset_shell_mode (); */ | |
X- if (status != 1) | |
X- { | |
X- return (-1); | |
X- } | |
X+ def_shell_mode(); | |
X+ | |
X #if defined(uniosu) | |
X if (jterm < 2) | |
X { /* kanji terminal */ | |
X@@ -175,7 +175,6 @@ openTermData () | |
X void | |
X closeTermData () | |
X { | |
X- resetterm (); | |
X reset_shell_mode (); | |
X } | |
X | |
END-of-inputmethod/canna/patches/patch-canuum_termio.c | |
echo x - inputmethod/canna/patches/patch-cmd_cmd.tmpl | |
sed 's/^X//' >inputmethod/canna/patches/patch-cmd_cmd.tmpl << 'END-of-inputmethod/canna/patches/patch-cmd_cmd.tmpl' | |
X$NetBSD$ | |
X | |
XAdd a hook to disable installation of unnecessary commands in canna-lib | |
X | |
X--- cmd/cmd.tmpl.orig 2003-09-25 06:30:21.000000000 +0000 | |
X+++ cmd/cmd.tmpl | |
X@@ -33,7 +33,9 @@ NormalProgramTarget($(TARGET),$(OBJS),$( | |
X # else | |
X NormalProgramTarget($(TARGET),$(OBJS),$(DEPRKINDEPLIB),$(RKINDEPLIB),) | |
X # endif | |
X+# ifndef DontInstallProgram | |
X InstallProgram($(TARGET),$(cannaBinDir)) | |
X+# endif | |
X # ifdef ManSrcName | |
X InstallManPageLong(ManSrcName,$(cannaManDir),$(TARGET)) | |
X # endif | |
END-of-inputmethod/canna/patches/patch-cmd_cmd.tmpl | |
echo x - inputmethod/canna/patches/patch-lib_RK_dd.c | |
sed 's/^X//' >inputmethod/canna/patches/patch-lib_RK_dd.c << 'END-of-inputmethod/canna/patches/patch-lib_RK_dd.c' | |
X$NetBSD$ | |
X | |
XFix "64 bit time_t on 32 bit architecture" problem. | |
X | |
X--- lib/RK/dd.c.orig 2003-09-17 08:50:52.000000000 +0000 | |
X+++ lib/RK/dd.c | |
X@@ -42,6 +42,12 @@ static char rcsid[]="$Id: dd.c,v 1.5 200 | |
X #include <sys/types.h> | |
X #include <sys/stat.h> | |
X | |
X+#ifdef HAVE_TIME_T | |
X+#define TIME_T time_t | |
X+#else | |
X+#define TIME_T long | |
X+#endif | |
X+ | |
X #define Calloc calloc | |
X #define cx_gwt cx_extdata.ptr | |
X #define STRCMP(d, s) strcmp((char *)(d), (char *)(s)) | |
X@@ -742,7 +748,7 @@ _RkRealizeDD(dd) | |
X int ret = -1; | |
X int tmpres; | |
X int fdes; | |
X- long tloc; | |
X+ TIME_T tloc; | |
X #ifdef __EMX__ | |
X struct stat statbuf; | |
X #endif | |
END-of-inputmethod/canna/patches/patch-lib_RK_dd.c | |
echo x - inputmethod/canna/patches/patch-dic_phono_Imakefile | |
sed 's/^X//' >inputmethod/canna/patches/patch-dic_phono_Imakefile << 'END-of-inputmethod/canna/patches/patch-dic_phono_Imakefile' | |
X$NetBSD: patch-dic_phono_Imakefile,v 1.1 2012/07/03 17:44:39 joerg Exp $ | |
X | |
X- Tweak canna-dict dirs | |
X- avoid use of ${CPP} as generic preprocessor | |
X | |
X--- dic/phono/Imakefile.orig 2015-10-03 19:39:32.000000000 +0000 | |
X+++ dic/phono/Imakefile | |
X@@ -27,9 +27,9 @@ | |
X | |
X ROMAJI_DIC_DEF = -DSHIFT | |
X | |
X- DICDIR = $(cannaLibDir)/dic | |
X- SAMPLEDIR = $(cannaLibDir)/sample | |
X- SAMPLESRCDIR = $(cannaLibDir)/sample/src | |
X+ DICDIR = $(DicDir) | |
X+ SAMPLEDIR = $(DicDir)/sample | |
X+ SAMPLESRCDIR = $(DicDir)/sample/src | |
X | |
X KPDEF = default.kpdef jdaemon.kpdef just.kpdef kaisoku.kpdef kana.kpdef \ | |
X lan5.kpdef matsu.kpdef newjis.kpdef romaji.kpdef sokuon.kpdef \ | |
X@@ -54,16 +54,16 @@ AllTarget($(ROMKANA_TABLES)) | |
X | |
X #ifdef __EMX__ | |
X .kpdef.kp: | |
X- $(FORCPP) -7 < $< | $(CPP) $(ROMAJI_DIC_DEF) | $(FORCPP) -8 | $(KPDIC) > $@ | |
X+ $(FORCPP) -7 < $< | tee ${.TARGET}.before | ${AWK} -f dic-phono-filter.awk | tee ${.TARGET}.after |$(FORCPP) -8 | $(KPDIC) > $@ | |
X | |
X .kpdef.cbp: | |
X- $(FORCPP) -7 < $< | $(CPP) $(ROMAJI_DIC_DEF) | $(FORCPP) -8 | $(KPDIC) > $@ | |
X+ $(FORCPP) -7 < $< | tee ${.TARGET}.before | ${AWK} -f dic-phono-filter.awk | tee ${.TARGET}.after | $(FORCPP) -8 | $(KPDIC) > $@ | |
X #else | |
X .kpdef.kp: | |
X- $(FORCPP) -7 < $< | $(CPP) $(ROMAJI_DIC_DEF) | $(FORCPP) -8 | $(KPDIC) > `basename $< '.kpdef'`.kp | |
X+ $(FORCPP) -7 < $< | tee ${.TARGET}.before | ${AWK} -f dic-phono-filter.awk | tee ${.TARGET}.after | $(FORCPP) -8 | $(KPDIC) > `basename $< '.kpdef'`.kp | |
X | |
X .kpdef.cbp: | |
X- $(FORCPP) -7 < $< | $(CPP) $(ROMAJI_DIC_DEF) | $(FORCPP) -8 | $(KPDIC) > `basename $< '.kpdef'`.cbp | |
X+ $(FORCPP) -7 < $< | tee ${.TARGET}.before | ${AWK} -f dic-phono-filter.awk | tee ${.TARGET}.after | $(FORCPP) -8 | $(KPDIC) > `basename $< '.kpdef'`.cbp | |
X #endif | |
X | |
X MakeDirectories(install,$(DICDIR)) | |
END-of-inputmethod/canna/patches/patch-dic_phono_Imakefile | |
echo x - inputmethod/canna/patches/patch-lib_RK_ncache.c | |
sed 's/^X//' >inputmethod/canna/patches/patch-lib_RK_ncache.c << 'END-of-inputmethod/canna/patches/patch-lib_RK_ncache.c' | |
X$NetBSD: patch-ao,v 1.1 2008/09/18 12:33:44 taca Exp $ | |
X | |
XFix crash problem of cannaserver. | |
X | |
X--- lib/RK/ncache.c.orig 2003-09-17 08:50:52.000000000 +0000 | |
X+++ lib/RK/ncache.c | |
X@@ -27,7 +27,7 @@ static char rcsid[]="$Id: ncache.c,v 1.2 | |
X #include "RKintern.h" | |
X | |
X #define NCHASH 101 | |
X-#define hash(x) ((int)((x)%NCHASH)) | |
X+#define hash(x) ((int)(((unsigned long)(x))%NCHASH)) | |
X | |
X static struct ncache Nchash[NCHASH]; | |
X static struct ncache Ncfree; | |
END-of-inputmethod/canna/patches/patch-lib_RK_ncache.c | |
echo x - inputmethod/canna/patches/patch-lib_RKC_convert.c | |
sed 's/^X//' >inputmethod/canna/patches/patch-lib_RKC_convert.c << 'END-of-inputmethod/canna/patches/patch-lib_RKC_convert.c' | |
X$NetBSD: patch-af,v 1.1 2003/05/31 07:24:42 uebayasi Exp $ | |
X | |
XTweak include path to build without configure in unnecessary dirs | |
X | |
X--- lib/RKC/convert.c.orig 2004-04-26 21:48:37.000000000 +0000 | |
X+++ lib/RKC/convert.c | |
X@@ -30,7 +30,7 @@ static char rcs_id[] = "$Id: convert.c,v | |
X #include "rkcw.h" | |
X #include "canna/RK.h" | |
X #include "rkc.h" | |
X-#include "IRproto.h" | |
X+#include "../server/IRproto.h" | |
X #include "RKindep/file.h" | |
X | |
X #include <sys/types.h> | |
END-of-inputmethod/canna/patches/patch-lib_RKC_convert.c | |
echo c - inputmethod/canna-canuum | |
mkdir -p inputmethod/canna-canuum > /dev/null 2>&1 | |
echo x - inputmethod/canna-canuum/MESSAGE | |
sed 's/^X//' >inputmethod/canna-canuum/MESSAGE << 'END-of-inputmethod/canna-canuum/MESSAGE' | |
X=========================================================================== | |
X$NetBSD: MESSAGE,v 1.2 2006/07/05 04:48:28 jlam Exp $ | |
X | |
XYou at least should set up key functions in ~/.canna, e.g.: | |
X | |
X (set-key 'alpha-mode "\C-i" 'japanese-mode) | |
X (set-key 'empty-mode "\C-i" 'alpha-mode) | |
X | |
X=========================================================================== | |
END-of-inputmethod/canna-canuum/MESSAGE | |
echo x - inputmethod/canna-canuum/DESCR | |
sed 's/^X//' >inputmethod/canna-canuum/DESCR << 'END-of-inputmethod/canna-canuum/DESCR' | |
XCanuum is a Japanese input frontend program from Wnn tty frontend uum. | |
END-of-inputmethod/canna-canuum/DESCR | |
echo x - inputmethod/canna-canuum/Makefile | |
sed 's/^X//' >inputmethod/canna-canuum/Makefile << 'END-of-inputmethod/canna-canuum/Makefile' | |
X# $NetBSD: Makefile,v 1.14 2015/08/18 07:31:10 wiz Exp $ | |
X | |
XCANNA_MODULE= canuum | |
X | |
X.include "../../inputmethod/canna/Makefile.common" | |
X | |
XMAINTAINER= pkgsrc-users@NetBSD.org | |
X | |
XINSTALLATION_DIRS= ${PKGMANDIR}/ja_JP.EUC/man1 | |
X | |
XCONFIGURE_DIRS= ${WRKSRC}/canuum | |
X | |
XINSTALL_MAKE_FLAGS+= INSTUGIDFLAGS= | |
X | |
X.include "../../mk/curses.buildlink3.mk" | |
XSUBST_CLASSES+= fix_curs | |
XSUBST_STAGE.fix_curs= post-patch | |
XSUBST_MESSAGE.fix_curs= Fixing curses | |
XSUBST_FILES.fix_curs+= canuum/Imakefile | |
XSUBST_SED.fix_curs+= -e 's/TERMCAP_LIB = .*/TERMCAP_LIB = -l'${BUILDLINK_LIBNAME.curses}'/g' | |
X | |
X.include "../../inputmethod/canna-lib/buildlink3.mk" | |
X | |
Xpre-configure: | |
X ${CP} ${PKGSRCDIR}/mk/gnu-config/config.guess ${WRKSRC}/canuum | |
X ${CP} ${PKGSRCDIR}/mk/gnu-config/config.sub ${WRKSRC}/canuum | |
X ${LN} -fs ${WRKSRC}/cannaconf.h ${WRKSRC}/canuum | |
X ${LN} -fs ${WRKSRC}/canna/ccompat.h ${WRKSRC}/canuum | |
X | |
X.include "../../mk/bsd.pkg.mk" | |
END-of-inputmethod/canna-canuum/Makefile | |
echo x - inputmethod/canna-canuum/PLIST | |
sed 's/^X//' >inputmethod/canna-canuum/PLIST << 'END-of-inputmethod/canna-canuum/PLIST' | |
X@comment $NetBSD: PLIST,v 1.3 2010/02/20 10:34:04 obache Exp $ | |
Xbin/canuum | |
Xman/ja_JP.EUC/man1/canuum.1 | |
Xman/man1/canuum.1 | |
END-of-inputmethod/canna-canuum/PLIST | |
echo c - inputmethod/canna-dict | |
mkdir -p inputmethod/canna-dict > /dev/null 2>&1 | |
echo x - inputmethod/canna-dict/Makefile | |
sed 's/^X//' >inputmethod/canna-dict/Makefile << 'END-of-inputmethod/canna-dict/Makefile' | |
X# $NetBSD: Makefile,v 1.14 2013/07/12 10:44:55 jperkin Exp $ | |
X | |
XCANNA_MODULE= dict | |
X | |
XMAKE_JOBS_SAFE= no | |
X | |
X.include "../../inputmethod/canna/Makefile.common" | |
X | |
XBUILD_DEPENDS+= Canna-server>=${CANNA_VERSION}:../../inputmethod/canna-server | |
X | |
XEVAL_PREFIX+= CANNASERVERBINDIR=Canna-server | |
X.for cmd in MERGE FORCPP FORSORT SPLITWORD MERGEWORD CRXGRAM CRXDIC CRFREQ KPDIC | |
XCANNA_CMD_SED_SCRIPT+= \ | |
X -e 's|\(${cmd} = \).*/\(.*\)|\1${CANNASERVERBINDIR}/bin/\2|' | |
X.endfor | |
X | |
XDICT_WRKSRC= ${WRKSRC}/dic/ideo | |
XCANNA_DICTDIR= ${PREFIX}/libdata/canna | |
X | |
XPKG_GROUPS= ${CANNA_GROUP} | |
XPKG_USERS= ${CANNA_USER}:${CANNA_GROUP} | |
X | |
Xpost-patch: | |
X ${MV} ${WRKSRC}/Imakefile ${WRKSRC}/Imakefile.orig | |
X ${SED} -e 's|\(SUBDIRS = \).*|\1 canna lib/RKindep dic/ideo|' \ | |
X ${WRKSRC}/Imakefile.orig > ${WRKSRC}/Imakefile | |
X @${MV} ${WRKSRC}/Canna.conf ${WRKSRC}/Canna.conf.orig | |
X @${SED} -e 's|\(DicDir.*=\).*|\1${IMDICTDIR}/canna|' \ | |
X ${WRKSRC}/Canna.conf.orig > ${WRKSRC}/Canna.conf | |
X @for file in `${FIND} ${DICT_WRKSRC} -name Imakefile -print`; do \ | |
X ${MV} $$file $$file.orig; \ | |
X ${SED} ${CANNA_CMD_SED_SCRIPT} $$file.orig > $$file; \ | |
X done | |
X | |
XINSTALLATION_DIRS+= ${CANNA_DICTDIR} | |
X | |
Xdo-install: | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/grammar/fuzokugo.cbd \ | |
X ${DESTDIR}${CANNA_DICTDIR} | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/words/bushu.cld \ | |
X ${DESTDIR}${CANNA_DICTDIR} | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/words/dics.dir \ | |
X ${DESTDIR}${CANNA_DICTDIR} | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/words/iroha.cbd \ | |
X ${DESTDIR}${CANNA_DICTDIR} | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/words/iroha.cld \ | |
X ${DESTDIR}${CANNA_DICTDIR} | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/words/chimei.t \ | |
X ${DESTDIR}${CANNA_DICTDIR}/chimei.ctd | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/words/hojomwd.t \ | |
X ${DESTDIR}${CANNA_DICTDIR}/hojomwd.ctd | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/words/hojoswd.t \ | |
X ${DESTDIR}${CANNA_DICTDIR}/hojoswd.ctd | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/words/kanasmpl.t \ | |
X ${DESTDIR}${CANNA_DICTDIR}/kanasmpl.ctd | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/words/katakana.t \ | |
X ${DESTDIR}${CANNA_DICTDIR}/katakana.ctd | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/words/keishiki.t \ | |
X ${DESTDIR}${CANNA_DICTDIR}/keishiki.ctd | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/words/necgaiji.t \ | |
X ${DESTDIR}${CANNA_DICTDIR}/necgaiji.ctd | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/words/number.t \ | |
X ${DESTDIR}${CANNA_DICTDIR}/number.ctd | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/words/software.t \ | |
X ${DESTDIR}${CANNA_DICTDIR}/software.ctd | |
X ${INSTALL_DATA} ${DICT_WRKSRC}/words/suffix.t \ | |
X ${DESTDIR}${CANNA_DICTDIR}/suffix.ctd | |
X | |
XREQD_DIRS_PERMS+= ${CANNA_DICTDIR} ${CANNA_USER} ${CANNA_GROUP} 0775 | |
X.for d in fuzokugo.cbd bushu.cld dics.dir iroha.cbd iroha.cld \ | |
X chimei.ctd hojomwd.ctd hojoswd.ctd kanasmpl.ctd katakana.ctd \ | |
X keishiki.ctd necgaiji.ctd number.ctd software.ctd suffix.ctd | |
XSPECIAL_PERMS+= ${CANNA_DICTDIR}/${d} ${CANNA_USER} ${CANNA_GROUP} 0664 | |
X.endfor | |
X | |
X.include "../../inputmethod/canna-lib/buildlink3.mk" | |
X.include "../../mk/bsd.pkg.mk" | |
END-of-inputmethod/canna-dict/Makefile | |
echo x - inputmethod/canna-dict/DESCR | |
sed 's/^X//' >inputmethod/canna-dict/DESCR << 'END-of-inputmethod/canna-dict/DESCR' | |
XDictionary part of Canna Japanese input method. | |
END-of-inputmethod/canna-dict/DESCR | |
echo x - inputmethod/canna-dict/PLIST | |
sed 's/^X//' >inputmethod/canna-dict/PLIST << 'END-of-inputmethod/canna-dict/PLIST' | |
X@comment $NetBSD: PLIST,v 1.4 2009/06/14 18:01:29 joerg Exp $ | |
Xlibdata/canna/bushu.cld | |
Xlibdata/canna/chimei.ctd | |
Xlibdata/canna/dics.dir | |
Xlibdata/canna/fuzokugo.cbd | |
Xlibdata/canna/hojomwd.ctd | |
Xlibdata/canna/hojoswd.ctd | |
Xlibdata/canna/iroha.cbd | |
Xlibdata/canna/iroha.cld | |
Xlibdata/canna/kanasmpl.ctd | |
Xlibdata/canna/katakana.ctd | |
Xlibdata/canna/keishiki.ctd | |
Xlibdata/canna/necgaiji.ctd | |
Xlibdata/canna/number.ctd | |
Xlibdata/canna/software.ctd | |
Xlibdata/canna/suffix.ctd | |
END-of-inputmethod/canna-dict/PLIST | |
echo c - inputmethod/canna-lib | |
mkdir -p inputmethod/canna-lib > /dev/null 2>&1 | |
echo x - inputmethod/canna-lib/Makefile | |
sed 's/^X//' >inputmethod/canna-lib/Makefile << 'END-of-inputmethod/canna-lib/Makefile' | |
X# $NetBSD: Makefile,v 1.14 2012/10/06 14:25:10 asau Exp $ | |
X | |
XCANNA_MODULE= lib | |
X | |
X.include "../../inputmethod/canna/Makefile.common" | |
X | |
X# (1) Change SUBDIRS. | |
X# (2) Don't install `forcpp', `kpdic'. | |
X# | |
Xpost-patch: | |
X @${MV} ${WRKSRC}/Imakefile ${WRKSRC}/Imakefile.orig | |
X @${SED} -e 's|\(SUBDIRS = lib canna\).*\( misc\)|\1 cmd/forcpp cmd/kpdic dic/phono\2|' \ | |
X -e 's|\(SGSDIR = \).*|\1 lib canna dic/phono misc doc|' \ | |
X ${WRKSRC}/Imakefile.orig > ${WRKSRC}/Imakefile | |
X.for f in forcpp kpdic | |
X @${MV} ${WRKSRC}/cmd/${f}/Imakefile ${WRKSRC}/cmd/${f}/Imakefile.orig | |
X @${SED} -e '/^#define TargetName/a\${.newline}#define DontInstallProgram' ${WRKSRC}/cmd/${f}/Imakefile.orig \ | |
X > ${WRKSRC}/cmd/${f}/Imakefile | |
X.endfor | |
X | |
XMAKE_ENV+= AWK=${AWK:Q} | |
X | |
Xpost-extract: | |
X ${CP} ${FILESDIR}/dic-phono-filter.awk ${WRKSRC}/dic/phono/ | |
X | |
Xpost-configure: | |
X @${LN} -s ${WRKSRC}/server/*.h ${WRKSRC}/include | |
X | |
X.include "../../mk/bsd.pkg.mk" | |
END-of-inputmethod/canna-lib/Makefile | |
echo x - inputmethod/canna-lib/DESCR | |
sed 's/^X//' >inputmethod/canna-lib/DESCR << 'END-of-inputmethod/canna-lib/DESCR' | |
XLibrary part of Canna Japanese input method. | |
END-of-inputmethod/canna-lib/DESCR | |
echo x - inputmethod/canna-lib/PLIST | |
sed 's/^X//' >inputmethod/canna-lib/PLIST << 'END-of-inputmethod/canna-lib/PLIST' | |
X@comment $NetBSD: PLIST,v 1.8 2009/06/14 18:01:29 joerg Exp $ | |
Xinclude/canna/RK.h | |
Xinclude/canna/jrkanji.h | |
Xinclude/canna/keydef.h | |
Xinclude/canna/mfdef.h | |
Xinclude/canna/pubconf.h | |
Xinclude/canna/sysdep.h | |
Xlib/libRKC.a | |
Xlib/libRKC.so | |
Xlib/libRKC.so.1 | |
Xlib/libRKC.so.1.2 | |
Xlib/libRKC16.a | |
Xlib/libRKC16.so | |
Xlib/libRKC16.so.1 | |
Xlib/libRKC16.so.1.2 | |
Xlib/libcanna.a | |
Xlib/libcanna.so | |
Xlib/libcanna.so.1 | |
Xlib/libcanna.so.1.2 | |
Xlib/libcanna16.a | |
Xlib/libcanna16.so | |
Xlib/libcanna16.so.1 | |
Xlib/libcanna16.so.1.2 | |
Xman/ja_JP.EUC/man3/RkBgnBun.3 | |
Xman/ja_JP.EUC/man3/RkCloseRoma.3 | |
Xman/ja_JP.EUC/man3/RkCvtEuc.3 | |
Xman/ja_JP.EUC/man3/RkCvtHan.3 | |
Xman/ja_JP.EUC/man3/RkCvtHira.3 | |
Xman/ja_JP.EUC/man3/RkCvtKana.3 | |
Xman/ja_JP.EUC/man3/RkCvtRoma.3 | |
Xman/ja_JP.EUC/man3/RkCvtZen.3 | |
Xman/ja_JP.EUC/man3/RkDefineDic.3 | |
Xman/ja_JP.EUC/man3/RkDeleteDic.3 | |
Xman/ja_JP.EUC/man3/RkEndBun.3 | |
Xman/ja_JP.EUC/man3/RkEnlarge.3 | |
Xman/ja_JP.EUC/man3/RkFinalize.3 | |
Xman/ja_JP.EUC/man3/RkGetDicList.3 | |
Xman/ja_JP.EUC/man3/RkGetKanji.3 | |
Xman/ja_JP.EUC/man3/RkGetLex.3 | |
Xman/ja_JP.EUC/man3/RkGetStat.3 | |
Xman/ja_JP.EUC/man3/RkGetYomi.3 | |
Xman/ja_JP.EUC/man3/RkGoto.3 | |
Xman/ja_JP.EUC/man3/RkInitialize.3 | |
Xman/ja_JP.EUC/man3/RkIntro.3 | |
Xman/ja_JP.EUC/man3/RkLeft.3 | |
Xman/ja_JP.EUC/man3/RkMapPhonogram.3 | |
Xman/ja_JP.EUC/man3/RkMapRoma.3 | |
Xman/ja_JP.EUC/man3/RkMountDic.3 | |
Xman/ja_JP.EUC/man3/RkNext.3 | |
Xman/ja_JP.EUC/man3/RkNfer.3 | |
Xman/ja_JP.EUC/man3/RkOpenRoma.3 | |
Xman/ja_JP.EUC/man3/RkPrev.3 | |
Xman/ja_JP.EUC/man3/RkRemountDic.3 | |
Xman/ja_JP.EUC/man3/RkResize.3 | |
Xman/ja_JP.EUC/man3/RkRight.3 | |
Xman/ja_JP.EUC/man3/RkShorten.3 | |
Xman/ja_JP.EUC/man3/RkStoreYomi.3 | |
Xman/ja_JP.EUC/man3/RkUnmountDic.3 | |
Xman/ja_JP.EUC/man3/RkXfer.3 | |
Xman/ja_JP.EUC/man3/XKanjiControl.3 | |
Xman/ja_JP.EUC/man3/XLookupKanjiString.3 | |
Xman/ja_JP.EUC/man3/cannalib.3 | |
Xman/ja_JP.EUC/man3/jrKanjiControl.3 | |
Xman/ja_JP.EUC/man3/jrKanjiString.3 | |
Xman/ja_JP.EUC/man3/uilib.3 | |
Xman/man3/RkBgnBun.3 | |
Xman/man3/RkCloseRoma.3 | |
Xman/man3/RkCvtEuc.3 | |
Xman/man3/RkCvtHan.3 | |
Xman/man3/RkCvtHira.3 | |
Xman/man3/RkCvtKana.3 | |
Xman/man3/RkCvtRoma.3 | |
Xman/man3/RkCvtZen.3 | |
Xman/man3/RkDefineDic.3 | |
Xman/man3/RkDeleteDic.3 | |
Xman/man3/RkEndBun.3 | |
Xman/man3/RkEnlarge.3 | |
Xman/man3/RkFinalize.3 | |
Xman/man3/RkGetDicList.3 | |
Xman/man3/RkGetKanji.3 | |
Xman/man3/RkGetLex.3 | |
Xman/man3/RkGetStat.3 | |
Xman/man3/RkGetYomi.3 | |
Xman/man3/RkGoto.3 | |
Xman/man3/RkInitialize.3 | |
Xman/man3/RkIntro.3 | |
Xman/man3/RkLeft.3 | |
Xman/man3/RkMapPhonogram.3 | |
Xman/man3/RkMapRoma.3 | |
Xman/man3/RkMountDic.3 | |
Xman/man3/RkNext.3 | |
Xman/man3/RkNfer.3 | |
Xman/man3/RkOpenRoma.3 | |
Xman/man3/RkPrev.3 | |
Xman/man3/RkRemountDic.3 | |
Xman/man3/RkResize.3 | |
Xman/man3/RkRight.3 | |
Xman/man3/RkShorten.3 | |
Xman/man3/RkStoreYomi.3 | |
Xman/man3/RkUnmountDic.3 | |
Xman/man3/RkXfer.3 | |
Xman/man3/XKanjiControl.3 | |
Xman/man3/XLookupKanjiString.3 | |
Xman/man3/cannalib.3 | |
Xman/man3/jrKanjiControl.3 | |
Xman/man3/jrKanjiString.3 | |
Xman/man3/uilib.3 | |
Xshare/canna/default.canna | |
Xshare/canna/dic/default.cbp | |
Xshare/canna/dic/english.cbp | |
Xshare/canna/dic/jdaemon.cbp | |
Xshare/canna/dic/just.cbp | |
Xshare/canna/dic/kaisoku.cbp | |
Xshare/canna/dic/kana.cbp | |
Xshare/canna/dic/lan5.cbp | |
Xshare/canna/dic/matsu.cbp | |
Xshare/canna/dic/newjis.cbp | |
Xshare/canna/dic/romaji.cbp | |
Xshare/canna/dic/sample/src/default.ctd | |
Xshare/canna/dic/sample/src/english.ctd | |
Xshare/canna/dic/sample/src/jdaemon.ctd | |
Xshare/canna/dic/sample/src/just.ctd | |
Xshare/canna/dic/sample/src/kaisoku.ctd | |
Xshare/canna/dic/sample/src/kana.ctd | |
Xshare/canna/dic/sample/src/lan5.ctd | |
Xshare/canna/dic/sample/src/matsu.ctd | |
Xshare/canna/dic/sample/src/newjis.ctd | |
Xshare/canna/dic/sample/src/romaji.ctd | |
Xshare/canna/dic/sample/src/sokuon.ctd | |
Xshare/canna/dic/sample/src/tut.ctd | |
Xshare/canna/dic/sample/src/vje.ctd | |
Xshare/canna/dic/sample/src/wx2+.ctd | |
Xshare/canna/dic/sokuon.cbp | |
Xshare/canna/dic/tut.cbp | |
Xshare/canna/dic/vje.cbp | |
Xshare/canna/dic/wx2+.cbp | |
Xshare/canna/sample/1.1.canna | |
Xshare/canna/sample/1.2.canna | |
Xshare/canna/sample/fixer.canna | |
Xshare/canna/sample/jdemon.canna | |
Xshare/canna/sample/just.canna | |
Xshare/canna/sample/lan5.canna | |
Xshare/canna/sample/matsu.canna | |
Xshare/canna/sample/modes.canna | |
Xshare/canna/sample/sample.canna | |
Xshare/canna/sample/skk.canna | |
Xshare/canna/sample/src/is.c | |
Xshare/canna/sample/tut.canna | |
Xshare/canna/sample/unix.canna | |
Xshare/canna/sample/verbose.canna | |
Xshare/canna/sample/vje.canna | |
Xshare/canna/sample/wx2+.canna | |
END-of-inputmethod/canna-lib/PLIST | |
echo x - inputmethod/canna-lib/buildlink3.mk | |
sed 's/^X//' >inputmethod/canna-lib/buildlink3.mk << 'END-of-inputmethod/canna-lib/buildlink3.mk' | |
X# $NetBSD: buildlink3.mk,v 1.7 2009/03/20 19:24:46 joerg Exp $ | |
X | |
XBUILDLINK_TREE+= Canna-lib | |
X | |
X.if !defined(CANNA_LIB_BUILDLINK3_MK) | |
XCANNA_LIB_BUILDLINK3_MK:= | |
X | |
XBUILDLINK_API_DEPENDS.Canna-lib+= Canna-lib>=3.7pl3 | |
XBUILDLINK_PKGSRCDIR.Canna-lib?= ../../inputmethod/canna-lib | |
X.endif # CANNA_LIB_BUILDLINK3_MK | |
X | |
XBUILDLINK_TREE+= -Canna-lib | |
END-of-inputmethod/canna-lib/buildlink3.mk | |
echo c - inputmethod/canna-server | |
mkdir -p inputmethod/canna-server > /dev/null 2>&1 | |
echo x - inputmethod/canna-server/INSTALL | |
sed 's/^X//' >inputmethod/canna-server/INSTALL << 'END-of-inputmethod/canna-server/INSTALL' | |
X# $NetBSD: INSTALL,v 1.3 2003/09/23 15:14:54 uebayasi Exp $ | |
X | |
Xcase ${STAGE} in | |
XPOST-INSTALL) | |
X (${GREP} -v ^# /etc/services | ${GREP} 'canna.*5680' >/dev/null) || \ | |
X (${ECHO} "" >> /etc/services; \ | |
X ${ECHO} "# canna package" >> /etc/services; \ | |
X ${ECHO} "canna 5680/tcp" >> /etc/services; \ | |
X ) | |
X ;; | |
Xesac | |
END-of-inputmethod/canna-server/INSTALL | |
echo x - inputmethod/canna-server/DESCR | |
sed 's/^X//' >inputmethod/canna-server/DESCR << 'END-of-inputmethod/canna-server/DESCR' | |
XServer part of Canna Japanese input method. | |
END-of-inputmethod/canna-server/DESCR | |
echo x - inputmethod/canna-server/MESSAGE | |
sed 's/^X//' >inputmethod/canna-server/MESSAGE << 'END-of-inputmethod/canna-server/MESSAGE' | |
X=========================================================================== | |
X$NetBSD: MESSAGE,v 1.5 2005/12/05 20:50:23 rillig Exp $ | |
X | |
XIf you want Canna server to boot automatically, | |
X | |
X 1) Copy ${PREFIX}/${RCD_SCRIPTS_EXAMPLEDIR}/canna to /etc/rc.d/. | |
X 2) Add the following line to /etc/rc.conf. | |
X | |
X canna=YES canna_flags="-u ${CANNA_USER}" | |
X | |
Xcanna_flags="-u ${CANNA_USER}" is not required, but recommended. Note | |
Xthat our Canna package no longer uses setuid(2) to make the server run | |
Xas user "${CANNA_USER}", owing to the implementation of "-u" option (3.6 | |
Xand above). See cannaserver(1M). | |
X | |
XAlso note that by default cannaserver(1M) no longer allows connections | |
Xthrough tcp port 5680. You need to explicitly specify the port by the | |
X"-inet" option. | |
X | |
X=========================================================================== | |
END-of-inputmethod/canna-server/MESSAGE | |
echo x - inputmethod/canna-server/Makefile | |
sed 's/^X//' >inputmethod/canna-server/Makefile << 'END-of-inputmethod/canna-server/Makefile' | |
X# $NetBSD: Makefile,v 1.23 2013/07/12 10:44:55 jperkin Exp $ | |
X | |
XCANNA_MODULE= server | |
X | |
X.include "../../inputmethod/canna/Makefile.common" | |
X | |
XPKG_DESTDIR_SUPPORT= destdir | |
X | |
XINSTALL_TARGET= instserver | |
X | |
XMESSAGE_SUBST+= CANNA_USER=${CANNA_USER} | |
XMESSAGE_SUBST+= CANNA_GROUP=${CANNA_GROUP} | |
X | |
XPKG_GROUPS= ${CANNA_GROUP} | |
XPKG_USERS= ${CANNA_USER}:${CANNA_GROUP} | |
X | |
XMAKE_DIRS+= ${IMDICTDIR} | |
XOWN_DIRS+= ${IMDICTDIR}/canna | |
XOWN_DIRS+= ${IMDICTDIR}/canna/canna | |
XOWN_DIRS_PERMS+= ${CANNA_SPOOL} \ | |
X ${CANNA_USER} ${CANNA_GROUP} ${CANNA_MODE} | |
X | |
XRCD_SCRIPTS= canna | |
X | |
X.include "../../inputmethod/canna-lib/buildlink3.mk" | |
X | |
Xpost-patch: | |
X ${MV} ${WRKSRC}/Imakefile ${WRKSRC}/Imakefile.orig | |
X ${SED} -e 's|\(SUBDIRS = \).*|\1 canna lib/RK lib/RKindep server cmd doc|' \ | |
X -e 's|\(SERVERDIR = \).*|\1 server cmd doc|' \ | |
X ${WRKSRC}/Imakefile.orig > ${WRKSRC}/Imakefile | |
X ${MV} ${WRKSRC}/Canna.conf ${WRKSRC}/Canna.conf.orig | |
X ${SED} -e 's|\(DicDir.*=\).*|\1${IMDICTDIR}/canna|' \ | |
X ${WRKSRC}/Canna.conf.orig > ${WRKSRC}/Canna.conf | |
X | |
X.include "../../mk/bsd.pkg.mk" | |
END-of-inputmethod/canna-server/Makefile | |
echo x - inputmethod/canna-server/PLIST | |
sed 's/^X//' >inputmethod/canna-server/PLIST << 'END-of-inputmethod/canna-server/PLIST' | |
X@comment $NetBSD: PLIST,v 1.8 2014/03/11 14:05:02 jperkin Exp $ | |
Xbin/addwords | |
Xbin/canlisp | |
Xbin/cannacheck | |
Xbin/cannastat | |
Xbin/catdic | |
Xbin/chkconc | |
Xbin/chmoddic | |
Xbin/cpdic | |
Xbin/crfreq | |
Xbin/crxdic | |
Xbin/crxgram | |
Xbin/cshost | |
Xbin/ctow | |
Xbin/delwords | |
Xbin/dicar | |
Xbin/dpbindic | |
Xbin/dpromdic | |
Xbin/dpxdic | |
Xbin/forcpp | |
Xbin/forsort | |
Xbin/kpdic | |
Xbin/lsdic | |
Xbin/mergeword | |
Xbin/mkbindic | |
Xbin/mkdic | |
Xbin/mkromdic | |
Xbin/mvdic | |
Xbin/rmdic | |
Xbin/splitword | |
Xbin/syncdic | |
Xbin/wtoc | |
Xman/ja_JP.EUC/man1/addwords.1 | |
Xman/ja_JP.EUC/man1/cannacheck.1 | |
Xman/ja_JP.EUC/man1/cannakill.1 | |
Xman/ja_JP.EUC/man1/cannaserver.1 | |
Xman/ja_JP.EUC/man1/cannastat.1 | |
Xman/ja_JP.EUC/man1/catdic.1 | |
Xman/ja_JP.EUC/man1/chmoddic.1 | |
Xman/ja_JP.EUC/man1/cpdic.1 | |
Xman/ja_JP.EUC/man1/cshost.1 | |
Xman/ja_JP.EUC/man1/ctow.1 | |
Xman/ja_JP.EUC/man1/delwords.1 | |
Xman/ja_JP.EUC/man1/dicar.1 | |
Xman/ja_JP.EUC/man1/dpbindic.1 | |
Xman/ja_JP.EUC/man1/dpromdic.1 | |
Xman/ja_JP.EUC/man1/lsdic.1 | |
Xman/ja_JP.EUC/man1/mkbindic.1 | |
Xman/ja_JP.EUC/man1/mkdic.1 | |
Xman/ja_JP.EUC/man1/mkromdic.1 | |
Xman/ja_JP.EUC/man1/mvdic.1 | |
Xman/ja_JP.EUC/man1/rmdic.1 | |
Xman/ja_JP.EUC/man1/splitword.1 | |
Xman/ja_JP.EUC/man1/wtoc.1 | |
Xman/man1/addwords.1 | |
Xman/man1/cannacheck.1 | |
Xman/man1/cannakill.1 | |
Xman/man1/cannaserver.1 | |
Xman/man1/cannastat.1 | |
Xman/man1/catdic.1 | |
Xman/man1/chmoddic.1 | |
Xman/man1/cpdic.1 | |
Xman/man1/cshost.1 | |
Xman/man1/ctow.1 | |
Xman/man1/delwords.1 | |
Xman/man1/dicar.1 | |
Xman/man1/dpbindic.1 | |
Xman/man1/dpromdic.1 | |
Xman/man1/lsdic.1 | |
Xman/man1/mkbindic.1 | |
Xman/man1/mkdic.1 | |
Xman/man1/mkromdic.1 | |
Xman/man1/mvdic.1 | |
Xman/man1/rmdic.1 | |
Xman/man1/splitword.1 | |
Xman/man1/wtoc.1 | |
Xsbin/cannakill | |
Xsbin/cannaserver | |
END-of-inputmethod/canna-server/PLIST | |
exit | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment