Commit | Line | Data |
---|---|---|
17865084 | 1 | /* |
3130283e | 2 | * @(#)tt.h 3.8 83/09/15 |
17865084 EW |
3 | */ |
4 | ||
3130283e EW |
5 | /* |
6 | * Interface structure for the terminal drivers. | |
7 | */ | |
17865084 | 8 | struct tt { |
3130283e | 9 | /* startup and cleanup */ |
17865084 | 10 | int (*tt_init)(); |
e908bfac | 11 | int (*tt_end)(); |
3130283e EW |
12 | |
13 | /* terminal functions */ | |
e908bfac | 14 | int (*tt_move)(); |
17865084 EW |
15 | int (*tt_insline)(); |
16 | int (*tt_delline)(); | |
17 | int (*tt_delchar)(); | |
3130283e EW |
18 | int (*tt_write)(); /* write a whole block */ |
19 | int (*tt_putc)(); /* write one character */ | |
17865084 EW |
20 | int (*tt_clreol)(); |
21 | int (*tt_clreos)(); | |
22 | int (*tt_clear)(); | |
3130283e EW |
23 | |
24 | /* internal variables */ | |
25 | char tt_modes; /* the current display modes */ | |
26 | char tt_nmodes; /* the new modes for next write */ | |
27 | char tt_insert; /* currently in insert mode */ | |
28 | char tt_ninsert; /* insert mode on next write */ | |
29 | int tt_row; /* cursor row */ | |
30 | int tt_col; /* cursor column */ | |
31 | ||
32 | /* terminal info */ | |
33 | int tt_nrow; /* number of display rows */ | |
34 | int tt_ncol; /* number of display columns */ | |
35 | char tt_hasinsert; /* has insert character */ | |
36 | char tt_availmodes; /* the display modes supported */ | |
5e785082 | 37 | char tt_wrap; /* has auto wrap around */ |
377a2410 | 38 | char tt_retain; /* can retain below (db flag) */ |
3130283e EW |
39 | |
40 | /* the frame characters */ | |
17865084 EW |
41 | char *tt_frame; |
42 | }; | |
17865084 EW |
43 | struct tt tt; |
44 | ||
3130283e EW |
45 | /* |
46 | * List of terminal drivers. | |
47 | */ | |
17865084 EW |
48 | struct tt_tab { |
49 | char *tt_name; | |
50 | int tt_len; | |
51 | int (*tt_func)(); | |
52 | }; | |
17865084 | 53 | struct tt_tab tt_tab[]; |
c3f80cb5 EW |
54 | |
55 | /* | |
3130283e | 56 | * Clean interface to termcap routines. |
c3f80cb5 EW |
57 | */ |
58 | char tt_strings[1024]; /* string buffer */ | |
59 | char *tt_strp; /* pointer for it */ | |
60 | ||
61 | int tt_pc(); /* just putchar() */ | |
62 | int tt_sc(); /* *tt_strp++ = c */ | |
63 | char *tt_xgetstr(); /* tgetstr() and expand delays */ | |
64 | ||
65 | #define tt_tgetstr(s) tgetstr((s), &tt_strp) | |
66 | #define tt_tputs(s, n) tputs((s), (n), tt_pc) |