1 /* This file contains enough terminfo reading capabilities sufficient for
2 * the slang SLtt interface.
5 /* Copyright (c) 1992, 1995 John E. Davis
8 * You may distribute under the terms of either the GNU General Public
9 * License or the Perl Artistic License.
24 * The majority of the comments found in the file were taken from the
25 * term(4) man page on an SGI.
28 /* Short integers are stored in two 8-bit bytes. The first byte contains
29 * the least significant 8 bits of the value, and the second byte contains
30 * the most significant 8 bits. (Thus, the value represented is
31 * 256*second+first.) The value -1 is represented by 0377,0377, and the
32 * value -2 is represented by 0376,0377; other negative values are illegal.
33 * The -1 generally means that a capability is missing from this terminal.
34 * The -2 means that the capability has been cancelled in the terminfo
35 * source and also is to be considered missing.
38 static int make_integer (unsigned char *buf
)
41 lo
= (int) *buf
++; hi
= (int) *buf
;
44 if (lo
== 0377) return -1;
45 if (lo
== 0376) return -2;
51 * The compiled file is created from the source file descriptions of the
52 * terminals (see the -I option of infocmp) by using the terminfo compiler,
53 * tic, and read by the routine setupterm [see curses(3X).] The file is
54 * divided into six parts in the following order: the header, terminal
55 * names, boolean flags, numbers, strings, and string table.
57 * The header section begins the file. This section contains six short
58 * integers in the format described below. These integers are (1) the magic
59 * number (octal 0432); (2) the size, in bytes, of the names section; (3)
60 * the number of bytes in the boolean section; (4) the number of short
61 * integers in the numbers section; (5) the number of offsets (short
62 * integers) in the strings section; (6) the size, in bytes, of the string
68 /* In this structure, all char * fields are malloced EXCEPT if the
69 * structure is SLTERMCAP. In that case, only terminal_names is malloced
70 * and the other fields are pointers into it.
78 unsigned int name_section_size
;
81 unsigned int boolean_section_size
;
82 unsigned char *boolean_flags
;
84 unsigned int num_numbers
;
85 unsigned char *numbers
;
87 unsigned int num_string_offsets
;
88 unsigned char *string_offsets
;
90 unsigned int string_table_size
;
95 static char *tcap_getstr (char *, Terminfo_Type
*);
96 static int tcap_getnum (char *, Terminfo_Type
*);
97 static int tcap_getflag (char *, Terminfo_Type
*);
98 static int tcap_getent (char *, Terminfo_Type
*);
100 static FILE *open_terminfo (char *file
, Terminfo_Type
*h
)
103 unsigned char buf
[12];
105 fp
= fopen (file
, "rb");
106 if (fp
== NULL
) return NULL
;
108 if ((12 == fread ((char *) buf
, 1, 12, fp
) && (MAGIC
== make_integer (buf
))))
110 h
->name_section_size
= make_integer (buf
+ 2);
111 h
->boolean_section_size
= make_integer (buf
+ 4);
112 h
->num_numbers
= make_integer (buf
+ 6);
113 h
->num_string_offsets
= make_integer (buf
+ 8);
114 h
->string_table_size
= make_integer (buf
+ 10);
125 * The terminal names section comes next. It contains the first line of the
126 * terminfo description, listing the various names for the terminal,
127 * separated by the bar ( | ) character (see term(5)). The section is
128 * terminated with an ASCII NUL character.
131 /* returns pointer to malloced space */
132 static unsigned char *read_terminfo_section (FILE *fp
, unsigned int size
)
136 if (NULL
== (s
= (char *) SLMALLOC (size
))) return NULL
;
137 if (size
!= fread (s
, 1, size
, fp
))
142 return (unsigned char *) s
;
145 static char *read_terminal_names (FILE *fp
, Terminfo_Type
*t
)
147 return t
->terminal_names
= (char *) read_terminfo_section (fp
, t
->name_section_size
);
151 * The boolean flags have one byte for each flag. This byte is either 0 or
152 * 1 as the flag is present or absent. The value of 2 means that the flag
153 * has been cancelled. The capabilities are in the same order as the file
157 static unsigned char *read_boolean_flags (FILE *fp
, Terminfo_Type
*t
)
159 /* Between the boolean section and the number section, a null byte is
160 * inserted, if necessary, to ensure that the number section begins on an
161 * even byte offset. All short integers are aligned on a short word
165 unsigned int size
= (t
->name_section_size
+ t
->boolean_section_size
) % 2;
166 size
+= t
->boolean_section_size
;
168 return t
->boolean_flags
= read_terminfo_section (fp
, size
);
174 * The numbers section is similar to the boolean flags section. Each
175 * capability takes up two bytes, and is stored as a short integer. If the
176 * value represented is -1 or -2, the capability is taken to be missing.
179 static unsigned char *read_numbers (FILE *fp
, Terminfo_Type
*t
)
181 return t
->numbers
= read_terminfo_section (fp
, 2 * t
->num_numbers
);
185 /* The strings section is also similar. Each capability is stored as a
186 * short integer, in the format above. A value of -1 or -2 means the
187 * capability is missing. Otherwise, the value is taken as an offset from
188 * the beginning of the string table. Special characters in ^X or \c
189 * notation are stored in their interpreted form, not the printing
190 * representation. Padding information ($<nn>) and parameter information
191 * (%x) are stored intact in uninterpreted form.
194 static unsigned char *read_string_offsets (FILE *fp
, Terminfo_Type
*t
)
196 return t
->string_offsets
= (unsigned char *) read_terminfo_section (fp
, 2 * t
->num_string_offsets
);
200 /* The final section is the string table. It contains all the values of
201 * string capabilities referenced in the string section. Each string is
205 static char *read_string_table (FILE *fp
, Terminfo_Type
*t
)
207 return t
->string_table
= (char *) read_terminfo_section (fp
, t
->string_table_size
);
212 * Compiled terminfo(4) descriptions are placed under the directory
213 * /usr/share/lib/terminfo. In order to avoid a linear search of a huge
214 * UNIX system directory, a two-level scheme is used:
215 * /usr/share/lib/terminfo/c/name where name is the name of the terminal,
216 * and c is the first character of name. Thus, att4425 can be found in the
217 * file /usr/share/lib/terminfo/a/att4425. Synonyms for the same terminal
218 * are implemented by multiple links to the same compiled file.
221 #define MAX_TI_DIRS 7
222 static char *Terminfo_Dirs
[MAX_TI_DIRS
] =
226 "/usr/share/lib/terminfo",
227 "/usr/local/lib/terminfo",
229 "/usr/local/share/terminfo",
230 "/usr/share/terminfo"
233 char *SLtt_tigetent (char *term
)
244 && (SLang_Untic_Terminfo_File
== NULL
)
249 if (NULL
== (ti
= (Terminfo_Type
*) SLMALLOC (sizeof (Terminfo_Type
))))
255 if (SLang_Untic_Terminfo_File
!= NULL
)
257 fp
= open_terminfo (SLang_Untic_Terminfo_File
, ti
);
262 /* If we are on a termcap based system, use termcap */
263 if (0 == tcap_getent (term
, ti
)) return (char *) ti
;
265 Terminfo_Dirs
[0] = getenv ("TERMINFO");
267 while (i
< MAX_TI_DIRS
)
269 tidir
= Terminfo_Dirs
[i
];
272 g_snprintf (file
, sizeof (file
), "%s/%c/%s", tidir
, *term
, term
);
273 if (NULL
!= (fp
= open_terminfo (file
, ti
))) break;
283 if (NULL
!= read_terminal_names (fp
, ti
))
285 if (NULL
!= read_boolean_flags (fp
, ti
))
287 if (NULL
!= read_numbers (fp
, ti
))
289 if (NULL
!= read_string_offsets (fp
, ti
))
291 if (NULL
!= read_string_table (fp
, ti
))
295 ti
->flags
= SLTERMINFO
;
298 SLFREE (ti
->string_offsets
);
300 SLFREE (ti
->numbers
);
302 SLFREE (ti
->boolean_flags
);
304 SLFREE (ti
->terminal_names
);
314 # define UNTIC_COMMENT(x) ,x
316 # define UNTIC_COMMENT(x)
329 /* I need to add: K1-5, %0-5(not important), @8, &8... */
330 static Tgetstr_Map_Type Tgetstr_Map
[] =
332 {"@7", 164 UNTIC_COMMENT("KEY End")},
333 {"AB", 360 UNTIC_COMMENT("set a color background")},
334 {"AF", 359 UNTIC_COMMENT("set a color foreground")},
335 {"AL", 110 UNTIC_COMMENT("parm_insert_line")},
336 {"DL", 106 UNTIC_COMMENT("parm_delete_line")},
337 {"RI", 112 UNTIC_COMMENT("parm_right_cursor")},
338 {"Sf", 302 UNTIC_COMMENT("set foreground (color)")},
339 {"Sb", 303 UNTIC_COMMENT("set background (color)")},
340 {"ac", 146 UNTIC_COMMENT("acs_chars")},
341 {"ae", 38 UNTIC_COMMENT("exit_alt_charset_mode")},
342 {"as", 25 UNTIC_COMMENT("enter_alt_charset_mode")},
343 {"ce", 6 UNTIC_COMMENT("clr_eol")},
344 {"cl", 5 UNTIC_COMMENT("clear_screen")},
345 {"cm", 10 UNTIC_COMMENT("cursor_address")},
346 {"cs", 3 UNTIC_COMMENT("change_scroll_region")},
347 {"dc", 21 UNTIC_COMMENT("delete_character")},
348 {"ds", 23 UNTIC_COMMENT("disable status line")},
349 {"eA", 155 UNTIC_COMMENT("enable alt char set")},
350 {"ei", 42 UNTIC_COMMENT("exit_insert_mode")},
351 {"fs", 47 UNTIC_COMMENT("return from status line")},
352 {"im", 31 UNTIC_COMMENT("enter_insert_mode")},
353 {"k0", 65 UNTIC_COMMENT("key_f0")},
354 {"k1", 66 UNTIC_COMMENT("key_f1")},
355 {"k2", 68 UNTIC_COMMENT("key_f2")},
356 {"k3", 69 UNTIC_COMMENT("key_f3")},
357 {"k4", 70 UNTIC_COMMENT("key_f4")},
358 {"k5", 71 UNTIC_COMMENT("key_f5")},
359 {"k6", 72 UNTIC_COMMENT("key_f6")},
360 {"k7", 73 UNTIC_COMMENT("key_f7")},
361 {"k8", 74 UNTIC_COMMENT("key_f8")},
362 {"k9", 75 UNTIC_COMMENT("key_f9")},
363 {"kA", 78 UNTIC_COMMENT("key_il")},
364 {"kC", 57 UNTIC_COMMENT("key_clear")},
365 {"kD", 59 UNTIC_COMMENT("key_dc")},
366 {"kE", 63 UNTIC_COMMENT("key_eol,")},
367 {"kF", 84 UNTIC_COMMENT("key_sf")},
368 {"kH", 80 UNTIC_COMMENT("key_ll")},
369 {"kI", 77 UNTIC_COMMENT("key_ic")},
370 {"kL", 60 UNTIC_COMMENT("key_dl")},
371 {"kM", 62 UNTIC_COMMENT("key_eic,")},
372 {"kN", 81 UNTIC_COMMENT("key_npage")},
373 {"kP", 82 UNTIC_COMMENT("key_ppage")},
374 {"kR", 85 UNTIC_COMMENT("key_sr")},
375 {"kS", 64 UNTIC_COMMENT("key_eos,")},
376 {"kT", 86 UNTIC_COMMENT("key_stab")},
377 {"ka", 56 UNTIC_COMMENT("key_catab")},
378 {"k;", 67 UNTIC_COMMENT("key_f10")},
379 {"kb", 55 UNTIC_COMMENT("key_backspace")},
380 {"kd", 61 UNTIC_COMMENT("key_down")},
381 {"ke", 88 UNTIC_COMMENT("End keypad transmit mode")},
382 {"kh", 76 UNTIC_COMMENT("key_home")},
383 {"kl", 79 UNTIC_COMMENT("key_left")},
384 {"kr", 83 UNTIC_COMMENT("key_right")},
385 {"ks", 89 UNTIC_COMMENT("Start keypad transmit mode")},
386 {"kt", 58 UNTIC_COMMENT("key_ctab")},
387 {"ku", 87 UNTIC_COMMENT("key_up")},
388 {"mb", 26 UNTIC_COMMENT("enter_blink_mode")},
389 {"md", 27 UNTIC_COMMENT("enter_bold_mode")},
390 {"me", 39 UNTIC_COMMENT("exit_attribute_mode")},
391 {"mr", 34 UNTIC_COMMENT("enter_reverse_mode")},
392 {"op", 297 UNTIC_COMMENT("orig_pair (color)")},
393 {"pf", 119 UNTIC_COMMENT("turn OFF printer")},
394 {"po", 120 UNTIC_COMMENT("turn ON printer")},
395 {"se", 43 UNTIC_COMMENT("exit_standout_mode")},
396 {"so", 35 UNTIC_COMMENT("enter_standout_mode")},
397 {"sr", 130 UNTIC_COMMENT("scroll_reverse")},
398 {"te", 40 UNTIC_COMMENT("end cursor addressing")},
399 {"ti", 28 UNTIC_COMMENT("begin cursor addressing")},
400 {"ts", 135 UNTIC_COMMENT("goto to status line")},
401 {"up", 19 UNTIC_COMMENT("cursor_up")},
402 {"us", 36 UNTIC_COMMENT("enter_underline_mode")},
403 {"vb", 45 UNTIC_COMMENT("flash_screen")},
404 {"ve", 16 UNTIC_COMMENT("make cursor very visible")},
405 {"vi", 13 UNTIC_COMMENT("make cursor invisible")},
406 {"vs", 20 UNTIC_COMMENT("make cursor very visible")},
407 {"", 0 UNTIC_COMMENT(NULL
)}
410 static int compute_cap_offset (char *cap
, Terminfo_Type
*t
, Tgetstr_Map_Type
*map
, unsigned int max_ofs
)
415 cha
= *cap
++; chb
= *cap
;
417 while (*map
->name
!= 0)
419 if ((cha
== *map
->name
) && (chb
== *(map
->name
+ 1)))
421 if (map
->offset
>= (int) max_ofs
) return -1;
430 char *SLtt_tigetstr (char *cap
, char **pp
)
435 if ((pp
== NULL
) || (NULL
== (t
= (Terminfo_Type
*) *pp
))) return NULL
;
437 if (t
->flags
== SLTERMCAP
) return tcap_getstr (cap
, t
);
439 offset
= compute_cap_offset (cap
, t
, Tgetstr_Map
, t
->num_string_offsets
);
440 if (offset
< 0) return NULL
;
441 offset
= make_integer (t
->string_offsets
+ 2 * offset
);
442 if (offset
< 0) return NULL
;
443 return t
->string_table
+ offset
;
446 static Tgetstr_Map_Type Tgetnum_Map
[] =
448 {"co", 0 UNTIC_COMMENT("columns")},
449 {"li", 2 UNTIC_COMMENT("lines")},
450 {"Co", 13 UNTIC_COMMENT("max colors")},
451 {"pa", 14 UNTIC_COMMENT("max pairs")},
452 {"sg", 4 UNTIC_COMMENT("magic cookie glitch")},
453 {"ws", 7 UNTIC_COMMENT("num columns in status line")},
454 {"", -1 UNTIC_COMMENT(NULL
)}
457 int SLtt_tigetnum (char *cap
, char **pp
)
462 if ((pp
== NULL
) || (NULL
== (t
= (Terminfo_Type
*) *pp
))) return -1;
464 if (t
->flags
== SLTERMCAP
) return tcap_getnum (cap
, t
);
466 offset
= compute_cap_offset (cap
, t
, Tgetnum_Map
, t
->num_numbers
);
467 if (offset
< 0) return -1;
468 return make_integer (t
->numbers
+ 2 * offset
);
471 static Tgetstr_Map_Type Tgetflag_Map
[] =
473 {"am", 1 UNTIC_COMMENT("auto right margin")},
474 {"hs", 9 UNTIC_COMMENT("has status line")},
475 {"ms", 14 UNTIC_COMMENT("move standout mode")},
476 {"xs", 3 UNTIC_COMMENT("ceol standout glitch")},
477 {"xn", 4 UNTIC_COMMENT("NEWLINE ignored after 80 columns")},
478 {"es", 16 UNTIC_COMMENT("status line esc ok")},
479 {"", -1 UNTIC_COMMENT(NULL
)}
482 int SLtt_tigetflag (char *cap
, char **pp
)
487 if ((pp
== NULL
) || (NULL
== (t
= (Terminfo_Type
*) *pp
))) return -1;
489 if (t
->flags
== SLTERMCAP
) return tcap_getflag (cap
, t
);
491 offset
= compute_cap_offset (cap
, t
, Tgetflag_Map
, t
->boolean_section_size
);
493 if (offset
< 0) return -1;
494 return (int) *(t
->boolean_flags
+ offset
);
499 /* These are my termcap routines. They only work with the TERMCAP environment
500 * variable. This variable must contain the termcap entry and NOT the file.
503 static int tcap_getflag (char *cap
, Terminfo_Type
*t
)
506 char *f
= (char *) t
->boolean_flags
;
509 if (f
== NULL
) return 0;
510 fmax
= f
+ t
->boolean_section_size
;
516 if ((a
== f
[0]) && (b
== f
[1]))
523 static char *tcap_get_cap (unsigned char *cap
, unsigned char *caps
, unsigned int len
)
525 unsigned char c0
, c1
;
526 unsigned char *caps_max
;
531 if (caps
== NULL
) return NULL
;
532 caps_max
= caps
+ len
;
533 while (caps
< caps_max
)
535 if ((c0
== caps
[0]) && (c1
== caps
[1]))
537 return (char *) caps
+ 3;
539 caps
+= (int) caps
[2];
545 static int tcap_getnum (char *cap
, Terminfo_Type
*t
)
547 cap
= tcap_get_cap ((unsigned char *) cap
, t
->numbers
, t
->num_numbers
);
548 if (cap
== NULL
) return -1;
552 static char *tcap_getstr (char *cap
, Terminfo_Type
*t
)
554 return tcap_get_cap ((unsigned char *) cap
, (unsigned char *) t
->string_table
, t
->string_table_size
);
557 static int tcap_extract_field (unsigned char *t0
)
559 register unsigned char ch
, *t
= t0
;
560 while (((ch
= *t
) != 0) && (ch
!= ':')) t
++;
561 if (ch
== ':') return (int) (t
- t0
);
565 int SLtt_Try_Termcap
= 1;
566 static int tcap_getent (char *term
, Terminfo_Type
*ti
)
568 unsigned char *termcap
, ch
;
569 unsigned char *buf
, *b
;
573 if (SLtt_Try_Termcap
== 0) return -1;
575 /* XFREE86 xterm sets the TERMCAP environment variable to an invalid
576 * value. Specifically, it lacks the tc= string.
578 if (!strncmp (term
, "xterm", 5))
581 termcap
= (unsigned char *) getenv ("TERMCAP");
582 if ((termcap
== NULL
) || (*termcap
== '/')) return -1;
584 /* We have a termcap so lets use it provided it does not have a reference
585 * to another terminal via tc=. In that case, user terminfo. The alternative
586 * would be to parse the termcap file which I do not want to do right now.
587 * Besides, this is a terminfo based system and if the termcap were parsed
588 * terminfo would almost never get a chance to run. In addition, the tc=
589 * thing should not occur if tset is used to set the termcap entry.
592 while ((len
= tcap_extract_field (t
)) != -1)
594 if ((len
> 3) && (t
[0] == 't') && (t
[1] == 'c') && (t
[2] == '='))
599 /* malloc some extra space just in case it is needed. */
600 len
= strlen ((char *) termcap
) + 256;
601 if (NULL
== (buf
= (unsigned char *) SLMALLOC ((unsigned int) len
))) return -1;
605 /* The beginning of the termcap entry contains the names of the entry.
606 * It is terminated by a colon.
609 ti
->terminal_names
= (char *) b
;
611 len
= tcap_extract_field (t
);
617 strncpy ((char *) b
, (char *) t
, (unsigned int) len
);
620 ti
->name_section_size
= len
;
623 /* Now, we are really at the start of the termcap entries. Point the
624 * termcap variable here since we want to refer to this a number of times.
626 termcap
= t
+ (len
+ 1);
629 /* Process strings first. */
630 ti
->string_table
= (char *) b
;
632 while (-1 != (len
= tcap_extract_field (t
)))
637 /* We are looking for: XX=something */
638 if ((len
< 4) || (t
[2] != '=') || (*t
== '.'))
649 if ((ch
== '\\') && (t
< tmax
))
651 t
= (unsigned char *) SLexpand_escaped_char ((char *) t
, (char *) &ch
);
653 else if ((ch
== '^') && (t
< tmax
))
656 if (ch
== '?') ch
= 127;
657 else ch
= (ch
| 0x20) - ('a' - 1);
661 /* Null terminate it. */
663 len
= (int) (b
- b1
);
664 b1
[2] = (unsigned char) len
; /* replace the = by the length */
665 /* skip colon to next field. */
668 ti
->string_table_size
= (int) (b
- (unsigned char *) ti
->string_table
);
670 /* Now process the numbers. */
674 while (-1 != (len
= tcap_extract_field (t
)))
679 /* We are looking for: XX#NUMBER */
680 if ((len
< 4) || (t
[2] != '#') || (*t
== '.'))
692 /* Null terminate it. */
694 len
= (int) (b
- b1
);
695 b1
[2] = (unsigned char) len
; /* replace the # by the length */
698 ti
->num_numbers
= (int) (b
- ti
->numbers
);
700 /* Now process the flags. */
702 ti
->boolean_flags
= b
;
703 while (-1 != (len
= tcap_extract_field (t
)))
705 /* We are looking for: XX#NUMBER */
706 if ((len
!= 2) || (*t
== '.') || (*t
<= ' '))
716 ti
->boolean_section_size
= (int) (b
- ti
->boolean_flags
);
717 ti
->flags
= SLTERMCAP
;
721 #else /* USE_SETUPTERM */
723 /* Ching Hui fixes so that it will work on AIX and OSF/1 */
727 int SLtt_Try_Termcap
= 1;
729 char *SLtt_tigetent (char *term
)
733 setupterm(term
, 1, &rc
);
736 return (char *)cur_term
;
739 #define MATCH_CHAR(c, variable) \
741 if (*(cap + 1) == c) \
745 char *SLtt_tigetstr (char *cap
, char **pp
)
747 if ((pp
== NULL
) || ((cur_term
= (struct term
*) *pp
) == NULL
))
752 MATCH_CHAR('7', key_end
);
755 MATCH_CHAR('A', parm_insert_line
);
758 MATCH_CHAR('L', parm_delete_line
);
761 MATCH_CHAR('I', parm_right_cursor
);
765 MATCH_CHAR('c', acs_chars
);
766 #elif defined (box_chars_1)
767 MATCH_CHAR('c', box_chars_1
); /* AIX hack */
769 MATCH_CHAR('c', NULL
);
771 MATCH_CHAR('e', exit_alt_charset_mode
);
772 MATCH_CHAR('s', enter_alt_charset_mode
);
775 MATCH_CHAR('e', clr_eol
);
776 MATCH_CHAR('l', clear_screen
);
777 MATCH_CHAR('m', cursor_address
);
778 MATCH_CHAR('s', change_scroll_region
);
781 MATCH_CHAR('c', delete_character
);
784 MATCH_CHAR('i', exit_insert_mode
);
786 MATCH_CHAR('A', ena_acs
); /* aix hack */
788 MATCH_CHAR('A', NULL
);
792 MATCH_CHAR('m', enter_insert_mode
);
795 MATCH_CHAR('0', key_f0
);
796 MATCH_CHAR('1', key_f1
);
797 MATCH_CHAR('1', key_f1
);
798 MATCH_CHAR('2', key_f2
);
799 MATCH_CHAR('3', key_f3
);
800 MATCH_CHAR('4', key_f4
);
801 MATCH_CHAR('5', key_f5
);
802 MATCH_CHAR('6', key_f6
);
803 MATCH_CHAR('7', key_f7
);
804 MATCH_CHAR('8', key_f8
);
805 MATCH_CHAR('9', key_f9
);
806 MATCH_CHAR('A', key_il
);
807 MATCH_CHAR('C', key_clear
);
808 MATCH_CHAR('D', key_dc
);
809 MATCH_CHAR('E', key_eol
);
810 MATCH_CHAR('F', key_sf
);
811 MATCH_CHAR('H', key_ll
);
812 MATCH_CHAR('I', key_ic
);
813 MATCH_CHAR('L', key_dl
);
814 MATCH_CHAR('M', key_eic
);
815 MATCH_CHAR('N', key_npage
);
816 MATCH_CHAR('P', key_ppage
);
817 MATCH_CHAR('R', key_sr
);
818 MATCH_CHAR('S', key_eos
);
819 MATCH_CHAR('T', key_stab
);
820 MATCH_CHAR('a', key_catab
);
821 MATCH_CHAR(';', key_f10
);
822 MATCH_CHAR('b', key_backspace
);
823 MATCH_CHAR('d', key_down
);
824 MATCH_CHAR('e', keypad_local
);
825 MATCH_CHAR('h', key_home
);
826 MATCH_CHAR('l', key_left
);
827 MATCH_CHAR('r', key_right
);
828 MATCH_CHAR('s', keypad_xmit
);
829 MATCH_CHAR('t', key_ctab
);
830 MATCH_CHAR('u', key_up
);
833 MATCH_CHAR('b', enter_blink_mode
);
834 MATCH_CHAR('d', enter_bold_mode
);
835 MATCH_CHAR('e', exit_attribute_mode
);
836 MATCH_CHAR('r', enter_reverse_mode
);
839 MATCH_CHAR('e', exit_standout_mode
);
840 MATCH_CHAR('o', enter_standout_mode
);
841 MATCH_CHAR('r', scroll_reverse
);
844 MATCH_CHAR('e', exit_ca_mode
);
845 MATCH_CHAR('i', enter_ca_mode
);
848 MATCH_CHAR('p', cursor_up
);
849 MATCH_CHAR('s', enter_underline_mode
);
852 MATCH_CHAR('b', flash_screen
);
853 MATCH_CHAR('i', cursor_invisible
);
854 MATCH_CHAR('s', cursor_visible
);
857 MATCH_CHAR('1', key_f11
);
858 MATCH_CHAR('2', key_f12
);
859 MATCH_CHAR('3', key_f13
);
860 MATCH_CHAR('4', key_f14
);
861 MATCH_CHAR('5', key_f15
);
862 MATCH_CHAR('6', key_f16
);
863 MATCH_CHAR('7', key_f17
);
864 MATCH_CHAR('8', key_f18
);
865 MATCH_CHAR('9', key_f19
);
866 MATCH_CHAR('A', key_f20
);
870 MATCH_CHAR('p', orig_pair
);
877 int SLtt_tigetnum (char *cap
, char **pp
)
879 if ((pp
== NULL
) || ((cur_term
= (struct term
*) *pp
) == NULL
))
883 MATCH_CHAR('o', columns
);
886 MATCH_CHAR('i', lines
);
892 int SLtt_tigetflag (char *cap
, char **pp
)
894 if ((pp
== NULL
) || ((cur_term
= (struct term
*) *pp
) == NULL
))
898 MATCH_CHAR('m', auto_right_margin
);
901 MATCH_CHAR('s', move_standout_mode
);
904 MATCH_CHAR('s', ceol_standout_glitch
);
907 MATCH_CHAR('g', magic_cookie_glitch
);
913 #endif /* !USE_SETUPTERM */