/* Log: term.c,v
* Revision 7.0.1.2 86/12/12 17:04:09 lwall
* Baseline for net release.
- *
+ *
* Revision 7.0.1.1 86/10/16 10:53:20 lwall
* Added Damage. Fixed random bugs.
- *
+ *
* Revision 7.0 86/10/08 15:14:02 lwall
* Split into separate files. Added amoebas and pirates.
- *
+ *
*/
#include "EXTERN.h"
{
savetty(); /* remember current tty state */
-#ifdef TERMIO
- ospeed = _tty.c_cflag & CBAUD; /* for tputs() */
+#if defined(TERMIO) || defined(TERMIOS)
+ ospeed = cfgetospeed(&_tty);
ERASECH = _tty.c_cc[VERASE]; /* for finish_command() */
KILLCH = _tty.c_cc[VKILL]; /* for finish_command() */
#else
#endif
#endif
#endif
-
+
/* get all that good termcap stuff */
retval = tgetent(tcbuf,getenv("TERM")); /* get termcap entry */
for (p=filler+(sizeof filler)-1;!*p;--p)
*p = PC;
}
- charsperhalfsec = ospeed >= B9600 ? 480 :
- ospeed == B4800 ? 240 :
- ospeed == B2400 ? 120 :
- ospeed == B1200 ? 60 :
- ospeed == B600 ? 30 :
- /* speed is 300 (?) */ 15;
-
- gfillen = ospeed >= B9600 ? (int /*XXX: speed_t*/)(sizeof filler) :
- ospeed == B4800 ? 13 :
- ospeed == B2400 ? 7 :
- ospeed == B1200 ? 4 :
- (1+BCsize);
- if (ospeed < B2400)
+ charsperhalfsec = (speed_t)ospeed >= B9600 ? (speed_t)480 :
+ (speed_t)ospeed == B4800 ? (speed_t)240 :
+ (speed_t)ospeed == B2400 ? (speed_t)120 :
+ (speed_t)ospeed == B1200 ? (speed_t)60 :
+ (speed_t)ospeed == B600 ? (speed_t)30 :
+ /* speed is 300 (?) */ (speed_t)15;
+
+ gfillen = (speed_t)ospeed >= B9600 ? (speed_t)(sizeof filler) :
+ (speed_t)ospeed == B4800 ? (speed_t)13 :
+ (speed_t)ospeed == B2400 ? (speed_t)7 :
+ (speed_t)ospeed == B1200 ? (speed_t)4 :
+ (speed_t)(1+BCsize);
+ if ((speed_t)ospeed < B2400)
lowspeed = true;
strcpy(term,ttyname(2));
no_can_do("dumb");
if (!scorespec && (LINES < 24 || COLS < 80))
no_can_do("puny");
- if (LINES > 25)
- no_can_do("humongus");
+// if (LINES > 25)
+// no_can_do("humongous");
crmode();
raw();
getcmd(spbuf);
} while (*spbuf != ' ');
rewrite();
-
+
}
void
#ifdef PUSHBACK
KEYMAP *curmap;
int i;
- bool no_macros;
+ bool no_macros;
int times = 0; /* loop detector */
char scrchar;
unsigned char *whatbuf = (void *)wbuf;
}
got_canonical:
-#ifndef TERMIO
+#if !defined(TERMIO) && !defined(TERMIOS)
if (*whatbuf == '\r')
*whatbuf = '\n';
#endif
assert(str != NULL);
interp(s,PUSHSIZE,str);
for (i = strlen(s)-1; i >= 0; --i) {
- s[i] ^= 0200;
+ s[i] ^= 0200;
pushchar(s[i]);
}
}