/* In this scheme, characters in the alternate character sets have
seperate termcap entries */
struct cap_graphics {
char *single_cap; /* termcap entry name for single lines */
char *double_cap; /* termcap entry name for double lines */
char *name; /* expanded text name */
};
static char *cap_single[256];
static char *cap_double[256];
static char *dual_caps[5][5][5];
static char cap_cookies[5];
struct cap_mode_list {
char *name;
char *begin_mode, *end_mode;
char *cookie_count;
int attr;
};
#ifdef TC
struct cap_graphics tcg[] = {
"gv", "GV", "vertical line",
"gh", "GH", "horizontal line",
"g1", "G1", "top right corner",
"g4", "G4", "bottom right corner",
"g2", "G2", "top left corner",
"g3", "G3", "bottom left corner",
"gd", "GD", "down-tick character (T)",
"gl", "GL", "left-tick character (-|)",
"gr", "GR", "right-tick character (|-)",
"gc", "GC", "middle intersection",
"gu", "GU", "up-tick character (_|_)",
0, 0, 0};
struct cap_mode_list cap_alt_modes[] = {
"inverse", "so", "se", "sg", 1,
"underline", "us", "ue", "ug", 2,
"blink", "bo", "be", "bb", 3,
"dim", "it", "ie", "ig", 4,
"graphics", "GS", "GE", "GG", 5,
0, "a3", "A3", 0, 0x24,
0, "a8", "A8", 0, 0x23,
0, "b0", "B0", 0, 0x25,
0, "a7", "A7", 0, 0x41,
0, "a6", "A6", 0, 0x21,
0, "b3", "B3", 0, 0x321,
0, "b4", "B4", 0, 0x51,
0, "b5", "B5", 0, 0x251,
0, "b2", "B2", 0, 0x31,
0, 0, 0, 0, 0 };
#else
#ifdef XENIX
struct cap_graphics tcg[] = {
"gv", "GV", "vertical line",
"gh", "GH", "horizontal line",
"g1", "G1", "top right corner",
"g4", "G4", "bottom right corner",
"g2", "G2", "top left corner",
"g3", "G3", "bottom left corner",
"gd", "GD", "down-tick character (T)",
"gl", "GL", "left-tick character (-|)",
"gr", "GR", "right-tick character (|-)",
"gc", "GC", "middle intersection",
"gu", "GU", "up-tick character (_|_)",
#ifdef WHO_KNOWS
"f1", "F1", "S/D top right corner",
"f4", "F4", "S/D bottom right corner",
"f2", "F2", "S/D top left corner",
"f3", "F3", "S/D bottom left corner",
"fd", "FD", "S/D down-tick character (T)",
"fl", "FL", "S/D left-tick character (-|)",
"fr", "FR", "S/D right-tick character (|-)",
"fc", "FC", "S/D middle intersection",
"fu", "FU", "S/D up-tick character (_|_)",
#endif
0, 0, 0};
struct cap_mode_list cap_alt_modes[] = {
"inverse", "so", "se", "sg", 1,
"underline", "us", "ue", "ug", 2,
"blink", "bo", "be", "bb", 3,
"dim", "it", "ie", "ig", 4,
"graphics", "GS", "GE", "GG", 5,
0, "a3", "A3", 0, 0x24,
0, "a8", "A8", 0, 0x23,
0, "b0", "B0", 0, 0x25,
0, "a7", "A7", 0, 0x41,
0, "a6", "A6", 0, 0x21,
0, "b3", "B3", 0, 0x321,
0, "b4", "B4", 0, 0x51,
0, "b5", "B5", 0, 0x251,
0, "b2", "B2", 0, 0x31,
0, 0, 0, 0, 0 };
#else
#ifdef MV
struct cap_graphics tcg[] = {
"GV", "GGV", "vertical line",
"GH", "GGH", "horizontal line",
"G1", "GG1", "top right corner",
"G4", "GG4", "bottom right corner",
"G2", "GG2", "top left corner",
"G3", "GG3", "bottom left corner",
"GD", "GGD", "Down-tick character (T)",
"GL", "GGL", "Left-tick character (-|)",
"GR", "GGR", "Right-tick character (|-)",
"GC", "GGC", "middle intersection",
"GU", "GGU", "Up-tick character (_|_)",
0, 0, 0};
struct cap_mode_list cap_alt_modes[] = {
"standout", "so", "se", "sg", 1,
"underline", "us", "ue", "ug", 2,
"graphics", "GS", "GE", "GG", 3,
"blink", "mb", "me", 0, 4,
"dim", "mh", "me", 0, 5,
"bold", "md", "me", 0, 6,
"overstrike","mo", "me", 0, 7,
0, 0, 0, 0, 0 };
#endif
#endif
#endif
#endif
test_status()
{
int i, max;
char *s;
static char m[] = "*** status line *** 123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.";
can_test("(hs)(wsl)(tsl)(fsl)(dsl)");
if (stop_testing) return;
if (has_status_line != 1)
{
ptextln("Terminal has no status line (hs)");
return;
}
max = width_status_line == -1 ? columns : width_status_line;
sprintf(temp, "Terminal has status line of %d characters", max);
ptextln(temp);
put_str("This line s");
s = tparm(to_status_line, 0);
putp(s);
for (i = 0; i < max; i++) putchp(m[i]);
putp(from_status_line);
putln("hould not be broken");
(void) wait_here();
if (dis_status_line)
{
ptextln("Disable status line (dsl)");
putp(dis_status_line);
}
else ptextln("Terminal can not disable status line (dsl)");
}
eat_cookie()
{ /* put a blank if this is not a magic cookie terminal */
if (magic_cookie_glitch < 1) putchp(' ');
}
put_mode(s)
char *s;
{ /* send the attribute string (with or without % execution) */
#ifdef SVR3_2
putp(tparm(s)); /* allow % execution */
#else
putp(s); /* ignore % */
#endif
}
void
set_attr(a)
int a;
{ /* set the attribute from the bits in a */
int i, b[32];
if (magic_cookie_glitch > 0) char_count += magic_cookie_glitch;