/*************************************************************************
* This program is copyright (C) 1985, 1986 by Jonathan Payne. It is *
* provided to you without charge for use only on a licensed Unix *
* system. You may copy JOVE provided that this notice is included with *
* the copy. You may not sell copies of this program or versions *
* modified for use on microcomputer systems, unless the copies are *
* included with a Unix system distribution and the source is provided. *
*************************************************************************/
/* Termcap definitions */
*M_IC
, /* Insert char with arg */
*M_DC
, /* Delete char with arg */
*M_AL
, /* Insert line with arg */
*M_DL
, /* Delete line with arg */
*SF
, /* Scroll forward */
*SP
, /* Send Cursor Position */
*RS
, /* Reverse video start */
*IP
, /* insert pad after character inserted */
ILI
, /* Internal lines, i.e., 23 of LI is 24. */
SG
, /* number of magic cookies left by SO and SE */
XS
, /* whether standout is braindamaged */
/* The ordering of ts and meas must agree !! */
static char *ts
="vsvealdlspcssosecmclcehoupbcicimdceillsfsrvbksketiteALDLICDCrsrepcip";
&VS
, &VE
, &AL
, &DL
, &SP
, &CS
, &SO
, &SE
,
&CM
, &CL
, &CE
, &HO
, &UP
, &BC
, &IC
, &IM
,
&DC
, &EI
, &LL
, &SF
, &SR
, &VB
, &KS
, &KE
,
&TI
, &TE
, &M_AL
, &M_DL
, &M_IC
, &M_DC
,
static char *ts
="vsvealdlspcssosecmclcehoupbcicimdceillsfsrvbksketiteALDLICDCpcip";
&VS
, &VE
, &AL
, &DL
, &SP
, &CS
, &SO
, &SE
,
&CM
, &CL
, &CE
, &HO
, &UP
, &BC
, &IC
, &IM
,
&DC
, &EI
, &LL
, &SF
, &SR
, &VB
, &KS
, &KE
,
&TI
, &TE
, &M_AL
, &M_DL
, &M_IC
, &M_DC
,
buf
[read(0, buf
, 12) - 1] = 0;
tbuff
[2048]; /* Good grief! */
termname
= getenv("TERM");
putstr("Enter terminal name: ");
if (tgetent(tbuff
, termname
) < 1)
TermError("[\"%s\" unknown terminal type?]", termname
);
if ((CO
= tgetnum("co")) == -1)
if ((LI
= tgetnum("li")) == -1)
if ((SG
= tgetnum("sg")) == -1)
SG
= 0; /* Used for mode line only */
if ((XS
= tgetflag("xs")) == -1)
XS
= 0; /* Used for mode line only */
for (i
= 0; meas
[i
]; i
++) {
*(meas
[i
]) = (char *) tgetstr(ts
, &termp
);
#ifdef LSRHS /* We, at the high school, are the only ones who
do SO right in termcap, but unfortunately the
right SO doesn't look as good with modelines. */
/* I only ever use SO for the modeline anyway. */
/* SO is really BOLDFACE! Why is LS always right and the rest of the
if (CanScroll
= ((AL
&& DL
) || CS
))