1 04/15/88  TERM
  2 
  3 Name:
  4 
  5 term - format of compiled term file.
  6 
  7 
  8 Synopsis:
  9 
 10 term
 11 
 12 
 13 Description:
 14 
 15 Compiled terminfo descriptions are placed under the directory
 16 >sl3p>cc>e>terminfo.  In order to avoid a linear search of a huge UNIX
 17 system directory, a two-level scheme is used:
 18 >sl3p>cc>e>terminfo>c>name where name is the name of the terminal, and
 19 c is the first character of name.  Thus, act4 can be found in the
 20 file >sl3p>terminfo>a>act4.  Synonyms for the same terminal are
 21 implemented by multiple links to the same compiled file.
 22 
 23 The format has been chosen so that it will be the same on all
 24 hardware.  An 8 or more bit byte is assumed, but no assumptions about
 25 byte ordering or sign extension are made.
 26 
 27 
 28 The compiled file is created with the terminfo compile program (tic),
 29 and read by the routine setupterm.  Both of these pieces of software
 30 are part of curses(3X).  The file is divided into six parts: the
 31 header, terminal names, boolean flags, numbers, strings, and string
 32 table.
 33 
 34 The header section begins the file.  This section contains six
 35 integers in the format described below.  These integers are (1) the
 36 magic number (octal 0432); (2) the size, in bytes, of the names
 37 section; (3) the number of bytes in the boolean section; (4) the
 38 number of short integers in the numbers section; (5) the number of
 39 offsets (short integers) in the strings section; (6) the size, in
 40 bytes, of the string table.
 41 
 42 
 43 The integers are stored as a character array of size int, starting at
 44 the address of the int.
 45 
 46 The terminal names section comes next.  It contains the first line of
 47 the terminfo description, listing the various names for the terminal,
 48 separated by the '|' character.  The section is terminated with an
 49 ASCII NULL character.
 50 
 51 The boolean flags have one byte for each flag.  This byte is either 0
 52 or 1 as the flag is present or absent.  The capabilities are in the
 53 same order as the file <term.h>.
 54 
 55 
 56 Between the boolean section and the number section, a null byte will
 57 be inserted, if necessary, to ensure that the number section begins
 58 on an even byte.  All integers are aligned on a integer word
 59 boundary.
 60 
 61 The numbers section is similar to the flags section.  Each capability
 62 takes up two bytes, and is stored as a integer.  If the value
 63 represented is -1, the capability is taken to be missing.
 64 
 65 
 66 The strings section is also similar.  Each capability is stored as a
 67 integer, in the format above.  A value of -1 means the capability is
 68 missing.  Otherwise, the value is taken as an offset from the
 69 beginning of the string table.  Special characters in ^X or \c
 70 notation are stored in their interpreted form, not the printing
 71 representation.  Padding information $<nn> and parameter information
 72 %x are stored intact in uninterpreted form.
 73 
 74 The final section is the string table.  It contains all the values of
 75 string capabilities referenced in the string section.  Each string is
 76 NULL terminated.
 77 
 78 
 79 Note that it is possible for setupterm to expect a different set of
 80 capabilities than are actually present in the file.  Either the
 81 database may have been updated since setupterm has been recompiled
 82 (resulting in extra unrecognized entries in the file) or the program
 83 may have been recompiled more recently than the database was updated
 84 (resulting in missing entries).  The routine setupterm must be
 85 prepared for both possibilities - this is why the numbers and sizes
 86 are included.  Also, new capabilities must always be added at the end
 87 of the lists of boolean, number, and string capabilities.
 88 
 89 Limitations include total compiled entries cannot exceed 4096 byte;
 90 the name field cannot exceed 128 bytes.
 91 
 92 
 93 Files:
 94 
 95 >sl3p>cc>e>terminfo>*>*    compiled terminal capability data base
 96 
 97 
 98 See also:
 99 
100 curses.gi.info, terminfo.gi.info