-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3645 2021/03/23 00:12:19 tom Exp $
+-- $Id: NEWS,v 1.3647 2021/03/27 23:40:15 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.
+20210327
+ + build-fixes for Solaris10 /bin/sh
+ + fix some cppcheck warnings, mostly style, in ncurses test-programs,
+ form and menu libraries.
+
20210323
+ add configure option --enable-stdnoreturn, making the _Noreturn
keyword optional to ease transition (prompted by report by
-5:0:10 6.2 20210323
+5:0:10 6.2 20210327
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.1406 2021/03/23 07:36:24 tom Exp $
+# $Id: dist.mk,v 1.1407 2021/03/27 09:43:25 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 = 2
-NCURSES_PATCH = 20210323
+NCURSES_PATCH = 20210327
# 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.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
</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.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
</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.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
<!--
****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 1999-2010,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* authorization. *
****************************************************************************
* Author: Thomas E. Dickey 1999-on
- * @Id: curs_extend.3x,v 1.24 2020/10/24 09:37:07 tom Exp @
+ * @Id: curs_extend.3x,v 1.26 2021/03/13 13:43:05 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
</PRE><H3><a name="h3-curses_version">curses_version</a></H3><PRE>
Use <STRONG>curses_version</STRONG> to get the version number, including patch level of
- the library, e.g., <STRONG>5.0.19991023</STRONG>
+ the library, prefixed by "ncurses", e.g.,
+
+ <STRONG>ncurses</STRONG> <STRONG>5.0.19991023</STRONG>
</PRE><H3><a name="h3-use_extended_names">use_extended_names</a></H3><PRE>
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: curs_terminfo.3x,v 1.72 2021/01/02 23:50:04 tom Exp @
+ * @Id: curs_terminfo.3x,v 1.74 2021/03/06 16:05:19 tom Exp @
* ***************************************************************************
* ***************************************************************************
* ***************************************************************************
<STRONG>o</STRONG> Aside from the <STRONG>set_attributes</STRONG> (<STRONG>sgr</STRONG>) capability, most terminal capa-
bilities require no more than one or two parameters.
+ <STRONG>o</STRONG> Padding information is ignored by <STRONG>tparm</STRONG>; it is interpreted by
+ <STRONG>tputs</STRONG>.
+
+ <STRONG>o</STRONG> The capability string is null-terminated. Use "\200" where an
+ ASCII NUL is needed in the output.
+
<STRONG>tiparm</STRONG> is a newer form of <STRONG>tparm</STRONG> which uses <EM><stdarg.h></EM> rather than a
fixed-parameter list. Its numeric parameters are integers (int) rather
than longs.
</PRE><H3><a name="h3-Output-Functions">Output Functions</a></H3><PRE>
- The <STRONG>tputs</STRONG> routine applies padding information to the string <EM>str</EM> and
- outputs it:
+ The <STRONG>tputs</STRONG> routine applies padding information (i.e., by interpreting
+ marker embedded in the terminfo capability such as "$<5>" as 5 mil-
+ liseconds) to the string <EM>str</EM> and outputs it:
- <STRONG>o</STRONG> The <EM>str</EM> parameter must be a terminfo string variable or the return
+ <STRONG>o</STRONG> The <EM>str</EM> parameter must be a terminfo string variable or the return
value from <STRONG>tparm</STRONG>, <STRONG>tiparm</STRONG>, <STRONG>tgetstr</STRONG>, or <STRONG>tgoto</STRONG>.
- The <STRONG>tgetstr</STRONG> and <STRONG>tgoto</STRONG> functions are part of the <EM>termcap</EM> interface,
- which happens to share this function name with the <EM>terminfo</EM> inter-
+ The <STRONG>tgetstr</STRONG> and <STRONG>tgoto</STRONG> functions are part of the <EM>termcap</EM> interface,
+ which happens to share this function name with the <EM>terminfo</EM> inter-
face.
<STRONG>o</STRONG> <EM>affcnt</EM> is the number of lines affected, or 1 if not applicable.
- <STRONG>o</STRONG> <EM>putc</EM> is a <STRONG>putchar</STRONG>-like routine to which the characters are passed,
+ <STRONG>o</STRONG> <EM>putc</EM> is a <STRONG>putchar</STRONG>-like routine to which the characters are passed,
one at a time.
- The <STRONG>putp</STRONG> routine calls <STRONG>tputs(</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>1,</STRONG> <STRONG>putchar)</STRONG>. The output of <STRONG>putp</STRONG> al-
+ The <STRONG>putp</STRONG> routine calls <STRONG>tputs(</STRONG><EM>str</EM><STRONG>,</STRONG> <STRONG>1,</STRONG> <STRONG>putchar)</STRONG>. The output of <STRONG>putp</STRONG> al-
ways goes to <STRONG>stdout</STRONG>, rather than the <EM>filedes</EM> specified in <STRONG>setupterm</STRONG>.
- The <STRONG>vidputs</STRONG> routine displays the string on the terminal in the video
+ The <STRONG>vidputs</STRONG> routine displays the string on the terminal in the video
attribute mode <EM>attrs</EM>, which is any combination of the attributes listed
- in <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>. The characters are passed to the <STRONG>putchar</STRONG>-like routine
+ in <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>. The characters are passed to the <STRONG>putchar</STRONG>-like routine
<EM>putc</EM>.
The <STRONG>vidattr</STRONG> routine is like the <STRONG>vidputs</STRONG> routine, except that it outputs
through <STRONG>putchar</STRONG>.
- The <STRONG>vid_attr</STRONG> and <STRONG>vid_puts</STRONG> routines correspond to vidattr and vidputs,
- respectively. They use a set of arguments for representing the video
+ The <STRONG>vid_attr</STRONG> and <STRONG>vid_puts</STRONG> routines correspond to vidattr and vidputs,
+ respectively. They use a set of arguments for representing the video
attributes plus color, i.e.,
<STRONG>o</STRONG> <EM>attrs</EM> of type <STRONG>attr_t</STRONG> for the attributes and
<STRONG>o</STRONG> <EM>pair</EM> of type <STRONG>short</STRONG> for the color-pair number.
- The <STRONG>vid_attr</STRONG> and <STRONG>vid_puts</STRONG> routines are designed to use the attribute
+ The <STRONG>vid_attr</STRONG> and <STRONG>vid_puts</STRONG> routines are designed to use the attribute
constants with the <EM>WA</EM><STRONG>_</STRONG> prefix.
- X/Open Curses reserves the <EM>opts</EM> argument for future use, saying that
- applications must provide a null pointer for that argument. As an ex-
- tension, this implementation allows <EM>opts</EM> to be used as a pointer to
+ X/Open Curses reserves the <EM>opts</EM> argument for future use, saying that
+ applications must provide a null pointer for that argument. As an ex-
+ tension, this implementation allows <EM>opts</EM> to be used as a pointer to
<STRONG>int</STRONG>, which overrides the <EM>pair</EM> (<STRONG>short</STRONG>) argument.
- The <STRONG>mvcur</STRONG> routine provides low-level cursor motion. It takes effect
+ The <STRONG>mvcur</STRONG> routine provides low-level cursor motion. It takes effect
immediately (rather than at the next refresh).
While <STRONG>putp</STRONG> and <STRONG>mvcur</STRONG> are low-level functions which do not use the high-
</PRE><H3><a name="h3-Terminal-Capability-Functions">Terminal Capability Functions</a></H3><PRE>
- 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>capname</EM> passed to them, such
- as <STRONG>xenl</STRONG>. The <EM>capname</EM> for each capability is given in the table column
+ 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>capname</EM> passed to them, such
+ as <STRONG>xenl</STRONG>. The <EM>capname</EM> for each capability is given in the table column
entitled <EM>capname</EM> code in the capabilities section of <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
These routines return special values to denote errors.
</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
- Routines that return an integer return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> (SVr4
- only specifies "an integer value other than <STRONG>ERR</STRONG>") upon successful com-
+ Routines that return an integer return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> (SVr4
+ only specifies "an integer value other than <STRONG>ERR</STRONG>") upon successful com-
pletion, unless otherwise noted in the preceding routine descriptions.
Routines that return pointers always return <STRONG>NULL</STRONG> on error.
ditions are documented above.
<STRONG>tputs</STRONG>
- returns an error if the string parameter is null. It does not
- detect I/O errors: X/Open states that <STRONG>tputs</STRONG> ignores the return
+ returns an error if the string parameter is null. It does not
+ detect I/O errors: X/Open states that <STRONG>tputs</STRONG> ignores the return
value of the output function <EM>putc</EM>.
</PRE><H3><a name="h3-Compatibility-macros">Compatibility macros</a></H3><PRE>
- This implementation provides a few macros for compatibility with sys-
+ This implementation provides a few macros for compatibility with sys-
tems before SVr4 (see <STRONG>HISTORY</STRONG>). Those include <STRONG>crmode</STRONG>, <STRONG>fixterm</STRONG>,
<STRONG>gettmode</STRONG>, <STRONG>nocrmode</STRONG>, <STRONG>resetterm</STRONG>, <STRONG>saveterm</STRONG>, and <STRONG>setterm</STRONG>.
- In SVr4, those are found in <STRONG><curses.h></STRONG>, but except for <STRONG>setterm</STRONG>, are
+ In SVr4, those are found in <STRONG><curses.h></STRONG>, but except for <STRONG>setterm</STRONG>, are
likewise macros. The one function, <STRONG>setterm</STRONG>, is mentioned in the manual
- page. The manual page notes that the <STRONG>setterm</STRONG> routine was replaced by
+ page. The manual page notes that the <STRONG>setterm</STRONG> routine was replaced by
<STRONG>setupterm</STRONG>, stating that the call:
<STRONG>setupterm(</STRONG><EM>term</EM><STRONG>,</STRONG> <STRONG>1,</STRONG> <STRONG>(int</STRONG> <STRONG>*)0)</STRONG>
provides the same functionality as <STRONG>setterm(</STRONG><EM>term</EM><STRONG>)</STRONG>, and is not recommend-
- ed for new programs. This implementation provides each of those sym-
+ ed for new programs. This implementation provides each of those sym-
bols as macros for BSD compatibility,
<STRONG>Function</STRONG> <STRONG>Description</STRONG>
------------------------------------------------------------
-
fixterm restore tty to "in curses" state
gettmode establish current tty modes
mvcur low level cursor motion
- putp utility function that uses <STRONG>tputs</STRONG> to send char-
+ putp utility function that uses <STRONG>tputs</STRONG> to send char-
acters via <STRONG>putchar</STRONG>.
resetterm set tty modes to "out of curses" state
resetty reset tty flags to stored value
tparm instantiate a string expression with parameters
tputs apply padding information to a string
vidattr like <STRONG>vidputs</STRONG>, but outputs through <STRONG>putchar</STRONG>
- vidputs output a string to put terminal in a specified
+ vidputs output a string to put terminal in a specified
video attribute mode
- The programming manual also mentioned functions provided for termcap
+ The programming manual also mentioned functions provided for termcap
compatibility (commenting that they "may go away at a later date"):
<STRONG>Function</STRONG> <STRONG>Description</STRONG>
tputs apply padding to capability, calling
a function to put characters
- Early terminfo programs obtained capability values from the <STRONG>TERMINAL</STRONG>
+ Early terminfo programs obtained capability values from the <STRONG>TERMINAL</STRONG>
structure initialized by <STRONG>setupterm</STRONG>.
- SVr3 extended terminfo by adding functions to retrieve capability val-
+ SVr3 extended terminfo by adding functions to retrieve capability val-
ues (like the termcap interface), and reusing tgoto and tputs:
<STRONG>Function</STRONG> <STRONG>Description</STRONG>
tigetnum get numeric entry for given <EM>id</EM>
tigetstr get string entry for given <EM>id</EM>
- SVr3 also replaced several of the SVr2 terminfo functions which had no
+ SVr3 also replaced several of the SVr2 terminfo functions which had no
counterpart in the termcap interface, documenting them as obsolete:
<STRONG>Function</STRONG> <STRONG>Replaced</STRONG> <STRONG>by</STRONG>
saveterm def_prog_mode
setterm setupterm
- SVr3 kept the <STRONG>mvcur</STRONG>, <STRONG>vidattr</STRONG> and <STRONG>vidputs</STRONG> functions, along with <STRONG>putp</STRONG>,
- <STRONG>tparm</STRONG> and <STRONG>tputs</STRONG>. The latter were needed to support padding, and han-
- dling functions such as <STRONG>vidattr</STRONG> (which used more than the two parame-
+ SVr3 kept the <STRONG>mvcur</STRONG>, <STRONG>vidattr</STRONG> and <STRONG>vidputs</STRONG> functions, along with <STRONG>putp</STRONG>,
+ <STRONG>tparm</STRONG> and <STRONG>tputs</STRONG>. The latter were needed to support padding, and han-
+ dling functions such as <STRONG>vidattr</STRONG> (which used more than the two parame-
ters supported by <STRONG>tgoto</STRONG>).
- SVr3 introduced the functions for switching between terminal descrip-
- tions, e.g., <STRONG>set_curterm</STRONG>. The various global variables such as <STRONG>bool-</STRONG>
+ SVr3 introduced the functions for switching between terminal descrip-
+ tions, e.g., <STRONG>set_curterm</STRONG>. The various global variables such as <STRONG>bool-</STRONG>
<STRONG>names</STRONG> were mentioned in the programming manual at this point.
SVr4 added the <STRONG>vid_attr</STRONG> and <STRONG>vid_puts</STRONG> functions.
</PRE><H3><a name="h3-Legacy-functions">Legacy functions</a></H3><PRE>
X/Open notes that <STRONG>vidattr</STRONG> and <STRONG>vidputs</STRONG> may be macros.
- The function <STRONG>setterm</STRONG> is not described by X/Open and must be considered
+ The function <STRONG>setterm</STRONG> is not described by X/Open and must be considered
non-portable. All other functions are as described by X/Open.
</PRE><H3><a name="h3-Legacy-data">Legacy data</a></H3><PRE>
- <STRONG>setupterm</STRONG> copies the terminal name to the array <STRONG>ttytype</STRONG>. This is not
+ <STRONG>setupterm</STRONG> copies the terminal name to the array <STRONG>ttytype</STRONG>. This is not
part of X/Open Curses, but is assumed by some applications.
- Other implementions may not declare the capability name arrays. Some
+ Other implementions may not declare the capability name arrays. Some
provide them without declaring them. X/Open does not specify them.
Extended terminal capability names, e.g., as defined by <STRONG>tic</STRONG> <STRONG>-x</STRONG>, are not
</PRE><H3><a name="h3-Output-buffering">Output buffering</a></H3><PRE>
- Older versions of <STRONG>ncurses</STRONG> assumed that the file descriptor passed to
+ Older versions of <STRONG>ncurses</STRONG> assumed that the file descriptor passed to
<STRONG>setupterm</STRONG> from <STRONG>initscr</STRONG> or <STRONG>newterm</STRONG> uses buffered I/O, and would write to
- the corresponding stream. In addition to the limitation that the ter-
- minal was left in block-buffered mode on exit (like System V curses),
- it was problematic because <STRONG>ncurses</STRONG> did not allow a reliable way to
+ the corresponding stream. In addition to the limitation that the ter-
+ minal was left in block-buffered mode on exit (like System V curses),
+ it was problematic because <STRONG>ncurses</STRONG> did not allow a reliable way to
cleanup on receiving SIGTSTP.
- The current version (ncurses6) uses output buffers managed directly by
+ The current version (ncurses6) uses output buffers managed directly by
<STRONG>ncurses</STRONG>. Some of the low-level functions described in this manual page
write to the standard output. They are not signal-safe. The high-lev-
el functions in <STRONG>ncurses</STRONG> use alternate versions of these functions using
</PRE><H3><a name="h3-Function-prototypes">Function prototypes</a></H3><PRE>
The X/Open Curses prototypes are based on the SVr4 curses header decla-
- rations, which were defined at the same time the C language was first
+ rations, which were defined at the same time the C language was first
standardized in the late 1980s.
- <STRONG>o</STRONG> X/Open Curses uses <STRONG>const</STRONG> less effectively than a later design
- might, in some cases applying it needlessly to values are already
- constant, and in most cases overlooking parameters which normally
- would use <STRONG>const</STRONG>. Using constant parameters for functions which do
+ <STRONG>o</STRONG> X/Open Curses uses <STRONG>const</STRONG> less effectively than a later design
+ might, in some cases applying it needlessly to values are already
+ constant, and in most cases overlooking parameters which normally
+ would use <STRONG>const</STRONG>. Using constant parameters for functions which do
not use <STRONG>const</STRONG> may prevent the program from compiling. On the other
hand, <EM>writable</EM> <EM>strings</EM> are an obsolescent feature.
- As an extension, this implementation can be configured to change
- the function prototypes to use the <STRONG>const</STRONG> keyword. The ncurses ABI
+ As an extension, this implementation can be configured to change
+ the function prototypes to use the <STRONG>const</STRONG> keyword. The ncurses ABI
6 enables this feature by default.
- <STRONG>o</STRONG> X/Open Curses prototypes <STRONG>tparm</STRONG> with a fixed number of parameters,
+ <STRONG>o</STRONG> X/Open Curses prototypes <STRONG>tparm</STRONG> with a fixed number of parameters,
rather than a variable argument list.
- This implementation uses a variable argument list, but can be con-
- figured to use the fixed-parameter list. Portable applications
- should provide 9 parameters after the format; zeroes are fine for
+ This implementation uses a variable argument list, but can be con-
+ figured to use the fixed-parameter list. Portable applications
+ should provide 9 parameters after the format; zeroes are fine for
this purpose.
- In response to review comments by Thomas E. Dickey, X/Open Curses
+ In response to review comments by Thomas E. Dickey, X/Open Curses
Issue 7 proposed the <STRONG>tiparm</STRONG> function in mid-2009.
</PRE><H3><a name="h3-Special-TERM-treatment">Special TERM treatment</a></H3><PRE>
If configured to use the terminal-driver, e.g., for the MinGW port,
- <STRONG>o</STRONG> <STRONG>setupterm</STRONG> interprets a missing/empty TERM variable as the special
+ <STRONG>o</STRONG> <STRONG>setupterm</STRONG> interprets a missing/empty TERM variable as the special
value "unknown".
- <STRONG>o</STRONG> <STRONG>setupterm</STRONG> allows explicit use of the the windows console driver by
- checking if $TERM is set to "#win32con" or an abbreviation of that
+ <STRONG>o</STRONG> <STRONG>setupterm</STRONG> allows explicit use of the the windows console driver by
+ checking if $TERM is set to "#win32con" or an abbreviation of that
string.
</PRE><H3><a name="h3-Other-portability-issues">Other portability issues</a></H3><PRE>
- In System V Release 4, <STRONG>set_curterm</STRONG> has an <STRONG>int</STRONG> return type and returns
+ In System V Release 4, <STRONG>set_curterm</STRONG> has an <STRONG>int</STRONG> return type and returns
<STRONG>OK</STRONG> or <STRONG>ERR</STRONG>. We have chosen to implement the X/Open Curses semantics.
- In System V Release 4, the third argument of <STRONG>tputs</STRONG> has the type <STRONG>int</STRONG>
+ In System V Release 4, the third argument of <STRONG>tputs</STRONG> has the type <STRONG>int</STRONG>
<STRONG>(*putc)(char)</STRONG>.
- At least one implementation of X/Open Curses (Solaris) returns a value
- other than <STRONG>OK</STRONG>/<STRONG>ERR</STRONG> from <STRONG>tputs</STRONG>. That returns the length of the string,
+ At least one implementation of X/Open Curses (Solaris) returns a value
+ other than <STRONG>OK</STRONG>/<STRONG>ERR</STRONG> from <STRONG>tputs</STRONG>. That returns the length of the string,
and does no error-checking.
- X/Open notes that after calling <STRONG>mvcur</STRONG>, the curses state may not match
+ X/Open notes that after calling <STRONG>mvcur</STRONG>, the curses state may not match
the actual terminal state, and that an application should touch and re-
fresh the window before resuming normal curses calls. Both <STRONG>ncurses</STRONG> and
- System V Release 4 curses implement <STRONG>mvcur</STRONG> using the SCREEN data allo-
- cated in either <STRONG>initscr</STRONG> or <STRONG>newterm</STRONG>. So though it is documented as a
- terminfo function, <STRONG>mvcur</STRONG> is really a curses function which is not well
+ System V Release 4 curses implement <STRONG>mvcur</STRONG> using the SCREEN data allo-
+ cated in either <STRONG>initscr</STRONG> or <STRONG>newterm</STRONG>. So though it is documented as a
+ terminfo function, <STRONG>mvcur</STRONG> is really a curses function which is not well
specified.
- X/Open states that the old location must be given for <STRONG>mvcur</STRONG>. This im-
- plementation allows the caller to use -1's for the old ordinates. In
+ X/Open states that the old location must be given for <STRONG>mvcur</STRONG>. This im-
+ plementation allows the caller to use -1's for the old ordinates. In
that case, the old location is unknown.
</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_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_kernel.3x.html">curs_kernel(3x)</A></STRONG>, <STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>,
+ <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><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>,
<STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>, <STRONG><A HREF="term_variables.3x.html">term_variables(3x)</A></STRONG>, <STRONG>putc(3)</STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
<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.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
https://invisible-island.net/ncurses/tctest.html
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
</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="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(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.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
</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.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
method of updating character screens with reasonable optimization.
This implementation is "new curses" (ncurses) and is the approved
replacement for 4.4BSD classic curses, which has been discontinued.
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
The <STRONG>ncurses</STRONG> library emulates the curses library of System V Release 4
UNIX, and XPG4 (X/Open Portability Guide) curses (also known as XSI
</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.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
</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.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
</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="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="tset.1.html">tset(1)</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.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
have, by specifying how to perform screen operations, and by specifying
padding requirements and initialization sequences.
- This manual describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+ This manual describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
</PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
<STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(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>. <STRONG><A HREF="user_caps.5.html">user_caps(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
</PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
<STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>, <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(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.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
<!--
* t
****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* sale, use or other dealings in this Software without prior written *
* authorization. *
****************************************************************************
- * @Id: tput.1,v 1.65 2020/12/19 22:17:47 tom Exp @
+ * @Id: tput.1,v 1.66 2021/03/06 15:56:23 tom Exp @
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
2010, NetBSD's <STRONG>tput</STRONG> uses terminfo names. Before that, it (like
FreeBSD) recognized termcap names.
+ Beginning in 2021, FreeBSD uses the ncurses <STRONG>tput</STRONG>, configured for
+ both terminfo (tested first) and termcap (as a fallback).
+
Because (apparently) <EM>all</EM> of the certified Unix systems support the full
- set of capability names, the reasoning for documenting only a few may
+ set of capability names, the reasoning for documenting only a few may
not be apparent.
- <STRONG>o</STRONG> X/Open Curses Issue 7 documents <STRONG>tput</STRONG> differently, with <EM>capname</EM> and
+ <STRONG>o</STRONG> X/Open Curses Issue 7 documents <STRONG>tput</STRONG> differently, with <EM>capname</EM> and
the other features used in this implementation.
- <STRONG>o</STRONG> That is, there are two standards for <STRONG>tput</STRONG>: POSIX (a subset) and
- X/Open Curses (the full implementation). POSIX documents a subset
- to avoid the complication of including X/Open Curses and the
+ <STRONG>o</STRONG> That is, there are two standards for <STRONG>tput</STRONG>: POSIX (a subset) and
+ X/Open Curses (the full implementation). POSIX documents a subset
+ to avoid the complication of including X/Open Curses and the
terminal capabilities database.
- <STRONG>o</STRONG> While it is certainly possible to write a <STRONG>tput</STRONG> program without
- using curses, none of the systems which have a curses
- implementation provide a <STRONG>tput</STRONG> utility which does not provide the
+ <STRONG>o</STRONG> While it is certainly possible to write a <STRONG>tput</STRONG> program without
+ using curses, none of the systems which have a curses
+ implementation provide a <STRONG>tput</STRONG> utility which does not provide the
<EM>capname</EM> feature.
X/Open Curses Issue 7 (2009) is the first version to document
utilities. However that part of X/Open Curses does not follow existing
practice (i.e., Unix features documented in SVID 3):
- <STRONG>o</STRONG> It assigns exit code 4 to "invalid operand", which may be the same
- as <EM>unknown</EM> <EM>capability</EM>. For instance, the source code for Solaris'
+ <STRONG>o</STRONG> It assigns exit code 4 to "invalid operand", which may be the same
+ as <EM>unknown</EM> <EM>capability</EM>. For instance, the source code for Solaris'
xcurses uses the term "invalid" in this case.
- <STRONG>o</STRONG> It assigns exit code 255 to a numeric variable that is not
+ <STRONG>o</STRONG> It assigns exit code 255 to a numeric variable that is not
specified in the terminfo database. That likely is a documentation
- error, confusing the <STRONG>-1</STRONG> written to the standard output for an
+ error, confusing the <STRONG>-1</STRONG> written to the standard output for an
absent or cancelled numeric value versus an (unsigned) exit code.
- The various Unix systems (AIX, HPUX, Solaris) use the same exit-codes
+ The various Unix systems (AIX, HPUX, Solaris) use the same exit-codes
as ncurses.
NetBSD curses documents different exit codes which do not correspond to
</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
<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="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
- This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
<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.2 (patch 20210109).
+ This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210327).
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "form.priv.h"
-MODULE_ID("$Id: fld_def.c,v 1.43 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: fld_def.c,v 1.44 2021/03/27 23:49:53 tom Exp $")
/* this can't be readonly */
static FIELD default_field =
_nc_Make_Argument(const FIELDTYPE *typ, va_list *ap, int *err)
{
TypeArgument *res = (TypeArgument *)0;
- TypeArgument *p;
if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
{
assert(err != 0 && ap != (va_list *)0);
if ((typ->status & _LINKED_TYPE) != 0)
{
- p = typeMalloc(TypeArgument, 1);
+ TypeArgument *p = typeMalloc(TypeArgument, 1);
if (p != 0)
{
_nc_Copy_Argument(const FIELDTYPE *typ, const TypeArgument *argp, int *err)
{
TypeArgument *res = (TypeArgument *)0;
- TypeArgument *p;
if (typ != 0 && (typ->status & _HAS_ARGS) != 0)
{
assert(err != 0 && argp != 0);
if ((typ->status & _LINKED_TYPE) != 0)
{
- p = typeMalloc(TypeArgument, 1);
+ TypeArgument *p = typeMalloc(TypeArgument, 1);
if (p != 0)
{
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2013 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "form.priv.h"
-MODULE_ID("$Id: frm_data.c,v 1.19 2020/12/11 23:20:37 tom Exp $")
+MODULE_ID("$Id: frm_data.c,v 1.20 2021/03/27 23:49:58 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
if (Single_Line_Field(field))
{
- int check_len;
-
pos = form->begincol + field->cols;
while (pos < field->dcols)
{
- check_len = field->dcols - pos;
+ int check_len = field->dcols - pos;
+
if (check_len >= field->cols)
check_len = field->cols;
cursor_moved = TRUE;
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "form.priv.h"
-MODULE_ID("$Id: frm_def.c,v 1.29 2020/12/11 23:47:16 tom Exp $")
+MODULE_ID("$Id: frm_def.c,v 1.30 2021/03/27 23:49:58 tom Exp $")
/* this can't be readonly */
static FORM default_form =
{
int field_cnt, j;
int page_nr;
- int maximum_row_in_field, maximum_col_in_field;
_PAGE *pg;
T((T_CALLED("Connect_Fields(%p,%p)"), (void *)form, (void *)fields));
size of the form */
for (j = 0; j < field_cnt; j++)
{
+ int maximum_row_in_field;
+ int maximum_col_in_field;
+
if (j == 0)
pg->pmin = (short)j;
else
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "form.priv.h"
-MODULE_ID("$Id: frm_driver.c,v 1.133 2020/12/12 00:36:42 tom Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.134 2021/03/27 23:49:58 tom Exp $")
/*----------------------------------------------------------------------------
This is the core module of the form library. It contains the majority
static void
check_pos(FORM *form, int lineno)
{
- int y, x;
-
if (form && form->w)
{
+ int y, x;
+
getyx(form->w, y, x);
if (y != form->currow || x != form->curcol)
{
wide_winsnstr(WINDOW *w, const cchar_t *s, int n)
{
int code = ERR;
- int y, x;
while (n-- > 0)
{
+ int y, x;
+
getyx(w, y, x);
if ((code = wins_wch(w, s++)) != OK)
break;
{
int width, height;
int y, x;
- int len;
int row;
FIELD_CELL *pBuffer;
row < height;
row++, pBuffer += width)
{
+ int len;
+
if ((len = (int)(After_End_Of_Data(pBuffer, width) - pBuffer)) > 0)
{
wmove(win, row, 0);
* realloc().
*/
int i, j;
- FIELD_CELL *old_bp;
- FIELD_CELL *new_bp;
result = TRUE; /* allow sharing of recovery on failure */
field->buf = newbuf;
for (i = 0; i <= field->nbuf; i++)
{
- new_bp = Address_Of_Nth_Buffer(field, i);
- old_bp = oldbuf + i * (1 + old_buflen);
+ FIELD_CELL *new_bp = Address_Of_Nth_Buffer(field, i);
+ FIELD_CELL *old_bp = oldbuf + i * (1 + old_buflen);
+
for (j = 0; j < old_buflen; ++j)
new_bp[j] = old_bp[j];
while (j < new_buflen)
else
{
/* A multi-line, i.e. vertical scrolling field */
- int row_after_bottom, first_modified_row, first_unmodified_row;
+ int first_modified_row, first_unmodified_row;
if (field->drows > field->rows)
{
- row_after_bottom = form->toprow + field->rows;
+ int row_after_bottom = form->toprow + field->rows;
+
if (form->currow < form->toprow)
{
form->toprow = form->currow;
{
FIELD_CELL *bp;
int len;
- int col = 0;
bp = (Field_Has_Option(field, O_NO_LEFT_STRIP)
? field->buf
if (len > 0)
{
+ int col = 0;
+
assert(win && (field->drows == 1));
if (field->cols - len >= 0)
{
FIELD *linked_field;
int res = E_OK;
- int syncres;
if (!field)
return (E_BAD_ARGUMENT);
(linked_field != field) && (linked_field != 0);
linked_field = linked_field->link)
{
+ int syncres;
+
if (((syncres = Synchronize_Field(linked_field)) != E_OK) &&
(res == E_OK))
res = syncres;
{
FORM *form;
int res = E_OK;
- WINDOW *formwin;
T((T_CALLED("_nc_Synchronize_Attributes(%p)"), (void *)field));
}
else
{
- formwin = Get_Form_Window(form);
+ WINDOW *formwin = Get_Form_Window(form);
+
copywin(form->w, formwin,
0, 0,
field->frow, field->fcol,
int datalen = (int)(After_End_Of_Data(bp, field->dcols) - bp);
int freelen = field->dcols - datalen;
int requiredlen = len + 1;
- FIELD_CELL *split;
int result = E_REQUEST_DENIED;
if (freelen >= requiredlen)
myINSNSTR(form->w, txt, len);
wmove(form->w, row, len);
myINSNSTR(form->w, &myBLANK, 1);
- return E_OK;
+ result = E_OK;
}
else
{
if (row < (field->drows - 1))
{
+ FIELD_CELL *split;
+
split =
After_Last_Whitespace_Character(bp,
(int)(Get_Start_Of_Data(bp
return E_OK;
}
}
- return (result);
}
+ return (result);
}
/*---------------------------------------------------------------------------
}
else if (wenclose(sub, event.y, event.x))
{ /* Inside the area we try to find the hit item */
- int i;
-
ry = event.y;
rx = event.x;
if (wmouse_trafo(sub, &ry, &rx, FALSE))
{
int min_field = form->page[form->curpage].pmin;
int max_field = form->page[form->curpage].pmax;
+ int i;
for (i = min_field; i <= max_field; ++i)
{
}
else if (wenclose(sub, event.y, event.x))
{ /* Inside the area we try to find the hit item */
- int i;
-
ry = event.y;
rx = event.x;
if (wmouse_trafo(sub, &ry, &rx, FALSE))
{
int min_field = form->page[form->curpage].pmin;
int max_field = form->page[form->curpage].pmax;
+ int i;
for (i = min_field; i <= max_field; ++i)
{
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2012,2015 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "form.priv.h"
-MODULE_ID("$Id: frm_req_name.c,v 1.21 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: frm_req_name.c,v 1.22 2021/03/27 23:49:58 tom Exp $")
#define DATA(s) { s }
to run sequentially through it.
*/
size_t i = 0;
- char buf[16]; /* longest name is 10 chars */
T((T_CALLED("form_request_by_name(%s)"), _nc_visbuf(str)));
if (str != 0 && (i = strlen(str)) != 0)
{
+ char buf[16]; /* longest name is 10 chars */
+
if (i > sizeof(buf) - 2)
i = sizeof(buf) - 2;
memcpy(buf, str, i);
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "form.priv.h"
-MODULE_ID("$Id: fty_enum.c,v 1.31 2020/12/12 01:15:37 tom Exp $")
+MODULE_ID("$Id: fty_enum.c,v 1.32 2021/03/27 23:49:53 tom Exp $")
typedef struct
{
int cnt = 0;
char **kp = (char **)0;
char **kwds = (char **)0;
- char **kptarget;
int ccase, cunique;
T((T_CREATE("enumARG %p"), (void *)argp));
if (cnt > 0)
{
+ char **kptarget;
+
/* We copy the keywords, because we can't rely on the fact
that the caller doesn't relocate or free the memory used
for the keywords (maybe he has GC)
bool unique = ((const enumARG *)argp)->checkunique;
unsigned char *bp = (unsigned char *)field_buffer(field, 0);
char *s, *t, *p;
- int res;
while (kwds && (s = (*kwds++)))
{
+ int res;
+
if ((res = Compare((unsigned char *)s, bp, ccase)) != NOMATCH)
{
p = t = s; /* t is at least a partial match */
/****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 2008-2012,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "form.priv.h"
-MODULE_ID("$Id: fty_generic.c,v 1.14 2020/12/12 17:27:44 tom Exp $")
+MODULE_ID("$Id: fty_generic.c,v 1.15 2021/03/27 23:49:53 tom Exp $")
/*
* This is not a full implementation of a field type, but adds some
int code = E_SYSTEM_ERROR;
WINDOW *res = (WINDOW *)0;
- if (!(form == 0 || pRow == 0 || pCol == 0))
+ if (form != 0 && pRow != 0 && pCol != 0)
{
*pRow = form->currow;
*pCol = form->curcol;
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "form.priv.h"
-MODULE_ID("$Id: fty_int.c,v 1.31 2020/12/12 01:15:37 tom Exp $")
+MODULE_ID("$Id: fty_int.c,v 1.32 2021/03/27 23:49:58 tom Exp $")
#if USE_WIDEC_SUPPORT
#define isDigit(c) (iswdigit((wint_t)(c)) || isdigit(UChar(c)))
int prec = argi->precision;
unsigned char *bp = (unsigned char *)field_buffer(field, 0);
char *s = (char *)bp;
- long val;
- char buf[100];
bool result = FALSE;
- while (*bp && *bp == ' ')
+ while (*bp == ' ')
bp++;
if (*bp)
{
#if USE_WIDEC_SUPPORT
if (*bp)
{
- bool blank = FALSE;
int len;
- int n;
wchar_t *list = _nc_Widen_String((char *)bp, &len);
if (list != 0)
{
+ bool blank = FALSE;
+ int n;
+
result = TRUE;
for (n = 0; n < len; ++n)
{
#endif
if (result)
{
- val = atol(s);
+ long val = atol(s);
+
if (low < high)
{
if (val < low || val > high)
}
if (result)
{
+ char buf[100];
+
_nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
"%.*ld", (prec > 0 ? prec : 0), val);
set_field_buffer(field, 0, buf);
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2006,2009 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "form.priv.h"
-MODULE_ID("$Id: fty_ipv4.c,v 1.14 2020/12/12 01:15:37 tom Exp $")
+MODULE_ID("$Id: fty_ipv4.c,v 1.15 2021/03/27 23:49:53 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnform
{
char *bp = field_buffer(field, 0);
int num = 0, len;
- unsigned int d1, d2, d3, d4;
+ unsigned int d1 = 0, d2 = 0, d3 = 0, d4 = 0;
if (isdigit(UChar(*bp))) /* Must start with digit */
{
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "form.priv.h"
-MODULE_ID("$Id: fty_num.c,v 1.36 2020/12/12 01:15:37 tom Exp $")
+MODULE_ID("$Id: fty_num.c,v 1.37 2021/03/27 23:49:58 tom Exp $")
#if HAVE_LOCALE_H
#include <locale.h>
int prec = argn->precision;
unsigned char *bp = (unsigned char *)field_buffer(field, 0);
char *s = (char *)bp;
- double val = 0.0;
struct lconv *L = argn->L;
- char buf[64];
bool result = FALSE;
- while (*bp && *bp == ' ')
+ while (*bp == ' ')
bp++;
if (*bp)
{
#if USE_WIDEC_SUPPORT
if (*bp)
{
- bool blank = FALSE;
- int state = 0;
int len;
- int n;
wchar_t *list = _nc_Widen_String((char *)bp, &len);
if (list != 0)
{
+ bool blank = FALSE;
+ int state = 0;
+ int n;
+
result = TRUE;
for (n = 0; n < len; ++n)
{
#endif
if (result)
{
- val = atof(s);
+ double val = atof(s);
+
if (low < high)
{
if (val < low || val > high)
}
if (result)
{
+ char buf[64];
+
_nc_SPRINTF(buf, _nc_SLIMIT(sizeof(buf))
"%.*f", (prec > 0 ? prec : 0), val);
set_field_buffer(field, 0, buf);
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "menu.priv.h"
-MODULE_ID("$Id: m_cursor.c,v 1.25 2020/12/12 00:38:02 tom Exp $")
+MODULE_ID("$Id: m_cursor.c,v 1.26 2021/03/27 23:46:29 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
MENU_EXPORT(int)
pos_menu_cursor(const MENU *menu)
{
- WINDOW *win, *sub;
int x = 0, y = 0;
int err = _nc_menu_cursor_pos(menu, (ITEM *)0, &y, &x);
if (E_OK == err)
{
- win = Get_Menu_UserWin(menu);
- sub = menu->usersub ? menu->usersub : win;
+ WINDOW *win = Get_Menu_UserWin(menu);
+ WINDOW *sub = menu->usersub ? menu->usersub : win;
+
assert(win && sub);
if ((menu->opt & O_SHOWMATCH) && (menu->pindex > 0))
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2012,2016 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "menu.priv.h"
-MODULE_ID("$Id: m_driver.c,v 1.36 2020/12/12 00:38:02 tom Exp $")
+MODULE_ID("$Id: m_driver.c,v 1.37 2021/03/27 23:46:29 tom Exp $")
/* Macros */
int result = E_OK;
ITEM *item;
- int my_top_row, rdiff;
+ int my_top_row;
T((T_CALLED("menu_driver(%p,%d)"), (void *)menu, c));
if ((c > KEY_MAX) && (c <= MAX_MENU_COMMAND))
{
+ int rdiff;
+
if (!((c == REQ_BACK_PATTERN)
|| (c == REQ_NEXT_MATCH) || (c == REQ_PREV_MATCH)))
{
}
else if (wenclose(sub, event.y, event.x))
{ /* Inside the area we try to find the hit item */
- int i, x, y, err;
+ int x, y;
ry = event.y;
rx = event.x;
if (wmouse_trafo(sub, &ry, &rx, FALSE))
{
+ int i;
+
for (i = 0; i < menu->nitems; i++)
{
- err = _nc_menu_cursor_pos(menu, menu->items[i],
- &y, &x);
+ int err = _nc_menu_cursor_pos(menu,
+ menu->items[i],
+ &y, &x);
+
if (E_OK == err)
{
if ((ry == y) &&
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "menu.priv.h"
-MODULE_ID("$Id: m_format.c,v 1.21 2020/12/12 00:38:02 tom Exp $")
+MODULE_ID("$Id: m_format.c,v 1.22 2021/03/27 23:46:29 tom Exp $")
#define minimum(a,b) ((a)<(b) ? (a): (b))
MENU_EXPORT(int)
set_menu_format(MENU *menu, int rows, int cols)
{
- int total_rows, total_cols;
T((T_CALLED("set_menu_format(%p,%d,%d)"), (void *)menu, rows, cols));
if (menu)
{
+ int total_rows, total_cols;
+
if (menu->status & _POSTED)
RETURN(E_POSTED);
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2012,2014 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "menu.priv.h"
-MODULE_ID("$Id: m_global.c,v 1.32 2020/12/12 00:38:02 tom Exp $")
+MODULE_ID("$Id: m_global.c,v 1.33 2021/03/27 23:46:29 tom Exp $")
static char mark[] = "-";
/* *INDENT-OFF* */
unsigned MaximumNameLength = 0;
unsigned MaximumDescriptionLength = 0;
ITEM **items;
- unsigned check;
assert(menu && menu->items);
for (items = menu->items; *items; items++)
{
- check = (unsigned)_nc_Calculate_Text_Width(&((*items)->name));
+ unsigned check = (unsigned)_nc_Calculate_Text_Width(&((*items)->name));
+
if (check > MaximumNameLength)
MaximumNameLength = check;
MENU_EXPORT(bool)
_nc_Connect_Items(MENU *menu, ITEM **items)
{
- ITEM **item;
unsigned int ItemCount = 0;
if (menu && items)
{
+ ITEM **item;
+
for (item = items; *item; item++)
{
if ((*item)->imenu)
calculate_actual_width(MENU *menu, bool name)
{
int width = 0;
- int check = 0;
- ITEM **items;
assert(menu && menu->items);
if (menu->items != 0)
{
+ ITEM **items;
+
for (items = menu->items; *items; items++)
{
- if (name)
- {
- check = _nc_Calculate_Text_Width(&((*items)->name));
- }
- else
- {
- check = _nc_Calculate_Text_Width(&((*items)->description));
- }
+ int check = (name
+ ? _nc_Calculate_Text_Width(&((*items)->name))
+ : _nc_Calculate_Text_Width(&((*items)->description)));
+
if (check > width)
width = check;
}
{
if (menu && menu->items && *(menu->items))
{
- int i, j;
+ int i;
ITEM *item;
int Number_Of_Items = menu->nitems;
int col = 0, row = 0;
else
{
int Number_Of_Rows = menu->rows;
+ int j;
for (j = 0; j < Number_Of_Items; j++)
{
MENU_EXPORT(void)
_nc_Show_Menu(const MENU *menu)
{
- WINDOW *win;
- int maxy, maxx;
-
assert(menu);
if ((menu->status & _POSTED) && !(menu->status & _IN_DRIVER))
{
+ WINDOW *win;
+ int maxy, maxx;
+
/* adjust the internal subwindow to start on the current top */
assert(menu->sub);
mvderwin(menu->sub, menu->spc_rows * menu->toprow, 0);
int new_toprow,
ITEM *new_current_item)
{
- ITEM *cur_item;
- bool mterm_called = FALSE;
- bool iterm_called = FALSE;
-
assert(menu);
if (menu->status & _POSTED)
{
+ ITEM *cur_item;
+ bool mterm_called = FALSE;
+ bool iterm_called = FALSE;
+
if (new_current_item != menu->curitem)
{
Call_Hook(menu, itemterm);
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_top.c,v 1.14 2020/12/12 00:38:08 tom Exp $")
+MODULE_ID("$Id: m_item_top.c,v 1.15 2021/03/27 23:46:29 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
MENU_EXPORT(int)
set_top_row(MENU *menu, int row)
{
- ITEM *item;
-
T((T_CALLED("set_top_row(%p,%d)"), (void *)menu, row));
if (menu)
if (row != menu->toprow)
{
+ ITEM *item;
+
if (menu->status & _LINK_NEEDED)
_nc_Link_Items(menu);
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2004,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "menu.priv.h"
-MODULE_ID("$Id: m_item_val.c,v 1.18 2020/12/12 00:38:08 tom Exp $")
+MODULE_ID("$Id: m_item_val.c,v 1.19 2021/03/27 23:46:29 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
MENU_EXPORT(int)
set_item_value(ITEM *item, bool value)
{
- MENU *menu;
-
T((T_CALLED("set_item_value(%p,%d)"), (void *)item, value));
if (item)
{
- menu = item->imenu;
+ MENU *menu = item->imenu;
if ((!(item->opt & O_SELECTABLE)) ||
(menu && (menu->opt & O_ONEVALUE)))
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2010,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "menu.priv.h"
-MODULE_ID("$Id: m_post.c,v 1.34 2020/12/12 00:38:14 tom Exp $")
+MODULE_ID("$Id: m_post.c,v 1.35 2021/03/27 23:46:29 tom Exp $")
/*---------------------------------------------------------------------------
| Facility : libnmenu
int count = 0;
bool isfore = FALSE, isback = FALSE, isgrey = FALSE;
int name_len;
- int desc_len;
assert(menu->win);
{
int m = menu->spc_desc / 2;
int cy = -1, cx = -1;
+ int desc_len;
for (ch = ' ', i = 0; i < menu->spc_desc; i++)
{
_nc_Draw_Menu(const MENU *menu)
{
ITEM *item = menu->items[0];
- ITEM *lasthor, *lastvert;
+ ITEM *lastvert;
ITEM *hitem;
int y = 0;
chtype s_bkgd;
do
{
+ ITEM *lasthor;
+
wmove(menu->win, y, 0);
hitem = item;
if (menu->items && *(menu->items))
{
- int y;
int h = 1 + menu->spc_rows * (menu->rows - 1);
WINDOW *win = Get_Menu_Window(menu);
if ((menu->win = newpad(h, menu->width)))
{
- y = (maxy >= h) ? h : maxy;
+ int y = (maxy >= h) ? h : maxy;
+
if (y >= menu->height)
y = menu->height;
if (!(menu->sub = subpad(menu->win, y, menu->width, 0, 0)))
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2012,2015 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "menu.priv.h"
-MODULE_ID("$Id: m_req_name.c,v 1.25 2020/05/24 01:40:20 anonymous.maarten Exp $")
+MODULE_ID("$Id: m_req_name.c,v 1.26 2021/03/27 23:46:29 tom Exp $")
#define DATA(s) { s }
to run sequentially through it.
*/
size_t i = 0;
- char buf[16];
T((T_CALLED("menu_request_by_name(%s)"), _nc_visbuf(str)));
if (str != 0 && (i = strlen(str)) != 0)
{
+ char buf[16];
+
if (i > sizeof(buf) - 2)
i = sizeof(buf) - 2;
memcpy(buf, str, i);
-# $Id: Makefile.in,v 1.74 2021/01/23 20:42:08 tom Exp $
+# $Id: Makefile.in,v 1.75 2021/03/27 20:39:59 tom Exp $
##############################################################################
# Copyright 2018-2020,2021 Thomas E. Dickey #
# Copyright 1998-2016,2017 Free Software Foundation, Inc. #
@MAKE_PC_FILES@install \
@MAKE_PC_FILES@install.libs :: pc-files
@MAKE_PC_FILES@ @$(SHELL) -c 'case "x$(DESTDIR)$(PKG_CONFIG_LIBDIR)" in \
-@MAKE_PC_FILES@ (x/*) \
+@MAKE_PC_FILES@ x/*) \
@MAKE_PC_FILES@ mkdir -p $(DESTDIR)$(PKG_CONFIG_LIBDIR); \
@MAKE_PC_FILES@ for name in $(PC_FILES); do \
@MAKE_PC_FILES@ test -f $$name || continue; \
@MAKE_PC_FILES@ $(INSTALL_DATA) $$name $(DESTDIR)$(PKG_CONFIG_LIBDIR)/$$name; \
@MAKE_PC_FILES@ done \
@MAKE_PC_FILES@ ;; \
-@MAKE_PC_FILES@ (*) \
+@MAKE_PC_FILES@ *) \
@MAKE_PC_FILES@ echo "...skip actual install: no destination was given" ; \
@MAKE_PC_FILES@ ;; \
@MAKE_PC_FILES@ esac'
uninstall.libs :
-rm -f $(DESTDIR)$(bindir)/$(NCURSES_CONFIG)
@MAKE_PC_FILES@ @$(SHELL) -c 'case x$(DESTDIR)$(PKG_CONFIG_LIBDIR) in \
-@MAKE_PC_FILES@ (x/*) \
+@MAKE_PC_FILES@ x/*) \
@MAKE_PC_FILES@ for name in $(PC_FILES); do \
@MAKE_PC_FILES@ test -f $$name || continue; \
@MAKE_PC_FILES@ echo uninstalling $$name; \
#!@SHELL@
-# $Id: gen-pkgconfig.in,v 1.49 2021/01/24 00:35:28 tom Exp $
+# $Id: gen-pkgconfig.in,v 1.50 2021/03/27 20:26:16 tom Exp $
##############################################################################
# Copyright 2018-2020,2021 Thomas E. Dickey #
# Copyright 2009-2015,2018 Free Software Foundation, Inc. #
continue
;;
-L*)
- lib_check=${opt##-L}
+ lib_check=`echo "x$opt" | sed -e 's/^.-L//'`
[ -d "$lib_check" ] || continue
case "$lib_check" in
@LD_SEARCHPATH@) # skip standard libdir
#!@SHELL@
-# $Id: ncurses-config.in,v 1.46 2021/01/23 23:47:46 tom Exp $
+# $Id: ncurses-config.in,v 1.47 2021/03/27 20:26:04 tom Exp $
##############################################################################
# Copyright 2018-2020,2021 Thomas E. Dickey #
# Copyright 2006-2015,2017 Free Software Foundation, Inc. #
continue
;;
-L*)
- lib_check=${opt##-L}
+ lib_check=`echo "x$opt" | sed -e 's/^.-L//'`
[ -d "$lib_check" ] || continue
case "$lib_check" in
@LD_SEARCHPATH@) # skip standard libdir
-ncurses6 (6.2+20210323) unstable; urgency=low
+ncurses6 (6.2+20210327) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 22 Mar 2021 20:10:24 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 27 Mar 2021 05:43:25 -0400
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.2+20210323) unstable; urgency=low
+ncurses6 (6.2+20210327) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 22 Mar 2021 20:10:24 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 27 Mar 2021 05:43:25 -0400
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (6.2+20210323) unstable; urgency=low
+ncurses6 (6.2+20210327) unstable; urgency=low
* latest weekly patch
- -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 22 Mar 2021 20:10:24 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 27 Mar 2021 05:43:25 -0400
ncurses6 (5.9-20120608) unstable; urgency=low
-; $Id: mingw-ncurses.nsi,v 1.449 2021/03/23 07:36:24 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.450 2021/03/27 09:43:25 tom Exp $\r
\r
; TODO add examples\r
; TODO bump ABI to 6\r
!define VERSION_MAJOR "6"\r
!define VERSION_MINOR "2"\r
!define VERSION_YYYY "2021"\r
-!define VERSION_MMDD "0323"\r
+!define VERSION_MMDD "0327"\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.2
-Release: 20210323
+Release: 20210327
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.2
-Release: 20210323
+Release: 20210327
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Summary: Curses library with POSIX thread support.
Name: ncursest6
Version: 6.2
-Release: 20210323
+Release: 20210327
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
#include "termsort.c" /* this C file is generated */
#include <parametrized.h> /* so is this */
-MODULE_ID("$Id: dump_entry.c,v 1.182 2021/03/20 16:08:32 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.183 2021/03/28 00:09:49 tom Exp $")
#define DISCARD(string) string = ABSENT_STRING
#define PRINTF (void) printf
size_t size = strlen(fill);
char *result = 0;
int pass;
- int s, d;
+ size_t s, d;
for (pass = 0; pass < 2; ++pass) {
for (s = d = 0; src[s] != '\0'; ++s) {
if (src[s] == ' ') {
if (pass) {
_nc_STRCPY(&result[d], fill, need + 1 - d);
- d += (int) size;
+ d += size;
} else {
need += size;
}
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* authorization. *
****************************************************************************/
/*
- * $Id: dup_field.c,v 1.1 2020/03/21 19:28:36 tom Exp $
+ * $Id: dup_field.c,v 1.2 2021/03/27 23:41:57 tom Exp $
*
* Demonstrate move_field().
*/
static char empty[] = "";
static FIELD *all_fields[100];
-
/* *INDENT-OFF* */
static struct {
int code;
int status;
FIELD *before;
unsigned n;
- int length;
int before_row;
int before_col;
int before_off = offset_in_field(form);
if (status == E_OK) {
bool modified = TRUE;
+ int length = buffer_length(before);
- length = buffer_length(before);
if (length < before_off)
length = before_off;
switch (*result) {
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* authorization. *
****************************************************************************/
/*
- * $Id: list_keys.c,v 1.26 2020/02/02 23:34:34 tom Exp $
+ * $Id: list_keys.c,v 1.27 2021/03/27 23:41:21 tom Exp $
*
* Author: Thomas E Dickey
*
map |= (bit1 << 1) | (bit2 >> 1);
_nc_SPRINTF(result, _nc_SLIMIT(sizeof(result))
"%sF%d", modifiers[map][(unsigned) f_opt], 1 + key);
- } else if (sscanf(name, "k%[A-Z]%d%c", buffer, &value, &chr) == 2 &&
+ } else if (sscanf(name, "k%80[A-Z]%d%c", buffer, &value, &chr) == 2 &&
(value > 1 &&
value <= 8) &&
(!strcmp(buffer, "UP") ||
!strcmp(buffer, "PRV"))) {
_nc_SPRINTF(result, _nc_SLIMIT(sizeof(result))
"%sk%s", modifiers[value - 1][(unsigned) f_opt], buffer);
- } else if (sscanf(name, "k%[A-Z]%c", buffer, &chr) == 1 &&
+ } else if (sscanf(name, "k%80[A-Z]%c", buffer, &chr) == 1 &&
(!strcmp(buffer, "UP") ||
!strcmp(buffer, "DN"))) {
_nc_SPRINTF(result, _nc_SLIMIT(sizeof(result))
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* authorization. *
****************************************************************************/
/*
- * $Id: move_field.c,v 1.7 2020/05/09 12:52:00 tom Exp $
+ * $Id: move_field.c,v 1.8 2021/03/27 23:41:57 tom Exp $
*
* Demonstrate move_field().
*/
#ifdef HAVE_NETBSD_FORM_H
#define form_field_row(field) (field)->form_row
#define form_field_col(field) (field)->form_col
-#else /* e.g., SVr4, ncurses */
+#else /* e.g., SVr4, ncurses */
#define form_field_row(field) (field)->frow
#define form_field_col(field) (field)->fcol
#endif
static char empty[] = "";
static FIELD *all_fields[100];
-
/* *INDENT-OFF* */
static struct {
int code;
int status;
FIELD *before;
unsigned n;
- int length;
int before_row;
int before_col;
int before_off = offset_in_field(form);
if (status == E_OK) {
bool modified = TRUE;
+ int length = buffer_length(before);
- length = buffer_length(before);
if (length < before_off)
length = before_off;
switch (*result) {
size_t needed = (size_t) count;
FIELD **old_fields = copy_fields(form_fields(form), needed);
FIELD **new_fields = copy_fields(form_fields(form), needed);
- int ch;
if (old_fields != NULL && new_fields != NULL) {
bool found = FALSE;
+ int ch;
/* TODO: move the label too, in parallel with the editing field */
getyx(stdscr, currow, curcol);
show_status(form, my_field);
- ch = '?';
while ((ch = wgetch(form_win(form))) != DO_DEMO) {
int field_y = form_field_row(my_field);
int field_x = form_field_col(my_field);
* authorization. *
****************************************************************************/
/*
- * $Id: picsmap.c,v 1.136 2021/03/20 16:08:22 tom Exp $
+ * $Id: picsmap.c,v 1.137 2021/03/27 22:52:16 tom Exp $
*
* Author: Thomas E. Dickey
*
case 0:
case 1:
case 2:
- if (sscanf(s, "#define %s %d%c", buf, &num, &ch) >= 2) {
+ if (sscanf(s, "#define %1024s %d%c", buf, &num, &ch) >= 2) {
if ((t = strstr(buf, "_width")) != 0) {
state |= 1;
result->wide = (short) bytes_of(num);
}
break;
case 3:
- if (sscanf(s, "static char %[^_ ]_bits[]%c", buf, &ch) >= 1) {
+ if (sscanf(s, "static char %1024[^_ ]_bits[]%c", buf, &ch) >= 1) {
if (strcmp(result->name, buf)) {
goto finish;
}
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 2006-2012,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* authorization. *
****************************************************************************/
/*
- * $Id: redraw.c,v 1.11 2020/02/02 23:34:34 tom Exp $
+ * $Id: redraw.c,v 1.12 2021/03/27 23:41:21 tom Exp $
*
* Demonstrate the redrawwin() and wredrawln() functions.
* Thomas Dickey - 2006/11/4
WINDOW *win1;
WINDOW *win2;
bool done = FALSE;
- int ch, y, x;
int max_y, max_x;
int beg_y, beg_x;
keypad(win, TRUE);
getmaxyx(win, max_y, max_x);
getbegyx(win, beg_y, beg_x);
+
while (!done) {
- ch = wgetch(win);
+ int ch = wgetch(win);
+ int y, x;
+
getyx(win, y, x);
switch (ch) {
case 'q':
/****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 2006-2017,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* authorization. *
****************************************************************************/
/*
- * $Id: savescreen.c,v 1.57 2020/02/02 23:34:34 tom Exp $
+ * $Id: savescreen.c,v 1.58 2021/03/27 23:41:21 tom Exp $
*
* Demonstrate save/restore functions from the curses library.
* Thomas Dickey - 2007/7/14
static void
cleanup(char *files[])
{
- int n;
-
if (!keep_dumps) {
+ int n;
+
for (n = 0; files[n] != 0; ++n) {
unlink(files[n]);
}
{
#if USE_WIDEC_SUPPORT
cchar_t mycc;
- int myxx;
#endif
char *filename = files[which];
bool dumped = FALSE;
wmove(stdscr, cy, cx);
#if USE_WIDEC_SUPPORT
if (win_wch(curscr, &mycc) != ERR) {
- myxx = wcwidth(BaseChar(mycc));
+ int myxx = wcwidth(BaseChar(mycc));
if (myxx > 0) {
wadd_wchnstr(stdscr, &mycc, 1);
cx += (myxx - 1);
char **files;
char *fill_by = 0;
#if USE_WIDEC_SUPPORT
- int r, g, b;
- int cube = 0;
- int cube0 = 16;
- int cube1;
cchar_t mycc;
static const wchar_t mywc[2] =
{L'#', 0};
- bool using_rgb = FALSE;
#endif
setlocale(LC_ALL, "");
curs_set(0);
if (has_colors() && (start_color() == OK) && COLORS >= MAX_ANSI) {
+#if USE_WIDEC_SUPPORT
+ bool using_rgb = FALSE;
+#endif
static const struct {
int fg, bg;
} table[MAX_ANSI] = {
int r_delta = (r_max / cols);
int g_delta = (g_max / cols);
int row = 0;
+ int b = 0;
- b = 0;
using_rgb = TRUE;
while (row++ < rows) {
int col = 0;
- r = 0;
- g = g_max;
+ int r = 0;
+ int g = g_max;
while (col++ < cols) {
int color = (((r * (g_max + 1)) + g) * (b_max + 1)
+ b + MAX_ANSI);
#endif
}
if ((fill_by == 0) && !replaying) {
+#if USE_WIDEC_SUPPORT
+ int cube = 0;
+#endif
/*
* Originally (before wide-characters) ncurses supported 16 colors.
*/
cube = 6;
}
if (cube != 0) {
- cube0 = 16;
- cube1 = cube0 + (cube * cube * cube);
+ int r, g, b;
+ int cube0 = 16;
+ int cube1 = cube0 + (cube * cube * cube);
addch('\n');
printw("Color cube, %dx%dx%d:\n", cube, cube, cube);
int cols = COLS - 1;
int row = 0;
- b = 0;
pair = MAX_ANSI;
while (row++ < rows) {
int col = 0;
/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
- * Copyright 2009-2016,2017 Free Software Foundation, Inc. *
+ * Copyright 2020,2021 Thomas E. Dickey *
+ * Copyright 2009-2016,2017 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: test_add_wchstr.c,v 1.27 2020/02/02 23:34:34 tom Exp $
+ * $Id: test_add_wchstr.c,v 1.28 2021/03/27 23:41:34 tom Exp $
*
* Demonstrate the waddwchstr() and wadd_wch functions.
* Thomas Dickey - 2009/9/12
if (!pass_ctls) {
size_t adjust = 0;
size_t n;
- const char *s;
for (n = 0; n < result; ++n) {
+ const char *s;
+
if (source[n] < 256 && (s = unctrl((chtype) source[n])) != 0) {
adjust += (strlen(s) - 1);
}
/*
* Author: Thomas E. Dickey
*
- * $Id: test_sgr.c,v 1.16 2021/03/20 16:04:31 tom Exp $
+ * $Id: test_sgr.c,v 1.17 2021/03/27 22:43:36 tom Exp $
*
* A simple demo of the sgr/sgr0 terminal capabilities.
*/
db_item++;
}
}
- printf("** %s\n", result);
+ printf("** %s\n", result ? result : "<null>");
return result;
}
* wrs(5/28/93) -- modified to be consistent (perform identically) with either
* PDCurses or under Unix System V, R4
*
- * $Id: testcurs.c,v 1.55 2019/12/14 23:25:29 tom Exp $
+ * $Id: testcurs.c,v 1.56 2021/03/27 22:39:50 tom Exp $
*/
#include <test.priv.h>
{
int answered;
int repeat;
- int w, h, bx, by, sw, sh, i, c, num;
+ int w, h, bx, by, sw, sh, i, num;
char buffer[80];
WINDOW *subWin;
wclear(win);
#endif
for (;;) {
+ int c;
+
wmove(win, 3, 5);
c = wgetch(win);
wclrtobot(win);
static void
outputTest(WINDOW *win)
{
- WINDOW *win1;
char Buffer[80];
chtype ch;
int by, bx;
MvWAddStr(win, 6, 1, "display of at least 24 LINES by 75 COLUMNS");
Continue(win);
} else {
- win1 = newwin(10, 50, 14, 25);
+ WINDOW *win1 = newwin(10, 50, 14, 25);
if (win1 == NULL) {
endwin();
return;
static void
padTest(WINDOW *dummy GCC_UNUSED)
{
- WINDOW *pad, *spad;
+ WINDOW *pad;
if ((pad = newpad(50, 100)) != 0) {
+ WINDOW *spad;
+
wattron(pad, A_REVERSE);
MvWAddStr(pad, 5, 2, "This is a new pad");
(void) wattrset(pad, A_NORMAL);
char *argv[]GCC_UNUSED)
{
WINDOW *win;
- int key;
int old_option = (-1);
int new_option = 0;
bool quit = FALSE;
erase();
display_menu(old_option, new_option);
+
for (;;) {
+ int key;
+
#ifdef A_COLOR
if (has_colors()) {
init_pair(1, COLOR_WHITE, COLOR_BLUE);
* scroll operation worked, and the refresh() code only had to do a
* partial repaint.
*
- * $Id: view.c,v 1.139 2021/03/20 16:04:20 tom Exp $
+ * $Id: view.c,v 1.140 2021/03/27 22:42:22 tom Exp $
*/
#include <test.priv.h>
ch_len(NCURSES_CH_T *src)
{
int result = 0;
-#if USE_WIDEC_SUPPORT
- int count;
-#endif
#if USE_WIDEC_SUPPORT
for (;;) {
+ int count;
TEST_CCHAR(src, count, {
int len = wcwidth(test_wch[0]);
result += (len > 0) ? len : 1;
int i;
int digits;
char temp[BUFSIZ];
- NCURSES_CH_T *s;
time_t this_time;
for (digits = 1, i = num_lines; i > 0; i /= 10) {
scrollok(stdscr, FALSE); /* prevent screen from moving */
for (i = 1; i < LINES; i++) {
+ NCURSES_CH_T *s;
int len;
int actual = (int) (lptr + i - vec_lines);
+
if (actual > num_lines) {
if (i < LINES - 1) {
int y, x;
*/
{
int j;
- int width = 1, count;
+ int width = 1;
+
for (j = actual = 0; j < shift; ++j) {
+ int count;
+
TEST_CCHAR(s + j, count, {
width = wcwidth(test_wch[0]);
}
/******************************************************************************/
/*
- * $Id: xmas.c,v 1.35 2021/03/20 16:15:31 tom Exp $
+ * $Id: xmas.c,v 1.36 2021/03/27 22:40:53 tom Exp $
*/
#include <test.priv.h>
y_pos = 0;
for (x_pos = 70; x_pos > 62; x_pos--) {
- if (x_pos < 62) {
- y_pos = 1;
- }
for (looper = 0; looper < 4; looper++) {
MvWAddCh(dotdeer0, y_pos, x_pos, (chtype) '.');
wrefresh(dotdeer0);