Make window 8bit clean and ctype oriented.

Fix restart after ^Z hang.
This commit is contained in:
Andrey A. Chernov 1994-10-30 03:09:58 +00:00
parent 434ded340d
commit 49a7037f5a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4002
9 changed files with 16 additions and 89 deletions

View File

@ -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",

View File

@ -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))

View File

@ -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;

View File

@ -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) {

View File

@ -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();

View File

@ -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();

View File

@ -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;

View File

@ -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;

View File

@ -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;