FreeNOS
teken_state.h
Go to the documentation of this file.
1 /* Generated file. Do not edit. */
2 
11 
12 /* '^[[>' */
13 static void
15 {
16 
17  if (teken_state_numbers(t, c))
18  return;
19 
20  switch (c) {
21  case 'c': /* DA2: Secondary Device Attributes */
23  break;
24  default:
25  teken_printf("Unsupported sequence in teken_state_3: %u\n", (unsigned int)c);
26  break;
27  }
28 
30 }
31 
32 /* '' */
33 static void
35 {
36 
37  switch (c) {
38  case '\x1B':
40  return;
41  default:
43  break;
44  }
45 }
46 
47 /* '^[[?' */
48 static void
50 {
51 
52  if (teken_state_numbers(t, c))
53  return;
54 
55  switch (c) {
56  case 'h': /* DECSM: Set DEC mode */
57  teken_subr_set_dec_mode(t, t->t_curnum < 1 ? 0 : t->t_nums[0]);
58  break;
59  case 'l': /* DECRM: Reset DEC mode */
60  teken_subr_reset_dec_mode(t, t->t_curnum < 1 ? 0 : t->t_nums[0]);
61  break;
62  case 'n': /* DSR: Device Status Report */
63  teken_subr_device_status_report(t, t->t_curnum < 1 ? 0 : t->t_nums[0]);
64  break;
65  default:
66  teken_printf("Unsupported sequence in teken_state_5: %u\n", (unsigned int)c);
67  break;
68  }
69 
71 }
72 
73 /* '^[[' */
74 static void
76 {
77 
78  if (teken_state_numbers(t, c))
79  return;
80 
81  switch (c) {
82  case '@': /* ICH: Insert character */
83  teken_subr_insert_character(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
84  break;
85  case 'A': /* CUU: Cursor Up */
86  teken_subr_cursor_up(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
87  break;
88  case 'B': /* CUD: Cursor Down */
89  teken_subr_cursor_down(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
90  break;
91  case 'C': /* CUF: Cursor Forward */
92  teken_subr_cursor_forward(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
93  break;
94  case 'D': /* CUB: Cursor Backward */
95  teken_subr_cursor_backward(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
96  break;
97  case 'E': /* CNL: Cursor Next Line */
98  teken_subr_cursor_next_line(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
99  break;
100  case 'F': /* CPL: Cursor Previous Line */
101  teken_subr_cursor_previous_line(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
102  break;
103  case 'G': /* HPA: Horizontal Position Absolute */
104  teken_subr_horizontal_position_absolute(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
105  break;
106  case 'H': /* CUP: Cursor Position */
107  teken_subr_cursor_position(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0], (t->t_curnum < 2 || t->t_nums[1] == 0) ? 1 : t->t_nums[1]);
108  break;
109  case 'I': /* CHT: Cursor Forward Tabulation */
110  teken_subr_cursor_forward_tabulation(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
111  break;
112  case 'J': /* ED: Erase display */
113  teken_subr_erase_display(t, t->t_curnum < 1 ? 0 : t->t_nums[0]);
114  break;
115  case 'K': /* EL: Erase line */
116  teken_subr_erase_line(t, t->t_curnum < 1 ? 0 : t->t_nums[0]);
117  break;
118  case 'L': /* IL: Insert line */
119  teken_subr_insert_line(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
120  break;
121  case 'M': /* DL: Delete line */
122  teken_subr_delete_line(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
123  break;
124  case 'P': /* DC: Delete character */
125  teken_subr_delete_character(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
126  break;
127  case 'S': /* SU: Pan Down */
128  teken_subr_pan_down(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
129  break;
130  case 'T': /* SD: Pan Up */
131  teken_subr_pan_up(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
132  break;
133  case 'X': /* ECH: Erase character */
134  teken_subr_erase_character(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
135  break;
136  case 'Z': /* CBT: Cursor Backward Tabulation */
137  teken_subr_cursor_backward_tabulation(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
138  break;
139  case '`': /* HPA: Horizontal Position Absolute */
140  teken_subr_horizontal_position_absolute(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
141  break;
142  case 'a': /* CUF: Cursor Forward */
143  teken_subr_cursor_forward(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
144  break;
145  case 'c': /* DA1: Primary Device Attributes */
147  break;
148  case 'd': /* VPA: Vertical Position Absolute */
149  teken_subr_vertical_position_absolute(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
150  break;
151  case 'e': /* CUD: Cursor Down */
152  teken_subr_cursor_down(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0]);
153  break;
154  case 'f': /* CUP: Cursor Position */
155  teken_subr_cursor_position(t, (t->t_curnum < 1 || t->t_nums[0] == 0) ? 1 : t->t_nums[0], (t->t_curnum < 2 || t->t_nums[1] == 0) ? 1 : t->t_nums[1]);
156  break;
157  case 'g': /* TBC: Tab Clear */
158  teken_subr_tab_clear(t, t->t_curnum < 1 ? 0 : t->t_nums[0]);
159  break;
160  case 'h': /* SM: Set Mode */
161  teken_subr_set_mode(t, t->t_curnum < 1 ? 0 : t->t_nums[0]);
162  break;
163  case 'l': /* RM: Reset Mode */
164  teken_subr_reset_mode(t, t->t_curnum < 1 ? 0 : t->t_nums[0]);
165  break;
166  case 'm': /* SGR: Set Graphic Rendition */
168  break;
169  case 'n': /* CPR: Cursor Position Report */
170  teken_subr_cursor_position_report(t, t->t_curnum < 1 ? 0 : t->t_nums[0]);
171  break;
172  case 'r': /* DECSTBM: Set top and bottom margins */
173  teken_subr_set_top_and_bottom_margins(t, t->t_curnum < 1 ? 0 : t->t_nums[0], t->t_curnum < 2 ? 0 : t->t_nums[1]);
174  break;
175  case 's': /* DECSC: Save cursor */
177  break;
178  case 'u': /* DECRC: Restore cursor */
180  break;
181  case 'z': /* C25VTSW: Cons25 switch virtual terminal */
183  break;
184  case '>':
186  return;
187  case '?':
189  return;
190  case '=':
192  return;
193  default:
194  teken_printf("Unsupported sequence in teken_state_2: %u\n", (unsigned int)c);
195  break;
196  }
197 
199 }
200 
201 /* '^[' */
202 static void
204 {
205 
206  switch (c) {
207  case '7': /* DECSC: Save cursor */
209  break;
210  case '8': /* DECRC: Restore cursor */
212  break;
213  case '=': /* DECKPAM: Keypad application mode */
215  break;
216  case '>': /* DECKPNM: Keypad numeric mode */
218  break;
219  case 'D': /* IND: Index */
220  teken_subr_index(t);
221  break;
222  case 'E': /* NEL: Next line */
224  break;
225  case 'H': /* HTS: Horizontal Tab Set */
227  break;
228  case 'M': /* RI: Reverse index */
230  break;
231  case 'P': /* DCS: Device Control String */
233  break;
234  case 'c': /* RIS: Reset to Initial State */
236  break;
237  case '\\': /* ST: String Terminator */
239  break;
240  case '[':
242  return;
243  case '(':
245  return;
246  case ')':
248  return;
249  case '#':
251  return;
252  default:
253  teken_printf("Unsupported sequence in teken_state_1: %u\n", (unsigned int)c);
254  break;
255  }
256 
258 }
259 
260 /* '^[(' */
261 static void
263 {
264 
265  switch (c) {
266  case '1': /* G0SCS1: G0 SCS US ASCII */
268  break;
269  case '2': /* G0SCS2: G0 SCS Special Graphics */
271  break;
272  case 'A': /* G0SCSA: G0 SCS UK National */
274  break;
275  case 'B': /* G0SCSB: G0 SCS US ASCII */
277  break;
278  case '0': /* G0SCS0: G0 SCS Special Graphics */
280  break;
281  default:
282  teken_printf("Unsupported sequence in teken_state_6: %u\n", (unsigned int)c);
283  break;
284  }
285 
287 }
288 
289 /* '^[)' */
290 static void
292 {
293 
294  switch (c) {
295  case '0': /* G1SCS0: G1 SCS Special Graphics */
297  break;
298  case '1': /* G1SCS1: G1 SCS US ASCII */
300  break;
301  case '2': /* G1SCS2: G1 SCS Special Graphics */
303  break;
304  case 'A': /* G1SCSA: G1 SCS UK National */
306  break;
307  case 'B': /* G1SCSB: G1 SCS US ASCII */
309  break;
310  default:
311  teken_printf("Unsupported sequence in teken_state_7: %u\n", (unsigned int)c);
312  break;
313  }
314 
316 }
317 
318 /* '^[[=' */
319 static void
321 {
322 
323  if (teken_state_numbers(t, c))
324  return;
325 
326  switch (c) {
327  case 'F': /* C25ADFG: Cons25 set adapter foreground */
329  break;
330  case 'G': /* C25ADBG: Cons25 set adapter background */
332  break;
333  case 'S': /* C25CURS: Cons25 set cursor type */
334  teken_subr_cons25_set_cursor_type(t, t->t_curnum < 1 ? 0 : t->t_nums[0]);
335  break;
336  default:
337  teken_printf("Unsupported sequence in teken_state_8: %u\n", (unsigned int)c);
338  break;
339  }
340 
342 }
343 
344 /* '^[#' */
345 static void
347 {
348 
349  switch (c) {
350  case '3': /* DECDHL: Double Height Double Width Line Top */
352  break;
353  case '4': /* DECDHL: Double Height Double Width Line Bottom */
355  break;
356  case '5': /* DECSWL: Single Height Single Width Line */
358  break;
359  case '6': /* DECDWL: Single Height Double Width Line */
361  break;
362  case '8': /* DECALN: Alignment test */
364  break;
365  default:
366  teken_printf("Unsupported sequence in teken_state_4: %u\n", (unsigned int)c);
367  break;
368  }
369 
371 }
teken_subr_device_status_report
static void teken_subr_device_status_report(teken_t *t, unsigned int cmd)
Definition: teken_subr.h:430
teken_state_init
static void teken_state_init(teken_t *t, teken_char_t c)
Definition: teken_state.h:34
teken_subr_reset_to_initial_state
static void teken_subr_reset_to_initial_state(teken_t *)
Definition: teken_subr.h:941
teken_state_t
void teken_state_t(teken_t *, teken_char_t)
Definition: teken.h:88
teken_state_1
static teken_state_t teken_state_1
Definition: teken_state.h:6
teken_subr_g0_scs_special_graphics
static void teken_subr_g0_scs_special_graphics(teken_t *t __unused)
Definition: teken_subr.h:535
teken_subr_insert_character
static void teken_subr_insert_character(teken_t *t, unsigned int ncols)
Definition: teken_subr.h:629
teken_state_6
static teken_state_t teken_state_6
Definition: teken_state.h:7
teken_state_8
static teken_state_t teken_state_8
Definition: teken_state.h:9
teken_subr_g1_scs_uk_national
static void teken_subr_g1_scs_uk_national(teken_t *t __unused)
Definition: teken_subr.h:563
teken_subr_vertical_position_absolute
static void teken_subr_vertical_position_absolute(teken_t *t, unsigned int row)
Definition: teken_subr.h:1199
teken_subr_double_height_double_width_line_bottom
static void teken_subr_double_height_double_width_line_bottom(teken_t *t __unused)
Definition: teken_subr.h:450
teken_subr_regular_character
static void teken_subr_regular_character(teken_t *, teken_char_t)
Definition: teken_subr.h:786
teken_subr_insert_line
static void teken_subr_insert_line(teken_t *t, unsigned int nrows)
Definition: teken_subr.h:655
teken_subr_string_terminator
static void teken_subr_string_terminator(teken_t *t __unused)
Definition: teken_subr.h:1178
teken_subr_g1_scs_us_ascii
static void teken_subr_g1_scs_us_ascii(teken_t *t __unused)
Definition: teken_subr.h:570
teken_subr_g0_scs_us_ascii
static void teken_subr_g0_scs_us_ascii(teken_t *t __unused)
Definition: teken_subr.h:549
teken_subr_cursor_down
static void teken_subr_cursor_down(teken_t *t, unsigned int nrows)
Definition: teken_subr.h:273
teken_subr_cursor_position
static void teken_subr_cursor_position(teken_t *t, unsigned int row, unsigned int col)
Definition: teken_subr.h:324
teken_state_7
static teken_state_t teken_state_7
Definition: teken_state.h:8
teken_subr_keypad_numeric_mode
static void teken_subr_keypad_numeric_mode(teken_t *t)
Definition: teken_subr.h:689
teken_printf
#define teken_printf(x,...)
Definition: teken.c:46
__teken::t_curnum
unsigned int t_curnum
Definition: teken.h:140
teken_subr_erase_display
static void teken_subr_erase_display(teken_t *t, unsigned int mode)
Definition: teken_subr.h:473
teken_subr_cons25_set_cursor_type
static void teken_subr_cons25_set_cursor_type(teken_t *t, unsigned int type)
Definition: teken_subr_compat.h:30
teken_state_3
static teken_state_t teken_state_3
Definition: teken_state.h:3
teken_subr_cursor_backward
static void teken_subr_cursor_backward(teken_t *t, unsigned int ncols)
Definition: teken_subr.h:242
teken_subr_cons25_set_adapter_foreground
static void teken_subr_cons25_set_adapter_foreground(teken_t *t, unsigned int c)
Definition: teken_subr_compat.h:48
teken_subr_cursor_next_line
static void teken_subr_cursor_next_line(teken_t *t, unsigned int ncols)
Definition: teken_subr.h:316
teken_subr_cursor_position_report
static void teken_subr_cursor_position_report(teken_t *t, unsigned int cmd)
Definition: teken_subr.h:340
teken_subr_set_mode
static void teken_subr_set_mode(teken_t *t, unsigned int cmd)
Definition: teken_subr.h:1045
teken_subr_reset_dec_mode
static void teken_subr_reset_dec_mode(teken_t *t, unsigned int cmd)
Definition: teken_subr.h:863
teken_subr_single_height_single_width_line
static void teken_subr_single_height_single_width_line(teken_t *t __unused)
Definition: teken_subr.h:1171
teken_subr_cons25_switch_virtual_terminal
static void teken_subr_cons25_switch_virtual_terminal(teken_t *t, unsigned int vt)
Definition: teken_subr_compat.h:63
teken_subr_keypad_application_mode
static void teken_subr_keypad_application_mode(teken_t *t)
Definition: teken_subr.h:682
teken_subr_cursor_previous_line
static void teken_subr_cursor_previous_line(teken_t *t, unsigned int ncols)
Definition: teken_subr.h:353
teken_subr_horizontal_tab_set
static void teken_subr_horizontal_tab_set(teken_t *t)
Definition: teken_subr.h:609
teken_subr_cursor_forward_tabulation
static void teken_subr_cursor_forward_tabulation(teken_t *t, unsigned int ntabs)
Definition: teken_subr.h:297
teken_subr_next_line
static void teken_subr_next_line(teken_t *t)
Definition: teken_subr.h:729
teken_state_2
static teken_state_t teken_state_2
Definition: teken_state.h:5
teken_subr_double_height_double_width_line_top
static void teken_subr_double_height_double_width_line_top(teken_t *t __unused)
Definition: teken_subr.h:443
teken_subr_pan_up
static void teken_subr_pan_up(teken_t *t, unsigned int nrows)
Definition: teken_subr.h:744
teken_subr_cursor_up
static void teken_subr_cursor_up(teken_t *, unsigned int)
Definition: teken_subr.h:361
teken_subr_delete_line
static void teken_subr_delete_line(teken_t *t, unsigned int nrows)
Definition: teken_subr.h:396
teken_state_5
static teken_state_t teken_state_5
Definition: teken_state.h:4
teken_subr_secondary_device_attributes
static void teken_subr_secondary_device_attributes(teken_t *t, unsigned int request)
Definition: teken_subr.h:984
teken_subr_reverse_index
static void teken_subr_reverse_index(teken_t *t)
Definition: teken_subr.h:962
teken_subr_cons25_set_adapter_background
static void teken_subr_cons25_set_adapter_background(teken_t *t, unsigned int c)
Definition: teken_subr_compat.h:40
teken_subr_save_cursor
static void teken_subr_save_cursor(teken_t *)
Definition: teken_subr.h:975
teken_state_4
static teken_state_t teken_state_4
Definition: teken_state.h:10
teken_state_numbers
static int teken_state_numbers(teken_t *t, teken_char_t c)
Definition: teken.c:361
teken_subr_pan_down
static void teken_subr_pan_down(teken_t *t, unsigned int nrows)
Definition: teken_subr.h:737
teken_subr_erase_character
static void teken_subr_erase_character(teken_t *t, unsigned int ncols)
Definition: teken_subr.h:457
teken_char_t
unsigned char teken_char_t
Definition: teken.h:49
teken_subr_horizontal_position_absolute
static void teken_subr_horizontal_position_absolute(teken_t *t, unsigned int col)
Definition: teken_subr.h:577
teken_state_switch
static void teken_state_switch(teken_t *t, teken_state_t *s)
Definition: teken.c:352
__teken
Definition: teken.h:131
teken_subr_cursor_backward_tabulation
static void teken_subr_cursor_backward_tabulation(teken_t *t, unsigned int ntabs)
Definition: teken_subr.h:254
__teken::t_nums
unsigned int t_nums[T_NUMSIZE]
Definition: teken.h:139
teken_subr_tab_clear
static void teken_subr_tab_clear(teken_t *t, unsigned int cmd)
Definition: teken_subr.h:1185
teken_subr_set_graphic_rendition
static void teken_subr_set_graphic_rendition(teken_t *t, unsigned int ncmds, unsigned int cmds[])
Definition: teken_subr.h:1059
teken_subr_index
static void teken_subr_index(teken_t *t)
Definition: teken_subr.h:616
teken_subr_primary_device_attributes
static void teken_subr_primary_device_attributes(teken_t *t, unsigned int request)
Definition: teken_subr.h:751
teken_subr_alignment_test
static void teken_subr_alignment_test(teken_t *t)
Definition: teken_subr.h:184
teken_subr_set_top_and_bottom_margins
static void teken_subr_set_top_and_bottom_margins(teken_t *t, unsigned int top, unsigned int bottom)
Definition: teken_subr.h:1134
teken_subr_g0_scs_uk_national
static void teken_subr_g0_scs_uk_national(teken_t *t __unused)
Definition: teken_subr.h:542
teken_subr_g1_scs_special_graphics
static void teken_subr_g1_scs_special_graphics(teken_t *t __unused)
Definition: teken_subr.h:556
teken_subr_set_dec_mode
static void teken_subr_set_dec_mode(teken_t *t, unsigned int cmd)
Definition: teken_subr.h:996
teken_subr_device_control_string
static void teken_subr_device_control_string(teken_t *t __unused)
Definition: teken_subr.h:423
teken_subr_restore_cursor
static void teken_subr_restore_cursor(teken_t *t)
Definition: teken_subr.h:951
teken_subr_cursor_forward
static void teken_subr_cursor_forward(teken_t *t, unsigned int ncols)
Definition: teken_subr.h:285
teken_subr_reset_mode
static void teken_subr_reset_mode(teken_t *t, unsigned int cmd)
Definition: teken_subr.h:912
teken_subr_erase_line
static void teken_subr_erase_line(teken_t *, unsigned int)
Definition: teken_subr.h:509
teken_subr_delete_character
static void teken_subr_delete_character(teken_t *t, unsigned int ncols)
Definition: teken_subr.h:373
teken_subr_single_height_double_width_line
static void teken_subr_single_height_double_width_line(teken_t *t __unused)
Definition: teken_subr.h:1164