Xlisp 2.0 on SCO Xenix
Peter da Silva
peter at ficc.UUCP
Thu May 19 00:48:32 AEST 1988
Reposted because it didn't get off-site (news was busted. My fault).
In article <21 at libove.UUCP>, root at libove.UUCP writes:
> Xlisp... on SCO Xenix SysV/286 rel 2.2.1 with development system 2.1.4d,
> the terminal gets put in a strange mode...
> The code that sets up the terminal is:
> ioctl( 0, TIOCGETP, &tty_old );
> tty_new = tty_old;
> tty_new.sg_flags &= ~(ECHO);
> tty_new.sg_flags |= RAW|CRMOD;
> ioctl( 0, TIOCSETP, &tty_new );
> Can someone tell me where this is going wrong, or perhaps if they have
> written the module necessary to put Xlisp 2.0 on SCO Xenix?
What's going wrong is that Xlisp is dorking with the terminal at all. I
have Xlisp 1.6, and I ripped out all the PC-DOS style cbreak-mode I/O
completely. There's no need for Xlisp to do erase and kill processing.
The terminal driver does an adequate job on Xenix, and an excellent job
on BSD.
I'd like to upgrade to a later release than 1.6, myself. Anyone nearby got
2.0?
The relevent code I use is:
---- unixio.c ----
#include "xlisp.h"
extern int prompt;
extern int errno;
int osgetc(fp)
FILE *fp;
{
int ch;
ch = getc(fp);
if(fp==stdin)
if(ch=='\n')
prompt = 1;
return ch;
}
osputc(ch, fp)
int ch;
FILE *fp;
{
putc(ch, fp);
}
osinit(banner)
{
if(isatty(fileno(stdin)) && isatty(fileno(stdout)))
fprintf(stderr, "%s\n", banner);
}
oscheck()
{
}
osfinit()
{
}
---- end ----
For most purposes under UNIX, you won't need any more than this. Any
extensions (such as (raw), (cbreak), or even (stty ...) and (gtty... ))
should be done by defining a bunch of functions and setting them up in
osfinit().
You may find you have to provide osrand() as well:
---- unixmisc.c ----
#include "xlisp.h"
#define MAXRND 32767
int osrand(n)
int n;
{
int m;
do
;
while ( (m = rand()) > (MAXRND % n) * n );
return (m % n);
}
---- end ----
--
-- Peter da Silva, Ferranti International Controls Corporation.
-- Phone: 713-274-5180. Remote UUCP: uunet!nuchat!sugar!peter.
More information about the Comp.unix.xenix
mailing list