1 /*  BEGIN:   ttt.incl.pl1                                     *  *  *  *  *  */
  2 
  3 /* This include file describes the terminal type table (TTT) and
  4    the various subtables it contains. */
  5 
  6 
  7 /****^  HISTORY COMMENTS:
  8   1) change(77-05-18,RCoren), approve(), audit(), install():
  9      Created
 10      Modified 5/29/81 by Suzanne Krupp to make TTT_version = 2,
 11         to change ttt and tte structures to include function key info
 12   2) change(84-12-17,Negaret), approve(87-07-28,MCR7742),
 13      audit(87-07-23,Gilcrease), install(87-08-04,MR12.1-1056):
 14      Add the dsatm_device table.
 15   3) change(87-03-05,LJAdams), approve(87-03-05,MCR7646),
 16      audit(87-05-05,Gilcrease), install(87-05-08,MR12.1-1029):
 17      Add the protocol field to the terminal type entry table.  Change
 18      TTT_version to TTT_version_3.
 19   4) change(87-06-26,LJAdams), approve(87-07-09,MCR7742),
 20      audit(87-07-23,Gilcrease), install(87-08-04,MR12.1-1056):
 21      Changed constant value for extended_tables_ntables from 2 to 3 in order to
 22      accommodate addition of DSA table.
 23   5) change(88-01-22,Brunelle), approve(88-01-22,MCR7813),
 24      audit(88-10-05,Blair), install(88-10-17,MR12.2-1171):
 25      1. Extend special character definition to 15 chars instead of three.
 26      2. add comment field to tte.
 27                                                    END HISTORY COMMENTS */
 28 
 29 
 30 dcl  TTT_version_4 fixed bin int static options (constant) init (4);
 31 
 32 dcl  tttp ptr;
 33 
 34 dcl 1 ttt aligned based (tttp),
 35       2 author like author_dcl.author,
 36       2 version fixed bin,
 37       2 n_tt_entries fixed bin,
 38       2 n_tables fixed bin,
 39       2 n_special_tables fixed bin,
 40       2 n_fkey_tables fixed bin,
 41       2 fkey_offset fixed bin(18),
 42       2 default_type_offset fixed bin (18),
 43       2 answerback_offset fixed bin (18),
 44       2 total_ttt_size fixed bin (18),
 45       2 type_map fixed bin,                       /* index of type implied by MAP command */
 46       2 type_963 fixed bin,                       /* likewise for 963 command */
 47       2 type_029 fixed bin,                       /* likewise for 029 command */
 48       2 highest_coded_type fixed bin,             /* highest value used so far for coded_type */
 49                                                   /* start entries on 8-word boundary */
 50       2 tt_entries (0 refer (ttt.n_tt_entries)) like tte,
 51       2 tables (0 refer (ttt.n_tables)) like table_entry, /* conversion and translation tables */
 52       2 rest_of_ttt (1) fixed bin;                /* placeholder for special_tables, function_key_tables,
 53                                                   *  delay tables, initial strings,
 54                                                   *  additional_info strings, default_types table,
 55                                                   *  answerback table */
 56 
 57 dcl  ttep ptr;
 58 
 59 dcl 1 tte based (ttep) aligned,                   /* terminal type entry */
 60       2 name char (32) unal,
 61       2 modes char (256),
 62       2 initial_string,
 63         3 offset fixed bin (18),
 64         3 length fixed bin,
 65       2 additional_info,
 66         3 offset fixed bin (18),
 67         3 length fixed bin,
 68       2 comment,
 69         3 offset fixed bin (18),
 70         3 length fixed bin,
 71       2 tables,
 72         3 input_translation_rp fixed bin (18),    /* offset of input translation table */
 73         3 output_translation_rp fixed bin (18),   /*   "     " output      "      "    */
 74         3 input_conversion_rp fixed bin (18),     /*   "     " input conversion   "    */
 75         3 output_conversion_rp fixed bin (18),    /*   "     " output      "      "    */
 76         3 special_rp fixed bin (18),              /*   "     " special_chars table */
 77         3 fkey_rp fixed bin(18),
 78         3 delay_rp fixed bin (18),                /* offset of array of delay tables */
 79       2 line_types bit (72),                      /* terminal type is possible only if corresponding line_type bit is on */
 80       2 editing_chars aligned,
 81         3 erase char (1) unal,
 82         3 kill char (1) unal,
 83         3 framing_chars unal,
 84           4 frame_begin char (1) unal,
 85           4 frame_end char (1) unal,
 86       2 flags aligned,
 87         3 keyboard_addressing bit (1) unal,
 88         3 print_preaccess_message bit (1) unal,
 89         3 conditional_printer_off bit (1) unal,
 90         3 input_timeout bit (1) unal,
 91         3 output_block_acknowledge bit (1) unal,
 92         3 pad bit (31) unal,
 93       2 old_type fixed bin,
 94       2 like_type fixed bin,                      /* index of entry which this one is "like" */
 95       2 like_flags unal,                          /* only meaningful if like_type is non-0 */
 96         3 bauds_overridden bit (1),
 97         3 delay_overridden (6) bit (1),           /* one for each kind of delay statement */
 98         3 pad bit (11) unal,
 99       2 line_delimiter char (1) unal,             /* default line delimiter, untanslated */
