<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!--
****************************************************************************
- * Copyright (c) 1999-2002,2003 Free Software Foundation, Inc. *
+ * Copyright (c) 1999-2006,2007 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 *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: curs_terminfo.3x,v 1.18 2003/12/27 18:48:59 tom Exp @
+ * @Id: curs_terminfo.3x,v 1.26 2007/02/24 16:37:50 tom Exp @
-->
<HTML>
<HEAD>
<HR>
<PRE>
<!-- Manpage converted by man2html 3.0.1 -->
-<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG> <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>
+<STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG> <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>
</PRE>
<H2>NAME</H2><PRE>
- <STRONG>del_curterm</STRONG>, <STRONG>mvcur</STRONG>, <STRONG>putp</STRONG>, <STRONG>restartterm</STRONG>, <STRONG>set_curterm</STRONG>, <STRONG>set-</STRONG>
- <STRONG>term</STRONG>, <STRONG>setupterm</STRONG>, <STRONG>tigetflag</STRONG>, <STRONG>tigetnum</STRONG>, <STRONG>tigetstr</STRONG>, <STRONG>tparm</STRONG>,
- <STRONG>tputs</STRONG>, <STRONG>vid_attr</STRONG>, <STRONG>vid_puts</STRONG>, <STRONG>vidattr</STRONG>, <STRONG>vidputs</STRONG> - <STRONG>curses</STRONG>
+ <STRONG>del_curterm</STRONG>, <STRONG>mvcur</STRONG>, <STRONG>putp</STRONG>, <STRONG>restartterm</STRONG>, <STRONG>set_curterm</STRONG>,
+ <STRONG>setterm</STRONG>, <STRONG>setupterm</STRONG>, <STRONG>tigetflag</STRONG>, <STRONG>tigetnum</STRONG>, <STRONG>tigetstr</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
<STRONG>int</STRONG> <STRONG>setterm(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>fildes</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <STRONG>*</STRONG><EM>errret</EM><STRONG>);</STRONG>
+ <STRONG>int</STRONG> <STRONG>restartterm(char</STRONG> <STRONG>*</STRONG><EM>term</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>fildes</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <STRONG>*</STRONG><EM>errret</EM><STRONG>);</STRONG>
<STRONG>char</STRONG> <STRONG>*tparm(char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>...);</STRONG>
<STRONG>int</STRONG> <STRONG>tputs(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>affcnt</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <STRONG>(*</STRONG><EM>putc</EM><STRONG>)(int));</STRONG>
<STRONG>int</STRONG> <STRONG>putp(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>str</EM><STRONG>);</STRONG>
tion keys. For all other functionality, <STRONG>curses</STRONG> routines
are more suitable and their use is recommended.
- Initially, <STRONG>setupterm</STRONG> should be called. Note that
- <STRONG>setupterm</STRONG> is automatically called by <STRONG>initscr</STRONG> and <STRONG>newterm</STRONG>.
+ Initially, <STRONG>setupterm</STRONG> should be called. Note that <STRONG>se-</STRONG>
+ <STRONG>tupterm</STRONG> is automatically called by <STRONG>initscr</STRONG> and <STRONG>newterm</STRONG>.
This defines the set of terminal-dependent variables
[listed in <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>]. The <STRONG>terminfo</STRONG> variables <STRONG>lines</STRONG> and
<STRONG>columns</STRONG> are initialized by <STRONG>setupterm</STRONG> as follows: If
strings [including the output of <STRONG>tparm</STRONG>] should be printed
with <STRONG>tputs</STRONG> or <STRONG>putp</STRONG>. Call the <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>]. Pro-
- grams which use cursor addressing should output
- <STRONG>enter_ca_mode</STRONG> upon startup and should output <STRONG>exit_ca_mode</STRONG>
+ grams which use cursor addressing should output <STRONG>en-</STRONG>
+ <STRONG>ter_ca_mode</STRONG> upon startup and should output <STRONG>exit_ca_mode</STRONG>
before exiting. Programs desiring shell escapes should
call
<STRONG>reset_shell_mode</STRONG> and output <STRONG>exit_ca_mode</STRONG> before the shell
- is called and should output <STRONG>enter_ca_mode</STRONG> and call
- <STRONG>reset_prog_mode</STRONG> after returning from the shell.
+ is called and should output <STRONG>enter_ca_mode</STRONG> and call <STRONG>re-</STRONG>
+ <STRONG>set_prog_mode</STRONG> after returning from the shell.
The <STRONG>setupterm</STRONG> routine reads in the <STRONG>terminfo</STRONG> database, ini-
tializing the <STRONG>terminfo</STRONG> structures, but does not set up the
the environment variable <STRONG>TERM</STRONG> is used. All output is to
file descriptor <STRONG>fildes</STRONG> which is initialized for output.
If <EM>errret</EM> is not null, then <STRONG>setupterm</STRONG> returns <STRONG>OK</STRONG> or <STRONG>ERR</STRONG>
- and stores a status value in the integer pointed to by
- <EM>errret</EM>. A return value of <STRONG>OK</STRONG> combined with status of <STRONG>1</STRONG> in
+ and stores a status value in the integer pointed to by <EM>er-</EM>
+ <EM>rret</EM>. A return value of <STRONG>OK</STRONG> combined with status of <STRONG>1</STRONG> in
<EM>errret</EM> is normal. If <STRONG>ERR</STRONG> is returned, examine <EM>errret</EM>:
<STRONG>1</STRONG> means that the terminal is hardcopy, cannot be
The <STRONG>del_curterm</STRONG> routine frees the space pointed to by
<EM>oterm</EM> and makes it available for further use. If <EM>oterm</EM> is
the same as <STRONG>cur_term</STRONG>, references to any of the <STRONG>terminfo</STRONG>
- boolean, numeric, and string variables thereafter may
- refer to invalid memory locations until another <STRONG>setupterm</STRONG>
+ boolean, numeric, and string variables thereafter may re-
+ fer to invalid memory locations until another <STRONG>setupterm</STRONG>
has been called.
The <STRONG>restartterm</STRONG> routine is similar to <STRONG>setupterm</STRONG> and
that argument.
The <STRONG>mvcur</STRONG> routine provides low-level cursor motion. It
- takes effect immediately (rather than at the next
- refresh).
+ takes effect immediately (rather than at the next re-
+ fresh).
The <STRONG>tigetflag</STRONG>, <STRONG>tigetnum</STRONG> and <STRONG>tigetstr</STRONG> routines return the
value of the capability corresponding to the <STRONG>terminfo</STRONG> <EM>cap-</EM>
from the terminal description.
The <STRONG>tigetnum</STRONG> routine returns the value <STRONG>-2</STRONG> if <EM>capname</EM> is
- not a numeric capability, or <STRONG>-1</STRONG> if it is canceled or
- absent from the terminal description.
+ not a numeric capability, or <STRONG>-1</STRONG> if it is canceled or ab-
+ sent from the terminal description.
The <STRONG>tigetstr</STRONG> routine returns the value <STRONG>(char</STRONG> <STRONG>*)-1</STRONG> if <EM>cap-</EM>
<EM>name</EM> is not a string capability, or <STRONG>0</STRONG> if it is canceled or
umn entitled <EM>capname</EM> code in the capabilities section of
<STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
- <STRONG>char</STRONG> <STRONG>*boolnames</STRONG>, <STRONG>*boolcodes</STRONG>, <STRONG>*boolfnames</STRONG>
+ <STRONG>char</STRONG> <STRONG>*boolnames[]</STRONG>, <STRONG>*boolcodes[]</STRONG>, <STRONG>*boolfnames[]</STRONG>
- <STRONG>char</STRONG> <STRONG>*numnames</STRONG>, <STRONG>*numcodes</STRONG>, <STRONG>*numfnames</STRONG>
+ <STRONG>char</STRONG> <STRONG>*numnames[]</STRONG>, <STRONG>*numcodes[]</STRONG>, <STRONG>*numfnames[]</STRONG>
- <STRONG>char</STRONG> <STRONG>*strnames</STRONG>, <STRONG>*strcodes</STRONG>, <STRONG>*strfnames</STRONG>
+ <STRONG>char</STRONG> <STRONG>*strnames[]</STRONG>, <STRONG>*strcodes[]</STRONG>, <STRONG>*strfnames[]</STRONG>
These null-terminated arrays contain the <EM>capnames</EM>, the
<STRONG>termcap</STRONG> codes, and the full C names, for each of the <STRONG>ter-</STRONG>
Routines that return pointers always return <STRONG>NULL</STRONG> on error.
+ X/Open defines no error conditions. In this implementa-
+ tion
+
+ <STRONG>del_curterm</STRONG>
+ returns an error if its terminal parameter is
+ null.
+
+ <STRONG>restartterm</STRONG>
+ returns an error if the associated call to <STRONG>se-</STRONG>
+ <STRONG>tupterm</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.
+
</PRE>
<H2>NOTES</H2><PRE>
a terminfo function, <STRONG>mvcur</STRONG> is really a curses function
which is not well specified.
+ XSI states that the old location must be given. This im-
+ plementation allows the caller to use -1's for the old or-
+ dinates. In that case, the old location is unknown.
+
+ Extended terminal capability names, e.g., as defined by
+ <STRONG>tic</STRONG> <STRONG>-x</STRONG>, are not stored in the arrays described in this
+ section.
+
</PRE>
<H2>SEE ALSO</H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>, <STRONG>curs_term-</STRONG>
- <STRONG><A HREF="curs_termcap.3x.html">cap(3x)</A></STRONG>, <STRONG><A HREF="putc.3S.html">putc(3S)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
+ <STRONG><A HREF="curs_termcap.3x.html">cap(3x)</A></STRONG>, <STRONG><A HREF="putc.3.html">putc(3)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>
+ <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>
</PRE>
<HR>
<ADDRESS>