Sync usage with man page.
[netbsd-mini2440.git] / usr.bin / tn3270 / ctlr / hostctlr.h
blobe3e0991751d126454c7e727a5a0982ac2d47e919
1 /* $NetBSD: hostctlr.h,v 1.4 1998/03/04 13:16:07 christos Exp $ */
3 /*-
4 * Copyright (c) 1988 The Regents of the University of California.
5 * All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
31 * from: @(#)hostctlr.h 4.2 (Berkeley) 4/26/91
34 #define INCLUDED_HOST3270
36 /* define orders given to 3270's */
38 #define ORDER_SF 0x1d /* Start Field */
39 #define ORDER_SFE 0x29 /* Start Field Extended */
40 #define ORDER_SBA 0x11 /* Set Buffer Address (for output) */
41 #define ORDER_SA 0x28 /* Set Attribute */
42 #define ORDER_MF 0x2c /* Modify field */
43 #define ORDER_IC 0x13 /* Insert Cursor (at buffer address) */
44 #define ORDER_PT 0x05 /* Program Tab (absurdly complicated) */
45 #define ORDER_RA 0x3c /* Repeat next character to some addr */
46 #define ORDER_EUA 0x12 /* Null out every unprotected field
47 * to some address.
49 #define ORDER_GE 0x08 /* Graphics Escape */
50 #define ORDER_YALE 0x2b /* This is a special YALE order, which
51 * introduces YALE extended orders
52 * (like setting tabs, etc.).
55 /* The following is defined for initialization and error messages. */
57 struct orders_def {
58 int
59 code; /* As in 3270 data stream */
60 char
61 *short_name, /* Short name */
62 *long_name; /* Long name */
65 #define ORDERS_DEF { \
66 { ORDER_SF, "SF", "Start Field" }, \
67 { ORDER_SFE, "SFE", "Start Field Extended" }, \
68 { ORDER_SBA, "SBA", "Set Buffer Address" }, \
69 { ORDER_SA, "SA", "Set Attribute" }, \
70 { ORDER_MF, "MF", "Modify Field" }, \
71 { ORDER_IC, "IC", "Insert Cursor" }, \
72 { ORDER_PT, "PT", "Program Tab" }, \
73 { ORDER_RA, "RA", "Repeat to Address" }, \
74 { ORDER_EUA, "EUA", "Erase Unprotected to Address" }, \
75 { ORDER_GE, "GE", "Graphics Escape" }, \
76 { ORDER_YALE, "YALE", "Yale Order" } \
80 #define ATTR_RESET 0x00 /* SA only - reset to default */
81 # define ATTR_DEFAULT 0x00 /* reset to default */
82 /* Also for 0x41-43 below */
83 #define ATTR_FIELD 0xC0 /* Field attributes */
84 # define ATTR_MASK 0xc0 /* control bits */
85 # define ATTR_PROT 0x20 /* protected bit */
86 # define ATTR_NUMERIC 0x10 /* numeric field */
87 # define ATTR_AUTO_SKIP_MASK 0x30 /* mask to check auto skip */
88 # define ATTR_AUTO_SKIP_VALUE 0x30 /* value to have auto skip */
89 # define ATTR_DSPD_MASK 0x0c /* highlighting, etc. */
90 # define ATTR_DSPD_DNSPD 0x00 /* display, no select */
91 # define ATTR_DSPD_DSPD 0x04 /* display, select */
92 # define ATTR_DSPD_HIGH 0x08 /* highlighted, select */
93 # define ATTR_DSPD_NONDISPLAY 0x0c /* non-display, no select */
94 # define ATTR_MDT 0x01 /* modified data tag */
96 #define ATTR_EXTENDED_HIGHLIGHT 0x41 /* Extended highlighting */
97 # define ATTR_BLINK 0xf1 /* Blinking */
98 # define ATTR_REVERSE_VIDEO 0xf2 /* Reverse video */
99 # define ATTR_UNDERSCORE 0xf3 /* Underline */
100 #define ATTR_COLOR 0x42 /* Color */
101 # define ATTR_BLUE 0xf1
102 # define ATTR_RED 0xf2
103 # define ATTR_PINK 0xf3
104 # define ATTR_GREEN 0xf4
105 # define ATTR_TURQUOISE 0xf5
106 # define ATTR_YELLOW 0xf6
107 # define ATTR_WHITE 0xf7 /* for 3279; black for 3287; */
108 /* multicolor for triple */
109 /* plane symbol */
110 #define ATTR_PROGRAMMED_SYMBOLS 0x43 /* Programmed Symbols */
111 # define ATTR_SYMBOL_SET_LOW 0x40 /* Lowest loadable set ID */
112 # define ATTR_SYMBOL_SET_HIGH 0xef /* Highest loadable set ID */
113 # define ATTR_SYMBOL_SET_APLTEXT 0xf1
115 /* Non-SNA control unit commands */
117 #define CMD_ERASE_ALL_UNPROTECTED 0x0f
118 #define CMD_ERASE_WRITE 0x05
119 #define CMD_ERASE_WRITE_ALTERNATE 0x0d
120 #define CMD_READ_BUFFER 0x02
121 #define CMD_READ_MODIFIED 0x06
122 #define CMD_WRITE 0x01
123 #define CMD_WRITE_STRUCTURED_FIELD 0x11
125 /* SNA control unit commands */
127 #define CMD_SNA_COPY 0xf7
128 #define CMD_SNA_ERASE_ALL_UNPROTECTED 0x6f
129 #define CMD_SNA_ERASE_WRITE 0xf5
130 #define CMD_SNA_ERASE_WRITE_ALTERNATE 0x7e
131 #define CMD_SNA_READ_BUFFER 0xf2
132 #define CMD_SNA_READ_MODIFIED 0xf6
133 #define CMD_SNA_READ_MODIFIED_ALL 0x6e
134 #define CMD_SNA_WRITE 0xf1
135 #define CMD_SNA_WRITE_STRUCTURED_FIELD 0xf3
138 #define WCC_RESET 0x40
139 #define WCC_ALARM 0x04
140 #define WCC_RESTORE 0x02
141 #define WCC_RESET_MDT 0x01
144 /* Special EBCDIC characters unique to a 3270 */
146 #define EBCDIC_BLANK 0x40 /* Space */
147 #define EBCDIC_CENTSIGN 0x4a /* Cent sign */
148 #define EBCDIC_DUP 0x1c /* DUP character */
149 #define EBCDIC_FM 0x1e /* Field mark character */
150 #define EBCDIC_PERCENT 0x6c /* Percent sign */
151 #define EBCDIC_SLASH 0x61 /* Slash */
152 #define EBCDIC_SOH 0x01 /* Start of Heading */
153 #define EBCDIC_STX 0x02 /* Start of Text */
155 /* Structured field types */
156 #define SF_3270DS 0x40 /* For write operations */
157 #define SF_LPS 0x06 /* Load Programmed Symbols */
158 #define SF_SRM 0x09 /* Set Reply Mode */
159 #define SF_SWO 0x0b /* Set Window Origin */
160 #define SF_READ_PARTITION 0x01 /* Read Partition (Query) */
161 #define SF_ERASE_RESET 0x03 /* Erase (and/or Reset) */
162 #define SF_SCS_DATA 0x41 /* SCS Data */
163 #define SF_CREATE_PARTITION 0x0c /* Create a partition */
165 /* AID characters sent to host.
167 * Note that this file (the following entries) are scanned by mkhit.c,
168 * and that the format must remain more-or-less consistent
169 * (#define\tAID_name\t[\t]*TOKEN)
172 #define AID_NONE 0x60 /* No AID (display) */
173 #define AID_NONE_PRINTER 0xe8 /* No AID (printer) */
175 #define AID_PA1 0x6c
176 #define AID_PA2 0x6e
177 #define AID_PA3 0x6b
178 #define AID_CLEAR 0x6d
179 #define AID_TREQ 0xf0
180 #define AID_ENTER 0x7d
181 #define AID_SELPEN 0x7e /*
182 * Really, only SELPEN with DESIGNATOR
183 * = space or null
185 #define AID_PF1 0xf1
186 #define AID_PF2 0xf2
187 #define AID_PF3 0xf3
188 #define AID_PF4 0xf4
189 #define AID_PF5 0xf5
190 #define AID_PF6 0xf6
191 #define AID_PF7 0xf7
192 #define AID_PF8 0xf8
193 #define AID_PF9 0xf9
194 #define AID_PF10 0x7a
195 #define AID_PF11 0x7b
196 #define AID_PF12 0x7c
197 #define AID_PF13 0xc1
198 #define AID_PF14 0xc2
199 #define AID_PF15 0xc3
200 #define AID_PF16 0xc4
201 #define AID_PF17 0xc5
202 #define AID_PF18 0xc6
203 #define AID_PF19 0xc7
204 #define AID_PF20 0xc8
205 #define AID_PF21 0xc9
206 #define AID_PF22 0x4a
207 #define AID_PF23 0x4b
208 #define AID_PF24 0x4c
209 #define AID_PF25 0xd1
210 #define AID_PF26 0xd2
211 #define AID_PF27 0xd3
212 #define AID_PF28 0xd4
213 #define AID_PF29 0xd5
214 #define AID_PF30 0xd6
215 #define AID_PF31 0xd7
216 #define AID_PF32 0xd8
217 #define AID_PF33 0xd9
218 #define AID_PF34 0x5a
219 #define AID_PF35 0x5b
220 #define AID_PF36 0x5c