diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1999-11-14 17:34:25 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1999-11-14 17:34:25 +0000 |
commit | 24c993d46ca2f888f6be6baf256bab1d17bdffa0 (patch) | |
tree | e26f0f93dd5cd7dc09fec09407622a1ba0708348 /usr.bin | |
parent | bc8cbbd687d0349dcd8509123625f8e894087662 (diff) |
o link with -ocurses for now since window does not work properly with ncurses
o use mkdtemp(), not mktemp + mkdir in TERMINFO support
o correct program paths for TERMINFO support
o use the curses unctrl() function instead of a private one
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/window/Makefile | 7 | ||||
-rw-r--r-- | usr.bin/window/char.c | 39 | ||||
-rw-r--r-- | usr.bin/window/char.h | 7 | ||||
-rw-r--r-- | usr.bin/window/local.h | 6 | ||||
-rw-r--r-- | usr.bin/window/ttinit.c | 8 | ||||
-rw-r--r-- | usr.bin/window/wwinit.c | 6 | ||||
-rw-r--r-- | usr.bin/window/wwterminfo.c | 10 |
7 files changed, 24 insertions, 59 deletions
diff --git a/usr.bin/window/Makefile b/usr.bin/window/Makefile index 9c56e0e50d5..201e77f8e39 100644 --- a/usr.bin/window/Makefile +++ b/usr.bin/window/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.6 1998/07/24 00:11:09 millert Exp $ +# $OpenBSD: Makefile,v 1.7 1999/11/14 17:34:24 millert Exp $ PROG= window SRCS= char.c cmd.c cmd1.c cmd2.c cmd3.c cmd4.c cmd5.c cmd6.c cmd7.c \ @@ -15,7 +15,8 @@ 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= ${LIBCURSES} -LDADD= -lcurses +DPADD= ${LIBOCURSES} +LDADD= -locurses +CFLAGS+=-D_USE_OLD_CURSES_ .include <bsd.prog.mk> diff --git a/usr.bin/window/char.c b/usr.bin/window/char.c index ec485db4b4f..b026c04de6b 100644 --- a/usr.bin/window/char.c +++ b/usr.bin/window/char.c @@ -1,4 +1,4 @@ -/* $OpenBSD: char.c,v 1.3 1997/02/25 00:03:53 downsj Exp $ */ +/* $OpenBSD: char.c,v 1.4 1999/11/14 17:34:24 millert Exp $ */ /* $NetBSD: char.c,v 1.3 1995/09/28 10:34:00 tls Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)char.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: char.c,v 1.3 1997/02/25 00:03:53 downsj Exp $"; +static char rcsid[] = "$OpenBSD: char.c,v 1.4 1999/11/14 17:34:24 millert Exp $"; #endif #endif /* not lint */ @@ -120,38 +120,3 @@ char _cmap[] = { _C|_U, _C|_U, _C|_U, _C|_U, _C|_U, _C|_U, _C|_U, _C|_U }; - -char *_unctrl[] = { - "^@", "^A", "^B", "^C", "^D", "^E", "^F", "^G", - "^H", "^I", "^J", "^K", "^L", "^M", "^N", "^O", - "^P", "^Q", "^R", "^S", "^T", "^U", "^V", "^W", - "^X", "^Y", "^Z", "^[", "^\\", "^]", "^^", "^_", - " ", "!", "\"", "#", "$", "%", "&", "'", - "(", ")", "*", "+", ",", "-", ".", "/", - "0", "1", "2", "3", "4", "5", "6", "7", - "8", "9", ":", ";", "<", "=", ">", "?", - "@", "A", "B", "C", "D", "E", "F", "G", - "H", "I", "J", "K", "L", "M", "N", "O", - "P", "Q", "R", "S", "T", "U", "V", "W", - "X", "Y", "Z", "[", "\\", "]", "^", "_", - "`", "a", "b", "c", "d", "e", "f", "g", - "h", "i", "j", "k", "l", "m", "n", "o", - "p", "q", "r", "s", "t", "u", "v", "w", - "x", "y", "z", "{", "|", "}", "~", "^?", - "\\200","\\201","\\202","\\203","\\204","\\205","\\206","\\207", - "\\210","\\211","\\212","\\213","\\214","\\215","\\216","\\217", - "\\220","\\221","\\222","\\223","\\224","\\225","\\226","\\227", - "\\230","\\231","\\232","\\233","\\234","\\235","\\236","\\237", - "\\240","\\241","\\242","\\243","\\244","\\245","\\246","\\247", - "\\250","\\251","\\252","\\253","\\254","\\255","\\256","\\257", - "\\260","\\261","\\262","\\263","\\264","\\265","\\266","\\267", - "\\270","\\271","\\272","\\273","\\274","\\275","\\276","\\277", - "\\300","\\301","\\302","\\303","\\304","\\305","\\306","\\307", - "\\310","\\311","\\312","\\313","\\314","\\315","\\316","\\317", - "\\320","\\321","\\322","\\323","\\324","\\325","\\326","\\327", - "\\330","\\331","\\332","\\333","\\334","\\335","\\336","\\337", - "\\340","\\341","\\342","\\343","\\344","\\345","\\346","\\347", - "\\350","\\351","\\352","\\353","\\354","\\355","\\356","\\357", - "\\360","\\361","\\362","\\363","\\364","\\365","\\366","\\367", - "\\370","\\371","\\372","\\373","\\374","\\375","\\376","\\377" -}; diff --git a/usr.bin/window/char.h b/usr.bin/window/char.h index 7a0af7d354b..9856454f31b 100644 --- a/usr.bin/window/char.h +++ b/usr.bin/window/char.h @@ -1,4 +1,4 @@ -/* $OpenBSD: char.h,v 1.3 1997/02/25 00:03:53 downsj Exp $ */ +/* $OpenBSD: char.h,v 1.4 1999/11/14 17:34:24 millert Exp $ */ /* $NetBSD: char.h,v 1.3 1995/09/28 10:34:01 tls Exp $ */ /* @@ -42,8 +42,6 @@ /* * Macros and things to deal with control characters. * - * Unctrl() is just like the standard function, except we don't want - * to include curses. * Isctrl() returns true for all characters less than space and * greater than or equal to delete. * Isprt() is tab and all characters not isctrl(). It's used @@ -51,11 +49,10 @@ * Isunctrl() includes all characters that should be expanded * using unctrl() by wwwrite() if ww_unctrl is set. */ +#include <curses.h> -extern char *_unctrl[]; extern char _cmap[]; #define ctrl(c) (c & 0x1f) -#define unctrl(c) (_unctrl[(unsigned char) (c)]) #define _C 0x01 #define _P 0x02 #define _U 0x04 diff --git a/usr.bin/window/local.h b/usr.bin/window/local.h index 06fd8b55c08..b5dea77a0f6 100644 --- a/usr.bin/window/local.h +++ b/usr.bin/window/local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: local.h,v 1.3 1997/02/25 00:04:08 downsj Exp $ */ +/* $OpenBSD: local.h,v 1.4 1999/11/14 17:34:24 millert Exp $ */ /* $NetBSD: local.h,v 1.3 1995/09/28 10:34:26 tls Exp $ */ /* @@ -48,7 +48,7 @@ #define NLINE 48 /* default text buffer size */ #ifdef TERMINFO -#define _PATH_CAPTOINFO "/usr/5bin/captoinfo" -#define _PATH_TIC "/usr/5bin/tic" +#define _PATH_CAPTOINFO "/usr/bin/captoinfo" +#define _PATH_TIC "/usr/bin/tic" #define _PATH_RM "/bin/rm" #endif diff --git a/usr.bin/window/ttinit.c b/usr.bin/window/ttinit.c index 9d45997eda3..ea827ea7de2 100644 --- a/usr.bin/window/ttinit.c +++ b/usr.bin/window/ttinit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttinit.c,v 1.4 1998/04/26 22:49:07 millert Exp $ */ +/* $OpenBSD: ttinit.c,v 1.5 1999/11/14 17:34:24 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.4 1998/04/26 22:49:07 millert Exp $"; +static char rcsid[] = "$OpenBSD: ttinit.c,v 1.5 1999/11/14 17:34:24 millert Exp $"; #endif #endif /* not lint */ @@ -96,6 +96,9 @@ ttinit() * Use the standard name of the terminal (i.e. the second * name in termcap). */ +#ifdef NCURSES_VERSION + wwterm = strdup(_nc_first_name(cur_term->type.term_names)); +#else for (p = wwtermcap; *p && *p != '|' && *p != ':'; p++) ; if (*p == '|') @@ -108,6 +111,7 @@ ttinit() *t++ = *p++; *t = 0; } +#endif for (tp = tt_tab; tp->tt_name != 0; tp++) if (strncmp(tp->tt_name, wwterm, tp->tt_len) == 0) break; diff --git a/usr.bin/window/wwinit.c b/usr.bin/window/wwinit.c index d90dc4d8d66..6215ac41c5c 100644 --- a/usr.bin/window/wwinit.c +++ b/usr.bin/window/wwinit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wwinit.c,v 1.8 1998/12/20 23:37:45 deraadt Exp $ */ +/* $OpenBSD: wwinit.c,v 1.9 1999/11/14 17:34:24 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.8 1998/12/20 23:37:45 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: wwinit.c,v 1.9 1999/11/14 17:34:24 millert Exp $"; #endif #endif /* not lint */ @@ -50,7 +50,7 @@ static char rcsid[] = "$OpenBSD: wwinit.c,v 1.8 1998/12/20 23:37:45 deraadt Exp #include "tt.h" #include <sys/signal.h> #include <fcntl.h> -#include <term.h> +#include <curses.h> #include "char.h" wwinit() diff --git a/usr.bin/window/wwterminfo.c b/usr.bin/window/wwterminfo.c index 6b3b0694762..556d7811948 100644 --- a/usr.bin/window/wwterminfo.c +++ b/usr.bin/window/wwterminfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wwterminfo.c,v 1.7 1998/03/17 04:11:55 deraadt Exp $ */ +/* $OpenBSD: wwterminfo.c,v 1.8 1999/11/14 17:34:24 millert Exp $ */ /* * Copyright (c) 1982, 1993 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)wwterminfo.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: wwterminfo.c,v 1.7 1998/03/17 04:11:55 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: wwterminfo.c,v 1.8 1999/11/14 17:34:24 millert Exp $"; #endif #endif /* not lint */ @@ -69,10 +69,8 @@ wwterminfoinit() /* make the directory */ (void) snprintf(wwterminfopath, sizeof wwterminfopath, - "%swwinXXXXXX", _PATH_TMP); - mktemp(wwterminfopath); - if (mkdir(wwterminfopath, 0755) < 0 || - chmod(wwterminfopath, 00755) < 0) { + "%swwinXXXXXXXXXX", _PATH_TMP); + if (mkdtemp(wwterminfopath) == NULL) { wwerrno = WWE_SYS; return -1; } |