Include oia.h
[unix-history] / usr / src / usr.bin / tn3270 / ctlr / oia.c
CommitLineData
d1add34f
GM
1/*
2 * Routines to maintain the Operator Information Area.
3 */
4
5#include "oia.h"
d6ebedbd 6#include "../general/globals.h"
d1add34f
GM
7
8static int
9 Insert,
10 SystemLocked,
11 PWait,
12 TWait,
13 OnlineA,
14 Ready3274,
15 MyJob;
16
17#define X_AREA_SYSTEM 0xc6, "\xb2\xb8"
18#define X_AREA_CLOCK 0xc6, "\xf2\xf3"
19#define X_AREA_NULL 0xc6, ""
20
21static void
1016088f 22OiaXArea(x, xwhy)
d1add34f
GM
23int x;
24char *xwhy;
25{
26 register int i;
27
28 OperatorInformationArea.x = x;
29 for (i = 0; i < sizeof OperatorInformationArea.xwhy; i++) {
30 if (*xwhy) {
31 OperatorInformationArea.xwhy[i] = *xwhy++;
32 } else {
33 OperatorInformationArea.xwhy[i] = 0;
34 }
35 }
36}
37
38
1016088f 39OiaInsert(onoff)
d1add34f
GM
40int onoff;
41{
42 Insert = onoff;
43
44 if (onoff) {
45 OperatorInformationArea.insert = OIA_INSERT_ON;
46 } else {
47 OperatorInformationArea.insert = 0;
48 }
d6ebedbd 49 ScreenOIA();
d1add34f
GM
50}
51
1016088f 52OiaSystemLocked(onoff)
d1add34f
GM
53int onoff;
54{
55 SystemLocked = onoff;
56
57 if ((PWait == 0) && (TWait == 0)) {
1016088f 58 OiaXArea(X_AREA_SYSTEM);
d1add34f 59 }
d6ebedbd 60 ScreenOIA();
d1add34f
GM
61}
62
1016088f 63OiaPWait(onoff)
d1add34f
GM
64int onoff;
65{
66 PWait = onoff;
67
68 if (onoff) {
1016088f 69 OiaXArea(X_AREA_CLOCK);
d1add34f
GM
70 } else {
71 if (SystemLocked) {
1016088f 72 OiaXArea(X_AREA_SYSTEM);
d1add34f 73 } else {
1016088f 74 OiaXArea(X_AREA_NULL);
d1add34f
GM
75 }
76 }
d6ebedbd 77 ScreenOIA();
d1add34f
GM
78}
79
1016088f 80OiaTWait(onoff)
d1add34f
GM
81int onoff;
82{
83 TWait = onoff;
84
1016088f 85 OiaPWait(onoff);
d1add34f
GM
86}
87
1016088f 88OiaOnlineA(onoff)
d1add34f
GM
89int onoff;
90{
91 OnlineA = onoff;
92
93 if (onoff) {
1016088f 94 OiaMyJob(1);
d1add34f
GM
95 OperatorInformationArea.online = OIA_ONLINE_A;
96 } else {
97 OperatorInformationArea.online = 0;
98 }
d6ebedbd 99 ScreenOIA();
d1add34f
GM
100}
101
1016088f 102OiaReady3274(onoff)
d1add34f
GM
103int onoff;
104{
105 Ready3274 = onoff;
106
107 if (onoff) {
108 OperatorInformationArea.ready = OIA_READY_3274;
109 } else {
110 OperatorInformationArea.ready = 0;
111 }
d6ebedbd 112 ScreenOIA();
d1add34f
GM
113}
114
1016088f 115OiaMyJob(onoff)
d1add34f
GM
116int onoff;
117{
118 MyJob = onoff;
119
120 if (onoff) {
121 OperatorInformationArea.ownership = OIA_OWNERSHIP_MYJOB;
122 } else {
123 OperatorInformationArea.ownership = 0;
124 }
d6ebedbd 125 ScreenOIA();
d1add34f 126}