static char *sccsid
= "@(#)ttgeneric.c 3.16 83/09/15";
#define pc(c) putchar('c')
#define ps(s) fputs((s), stdout)
diff
= new ^ tt
.tt_modes
;
if (tt
.tt_modes
) /* for concept 100 */
tt_tputs(gen_AL
, gen_LI
- tt
.tt_row
);
if (tt
.tt_modes
) /* for concept 100 */
tt_tputs(gen_DL
, gen_LI
- tt
.tt_row
);
if (tt
.tt_ninsert
!= tt
.tt_insert
)
gen_setinsert(tt
.tt_ninsert
);
if (tt
.tt_nmodes
!= tt
.tt_modes
)
gen_setmodes(tt
.tt_nmodes
);
tt_tputs(gen_IC
, gen_CO
- tt
.tt_col
);
tt_tputs(gen_IP
, gen_CO
- tt
.tt_col
);
if (++tt
.tt_col
== gen_CO
)
tt
.tt_col
= 0, tt
.tt_row
++;
if (tt
.tt_ninsert
!= tt
.tt_insert
)
gen_setinsert(tt
.tt_ninsert
);
if (tt
.tt_nmodes
!= tt
.tt_modes
)
gen_setmodes(tt
.tt_nmodes
);
tt_tputs(gen_IC
, gen_CO
- tt
.tt_col
);
tt_tputs(gen_IP
, gen_CO
- tt
.tt_col
);
tt
.tt_col
= 0, tt
.tt_row
++;
if (tt
.tt_row
== row
&& tt
.tt_col
== col
)
if (!gen_MI
&& tt
.tt_insert
)
if (!gen_MS
&& tt
.tt_modes
)
if (tt
.tt_col
== col
- 1) {
} else if (tt
.tt_col
== col
+ 1) {
if (tt
.tt_row
== row
+ 1) {
} else if (tt
.tt_row
== row
+ 1) {
if (gen_HO
&& col
== 0 && row
== 0) {
ps(tgoto(gen_CM
, col
, row
));
tt
.tt_col
= tt
.tt_row
= 0;
tt
.tt_ninsert
= tt
.tt_insert
= 0;
tt
.tt_nmodes
= tt
.tt_modes
= 0;
if (tt
.tt_modes
) /* for concept 100 */
tt_tputs(gen_CE
, gen_CO
- tt
.tt_col
);
if (tt
.tt_modes
) /* for concept 100 */
tt_tputs(gen_CD
, gen_LI
- tt
.tt_row
);
if (tt
.tt_modes
) /* for concept 100 */
tt_tputs(gen_DC
, gen_CO
- tt
.tt_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_TI
= tt_xgetstr("ti");
gen_TE
= tt_xgetstr("te");
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_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_hasinsert
= gen_IM
!= 0;