100       2 pad1 bit (9) unal,
101       2 coded_type fixed bin,                     /* used for storing type values in PDT & PNT */
102       2 flow_control_chars unal,
103         3 input_suspend char (1),
104         3 input_resume char (1),
105         3 output_suspend_etb char (1),
106         3 output_resume_ack char (1),
107       2 output_buffer_size fixed bin,
108       2 extended_tables_rp fixed bin (18),        /* rel pointer to extended_tables */
109       2 protocol fixed bin;                       /* 0=NONE    1=MOWSE */
110                                                   /* 2=MOWSE_FANSI     */
111 
112 dcl  extended_tablesp ptr;
113 
114 dcl 1 extended_tables aligned based (extended_tablesp),
115       2 ntables fixed bin,
116       2 tables_rp (extended_tables_ntables refer (extended_tables.ntables)) fixed bin (18);
117 
118 dcl (VIDEO_RP init (1),                           /* indexes in tables_rp */
119      FUNCTION_KEY_RP init (2),
120      DSATM_DEVICE_RP init (3)) fixed bin int static options (constant);
121 
122 dcl  extended_tables_ntables fixed bin int static options (constant) init (3);
123 
124 
125 dcl  dfttp ptr;
126 
127 dcl 1 dftt based (dfttp) aligned,                 /* default_types table */
128       2 dft_count fixed bin,
129       2 dftte (0 refer (dftt.dft_count)),
130         3 baud fixed bin,
131         3 line_type fixed bin,
132         3 term_type_index fixed bin;
133 
134 
135 dcl  tablep ptr;
136 
137 dcl 1 table_entry aligned based (tablep),
138       2 name char (32) unal,
139       2 type fixed bin,                           /* 1 = conversion, 2 = translation */
140       2 table like cv_trans_struc;
141 
142 
143 dcl 1 special_table aligned based,
144       2 name char (32) unal,
145       2 type fixed bin,
146       2 table,
147         3 version fixed bin,
148         3 default fixed bin,                                /* non-zero indicates use default */
149         3 special_chars,                                    /* same as level-1 above */
150                                                             /* has to be spelled out instead of using like */
151                                                             /* because of refer options */
152           4 nl_seq aligned like c_chars,                              /* new-line sequence */
153           4 cr_seq aligned like c_chars,                              /* carriage-return sequence */
154           4 bs_seq aligned like c_chars,                              /* backspace sequence */
155           4 tab_seq aligned like c_chars,                             /* horizontal tab sequence */
156           4 vt_seq aligned like c_chars,                              /* vertical tab sequence */
157           4 ff_seq aligned like c_chars,                              /* form-feed sequence */
158           4 printer_on aligned like c_chars,                /* printer-on sequence */
159           4 printer_off aligned like c_chars,               /* printer_off sequence */
160           4 red_ribbon_shift aligned like c_chars,                    /* red ribbon shift sequence */
161           4 black_ribbon_shift aligned like c_chars,                  /* black ribbon shift sequence */
162           4 end_of_page aligned like c_chars,               /* end-of-page warning sequence */
163 
164           4 escape_length fixed bin,                        /* number of escape sequences */
165           4 not_edited_escapes (sc_escape_len refer (special_table.escape_length)) like c_chars, /* use in ^edited mode */
166           4 edited_escapes (sc_escape_len refer (special_table.escape_length)) like c_chars, /* use in edited mode */
167 
168           4 input_escapes aligned,
169             5 len fixed bin (8) unaligned,                            /* length of string */
170             5 str char (sc_input_escape_len refer (special_table.input_escapes.len)) unaligned, /* escape sequence characters */
171           4 input_results aligned,
172             5 pad bit (9) unaligned,                        /* so that strings will look the same */
173             5 str char (sc_input_escape_len refer (special_table.input_escapes.len)) unaligned; /* results of escape sequences */
174 
175 dcl fkey_tablep ptr;
176 
177 dcl 1 fkey_table aligned based (fkey_tablep),
178       2 name char(32) unal,
179       2 fkey_data aligned,
180         3 version fixed bin,
181         3 highest fixed bin,
182         3 sequence,                                         /* string of all seqs*/
183           4 seq_offset fixed bin(18),                       /* offset in ttt of sequence */
184           4 pad bit(36),                                    /* pad makes overlay of function_key_data struct possible */
185           4 seq_len fixed bin(21),
186         3 cursor_motion_keys,
187           4 home (0:3) like template,
188           4 left (0:3) like template,
189           4 up (0:3) like template,
190           4 right (0:3) like template,
191           4 down (0:3) like template,
192         3 function_keys (0:function_key_data_highest refer(fkey_table.highest), 0:3) like template;
193 
194 dcl template_ptr ptr;
195 
196 dcl 1 template unaligned based(template_ptr),
197       2 sequence_index fixed bin(12) unsigned unaligned,
198       2 sequence_length fixed bin(6) unsigned unaligned;
199 
200 dcl  delay_tablep ptr;
201 
202 dcl 1 delay_table based (delay_tablep) aligned,
203       2 n_bauds fixed bin,
204       2 delay_array (0 refer (delay_table.n_bauds)),
205         3 baud_rate fixed bin,
206         3 version fixed bin,
207         3 mbz fixed bin,
208         3 delays (6) fixed bin;
209 
210 
211 dcl  answerback_entry_ptr ptr;
212 dcl  answerback_length fixed bin;                 /* automatic copy of length of char string */
213 
214 dcl 1 answerback_entry based (answerback_entry_ptr) aligned,
215       2 next fixed bin (18),                      /* offset of next answerback table entry */
216       2 term_type_index fixed bin,
217       2 def_string,
218         3 length fixed bin,
219         3 chars (answerback_length refer (answerback_entry.length)) char (1) unal;
220 
221 dcl  CONV_TYPE fixed bin int static options (constant) init (1);
222 dcl  TRANS_TYPE fixed bin int static options (constant) init (2);
223 dcl  SPEC_TYPE fixed bin int static options (constant) init (3);
224 dcl  FKEY_TYPE fixed bin int static options (constant) init (4);
225 
226 dcl  table_types (4) char (12) int static options (constant) init
227                     ("conversion", "translation", "special", "function_key");
228 
229 dcl  pa_name (3) char (3) int static options (constant) init
230                     ("MAP", "963", "029");
231 
232 %include tty_convert;
233 
234 /*  END OF:  ttt.incl.pl1                                     *  *  *  *  *  */