- Routines that return an integer return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> (SVr4
- only specifies "an integer value other than <STRONG>ERR</STRONG>") upon successful
- completion, unless otherwise noted in the preceding routine
- descriptions.
-
- Routines that return pointers always return <STRONG>NULL</STRONG> on error.
-
- X/Open defines no error conditions. In this implementation
-
- <STRONG>del_curterm</STRONG>
- returns an error if its terminal parameter is null.
-
- <STRONG>putp</STRONG> calls <STRONG>tputs</STRONG>, returning the same error-codes.
-
- <STRONG>restartterm</STRONG>
- returns an error if the associated call to <STRONG>setupterm</STRONG> returns an
- error.
-
- <STRONG>setupterm</STRONG>
- returns an error if it cannot allocate enough memory, or create
- the initial windows (stdscr, curscr, newscr). Other error
- conditions are documented above.
-
- <STRONG>tparm</STRONG>
- returns a null if the capability would require unexpected
- parameters, e.g., too many, too few, or incorrect types
- (strings where integers are expected, or vice versa).
-
- <STRONG>tputs</STRONG>
- returns an error if the string parameter is null. It does not
- detect I/O errors: X/Open states that <STRONG>tputs</STRONG> ignores the return
- 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
- systems before SVr4 (see <EM>HISTORY</EM>). 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><curses.h></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
- recommended for new programs. This implementation provides each of
- those symbols as macros for BSD compatibility,
-
-
-</PRE><H2><a name="h2-HISTORY">HISTORY</a></H2><PRE>
- SVr2 introduced the terminfo feature. Its programming manual mentioned
- the following low-level functions.
-
- <STRONG>Function</STRONG> <STRONG>Description</STRONG>
- ------------------------------------------------------------------------
- <STRONG>fixterm</STRONG> restore tty to "in curses" state
- <STRONG>gettmode</STRONG> establish current tty modes
- <STRONG>mvcur</STRONG> low level cursor motion
- <STRONG>putp</STRONG> utility function that uses <STRONG>tputs</STRONG> to send characters via
- <STRONG>putchar</STRONG>.
- <STRONG>resetterm</STRONG> set tty modes to "out of curses" state
- <STRONG>resetty</STRONG> reset tty flags to stored value
- <STRONG>saveterm</STRONG> save current modes as "in curses" state
- <STRONG>savetty</STRONG> store current tty flags
- <STRONG>setterm</STRONG> establish terminal with given type
- <STRONG>setupterm</STRONG> establish terminal with given type
- <STRONG>tparm</STRONG> instantiate a string expression with parameters
- <STRONG>tputs</STRONG> apply padding information to a string
- <STRONG>vidattr</STRONG> like <STRONG>vidputs</STRONG>, but outputs through <STRONG>putchar</STRONG>
- <STRONG>vidputs</STRONG> output a string to put terminal in a specified video
- attribute mode
-
- The programming manual also mentioned functions provided for <EM>termcap</EM>
- compatibility (commenting that they "may go away at a later date").
-
- <STRONG>Function</STRONG> <STRONG>Description</STRONG>
- ------------------------------------------------------------------------
- <STRONG>tgetent</STRONG> look up <EM>termcap</EM> entry for given <EM>name</EM>
- <STRONG>tgetflag</STRONG> get boolean entry for given <EM>id</EM>
- <STRONG>tgetnum</STRONG> get numeric entry for given <EM>id</EM>
- <STRONG>tgetstr</STRONG> get string entry for given <EM>id</EM>
- <STRONG>tgoto</STRONG> apply parameters to given capability
- <STRONG>tputs</STRONG> apply padding to capability, calling a function to put
- characters