support for AVIV
[unix-history] / usr / src / usr.bin / window / tt.h
CommitLineData
17865084 1/*
c1a57462 2 * @(#)tt.h 3.14 %G%
60de5df9
EW
3 */
4
5/*
6 * Copyright (c) 1983 Regents of the University of California,
7 * All rights reserved. Redistribution permitted subject to
8 * the terms of the Berkeley Software License Agreement.
17865084
EW
9 */
10
3130283e
EW
11/*
12 * Interface structure for the terminal drivers.
13 */
17865084 14struct tt {
3130283e 15 /* startup and cleanup */
17865084 16 int (*tt_init)();
e908bfac 17 int (*tt_end)();
3130283e
EW
18
19 /* terminal functions */
e908bfac 20 int (*tt_move)();
17865084
EW
21 int (*tt_insline)();
22 int (*tt_delline)();
23 int (*tt_delchar)();
3130283e
EW
24 int (*tt_write)(); /* write a whole block */
25 int (*tt_putc)(); /* write one character */
17865084
EW
26 int (*tt_clreol)();
27 int (*tt_clreos)();
28 int (*tt_clear)();
c1a57462
EW
29 int (*tt_setinsert)(); /* set insert mode */
30 int (*tt_setmodes)(); /* set display modes */
3130283e
EW
31
32 /* internal variables */
33 char tt_modes; /* the current display modes */
34 char tt_nmodes; /* the new modes for next write */
35 char tt_insert; /* currently in insert mode */
36 char tt_ninsert; /* insert mode on next write */
37 int tt_row; /* cursor row */
38 int tt_col; /* cursor column */
39
40 /* terminal info */
41 int tt_nrow; /* number of display rows */
42 int tt_ncol; /* number of display columns */
43 char tt_hasinsert; /* has insert character */
44 char tt_availmodes; /* the display modes supported */
5e785082 45 char tt_wrap; /* has auto wrap around */
377a2410 46 char tt_retain; /* can retain below (db flag) */
3130283e
EW
47
48 /* the frame characters */
a830e8bb 49 short *tt_frame;
17865084 50};
17865084
EW
51struct tt tt;
52
3130283e
EW
53/*
54 * List of terminal drivers.
55 */
17865084
EW
56struct tt_tab {
57 char *tt_name;
58 int tt_len;
59 int (*tt_func)();
60};
17865084 61struct tt_tab tt_tab[];
c3f80cb5
EW
62
63/*
3130283e 64 * Clean interface to termcap routines.
b1189050 65 * Too may t's.
c3f80cb5
EW
66 */
67char tt_strings[1024]; /* string buffer */
68char *tt_strp; /* pointer for it */
69
b1189050
EW
70#define tttgetstr(s) tgetstr((s), &tt_strp)
71char *ttxgetstr(); /* tgetstr() and expand delays */
c3f80cb5 72
b1189050
EW
73int tttputc();
74#define tttputs(s, n) tputs((s), (n), tttputc)
75
76/*
77 * Buffered output without stdio.
78 * These variables have different meanings from the ww_ob* variabels.
79 * But I'm too lazy to think up different names.
80 */
81char tt_ob[512];
82char *tt_obp;
83char *tt_obe;
cc3bd200 84#define ttputc(c) (tt_obp < tt_obe ? (*tt_obp++ = (c)) \
b1189050 85 : (ttflush(), *tt_obp++ = (c)))