1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-22 04:17:44 +00:00

Fix build error without sgtty.h, and investigate some terminal codes.

PR:		ports/119113
Submitted by:	Ed Schouten  ed at fxq.nl
		Yoshihiko Sarumaru  mistral at imasy.or.jp (maintainer)
Approved by:	Yoshihiko Sarumaru  mistral at imasy.or.jp (maintainer)
This commit is contained in:
Norikatsu Shigemura 2008-02-04 17:03:48 +00:00
parent c0ec557460
commit ae40d9715c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=206717
3 changed files with 94 additions and 2 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= rogue_s
PORTVERSION= 1.3a
PORTREVISION= 1
CATEGORIES= japanese games
MASTER_SITES= ${MASTER_SITE_LOCAL} \
${MASTER_SITE_PORTS_JP:S,/%SUBDIR%/,/,}

View File

@ -16,7 +16,7 @@
-#CFLAGS = -O -g -DUNIX -DUNIX_BSD4_2 -DUNIX_386BSD -DCURSES -DJAPAN -DEUC -DTOPSCO
-#LIBS =
+CC = cc
+CFLAGS += -DUNIX -DUNIX_BSD4_2 -DUNIX_386BSD -DCURSES -DJAPAN -DEUC -DTOPSCO -DCOLOR -DMESG_DIR=\"${PREFIX}/share/rogue\" -DLIST_MESSAGES
+CFLAGS += -DUNIX -DUNIX_SYSV -DUNIX_386BSD -DCURSES -DJAPAN -DEUC -DTOPSCO -DCOLOR -DMESG_DIR=\"${PREFIX}/share/rogue\" -DLIST_MESSAGES
+LIBS =
# for NeXT (Japanese, using jcurses of NeXT) by Yasha

View File

@ -1,6 +1,70 @@
--- machdep.c.orig Mon Sep 14 14:40:12 1992
+++ machdep.c Fri Dec 4 00:22:26 1998
@@ -397,9 +397,9 @@
@@ -54,9 +54,10 @@
# include <sys/types.h>
# include <sys/file.h>
# include <sys/stat.h>
+# include <sys/ioctl.h>
# ifdef UNIX_SYSV
# include <time.h>
-# include <termio.h>
+# include <termios.h>
# endif /* UNIX_SYSV */
# ifdef UNIX_BSD4_2
# include <sys/time.h>
@@ -268,13 +269,7 @@
#ifdef UNIX
long ln = 0;
-#ifdef UNIX_BSD4_2
ioctl(0, FIONREAD, &ln);
-#endif /* UNIX_BSD4_2 */
-#ifdef UNIX_SYSV
- ioctl(0, TCFLSH, &ln);
- ln = 0;
-#endif /* UNIX_SYSV */
#ifdef UNIX_386BSD
fpurge(stdin);
#else
@@ -334,8 +329,8 @@
struct tchars tc_temp;
#endif /* UNIX_BSD4_2 */
#ifdef UNIX_SYSV
- static struct termio _oldtty;
- struct termio _tty;
+ static struct termios _oldtty;
+ struct termios _tty;
#endif /* UNIX_SYSV */
if (!called_before) {
@@ -345,7 +340,7 @@
ioctl(0, TIOCGLTC, &ltc_orig);
#endif /* UNIX_BSD4_2 */
#ifdef UNIX_SYSV
- ioctl(0, TCGETA, &_oldtty);
+ tcgetattr(0, &_oldtty);
#endif /* UNIX_SYSV */
}
#ifdef UNIX_BSD4_2
@@ -364,7 +359,7 @@
tc_temp.t_startc = tc_temp.t_stopc = -1;
#endif /* UNIX_BSD4_2 */
#ifdef UNIX_SYSV
- _tty.c_cc[VSWTCH] = CNSWTCH;
+ _tty.c_cc[VSUSP] = _tty.c_cc[VDSUSP] = 0;
#endif /* UNIX_SYSV */
}
#ifdef UNIX_BSD4_2
@@ -372,7 +367,7 @@
ioctl(0, TIOCSLTC, &ltc_temp);
#endif /* UNIX_BSD4_2 */
#ifdef UNIX_SYSV
- ioctl(0, TCSETA, &_tty);
+ tcsetattr(0, TCSANOW, &_tty);
#endif /* UNIX_SYSV */
#endif /* UNIX */
}
@@ -397,9 +392,9 @@
md_heed_signals()
{
#ifdef UNIX
@ -13,3 +77,30 @@
#endif /* UNIX */
#ifdef HUMAN
@@ -907,19 +902,19 @@
}
#endif /* UNIX_BSD4_2 */
#ifdef UNIX_SYSV
- struct termio tty_buf;
- static struct termio tty_save;
+ struct termios tty_buf;
+ static struct termios tty_save;
if (on) {
- ioctl(0, TCGETA, &tty_buf);
+ tcgetattr(0, &tty_buf);
tty_save = tty_buf;
tty_buf.c_lflag &= ~(ICANON | ECHO);
tty_buf.c_oflag &= ~ONLCR;
- tty_buf.c_cc[4] = 1; /* MIN */
- tty_buf.c_cc[5] = 2; /* TIME */
- ioctl(0, TCSETAF, &tty_buf);
+ tty_buf.c_cc[VMIN] = 1;
+ tty_buf.c_cc[VTIME] = 2;
+ tcsetattr(0, TCSAFLUSH, &tty_buf);
} else {
- ioctl(0, TCSETAF, &tty_save);
+ tcsetattr(0, TCSAFLUSH, &tty_save);
}
#endif /* UNIX_SYSV */
#endif /* UNIX */