static char sccsid
[] = "@(#)ttgeneric.c 3.30 %G%";
* Copyright (c) 1983 Regents of the University of California,
* All rights reserved. Redistribution permitted subject to
* the terms of the Berkeley Software License Agreement.
/* ANSI graphics frame */
#define G (WWM_GRP << WWC_MSHIFT)
' ', 'x'|G
, 'Q'|G
, 'm'|G
,
'x'|G
, 'x'|G
, 'l'|G
, 't'|G
,
'q'|G
, 'j'|G
, 'q'|G
, 'v'|G
,
'k'|G
, 'u'|G
, 'w'|G
, 'n'|G
struct tt_str ansi_AS
= {
diff
= new ^ tt
.tt_modes
;
if (tt
.tt_modes
) /* for concept 100 */
tttputs(gen_AL
, gen_LI
- tt
.tt_row
);
if (tt
.tt_modes
) /* for concept 100 */
tttputs(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
);
tttputs(gen_IC
, gen_CO
- tt
.tt_col
);
tttputs(gen_IP
, gen_CO
- tt
.tt_col
);
if (++tt
.tt_col
== gen_CO
)
tt
.tt_col
= tt
.tt_row
= -10;
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
);
if (tt
.tt_insert
&& (gen_IC
|| gen_IP
)) {
tttputs(gen_IC
, gen_CO
- tt
.tt_col
);
tttputs(gen_IP
, gen_CO
- tt
.tt_col
);
tt
.tt_col
= tt
.tt_row
= -10;
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) {
tttgoto(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 */
tttputs(gen_CE
, gen_CO
- tt
.tt_col
);
if (tt
.tt_modes
) /* for concept 100 */
tttputs(gen_CD
, gen_LI
- tt
.tt_row
);
if (tt
.tt_modes
) /* for concept 100 */
tttputs(gen_DC
, gen_CO
- tt
.tt_col
);
gen_PC
= tttgetstr("pc");
PC
= gen_PC
? *gen_PC
->ts_str
: 0;
ospeed
= wwoldtty
.ww_sgttyb
.sg_ospeed
;
gen_CM
= ttxgetstr("cm"); /* may not work */
gen_IM
= ttxgetstr("im");
gen_IC
= tttgetstr("ic");
gen_IP
= tttgetstr("ip");
gen_EI
= ttxgetstr("ei");
gen_DC
= tttgetstr("dc");
gen_AL
= tttgetstr("al");
gen_DL
= tttgetstr("dl");
gen_CE
= tttgetstr("ce");
gen_CD
= tttgetstr("cd");
gen_CL
= ttxgetstr("cl");
gen_VS
= ttxgetstr("vs");
gen_VE
= ttxgetstr("ve");
gen_TI
= ttxgetstr("ti");
gen_TE
= ttxgetstr("te");
gen_SO
= ttxgetstr("so");
gen_SE
= ttxgetstr("se");
gen_US
= ttxgetstr("us");
gen_UE
= ttxgetstr("ue");
gen_UP
= ttxgetstr("up");
gen_BC
= ttxgetstr("bc");
gen_ND
= ttxgetstr("nd");
gen_HO
= ttxgetstr("ho");
gen_NL
= ttxgetstr("nl");
gen_AS
= ttxgetstr("as");
gen_AE
= ttxgetstr("ae");
gen_XS
= ttxgetstr("XS");
gen_XE
= ttxgetstr("XE");
static struct tt_str nl
= { "\n", 1 };
if (gen_BC
== 0 && gen_BS
) {
static struct tt_str bc
= { "\b", 1 };
BC
= gen_BC
? gen_BC
->ts_str
: 0;
UP
= gen_UP
? gen_UP
->ts_str
: 0;
if (gen_CL
== 0 || gen_OS
|| gen_CM
== 0)
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
;
if (gen_UG
> 0 || gen_US
&& gen_SO
&& ttstrcmp(gen_US
, gen_SO
) == 0)
tt
.tt_availmodes
|= WWM_REV
;
tt
.tt_availmodes
|= WWM_UL
;
tt
.tt_availmodes
|= WWM_GRP
;
tt
.tt_availmodes
|= WWM_USR
;
tt
.tt_hasinsert
= gen_IM
!= 0;
tt
.tt_setinsert
= gen_setinsert
;
tt
.tt_setmodes
= gen_setmodes
;
tt
.tt_frame
= gen_AS
&& ttstrcmp(gen_AS
, &ansi_AS
) == 0 ?