projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed extra tt_col += n in gen_write
[unix-history]
/
usr
/
src
/
usr.bin
/
window
/
tth19.c
diff --git
a/usr/src/usr.bin/window/tth19.c
b/usr/src/usr.bin/window/tth19.c
index
5356794
..
4469247
100644
(file)
--- a/
usr/src/usr.bin/window/tth19.c
+++ b/
usr/src/usr.bin/window/tth19.c
@@
-1,7
+1,13
@@
#ifndef lint
#ifndef lint
-static char sccsid[] = "@(#)tth19.c 3.1
3
%G%";
+static char sccsid[] = "@(#)tth19.c 3.1
6
%G%";
#endif
#endif
+/*
+ * Copyright (c) 1983 Regents of the University of California,
+ * All rights reserved. Redistribution permitted subject to
+ * the terms of the Berkeley Software License Agreement.
+ */
+
#include "ww.h"
#include "tt.h"
#include "ww.h"
#include "tt.h"
@@
-28,8
+34,8
@@
short h19_frame[16] = {
'c'|G, 't'|G, 's'|G, 'b'|G
};
'c'|G, 't'|G, 's'|G, 'b'|G
};
-extern
cha
r *gen_VS;
-extern
cha
r *gen_VE;
+extern
struct tt_st
r *gen_VS;
+extern
struct tt_st
r *gen_VE;
int h19_msp10c;
int h19_msp10c;
@@
-43,7
+49,12
@@
int h19_msp10c;
#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 */
#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 */
-#define h19_setinsert(m) (esc(), (tt.tt_insert = (m)) ? pc(@) : pc(O))
+#define H19_SETINSERT(m) (esc(), (tt.tt_insert = (m)) ? pc(@) : pc(O))
+
+h19_setinsert(new)
+{
+ H19_SETINSERT(new);
+}
h19_setmodes(new)
register new;
h19_setmodes(new)
register new;
@@
-86,9
+97,9
@@
h19_putc(c)
register char c;
{
if (tt.tt_nmodes != tt.tt_modes)
register char c;
{
if (tt.tt_nmodes != tt.tt_modes)
-
h19_setmodes
(tt.tt_nmodes);
+
(*tt.tt_setmodes)
(tt.tt_nmodes);
if (tt.tt_ninsert != tt.tt_insert)
if (tt.tt_ninsert != tt.tt_insert)
-
h19_setinsert
(tt.tt_ninsert);
+
H19_SETINSERT
(tt.tt_ninsert);
ttputc(c);
if (tt.tt_insert)
ICPAD();
ttputc(c);
if (tt.tt_insert)
ICPAD();
@@
-101,9
+112,9
@@
register char *p;
register n;
{
if (tt.tt_nmodes != tt.tt_modes)
register n;
{
if (tt.tt_nmodes != tt.tt_modes)
-
h19_setmodes
(tt.tt_nmodes);
+
(*tt.tt_setmodes)
(tt.tt_nmodes);
if (tt.tt_ninsert != tt.tt_insert)
if (tt.tt_ninsert != tt.tt_insert)
-
h19_setinsert
(tt.tt_ninsert);
+
H19_SETINSERT
(tt.tt_ninsert);
if (tt.tt_insert) {
while (--n >= 0) {
ttputc(*p++);
if (tt.tt_insert) {
while (--n >= 0) {
ttputc(*p++);
@@
-112,8
+123,7
@@
register n;
}
} else {
tt.tt_col += n;
}
} else {
tt.tt_col += n;
- while (--n >= 0)
- ttputc(*p++);
+ ttwrite(p, n);
}
if (tt.tt_col == NCOL)
tt.tt_col = NCOL - 1;
}
if (tt.tt_col == NCOL)
tt.tt_col = NCOL - 1;
@@
-161,7
+171,7
@@
out:
h19_init()
{
if (gen_VS)
h19_init()
{
if (gen_VS)
- ttputs(gen_VS);
+ tt
x
puts(gen_VS);
esc();
pc(w);
esc();
esc();
pc(w);
esc();
@@
-173,10
+183,8
@@
h19_init()
h19_end()
{
h19_end()
{
- h19_setmodes(0);
- h19_setinsert(0);
if (gen_VE)
if (gen_VE)
- ttputs(gen_VE);
+ tt
x
puts(gen_VE);
esc();
pc(v);
}
esc();
pc(v);
}
@@
-225,6
+233,8
@@
tt_h19()
tt.tt_move = h19_move;
tt.tt_write = h19_write;
tt.tt_putc = h19_putc;
tt.tt_move = h19_move;
tt.tt_write = h19_write;
tt.tt_putc = h19_putc;
+ tt.tt_setinsert = h19_setinsert;
+ tt.tt_setmodes = h19_setmodes;
tt.tt_ncol = NCOL;
tt.tt_nrow = NROW;
tt.tt_ncol = NCOL;
tt.tt_nrow = NROW;