BSD 4_4 release
[unix-history] / usr / src / usr.bin / tn3270 / ctlr / oia.c
index e6dc3c8..1f80359 100644 (file)
+/*-
+ * Copyright (c) 1988, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)oia.c      8.1 (Berkeley) 6/6/93";
+#endif /* not lint */
+
 /*
  * Routines to maintain the Operator Information Area.
  */
 
 /*
  * Routines to maintain the Operator Information Area.
  */
 
+#include "../general/general.h"
+
 #include "oia.h"
 #include "../general/globals.h"
 
 #include "oia.h"
 #include "../general/globals.h"
 
-static int
-    Insert,
-    SystemLocked,
-    PWait,
-    TWait,
-    OnlineA,
-    Ready3274,
-    MyJob;
-
-#define        X_AREA_SYSTEM   0xc6, "\xb2\xb8"
-#define        X_AREA_CLOCK    0xc6, "\xf2\xf3"
-#define        X_AREA_NULL     0xc6, ""
-
-static void
-OiaXArea(x, xwhy)
-int    x;
-char   *xwhy;
-{
-    register int i;
-
-    OperatorInformationArea.x = x;
-    for (i = 0; i < sizeof OperatorInformationArea.xwhy; i++) {
-       if (*xwhy) {
-           OperatorInformationArea.xwhy[i] = *xwhy++;
-       } else {
-           OperatorInformationArea.xwhy[i] = 0;
-       }
-    }
-}
-
-
-OiaInsert(onoff)
-int    onoff;
-{
-    Insert = onoff;
-
-    if (onoff) {
-       OperatorInformationArea.insert = OIA_INSERT_ON;
-    } else {
-       OperatorInformationArea.insert = 0;
-    }
-    ScreenOIA();
-}
-
-OiaSystemLocked(onoff)
-int    onoff;
-{
-    SystemLocked = onoff;
-
-    if ((PWait == 0) && (TWait == 0)) {
-       OiaXArea(X_AREA_SYSTEM);
-    }
-    ScreenOIA();
-}
 
 
-OiaPWait(onoff)
-int    onoff;
+init_oia()
 {
 {
-    PWait = onoff;
-
-    if (onoff) {
-       OiaXArea(X_AREA_CLOCK);
-    } else {
-       if (SystemLocked) {
-           OiaXArea(X_AREA_SYSTEM);
-       } else {
-           OiaXArea(X_AREA_NULL);
-       }
-    }
-    ScreenOIA();
-}
-
-OiaTWait(onoff)
-int    onoff;
-{
-    TWait = onoff;
-
-    OiaPWait(onoff);
-}
-
-OiaOnlineA(onoff)
-int    onoff;
-{
-    OnlineA = onoff;
-
-    if (onoff) {
-       OiaMyJob(1);
-       OperatorInformationArea.online = OIA_ONLINE_A;
-    } else {
-       OperatorInformationArea.online = 0;
-    }
-    ScreenOIA();
-}
-
-OiaReady3274(onoff)
-int    onoff;
-{
-    Ready3274 = onoff;
-
-    if (onoff) {
-       OperatorInformationArea.ready = OIA_READY_3274;
-    } else {
-       OperatorInformationArea.ready = 0;
-    }
-    ScreenOIA();
-}
-
-OiaMyJob(onoff)
-int    onoff;
-{
-    MyJob = onoff;
-
-    if (onoff) {
-       OperatorInformationArea.ownership = OIA_OWNERSHIP_MYJOB;
-    } else {
-       OperatorInformationArea.ownership = 0;
-    }
-    ScreenOIA();
+    ClearElement(OperatorInformationArea);
 }
 }