is probably not worth the effort.
-# $OpenBSD: Makefile,v 1.7 1999/11/14 17:34:24 millert Exp $
+# $OpenBSD: Makefile,v 1.8 2000/04/15 05:22:14 millert Exp $
PROG= window
SRCS= char.c cmd.c cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c cmd7.c \
wwterminfo.c wwtty.c wwunframe.c wwupdate.c wwwrite.c xx.c xxflush.c \
compress.c
MAN= window.1
-DPADD= ${LIBOCURSES}
-LDADD= -locurses
-CFLAGS+=-D_USE_OLD_CURSES_
+DPADD= ${LIBCURSES}
+LDADD= -lcurses
.include <bsd.prog.mk>
-/* $OpenBSD: char.h,v 1.4 1999/11/14 17:34:24 millert Exp $ */
+/* $OpenBSD: char.h,v 1.5 2000/04/15 05:22:14 millert Exp $ */
/* $NetBSD: char.h,v 1.3 1995/09/28 10:34:01 tls Exp $ */
/*
* using unctrl() by wwwrite() if ww_unctrl is set.
*/
#include <curses.h>
+#if defined(TERMINFO) || defined(NCURSES_VERSION)
+#include <term.h>
+#endif
extern char _cmap[];
#define ctrl(c) (c & 0x1f)
-/* $OpenBSD: cmd.c,v 1.4 1997/02/25 00:03:54 downsj Exp $ */
+/* $OpenBSD: cmd.c,v 1.5 2000/04/15 05:22:14 millert Exp $ */
/* $NetBSD: cmd.c,v 1.4 1996/02/08 20:44:57 mycroft Exp $ */
/*
#if 0
static char sccsid[] = "@(#)cmd.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: cmd.c,v 1.4 1997/02/25 00:03:54 downsj Exp $";
+static char rcsid[] = "$OpenBSD: cmd.c,v 1.5 2000/04/15 05:22:14 millert Exp $";
#endif
#endif /* not lint */
out = 1;
break;
case '%':
- if ((w = getwin()) != 0)
+ if ((w = getwindow()) != 0)
setselwin(w);
break;
case ctrl('^'):
error("No previous window.");
break;
case 'c':
- if ((w = getwin()) != 0)
+ if ((w = getwindow()) != 0)
closewin(w);
break;
case 'w':
c_window();
break;
case 'm':
- if ((w = getwin()) != 0)
+ if ((w = getwindow()) != 0)
c_move(w);
break;
case 'M':
- if ((w = getwin()) != 0)
+ if ((w = getwindow()) != 0)
movewin(w, w->ww_alt.t, w->ww_alt.l);
break;
case 's':
- if ((w = getwin()) != 0)
+ if ((w = getwindow()) != 0)
c_size(w);
break;
case 'S':
- if ((w = getwin()) != 0)
+ if ((w = getwindow()) != 0)
sizewin(w, w->ww_alt.nr, w->ww_alt.nc);
break;
case 'y':
}
struct ww *
-getwin()
+getwindow()
{
register int c;
struct ww *w = 0;
-/* $OpenBSD: cmd6.c,v 1.3 1997/02/25 00:04:00 downsj Exp $ */
+/* $OpenBSD: cmd6.c,v 1.4 2000/04/15 05:22:14 millert Exp $ */
/* $NetBSD: cmd6.c,v 1.3 1995/09/28 10:34:10 tls Exp $ */
/*
#if 0
static char sccsid[] = "@(#)cmd6.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: cmd6.c,v 1.3 1997/02/25 00:04:00 downsj Exp $";
+static char rcsid[] = "$OpenBSD: cmd6.c,v 1.4 2000/04/15 05:22:14 millert Exp $";
#endif
#endif /* not lint */
debug_str();
break;
case 'v':
- if ((w = getwin()) != 0)
+ if ((w = getwindow()) != 0)
wwdumpnvis(w);
break;
case 'w':
- if ((w = getwin()) != 0)
+ if ((w = getwindow()) != 0)
wwdumpwin(w);
break;
default:
-/* $OpenBSD: defs.h,v 1.4 1997/06/24 02:44:45 dgregor Exp $ */
+/* $OpenBSD: defs.h,v 1.5 2000/04/15 05:22:14 millert Exp $ */
/* $NetBSD: defs.h,v 1.3 1995/09/28 10:34:19 tls Exp $ */
/*
char debug; /* debug mode */
char incmd; /* in command mode */
-struct ww *getwin();
+struct ww *getwindow();
struct ww *openwin();
struct ww *vtowin();
struct ww *openiwin();
-/* $OpenBSD: ttinit.c,v 1.6 2000/04/14 18:43:34 millert Exp $ */
+/* $OpenBSD: ttinit.c,v 1.7 2000/04/15 05:22:14 millert Exp $ */
/* $NetBSD: ttinit.c,v 1.3 1995/09/28 10:34:50 tls Exp $ */
/*
#if 0
static char sccsid[] = "@(#)ttinit.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: ttinit.c,v 1.6 2000/04/14 18:43:34 millert Exp $";
+static char rcsid[] = "$OpenBSD: ttinit.c,v 1.7 2000/04/15 05:22:14 millert Exp $";
#endif
#endif /* not lint */
*/
#ifdef NCURSES_VERSION
wwterm = strdup(_nc_first_name(cur_term->type.term_names));
-#else
+#elif !defined(TERMINFO)
if ((p = strchr(wwtermcap, '|')) && p - wwtermcap == 2) {
/* Skip the two-character short name. */
for (p = wwtermcap; *p && *p != '|' && *p != ':'; p++)
-/* $OpenBSD: wwinit.c,v 1.9 1999/11/14 17:34:24 millert Exp $ */
+/* $OpenBSD: wwinit.c,v 1.10 2000/04/15 05:22:14 millert Exp $ */
/* $NetBSD: wwinit.c,v 1.11 1996/02/08 21:49:07 mycroft Exp $ */
/*
#if 0
static char sccsid[] = "@(#)wwinit.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: wwinit.c,v 1.9 1999/11/14 17:34:24 millert Exp $";
+static char rcsid[] = "$OpenBSD: wwinit.c,v 1.10 2000/04/15 05:22:14 millert Exp $";
#endif
#endif /* not lint */
#include "tt.h"
#include <sys/signal.h>
#include <fcntl.h>
-#include <curses.h>
#include "char.h"
wwinit()
wwerrno = WWE_BADTERM;
goto bad;
}
+#ifdef TERMINFO
+ if (setupterm(wwterm, STDOUT_FILENO, NULL) != 0) {
+ wwerrno = WWE_BADTERM;
+ goto bad;
+ }
+#else
if (tgetent(wwtermcap, wwterm) != 1) {
wwerrno = WWE_BADTERM;
goto bad;
}
+#endif
#ifdef OLD_TTY
wwospeed = wwoldtty.ww_sgttyb.sg_ospeed;
#else