/* Copyright (C) Magna Carta Software, Inc. 1990, 1991. All Rights Reserved. C COMMUNICATIONS TOOLKIT IBMANSI.C -- IBM ANSI terminal emulation routines. */ #if (defined(CCTW) || defined(_WINDOWS)) #include #endif #include #include #include #include /* IBMANSI_INIT -- Memory initialization of IBM ANSI.SYS. */ void ibmansi_init(TERMINAL *t) { /* CONSTANTS */ t->type = ANSI_SYS; t->att = 7; t->csi = 0X1B; t->d_att = 7; t->d_rows = 25; t->d_cols = 80; t->delim1 = ';'; t->mode = DECANM; t->offset = 1; /* FUNCTIONS */ t->cur_pos = ansi_cursor_; t->dispatch_ctrl = vt_dispatch_ctrl_; t->erase = ansi_erase_; t->parse_cmd = ansi_parse_cmd_; t->parse_parms = term_ascii_parse_parms_; t->reset_mode = vt_reset_mode_; t->set_mode = vt_set_mode_; t->sgr = ansi_sgr_; /* KEYSTROKE ASSIGNMENTS */ term_assign_key(t, UP_ARROW, 0, "\x1B[A"); term_assign_key(t, DOWN_ARROW, 0, "\x1B[B"); term_assign_key(t, RIGHT_ARROW, 0, "\x1B[C"); term_assign_key(t, LEFT_ARROW, 0, "\x1B[D"); /* RECEIVED COMMANDS AND RESPONSES */ /* CURSOR CONTROL */ term_assign_cmd(t, CUU, "[%A", ansi_cursor_, NULL); term_assign_cmd(t, CUD, "[%B", ansi_cursor_, NULL); term_assign_cmd(t, CUF, "[%C", ansi_cursor_, NULL); term_assign_cmd(t, CUB, "[%D", ansi_cursor_, NULL); term_assign_cmd(t, CUP, "[%;%H", ansi_cursor_, NULL); term_assign_cmd(t, HVP, "[%;%f", ansi_cursor_, NULL); /* ERASE IN DISPLAY */ term_assign_cmd(t, ED, "[2J", ansi_erase_, NULL); term_assign_cmd(t, EBD,"[J", ansi_erase_, NULL); /* ERASE IN LINE */ term_assign_cmd(t, EEL0, "[K", ansi_erase_, NULL); /* STATUS REPORTS */ term_assign_cmd(t, CPR, "[6n", (void (*)(TERMINAL *, short)) ansi_cpr_, NULL); term_assign_cmd(t, SM, "[%;%h", vt_set_mode_, NULL); term_assign_cmd(t, MODE_DECSC, "[s", vt100_private_, NULL); term_assign_cmd(t, MODE_DECSC, "[u", vt100_private_, NULL); term_assign_cmd(t, SGR, "[%m", (void (*)(TERMINAL *, short)) ansi_sgr_, NULL); }