Fix bug where, on an unformatted screen, we were changing the
[unix-history] / usr / src / usr.bin / tn3270 / ctlr / api.h
CommitLineData
3f328054
GM
1/*
2 * This file contains header information used by the PC API routines.
992de934 3 *
850b267c 4 * @(#)api.h 3.2 (Berkeley) %G%
3f328054
GM
5 */
6
d4967272
GM
7#if !defined(MSDOS)
8#define far /* For 'far *' checks */
9#endif /* !defined(MSDOS) */
10
3f328054
GM
11#define API_INTERRUPT_NUMBER 0x7A /* API Interrupt Number */
12
13/*
14 * Define the gate numbers. These are returned via the Name Resolution
15 * service.
16 */
17
ffff8f6a
GM
18#define GATE_SESSMGR 1234
19#define GATE_KEYBOARD 5678
20#define GATE_COPY 9101
21#define GATE_OIAM 1121
3f328054 22
86057566
GM
23/*
24 * The names which correspond to the above gate numbers.
25 */
26
27#define NAME_SESSMGR "SESSMGR "
e75c75e7 28#define NAME_KEYBOARD "KEYBOARD"
86057566
GM
29#define NAME_COPY "COPY "
30#define NAME_OIAM "OIAM "
e75c75e7
GM
31
32
3f328054
GM
33/*
34 * Name Resolution is specified in AH.
35 */
36
bada4bfa
GM
37#define NAME_RESOLUTION 0x81
38
39#if defined(unix)
40/*
41 * In unix, we offer a service to allow the application to keep from
42 * having to poll us constantly.
43 */
44#define PS_OR_OIA_MODIFIED 0x99
45
46#endif /* defined(unix) */
3f328054
GM
47
48/*
49 * Codes specified in AL for various services.
50 */
51
86057566 52#define QUERY_SESSION_ID 0x01
ffff8f6a 53#define QUERY_SESSION_PARAMETERS 0x02
86057566 54#define QUERY_SESSION_CURSOR 0x0b
3f328054 55
86057566 56#define CONNECT_TO_KEYBOARD 0x01
3f328054 57#define DISCONNECT_FROM_KEYBOARD 0x02
86057566
GM
58#define WRITE_KEYSTROKE 0x04
59#define DISABLE_INPUT 0x05
60#define ENABLE_INPUT 0x06
61
62#define COPY_STRING 0x01
63
64#define READ_OIA_GROUP 0x02
65\f
66/*
67 * For each service, we define the assoicated parameter blocks.
68 */
69
70/*
71 * Supervisor Services
72 */
73
74typedef struct {
75 char gate_name[8];
76} NameResolveParms;
77
78
79/*
80 * Session Information Services
81 */
82
83typedef struct {
84 char
85 short_name,
86 type,
87 session_id,
88 reserved,
89 long_name[8];
90} NameArrayElement;
91
92typedef struct {
1092af8a 93 unsigned char
86057566
GM
94 length,
95 number_matching_session;
96 NameArrayElement
97 name_array_element; /* Variable number */
98} NameArray;
99
100typedef struct {
101 char
102 rc,
103 function_id,
104 option_code,
105 data_code;
106 NameArray far
107 *name_array;
108 char
109 long_name[8];
110} QuerySessionIdParms;
111
ffff8f6a
GM
112#define ID_OPTION_BY_NAME 0x01 /* By short (or long) name */
113#define ID_OPTION_ALL 0x00 /* All (of specified type */
114
86057566
GM
115typedef struct {
116 char
117 rc,
118 function_id,
119 session_id,
120 reserved,
121 session_type,
122 session_characteristics,
123 rows,
124 columns;
125 char far
126 *presentation_space;
65c9fa1f 127} QuerySessionParametersParms;
86057566
GM
128
129#define TYPE_WSCTL 0x01 /* Work Station Control */
130#define TYPE_DFT 0x02 /* DFT Host Session */
131#define TYPE_CUT 0x03 /* CUT Host Session */
132#define TYPE_NOTEPAD 0x04 /* Notepad Session */
133#define TYPE_PC 0x05 /* Personal Computer Session */
134
135#define CHARACTERISTIC_EAB 0x80 /* Extended Attribute Buffer */
136#define CHARACTERISTIC_PSS 0x40 /* Program Symbols Supported */
137
138typedef struct {
139 char
140 rc,
141 function_id,
142 session_id,
143 cursor_type,
144 row_address, /* from 0 */
145 column_address; /* from 0 */
146} QuerySessionCursorParms;
147
148#define CURSOR_INHIBITED_AUTOSCROLL 0x10
149#define CURSOR_INHIBITED 0x04
150#define CURSOR_BLINKING 0x02
151#define CURSOR_BOX 0x01
152typedef struct {
153 char
154 rc,
155 function_id,
156 session_id,
157 reserved;
158 int
159 event_queue_id,
160 input_queue_id;
161 char
162 intercept_options,
163 first_connection_identifier;
164} ConnectToKeyboardParms;
165
166typedef struct {
167 char
168 rc,
169 function_id,
170 session_id,
171 reserved;
172 int
65c9fa1f 173 connectors_task_id;
86057566
GM
174} DisconnectFromKeyboardParms;
175
176typedef struct {
177 char
178 scancode,
179 shift_state;
180} KeystrokeEntry;
181
182typedef struct {
183 int
184 length; /* Length (in bytes) of list */
185 KeystrokeEntry keystrokes; /* Variable size */
186} KeystrokeList;
187
188typedef struct {
189 char
190 rc,
191 function_id,
192 session_id,
193 reserved;
194 int
195 connectors_task_id;
196 char
197 options,
198 number_of_keys_sent;
199 union {
200 KeystrokeEntry
201 keystroke_entry;
202 KeystrokeList far
203 *keystroke_list;
204 } keystroke_specifier;
205} WriteKeystrokeParms;
206
cbdd0b03
GM
207#define OPTION_SINGLE_KEYSTROKE 0x20
208#define OPTION_MULTIPLE_KEYSTROKES 0x30
209
86057566
GM
210typedef struct {
211 char
212 rc,
213 function_id,
214 session_id,
215 reserved;
216 int
217 connectors_task_id;
218} DisableInputParms;
219
220typedef DisableInputParms EnableInputParms;
221
222typedef struct {
223 char
224 session_id,
225 reserved;
226 char far
227 *buffer;
228 char
229 characteristics,
230 session_type;
231 int
232 begin; /* Offset within buffer */
233} BufferDescriptor;
234
235typedef struct {
236 char
237 rc,
238 function_id;
239 BufferDescriptor
240 source;
241 int
242 source_end; /* Offset within source buffer */
243 BufferDescriptor
244 target;
245 char
246 copy_mode,
247 reserved;
248} CopyStringParms;
249
250#define COPY_MODE_7_COLOR 0x80 /* Else 4 color mode */
251#define COPY_MODE_FIELD_ATTRIBUTES 0x40 /* Else don't copy attributes */
252
253typedef struct {
254 char
255 rc,
256 function_id,
257 session_id,
258 reserved;
259 char far
260 *oia_buffer;
261 char
262 oia_group_number;
263} ReadOiaGroupParms;
264
92f7501a 265/* If the user wants all groups, we return API_OIA_BYTES_ALL_GROUPS bytes */
ffff8f6a 266#define API_OIA_ALL_GROUPS '\377'
92f7501a
GM
267#define API_OIA_BYTES_ALL_GROUPS 22 /* 22 bytes of data */
268
269/* API_OIA_INPUT_INHIBITED is special. It returns more than on byte of data */
270#define API_OIA_INPUT_INHIBITED 8
271
272#define API_OIA_LAST_LEGAL_GROUP 18 /* Highest legal number */
86057566 273
3f328054 274
3f328054 275
d4967272
GM
276#if defined(MSDOS)
277
278#if !defined(FP_SEG)
279#include <dos.h>
280#endif /* !defined(FP_SEG) */
281
282#else /* defined(MSDOS) */
283
284/*
285 * These definitions are here to provide the descriptions of
286 * some registers which are, normally, defined in <dos.h> on
287 * a dos system.
288 */
289
92f7501a
GM
290#define FP_SEG(x) (x)
291#define FP_OFF(y) (y)
d4967272 292
0e7d52c0
GM
293/*
294 * Now, it is somewhat of a pain, but we need to keep
295 * 8086 conventions about which of the "highlow"'s map
296 * into which of the "words".
297 */
298
d4967272 299struct highlow {
0e7d52c0 300 unsigned char
4a78fe47 301#if defined(vax)
d4967272 302 al,
0e7d52c0 303 ah,
d4967272 304 bl,
0e7d52c0 305 bh,
d4967272 306 cl,
0e7d52c0
GM
307 ch,
308 dl,
309 dh;
4a78fe47 310#endif /* defined(vax) */
850b267c 311#if defined(sun) || defined(tahoe) || defined(ibm032) || defined(pyr)
4a78fe47
GM
312 ah,
313 al,
314 bh,
315 bl,
316 ch,
317 cl,
318 dh,
319 dl;
1092af8a 320#endif /* defined(sun) || defined(tahoe) || defined(ibm032) */
d4967272
GM
321};
322
323struct words {
0e7d52c0 324 unsigned short
d4967272
GM
325 ax,
326 bx,
327 cx,
0e7d52c0
GM
328 dx;
329 unsigned int
d4967272
GM
330 si,
331 di;
332};
333
334union REGS {
335 struct highlow h;
336 struct words x;
337};
338
339struct SREGS {
0e7d52c0 340 unsigned int
d4967272
GM
341 cs,
342 ds,
343 es,
344 ss;
345};
346#endif /* defined(MSDOS) (else section) */