summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-01-17 16:27:39 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-01-17 16:27:39 +0000
commitfc75df79b339ce5f679b6cdb5395378328fd8510 (patch)
tree6e79365e27ab3167f64f5e6b6a7767a06ba19580 /lib
parent5af16d68f427511a7d63fc23f6e315c81674d436 (diff)
Use _ti_get_screensize() from libtermlib to update screen size if changed
after a program is suspended. Define EXTERN_TERMINFO in curses.h. Update to ncurses-4.1-980103 and crank minor.
Diffstat (limited to 'lib')
-rw-r--r--lib/libcurses/Makefile6
-rw-r--r--lib/libcurses/curses.h9
-rw-r--r--lib/libcurses/curses.priv.h41
-rw-r--r--lib/libcurses/lib_doupdate.c9
-rw-r--r--lib/libcurses/lib_getch.c8
-rw-r--r--lib/libcurses/lib_mouse.c6
-rw-r--r--lib/libcurses/lib_newterm.c12
-rw-r--r--lib/libcurses/lib_options.c4
-rw-r--r--lib/libcurses/lib_overlay.c8
-rw-r--r--lib/libcurses/lib_raw.c37
-rw-r--r--lib/libcurses/lib_refresh.c12
-rw-r--r--lib/libcurses/lib_screen.c4
-rw-r--r--lib/libcurses/lib_set_term.c6
-rw-r--r--lib/libcurses/lib_tstp.c8
-rw-r--r--lib/libcurses/ncurses_cfg.h20
-rw-r--r--lib/libcurses/screensize.c54
-rw-r--r--lib/libcurses/shlib_version2
-rw-r--r--lib/libcurses/tries.c11
18 files changed, 192 insertions, 65 deletions
diff --git a/lib/libcurses/Makefile b/lib/libcurses/Makefile
index d132ddfe40c..1f19ffc483a 100644
--- a/lib/libcurses/Makefile
+++ b/lib/libcurses/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.20 1997/12/17 19:35:31 millert Exp $
+# $OpenBSD: Makefile,v 1.21 1998/01/17 16:27:30 millert Exp $
# Uncomment this to enable tracing in libcurses
#CURSESTRACE=-DTRACE
@@ -19,14 +19,14 @@ SRCS= define_key.c hardscroll.c hashmap.c keyok.c lib_acs.c lib_addch.c \
lib_slkinit.c lib_slklab.c lib_slkrefr.c lib_slkset.c lib_slktouch.c \
lib_touch.c lib_tstp.c lib_twait.c lib_ungetch.c lib_vidattr.c \
lib_vline.c lib_wattroff.c lib_wattron.c lib_window.c nc_panel.c \
- resizeterm.c safe_sprintf.c softscroll.c tries.c unctrl.c \
+ resizeterm.c safe_sprintf.c screensize.c softscroll.c tries.c unctrl.c \
wresize.c
SRCS+= expanded.c lib_gen.c lib_keyname.c
.if defined(${CURSESTRACE})
SRCS+= lib_trace.c lib_traceatr.c lib_tracechr.c lib_tracedmp.c \
lib_tracemse.c trace_buf.c
.endif
-CFLAGS+= -I. -I${.CURDIR} -DTERMIOS -DEXTERN_TERMINFO ${CURSESTRACE}
+CFLAGS+= -I. -I${.CURDIR} -DTERMIOS ${CURSESTRACE}
LDADD+= -ltermlib
MAN= curs_addch.3 curs_addchstr.3 curs_addstr.3 curs_attr.3 curs_beep.3 \
curs_bkgd.3 curs_border.3 curs_clear.3 curs_color.3 curs_delch.3 \
diff --git a/lib/libcurses/curses.h b/lib/libcurses/curses.h
index 8d1a6b08c36..9cab1d29ec4 100644
--- a/lib/libcurses/curses.h
+++ b/lib/libcurses/curses.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: curses.h,v 1.6 1997/12/14 23:15:44 millert Exp $ */
+/* $OpenBSD: curses.h,v 1.7 1998/01/17 16:27:31 millert Exp $ */
/***************************************************************************
* COPYRIGHT NOTICE *
@@ -28,6 +28,10 @@
#define CURSES 1
#define CURSES_H 1
+#ifdef __OpenBSD__
+#define EXTERN_TERMINFO
+#endif
+
/* This should be defined for the enhanced functionality to be visible.
* However, none of the wide-character (enhanced) functionality is implemented.
* So we do not define it (yet).
@@ -37,7 +41,7 @@
/* These are defined only in curses.h, and are used for conditional compiles */
#define NCURSES_VERSION_MAJOR 4
#define NCURSES_VERSION_MINOR 1
-#define NCURSES_VERSION_PATCH 971213
+#define NCURSES_VERSION_PATCH 980103
/* This is defined in more than one ncurses header, for identification */
#undef NCURSES_VERSION
@@ -717,6 +721,7 @@ extern int unget_wch(const wchar_t *); /* missing */
#endif /* _XOPEN_SOURCE_EXTENDED */
extern int untouchwin(WINDOW *); /* generated */
#ifndef EXTERN_TERMINFO
+extern void use_env(bool); /* implemented */
extern int vidattr(chtype); /* implemented */
#endif
extern int vid_attr(attr_t); /* generated:WIDEC */
diff --git a/lib/libcurses/curses.priv.h b/lib/libcurses/curses.priv.h
index 05f719db8b8..19101201df2 100644
--- a/lib/libcurses/curses.priv.h
+++ b/lib/libcurses/curses.priv.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: curses.priv.h,v 1.4 1997/12/06 19:11:03 millert Exp $ */
+/* $OpenBSD: curses.priv.h,v 1.5 1998/01/17 16:27:32 millert Exp $ */
/***************************************************************************
@@ -23,7 +23,7 @@
/*
- * Id: curses.priv.h,v 1.93 1997/11/01 23:01:54 tom Exp $
+ * Id: curses.priv.h,v 1.97 1998/01/03 19:57:54 tom Exp $
*
* curses.priv.h
*
@@ -103,6 +103,20 @@ extern int errno;
#define DEFAULT_MAXCLICK 166
/*
+ * If we don't have signals to support it, don't add a sigwinch handler.
+ * In any case, resizing is an extended feature. Use it if we've got it.
+ */
+#ifndef NCURSES_EXT_FUNCS
+#undef HAVE_SIZECHANGE
+#endif
+
+#if HAVE_SIZECHANGE
+#define USE_SIZECHANGE 1
+#else
+#undef USE_SIGWINCH
+#endif
+
+/*
* As currently coded, hashmap relies on the scroll-hints logic.
*/
#if !USE_SCROLL_HINTS
@@ -267,6 +281,7 @@ struct screen {
int _carriage_return_length;
int _cursor_home_length;
int _cursor_to_ll_length;
+ int _scrolling; /* 1 if terminal's smart enough to */
/* used in lib_color.c */
color_t *_color_table; /* screen's color palette */
@@ -304,7 +319,9 @@ struct screen {
/*
* This supports automatic resizing
*/
+#if USE_SIZECHANGE
int (*_resize)(int,int);
+#endif
/*
* These are data that support the proper handling of the panel stack on an
@@ -537,9 +554,6 @@ extern void _nc_expanded(void);
#endif
-/* comp_scan.c */
-extern char _nc_trans_string(char *); /* used by 'tack' program */
-
/* doupdate.c */
#if USE_XMC_SUPPORT
extern void _nc_do_xmc_glitch(attr_t);
@@ -593,9 +607,9 @@ extern char *_nc_trace_buf(int, size_t);
extern chtype _nc_background(WINDOW *);
extern chtype _nc_render(WINDOW *, chtype);
extern int _nc_keypad(bool);
-#ifdef EXTERN_TERMINFO
-#define _nc_outch _ti_outc
-#endif
+#ifdef EXTERN_TERMINFO
+#define _nc_outch _ti_outc
+#endif
extern int _nc_outch(int);
extern int _nc_setupscreen(short, short const, FILE *);
extern int _nc_timed_wait(int, int, int *);
@@ -611,7 +625,8 @@ extern void _nc_scroll_window(WINDOW *, int const, short const, short const, cht
extern void _nc_set_buffer(FILE *ofp, bool buffered);
extern void _nc_signal_handler(bool);
extern void _nc_synchook(WINDOW *win);
-#ifndef EXTERN_TERMINFO
+
+#if USE_SIZECHANGE
extern void _nc_update_screensize(void);
#endif
@@ -644,10 +659,10 @@ extern int _nc_usleep(unsigned int);
* ncurses' terminfo defines these but since we use our own terminfo
* we need to fake it here.
*/
-#ifdef EXTERN_TERMINFO
+#ifdef EXTERN_TERMINFO
#define _nc_get_curterm(buf) tcgetattr(cur_term->Filedes, buf)
#define _nc_set_curterm(buf) tcsetattr(cur_term->Filedes, TCSADRAIN, buf)
-#endif
+#endif
/*
* We don't want to use the lines or columns capabilities internally,
@@ -661,8 +676,8 @@ extern int _nc_usleep(unsigned int);
extern int _nc_slk_format; /* != 0 if slk_init() called */
extern int _nc_slk_initialize(WINDOW *, int);
-/*
- * Some constants related to SLK's
+/*
+ * Some constants related to SLK's
*/
#define MAX_SKEY_OLD 8 /* count of soft keys */
#define MAX_SKEY_LEN_OLD 8 /* max length of soft key text */
diff --git a/lib/libcurses/lib_doupdate.c b/lib/libcurses/lib_doupdate.c
index b62efe5cd62..d48ceb2f7f9 100644
--- a/lib/libcurses/lib_doupdate.c
+++ b/lib/libcurses/lib_doupdate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_doupdate.c,v 1.4 1997/12/03 05:21:16 millert Exp $ */
+/* $OpenBSD: lib_doupdate.c,v 1.5 1998/01/17 16:27:32 millert Exp $ */
/***************************************************************************
* COPYRIGHT NOTICE *
@@ -58,7 +58,7 @@
#include <term.h>
-MODULE_ID("Id: lib_doupdate.c,v 1.93 1997/11/15 22:48:57 tom Exp $")
+MODULE_ID("Id: lib_doupdate.c,v 1.95 1997/12/27 23:43:53 tom Exp $")
/*
* This define controls the line-breakout optimization. Every once in a
@@ -482,7 +482,7 @@ struct tms before, after;
if (SP->_fifohold)
SP->_fifohold--;
-#ifndef EXTERN_TERMINFO
+#if USE_SIZECHANGE
if (SP->_endwin || SP->_sig_winch)
{
/*
@@ -683,6 +683,8 @@ struct tms before, after;
goto cleanup;
nonempty = min(screen_lines, newscr->_maxy+1);
+
+ if (!SP->_scrolling) {
#if USE_HASHMAP /* still 5% slower 960928 */
#if defined(TRACE) || defined(NCURSES_TEST)
if (_nc_optimize_enable & OPTIMIZE_HASHMAP)
@@ -699,6 +701,7 @@ struct tms before, after;
#else
_nc_perform_scroll();
#endif
+ }
nonempty = ClrBottom(nonempty);
diff --git a/lib/libcurses/lib_getch.c b/lib/libcurses/lib_getch.c
index 94513092d1a..6178563f3eb 100644
--- a/lib/libcurses/lib_getch.c
+++ b/lib/libcurses/lib_getch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_getch.c,v 1.4 1997/12/06 19:11:04 millert Exp $ */
+/* $OpenBSD: lib_getch.c,v 1.5 1998/01/17 16:27:33 millert Exp $ */
/***************************************************************************
@@ -30,7 +30,7 @@
#include <curses.priv.h>
-MODULE_ID("Id: lib_getch.c,v 1.37 1997/11/30 00:37:38 tom Exp $")
+MODULE_ID("Id: lib_getch.c,v 1.38 1997/12/20 22:22:57 tom Exp $")
#include <fifo_defs.h>
@@ -241,11 +241,10 @@ int ch;
if (ch == ERR)
{
+#if USE_SIZECHANGE
if(SP->_sig_winch)
{
-#ifndef EXTERN_TERMINFO
_nc_update_screensize();
-#endif
/* resizeterm can push KEY_RESIZE */
if(cooked_key_in_fifo())
{
@@ -254,6 +253,7 @@ int ch;
returnCode(ch);
}
}
+#endif
T(("wgetch returning ERR"));
returnCode(ERR);
}
diff --git a/lib/libcurses/lib_mouse.c b/lib/libcurses/lib_mouse.c
index 1076b1bd78c..d528b2c1cbc 100644
--- a/lib/libcurses/lib_mouse.c
+++ b/lib/libcurses/lib_mouse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_mouse.c,v 1.3 1997/12/03 05:21:23 millert Exp $ */
+/* $OpenBSD: lib_mouse.c,v 1.4 1998/01/17 16:27:33 millert Exp $ */
/***************************************************************************
@@ -63,7 +63,7 @@
#endif
#endif
-MODULE_ID("Id: lib_mouse.c,v 0.31 1997/10/11 22:40:49 tom Exp $")
+MODULE_ID("Id: lib_mouse.c,v 0.32 1997/12/20 22:30:42 tom Exp $")
#define MY_TRACE TRACE_ICALLS|TRACE_IEVENT
@@ -321,7 +321,9 @@ static void mouse_activate(bool on)
_nc_mouse_init();
if (mousetype == M_XTERM)
{
+#ifdef NCURSES_EXT_FUNCS
keyok(KEY_MOUSE, on);
+#endif
if (on)
{
TPUTS_TRACE("xterm mouse initialization");
diff --git a/lib/libcurses/lib_newterm.c b/lib/libcurses/lib_newterm.c
index a1076190e60..4c00a4ecd12 100644
--- a/lib/libcurses/lib_newterm.c
+++ b/lib/libcurses/lib_newterm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_newterm.c,v 1.3 1997/12/03 05:21:25 millert Exp $ */
+/* $OpenBSD: lib_newterm.c,v 1.4 1998/01/17 16:27:34 millert Exp $ */
/***************************************************************************
@@ -38,7 +38,7 @@
#include <term.h> /* clear_screen, cup & friends, cur_term */
-MODULE_ID("Id: lib_newterm.c,v 1.30 1997/11/08 17:32:31 tom Exp $")
+MODULE_ID("Id: lib_newterm.c,v 1.31 1997/12/28 00:36:51 tom Exp $")
#ifndef ONLCR /* Allows compilation under the QNX 4.2 OS */
#define ONLCR 0
@@ -177,6 +177,14 @@ char *t = getenv("NCURSES_TRACE");
#endif
SP->_endwin = FALSE;
+ /* Check whether we can optimize scrolling under dumb terminals in case
+ * we do not have any of these capabilities, scrolling optimization
+ * will be useless.
+ */
+ SP->_scrolling = ((scroll_forward && scroll_reverse) ||
+ ((parm_rindex || parm_insert_line || insert_line) &&
+ (parm_index || parm_delete_line || delete_line)));
+
baudrate(); /* sets a field in the SP structure */
/* compute movement costs so we can do better move optimization */
diff --git a/lib/libcurses/lib_options.c b/lib/libcurses/lib_options.c
index 7af726649ad..53408b37918 100644
--- a/lib/libcurses/lib_options.c
+++ b/lib/libcurses/lib_options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_options.c,v 1.3 1997/12/03 05:21:26 millert Exp $ */
+/* $OpenBSD: lib_options.c,v 1.4 1998/01/17 16:27:34 millert Exp $ */
/***************************************************************************
@@ -34,7 +34,7 @@
#include <term.h> /* keypad_xmit, keypad_local, meta_on, meta_off */
/* cursor_visible,cursor_normal,cursor_invisible */
-MODULE_ID("Id: lib_options.c,v 1.22 1997/05/01 23:46:18 Alexander.V.Lukyanov Exp $")
+MODULE_ID("Id: lib_options.c,v 1.26 1997/09/20 15:02:34 juergen Exp $")
static void add_to_try(char *, short);
diff --git a/lib/libcurses/lib_overlay.c b/lib/libcurses/lib_overlay.c
index 991e84147d1..fd08c4e5b63 100644
--- a/lib/libcurses/lib_overlay.c
+++ b/lib/libcurses/lib_overlay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_overlay.c,v 1.4 1997/12/14 23:15:47 millert Exp $ */
+/* $OpenBSD: lib_overlay.c,v 1.5 1998/01/17 16:27:35 millert Exp $ */
/***************************************************************************
@@ -31,7 +31,7 @@
#include <curses.priv.h>
-MODULE_ID("Id: lib_overlay.c,v 1.10 1997/12/03 15:47:41 Alexander.V.Lukyanov Exp $")
+MODULE_ID("Id: lib_overlay.c,v 1.11 1997/12/19 17:04:06 xtang Exp $")
static int overlap(const WINDOW *const s, WINDOW *const d, int const flag)
{
@@ -40,6 +40,10 @@ int sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol;
T(("overlap : sby %d, sbx %d, smy %d, smx %d, dby %d, dbx %d, dmy %d, dmx %d",
s->_begy, s->_begx, s->_maxy, s->_maxx,
d->_begy, d->_begx, d->_maxy, d->_maxx));
+
+ if (!s || !d)
+ returnCode(ERR);
+
sminrow = max(s->_begy, d->_begy) - s->_begy;
smincol = max(s->_begx, d->_begx) - s->_begx;
dminrow = max(s->_begy, d->_begy) - d->_begy;
diff --git a/lib/libcurses/lib_raw.c b/lib/libcurses/lib_raw.c
index 204d3424227..e52eb4c6bc1 100644
--- a/lib/libcurses/lib_raw.c
+++ b/lib/libcurses/lib_raw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_raw.c,v 1.3 1997/12/03 05:21:27 millert Exp $ */
+/* $OpenBSD: lib_raw.c,v 1.4 1998/01/17 16:27:35 millert Exp $ */
/***************************************************************************
@@ -43,7 +43,7 @@
#include <curses.priv.h>
#include <term.h> /* cur_term */
-MODULE_ID("Id: lib_raw.c,v 1.21 1997/11/01 19:05:35 tom Exp $")
+MODULE_ID("Id: lib_raw.c,v 1.22 1998/01/03 21:59:22 tom Exp $")
#if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE)
#define _POSIX_SOURCE
@@ -53,6 +53,11 @@ MODULE_ID("Id: lib_raw.c,v 1.21 1997/11/01 19:05:35 tom Exp $")
#include <sys/termio.h> /* needed for ISC */
#endif
+#ifdef __EMX__
+#include <io.h>
+#include <fcntl.h>
+#endif
+
/* may be undefined if we're using termio.h */
#ifndef TOSTOP
#define TOSTOP 0
@@ -233,6 +238,10 @@ int raw(void)
SP->_raw = TRUE;
SP->_cbreak = TRUE;
+#ifdef __EMX__
+ setmode(SP->_ifd, O_BINARY);
+#endif
+
#ifdef TERMIOS
BEFORE("raw");
cur_term->Nttyb.c_lflag &= ~(ICANON|ISIG);
@@ -252,6 +261,10 @@ int cbreak(void)
SP->_cbreak = TRUE;
+#ifdef __EMX__
+ setmode(SP->_ifd, O_BINARY);
+#endif
+
#ifdef TERMIOS
BEFORE("cbreak");
cur_term->Nttyb.c_lflag &= ~ICANON;
@@ -282,6 +295,11 @@ int nl(void)
SP->_nl = TRUE;
+#ifdef __EMX__
+ fflush(SP->_ofp);
+ _fsetmode(SP->_ofp, "t");
+#endif
+
returnCode(OK);
}
@@ -313,6 +331,10 @@ int noraw(void)
SP->_raw = FALSE;
SP->_cbreak = FALSE;
+#ifdef __EMX__
+ setmode(SP->_ifd, O_TEXT);
+#endif
+
#ifdef TERMIOS
BEFORE("noraw");
cur_term->Nttyb.c_lflag |= ISIG|ICANON;
@@ -329,7 +351,11 @@ int nocbreak(void)
{
T((T_CALLED("nocbreak()")));
- SP->_cbreak = 0;
+ SP->_cbreak = FALSE;
+
+#ifdef __EMX__
+ setmode(SP->_ifd, O_TEXT);
+#endif
#ifdef TERMIOS
BEFORE("nocbreak");
@@ -356,6 +382,11 @@ int nonl(void)
SP->_nl = FALSE;
+#ifdef __EMX__
+ fflush(SP->_ofp);
+ _fsetmode(SP->_ofp, "b");
+#endif
+
returnCode(OK);
}
diff --git a/lib/libcurses/lib_refresh.c b/lib/libcurses/lib_refresh.c
index 65c32f7d7e9..577f9b2ffc9 100644
--- a/lib/libcurses/lib_refresh.c
+++ b/lib/libcurses/lib_refresh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_refresh.c,v 1.3 1997/12/03 05:21:28 millert Exp $ */
+/* $OpenBSD: lib_refresh.c,v 1.4 1998/01/17 16:27:35 millert Exp $ */
/***************************************************************************
@@ -32,7 +32,7 @@
#include <curses.priv.h>
-MODULE_ID("Id: lib_refresh.c,v 1.17 1997/11/29 19:54:29 tom Exp $")
+MODULE_ID("Id: lib_refresh.c,v 1.18 1997/12/19 17:04:06 xtang Exp $")
int wrefresh(WINDOW *win)
{
@@ -61,8 +61,8 @@ int code;
int wnoutrefresh(WINDOW *win)
{
short i, j;
-short begx = win->_begx;
-short begy = win->_begy;
+short begx;
+short begy;
short m, n;
bool wide;
@@ -79,6 +79,10 @@ bool wide;
|| (win->_flags & _ISPAD))
returnCode(ERR);
+ /* put them here so "win == 0" won't break our code */
+ begx = win->_begx;
+ begy = win->_begy;
+
/*
* If 'newscr' has a different background than the window that we're
* trying to refresh, we'll have to copy the whole thing.
diff --git a/lib/libcurses/lib_screen.c b/lib/libcurses/lib_screen.c
index a152f5b6174..d605e88c4a5 100644
--- a/lib/libcurses/lib_screen.c
+++ b/lib/libcurses/lib_screen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_screen.c,v 1.3 1997/12/03 05:21:29 millert Exp $ */
+/* $OpenBSD: lib_screen.c,v 1.4 1998/01/17 16:27:36 millert Exp $ */
/***************************************************************************
@@ -28,7 +28,7 @@
#include <time.h>
#include <term.h> /* exit_ca_mode, non_rev_rmcup */
-MODULE_ID("Id: lib_screen.c,v 1.9 1997/10/18 19:22:52 tom Exp $")
+MODULE_ID("Id: lib_screen.c,v 1.10 1997/12/27 19:48:58 tom Exp $")
static time_t dumptime;
diff --git a/lib/libcurses/lib_set_term.c b/lib/libcurses/lib_set_term.c
index 5735154f86d..6ad2d1f2216 100644
--- a/lib/libcurses/lib_set_term.c
+++ b/lib/libcurses/lib_set_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_set_term.c,v 1.4 1997/12/03 05:21:31 millert Exp $ */
+/* $OpenBSD: lib_set_term.c,v 1.5 1998/01/17 16:27:36 millert Exp $ */
/***************************************************************************
@@ -34,7 +34,7 @@
#include <term.h> /* cur_term */
-MODULE_ID("Id: lib_set_term.c,v 1.35 1997/11/08 21:23:37 tom Exp $")
+MODULE_ID("Id: lib_set_term.c,v 1.36 1997/12/20 22:21:48 tom Exp $")
/*
* If the output file descriptor is connected to a tty (the typical case) it
@@ -277,7 +277,9 @@ size_t i;
SP->_newscr = newscr;
SP->_curscr = curscr;
+#if USE_SIZECHANGE
SP->_resize = resizeterm;
+#endif
newscr->_clear = TRUE;
curscr->_clear = FALSE;
diff --git a/lib/libcurses/lib_tstp.c b/lib/libcurses/lib_tstp.c
index 454555ce305..651cb408c45 100644
--- a/lib/libcurses/lib_tstp.c
+++ b/lib/libcurses/lib_tstp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_tstp.c,v 1.5 1997/12/03 05:21:38 millert Exp $ */
+/* $OpenBSD: lib_tstp.c,v 1.6 1998/01/17 16:27:37 millert Exp $ */
/***************************************************************************
@@ -43,11 +43,7 @@ typedef struct sigaction sigaction_t;
#define _POSIX_SOURCE
#endif
-#ifndef SIGWINCH
-#undef USE_SIGWINCH /* FIXME: configure should resolve this */
-#endif
-
-MODULE_ID("Id: lib_tstp.c,v 1.13 1997/11/01 19:05:13 tom Exp $")
+MODULE_ID("Id: lib_tstp.c,v 1.14 1997/12/20 22:07:59 tom Exp $")
/*
* Note: This code is fragile! Its problem is that different OSs
diff --git a/lib/libcurses/ncurses_cfg.h b/lib/libcurses/ncurses_cfg.h
index a386240cae4..861f6cb2a0c 100644
--- a/lib/libcurses/ncurses_cfg.h
+++ b/lib/libcurses/ncurses_cfg.h
@@ -1,13 +1,8 @@
-/* $OpenBSD: ncurses_cfg.h,v 1.2 1997/12/03 05:21:42 millert Exp $ */
-
-/* generated by configure-script
- * On host: OpenBSD xerxes.courtesan.com 2.2 XERXES#13 i386
- */
-#ifndef NC_CONFIG_H
-#define NC_CONFIG_H
+/* $OpenBSD: ncurses_cfg.h,v 1.3 1998/01/17 16:27:37 millert Exp $ */
+/* include/ncurses_cfg.h. Generated automatically by configure. */
/******************************************************************************
- * Copyright 1995 by Thomas E. Dickey <dickey@clark.net> *
+ * Copyright 1997 by Thomas E. Dickey <dickey@clark.net> *
* All Rights Reserved. *
* *
* Permission to use, copy, modify, and distribute this software and its *
@@ -26,11 +21,16 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *
******************************************************************************/
/*
+ * Id: ncurses_cfg.hin,v 1.1 1997/12/24 12:26:32 tom Exp $
+ *
* This is a template-file used to generate the "ncurses_cfg.h" file.
*
* Rather than list every definition, the configuration script substitutes
- * the definitions that it finds using 'sed'.
+ * the definitions that it finds using 'sed'. You need a patch (971222)
+ * to autoconf 2.12 to do this.
*/
+#ifndef NC_CONFIG_H
+#define NC_CONFIG_H
#define CC_HAS_INLINE_FUNCS 1
#define GCC_NORETURN __attribute__((noreturn))
@@ -44,6 +44,7 @@
#define HAVE_GETTIMEOFDAY 1
#define HAVE_GETTTYNAM 1
#define HAVE_LIMITS_H 1
+#define HAVE_LINK 1
#define HAVE_LOCALE_H 1
#define HAVE_LONG_FILE_NAMES 1
#define HAVE_MEMCCPY 1
@@ -76,6 +77,7 @@
#define HAVE_USLEEP 1
#define HAVE_VSNPRINTF 1
#define HAVE_VSSCANF 1
+#define NCURSES_EXT_FUNCS 1
#define NDEBUG 1
#define PURE_TERMINFO 1
#define RETSIGTYPE void
diff --git a/lib/libcurses/screensize.c b/lib/libcurses/screensize.c
new file mode 100644
index 00000000000..e840f4b1e39
--- /dev/null
+++ b/lib/libcurses/screensize.c
@@ -0,0 +1,54 @@
+/* $OpenBSD: screensize.c,v 1.1 1998/01/17 16:27:38 millert Exp $ */
+
+/***************************************************************************
+* COPYRIGHT NOTICE *
+****************************************************************************
+* ncurses is copyright (C) 1992-1995 *
+* Zeyd M. Ben-Halim *
+* zmbenhal@netcom.com *
+* Eric S. Raymond *
+* esr@snark.thyrsus.com *
+* *
+* Permission is hereby granted to reproduce and distribute ncurses *
+* by any means and for any fee, whether alone or as part of a *
+* larger distribution, in source or in binary form, PROVIDED *
+* this notice is included with any such distribution, and is not *
+* removed from any of its header files. Mention of ncurses in any *
+* applications linked with it is highly appreciated. *
+* *
+* ncurses comes AS IS with no warranty, implied or expressed. *
+* *
+***************************************************************************/
+
+
+#include <curses.priv.h>
+
+#if defined(SVR4_TERMIO) && !defined(_POSIX_SOURCE)
+#define _POSIX_SOURCE
+#endif
+
+#include <term.h> /* lines, columns, cur_term */
+
+#ifdef EXTERN_TERMINFO
+void _ti_get_screensize(int *, int *, int *);
+#endif
+
+/****************************************************************************
+ *
+ * Terminal size computation
+ *
+ ****************************************************************************/
+
+#if USE_SIZECHANGE
+void _nc_update_screensize(void)
+{
+ int my_lines, my_cols;
+#ifdef EXTERN_TERMINFO
+ _ti_get_screensize(&my_lines, &my_cols, NULL);
+#else
+ _nc_get_screensize(&my_lines, &my_cols);
+#endif
+ if (SP != 0 && SP->_resize != 0)
+ SP->_resize(my_lines, my_cols);
+}
+#endif
diff --git a/lib/libcurses/shlib_version b/lib/libcurses/shlib_version
index 890c57389b5..f89dbabf714 100644
--- a/lib/libcurses/shlib_version
+++ b/lib/libcurses/shlib_version
@@ -1,2 +1,2 @@
major=4
-minor=1
+minor=2
diff --git a/lib/libcurses/tries.c b/lib/libcurses/tries.c
index a93e59fa983..92090efc5d4 100644
--- a/lib/libcurses/tries.c
+++ b/lib/libcurses/tries.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tries.c,v 1.1 1997/12/03 05:21:45 millert Exp $ */
+/* $OpenBSD: tries.c,v 1.2 1998/01/17 16:27:38 millert Exp $ */
/******************************************************************************
* Copyright 1997 by Thomas E. Dickey <dickey@clark.net> *
@@ -29,9 +29,10 @@
#include <curses.priv.h>
-MODULE_ID("Id: tries.c,v 1.5 1997/10/26 21:55:15 tom Exp $")
+MODULE_ID("Id: tries.c,v 1.6 1997/12/28 00:15:04 tom Exp $")
#define SET_TRY(dst,src) if ((dst->ch = *src++) == 128) dst->ch = '\0'
+#define CMP_TRY(a,b) ((a)? (a == b) : (b == 128))
void _nc_add_to_try(struct tries **tree, char *str, unsigned short code)
{
@@ -39,7 +40,7 @@ void _nc_add_to_try(struct tries **tree, char *str, unsigned short code)
struct tries *ptr, *savedptr;
unsigned char *txt = (unsigned char *)str;
- if (txt == 0 || out_of_memory || code == 0)
+ if (txt == 0 || *txt == '\0' || out_of_memory || code == 0)
return;
if ((*tree) != 0) {
@@ -48,11 +49,11 @@ void _nc_add_to_try(struct tries **tree, char *str, unsigned short code)
for (;;) {
unsigned char cmp = *txt;
- while (ptr->ch != cmp
+ while (!CMP_TRY(ptr->ch, cmp)
&& ptr->sibling != 0)
ptr = ptr->sibling;
- if (ptr->ch == cmp) {
+ if (CMP_TRY(ptr->ch, cmp)) {
if (*(++txt) == '\0') {
ptr->value = code;
return;