Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Implement ncurses is_pad(3).



details:   https://anonhg.NetBSD.org/src/rev/048aacd19c7b
branches:  trunk
changeset: 820284:048aacd19c7b
user:      roy <roy%NetBSD.org@localhost>
date:      Thu Jan 05 23:15:43 2017 +0000

description:
Implement ncurses is_pad(3).
Correct documentation about is_keypad(3).

diffstat:

 distrib/sets/lists/comp/mi   |   7 +++++--
 lib/libcurses/Makefile       |   6 +++---
 lib/libcurses/curses.h       |   3 ++-
 lib/libcurses/curses_input.3 |  19 ++++++++++++++++---
 lib/libcurses/curses_pad.3   |  14 ++++++++------
 lib/libcurses/newwin.c       |  15 +++++++++++++--
 6 files changed, 47 insertions(+), 17 deletions(-)

diffs (217 lines):

diff -r d72560508019 -r 048aacd19c7b distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Thu Jan 05 22:51:15 2017 +0000
+++ b/distrib/sets/lists/comp/mi        Thu Jan 05 23:15:43 2017 +0000
@@ -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
diff -r d72560508019 -r 048aacd19c7b lib/libcurses/Makefile
--- a/lib/libcurses/Makefile    Thu Jan 05 22:51:15 2017 +0000
+++ b/lib/libcurses/Makefile    Thu Jan 05 23:15:43 2017 +0000
@@ -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 @@
         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 \
diff -r d72560508019 -r 048aacd19c7b lib/libcurses/curses.h
--- a/lib/libcurses/curses.h    Thu Jan 05 22:51:15 2017 +0000
+++ b/lib/libcurses/curses.h    Thu Jan 05 23:15:43 2017 +0000
@@ -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 @@
 /* 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);
diff -r d72560508019 -r 048aacd19c7b lib/libcurses/curses_input.3
--- a/lib/libcurses/curses_input.3      Thu Jan 05 22:51:15 2017 +0000
+++ b/lib/libcurses/curses_input.3      Thu Jan 05 23:15:43 2017 +0000
@@ -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 (blymn%NetBSD.org@localhost, brett_lymn%yahoo.com.au@localhost)
@@ -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 @@
 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 @@
 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 .
-
diff -r d72560508019 -r 048aacd19c7b lib/libcurses/curses_pad.3
--- a/lib/libcurses/curses_pad.3        Thu Jan 05 22:51:15 2017 +0000
+++ b/lib/libcurses/curses_pad.3        Thu Jan 05 23:15:43 2017 +0000
@@ -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 @@
 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 @@
 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
diff -r d72560508019 -r 048aacd19c7b lib/libcurses/newwin.c
--- a/lib/libcurses/newwin.c    Thu Jan 05 22:51:15 2017 +0000
+++ b/lib/libcurses/newwin.c    Thu Jan 05 23:15:43 2017 +0000
@@ -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 @@
                        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;
+}



Home | Main Index | Thread Index | Old Index