./progs/tput.c
./progs/transform.c
./progs/tset.c
+./progs/tty_settings.c
+./progs/tty_settings.h
./test/Makefile.in
./test/README
./test/aclocal.m4
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.2711 2016/12/17 23:41:02 tom Exp $
+-- $Id: NEWS,v 1.2715 2016/12/24 23:45:38 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20161224
+ + correct parmeters for copywin call in _nc_Synchronize_Attributes()
+ (patch by Leon Winter).
+ + improve color-handling section in terminfo manual page (prompted by
+ patch by Mihail Konev).
+ + modify programs clear, tput and tset to pass the actual tty file
+ descriptor to setupterm rather than the standard output, making
+ padding work.
+
20161217
+ add tput-colorcube demo script.
+ add -r and -s options to tput-initc demo, to match usage in xterm.
-5:0:9 6.0 20161217
+5:0:9 6.0 20161224
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.1137 2016/12/17 16:05:02 tom Exp $
+# $Id: dist.mk,v 1.1138 2016/12/24 13:45:15 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 6
NCURSES_MINOR = 0
-NCURSES_PATCH = 20161217
+NCURSES_PATCH = 20161224
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="tput.1.html">tput(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "form_" for
detailed descriptions of the entry points.
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
http://invisible-island.net/ncurses/tctest.html
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "menu_" for
detailed descriptions of the entry points.
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
sonable optimization. This implementation is "new curses"
(ncurses) and is the approved replacement for 4.4BSD clas-
sic curses, which has been discontinued. This describes
- <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
The <STRONG>ncurses</STRONG> library emulates the curses library of System
V Release 4 UNIX, and XPG4 (X/Open Portability Guide)
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
****************************************************************************
* @Id: terminfo.head,v 1.22 2016/10/15 17:02:31 tom Exp @
* Head of terminfo man page ends here
- * @Id: terminfo.tail,v 1.74 2016/11/05 21:15:43 Alain.Williams Exp @
+ * @Id: terminfo.tail,v 1.75 2016/12/24 22:54:11 tom Exp @
* Beginning of terminfo.tail file
* This file is part of ncurses.
* See "terminfo.head" for copyright.
nals by giving a set of capabilities which they have, by
specifying how to perform screen operations, and by speci-
fying padding requirements and initialization sequences.
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
Entries in <EM>terminfo</EM> consist of a sequence of `,' separated
fields (embedded commas may be escaped with a backslash or
</PRE><H3><a name="h3-Color-Handling">Color Handling</a></H3><PRE>
- Most color terminals are either "Tektronix-like" or "HP-
- like". Tektronix-like terminals have a predefined set of
- N colors (where N usually 8), and can set character-cell
- foreground and background characters independently, mixing
- them into N * N color-pairs. On HP-like terminals, the
- use must set each color pair up separately (foreground and
- background are not independently settable). Up to M
- color-pairs may be set up from 2*M different colors.
- ANSI-compatible terminals are Tektronix-like.
+ The curses library functions <STRONG>init_pair</STRONG> and <STRONG>init_color</STRONG>
+ manipulate the <EM>color</EM> <EM>pairs</EM> and <EM>color</EM> <EM>values</EM> discussed in
+ this section (see <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG> for details on these and
+ related functions).
+
+ Most color terminals are either "Tektronix-like" or "HP-
+ like":
+
+ <STRONG>o</STRONG> Tektronix-like terminals have a predefined set of <EM>N</EM>
+ colors (where <EM>N</EM> is usually 8), and can set character-
+ cell foreground and background characters indepen-
+ dently, mixing them into <EM>N</EM> * <EM>N</EM> color-pairs.
+
+ <STRONG>o</STRONG> On HP-like terminals, the user must set each color
+ pair up separately (foreground and background are not
+ independently settable). Up to <EM>M</EM> color-pairs may be
+ set up from 2*<EM>M</EM> different colors. ANSI-compatible
+ terminals are Tektronix-like.
Some basic color capabilities are independent of the color
method. The numeric capabilities <STRONG>colors</STRONG> and <STRONG>pairs</STRONG> specify
- the maximum numbers of colors and color-pairs that can be
- displayed simultaneously. The <STRONG>op</STRONG> (original pair) string
- resets foreground and background colors to their default
- values for the terminal. The <STRONG>oc</STRONG> string resets all colors
- or color-pairs to their default values for the terminal.
- Some terminals (including many PC terminal emulators)
- erase screen areas with the current background color
- rather than the power-up default background; these should
+ the maximum numbers of colors and color-pairs that can be
+ displayed simultaneously. The <STRONG>op</STRONG> (original pair) string
+ resets foreground and background colors to their default
+ values for the terminal. The <STRONG>oc</STRONG> string resets all colors
+ or color-pairs to their default values for the terminal.
+ Some terminals (including many PC terminal emulators)
+ erase screen areas with the current background color
+ rather than the power-up default background; these should
have the boolean capability <STRONG>bce</STRONG>.
- To change the current foreground or background color on a
- Tektronix-type terminal, use <STRONG>setaf</STRONG> (set ANSI foreground)
- and <STRONG>setab</STRONG> (set ANSI background) or <STRONG>setf</STRONG> (set foreground)
- and <STRONG>setb</STRONG> (set background). These take one parameter, the
- color number. The SVr4 documentation describes only
- <STRONG>setaf</STRONG>/<STRONG>setab</STRONG>; the XPG4 draft says that "If the terminal
- supports ANSI escape sequences to set background and fore-
- ground, they should be coded as <STRONG>setaf</STRONG> and <STRONG>setab</STRONG>, respec-
- tively. If the terminal supports other escape sequences
- to set background and foreground, they should be coded as
- <STRONG>setf</STRONG> and <STRONG>setb</STRONG>, respectively. The <STRONG>vidputs</STRONG> function and the
- refresh functions use <STRONG>setaf</STRONG> and <STRONG>setab</STRONG> if they are
- defined."
+ While the curses library works with <EM>color</EM> <EM>pairs</EM> (reflect-
+ ing the inability of some devices to set foreground and
+ background colors independently), there are separate capa-
+ bilities for setting these features:
+
+ <STRONG>o</STRONG> To change the current foreground or background color
+ on a Tektronix-type terminal, use <STRONG>setaf</STRONG> (set ANSI
+ foreground) and <STRONG>setab</STRONG> (set ANSI background) or <STRONG>setf</STRONG>
+ (set foreground) and <STRONG>setb</STRONG> (set background). These
+ take one parameter, the color number. The SVr4 docu-
+ mentation describes only <STRONG>setaf</STRONG>/<STRONG>setab</STRONG>; the XPG4 draft
+ says that "If the terminal supports ANSI escape
+ sequences to set background and foreground, they
+ should be coded as <STRONG>setaf</STRONG> and <STRONG>setab</STRONG>, respectively.
+
+ <STRONG>o</STRONG> If the terminal supports other escape sequences to set
+ background and foreground, they should be coded as
+ <STRONG>setf</STRONG> and <STRONG>setb</STRONG>, respectively. The <STRONG>vidputs</STRONG> and the
+ <STRONG>refresh</STRONG> functions use the <STRONG>setaf</STRONG> and <STRONG>setab</STRONG> capabilities
+ if they are defined.
The <STRONG>setaf</STRONG>/<STRONG>setab</STRONG> and <STRONG>setf</STRONG>/<STRONG>setb</STRONG> capabilities take a single
numeric argument each. Argument values 0-7 of <STRONG>setaf</STRONG>/<STRONG>setab</STRONG>
On an HP-like terminal, use <STRONG>scp</STRONG> with a color-pair number
parameter to set which color pair is current.
- On a Tektronix-like terminal, the capability <STRONG>ccc</STRONG> may be
- present to indicate that colors can be modified. If so,
- the <STRONG>initc</STRONG> capability will take a color number (0 to <STRONG>colors</STRONG>
- - 1)and three more parameters which describe the color.
- These three parameters default to being interpreted as RGB
- (Red, Green, Blue) values. If the boolean capability <STRONG>hls</STRONG>
- is present, they are instead as HLS (Hue, Lightness, Satu-
- ration) indices. The ranges are terminal-dependent.
-
- On an HP-like terminal, <STRONG>initp</STRONG> may give a capability for
- changing a color-pair value. It will take seven parame-
- ters; a color-pair number (0 to <STRONG>max_pairs</STRONG> - 1), and two
- triples describing first background and then foreground
- colors. These parameters must be (Red, Green, Blue) or
- (Hue, Lightness, Saturation) depending on <STRONG>hls</STRONG>.
+ Some terminals allow the <EM>color</EM> <EM>values</EM> to be modified:
+
+ <STRONG>o</STRONG> On a Tektronix-like terminal, the capability <STRONG>ccc</STRONG> may
+ be present to indicate that colors can be modified.
+ If so, the <STRONG>initc</STRONG> capability will take a color number
+ (0 to <STRONG>colors</STRONG> - 1)and three more parameters which
+ describe the color. These three parameters default to
+ being interpreted as RGB (Red, Green, Blue) values.
+ If the boolean capability <STRONG>hls</STRONG> is present, they are
+ instead as HLS (Hue, Lightness, Saturation) indices.
+ The ranges are terminal-dependent.
+
+ <STRONG>o</STRONG> On an HP-like terminal, <STRONG>initp</STRONG> may give a capability
+ for changing a color-pair value. It will take seven
+ parameters; a color-pair number (0 to <STRONG>max_pairs</STRONG> - 1),
+ and two triples describing first background and then
+ foreground colors. These parameters must be (Red,
+ Green, Blue) or (Hue, Lightness, Saturation) depending
+ on <STRONG>hls</STRONG>.
On some color terminals, colors collide with highlights.
You can register these collisions with the <STRONG>ncv</STRONG> capability.
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
- <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG>printf(3)</STRONG>, <STRONG><A HREF="term.5.html">term(5)</A></STRONG>.
- <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>.
+ <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_color.3x.html">curs_color(3x)</A></STRONG>,
+ <STRONG>printf(3)</STRONG>, <STRONG><A HREF="term.5.html">term(5)</A></STRONG>. <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>.
</PRE><H2><a name="h2-AUTHORS">AUTHORS</a></H2><PRE>
<STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>, <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>,
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="term.5.html">term(5)</A></STRONG>. <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
<STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>,
<STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
<STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>, <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>,
<STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
<STRONG>csh(1)</STRONG>, <STRONG>sh(1)</STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>, <STRONG>tty(4)</STRONG>,
<STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>, <STRONG>ttys(5)</STRONG>, <STRONG>environ(7)</STRONG>
- This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161203).
+ This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20161224).
#include "form.priv.h"
-MODULE_ID("$Id: frm_driver.c,v 1.119 2016/10/29 22:30:10 tom Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.120 2016/12/24 22:28:28 Leon.Winter Exp $")
/*----------------------------------------------------------------------------
This is the core module of the form library. It contains the majority
copywin(form->w, formwin,
0, 0,
field->frow, field->fcol,
- field->rows - 1, field->cols - 1, 0);
+ field->frow + field->rows - 1,
+ field->fcol + field->cols - 1, 0);
wsyncup(formwin);
Buffer_To_Window(field, form->w);
SetStatus(field, _NEWTOP); /* fake refresh to paint all */
-.\" $Id: terminfo.tail,v 1.74 2016/11/05 21:15:43 Alain.Williams Exp $
+.\" $Id: terminfo.tail,v 1.75 2016/12/24 22:54:11 tom Exp $
.\" Beginning of terminfo.tail file
.\" This file is part of ncurses.
.\" See "terminfo.head" for copyright.
.PP
.SS Color Handling
.PP
-Most color terminals are either \*(``Tektronix-like\*('' or \*(``HP-like\*(''.
+The curses library functions \fBinit_pair\fP and \fBinit_color\fP
+manipulate the \fIcolor pairs\fP and \fIcolor values\fP discussed in this
+section
+(see \fBcurs_color\fP(3X) for details on these and related functions).
+.PP
+Most color terminals are either \*(``Tektronix-like\*('' or \*(``HP-like\*('':
+.bP
Tektronix-like
-terminals have a predefined set of N colors (where N usually 8), and can set
+terminals have a predefined set of \fIN\fP colors
+(where \fIN\fP is usually 8),
+and can set
character-cell foreground and background characters independently, mixing them
-into N\ *\ N color-pairs.
-On HP-like terminals, the use must set each color
+into \fIN\fP\ *\ \fIN\fP color-pairs.
+.bP
+On HP-like terminals, the user must set each color
pair up separately (foreground and background are not independently settable).
-Up to M color-pairs may be set up from 2*M different colors.
-ANSI-compatible
-terminals are Tektronix-like.
+Up to \fIM\fP color-pairs may be set up from 2*\fIM\fP different colors.
+ANSI-compatible terminals are Tektronix-like.
.PP
Some basic color capabilities are independent of the color method.
The numeric
than the power-up default background; these should have the boolean capability
\fBbce\fR.
.PP
+While the curses library works with \fIcolor pairs\fP
+(reflecting the inability of some devices to set foreground
+and background colors independently),
+there are separate capabilities for setting these features:
+.bP
To change the current foreground or background color on a Tektronix-type
terminal, use \fBsetaf\fR (set ANSI foreground) and \fBsetab\fR (set ANSI
background) or \fBsetf\fR (set foreground) and \fBsetb\fR (set background).
only \fBsetaf\fR/\fBsetab\fR; the XPG4 draft says that "If the terminal
supports ANSI escape sequences to set background and foreground, they should
be coded as \fBsetaf\fR and \fBsetab\fR, respectively.
+.bP
If the terminal
supports other escape sequences to set background and foreground, they should
be coded as \fBsetf\fR and \fBsetb\fR, respectively.
-The \fBvidputs\fR
-function and the refresh functions use \fBsetaf\fR and \fBsetab\fR if they are
-defined."
+The \fBvidputs\fR and the \fBrefresh\fP functions
+use the \fBsetaf\fR and \fBsetab\fR capabilities if they are defined.
.PP
The \fBsetaf\fR/\fBsetab\fR and \fBsetf\fR/\fBsetb\fR capabilities take a
single numeric argument each.
On an HP-like terminal, use \fBscp\fR with a color-pair number parameter to set
which color pair is current.
.PP
+Some terminals allow the \fIcolor values\fP to be modified:
+.bP
On a Tektronix-like terminal, the capability \fBccc\fR may be present to
indicate that colors can be modified.
If so, the \fBinitc\fR capability will
they are instead as HLS (Hue, Lightness, Saturation) indices.
The ranges are
terminal-dependent.
-.PP
+.bP
On an HP-like terminal, \fBinitp\fR may give a capability for changing a
color-pair value.
It will take seven parameters; a color-pair number (0 to
\fB@TIC@\fR(1M),
\fB@INFOCMP@\fR(1M),
\fBcurses\fR(3X),
+\fBcurs_color\fR(3X),
\fBprintf\fR(3),
\fBterm\fR(\*n).
\fBterm_variables\fR(3X).
/****************************************************************************
- * Copyright (c) 1998-2012,2014 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2014,2016 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 *
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_ttyflags.c,v 1.30 2014/04/26 18:47:20 juergen Exp $")
+MODULE_ID("$Id: lib_ttyflags.c,v 1.31 2016/12/24 21:41:24 tom Exp $")
NCURSES_EXPORT(int)
NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf)
{
+ TERMINAL *termp = TerminalOf(SP_PARM);
int result = OK;
- if (buf == 0 || SP_PARM == 0) {
+ if (buf == 0 || termp == 0) {
result = ERR;
} else {
- TERMINAL *termp = TerminalOf(SP_PARM);
- if (0 == termp) {
- result = ERR;
- } else {
#ifdef USE_TERM_DRIVER
+ if (SP_PARM != 0) {
result = CallDriver_2(SP_PARM, td_sgmode, FALSE, buf);
+ } else {
+ result = ERR;
+ }
#else
- for (;;) {
- if (GET_TTY(termp->Filedes, buf) != 0) {
- if (errno == EINTR)
- continue;
- result = ERR;
- }
- break;
+ for (;;) {
+ if (GET_TTY(termp->Filedes, buf) != 0) {
+ if (errno == EINTR)
+ continue;
+ result = ERR;
}
-#endif
+ break;
}
-
- if (result == ERR)
- memset(buf, 0, sizeof(*buf));
+#endif
TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s",
termp ? termp->Filedes : -1,
_nc_trace_ttymode(buf)));
}
+ if (result == ERR && buf != 0)
+ memset(buf, 0, sizeof(*buf));
+
return (result);
}
#include <curses.priv.h>
#define CUR ((TERMINAL*)TCB)->type.
#include <tic.h>
+#include <termcap.h> /* ospeed */
#if HAVE_NANOSLEEP
#include <time.h>
# endif
#endif
-MODULE_ID("$Id: tinfo_driver.c,v 1.41 2016/09/10 20:14:56 tom Exp $")
+MODULE_ID("$Id: tinfo_driver.c,v 1.43 2016/12/24 23:20:08 tom Exp $")
/*
* SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS,
return "tinfo";
}
+static void
+get_baudrate(TERMINAL * termp)
+{
+ int my_ospeed;
+ int result;
+ if (GET_TTY(termp->Filedes, &termp->Nttyb) == OK) {
+#ifdef TERMIOS
+ termp->Nttyb.c_oflag &= (unsigned) (~OFLAGS_TABS);
+#else
+ termp->Nttyb.sg_flags &= (unsigned) (~XTABS);
+#endif
+ }
+#ifdef USE_OLD_TTY
+ result = (int) cfgetospeed(&(termp->Nttyb));
+ my_ospeed = (NCURSES_OSPEED) _nc_ospeed(result);
+#else /* !USE_OLD_TTY */
+#ifdef TERMIOS
+ my_ospeed = (NCURSES_OSPEED) cfgetospeed(&(termp->Nttyb));
+#else
+ my_ospeed = (NCURSES_OSPEED) termp->Nttyb.sg_ospeed;
+#endif
+ result = _nc_baudrate(my_ospeed);
+#endif
+ termp->_baudrate = result;
+ ospeed = (NCURSES_OSPEED) my_ospeed;
+}
+
#undef SETUP_FAIL
#define SETUP_FAIL FALSE
if (command_character)
_nc_tinfo_cmdch(termp, *command_character);
+ /*
+ * If an application calls setupterm() rather than initscr() or
+ * newterm(), we will not have the def_prog_mode() call in
+ * _nc_setupscreen(). Do it now anyway, so we can initialize the
+ * baudrate.
+ */
+ if (sp == 0 && NC_ISATTY(termp->Filedes)) {
+ get_baudrate(termp);
+ }
+
if (generic_type) {
/*
* BSD 4.3's termcap contains mis-typed "gn" for wy99. Do a sanity
-ncurses6 (6.0+20161217) unstable; urgency=low
+ncurses6 (6.0+20161224) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Dec 2016 11:05:02 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 24 Dec 2016 08:45:15 -0500
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.0+20161217) unstable; urgency=low
+ncurses6 (6.0+20161224) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Dec 2016 11:05:02 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 24 Dec 2016 08:45:15 -0500
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.0+20161217) unstable; urgency=low
+ncurses6 (6.0+20161224) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Dec 2016 11:05:02 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 24 Dec 2016 08:45:15 -0500
ncurses6 (5.9-20120608) unstable; urgency=low
-; $Id: mingw-ncurses.nsi,v 1.189 2016/12/17 16:05:02 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.190 2016/12/24 13:45:15 tom Exp $\r
\r
; TODO add examples\r
; TODO bump ABI to 6\r
!define VERSION_MAJOR "6"\r
!define VERSION_MINOR "0"\r
!define VERSION_YYYY "2016"\r
-!define VERSION_MMDD "1217"\r
+!define VERSION_MMDD "1224"\r
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
\r
!define MY_ABI "5"\r
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 6.0
-Release: 20161217
+Release: 20161224
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.0
-Release: 20161217
+Release: 20161224
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
-# $Id: Makefile.in,v 1.99 2016/10/22 00:13:20 tom Exp $
+# $Id: Makefile.in,v 1.100 2016/12/24 17:35:01 tom Exp $
##############################################################################
# Copyright (c) 1998-2015,2016 Free Software Foundation, Inc. #
# #
DEPS_CLEAR = \
$(MODEL)/clear$o \
- $(MODEL)/clear_cmd$o
+ $(MODEL)/clear_cmd$o \
+ $(MODEL)/tty_settings$o
clear$x: $(DEPS_CLEAR) $(DEPS_CURSES)
@ECHO_LD@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_TINFO) -o $@
$(MODEL)/clear_cmd$o \
$(MODEL)/reset_cmd$o \
$(MODEL)/tparm_type$o \
- $(MODEL)/transform$o
+ $(MODEL)/transform$o \
+ $(MODEL)/tty_settings$o
tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h
@ECHO_LD@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_TINFO) -o $@
DEPS_TSET = \
$(MODEL)/tset$o \
$(MODEL)/reset_cmd$o \
- $(MODEL)/transform$o
+ $(MODEL)/transform$o \
+ $(MODEL)/tty_settings$o
tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h
@ECHO_LD@ $(LINK) $(DEPS_TSET) $(LDFLAGS_TINFO) -o $@
* clear.c -- clears the terminal's screen
*/
-#define USE_LIBTINFO 1
+#define USE_LIBTINFO
#include <clear_cmd.h>
+#include <tty_settings.h>
-MODULE_ID("$Id: clear.c,v 1.15 2016/10/23 00:36:36 tom Exp $")
+MODULE_ID("$Id: clear.c,v 1.17 2016/12/24 19:33:39 tom Exp $")
+
+const char *_nc_progname = "clear";
int
main(
int argc GCC_UNUSED,
char *argv[]GCC_UNUSED)
{
- setupterm((char *) 0, STDOUT_FILENO, (int *) 0);
+ TTY tty_settings;
+ int fd;
+
+ _nc_progname = _nc_rootname(argv[0]);
+
+ fd = save_tty_settings(&tty_settings);
+
+ setupterm((char *) 0, fd, (int *) 0);
ExitProgram((clear_cmd() == ERR)
? EXIT_FAILURE
-# $Id: modules,v 1.20 2016/10/21 23:15:41 tom Exp $
+# $Id: modules,v 1.21 2016/12/24 17:33:59 tom Exp $
# Program modules (some are in ncurses lib!)
##############################################################################
# Copyright (c) 1998-2014,2016 Free Software Foundation, Inc. #
#
@ base
-clear progs $(srcdir) $(HEADER_DEPS)
+clear progs $(srcdir) $(HEADER_DEPS) tty_settings.h
tic progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h $(srcdir)/tparm_type.h
toe progs $(srcdir) $(HEADER_DEPS) $(INCDIR)/hashed_db.h
clear_cmd progs $(srcdir) $(HEADER_DEPS) clear_cmd.h
dump_entry progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h ../include/parametrized.h $(INCDIR)/capdefaults.c termsort.c
infocmp progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h
-reset_cmd progs $(srcdir) $(HEADER_DEPS) reset_cmd.h
+reset_cmd progs $(srcdir) $(HEADER_DEPS) reset_cmd.h tty_settings.h
tabs progs $(srcdir) $(HEADER_DEPS)
tparm_type progs $(srcdir) $(HEADER_DEPS) $(srcdir)/tparm_type.h
-tput progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h $(srcdir)/tparm_type.h termsort.c reset_cmd.h
-tset progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h ../include/termcap.h reset_cmd.h
+tput progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h $(srcdir)/tparm_type.h termsort.c reset_cmd.h tty_settings.h
+tset progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h ../include/termcap.h reset_cmd.h tty_settings.h
transform progs $(srcdir) $(HEADER_DEPS) transform.h
+tty_settings progs $(srcdir) $(HEADER_DEPS) tty_settings.h
# vile:makemode
****************************************************************************/
#include <reset_cmd.h>
+#include <tty_settings.h>
#include <errno.h>
#include <stdio.h>
#include <sys/ptem.h>
#endif
-MODULE_ID("$Id: reset_cmd.c,v 1.9 2016/10/23 01:08:11 tom Exp $")
+MODULE_ID("$Id: reset_cmd.c,v 1.11 2016/12/24 23:20:57 tom Exp $")
/*
* SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS,
# endif
#endif
-static int my_fd;
static FILE *my_file;
-static TTY original_settings;
-static bool can_restore = FALSE;
static bool use_reset = FALSE; /* invoked as reset */
static bool use_init = FALSE; /* invoked as init */
/* NOTREACHED */
}
-static bool
-get_tty_settings(int fd, TTY * tty_settings)
-{
- bool success = TRUE;
- my_fd = fd;
- if (fd < 0 || GET_TTY(my_fd, tty_settings) < 0) {
- success = FALSE;
- }
- return success;
-}
-
static bool
cat_file(char *file)
{
* a child program dies in raw mode.
*/
void
-reset_tty_settings(TTY * tty_settings)
+reset_tty_settings(int fd, TTY * tty_settings)
{
-#ifdef TERMIOS
- tcgetattr(my_fd, tty_settings);
-#else
- stty(my_fd, tty_settings);
-#endif
+ GET_TTY(fd, tty_settings);
#ifdef TERMIOS
#if defined(VDISCARD) && defined(CDISCARD)
);
#endif
- SET_TTY(my_fd, tty_settings);
+ SET_TTY(fd, tty_settings);
}
/*
/* Output startup string. */
bool
-send_init_strings(TTY * old_settings)
+send_init_strings(int fd GCC_UNUSED, TTY * old_settings)
{
int i;
bool need_flush = FALSE;
if (old_settings != 0 &&
old_settings->c_oflag & (TAB3 | ONLCR | OCRNL | ONLRET)) {
old_settings->c_oflag &= (TAB3 | ONLCR | OCRNL | ONLRET);
- SET_TTY(my_fd, old_settings);
+ SET_TTY(fd, old_settings);
}
#endif
if (use_reset || use_init) {
show_tty_change(old_settings, new_settings, "Interrupt", VINTR, CINTR);
}
-/*
- * Open a file descriptor on the current terminal, to obtain its settings.
- * stderr is less likely to be redirected than stdout; try that first.
- */
-int
-save_tty_settings(TTY * tty_settings)
-{
- if (!get_tty_settings(STDERR_FILENO, tty_settings) &&
- !get_tty_settings(STDOUT_FILENO, tty_settings) &&
- !get_tty_settings(STDIN_FILENO, tty_settings) &&
- !get_tty_settings(open("/dev/tty", O_RDWR), tty_settings)) {
- failed("terminal attributes");
- }
- can_restore = TRUE;
- original_settings = *tty_settings;
- return my_fd;
-}
-
-void
-restore_tty_settings(void)
-{
- if (can_restore)
- SET_TTY(my_fd, &original_settings);
-}
-
-/* Set the modes if they've changed. */
-void
-update_tty_settings(TTY * old_settings, TTY * new_settings)
-{
- if (memcmp(new_settings, old_settings, sizeof(TTY))) {
- SET_TTY(my_fd, new_settings);
- }
-}
-
#if HAVE_SIZECHANGE
/*
* Set window size if not set already, but update our copy of the values if the
****************************************************************************/
/*
- * $Id: reset_cmd.h,v 1.6 2016/10/22 23:34:37 tom Exp $
+ * $Id: reset_cmd.h,v 1.7 2016/12/24 18:08:48 tom Exp $
*
* Utility functions for resetting terminal.
*/
#undef CTRL
#define CTRL(x) ((x) & 0x1f)
-extern bool send_init_strings(TTY * /* old_settings */);
-extern int save_tty_settings(TTY * /* tty_settings */);
+extern bool send_init_strings(int /* fd */, TTY * /* old_settings */);
extern void print_tty_chars(TTY * /* old_settings */, TTY * /* new_settings */);
extern void reset_flush(void);
extern void reset_start(FILE * /* fp */, bool /* is_reset */, bool /* is_init */ );
-extern void reset_tty_settings(TTY * /* tty_settings */);
-extern void restore_tty_settings(void);
+extern void reset_tty_settings(int /* fd */, TTY * /* tty_settings */);
extern void set_control_chars(TTY * /* tty_settings */, int /* erase */, int /* intr */, int /* kill */);
extern void set_conversions(TTY * /* tty_settings */);
-extern void update_tty_settings(TTY * /* old_settings */, TTY * /* new_settings */);
#if HAVE_SIZECHANGE
extern void set_window_size(int /* fd */, short * /* high */, short * /* wide */);
#include <termsort.c>
#endif
#include <transform.h>
+#include <tty_settings.h>
-MODULE_ID("$Id: tput.c,v 1.63 2016/10/23 01:08:28 tom Exp $")
+MODULE_ID("$Id: tput.c,v 1.65 2016/12/24 18:44:32 tom Exp $")
#define PUTS(s) fputs(s, stdout)
}
static int
-tput_cmd(int argc, char *argv[])
+tput_cmd(int fd, TTY * saved_settings, int argc, char *argv[])
{
NCURSES_CONST char *name;
char *s;
name = check_aliases(argv[0], FALSE);
if (is_reset || is_init) {
- TTY mode, oldmode;
+ TTY oldmode;
int terasechar = -1; /* new erase character */
int intrchar = -1; /* new interrupt character */
int tkillchar = -1; /* new kill character */
- int my_fd = save_tty_settings(&mode);
-
reset_start(stdout, is_reset, is_init);
- reset_tty_settings(&mode);
+ reset_tty_settings(fd, saved_settings);
#if HAVE_SIZECHANGE
- set_window_size(my_fd, &lines, &columns);
+ set_window_size(fd, &lines, &columns);
#else
- (void) my_fd;
+ (void) fd;
#endif
- set_control_chars(&mode, terasechar, intrchar, tkillchar);
- set_conversions(&mode);
- if (send_init_strings(&oldmode)) {
+ set_control_chars(saved_settings, terasechar, intrchar, tkillchar);
+ set_conversions(saved_settings);
+ if (send_init_strings(fd, &oldmode)) {
reset_flush();
}
- update_tty_settings(&oldmode, &mode);
+ update_tty_settings(&oldmode, saved_settings);
return 0;
}
int c;
char buf[BUFSIZ];
int result = 0;
+ int fd;
+ TTY tty_settings;
prg_name = check_aliases(_nc_rootname(argv[0]), TRUE);
if (term == 0 || *term == '\0')
quit(2, "No value for $TERM and no -T specified");
- if (setupterm(term, STDOUT_FILENO, &errret) != OK && errret <= 0)
+ fd = save_tty_settings(&tty_settings);
+
+ if (setupterm(term, fd, &errret) != OK && errret <= 0)
quit(3, "unknown terminal \"%s\"", term);
if (cmdline) {
if ((argc <= 0) && !(is_clear || is_reset || is_init))
usage();
- ExitProgram(tput_cmd(argc, argv));
+ ExitProgram(tput_cmd(fd, &tty_settings, argc, argv));
}
while (fgets(buf, sizeof(buf), stdin) != 0) {
argvec[argnum] = 0;
if (argnum != 0
- && tput_cmd(argnum, argvec) != 0) {
+ && tput_cmd(fd, &tty_settings, argnum, argvec) != 0) {
if (result == 0)
result = 4; /* will return value >4 */
++result;
#include <reset_cmd.h>
#include <termcap.h>
#include <transform.h>
+#include <tty_settings.h>
#if HAVE_GETTTYNAM && HAVE_TTYENT_H
#include <ttyent.h>
char *ttyname(int fd);
#endif
-MODULE_ID("$Id: tset.c,v 1.113 2016/10/22 23:34:47 tom Exp $")
+MODULE_ID("$Id: tset.c,v 1.115 2016/12/24 18:46:42 tom Exp $")
#ifndef environ
extern char **environ;
ttype = askuser(0);
}
/* Find the terminfo entry. If it doesn't exist, ask the user. */
- while (setupterm((NCURSES_CONST char *) ttype, STDOUT_FILENO, &errret)
+ while (setupterm((NCURSES_CONST char *) ttype, fd, &errret)
!= OK) {
if (errret == 0) {
(void) fprintf(stderr, "%s: unknown terminal type %s\n",
if (same_program(_nc_progname, PROG_RESET)) {
reset_start(stderr, TRUE, FALSE);
- reset_tty_settings(&mode);
+ reset_tty_settings(my_fd, &mode);
} else {
reset_start(stderr, FALSE, FALSE);
}
set_conversions(&mode);
if (!noinit) {
- if (send_init_strings(&oldmode)) {
+ if (send_init_strings(my_fd, &oldmode)) {
(void) putc('\r', stderr);
(void) fflush(stderr);
(void) napms(1000); /* Settle the terminal. */
--- /dev/null
+/****************************************************************************
+ * Copyright (c) 2016 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 *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Thomas E. Dickey *
+ ****************************************************************************/
+
+#define USE_LIBTINFO
+#include <tty_settings.h>
+
+#include <fcntl.h>
+
+MODULE_ID("$Id: tty_settings.c,v 1.2 2016/12/24 19:31:11 tom Exp $")
+
+static int my_fd;
+static TTY original_settings;
+static bool can_restore = FALSE;
+
+static void
+exit_error(void)
+{
+ restore_tty_settings();
+ (void) fprintf(stderr, "\n");
+ ExitProgram(EXIT_FAILURE);
+ /* NOTREACHED */
+}
+
+static void
+failed(const char *msg)
+{
+ char temp[BUFSIZ];
+
+ _nc_STRCPY(temp, _nc_progname, sizeof(temp));
+ _nc_STRCAT(temp, ": ", sizeof(temp));
+ _nc_STRNCAT(temp, msg, sizeof(temp), sizeof(temp) - strlen(temp) - 2);
+ perror(temp);
+ exit_error();
+ /* NOTREACHED */
+}
+
+static bool
+get_tty_settings(int fd, TTY * tty_settings)
+{
+ bool success = TRUE;
+ my_fd = fd;
+ if (fd < 0 || GET_TTY(my_fd, tty_settings) < 0) {
+ success = FALSE;
+ }
+ return success;
+}
+
+/*
+ * Open a file descriptor on the current terminal, to obtain its settings.
+ * stderr is less likely to be redirected than stdout; try that first.
+ */
+int
+save_tty_settings(TTY * tty_settings)
+{
+ if (!get_tty_settings(STDERR_FILENO, tty_settings) &&
+ !get_tty_settings(STDOUT_FILENO, tty_settings) &&
+ !get_tty_settings(STDIN_FILENO, tty_settings) &&
+ !get_tty_settings(open("/dev/tty", O_RDWR), tty_settings)) {
+ failed("terminal attributes");
+ }
+ can_restore = TRUE;
+ original_settings = *tty_settings;
+ return my_fd;
+}
+
+void
+restore_tty_settings(void)
+{
+ if (can_restore)
+ SET_TTY(my_fd, &original_settings);
+}
+
+/* Set the modes if they've changed. */
+void
+update_tty_settings(TTY * old_settings, TTY * new_settings)
+{
+ if (memcmp(new_settings, old_settings, sizeof(TTY))) {
+ SET_TTY(my_fd, new_settings);
+ }
+}
--- /dev/null
+/****************************************************************************
+ * Copyright (c) 2016 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 *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Thomas E Dickey *
+ ****************************************************************************/
+
+/*
+ * $Id: tty_settings.h,v 1.1 2016/12/24 18:17:44 tom Exp $
+ *
+ * Utility functions for saving/restoring terminal settings.
+ */
+#ifndef TTY_SETTINGS_H
+#define TTY_SETTINGS_H 1
+/* *INDENT-OFF* */
+
+#include <progs.priv.h>
+
+extern int save_tty_settings(TTY * /* tty_settings */ );
+extern void restore_tty_settings(void);
+extern void update_tty_settings(TTY * /* old_settings */, TTY * /* new_settings */ );
+
+/* *INDENT-ON* */
+
+#endif /* TTY_SETTINGS_H */