xref: /csrg-svn/usr.bin/tn3270/ctlr/api.h (revision 31168)
1 /*
2  * This file contains header information used by the PC API routines.
3  */
4 
5 #define	API_INTERRUPT_NUMBER	0x7A		/* API Interrupt Number */
6 
7 /*
8  * Define the gate numbers.  These are returned via the Name Resolution
9  * service.
10  */
11 
12 #define	GATE_SESSMGR	1
13 #define	GATE_KEYBOARD	2
14 #define	GATE_COPY	3
15 #define	GATE_OIAM	4
16 
17 /*
18  * The names which correspond to the above gate numbers.
19  */
20 
21 #define	NAME_SESSMGR	"SESSMGR "
22 #define	NAME_KEYBOARD	"KEYBOARD"
23 #define	NAME_COPY	"COPY    "
24 #define	NAME_OIAM	"OIAM    "
25 
26 
27 /*
28  * Name Resolution is specified in AH.
29  */
30 
31 #define	NAME_RESOLUTION	0x81
32 
33 /*
34  * Codes specified in AL for various services.
35  */
36 
37 #define	QUERY_SESSION_ID		0x01
38 #define	QUERY_SESSION_PARMS		0x02
39 #define	QUERY_SESSION_CURSOR		0x0b
40 
41 #define	CONNECT_TO_KEYBOARD		0x01
42 #define	DISCONNECT_FROM_KEYBOARD	0x02
43 #define	WRITE_KEYSTROKE			0x04
44 #define	DISABLE_INPUT			0x05
45 #define	ENABLE_INPUT			0x06
46 
47 #define	COPY_STRING			0x01
48 
49 #define	READ_OIA_GROUP			0x02
50 
51 /*
52  * For each service, we define the assoicated parameter blocks.
53  */
54 
55 /*
56  * Supervisor Services
57  */
58 
59 typedef struct {
60     char	gate_name[8];
61 } NameResolveParms;
62 
63 
64 /*
65  * Session Information Services
66  */
67 
68 typedef struct {
69     char
70 	short_name,
71 	type,
72 	session_id,
73 	reserved,
74 	long_name[8];
75 } NameArrayElement;
76 
77 typedef struct {
78     char
79 	length,
80 	number_matching_session;
81     NameArrayElement
82 	name_array_element;		/* Variable number */
83 } NameArray;
84 
85 typedef struct {
86     char
87 	rc,
88 	function_id,
89 	option_code,
90 	data_code;
91     NameArray far
92 	*name_array;
93     char
94 	long_name[8];
95 } QuerySessionIdParms;
96 
97 typedef struct {
98     char
99 	rc,
100 	function_id,
101 	session_id,
102 	reserved,
103 	session_type,
104 	session_characteristics,
105 	rows,
106 	columns;
107     char far
108 	*presentation_space;
109 } QuerySessionParametersParms;
110 
111 #define	TYPE_WSCTL		0x01		/* Work Station Control */
112 #define	TYPE_DFT		0x02		/* DFT Host Session */
113 #define	TYPE_CUT		0x03		/* CUT Host Session */
114 #define	TYPE_NOTEPAD		0x04		/* Notepad Session */
115 #define	TYPE_PC			0x05		/* Personal Computer Session */
116 
117 #define	CHARACTERISTIC_EAB	0x80		/* Extended Attribute Buffer */
118 #define	CHARACTERISTIC_PSS	0x40		/* Program Symbols Supported */
119 
120 typedef struct {
121     char
122 	rc,
123 	function_id,
124 	session_id,
125 	cursor_type,
126 	row_address,				/* from 0 */
127 	column_address;				/* from 0 */
128 } QuerySessionCursorParms;
129 
130 #define	CURSOR_INHIBITED_AUTOSCROLL	0x10
131 #define	CURSOR_INHIBITED		0x04
132 #define	CURSOR_BLINKING			0x02
133 #define	CURSOR_BOX			0x01
134 typedef struct {
135     char
136 	rc,
137 	function_id,
138 	session_id,
139 	reserved;
140     int
141 	event_queue_id,
142 	input_queue_id;
143     char
144 	intercept_options,
145 	first_connection_identifier;
146 } ConnectToKeyboardParms;
147 
148 typedef struct {
149     char
150 	rc,
151 	function_id,
152 	session_id,
153 	reserved;
154     int
155 	connectors_task_id;
156 } DisconnectFromKeyboardParms;
157 
158 typedef struct {
159     char
160 	scancode,
161 	shift_state;
162 } KeystrokeEntry;
163 
164 typedef struct {
165     int
166 	length;			/* Length (in bytes) of list */
167     KeystrokeEntry keystrokes;	/* Variable size */
168 } KeystrokeList;
169 
170 typedef struct {
171     char
172 	rc,
173 	function_id,
174 	session_id,
175 	reserved;
176     int
177 	connectors_task_id;
178     char
179 	options,
180 	number_of_keys_sent;
181     union {
182 	KeystrokeEntry
183 	    keystroke_entry;
184 	KeystrokeList far
185 	    *keystroke_list;
186     } keystroke_specifier;
187 } WriteKeystrokeParms;
188 
189 typedef struct {
190     char
191 	rc,
192 	function_id,
193 	session_id,
194 	reserved;
195     int
196 	connectors_task_id;
197 } DisableInputParms;
198 
199 typedef DisableInputParms EnableInputParms;
200 
201 typedef struct {
202     char
203 	session_id,
204 	reserved;
205     char far
206 	*buffer;
207     char
208 	characteristics,
209 	session_type;
210     int
211 	begin;			/* Offset within buffer */
212 } BufferDescriptor;
213 
214 typedef struct {
215     char
216 	rc,
217 	function_id;
218     BufferDescriptor
219 	source;
220     int
221 	source_end;		/* Offset within source buffer */
222     BufferDescriptor
223 	target;
224     char
225 	copy_mode,
226 	reserved;
227 } CopyStringParms;
228 
229 #define	COPY_MODE_7_COLOR		0x80	/* Else 4 color mode */
230 #define	COPY_MODE_FIELD_ATTRIBUTES	0x40	/* Else don't copy attributes */
231 
232 typedef struct {
233     char
234 	rc,
235 	function_id,
236 	session_id,
237 	reserved;
238     char far
239 	*oia_buffer;
240     char
241 	oia_group_number;
242 } ReadOiaGroupParms;
243 
244 #define	OIA_ALL_GROUPS				0xFF
245 #define	OIA_ONLINE_OWNERSHIP			0x01
246 #	define	OIA_SETUP		0x80
247 #	define	OIA_TEST		0x40
248 #	define	OIA_SSCP_LU		0x20
249 #	define	OIA_LU_LU		0x10
250 #	define	OIA_UNOWNED		0x08
251 #	define	OIA_SUBSYSTEM_READY	0x04
252 
253 #define	OIA_CHARACTER_SELECTION			0x02
254 #	define	OIA_EXTENDED_SELECT	0x80
255 #	define	OIA_APL			0x40
256 #	define	OIA_KANA		0x20
257 #	define	OIA_ALPHA		0x10
258 #	define	OIA_TEXT		0x08
259 
260 #define	OIA_SHIFT_STATE				0x03
261 #	define	OIA_NUMERIC		0x80
262 #	define	OIA_UPPER_SHIFT		0x40
263 
264 #define	OIA_PSS_GROUP_1				0x04
265 #define	OIA_HIGHLIGHT_GROUP_1			0x05
266 #define	OIA_COLOR_GROUP_1			0x06
267 #	define	OIA_SELECTABLE		0x80
268 #	define	OIA_FIELD_INHERIT	0x40
269 
270 #define	OIA_INSERT				0x07
271 #	define	OIA_INSERT_MODE		0x80
272 
273 /* We define this to be a 'long' followed by a 'char' (5 bytes) */
274 
275 #define	OIA_INPUT_INHIBITED			0x08
276 
277 #	define	OIA_NON_RESETTABLE	0x80000000
278 #	define	OIA_SECURITY_KEY	0x40000000
279 #	define	OIA_MACHINE_CHECK	0x20000000
280 #	define	OIA_COMM_CHECK		0x10000000
281 #	define	OIA_PROGRAM_CHECK	0x08000000
282 #	define	OIA_RETRY		0x04000000
283 #	define	OIA_DEVICE_NOT_WORKING	0x02000000
284 #	define	OIA_DEVICE_VERY_BUSY	0x01000000
285 
286 #	define	OIA_DEVICE_BUSY		0x00800000
287 #	define	OIA_TERMINAL_WAIT	0x00400000
288 #	define	OIA_MINUS_SYMBOL	0x00200000
289 #	define	OIA_MINUS_FUNCTION	0x00100000
290 #	define	OIA_TOO_MUCH_ENTERED	0x00080000
291 #	define	OIA_NOT_ENOUGH_ENTERED	0x00040000
292 #	define	OIA_WRONG_NUMBER	0x00020000
293 #	define	OIA_NUMERIC_FIELD	0x00010000
294 
295 #	define	OIA_OP_UNAUTHORIZED	0x00008000
296 #	define	OIA_OP_UNAUTHORIZED_MIN	0x00004000
297 #	define	OIA_INVALID_DEAD_KEY_COMBO 0x00002000
298 #	define	OIA_WRONG_PLACE		0x00001000
299 
300 #	define	OIA_MESSAGE_PENDING	0x00000080
301 #	define	OIA_PARTITION_WAIT	0x00000040
302 #	define	OIA_SYSTEM_WAIT		0x00000020
303 #	define	OIA_HARDWARE_MISMATCH	0x00000010
304 #	define	OIA_LOGICAL_TERM_NOT_CONF 0x00000008
305 
306 
307 #	define	OIA_AUTOKEY_INHIBIT	0x80
308 #	define	OIA_API_INHIBIT		0x40
309 
310 #define	OIA_PSS_GROUP_2				0x09
311 #	define	OIA_PS_SELECTED		0x80
312 #	define	OIA_PC_DISPLAY_DISABLE	0x40
313 
314 #define	OIA_HIGHLIGHT_GROUP_2			0x0a
315 #define	OIA_COLOR_GROUP_2			0x0b
316 #	define	OIA_SELECTED		0x80
317 
318 #define	OIA_COMMUNICATION_ERROR_REMINDER	0x0c
319 #	define	OIA_COMM_ERROR		0x80
320 #	define	OIA_RTM			0x40
321 
322 #define	OIA_PRINTER_STATUS			0x0d
323 #	define	OIA_PRINT_NOT_CUSTOM	0x80
324 #	define	OIA_PRINTER_MALFUNCTION	0x40
325 #	define	OIA_PRINTER_PRINTING	0x20
326 #	define	OIA_ASSIGN_PRINTER	0x10
327 #	define	OIA_WHAT_PRINTER	0x08
328 #	define	OIA_PRINTER_ASSIGNMENT	0x04
329 
330 #define	OIA_AUTOKEY_PLAY_RECORD_STATUS		0x10
331 #	define	OIA_PLAY		0x80
332 #	define	OIA_RECORD		0x40
333 
334 #define	OIA_AUTOKEY_ABORT_PAUSE_STATUS		0x11
335 #	define	OIA_RECORDING_OVERFLOW	0x80
336 #	define	OIA_PAUSE		0x40
337 
338 #define	OIA_ENLARGE_STATE			0x12
339 #	define	OIA_WINDOW_IS_ENLARGED	0x80
340 
341 
342 
343