SCCS-vsn: usr.bin/window/tt.h 3.8
SCCS-vsn: usr.bin/window/:tt 1.2
SCCS-vsn: usr.bin/window/tth19.c 3.9
SCCS-vsn: usr.bin/window/wwdata.c 3.6
SCCS-vsn: usr.bin/window/wwdump.c 3.6
SCCS-vsn: usr.bin/window/wwinschar.c 3.9
SCCS-vsn: usr.bin/window/wwupdate.c 3.8
SCCS-vsn: usr.bin/window/ttgeneric.c 3.16
-./"init"16t"end"16t"setinsert"16t"setmodes"n4p
+/"move"16t"insline"16t"delline"16t"delchar"n4p
+/"move"16t"insline"16t"delline"16t"delchar"n4p
-+/"write"16t"putc"16t"blank"n3p
++/"write"16t"putc"16tn2p
+/"clreol"16t"clreos"16t"clear"n3p
+/"clreol"16t"clreos"16t"clear"n3p
-+/"nrow"16t"ncol"16t"availmodes"16t"wrap"n2pb16tb++
++/"modes"8t"nmodes"8t"insert"8t"ninsert"8t"row"16t"col"n4b2D
++/"nrow"16t"ncol"16t"hasins"8t"avlmods"8t"wrap"8t"retain"n2D4b
- * @(#)tt.h 3.7 83/08/24
+ * @(#)tt.h 3.8 83/09/15
+/*
+ * Interface structure for the terminal drivers.
+ */
+ /* startup and cleanup */
int (*tt_init)();
int (*tt_end)();
int (*tt_init)();
int (*tt_end)();
- int (*tt_setinsert)();
- int (*tt_setmodes)();
+
+ /* terminal functions */
int (*tt_move)();
int (*tt_insline)();
int (*tt_delline)();
int (*tt_delchar)();
int (*tt_move)();
int (*tt_insline)();
int (*tt_delline)();
int (*tt_delchar)();
- int (*tt_write)();
- int (*tt_putc)();
- int (*tt_blank)();
+ int (*tt_write)(); /* write a whole block */
+ int (*tt_putc)(); /* write one character */
int (*tt_clreol)();
int (*tt_clreos)();
int (*tt_clear)();
int (*tt_clreol)();
int (*tt_clreos)();
int (*tt_clear)();
- int tt_nrow;
- int tt_ncol;
- char tt_availmodes;
+
+ /* internal variables */
+ char tt_modes; /* the current display modes */
+ char tt_nmodes; /* the new modes for next write */
+ char tt_insert; /* currently in insert mode */
+ char tt_ninsert; /* insert mode on next write */
+ int tt_row; /* cursor row */
+ int tt_col; /* cursor column */
+
+ /* terminal info */
+ int tt_nrow; /* number of display rows */
+ int tt_ncol; /* number of display columns */
+ char tt_hasinsert; /* has insert character */
+ char tt_availmodes; /* the display modes supported */
char tt_wrap; /* has auto wrap around */
char tt_retain; /* can retain below (db flag) */
char tt_wrap; /* has auto wrap around */
char tt_retain; /* can retain below (db flag) */
+
+ /* the frame characters */
+/*
+ * List of terminal drivers.
+ */
struct tt_tab {
char *tt_name;
int tt_len;
int (*tt_func)();
};
struct tt_tab {
char *tt_name;
int tt_len;
int (*tt_func)();
};
struct tt_tab tt_tab[];
/*
struct tt_tab tt_tab[];
/*
- * nicer interface to termcap routines
+ * Clean interface to termcap routines.
*/
char tt_strings[1024]; /* string buffer */
char *tt_strp; /* pointer for it */
*/
char tt_strings[1024]; /* string buffer */
char *tt_strp; /* pointer for it */
-static char *sccsid = "@(#)ttgeneric.c 3.15 83/08/24";
+static char *sccsid = "@(#)ttgeneric.c 3.16 83/09/15";
-int gen_row, gen_col;
-char gen_modes, gen_nmodes;
-char gen_insert, gen_ninsert;
-
char *gen_CM;
char *gen_IM;
char *gen_IC;
char *gen_CM;
char *gen_IM;
char *gen_IC;
#define ps(s) fputs((s), stdout)
gen_setinsert(new)
#define ps(s) fputs((s), stdout)
gen_setinsert(new)
-{
- gen_ninsert = new;
-}
-
-gen_setinsert1(new)
- if (gen_insert == new)
- return;
if (new) {
if (gen_IM)
ps(gen_IM);
} else
if (gen_EI)
ps(gen_EI);
if (new) {
if (gen_IM)
ps(gen_IM);
} else
if (gen_EI)
ps(gen_EI);
-char new;
-{
- gen_nmodes = new & tt.tt_availmodes;
-}
-
-gen_setmodes1(new)
register new;
{
register diff;
register new;
{
register diff;
- if ((diff = new ^ gen_modes) == 0)
- return;
+ diff = new ^ tt.tt_modes;
if (diff & WWM_REV) {
if (new & WWM_REV) {
if (gen_SO)
if (diff & WWM_REV) {
if (new & WWM_REV) {
if (gen_SO)
if (gen_UE)
ps(gen_UE);
}
if (gen_UE)
ps(gen_UE);
}
- if (gen_modes) /* for concept 100 */
- gen_setmodes1(0);
+ if (tt.tt_modes) /* for concept 100 */
+ gen_setmodes(0);
- tt_tputs(gen_AL, gen_LI - gen_row);
+ tt_tputs(gen_AL, gen_LI - tt.tt_row);
- if (gen_modes) /* for concept 100 */
- gen_setmodes1(0);
+ if (tt.tt_modes) /* for concept 100 */
+ gen_setmodes(0);
- tt_tputs(gen_DL, gen_LI - gen_row);
+ tt_tputs(gen_DL, gen_LI - tt.tt_row);
}
gen_putc(c)
register char c;
{
}
gen_putc(c)
register char c;
{
- gen_setinsert1(gen_ninsert);
- gen_setmodes1(gen_nmodes);
- if (gen_insert) {
+ if (tt.tt_ninsert != tt.tt_insert)
+ gen_setinsert(tt.tt_ninsert);
+ if (tt.tt_nmodes != tt.tt_modes)
+ gen_setmodes(tt.tt_nmodes);
+ if (tt.tt_insert) {
- tt_tputs(gen_IC, gen_CO - gen_col);
+ tt_tputs(gen_IC, gen_CO - tt.tt_col);
- tt_tputs(gen_IP, gen_CO - gen_col);
+ tt_tputs(gen_IP, gen_CO - tt.tt_col);
- if (++gen_col == gen_CO)
+ if (++tt.tt_col == gen_CO)
- gen_col = 0, gen_row++;
+ tt.tt_col = 0, tt.tt_row++;
-gen_write(start, end)
-register char *start, *end;
-{
- gen_setinsert1(gen_ninsert);
- gen_setmodes1(gen_nmodes);
- if (gen_insert) {
- while (start <= end) {
- if (gen_IC)
- tt_tputs(gen_IC, gen_CO - gen_col);
- putchar(*start++);
- if (gen_IP)
- tt_tputs(gen_IP, gen_CO - gen_col);
- gen_col++;
- }
- } else {
- gen_col += end - start + 1;
- while (start <= end)
- putchar(*start++);
- }
- if (gen_col == gen_CO)
- if (gen_AM)
- gen_col = 0, gen_row++;
- else
- gen_col--;
-}
-
-gen_blank(n)
+gen_write(p, n)
+register char *p;
- if (n <= 0)
- return;
- gen_setinsert1(gen_ninsert);
- gen_setmodes1(gen_nmodes);
- if (gen_insert) {
+ if (tt.tt_ninsert != tt.tt_insert)
+ gen_setinsert(tt.tt_ninsert);
+ if (tt.tt_nmodes != tt.tt_modes)
+ gen_setmodes(tt.tt_nmodes);
+ if (tt.tt_insert) {
while (--n >= 0) {
if (gen_IC)
while (--n >= 0) {
if (gen_IC)
- tt_tputs(gen_IC, gen_CO - gen_col);
- putchar(' ');
+ tt_tputs(gen_IC, gen_CO - tt.tt_col);
+ putchar(*p++);
- tt_tputs(gen_IP, gen_CO - gen_col);
- gen_col++;
+ tt_tputs(gen_IP, gen_CO - tt.tt_col);
+ tt.tt_col++;
+ if (tt.tt_col == gen_CO)
- gen_col = 0, gen_row++;
+ tt.tt_col = 0, tt.tt_row++;
}
gen_move(row, col)
register char row, col;
{
}
gen_move(row, col)
register char row, col;
{
- if (gen_row == row && gen_col == col)
+ if (tt.tt_row == row && tt.tt_col == col)
- if (!gen_MI && gen_insert)
- gen_setinsert1(0);
- if (!gen_MS && gen_modes)
- gen_setmodes1(0);
- if (gen_row == row) {
- if (gen_col == col)
+ if (!gen_MI && tt.tt_insert)
+ gen_setinsert(0);
+ if (!gen_MS && tt.tt_modes)
+ gen_setmodes(0);
+ if (tt.tt_row == row) {
+ if (tt.tt_col == col)
- if (gen_col == col - 1) {
+ if (tt.tt_col == col - 1) {
if (gen_ND) {
ps(gen_ND);
goto out;
}
if (gen_ND) {
ps(gen_ND);
goto out;
}
- } else if (gen_col == col + 1) {
+ } else if (tt.tt_col == col + 1) {
if (gen_BC) {
ps(gen_BC);
goto out;
}
}
}
if (gen_BC) {
ps(gen_BC);
goto out;
}
}
}
- if (gen_col == col) {
- if (gen_row == row + 1) {
+ if (tt.tt_col == col) {
+ if (tt.tt_row == row + 1) {
if (gen_UP) {
ps(gen_UP);
goto out;
}
if (gen_UP) {
ps(gen_UP);
goto out;
}
- } else if (gen_row == row + 1) {
+ } else if (tt.tt_row == row + 1) {
if (gen_NL) {
ps(gen_NL);
goto out;
if (gen_NL) {
ps(gen_NL);
goto out;
}
ps(tgoto(gen_CM, col, row));
out:
}
ps(tgoto(gen_CM, col, row));
out:
- gen_col = col;
- gen_row = row;
+ tt.tt_col = col;
+ tt.tt_row = row;
ps(gen_TI);
if (gen_CL)
ps(gen_CL);
ps(gen_TI);
if (gen_CL)
ps(gen_CL);
- gen_col = gen_row = 0;
- gen_ninsert = gen_insert = 0;
- gen_nmodes = gen_modes = 0;
+ tt.tt_col = tt.tt_row = 0;
+ tt.tt_ninsert = tt.tt_insert = 0;
+ tt.tt_nmodes = tt.tt_modes = 0;
- gen_setmodes1(0);
- gen_setinsert1(0);
+ gen_setmodes(0);
+ gen_setinsert(0);
if (gen_TE)
ps(gen_TE);
if (gen_VE)
if (gen_TE)
ps(gen_TE);
if (gen_VE)
- if (gen_modes) /* for concept 100 */
- gen_setmodes1(0);
+ if (tt.tt_modes) /* for concept 100 */
+ gen_setmodes(0);
- tt_tputs(gen_CE, gen_CO - gen_col);
+ tt_tputs(gen_CE, gen_CO - tt.tt_col);
- if (gen_modes) /* for concept 100 */
- gen_setmodes1(0);
+ if (tt.tt_modes) /* for concept 100 */
+ gen_setmodes(0);
- tt_tputs(gen_CD, gen_LI - gen_row);
+ tt_tputs(gen_CD, gen_LI - tt.tt_row);
- if (gen_modes) /* for concept 100 */
- gen_setmodes1(0);
+ if (tt.tt_modes) /* for concept 100 */
+ gen_setmodes(0);
if (gen_CL)
ps(gen_CL);
}
if (gen_CL)
ps(gen_CL);
}
gen_delchar()
{
if (gen_DC)
gen_delchar()
{
if (gen_DC)
- tt_tputs(gen_DC, gen_CO - gen_col);
+ tt_tputs(gen_DC, gen_CO - tt.tt_col);
ospeed = wwoldtty.ww_sgttyb.sg_ospeed;
}
ospeed = wwoldtty.ww_sgttyb.sg_ospeed;
}
- if (gen_IM)
- tt.tt_setinsert = gen_setinsert;
if (gen_DC)
tt.tt_delchar = gen_delchar;
if (gen_AL)
if (gen_DC)
tt.tt_delchar = gen_delchar;
if (gen_AL)
tt.tt_availmodes |= WWM_REV;
if (gen_US)
tt.tt_availmodes |= WWM_UL;
tt.tt_availmodes |= WWM_REV;
if (gen_US)
tt.tt_availmodes |= WWM_UL;
+ tt.tt_hasinsert = gen_IM != 0;
tt.tt_wrap = gen_AM;
tt.tt_retain = gen_DB;
tt.tt_ncol = gen_CO;
tt.tt_nrow = gen_LI;
tt.tt_init = gen_init;
tt.tt_end = gen_end;
tt.tt_wrap = gen_AM;
tt.tt_retain = gen_DB;
tt.tt_ncol = gen_CO;
tt.tt_nrow = gen_LI;
tt.tt_init = gen_init;
tt.tt_end = gen_end;
- tt.tt_setmodes = gen_setmodes;
- tt.tt_blank = gen_blank;
tt.tt_write = gen_write;
tt.tt_putc = gen_putc;
tt.tt_move = gen_move;
tt.tt_write = gen_write;
tt.tt_putc = gen_putc;
tt.tt_move = gen_move;
-static char *sccsid = "@(#)tth19.c 3.8 83/08/17";
+static char *sccsid = "@(#)tth19.c 3.9 83/09/15";
es:hs:ts=\Ej\Ex5\Ex1\EY8%+ \Eo:fs=\Ek\Ey5:ds=\Ey1:
*/
es:hs:ts=\Ej\Ex5\Ex1\EY8%+ \Eo:fs=\Ek\Ey5:ds=\Ey1:
*/
+#define NCOL 80
+#define NROW 24
+
char h19_frame[16] = {
' ', '`'|0x80, 'a'|0x80, 'e'|0x80,
'`'|0x80, '`'|0x80, 'f'|0x80, 'v'|0x80,
char h19_frame[16] = {
' ', '`'|0x80, 'a'|0x80, 'e'|0x80,
'`'|0x80, '`'|0x80, 'f'|0x80, 'v'|0x80,
'c'|0x80, 't'|0x80, 's'|0x80, 'b'|0x80
};
'c'|0x80, 't'|0x80, 's'|0x80, 'b'|0x80
};
-char h19_row, h19_col;
-char h19_modes, h19_nmodes;
-char h19_insert, h19_ninsert;
-char h19_graphics;
+extern char *gen_VS;
+extern char *gen_VE;
+
+char h19_graphics; /* in graphics mode */
-char *h19_VS;
-char *h19_VE;
#define pc(c) putchar('c')
#define esc() pc(\033)
#define pc(c) putchar('c')
#define esc() pc(\033)
for (i = ((ms10) + 5) / h19_msp10c; --i >= 0;) \
pc(\0); \
}
for (i = ((ms10) + 5) / h19_msp10c; --i >= 0;) \
pc(\0); \
}
-#define ICPAD() PAD((80 - h19_col) * 1) /* 0.1 ms per char */
-#define ILPAD() PAD((24 - h19_row) * 10); /* 1 ms per char */
+#define ICPAD() PAD((NCOL - tt.tt_col) * 1) /* 0.1 ms per char */
+#define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */
- ((m) != h19_insert \
- ? (esc(), (h19_insert = (m)) ? pc(@) : pc(O)) : 0)
+ ((m) != tt.tt_insert \
+ ? (esc(), (tt.tt_insert = (m)) ? pc(@) : pc(O)) : 0)
- ((m) != h19_modes \
- ? (esc(), (h19_modes = (m)) ? pc(p) : pc(q)) : 0)
+ ((m) != tt.tt_modes \
+ ? (esc(), (tt.tt_modes = (m)) ? pc(p) : pc(q)) : 0)
#define SETGRAPHICS(m) \
((m) != h19_graphics \
? (esc(), (h19_graphics = (m)) ? pc(F) : pc(G)) : 0)
#define SETGRAPHICS(m) \
((m) != h19_graphics \
? (esc(), (h19_graphics = (m)) ? pc(F) : pc(G)) : 0)
-h19_setinsert(new)
-char new;
-{
- h19_ninsert = new;
-}
-
-h19_setmodes(new)
-{
- h19_nmodes = new & WWM_REV;
-}
-
h19_putc(c)
register char c;
{
h19_putc(c)
register char c;
{
- SETMODES(h19_nmodes);
- SETINSERT(h19_ninsert);
+ SETMODES(tt.tt_nmodes);
+ SETINSERT(tt.tt_ninsert);
if (c & 0x80) {
SETGRAPHICS(1);
putchar(c & 0x7f);
if (c & 0x80) {
SETGRAPHICS(1);
putchar(c & 0x7f);
SETGRAPHICS(0);
putchar(c);
}
SETGRAPHICS(0);
putchar(c);
}
- if (++h19_col == 80)
- h19_col = 79;
+ if (++tt.tt_col == NCOL)
+ tt.tt_col = NCOL - 1;
-h19_write(start, end)
-register char *start, *end;
+h19_write(p, n)
+register char *p;
+register n;
- SETMODES(h19_nmodes);
- SETINSERT(h19_ninsert);
- if (h19_insert) {
- while (start <= end) {
- if ((c = *start++) & 0x80) {
+ SETMODES(tt.tt_nmodes);
+ SETINSERT(tt.tt_ninsert);
+ if (tt.tt_insert) {
+ while (--n >= 0) {
+ if ((c = *p++) & 0x80) {
SETGRAPHICS(1);
putchar(c & 0x7f);
} else {
SETGRAPHICS(1);
putchar(c & 0x7f);
} else {
- h19_col += end - start + 1;
- while (start <= end)
- if ((c = *start++) & 0x80) {
+ tt.tt_col += n;
+ while (--n >= 0)
+ if ((c = *p++) & 0x80) {
SETGRAPHICS(1);
putchar(c & 0x7f);
} else {
SETGRAPHICS(1);
putchar(c & 0x7f);
} else {
- if (h19_col == 80)
- h19_col = 79;
-}
-
-h19_blank(n)
-register n;
-{
- if (n <= 0)
- return;
- SETMODES(h19_nmodes);
- SETINSERT(h19_ninsert);
- if (h19_insert) {
- while (--n >= 0) {
- putchar(' ');
- ICPAD();
- h19_col++;
- }
- } else {
- h19_col += n;
- while (--n >= 0)
- putchar(' ');
- }
- if (h19_col == 80)
- h19_col = 79;
+ if (tt.tt_col == NCOL)
+ tt.tt_col = NCOL - 1;
}
h19_move(row, col)
register char row, col;
{
}
h19_move(row, col)
register char row, col;
{
- if (h19_row == row) {
- if (h19_col == col)
+ if (tt.tt_row == row) {
+ if (tt.tt_col == col)
- if (h19_col == col - 1) {
+ if (tt.tt_col == col - 1) {
- } else if (h19_col == col + 1) {
+ } else if (tt.tt_col == col + 1) {
- if (h19_col == col) {
- if (h19_row == row + 1) {
+ if (tt.tt_col == col) {
+ if (tt.tt_row == row + 1) {
- } else if (h19_row == row + 1) {
+ } else if (tt.tt_row == row + 1) {
putchar(' ' + row);
putchar(' ' + col);
out:
putchar(' ' + row);
putchar(' ' + col);
out:
- h19_col = col;
- h19_row = row;
+ tt.tt_col = col;
+ tt.tt_row = row;
- if (h19_VS)
- fputs(h19_VS, stdout);
+ if (gen_VS)
+ fputs(gen_VS, stdout);
esc();
pc(w);
esc();
pc(E);
esc();
pc(w);
esc();
pc(E);
- h19_col = h19_row = 0;
- h19_insert = 0;
+ tt.tt_col = tt.tt_row = 0;
+ tt.tt_ninsert = tt.tt_insert = 0;
+ tt.tt_nmodes = tt.tt_modes = 0;
SETMODES(0);
SETINSERT(0);
SETGRAPHICS(0);
SETMODES(0);
SETINSERT(0);
SETGRAPHICS(0);
- if (h19_VE)
- fputs(h19_VE, stdout);
+ if (gen_VE)
+ fputs(gen_VE, stdout);
float cpms = (float) wwbaud / 10000; /* char per ms */
h19_msp10c = 10 / cpms; /* ms per 10 char */
float cpms = (float) wwbaud / 10000; /* char per ms */
h19_msp10c = 10 / cpms; /* ms per 10 char */
- h19_VS = tt_xgetstr("vs");
- h19_VE = tt_xgetstr("ve");
- tt.tt_setinsert = h19_setinsert;
- tt.tt_setmodes = h19_setmodes;
+ gen_VS = tt_xgetstr("vs");
+ gen_VE = tt_xgetstr("ve");
+
+ tt.tt_init = h19_init;
+ tt.tt_end = h19_end;
+
tt.tt_insline = h19_insline;
tt.tt_delline = h19_delline;
tt.tt_delchar = h19_delchar;
tt.tt_insline = h19_insline;
tt.tt_delline = h19_delline;
tt.tt_delchar = h19_delchar;
- tt.tt_blank = h19_blank;
- tt.tt_init = h19_init;
- tt.tt_end = h19_end;
tt.tt_clreol = h19_clreol;
tt.tt_clreos = h19_clreos;
tt.tt_clear = h19_clear;
tt.tt_move = h19_move;
tt.tt_write = h19_write;
tt.tt_putc = h19_putc;
tt.tt_clreol = h19_clreol;
tt.tt_clreos = h19_clreos;
tt.tt_clear = h19_clear;
tt.tt_move = h19_move;
tt.tt_write = h19_write;
tt.tt_putc = h19_putc;
- tt.tt_ncol = 80;
- tt.tt_nrow = 24;
+
+ tt.tt_ncol = NCOL;
+ tt.tt_nrow = NROW;
+ tt.tt_hasinsert = 1;
tt.tt_availmodes = WWM_REV;
tt.tt_frame = h19_frame;
return 0;
tt.tt_availmodes = WWM_REV;
tt.tt_frame = h19_frame;
return 0;
-static char *sccsid = "@(#)wwdata.c 3.5 83/09/15";
+static char *sccsid = "@(#)wwdata.c 3.6 83/09/15";
int tt_h19();
int tt_generic();
struct tt_tab tt_tab[] = {
int tt_h19();
int tt_generic();
struct tt_tab tt_tab[] = {
- { "h19", 3, tt_h19 },
- { "generic", 0, tt_generic },
+ { "h19", 3, tt_h19 },
+ { "generic", 0, tt_generic },
0
};
char *tt_strp = tt_strings;
0
};
char *tt_strp = tt_strings;
-static char *sccsid = "@(#)wwdump.c 3.5 83/09/15";
+static char *sccsid = "@(#)wwdump.c 3.6 83/09/15";
(*tt.tt_clear)();
for (i = w->ww_i.t; i < w->ww_i.b; i++) {
(*tt.tt_move)(i, w->ww_i.l);
(*tt.tt_clear)();
for (i = w->ww_i.t; i < w->ww_i.b; i++) {
(*tt.tt_move)(i, w->ww_i.l);
(*tt.tt_clear)();
for (i = w->ww_i.t; i < w->ww_i.b; i++) {
(*tt.tt_move)(i, w->ww_i.l);
(*tt.tt_clear)();
for (i = w->ww_i.t; i < w->ww_i.b; i++) {
(*tt.tt_move)(i, w->ww_i.l);
(*tt.tt_clear)();
for (i = 0; i < w->ww_w.nr; i++) {
(*tt.tt_move)(i, w->ww_w.l);
(*tt.tt_clear)();
for (i = 0; i < w->ww_w.nr; i++) {
(*tt.tt_move)(i, w->ww_w.l);
(*tt.tt_clear)();
for (i = 0; i < wwnrow; i++) {
(*tt.tt_move)(i, 0);
(*tt.tt_clear)();
for (i = 0; i < wwnrow; i++) {
(*tt.tt_move)(i, 0);
for (i = 0; i < wwnrow; i++) {
(*tt.tt_move)(i, 0);
for (j = 0; j < wwncol; j++) {
for (i = 0; i < wwnrow; i++) {
(*tt.tt_move)(i, 0);
for (j = 0; j < wwncol; j++) {
- (*tt.tt_setmodes)(wwns[i][j].c_m);
+ tt.tt_nmodes = wwns[i][j].c_m & tt.tt_availmodes;
(*tt.tt_putc)(wwns[i][j].c_c);
}
}
(*tt.tt_putc)(wwns[i][j].c_c);
}
}
for (i = 0; i < wwnrow; i++) {
(*tt.tt_move)(i, 0);
for (j = 0; j < wwncol; j++) {
for (i = 0; i < wwnrow; i++) {
(*tt.tt_move)(i, 0);
for (j = 0; j < wwncol; j++) {
- (*tt.tt_setmodes)(wwns[i][j].c_m);
+ tt.tt_nmodes = wwos[i][j].c_m & tt.tt_availmodes;
(*tt.tt_putc)(wwns[i][j].c_c);
}
}
(*tt.tt_putc)(wwns[i][j].c_c);
}
}
-static char *sccsid = "@(#)wwinschar.c 3.8 83/09/15";
+static char *sccsid = "@(#)wwinschar.c 3.9 83/09/15";
/*
* Can/Should we use delete character?
*/
/*
* Can/Should we use delete character?
*/
- if (tt.tt_setinsert != 0 && nvis > (wwncol - col) / 2) {
+ if (tt.tt_hasinsert && nvis > (wwncol - col) / 2) {
register union ww_char *p, *q;
register union ww_char *p, *q;
+ tt.tt_ninsert = 1;
+ tt.tt_nmodes = c >> WWC_MSHIFT & tt.tt_availmodes;
- (*tt.tt_setmodes)(c >> WWC_MSHIFT);
(*tt.tt_putc)(c & WWC_CMASK);
(*tt.tt_putc)(c & WWC_CMASK);
p = &wwos[row][wwncol];
q = p - 1;
p = &wwos[row][wwncol];
q = p - 1;
-static char *sccsid = "@(#)wwupdate.c 3.7 83/08/19";
+static char *sccsid = "@(#)wwupdate.c 3.8 83/09/15";
if (j > wwncol)
break;
p = buf;
if (j > wwncol)
break;
p = buf;
+ m = ns[-1].c_m & tt.tt_availmodes;
c = j - 1;
os[-1] = ns[-1];
*p++ = ns[-1].c_c;
x = 5;
q = p;
c = j - 1;
os[-1] = ns[-1];
*p++ = ns[-1].c_c;
x = 5;
q = p;
- while (j < wwncol && ns->c_m == m) {
+ while (j < wwncol && (ns->c_m&tt.tt_availmodes) == m) {
*p++ = ns->c_c;
if (ns->c_w == os->c_w) {
if (--x <= 0)
*p++ = ns->c_c;
if (ns->c_w == os->c_w) {
if (--x <= 0)
+ tt.tt_nmodes = m;
+ (*tt.tt_move)(i, c);
if (wwwrap
&& i == wwnrow - 1 && q - buf + c == wwncol) {
if (wwwrap
&& i == wwnrow - 1 && q - buf + c == wwncol) {
- if (tt.tt_setinsert != 0) {
+ if (tt.tt_hasinsert) {
+ (*tt.tt_write)(buf + 1, q - buf - 1);
- (*tt.tt_setmodes)(m);
- (*tt.tt_write)(buf + 1, q - 1);
- (*tt.tt_move)(i, c);
- (*tt.tt_setinsert)(1);
- (*tt.tt_write)(buf, buf);
- (*tt.tt_setinsert)(0);
+ tt.tt_ninsert = 1;
+ (*tt.tt_write)(buf, 1);
+ tt.tt_ninsert = 0;
- (*tt.tt_move)(i, c);
- (*tt.tt_setmodes)(m);
- (*tt.tt_write)(buf, q - 2);
+ (*tt.tt_write)(buf, q - buf - 1);
- } else {
- (*tt.tt_move)(i, c);
- (*tt.tt_setmodes)(m);
- (*tt.tt_write)(buf, q - 1);
- }
+ } else
+ (*tt.tt_write)(buf, q - buf);