From: millert Date: Sat, 15 Apr 2000 05:22:14 +0000 (+0000) Subject: Modify to build with ncurses, not ocurses. A proper port to terminfo X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9627b994aa634be8a0c0cab8092a7018dcb00bf2;p=openbsd Modify to build with ncurses, not ocurses. A proper port to terminfo is probably not worth the effort. --- diff --git a/usr.bin/window/Makefile b/usr.bin/window/Makefile index 201e77f8e39..18386e4fbe4 100644 --- a/usr.bin/window/Makefile +++ b/usr.bin/window/Makefile @@ -1,4 +1,4 @@ -# $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 \ @@ -15,8 +15,7 @@ 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 diff --git a/usr.bin/window/char.h b/usr.bin/window/char.h index 9856454f31b..f078305b132 100644 --- a/usr.bin/window/char.h +++ b/usr.bin/window/char.h @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -50,6 +50,9 @@ * using unctrl() by wwwrite() if ww_unctrl is set. */ #include +#if defined(TERMINFO) || defined(NCURSES_VERSION) +#include +#endif extern char _cmap[]; #define ctrl(c) (c & 0x1f) diff --git a/usr.bin/window/cmd.c b/usr.bin/window/cmd.c index 08ac97d0682..ae951e0996a 100644 --- a/usr.bin/window/cmd.c +++ b/usr.bin/window/cmd.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -41,7 +41,7 @@ #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 */ @@ -100,7 +100,7 @@ docmd() out = 1; break; case '%': - if ((w = getwin()) != 0) + if ((w = getwindow()) != 0) setselwin(w); break; case ctrl('^'): @@ -112,26 +112,26 @@ docmd() 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': @@ -220,7 +220,7 @@ docmd() } struct ww * -getwin() +getwindow() { register int c; struct ww *w = 0; diff --git a/usr.bin/window/cmd6.c b/usr.bin/window/cmd6.c index 4198f5dd9a5..6902a71464e 100644 --- a/usr.bin/window/cmd6.c +++ b/usr.bin/window/cmd6.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -41,7 +41,7 @@ #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 */ @@ -78,11 +78,11 @@ c_debug() 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: diff --git a/usr.bin/window/defs.h b/usr.bin/window/defs.h index aff43d26a95..1fb9f82c073 100644 --- a/usr.bin/window/defs.h +++ b/usr.bin/window/defs.h @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -70,7 +70,7 @@ char terse; /* terse mode */ char debug; /* debug mode */ char incmd; /* in command mode */ -struct ww *getwin(); +struct ww *getwindow(); struct ww *openwin(); struct ww *vtowin(); struct ww *openiwin(); diff --git a/usr.bin/window/ttinit.c b/usr.bin/window/ttinit.c index 360a9c4702f..8895c359ec7 100644 --- a/usr.bin/window/ttinit.c +++ b/usr.bin/window/ttinit.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -41,7 +41,7 @@ #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 */ @@ -98,7 +98,7 @@ ttinit() */ #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++) diff --git a/usr.bin/window/wwinit.c b/usr.bin/window/wwinit.c index 6215ac41c5c..79e9ac4d56a 100644 --- a/usr.bin/window/wwinit.c +++ b/usr.bin/window/wwinit.c @@ -1,4 +1,4 @@ -/* $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 $ */ /* @@ -41,7 +41,7 @@ #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 */ @@ -50,7 +50,6 @@ static char rcsid[] = "$OpenBSD: wwinit.c,v 1.9 1999/11/14 17:34:24 millert Exp #include "tt.h" #include #include -#include #include "char.h" wwinit() @@ -129,10 +128,17 @@ 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