make sure unavailable mode bits are not set,
[unix-history] / usr / src / usr.bin / window / tth29.c
CommitLineData
a0a9320a 1#ifndef lint
4c049d16 2static char sccsid[] = "@(#)tth29.c 3.4 %G%";
a0a9320a
EW
3#endif
4
60de5df9
EW
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.
9 */
10
a0a9320a
EW
11#include "ww.h"
12#include "tt.h"
13
14/*
a6833679
EW
15 * H29 Driver
16 *
17 * WWM_USR mode is alternate character set.
18 *
a0a9320a
EW
19kC|h29|heath-29|z29|zenith-29:\
20 :am:bc=\ED:bt=\E-:cr=^M:do=^J:nl=^J:bl=^G:\
21 :al=\EL:le=^H:bs:cd=\EJ:ce=\EK:cl=\EE:cm=\EY%+ %+ :co#80:dc=\EN:\
22 :dl=1*\EM:do=\EB:ei=\EO:ho=\EH:im=\E@:li#24:mi:nd=\EC:as=\EF:ae=\EG:\
23 :ms:ta=^I:pt:sr=\EI:se=\Eq:so=\Ep:up=\EA:vs=\Ex4:ve=\Ey4:\
24 :kb=^H:ku=\EA:kd=\EB:kl=\ED:kr=\EC:kh=\EH:kn#1:k0=\E~:l0=HOME:\
25 :k1=\ES:k2=\ET:k3=\EU:k4=\EV:k5=\EW:k6=\EP:k7=\EQ:k8=\ER:k9=\E01:\
26 :es:hs:ts=\Ej\Ex5\Ex1\EY8%+ \Eo:fs=\Ek\Ey5:ds=\Ey1:us=\Es8:ue=\Es0:
a6833679
EW
27 *
28 */
a0a9320a 29
a0a9320a
EW
30#define pc(c) ttputc('c')
31#define esc() pc(\033)
a0a9320a
EW
32
33h29_setmodes(new)
34register new;
35{
36 register modes = '0';
37
38 if (new & WWM_REV)
a6833679 39 modes += 0x01;
a0a9320a 40 if (new & WWM_BLK)
a6833679
EW
41 modes += 0x02;
42 if (new & WWM_DIM)
43 modes += 0x04;
a0a9320a 44 if (new & WWM_UL)
a6833679
EW
45 modes += 0x08;
46 if (new & WWM_USR)
47 modes += 0x10;
a0a9320a
EW
48 esc();
49 pc(s);
50 ttputc(modes);
51 if (new & WWM_GRP) {
52 if ((tt.tt_modes & WWM_GRP) == 0)
53 esc(), pc(F);
54 } else
55 if (tt.tt_modes & WWM_GRP)
56 esc(), pc(G);
57 tt.tt_modes = new;
58}
59
a0a9320a
EW
60tt_h29()
61{
62 if (tt_h19() < 0)
63 return -1;
c1a57462 64 tt.tt_setmodes = h29_setmodes;
a6833679 65 tt.tt_availmodes |= WWM_BLK|WWM_UL|WWM_DIM|WWM_USR;
a0a9320a
EW
66 return 0;
67}