]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - doc/html/man/curs_terminfo.3x.html
ncurses 6.2 - patch 20210102
[ncurses.git] / doc / html / man / curs_terminfo.3x.html
index 64b9ea1de8ca9c1da77b1acc8863da081fb2bf86..3c8da425172f50bff6cdbc383b838b27ff454b4f 100644 (file)
@@ -1,6 +1,7 @@
 <!-- 
   ****************************************************************************
-  * Copyright (c) 1999-2016,2017 Free Software Foundation, Inc.              *
+  * Copyright 2018-2020,2021 Thomas E. Dickey                                *
+  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
   *                                                                          *
   * Permission is hereby granted, free of charge, to any person obtaining a  *
   * copy of this software and associated documentation files (the            *
@@ -26,7 +27,9 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_terminfo.3x,v 1.57 2017/11/21 00:46:31 tom Exp @
+  * @Id: curs_terminfo.3x,v 1.72 2021/01/02 23:50:04 tom Exp @
+  * ***************************************************************************
+  * ***************************************************************************
   * ***************************************************************************
   * ***************************************************************************
   * ***************************************************************************
@@ -39,7 +42,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
 <meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
 <TITLE>curs_terminfo 3x</TITLE>
-<link rev=made href="mailto:bug-ncurses@gnu.org">
+<link rel="author" href="mailto:bug-ncurses@gnu.org">
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 </HEAD>
 <BODY>
@@ -51,7 +54,7 @@
 
 
 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
-       <STRONG>del_curterm</STRONG>, <STRONG>mvcur</STRONG>, <STRONG>putp</STRONG>, <STRONG>restartterm</STRONG>, <STRONG>set_curterm</STRONG>, <STRONG>setterm</STRONG>, <STRONG>setupterm</STRONG>,
+       <STRONG>del_curterm</STRONG>, <STRONG>mvcur</STRONG>, <STRONG>putp</STRONG>, <STRONG>restartterm</STRONG>, <STRONG>set_curterm</STRONG>, <STRONG>setupterm</STRONG>,
        <STRONG>tigetflag</STRONG>, <STRONG>tigetnum</STRONG>, <STRONG>tigetstr</STRONG>, <STRONG>tiparm</STRONG>, <STRONG>tparm</STRONG>, <STRONG>tputs</STRONG>, <STRONG>vid_attr</STRONG>,
        <STRONG>vid_puts</STRONG>, <STRONG>vidattr</STRONG>, <STRONG>vidputs</STRONG> - <STRONG>curses</STRONG> interfaces to terminfo database
 
@@ -73,7 +76,6 @@
        <STRONG>const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>const</STRONG> <STRONG>strfnames[];</STRONG>
 
        <STRONG>int</STRONG> <STRONG>setupterm(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>term</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>filedes</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <STRONG>*</STRONG><EM>errret</EM><STRONG>);</STRONG>
-       <STRONG>int</STRONG> <STRONG>setterm(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>term</EM><STRONG>);</STRONG>
        <STRONG>TERMINAL</STRONG> <STRONG>*set_curterm(TERMINAL</STRONG> <STRONG>*</STRONG><EM>nterm</EM><STRONG>);</STRONG>
        <STRONG>int</STRONG> <STRONG>del_curterm(TERMINAL</STRONG> <STRONG>*</STRONG><EM>oterm</EM><STRONG>);</STRONG>
        <STRONG>int</STRONG> <STRONG>restartterm(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>term</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>filedes</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <STRONG>*</STRONG><EM>errret</EM><STRONG>);</STRONG>
        ities, such as programming function keys.  For all other functionality,
        <STRONG>curses</STRONG> routines are more suitable and their use is recommended.
 
+       None of these functions use  (or  are  aware  of)  multibyte  character
+       strings such as UTF-8:
+
+       <STRONG>o</STRONG>   capability names use the POSIX portable character set
+
+       <STRONG>o</STRONG>   capability  string  values  have  no  associated encoding; they are
+           strings of 8-bit characters.
+
 
 </PRE><H3><a name="h3-Initialization">Initialization</a></H3><PRE>
        Initially, <STRONG>setupterm</STRONG> should be called.  The high-level curses functions
            used.
 
        Parameterized strings should be passed  through  <STRONG>tparm</STRONG>  to  instantiate
-       them.   All  <STRONG>terminfo</STRONG> strings [including the output of <STRONG>tparm</STRONG>] should be
+       them.   All  <STRONG>terminfo</STRONG> strings (including the output of <STRONG>tparm</STRONG>) should be
        printed with <STRONG>tputs</STRONG> or <STRONG>putp</STRONG>.  Call <STRONG>reset_shell_mode</STRONG> to restore  the  tty
        modes before exiting [see <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>].
 
 
                which uses all the defaults and sends the output to <STRONG>stdout</STRONG>.
 
-       The <STRONG>setterm</STRONG> routine was replaced by <STRONG>setupterm</STRONG>.  The call:
-
-             <STRONG>setupterm(</STRONG><EM>term</EM><STRONG>,</STRONG> <STRONG>1,</STRONG> <STRONG>(int</STRONG> <STRONG>*)0)</STRONG>
-
-       provides the same functionality as <STRONG>setterm(</STRONG><EM>term</EM><STRONG>)</STRONG>.  The <STRONG>setterm</STRONG>  routine
-       is  provided for BSD compatibility, and is not recommended for new pro-
-       grams.
-
 
 </PRE><H3><a name="h3-The-Terminal-State">The Terminal State</a></H3><PRE>
        The <STRONG>setupterm</STRONG> routine stores its information about the  terminal  in  a
        The  <STRONG>tputs</STRONG>  routine  applies  padding information to the string <EM>str</EM> and
        outputs it:
 
-       <STRONG>o</STRONG>   The <EM>str</EM> must be a terminfo string variable or the return value from
-           <STRONG>tparm</STRONG>, <STRONG>tgetstr</STRONG>, or <STRONG>tgoto</STRONG>.
+       <STRONG>o</STRONG>   The <EM>str</EM> parameter must be a terminfo string variable or the  return
+           value from <STRONG>tparm</STRONG>, <STRONG>tiparm</STRONG>, <STRONG>tgetstr</STRONG>, or <STRONG>tgoto</STRONG>.
+
+           The  <STRONG>tgetstr</STRONG> and <STRONG>tgoto</STRONG> functions are part of the <EM>termcap</EM> interface,
+           which happens to share this function name with the <EM>terminfo</EM>  inter-
+           face.
 
        <STRONG>o</STRONG>   <EM>affcnt</EM> is the number of lines affected, or 1 if not applicable.
 
        The  <STRONG>mvcur</STRONG>  routine  provides low-level cursor motion.  It takes effect
        immediately (rather than at the next refresh).
 
+       While <STRONG>putp</STRONG> and <STRONG>mvcur</STRONG> are low-level functions which do not use the high-
+       level curses state, they are declared in <STRONG>&lt;curses.h&gt;</STRONG> because SystemV did
+       this (see <STRONG>HISTORY</STRONG>).
+
 
 </PRE><H3><a name="h3-Terminal-Capability-Functions">Terminal Capability Functions</a></H3><PRE>
        The <STRONG>tigetflag</STRONG>, <STRONG>tigetnum</STRONG> and <STRONG>tigetstr</STRONG> routines return the value  of  the
 
        <STRONG>o</STRONG>   the short terminfo names ("codes"),
 
-       <STRONG>o</STRONG>   the <STRONG>termcap</STRONG> names ("names", and
+       <STRONG>o</STRONG>   the <STRONG>termcap</STRONG> names ("names"), and
 
        <STRONG>o</STRONG>   the long terminfo names ("fnames")
 
                value of the output function <EM>putc</EM>.
 
 
+</PRE><H3><a name="h3-Compatibility-macros">Compatibility macros</a></H3><PRE>
+       This implementation provides a few macros for compatibility  with  sys-
+       tems  before  SVr4  (see  <STRONG>HISTORY</STRONG>).   Those  include  <STRONG>crmode</STRONG>,  <STRONG>fixterm</STRONG>,
+       <STRONG>gettmode</STRONG>, <STRONG>nocrmode</STRONG>, <STRONG>resetterm</STRONG>, <STRONG>saveterm</STRONG>, and <STRONG>setterm</STRONG>.
+
+       In SVr4, those are found in <STRONG>&lt;curses.h&gt;</STRONG>, but  except  for  <STRONG>setterm</STRONG>,  are
+       likewise macros.  The one function, <STRONG>setterm</STRONG>, is mentioned in the manual
+       page.  The manual page notes that the <STRONG>setterm</STRONG> routine was  replaced  by
+       <STRONG>setupterm</STRONG>, stating that the call:
+
+             <STRONG>setupterm(</STRONG><EM>term</EM><STRONG>,</STRONG> <STRONG>1,</STRONG> <STRONG>(int</STRONG> <STRONG>*)0)</STRONG>
+
+       provides the same functionality as <STRONG>setterm(</STRONG><EM>term</EM><STRONG>)</STRONG>, and is not recommend-
+       ed for new programs.  This implementation provides each of  those  sym-
+       bols as macros for BSD compatibility,
+
+
+</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
+       SVr2 introduced the terminfo feature.  Its programming manual mentioned
+       these low-level functions:
+
+       <STRONG>Function</STRONG>    <STRONG>Description</STRONG>
+       ------------------------------------------------------------
+
+       fixterm     restore tty to "in curses" state
+       gettmode    establish current tty modes
+       mvcur       low level cursor motion
+       putp        utility function that uses <STRONG>tputs</STRONG> to send  char-
+                   acters via <STRONG>putchar</STRONG>.
+       resetterm   set tty modes to "out of curses" state
+       resetty     reset tty flags to stored value
+       saveterm    save current modes as "in curses" state
+       savetty     store current tty flags
+       setterm     establish terminal with given type
+       setupterm   establish terminal with given type
+       tparm       instantiate a string expression with parameters
+       tputs       apply padding information to a string
+       vidattr     like <STRONG>vidputs</STRONG>, but outputs through <STRONG>putchar</STRONG>
+       vidputs     output  a string to put terminal in a specified
+                   video attribute mode
+
+       The programming manual also mentioned functions  provided  for  termcap
+       compatibility (commenting that they "may go away at a later date"):
+
+       <STRONG>Function</STRONG>   <STRONG>Description</STRONG>
+       ------------------------------------------------
+       tgetent    look up termcap entry for given <EM>name</EM>
+       tgetflag   get boolean entry for given <EM>id</EM>
+       tgetnum    get numeric entry for given <EM>id</EM>
+       tgetstr    get string entry for given <EM>id</EM>
+       tgoto      apply parameters to given capability
+       tputs      apply padding to capability, calling
+                  a function to put characters
+
+       Early terminfo programs obtained capability values  from  the  <STRONG>TERMINAL</STRONG>
+       structure initialized by <STRONG>setupterm</STRONG>.
+
+       SVr3  extended terminfo by adding functions to retrieve capability val-
+       ues (like the termcap interface), and reusing tgoto and tputs:
+
+       <STRONG>Function</STRONG>    <STRONG>Description</STRONG>
+       -------------------------------------------
+       tigetflag   get boolean entry for given <EM>id</EM>
+       tigetnum    get numeric entry for given <EM>id</EM>
+       tigetstr    get string entry for given <EM>id</EM>
+
+       SVr3 also replaced several of the SVr2 terminfo functions which had  no
+       counterpart in the termcap interface, documenting them as obsolete:
+
+       <STRONG>Function</STRONG>    <STRONG>Replaced</STRONG> <STRONG>by</STRONG>
+       -----------------------------
+       crmode      cbreak
+       fixterm     reset_prog_mode
+       gettmode    N/A
+       nocrmode    nocbreak
+       resetterm   reset_shell_mode
+       saveterm    def_prog_mode
+       setterm     setupterm
+
+       SVr3  kept  the  <STRONG>mvcur</STRONG>, <STRONG>vidattr</STRONG> and <STRONG>vidputs</STRONG> functions, along with <STRONG>putp</STRONG>,
+       <STRONG>tparm</STRONG> and <STRONG>tputs</STRONG>.  The latter were needed to support padding,  and  han-
+       dling  functions  such as <STRONG>vidattr</STRONG> (which used more than the two parame-
+       ters supported by <STRONG>tgoto</STRONG>).
+
+       SVr3 introduced the functions for switching between  terminal  descrip-
+       tions,  e.g.,  <STRONG>set_curterm</STRONG>.  The various global variables such as <STRONG>bool-</STRONG>
+       <STRONG>names</STRONG> were mentioned in the programming manual at this point.
+
+       SVr4 added the <STRONG>vid_attr</STRONG> and <STRONG>vid_puts</STRONG> functions.
+
+       There are other low-level functions declared in the curses header files
+       on Unix systems, but none were documented.  The functions marked "obso-
+       lete" remained in use by the Unix <STRONG>vi</STRONG> editor.
+
+
 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
 
 </PRE><H3><a name="h3-Legacy-functions">Legacy functions</a></H3><PRE>
 <li><a href="#h3-Terminal-Capability-Names">Terminal Capability Names</a></li>
 </ul>
 </li>
-<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
+<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a>
+<ul>
+<li><a href="#h3-Compatibility-macros">Compatibility macros</a></li>
+</ul>
+</li>
+<li><a href="#h2-HISTORY">HISTORY</a></li>
 <li><a href="#h2-PORTABILITY">PORTABILITY</a>
 <ul>
 <li><a href="#h3-Legacy-functions">Legacy functions</a></li>