summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1994-10-30 03:09:58 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1994-10-30 03:09:58 +0000
commit49a7037f5ac89c3b025f275a67b6c140ae2850c9 (patch)
treedd62d13f8c3f4006a2e9765e2afc8ff0a128cfd0 /usr.bin
parent434ded340d7c26d174c861ae024af7591b92c9b6 (diff)
downloadsrc-test2-49a7037f5ac89c3b025f275a67b6c140ae2850c9.tar.gz
src-test2-49a7037f5ac89c3b025f275a67b6c140ae2850c9.zip
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/window/char.c74
-rw-r--r--usr.bin/window/char.h14
-rw-r--r--usr.bin/window/cmd.c2
-rw-r--r--usr.bin/window/cmd1.c2
-rw-r--r--usr.bin/window/wwgets.c2
-rw-r--r--usr.bin/window/wwinit.c1
-rw-r--r--usr.bin/window/wwinschar.c2
-rw-r--r--usr.bin/window/wwlabel.c2
-rw-r--r--usr.bin/window/wwwrite.c6
9 files changed, 16 insertions, 89 deletions
diff --git a/usr.bin/window/char.c b/usr.bin/window/char.c
index 34bea59f5479..670d5f1afe08 100644
--- a/usr.bin/window/char.c
+++ b/usr.bin/window/char.c
@@ -40,80 +40,6 @@ static char sccsid[] = "@(#)char.c 8.1 (Berkeley) 6/6/93";
#include "char.h"
-char _cmap[] = {
- _C|_U, _C|_U, _C|_U, _C|_U, /* ^@ - ^C */
- _C|_U, _C|_U, _C|_U, _C|_U, /* ^D - ^G */
- _C, _C|_P, _C, _C|_U, /* ^H - ^K */
- _C|_U, _C, _C|_U, _C|_U, /* ^L - ^O */
- _C|_U, _C|_U, _C|_U, _C|_U, /* ^P - ^S */
- _C|_U, _C|_U, _C|_U, _C|_U, /* ^T - ^W */
- _C|_U, _C|_U, _C|_U, _C|_U, /* ^U - ^[ */
- _C|_U, _C|_U, _C|_U, _C|_U, /* ^\ - ^_ */
-
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
-
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
-
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _P|_U,
- _P|_U, _P|_U, _P|_U, _C|_U,
-
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
-
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
-
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
-
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _C|_U, _C|_U, _C|_U, _C|_U,
- _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",
diff --git a/usr.bin/window/char.h b/usr.bin/window/char.h
index eb4774fb9f5a..dd4ad2717994 100644
--- a/usr.bin/window/char.h
+++ b/usr.bin/window/char.h
@@ -49,13 +49,13 @@
* using unctrl() by wwwrite() if ww_unctrl is set.
*/
+#include <ctype.h>
+#include <string.h>
+#include <stdlib.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
-#define isctrl(c) (_cmap[(unsigned char) (c)] & _C)
-#define isprt(c) (_cmap[(unsigned char) (c)] & _P)
-#define isunctrl(c) (_cmap[(unsigned char) (c)] & _U)
+#define isctrl(c) iscntrl((unsigned char)(c))
+#define isprt(c) isprint((unsigned char)(c))
+#define isunctrl(c) (strchr("\b\t\n\r", (c)) == NULL && isctrl(c))
diff --git a/usr.bin/window/cmd.c b/usr.bin/window/cmd.c
index cd105ea0877f..391e34664130 100644
--- a/usr.bin/window/cmd.c
+++ b/usr.bin/window/cmd.c
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)cmd.c 8.1 (Berkeley) 6/6/93";
docmd()
{
- register char c;
+ register c;
register struct ww *w;
char out = 0;
diff --git a/usr.bin/window/cmd1.c b/usr.bin/window/cmd1.c
index df6deb910483..6fdc9dad3bab 100644
--- a/usr.bin/window/cmd1.c
+++ b/usr.bin/window/cmd1.c
@@ -115,7 +115,7 @@ int maxrow, maxcol;
{
static int scount;
int count;
- char c;
+ int c;
int oldrow = *row, oldcol = *col;
while ((c = wwgetc()) >= 0) {
diff --git a/usr.bin/window/wwgets.c b/usr.bin/window/wwgets.c
index 1f69fa5e9c67..1141834679dc 100644
--- a/usr.bin/window/wwgets.c
+++ b/usr.bin/window/wwgets.c
@@ -47,7 +47,7 @@ int n;
register struct ww *w;
{
register char *p = buf;
- register char c;
+ register int c;
char uc = w->ww_unctrl;
static void rub();
diff --git a/usr.bin/window/wwinit.c b/usr.bin/window/wwinit.c
index 4e4d5dad1239..b94d31209352 100644
--- a/usr.bin/window/wwinit.c
+++ b/usr.bin/window/wwinit.c
@@ -364,6 +364,7 @@ wwstart()
register i;
(void) wwsettty(0, &wwnewtty);
+ signal(SIGIO, wwrint);
for (i = 0; i < wwnrow; i++)
wwtouched[i] = WWU_TOUCHED;
wwstart1();
diff --git a/usr.bin/window/wwinschar.c b/usr.bin/window/wwinschar.c
index d055fcd1dd1b..b283f999b016 100644
--- a/usr.bin/window/wwinschar.c
+++ b/usr.bin/window/wwinschar.c
@@ -43,7 +43,7 @@ static char sccsid[] = "@(#)wwinschar.c 8.1 (Berkeley) 6/6/93";
wwinschar(w, row, col, c, m)
register struct ww *w;
-char c, m;
+unsigned char c, m;
{
register i;
int nvis;
diff --git a/usr.bin/window/wwlabel.c b/usr.bin/window/wwlabel.c
index d78e1f2f4951..4bb128f16afa 100644
--- a/usr.bin/window/wwlabel.c
+++ b/usr.bin/window/wwlabel.c
@@ -60,7 +60,7 @@ char *l;
register char *fmap;
register char *smap;
char touched;
- char *p;
+ unsigned char *p;
if (f->ww_fmap == 0)
return;
diff --git a/usr.bin/window/wwwrite.c b/usr.bin/window/wwwrite.c
index d406cbc2bb1e..98804606470d 100644
--- a/usr.bin/window/wwwrite.c
+++ b/usr.bin/window/wwwrite.c
@@ -58,12 +58,12 @@ static char sccsid[] = "@(#)wwwrite.c 8.1 (Berkeley) 6/6/93";
*/
wwwrite(w, p, n)
register struct ww *w;
-register char *p;
+register unsigned char *p;
int n;
{
char hascursor;
- char *savep = p;
- char *q = p + n;
+ unsigned char *savep = p;
+ unsigned char *q = p + n;
char *r = 0;
char *s;