summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hack/hack.termcap.c34
-rw-r--r--larn/io.c23
-rw-r--r--tetris/screen.c9
3 files changed, 29 insertions, 37 deletions
diff --git a/hack/hack.termcap.c b/hack/hack.termcap.c
index 09782246..c9ccb9e1 100644
--- a/hack/hack.termcap.c
+++ b/hack/hack.termcap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.termcap.c,v 1.10 2000/05/20 14:01:42 blymn Exp $ */
+/* $NetBSD: hack.termcap.c,v 1.11 2001/11/02 18:27:00 christos Exp $ */
/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
@@ -6,7 +6,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.termcap.c,v 1.10 2000/05/20 14:01:42 blymn Exp $");
+__RCSID("$NetBSD: hack.termcap.c,v 1.11 2001/11/02 18:27:00 christos Exp $");
#endif /* not lint */
#include <string.h>
@@ -18,7 +18,6 @@ __RCSID("$NetBSD: hack.termcap.c,v 1.10 2000/05/20 14:01:42 blymn Exp $");
#include "extern.h"
#include "def.flag.h" /* for flags.nonull */
-static char *tbuf;
static struct tinfo *info;
static char *HO, *CL, *CE, *UP, *CM, *ND, *XD, *BC, *SO, *SE, *TI, *TE;
static char *VS, *VE;
@@ -32,9 +31,8 @@ void
startup()
{
char *term;
- char *tbufptr, *pc;
+ char *pc;
- tbuf = NULL;
if (!(term = getenv("TERM")))
error("Can't get TERM.");
@@ -42,45 +40,45 @@ startup()
flags.nonull = 1; /* this should be a termcap flag */
if (t_getent(&info, term) < 1)
error("Unknown terminal type: %s.", term);
- if ((pc = t_agetstr(info, "pc", &tbuf, &tbufptr)) != NULL)
+ if ((pc = t_agetstr(info, "pc")) != NULL)
PC = *pc;
- if (!(BC = t_agetstr(info, "bc", &tbuf, &tbufptr))) {
+ if (!(BC = t_agetstr(info, "bc"))) {
if (!t_getflag(info, "bs"))
error("Terminal must backspace.");
BC = &BC_char;
}
- HO = t_agetstr(info, "ho", &tbuf, &tbufptr);
+ HO = t_agetstr(info, "ho");
CO = t_getnum(info, "co");
LI = t_getnum(info, "li");
if (CO < COLNO || LI < ROWNO + 2)
setclipped();
- if (!(CL = t_agetstr(info, "cl", &tbuf, &tbufptr)))
+ if (!(CL = t_agetstr(info, "cl")))
error("Hack needs CL.");
- ND = t_agetstr(info, "nd", &tbuf, &tbufptr);
+ ND = t_agetstr(info, "nd");
if (t_getflag(info, "os"))
error("Hack can't have OS.");
- CE = t_agetstr(info, "ce", &tbuf, &tbufptr);
- UP = t_agetstr(info, "up", &tbuf, &tbufptr);
+ CE = t_agetstr(info, "ce");
+ UP = t_agetstr(info, "up");
/*
* It seems that xd is no longer supported, and we should use a
* linefeed instead; unfortunately this requires resetting CRMOD, and
* many output routines will have to be modified slightly. Let's
* leave that till the next release.
*/
- XD = t_agetstr(info, "xd", &tbuf, &tbufptr);
- /* not: XD = t_agetstr(info, "do", &tbuf, &tbufptr); */
- if (!(CM = t_agetstr(info, "cm", &tbuf, &tbufptr))) {
+ XD = t_agetstr(info, "xd");
+ /* not: XD = t_agetstr(info, "do"); */
+ if (!(CM = t_agetstr(info, "cm"))) {
if (!UP && !HO)
error("Hack needs CM or UP or HO.");
printf("Playing hack on terminals without cm is suspect...\n");
getret();
}
- SO = t_agetstr(info, "so", &tbuf, &tbufptr);
- SE = t_agetstr(info, "se", &tbuf, &tbufptr);
+ SO = t_agetstr(info, "so");
+ SE = t_agetstr(info, "se");
SG = t_getnum(info, "sg"); /* -1: not fnd; else # of spaces left by so */
if (!SO || !SE || (SG > 0))
SO = SE = 0;
- CD = t_agetstr(info, "cd", &tbuf, &tbufptr);
+ CD = t_agetstr(info, "cd");
set_whole_screen(); /* uses LI and CD */
}
diff --git a/larn/io.c b/larn/io.c
index c7233271..f769312c 100644
--- a/larn/io.c
+++ b/larn/io.c
@@ -1,4 +1,4 @@
-/* $NetBSD: io.c,v 1.12 2001/09/24 13:22:29 wiz Exp $ */
+/* $NetBSD: io.c,v 1.13 2001/11/02 18:27:00 christos Exp $ */
/*
* io.c Larn is copyrighted 1986 by Noah Morgan.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: io.c,v 1.12 2001/09/24 13:22:29 wiz Exp $");
+__RCSID("$NetBSD: io.c,v 1.13 2001/11/02 18:27:00 christos Exp $");
#endif /* not lint */
#include "header.h"
@@ -764,7 +764,6 @@ cursors()
* obvious meanings.
*/
-static char *cap;
struct tinfo *info;
char *CM, *CE, *CD, *CL, *SO, *SE, *AL, *DL; /* Termcap capabilities */
static char *outbuf = 0; /* translated output buffer */
@@ -775,10 +774,8 @@ static char *outbuf = 0; /* translated output buffer */
void
init_term()
{
- char *capptr;
char *term;
- cap = NULL;
switch (t_getent(&info, term = getenv("TERM"))) {
case -1:
write(2, "Cannot open termcap file.\n", 26);
@@ -790,16 +787,16 @@ init_term()
exit(1);
};
- CM = t_agetstr(info, "cm", &cap, &capptr); /* Cursor motion */
- CE = t_agetstr(info, "ce", &cap, &capptr); /* Clear to eoln */
- CL = t_agetstr(info, "cl", &cap, &capptr); /* Clear screen */
+ CM = t_agetstr(info, "cm"); /* Cursor motion */
+ CE = t_agetstr(info, "ce"); /* Clear to eoln */
+ CL = t_agetstr(info, "cl"); /* Clear screen */
/* OPTIONAL */
- AL = t_agetstr(info, "al", &cap, &capptr); /* Insert line */
- DL = t_agetstr(info, "dl", &cap, &capptr); /* Delete line */
- SO = t_agetstr(info, "so", &cap, &capptr); /* Begin standout mode */
- SE = t_agetstr(info, "se", &cap, &capptr); /* End standout mode */
- CD = t_agetstr(info, "cd", &cap, &capptr); /* Clear to end of display */
+ AL = t_agetstr(info, "al"); /* Insert line */
+ DL = t_agetstr(info, "dl"); /* Delete line */
+ SO = t_agetstr(info, "so"); /* Begin standout mode */
+ SE = t_agetstr(info, "se"); /* End standout mode */
+ CD = t_agetstr(info, "cd"); /* Clear to end of display */
if (!CM) { /* can't find cursor motion entry */
write(2, "Sorry, for a ", 13);
diff --git a/tetris/screen.c b/tetris/screen.c
index 069e48a5..49031645 100644
--- a/tetris/screen.c
+++ b/tetris/screen.c
@@ -1,4 +1,4 @@
-/* $NetBSD: screen.c,v 1.15 2000/05/24 14:43:00 blymn Exp $ */
+/* $NetBSD: screen.c,v 1.16 2001/11/02 18:27:00 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -120,7 +120,6 @@ struct tcsinfo { /* termcap string info; some abbrevs above */
/* This is where we will actually stuff the information */
-static char *combuf;
static struct tinfo *info;
/*
@@ -160,7 +159,7 @@ scr_init()
#ifdef unneeded
static int ncflag;
#endif
- char *term, *fill;
+ char *term;
static struct tcninfo { /* termcap numeric and flag info */
char tcname[3];
int *tcaddr;
@@ -183,13 +182,11 @@ scr_init()
stop("you must set the TERM environment variable");
if (t_getent(&info, term) <= 0)
stop("cannot find your termcap");
- combuf = NULL;
{
register struct tcsinfo *p;
for (p = tcstrings; p->tcaddr; p++)
- *p->tcaddr = t_agetstr(info, p->tcname, &combuf,
- &fill);
+ *p->tcaddr = t_agetstr(info, p->tcname);
}
{
register struct tcninfo *p;