]> thyrsus.com Git - morse-classic.git/commitdiff
Get rid of BSD tty support.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 24 Jan 2005 16:02:57 +0000 (16:02 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 24 Jan 2005 16:02:57 +0000 (16:02 +0000)
morse.c

diff --git a/morse.c b/morse.c
index 1437a37c3d2a4f95bc8ea5795e60ec6de50504b0..73e3a78bae744e59480b1cf8481d5ce46584f338 100644 (file)
--- a/morse.c
+++ b/morse.c
@@ -133,8 +133,6 @@ char            copyleftjoe[] =
 #include <signal.h>
 #include "beep.h"
 
-#define USG
-
 #define FREQUENCY      800.0
 #define FREQUENCY2     602.0
 #define VOLUME         0.5
@@ -1824,29 +1822,19 @@ toneflush (void)
 
 #include <sys/ioctl.h>
 #include <fcntl.h>
-#ifdef USG
 #include <termio.h>
 struct termio   oldtermgtty;
 struct termio   termgtty;
-#else
-#include <sys/file.h>
-struct sgttyb   oldtermgtty;
-struct sgttyb   termgtty;
-#endif
 static char    *terminal = "/dev/tty";
 static int      termfd;
 static int      termopen = 0;
-
-#ifndef USG
 static int      oldflgs, newflgs;
-#endif
 
 static void
 openterminal (void)
 {
     /* get parameters and open terminal */
 
-#ifdef USG
     termfd = open (terminal, O_RDWR | O_NDELAY, 0);
     ioctl (termfd, TCGETA, &termgtty);
     oldtermgtty = termgtty;
@@ -1856,18 +1844,6 @@ openterminal (void)
     termgtty.c_cc[VMIN] = 1;
     termgtty.c_cc[VTIME] = 0;
     ioctl (termfd, TCSETAW, &termgtty);
-#else
-    termfd = open (terminal, O_RDWR, 0);
-    ioctl (termfd, TIOCGETP, &termgtty);
-    oldtermgtty = termgtty;
-    if (typeaway != LETMESEE)
-       termgtty.sg_flags &= ~ECHO;
-    termgtty.sg_flags |= CBREAK;
-    ioctl (termfd, TIOCSETP, &termgtty);
-    oldflgs = fcntl (termfd, F_GETFL);
-    newflgs = oldflgs | FNDELAY;
-#endif
-
     termopen = 1;
 }
 
@@ -1878,13 +1854,7 @@ readterminal (char **string)
 static char     line[TESTBUFSZ];
 int             n;
 
-#ifndef USG
-    fcntl (termfd, F_SETFL, newflgs);
-#endif
     n = read (termfd, line, sizeof (line) - 1);
-#ifndef USG
-    fcntl (termfd, F_SETFL, oldflgs);
-#endif
 
     if (n > 0)
     {
@@ -1900,11 +1870,7 @@ int             n;
 static void
 closeterminal (void)
 {
-#ifdef USG
     ioctl (termfd, TCSETAW, &oldtermgtty);
-#else
-    ioctl (termfd, TIOCSETP, &oldtermgtty);
-#endif
     close (termfd);
 }