home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / tn3270 / ctlr / hostctlr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-26  |  7.7 KB  |  223 lines

  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.  *    @(#)hostctlr.h    4.2 (Berkeley) 4/26/91
  34.  */
  35.  
  36. #define    INCLUDED_HOST3270
  37.  
  38. /* define orders given to 3270's */
  39.  
  40. #define    ORDER_SF    0x1d        /* Start Field */
  41. #define    ORDER_SFE    0x29        /* Start Field Extended */
  42. #define    ORDER_SBA    0x11        /* Set Buffer Address (for output) */
  43. #define    ORDER_SA    0x28        /* Set Attribute */
  44. #define    ORDER_MF    0x2c        /* Modify field */
  45. #define    ORDER_IC    0x13        /* Insert Cursor (at buffer address) */
  46. #define    ORDER_PT    0x05        /* Program Tab (absurdly complicated) */
  47. #define    ORDER_RA    0x3c        /* Repeat next character to some addr */
  48. #define    ORDER_EUA    0x12        /* Null out every unprotected field
  49.                      * to some address.
  50.                      */
  51. #define    ORDER_GE    0x08        /* Graphics Escape */
  52. #define    ORDER_YALE    0x2b        /* This is a special YALE order, which
  53.                      * introduces YALE extended orders
  54.                      * (like setting tabs, etc.).
  55.                      */
  56.  
  57. /* The following is defined for initialization and error messages. */
  58.  
  59. struct orders_def {
  60.     int
  61.     code;            /* As in 3270 data stream */
  62.     char
  63.     *short_name,        /* Short name */
  64.     *long_name;        /* Long name */
  65. };
  66.  
  67. #define    ORDERS_DEF { \
  68.                 ORDER_SF, "SF", "Start Field", \
  69.                 ORDER_SFE, "SFE", "Start Field Extended", \
  70.                 ORDER_SBA, "SBA", "Set Buffer Address", \
  71.                 ORDER_SA, "SA", "Set Attribute", \
  72.                 ORDER_MF, "MF", "Modify Field", \
  73.                 ORDER_IC, "IC", "Insert Cursor", \
  74.                 ORDER_PT, "PT", "Program Tab", \
  75.                 ORDER_RA, "RA", "Repeat to Address", \
  76.                 ORDER_EUA, "EUA", "Erase Unprotected to Address", \
  77.                 ORDER_GE, "GE", "Graphics Escape", \
  78.                 ORDER_YALE, "YALE", "Yale Order" \
  79.             }
  80.  
  81.  
  82. #define    ATTR_RESET        0x00        /* SA only - reset to default */
  83. #    define    ATTR_DEFAULT    0x00        /* reset to default */
  84.                         /* Also for 0x41-43 below */
  85. #define    ATTR_FIELD        0xC0        /* Field attributes */
  86. #    define    ATTR_MASK        0xc0    /* control bits */
  87. #    define    ATTR_PROT        0x20    /* protected bit */
  88. #    define    ATTR_NUMERIC        0x10    /* numeric field */
  89. #    define    ATTR_AUTO_SKIP_MASK    0x30    /* mask to check auto skip */
  90. #    define    ATTR_AUTO_SKIP_VALUE    0x30    /* value to have auto skip */
  91. #    define    ATTR_DSPD_MASK        0x0c    /* highlighting, etc. */
  92. #    define    ATTR_DSPD_DNSPD        0x00    /* display, no select */
  93. #    define    ATTR_DSPD_DSPD        0x04    /* display, select */
  94. #    define    ATTR_DSPD_HIGH        0x08    /* highlighted, select */
  95. #    define    ATTR_DSPD_NONDISPLAY    0x0c    /* non-display, no select */
  96. #    define    ATTR_MDT        0x01        /* modified data tag */
  97.  
  98. #define    ATTR_EXTENDED_HIGHLIGHT    0x41        /* Extended highlighting */
  99. #    define    ATTR_BLINK        0xf1    /* Blinking */
  100. #    define    ATTR_REVERSE_VIDEO    0xf2    /* Reverse video */
  101. #    define    ATTR_UNDERSCORE        0xf3    /* Underline */
  102. #define    ATTR_COLOR        0x42        /* Color */
  103. #    define    ATTR_BLUE        0xf1
  104. #    define    ATTR_RED        0xf2
  105. #    define    ATTR_PINK        0xf3
  106. #    define    ATTR_GREEN        0xf4
  107. #    define    ATTR_TURQUOISE        0xf5
  108. #    define    ATTR_YELLOW        0xf6
  109. #    define    ATTR_WHITE        0xf7    /* for 3279; black for 3287; */
  110.                         /* multicolor for triple */
  111.                         /* plane symbol */
  112. #define    ATTR_PROGRAMMED_SYMBOLS    0x43        /* Programmed Symbols */
  113. #    define    ATTR_SYMBOL_SET_LOW    0x40    /* Lowest loadable set ID */
  114. #    define    ATTR_SYMBOL_SET_HIGH    0xef    /* Highest loadable set ID */
  115. #    define    ATTR_SYMBOL_SET_APLTEXT    0xf1
  116.  
  117. /* Non-SNA control unit commands */
  118.  
  119. #define    CMD_ERASE_ALL_UNPROTECTED    0x0f
  120. #define    CMD_ERASE_WRITE            0x05
  121. #define    CMD_ERASE_WRITE_ALTERNATE    0x0d
  122. #define    CMD_READ_BUFFER            0x02
  123. #define    CMD_READ_MODIFIED        0x06
  124. #define    CMD_WRITE            0x01
  125. #define    CMD_WRITE_STRUCTURED_FIELD    0x11
  126.  
  127. /* SNA control unit commands */
  128.  
  129. #define    CMD_SNA_COPY            0xf7
  130. #define    CMD_SNA_ERASE_ALL_UNPROTECTED    0x6f
  131. #define    CMD_SNA_ERASE_WRITE        0xf5
  132. #define    CMD_SNA_ERASE_WRITE_ALTERNATE    0x7e
  133. #define    CMD_SNA_READ_BUFFER        0xf2
  134. #define    CMD_SNA_READ_MODIFIED        0xf6
  135. #define    CMD_SNA_READ_MODIFIED_ALL    0x6e
  136. #define    CMD_SNA_WRITE            0xf1
  137. #define    CMD_SNA_WRITE_STRUCTURED_FIELD    0xf3
  138.  
  139.  
  140. #define    WCC_RESET    0x40
  141. #define    WCC_ALARM    0x04
  142. #define    WCC_RESTORE    0x02
  143. #define    WCC_RESET_MDT    0x01
  144.  
  145.  
  146. /* Special EBCDIC characters unique to a 3270 */
  147.  
  148. #define    EBCDIC_BLANK    0x40            /* Space */
  149. #define    EBCDIC_CENTSIGN    0x4a            /* Cent sign */
  150. #define    EBCDIC_DUP    0x1c            /* DUP character */
  151. #define    EBCDIC_FM    0x1e            /* Field mark character */
  152. #define    EBCDIC_PERCENT    0x6c            /* Percent sign */
  153. #define    EBCDIC_SLASH    0x61            /* Slash */
  154. #define    EBCDIC_SOH    0x01            /* Start of Heading */
  155. #define    EBCDIC_STX    0x02            /* Start of Text */
  156.  
  157. /* Structured field types */
  158. #define    SF_3270DS    0x40            /* For write operations */
  159. #define    SF_LPS        0x06            /* Load Programmed Symbols */
  160. #define    SF_SRM        0x09            /* Set Reply Mode */
  161. #define    SF_SWO        0x0b            /* Set Window Origin */
  162. #define    SF_READ_PARTITION    0x01        /* Read Partition (Query) */
  163. #define    SF_ERASE_RESET        0x03        /* Erase (and/or Reset) */
  164. #define    SF_SCS_DATA        0x41        /* SCS Data */
  165. #define    SF_CREATE_PARTITION    0x0c        /* Create a partition */
  166.  
  167. /* AID characters sent to host.
  168.  *
  169.  * Note that this file (the following entries) are scanned by mkhit.c,
  170.  * and that the format must remain more-or-less consistent
  171.  * (#define\tAID_name\t[\t]*TOKEN)
  172.  */
  173.  
  174. #define    AID_NONE        0x60        /* No AID (display) */
  175. #define    AID_NONE_PRINTER    0xe8        /* No AID (printer) */
  176.  
  177. #define    AID_PA1            0x6c
  178. #define    AID_PA2            0x6e
  179. #define    AID_PA3            0x6b
  180. #define    AID_CLEAR        0x6d
  181. #define    AID_TREQ        0xf0
  182. #define    AID_ENTER        0x7d
  183. #define    AID_SELPEN        0x7e    /*
  184.                      * Really, only SELPEN with DESIGNATOR
  185.                      * = space or null
  186.                      */
  187. #define    AID_PF1            0xf1
  188. #define    AID_PF2            0xf2
  189. #define    AID_PF3            0xf3
  190. #define    AID_PF4            0xf4
  191. #define    AID_PF5            0xf5
  192. #define    AID_PF6            0xf6
  193. #define    AID_PF7            0xf7
  194. #define    AID_PF8            0xf8
  195. #define    AID_PF9            0xf9
  196. #define    AID_PF10        0x7a
  197. #define    AID_PF11        0x7b
  198. #define    AID_PF12        0x7c
  199. #define    AID_PF13        0xc1
  200. #define    AID_PF14        0xc2
  201. #define    AID_PF15        0xc3
  202. #define    AID_PF16        0xc4
  203. #define    AID_PF17        0xc5
  204. #define    AID_PF18        0xc6
  205. #define    AID_PF19        0xc7
  206. #define    AID_PF20        0xc8
  207. #define    AID_PF21        0xc9
  208. #define    AID_PF22        0x4a
  209. #define    AID_PF23        0x4b
  210. #define    AID_PF24        0x4c
  211. #define    AID_PF25        0xd1
  212. #define    AID_PF26        0xd2
  213. #define    AID_PF27        0xd3
  214. #define    AID_PF28        0xd4
  215. #define    AID_PF29        0xd5
  216. #define    AID_PF30        0xd6
  217. #define    AID_PF31        0xd7
  218. #define    AID_PF32        0xd8
  219. #define    AID_PF33        0xd9
  220. #define    AID_PF34        0x5a
  221. #define    AID_PF35        0x5b
  222. #define    AID_PF36        0x5c
  223.