Commit | Line | Data |
---|---|---|
17865084 | 1 | /* |
7edc52ec | 2 | * @(#)tt.h 3.11 %G% |
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 */ | |
a830e8bb | 41 | short *tt_frame; |
17865084 | 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. |
b1189050 | 57 | * Too may t's. |
c3f80cb5 EW |
58 | */ |
59 | char tt_strings[1024]; /* string buffer */ | |
60 | char *tt_strp; /* pointer for it */ | |
61 | ||
b1189050 EW |
62 | #define tttgetstr(s) tgetstr((s), &tt_strp) |
63 | char *ttxgetstr(); /* tgetstr() and expand delays */ | |
c3f80cb5 | 64 | |
b1189050 EW |
65 | int tttputc(); |
66 | #define tttputs(s, n) tputs((s), (n), tttputc) | |
67 | ||
68 | /* | |
69 | * Buffered output without stdio. | |
70 | * These variables have different meanings from the ww_ob* variabels. | |
71 | * But I'm too lazy to think up different names. | |
72 | */ | |
73 | char tt_ob[512]; | |
74 | char *tt_obp; | |
75 | char *tt_obe; | |
76 | #define ttputc(c) (tt_obp < tt_obe ? *tt_obp++ = (c) \ | |
77 | : (ttflush(), *tt_obp++ = (c))) |