date and time created 87/05/11 13:12:01 by minshall
[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"
6
7OIA OperatorInformationArea;
8
9static int
10 Insert,
11 SystemLocked,
12 PWait,
13 TWait,
14 OnlineA,
15 Ready3274,
16 MyJob;
17
18#define X_AREA_SYSTEM 0xc6, "\xb2\xb8"
19#define X_AREA_CLOCK 0xc6, "\xf2\xf3"
20#define X_AREA_NULL 0xc6, ""
21
22static void
23SetXarea(x, xwhy)
24int x;
25char *xwhy;
26{
27 register int i;
28
29 OperatorInformationArea.x = x;
30 for (i = 0; i < sizeof OperatorInformationArea.xwhy; i++) {
31 if (*xwhy) {
32 OperatorInformationArea.xwhy[i] = *xwhy++;
33 } else {
34 OperatorInformationArea.xwhy[i] = 0;
35 }
36 }
37}
38
39
40SetInsert(onoff)
41int onoff;
42{
43 Insert = onoff;
44
45 if (onoff) {
46 OperatorInformationArea.insert = OIA_INSERT_ON;
47 } else {
48 OperatorInformationArea.insert = 0;
49 }
50}
51
52SetSystemLocked(onoff)
53int onoff;
54{
55 SystemLocked = onoff;
56
57 if ((PWait == 0) && (TWait == 0)) {
58 SetXArea(X_AREA_SYSTEM);
59 }
60}
61
62SetPWait(onoff)
63int onoff;
64{
65 PWait = onoff;
66
67 if (onoff) {
68 SetXArea(X_AREA_CLOCK);
69 } else {
70 if (SystemLocked) {
71 SetXArea(X_AREA_SYSTEM);
72 } else {
73 SetXArea(X_AREA_NULL);
74 }
75 }
76}
77
78SetTWait(onoff)
79int onoff;
80{
81 TWait = onoff;
82
83 SetPWait(onoff);
84}
85
86SetOnlineA(onoff)
87int onoff;
88{
89 OnlineA = onoff;
90
91 if (onoff) {
92 SetMyJob(1);
93 OperatorInformationArea.online = OIA_ONLINE_A;
94 } else {
95 OperatorInformationArea.online = 0;
96 }
97}
98
99SetReady3274(onoff)
100int onoff;
101{
102 Ready3274 = onoff;
103
104 if (onoff) {
105 OperatorInformationArea.ready = OIA_READY_3274;
106 } else {
107 OperatorInformationArea.ready = 0;
108 }
109}
110
111SetMyJob(onoff)
112int onoff;
113{
114 MyJob = onoff;
115
116 if (onoff) {
117 OperatorInformationArea.ownership = OIA_OWNERSHIP_MYJOB;
118 } else {
119 OperatorInformationArea.ownership = 0;
120 }
121}