Release 4.1
[unix-history] / usr / src / usr.bin / tn3270 / ctlr / api.h
index 0932233..52d168f 100644 (file)
@@ -1,3 +1,22 @@
+/*
+ * Copyright (c) 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *     @(#)api.h       4.1 (Berkeley) %G%
+ */
+
 /*
  * This file contains header information used by the PC API routines.
  */
 /*
  * This file contains header information used by the PC API routines.
  */
  * Name Resolution is specified in AH.
  */
 
  * Name Resolution is specified in AH.
  */
 
-#define        NAME_RESOLUTION 0x81
+#define        NAME_RESOLUTION         0x81
+
+#if    defined(unix)
+/*
+ * In unix, we offer a service to allow the application to keep from
+ * having to poll us constantly.
+ */
+#define        PS_OR_OIA_MODIFIED      0x99
+
+#endif /* defined(unix) */
 
 /*
  * Codes specified in AL for various services.
 
 /*
  * Codes specified in AL for various services.
@@ -79,7 +107,7 @@ typedef struct {
 } NameArrayElement;
 
 typedef struct {
 } NameArrayElement;
 
 typedef struct {
-    char
+    unsigned char
        length,
        number_matching_session;
     NameArrayElement
        length,
        number_matching_session;
     NameArrayElement
@@ -144,7 +172,7 @@ typedef struct {
        function_id,
        session_id,
        reserved;
        function_id,
        session_id,
        reserved;
-    int
+    short
        event_queue_id,
        input_queue_id;
     char
        event_queue_id,
        input_queue_id;
     char
@@ -158,18 +186,18 @@ typedef struct {
        function_id,
        session_id,
        reserved;
        function_id,
        session_id,
        reserved;
-    int
+    short
        connectors_task_id;
 } DisconnectFromKeyboardParms;
 
 typedef struct {
        connectors_task_id;
 } DisconnectFromKeyboardParms;
 
 typedef struct {
-    char
+    unsigned char
        scancode,
        shift_state;
 } KeystrokeEntry;
 
 typedef struct {
        scancode,
        shift_state;
 } KeystrokeEntry;
 
 typedef struct {
-    int
+    short
        length;                 /* Length (in bytes) of list */
     KeystrokeEntry keystrokes; /* Variable size */
 } KeystrokeList;
        length;                 /* Length (in bytes) of list */
     KeystrokeEntry keystrokes; /* Variable size */
 } KeystrokeList;
@@ -180,7 +208,7 @@ typedef struct {
        function_id,
        session_id,
        reserved;
        function_id,
        session_id,
        reserved;
-    int
+    short
        connectors_task_id;
     char
        options,
        connectors_task_id;
     char
        options,
@@ -202,7 +230,7 @@ typedef struct {
        function_id,
        session_id,
        reserved;
        function_id,
        session_id,
        reserved;
-    int
+    short
        connectors_task_id;
 } DisableInputParms;
 
        connectors_task_id;
 } DisableInputParms;
 
@@ -217,7 +245,7 @@ typedef struct {
     char
        characteristics,
        session_type;
     char
        characteristics,
        session_type;
-    int
+    short
        begin;                  /* Offset within buffer */
 } BufferDescriptor;
     
        begin;                  /* Offset within buffer */
 } BufferDescriptor;
     
@@ -227,7 +255,7 @@ typedef struct {
        function_id;
     BufferDescriptor
        source;
        function_id;
     BufferDescriptor
        source;
-    int
+    short
        source_end;             /* Offset within source buffer */
     BufferDescriptor
        target;
        source_end;             /* Offset within source buffer */
     BufferDescriptor
        target;
@@ -276,8 +304,14 @@ typedef struct {
  * a dos system.
  */
 
  * a dos system.
  */
 
-#define        FP_SEG(x)       (x)
-#define        FP_OFF(y)       (y)
+#define        FP_SEG(x)       ((unsigned int)(((unsigned long)(x))>>16))
+#define        FP_OFF(y)       ((unsigned int)(((unsigned long)(y))&0xFFFF))
+
+/*
+ * Undo the preceeding.
+ */
+
+#define        SEG_OFF_BACK(x,y)       (((x)<<16)|(y))
 
 /*
  * Now, it is somewhat of a pain, but we need to keep
 
 /*
  * Now, it is somewhat of a pain, but we need to keep
@@ -287,6 +321,7 @@ typedef struct {
 
 struct highlow {
     unsigned char
 
 struct highlow {
     unsigned char
+#if    defined(vax) || defined(ns32000)
        al,
        ah,
        bl,
        al,
        ah,
        bl,
@@ -295,6 +330,17 @@ struct highlow {
        ch,
        dl,
        dh;
        ch,
        dl,
        dh;
+#endif /* defined(vax) || defined(ns32000) */ 
+#if    defined(sun) || defined(tahoe) || defined(ibm032) || defined(pyr)
+       ah,
+       al,
+       bh,
+       bl,
+       ch,
+       cl,
+       dh,
+       dl;
+#endif /* defined(sun) || defined(tahoe) || defined(ibm032) || defined(pyr) */
 };
 
 struct words {
 };
 
 struct words {
@@ -303,7 +349,7 @@ struct words {
        bx,
        cx,
        dx;
        bx,
        cx,
        dx;
-    unsigned int
+    unsigned short
        si,
        di;
 };
        si,
        di;
 };
@@ -314,7 +360,7 @@ union REGS {
 };
 
 struct SREGS {
 };
 
 struct SREGS {
-    unsigned int
+    unsigned short
        cs,
        ds,
        es,
        cs,
        ds,
        es,