Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!bellcore!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.sources.games Subject: Re: hack.tty.c for SysVR2 Message-ID: <2159@sun.uucp> Date: Sat, 4-May-85 06:08:11 EDT Article-I.D.: sun.2159 Posted: Sat May 4 06:08:11 1985 Date-Received: Mon, 6-May-85 00:55:53 EDT References: <399@ho95b.UUCP> Organization: Sun Microsystems, Inc. Lines: 31 > #ifdef BSD This should be "#ifdef V7"; it's not the BSD driver that's being used, it's the V7 driver (the BSD driver is a V7 superset). > #define CBREAK ICANON Nope. Turning CBREAK *on* is equivalent to turning ICANON off. However, the later code doesn't use CBREAK for the USDL driver, and does recognize that the sense of the bit is reversed, so this may not be a problem. > #ifdef BSD > register int cf = (flags.cbreak == ON) ? CBREAK : 0; > #else > register int cf = (flags.cbreak == ON) ? 0 : ICANON; > #endif > ... > #ifdef BSD > if((curttyb.sg_flags & CBREAK) != cf){ > curttyb.sg_flags &= ~CBREAK; > #else > if((curttyb.sg_flags & ICANON || curttyb.c_cc[VMIN] > 1 ) != cf){ I'd remove the test of c_cc[VMIN] if I were you - the appearance of the "||" means that the LHS of the comparison will be 1 or 0, but the RHS is "cf" which is either ICANON or 0 - ICANON is, if I remember correctly, 2 not 1. Other than that, it looks sane. Guy Harris