/************************************************************************
 *                                                                      *
 *                      copyright Richard Bornat 1981                   *
 *                                                                      *
 ************************************************************************/

new_move(srow, scol)
register int srow, scol;
 {  /* ^V, col+040, row+040 */
    ttyout('\026');
    ttyout(scol+040);
    ttyout(srow+040);
 }

#define TER_ROWS 24
#define TER_COLS 80

struct TERMINAL new_ter =
 {  /* nrows, ncols - size of the screen */
    TER_ROWS, TER_COLS,

    /* up, left, c_MODIFY, c_CONTROL, c_BLOB - single characters */
    { '\013', '\010', 0, '^'|0200, ' '|0200 },
        /* onechar */

    /* rollup, pushdown, pushup, pulldown, pullup STRINGS */
    /* and hardscroll boolean */
    { "\n", "\001", 0, 0, "\002", true },
        /* scrseq */

    /* scrollup, scrolldown PROCEDURES */
    scr2_up, scr2_down,

    /* splitdown, splitup, joindown, joinup STRINGS */
    { 0, 0, 0, 0 },
        /* splitseq */

    /* split_row, join_row PROCEDURES */
    split0, join0,

    /* clearscreen, *clearhead, *cleartail STRINGS */
    { "\037", 0, "\031" },
        /* clrseq */

    /* clr_screen, clr_head, clr_tail PROCEDURES */
    clrs1, clrh0, clrt1,

    /* inspace, makespace, rubout, erase STRINGS */
    { 0, "\017", 0, "\016" },
        /* charseq */

    /* ins_char, del_char PROCEDURES */
    insc2, delc2,

    /* bright, normal STRINGS */
    { "\005", "\006" },
        /* vidseq */

    /* in_two, out_two PROCEDURES */
    no_char, no_char,

    /* move PROCEDURE and nmove integer */
    new_move, 3,

    /* setup, special, pad PROCEDURES */
    no_int, no_int, no_int

 };

/* table of characters for input (INMODE) mode */
char  ictab[] =
 {      /* 000 - 007, null - ^G */
        IGN, WRIGHT, WLEFT, IGN, NL, HEADRUBOUT, TAILERASE, WERASE,
        /* 010 - 017, ^H - ^O */
        LEFT, TAB, DOWN, UP, CHMODE, CR, BOTSCREEN, TOPSCREEN,
        /* 020 - 027, ^P - ^W */
        LSTART, LEND, ERASE, UP, WRIGHT, WLEFT, SEND, WRUBOUT,
        /* 030 - 037, ^X - ^_ */
        RIGHT, TAILERASE, CONTROL, ENTERedit, IGN, SEND, IGN, IGN,
        SPACE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, RUBOUT
 };

/* table of characters for edit (EDMODE) mode. Much the same
 * as ictab, except for the absence of UP, DOWN, TOPSCREEN,
 * BOTSCREEN and LINEERASE. CR or LF are also COMMAND in this mode
 */
char  ectab[] =
 {      /* 000 - 007, null - ^G */
        IGN, WRIGHT, WLEFT, IGN, COMMAND, HEADRUBOUT, TAILERASE, WERASE,
        /* 010 - 017, ^H - ^O */
        LEFT, TAB, IGN, IGN, CHMODE, COMMAND, IGN, IGN,
        /* 020 - 027, ^P - ^W */
        LSTART, LEND, ERASE, IGN, WRIGHT, WLEFT, SEND, WRUBOUT,
        /* 030 - 037, ^X - ^_ */
        RIGHT, TAILERASE, CONTROL, ENTERedit, IGN, SEND, IGN, IGN,
        SPACE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, ONE,
        ONE, ONE, ONE, ONE, ONE, ONE, ONE, RUBOUT
 };
