xref: /386bsd/usr/src/usr.bin/tn3270/ctlr/oia.h (revision a2142627)
1 /*-
2  * Copyright (c) 1988 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. All advertising materials mentioning features or use of this software
14  *    must display the following acknowledgement:
15  *	This product includes software developed by the University of
16  *	California, Berkeley and its contributors.
17  * 4. Neither the name of the University nor the names of its contributors
18  *    may be used to endorse or promote products derived from this software
19  *    without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  *
33  *	@(#)oia.h	4.2 (Berkeley) 4/26/91
34  */
35 
36 /*
37  * This file describes the Operator Information Area in the 3270.
38  *
39  * Our OIA looks like that used by the 3270 PC and PC 3270 products.
40  */
41 
42 #define	INCLUDED_OIA
43 
44 typedef struct {
45     char
46 	online_ownership,
47 	character_selection,
48 	shift_state,
49 	pss_group_1,
50 	highlight_group_1,
51 	color_group_1,
52 	insert,
53 	input_inhibited[5],
54 	pss_group_2,
55 	highlight_group_2,
56 	color_group_2,
57 	comm_error_reminder,
58 	printer_status,
59 	reserved_group_14,
60 	reserved_group_15,
61 	autokey_play_record_status,
62 	autokey_abort_pause_status,
63 	enlarge_state;
64 } OIA;
65 
66 /* Bits in online_ownership */
67 #define	OIA_SETUP		0x80
68 #define	OIA_TEST		0x40
69 #define	OIA_SSCP_LU		0x20
70 #define	OIA_LU_LU		0x10
71 #define	OIA_UNOWNED		0x08
72 #define	OIA_SUBSYSTEM_READY	0x04
73 
74 /* Bit in character_selection */
75 #define	OIA_EXTENDED_SELECT	0x80
76 #define	OIA_APL			0x40
77 #define	OIA_KANA		0x20
78 #define	OIA_ALPHA		0x10
79 #define	OIA_TEXT		0x08
80 
81 /* Bits in shift_state */
82 #define	OIA_NUMERIC		0x80
83 #define	OIA_UPPER_SHIFT		0x40
84 
85 /* Bits in pss_group_1, highlight_group_1, and color_group_1 */
86 #define	OIA_SELECTABLE		0x80
87 #define	OIA_FIELD_INHERIT	0x40
88 
89 /* Bits in insert */
90 #define	OIA_INSERT_MODE		0x80
91 
92 /* We define this to be a 'long' followed by a 'char' (5 bytes) */
93 
94 #define	OIA_NON_RESETTABLE	0x80
95 #define	OIA_SECURITY_KEY	0x40
96 #define	OIA_MACHINE_CHECK	0x20
97 #define	OIA_COMM_CHECK		0x10
98 #define	OIA_PROGRAM_CHECK	0x08
99 #define	OIA_RETRY		0x04
100 #define	OIA_DEVICE_NOT_WORKING	0x02
101 #define	OIA_DEVICE_VERY_BUSY	0x01
102 
103 #define	OIA_DEVICE_BUSY		  0x80
104 #define	OIA_TERMINAL_WAIT	  0x40
105 #define	OIA_MINUS_SYMBOL	  0x20
106 #define	OIA_MINUS_FUNCTION	  0x10
107 #define	OIA_TOO_MUCH_ENTERED	  0x08
108 #define	OIA_NOT_ENOUGH_ENTERED	  0x04
109 #define	OIA_WRONG_NUMBER	  0x02
110 #define	OIA_NUMERIC_FIELD	  0x01
111 
112 #define	OIA_OP_UNAUTHORIZED	    0x80
113 #define	OIA_OP_UNAUTHORIZED_MIN	    0x40
114 #define	OIA_INVALID_DEAD_KEY_COMBO  0x20
115 #define	OIA_WRONG_PLACE		    0x10
116 
117 #define	OIA_MESSAGE_PENDING	      0x80
118 #define	OIA_PARTITION_WAIT	      0x40
119 #define	OIA_SYSTEM_WAIT		      0x20
120 #define	OIA_HARDWARE_MISMATCH	      0x10
121 #define	OIA_LOGICAL_TERM_NOT_CONF     0x08
122 
123 
124 #define	OIA_AUTOKEY_INHIBIT	        0x80
125 #define	OIA_API_INHIBIT		        0x40
126 
127 /* Bits in pss_group_2 */
128 #define	OIA_PS_SELECTED		0x80
129 #define	OIA_PC_DISPLAY_DISABLE	0x40
130 
131 /* Bits in highlight_group_2 and color_group_2 */
132 #define	OIA_SELECTED		0x80
133 
134 /* Bits in comm_error_reminder */
135 #define	OIA_COMM_ERROR		0x80
136 #define	OIA_RTM			0x40
137 
138 /* Bits in printer_status */
139 #define	OIA_PRINT_NOT_CUSTOM	0x80
140 #define	OIA_PRINTER_MALFUNCTION	0x40
141 #define	OIA_PRINTER_PRINTING	0x20
142 #define	OIA_ASSIGN_PRINTER	0x10
143 #define	OIA_WHAT_PRINTER	0x08
144 #define	OIA_PRINTER_ASSIGNMENT	0x04
145 
146 /* Bits in autokey_play_record_status */
147 #define	OIA_PLAY		0x80
148 #define	OIA_RECORD		0x40
149 
150 /* Bits in autokey_abort_pause_status */
151 #define	OIA_RECORDING_OVERFLOW	0x80
152 #define	OIA_PAUSE		0x40
153 
154 /* Bits in enlarge_state */
155 #define	OIA_WINDOW_IS_ENLARGED	0x80
156 
157 /* Define functions to set and read the oia */
158 
159 #define	SetOiaOnlineA(oia) SetOiaMyJob((oia))		/* Side-effect */
160 #define	ResetOiaOnlineA(oia) \
161 	/* Nothing defined for this */
162 
163 #define	IsOiaReady3274(oia)	((oia)->online_ownership&OIA_SUBSYSTEM_READY)
164 #define	ResetOiaReady3274(oia)	(oia)->online_ownership &= ~OIA_SUBSYSTEM_READY
165 #define	SetOiaReady3274(oia)	(oia)->online_ownership |= OIA_SUBSYSTEM_READY
166 
167 #define	IsOiaMyJob(oia)		((oia)->online_ownership&OIA_LU_LU)
168 #define	ResetOiaMyJob(oia)	(oia)->online_ownership &= ~OIA_LU_LU
169 #define	SetOiaMyJob(oia)	(oia)->online_ownership |= OIA_LU_LU
170 
171 #define	IsOiaInsert(oia)	((oia)->online_ownership&OIA_INSERT_MODE)
172 #define	ResetOiaInsert(oia)	(oia)->online_ownership &= ~OIA_INSERT_MODE
173 #define	SetOiaInsert(oia)	(oia)->online_ownership |= OIA_INSERT_MODE
174 
175 #define	IsOiaSystemLocked(oia)	((oia)->input_inhibited[3]&OIA_SYSTEM_WAIT)
176 #define	ResetOiaSystemLocked(oia) \
177 				(oia)->input_inhibited[3] &= ~OIA_SYSTEM_WAIT
178 #define	SetOiaSystemLocked(oia)	(oia)->input_inhibited[3] |= OIA_SYSTEM_WAIT
179 
180 #define	IsOiaTWait(oia)		((oia)->input_inhibited[1]&OIA_TERMINAL_WAIT)
181 #define	ResetOiaTWait(oia)	(oia)->input_inhibited[1] &= ~OIA_TERMINAL_WAIT
182 #define	SetOiaTWait(oia)	(oia)->input_inhibited[1] |= OIA_TERMINAL_WAIT
183 
184 #define	IsOiaApiInhibit(oia)	((oia)->input_inhibited[4] &   OIA_API_INHIBIT)
185 #define	ResetOiaApiInhibit(oia)	((oia)->input_inhibited[4] &= ~OIA_API_INHIBIT)
186 #define	SetOiaApiInhibit(oia)	((oia)->input_inhibited[4] |=  OIA_API_INHIBIT)
187 
188 /* A macro to let the world know that someone has modified the OIA. */
189 #define	SetOiaModified()	oia_modified = 1
190 #define	SetPsModified()		ps_modified = 1
191