⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 terminfo.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>Terminfo</title></head><body bgcolor=white><center><font size=2>The Single UNIX &reg; Specification, Version 2<br>Copyright &copy; 1997 The Open Group</font></center><hr size=2 noshade><blockquote><h2><a name = "tag_002">&nbsp;</a>Terminfo Source Format (ENHANCED CURSES)</h2><xref type="1" name="chapTERMINFO"></xref>The requirements in this chapter are in effect only for implementationsthat claim Enhanced Curses compliance.<p>The <b>terminfo</b> database contains a description of the capabilities of avariety of devices, such as terminals and printers.  Devices are described byspecifying a set of capabilities, by quantifying certain aspects of thedevice, and by specifying character sequences that effect particular results.<p>This chapter specifies the format of <b>terminfo</b> source files.<p>X/Open-compliant implementations must provide a facility that acceptssource files in the format specified in this chapter as a means ofentering information into the <b>terminfo</b> database.The facility for installing this information into the databaseis implementation-specific.  A valid <b>terminfo</b> entry describinga given model of terminal can be added to <b>terminfo</b> on anyX/Open-compliant implementation to permit use of the same terminal model.<p><p><xref href=terminfo_syntax><a href="#tag_002_001">Source File Syntax</a></xref>describes the syntax of <b>terminfo</b> source files.  A grammarand lexical conventions appear in<xref href=terminfo_grammar><a href="#tag_002_001_002">Formal Grammar</a></xref>.A list of all terminal capabilities defined by X/Open appears in<xref href=caplist><a href="#tag_002_001_003">Defined Capabilities</a></xref>.An example follows in<xref href=sampleentry><a href="#tag_002_001_004">Sample Entry</a></xref>.<xref href=terminfo_device></xref>describes the specification of devices in general, such as video terminals.<xref href=terminfo_printer></xref>describes the specification of printers.<p>The <b>terminfo</b> database is often used by screen-oriented applications suchas <b>vi</b> and Cursesprograms, as well as by some utilities such as <b>ls</b> and <b>more</b>.  Thisusage allows them to work with a variety of devices without changes to theprograms.<h3><a name = "tag_002_001">&nbsp;</a>Source File Syntax</h3><xref type="2" name="terminfo_syntax"></xref>Source files can use the ISO 8859-1 codeset.  The behaviour when the sourcefile is in another codeset is unspecified.  Traditional practice has been totranslate information from other codesets into the source file syntax.<p><b>terminfo</b> source files consist of one or more device descriptions.Each description defines a mnemonic name for the terminal model.  Eachdescription consists of a header (beginning in column 1) and one or more linesthat list the features for that particular device.  Every line in a<b>terminfo</b> source file must end in a comma.  Every line in a<b>terminfo</b> source file except the header must be indented with one or morewhite spaces (either spaces or tabs).<p>Entries in <b>terminfo</b> source files consist of a number of comma-separatedfields.  White space after each comma is ignored.  Embedded commas must beescaped by using a backslash.  The following example shows the format of a<b>terminfo</b> source file:delim $$delim offThe first line, commonly referred to as the header line, must begin in columnone and must contain at least two aliases separated by vertical bars.  Thelast field in the header line must be the long name of the device and it maycontain any string.<p>Alias names must be unique in the <b>terminfo</b> databaseand they must conform to file naming conventions established byimplementation-specific <b>terminfo</b> compilation utilities.Implementations will recognise alias names consisting only of charactersfrom the portable filename character set except that implementations need not accept a first character  of minus (-).For example, atypical restriction is that they cannot contain white space orslashes.  There may be further constraints imposed on source file values bythe implementation-specific <b>terminfo</b> compilation utilities.<xref href=aliasconventions></xref>provides conventions for choosing alias names.<p>Each capability in <b>terminfo</b> is of one of the following types:<ul><p><li>Boolean capabilities show that a device has or does not have a particularfeature.<p><li>Numeric capabilities quantify particular features of a device.<p><li>String capabilities provide sequences that can be used to performparticular operations on devices.<p></ul><p>Capability names adhere to an informal length limit of fivecharacters.  Whenever possible, capabilitynames are chosen to be the same as or similar to those specified by theANSI X3.64-1979 standard.  Semantics are also intended to match those of the ANSI standard.<p>All string capabilities may have padding specified, with the exception ofthose used for input.  Input capabilities, listed under the <b>Strings</b>section in the following tables, have names beginning with <b>key_</b>.  Thesecapabilities are defined in<i><a href="term.h.html">&lt;term.h&gt;</a></i>.<br><h4><a name = "tag_002_001_001">&nbsp;</a>Minimum Guaranteed Limits</h4><xref type="3" name="minmax"></xref>All X/Open-compliant implementations support at least the following limitsfor the <b>terminfo</b> source file:<p><table  bordercolor=#000000 border=1 align=center><tr valign=top><th align=center><b>Source File Characteristic</b><th align=center><b>Minimum Guaranteed Value</b><tr valign=top><td align=left>Length of a line<td align=left>1023 bytes<tr valign=top><td align=left>Length of a terminal alias<td align=left>14 bytes<tr valign=top><td align=left>Length of a terminal model name<td align=left>128 bytes<tr valign=top><td align=left>Width of a single field<td align=left>128 bytes<tr valign=top><td align=left>Length of a string value<td align=left>1000 bytes<tr valign=top><td align=left>Length of a string representing a numeric value<td align=left>99 digits<tr valign=top><td align=left>Magnitude of a numeric value<td align=left>0 up to and including 32767</table>An implementation may support higher limits than those specified above.<h4><a name = "tag_002_001_002">&nbsp;</a>Formal Grammar</h4><xref type="3" name="terminfo_grammar"></xref>The grammar and lexical conventions in this section togetherdescribe the syntax for <b>terminfo</b> terminal descriptions within a terminfosource file.  A terminal description that satisfies the requirements of thissection will be accepted by all implementations.<pre><code>descriptions : START_OF_HEADER_LINE  rest_of_header_line feature_lines          | descriptions START_OF_HEADER_LINE rest_of_header_line           | feature_lines          ;An ALIAS that begins in column one.  This is handled by the lexical analyzer.rest_of_header_line : PIPE LONGNAME COMMA NEWLINE          | aliases PIPE LONGNAME COMMA NEWLINE          ;feature_lines : start_feature_line rest_of_feature_line          | feature_lines start_feature_line rest_of_feature_line          ;start_feature_line : START_FEATURE_LINE_BOOLEANA BOOLEAN feature that begins after column one but is the firstfeature on the feature line.  This is handled by the lexical analyzer.          | START_FEATURE_LINE_NUMERICA NUMERIC feature that begins after column one but is the firstfeature on the feature line.  This is handled by the lexical analyzer.          | START_FEATURE_LINE_STRINGA STRING feature that begins after column one but is the firstfeature on the feature line.  This is handled by the lexical analyzer.          ;rest_of_feature_line : features COMMA NEWLINE          | COMMA NEWLINE          ;features : COMMA feature          | features COMMA feature          ;aliases : PIPE ALIAS          | aliases PIPE ALIAS          ;feature : BOOLEAN          | NUMERIC          | STRING          ;</code></pre>The lexical conventions for <b>terminfo</b> descriptions are as follows:<ol><p><li>White space consists of the ' ' and &lt;tab&gt; character.<p><li>An ALIAS may contain any graph characters other than ',','/' and '|'.Graph characters are those characters for which<i><a href="../xsh/isgraph.html">isgraph()</a></i>returns non-zero.<p><li>A LONGNAME may contain any print characters other than ',' and '|'.Print characters are those characters for which<i><a href="../xsh/isprint.html">isprint()</a></i>returns non-zero.<p><li>A BOOLEAN feature may contain any print characters otherthan ',', '=', and '#'.<p><li>A NUMERIC feature consists of:<ol type = a><p><li>A name which may contain any print character other than ',', '=', and '#'.<p><li>The '#' character.<p><li>A positive integer which conforms to the C languageconvention for integer constants.<p></ol><p><li>A STRING feature consists of:<ol type = a><p><li>A name which may contain any print character other than ',', '=', and '#'.<p><li>The '=' character.<p><li>A string which may contain any print characters other than ','.<p></ol><p><li>White space immediately following a ',' is ignored.<p><li>Comments consist of &lt;bol&gt;, optional whitespace, a required '#',and a terminating &lt;eol&gt;.<p><li>A header line must begin in column one.<p><li>A feature line must not begin in column one.<p><li>Blank lines are ignored.<p></ol><h4><a name = "tag_002_001_003">&nbsp;</a>Defined Capabilities</h4><xref type="3" name="caplist"></xref>X/Open defines the capabilities listed in the following table.  AllX/Open-compliant implementations must accept each of these capabilities in anentry in a <b>terminfo</b> source file.Implementations use this information to determine how properly to operatethe current terminal.  In addition, implementations return any of the currentterminal's capabilities when the application calls the query functions listedin<xref href=tgetent><a href="tgetent.html#tag_002_001">Source File Syntax</a></xref>(in the cases where the following table lists a<b>Termcap</b>code) and<xref href=tigetflag><a href="tigetflag.html#tag_002_001">Source File Syntax</a></xref>.<p>The table of capabilities has the following columns:<dl compact><dt><b>Variable</b><dd>Names for use by the Curses functions that operate on the <b>terminfo</b>database.  These names are reserved and the application must not define them.<dt><b>Capname</b><dd>The short name for a capability specified in the <b>terminfo</b> source file.It is used for updating the source file and by the <i>tput</i> command.<dt><b>Termcap</b><dd>Codes provided for compatibility with older applications.  These codesare <b>TO BE WITHDRAWN</b>.  Because of this, not all <b>Capname</b>s have<b>Termcap</b> codes.</dl><h5><a name = "tag_002_001_003_001">&nbsp;</a>Booleans</h5><p><table  bordercolor=#000000 border=1 align=center><tr valign=top><th align=left><b></b><th align=left><b>Cap-</b><th align=left><b>Term-</b><th align=left><b></b><tr valign=top><th align=left><b>Variable</b><th align=left><b>name</b><th align=left><b>cap</b><th align=left><b>Description</b><tr valign=top><td align=left>auto_left_margin<td align=left><b>bw</b><td align=left>bw<td align=left><b>cub1</b> wraps from column 0 to last column<tr valign=top><td align=left>auto_right_margin<td align=left><b>am</b><td align=left>am<td align=left>Terminal has automatic margins<tr valign=top><td align=left>back_color_erase<td align=left><b>bce</b><td align=left>ut<td align=left>Screen erased with background colour<tr valign=top><td align=left>can_change<td align=left><b>ccc</b><td align=left>cc<td align=left>Terminal can re-define existing colour<tr valign=top><td align=left>ceol_standout_glitch<td align=left><b>xhp</b><td align=left>xs<td align=left>Standout not erased by overwriting (hp)<tr valign=top><td align=left>col_addr_glitch<td align=left><b>xhpa</b><td align=left>YA<td align=left>Only positive motion for <b>hpa</b>/<b>mhpa</b> caps<tr valign=top><td align=left>cpi_changes_res<td align=left><b>cpix</b><td align=left>YF<td align=left>Changing character pitch changes resolution<tr valign=top><td align=left>cr_cancels_micro_mode<td align=left><b>crxm</b><td align=left>YB<td align=left>Using <b>cr</b> turns off micro mode<tr valign=top><td align=left>dest_tabs_magic_smso<td align=left><b>xt</b><td align=left>xt<td align=left>Destructive tabs, magic <b>smso</b> char (t1061)<tr valign=top><td align=left>eat_newline_glitch<td align=left><b>xenl</b><td align=left>xn<td align=left>Newline ignored after 80 columns (Concept)<tr valign=top><td align=left>erase_overstrike<td align=left><b>eo</b><td align=left>eo<td align=left>Can erase overstrikes with a blank<tr valign=top><td align=left>generic_type<td align=left><b>gn</b><td align=left>gn<td align=left>Generic line type (<i>e.g.</i>, dialup, switch)<tr valign=top><td align=left>hard_copy<td align=left><b>hc</b><td align=left>hc<td align=left>Hardcopy terminal<tr valign=top><td align=left>hard_cursor<td align=left><b>chts</b><td align=left>HC<td align=left>Cursor is hard to see<tr valign=top><td align=left>has_meta_key<td align=left><b>km</b><td align=left>km<td align=left>Has a meta key (shift, sets parity bit)<tr valign=top><td align=left>has_print_wheel<td align=left><b>daisy</b><td align=left>YC<td align=left>Printer needs operator to change<tr valign=top><td align=left><td align=left><b></b><td align=left><td align=left>character set<tr valign=top><td align=left>has_status_line<td align=left><b>hs</b>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -