+ if (!tt.tt_insert)
+ gen_setinsert(1);
+ if (tt.tt_nmodes != tt.tt_modes)
+ gen_setmodes(tt.tt_nmodes);
+ if (gen_IC)
+ tttputs(gen_IC, gen_CO - tt.tt_col);
+ ttputc(c);
+ if (gen_IP)
+ tttputs(gen_IP, gen_CO - tt.tt_col);
+ if (++tt.tt_col == gen_CO)
+ if (gen_XN)
+ tt.tt_col = tt.tt_row = -10;
+ else if (gen_AM)
+ tt.tt_col = 0, tt.tt_row++;
+ else
+ tt.tt_col--;
+}
+
+gen_insspace(n)
+{
+ if (gen_ICn)
+ ttpgoto(gen_ICn, 0, n, gen_CO - tt.tt_col);
+ else
+ while (--n >= 0)
+ tttputs(gen_IC, gen_CO - tt.tt_col);
+}
+
+gen_delchar(n)
+{
+ if (gen_DCn)
+ ttpgoto(gen_DCn, 0, n, gen_CO - tt.tt_col);
+ else
+ while (--n >= 0)
+ tttputs(gen_DC, gen_CO - tt.tt_col);
+}
+
+gen_scroll_down(n)
+{
+ gen_move(tt.tt_scroll_bot, 0);
+ if (gen_SFn)
+ ttpgoto(gen_SFn, 0, n, n);
+ else
+ while (--n >= 0)
+ ttxputs(gen_SF);
+}
+
+gen_scroll_up(n)
+{
+ gen_move(tt.tt_scroll_top, 0);
+ if (gen_SRn)
+ ttpgoto(gen_SRn, 0, n, n);
+ else
+ while (--n >= 0)
+ ttxputs(gen_SR);
+}
+
+gen_setscroll(top, bot)
+{
+ tttgoto(gen_CS, bot, top);
+ tt.tt_scroll_top = top;
+ tt.tt_scroll_bot = bot;
+ tt.tt_row = tt.tt_col = -10;