Module Name: src
Committed By: roy
Date: Thu Jan 5 23:15:43 UTC 2017
Modified Files:
src/distrib/sets/lists/comp: mi
src/lib/libcurses: Makefile curses.h curses_input.3 curses_pad.3
newwin.c
Log Message:
Implement ncurses is_pad(3).
Correct documentation about is_keypad(3).
To generate a diff of this commit:
cvs rdiff -u -r1.2097 -r1.2098 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.80 -r1.81 src/lib/libcurses/Makefile
cvs rdiff -u -r1.117 -r1.118 src/lib/libcurses/curses.h
cvs rdiff -u -r1.24 -r1.25 src/lib/libcurses/curses_input.3
cvs rdiff -u -r1.5 -r1.6 src/lib/libcurses/curses_pad.3
cvs rdiff -u -r1.48 -r1.49 src/lib/libcurses/newwin.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2097 src/distrib/sets/lists/comp/mi:1.2098
--- src/distrib/sets/lists/comp/mi:1.2097 Thu Jan 5 21:25:18 2017
+++ src/distrib/sets/lists/comp/mi Thu Jan 5 23:15:43 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.2097 2017/01/05 21:25:18 roy Exp $
+# $NetBSD: mi,v 1.2098 2017/01/05 23:15:43 roy Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
./etc/mtree/set.comp comp-sys-root
@@ -6878,6 +6878,7 @@
./usr/share/man/cat3/is_keypad.0 comp-c-catman .cat
./usr/share/man/cat3/is_leaveok.0 comp-c-catman .cat
./usr/share/man/cat3/is_linetouched.0 comp-c-catman .cat
+./usr/share/man/cat3/is_pad.0 comp-c-catman .cat
./usr/share/man/cat3/is_term_resized.0 comp-c-catman .cat
./usr/share/man/cat3/is_wintouched.0 comp-c-catman .cat
./usr/share/man/cat3/isalnum.0 comp-c-catman .cat
@@ -7071,7 +7072,7 @@
./usr/share/man/cat3/krb5_checksum.0 comp-krb5-catman kerberos,.cat
./usr/share/man/cat3/krb5_checksum_disable.0 comp-krb5-catman kerberos,.cat
./usr/share/man/cat3/krb5_checksum_is_collision_proof.0 comp-krb5-catman kerberos,.cat
-./usr/share/man/cat3/krb5_checksum_is_keyed.0 comp-krb5-catman kerberos,.cat
+./usr/share/man/cat3/krb5_checksum_ is_keyed.0 comp-krb5-catman kerberos,.cat
./usr/share/man/cat3/krb5_checksumsize.0 comp-krb5-catman kerberos,.cat
./usr/share/man/cat3/krb5_cksumtype_valid.0 comp-krb5-catman kerberos,.cat
./usr/share/man/cat3/krb5_clear_error_string.0 comp-obsolete obsolete
@@ -14232,6 +14233,7 @@
./usr/share/man/html3/is_keypad.html comp-c-htmlman html
./usr/share/man/html3/is_leaveok.html comp-c-htmlman html
./usr/share/man/html3/is_linetouched.html comp-c-htmlman html
+./usr/share/man/html3/is_pad.html comp-c-htmlman html
./usr/share/man/html3/is_term_resized.html comp-c-htmlman html
./usr/share/man/html3/is_wintouched.html comp-c-htmlman html
./usr/share/man/html3/isalnum.html comp-c-htmlman html
@@ -21503,6 +21505,7 @@
./usr/share/man/man3/is_keypad.3 comp-c-man .man
./usr/share/man/man3/is_leaveok.3 comp-c-man .man
./usr/share/man/man3/is_linetouched.3 comp-c-man .man
+./usr/share/man/man3/is_pad.3 comp-c-man .man
./usr/share/man/man3/is_term_resized.3 comp-c-man .man
./usr/share/man/man3/is_wintouched.3 comp-c-man .man
./usr/share/man/man3/isalnum.3 comp-c-man .man
Index: src/lib/libcurses/Makefile
diff -u src/lib/libcurses/Makefile:1.80 src/lib/libcurses/Makefile:1.81
--- src/lib/libcurses/Makefile:1.80 Thu Jan 5 21:25:17 2017
+++ src/lib/libcurses/Makefile Thu Jan 5 23:15:43 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.80 2017/01/05 21:25:17 roy Exp $
+# $NetBSD: Makefile,v 1.81 2017/01/05 23:15:43 roy Exp $
# @(#)Makefile 8.2 (Berkeley) 1/2/94
.include <bsd.own.mk>
@@ -101,9 +101,9 @@ MLINKS+= curses_addch.3 addch.3 curses_a
curses_insertch.3 insch.3 curses_insdelln.3 insdelln.3 \
curses_insertln.3 insertln.3 curses_inch.3 instr.3 \
curses_tty.3 intrflush.3 \
- curses_pad.3 is_keypad.3 \
+ curses_input.3 is_keypad.3 \
curses_refresh.3 is_leaveok.3 curses_touch.3 is_linetouched.3 \
- curses_screen.3 is_term_resized.3 \
+ curses_pad.3 is_pad.3 curses_screen.3 is_term_resized.3 \
curses_touch.3 is_wintouched.3 curses_screen.3 isendwin.3 \
curses_keyname.3 keyname.3 \
curses_input.3 keypad.3 curses_tty.3 killchar.3 \
Index: src/lib/libcurses/curses.h
diff -u src/lib/libcurses/curses.h:1.117 src/lib/libcurses/curses.h:1.118
--- src/lib/libcurses/curses.h:1.117 Thu Jan 5 21:25:18 2017
+++ src/lib/libcurses/curses.h Thu Jan 5 23:15:43 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: curses.h,v 1.117 2017/01/05 21:25:18 roy Exp $ */
+/* $NetBSD: curses.h,v 1.118 2017/01/05 23:15:43 roy Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -959,6 +959,7 @@ int wgetbkgrnd(WINDOW *, cchar_t *);
/* ncurses window tests */
bool is_keypad(const WINDOW *);
bool is_leaveok(const WINDOW *);
+bool is_pad(const WINDOW *);
/* Private functions that are needed for user programs prototypes. */
int __cputchar(int);
Index: src/lib/libcurses/curses_input.3
diff -u src/lib/libcurses/curses_input.3:1.24 src/lib/libcurses/curses_input.3:1.25
--- src/lib/libcurses/curses_input.3:1.24 Thu Jan 5 20:31:37 2017
+++ src/lib/libcurses/curses_input.3 Thu Jan 5 23:15:43 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: curses_input.3,v 1.24 2017/01/05 20:31:37 roy Exp $
+.\" $NetBSD: curses_input.3,v 1.25 2017/01/05 23:15:43 roy Exp $
.\"
.\" Copyright (c) 2002
.\" Brett Lymn ([email protected], [email protected])
@@ -51,6 +51,7 @@
.Nm mvgetstr ,
.Nm mvwgetstr ,
.Nm keypad ,
+.Nm is_keypad ,
.Nm notimeout ,
.Nm timeout ,
.Nm wtimeout ,
@@ -94,6 +95,8 @@
.Fn mvwgetstr "WINDOW *win" "int y" "int x" "char *str"
.Ft int
.Fn keypad "WINDOW *win" "boolf flag"
+.Ft bool
+.Fn is_keypad "const WINDOW *win"
.Ft int
.Fn notimeout "WINDOW *win" "boolf flag"
.Ft int
@@ -161,6 +164,15 @@ on a key symbol then
will behave as if the character sequence associated with that key symbol
was not recognised and will return the component characters one at a time to
the caller.
+The
+.Fn is_keypad
+function returns
+.Dv TRUE
+if the
+.Fn
+keypad
+flag is set for the window specified by
+.Fa win .
.Pp
The
.Fn has_key
@@ -603,9 +615,10 @@ Portable implementations should avoid th
The Curses package appeared in
.Bx 4.0 .
The
+.Fn is_keypad
+and
.Fn set_tabsize
-function is a
+functions are
.Em ncurses
extension to the Curses library and was added in
.Nx 8.0 .
-
Index: src/lib/libcurses/curses_pad.3
diff -u src/lib/libcurses/curses_pad.3:1.5 src/lib/libcurses/curses_pad.3:1.6
--- src/lib/libcurses/curses_pad.3:1.5 Sat Dec 31 13:50:16 2016
+++ src/lib/libcurses/curses_pad.3 Thu Jan 5 23:15:43 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: curses_pad.3,v 1.5 2016/12/31 13:50:16 roy Exp $
+.\" $NetBSD: curses_pad.3,v 1.6 2017/01/05 23:15:43 roy Exp $
.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
@@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd December 31, 2016
+.Dd January 5, 2016
.Dt CURSES_PAD 3
.Os
.Sh NAME
@@ -48,7 +48,7 @@
.Ft int
.Fn pnoutrefresh "WINDOW *pad" "int pbeg_y" "int pbeg_x" "int sbeg_y" "int sbeg_x" "int smax_y" "int smax_x"
.Ft bool
-.Fn is_keypad "const WINDOW *pad"
+.Fn is_pad "const WINDOW *pad"
.Sh DESCRIPTION
These functions create and display pads on the current screen.
.Pp
@@ -112,8 +112,10 @@ deferring the actual terminal updates un
to multiple pads has been done.
.Pp
The
-.Fn is_keypad
-function returns true if the given window is a pad, otherwise false.
+.Fn is_pad
+function returns true if the given window was created by
+.Fn newpad ,
+otherwise false.
.Sh RETURN VALUES
Functions returning pointers will return
.Dv NULL
@@ -147,7 +149,7 @@ Single Unix Specification.
The Curses package appeared in
.Bx 4.0 .
The
-.Fn is_keypad
+.Fn is_pad
function is a
.Em ncurses
extension to the Curses library and was added in
Index: src/lib/libcurses/newwin.c
diff -u src/lib/libcurses/newwin.c:1.48 src/lib/libcurses/newwin.c:1.49
--- src/lib/libcurses/newwin.c:1.48 Sun Oct 23 21:20:56 2016
+++ src/lib/libcurses/newwin.c Thu Jan 5 23:15:43 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: newwin.c,v 1.48 2016/10/23 21:20:56 christos Exp $ */
+/* $NetBSD: newwin.c,v 1.49 2017/01/05 23:15:43 roy Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)newwin.c 8.3 (Berkeley) 7/27/94";
#else
-__RCSID("$NetBSD: newwin.c,v 1.48 2016/10/23 21:20:56 christos Exp $");
+__RCSID("$NetBSD: newwin.c,v 1.49 2017/01/05 23:15:43 roy Exp $");
#endif
#endif /* not lint */
@@ -415,3 +415,14 @@ __swflags(WINDOW *win)
win->flags |= __SCROLLWIN;
}
}
+
+/*
+ * is_pad --
+ * Return true if window was created by newpad.
+ */
+bool
+is_pad(const WINDOW *win)
+{
+
+ return win->flags & __ISPAD ? true : false;
+}