static char *sccsid
= "@(#)ttgeneric.c 3.11 83/08/18";
#define pc(c) putchar('c')
#define ps(s) fputs((s), stdout)
if ((diff
= new ^ gen_modes
) == 0)
tt_tputs(gen_AL
, gen_LI
- gen_row
);
tt_tputs(gen_DL
, gen_LI
- gen_row
);
tt_tputs(gen_IC
, gen_CO
- gen_col
);
tt_tputs(gen_IP
, gen_CO
- gen_col
);
register char *start
, *end
;
tt_tputs(gen_IC
, gen_CO
- gen_col
);
tt_tputs(gen_IP
, gen_CO
- gen_col
);
gen_col
+= end
- start
+ 1;
tt_tputs(gen_IC
, gen_CO
- gen_col
);
tt_tputs(gen_IP
, gen_CO
- gen_col
);
if (gen_row
== row
&& gen_col
== col
)
if (!gen_MI
&& gen_insert
)
if (!gen_MS
&& gen_modes
& WWM_REV
)
if (gen_col
== col
- 1) {
} else if (gen_col
== col
+ 1) {
if (gen_row
== row
+ 1) {
} else if (gen_row
== row
+ 1) {
if (gen_HO
&& col
== 0 && row
== 0) {
ps(tgoto(gen_CM
, col
, row
));
if (!gen_MI
&& gen_insert
)
if (!gen_MS
&& gen_modes
& WWM_REV
)
tt_tputs(gen_CE
, gen_CO
- gen_col
);
tt_tputs(gen_CD
, gen_LI
- gen_row
);
tt_tputs(gen_DC
, gen_CO
- gen_col
);
gen_CM
= tt_xgetstr("cm"); /* may not work */
gen_IM
= tt_xgetstr("im");
gen_IC
= tt_tgetstr("ic");
gen_IP
= tt_tgetstr("ip");
gen_EI
= tt_xgetstr("ei");
gen_DC
= tt_tgetstr("dc");
gen_AL
= tt_tgetstr("al");
gen_DL
= tt_tgetstr("dl");
gen_CE
= tt_tgetstr("ce");
gen_CD
= tt_tgetstr("cd");
gen_CL
= tt_xgetstr("cl");
gen_VS
= tt_xgetstr("vs");
gen_VE
= tt_xgetstr("ve");
gen_SO
= tt_xgetstr("so");
gen_SE
= tt_xgetstr("se");
gen_US
= tt_xgetstr("us");
gen_UE
= tt_xgetstr("ue");
gen_UP
= tt_xgetstr("up");
gen_PC
= tt_tgetstr("pc");
gen_BC
= tt_xgetstr("bc");
gen_ND
= tt_xgetstr("nd");
gen_HO
= tt_xgetstr("ho");
gen_NL
= tt_xgetstr("nl");
if (gen_CL
== 0 || gen_CM
== 0 || gen_OS
)
if (gen_BC
== 0 && gen_BS
)
extern char PC
, *BC
, *UP
;
PC
= gen_PC
? *gen_PC
: 0;
ospeed
= wwoldtty
.ww_sgttyb
.sg_ospeed
;
tt
.tt_setinsert
= gen_setinsert
;
tt
.tt_delchar
= gen_delchar
;
tt
.tt_insline
= gen_insline
;
tt
.tt_delline
= gen_delline
;
tt
.tt_clreol
= gen_clreol
;
tt
.tt_clreos
= gen_clreos
;
tt
.tt_availmodes
|= WWM_REV
;
tt
.tt_availmodes
|= WWM_UL
;
tt
.tt_setmodes
= gen_setmodes
;