Home | History | Annotate | only in /src/usr.bin/menuc
History log of /src/usr.bin/menuc
RevisionDateAuthorComments
 1.14 29-Oct-2009  christos option noinput
 1.13 20-Apr-2009  drochner define YY_NO_INPUT where appropriate, from Kurt J. Lidl per PR misc/41160
 1.12 14-Apr-2009  lukem Enable WARNS=4 by default for usr.bin, except for:
awk bdes checknr compile_et error gss hxtool kgetcred kinit
klist ldd less lex locale login m4 man menuc mk_cmds
mklocale msgc openssl rpcgen rpcinfo sdiff spell ssh
string2key telnet tn3270 verify_krb5_conf xlint
 1.11 18-May-2003  lukem branches: 1.11.42;
Now that <bsd.prog.mk> DTRT if HOSTPROG is defined (i.e, it is a no-op),
there's no need to special-case .include-ing it.
 1.10 31-Jan-2002  tv Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
 1.9 12-Nov-2001  tv Formatting cleanup.
 1.8 05-Oct-2001  jmc Add appropriate ifdefs so tools reachovers build clean
 1.7 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.6 27-Sep-1998  lukem don't install in /usr/share if NOSHARE is defined
 1.5 09-Apr-1998  tv .y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.
 1.4 22-Oct-1997  lukem use CPPFLAGS instead of CFLAGS
 1.3 19-Oct-1997  lukem branches: 1.3.2;
don't define WARNS=1 here
 1.2 11-Oct-1997  mycroft Clean up this garbage.
 1.1 26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1 26-Sep-1997  phil Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.3.2.1 08-Nov-1997  lukem sync with trunk (approved by thorpej)
 1.11.42.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.7 11-Feb-2005  simonb White space nit- don't put a space before/after increment/decrement
operators.
 1.6 20-Jun-2004  jmc Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
 1.5 17-Jul-2003  lukem branches: 1.5.2;
only use __RCSID() if it is #defined
 1.4 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.3 21-Mar-2002  phil Fix bug in AVL tree routines. Correct man page.
 1.2 03-Jul-2000  matt Make gcc 2.96 (and maybe earlier) happier. Include <stdlib.h>,<string.>,
etc. as appropriate to get exit,srncmp,abs,abort,etc.
Add -I${.CURDIR} to a few Makefiles
 1.1 26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1 26-Sep-1997  phil Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.5.2.1 22-Jun-2004  tron branches: 1.5.2.1.2;
Pull up revision 1.6 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
 1.5.2.1.2.1 23-Jul-2005  snj Pull up revision 1.7 (requested by riz in ticket #5515):
White space nit- don't put a space before/after increment/decrement
operators.
 1.11 21-Nov-2018  martin Add (optional) support for expanded static menu texts - that is: whatever
the application programmer defines as expansion, e.g. to implement
parameter substitution.
While here add rudimentary documentation of the dynamic messages
feature (so at least the parser and the syntax documented here
are in sync).
The man page could use some typesetting help...
 1.10 18-Oct-2013  christos branches: 1.10.24; 1.10.26;
avoid redefinitions
 1.9 06-Mar-2012  mbalmer branches: 1.9.2;
Remove the advertising clause and appease the eye a bit (still not good, but
better). Almost no functional change.
 1.8 27-Oct-2003  lukem branches: 1.8.56;
Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.7 23-Jul-2003  itojun style
 1.6 10-Jun-2003  dsl Add extra command 'allow dynamic messages' which will push all texts through
the msgc translation service.
Allow for texts being NULL as well as "", don't use strlen() to test for "".
 1.5 29-Jan-2002  tv Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)
 1.4 11-Oct-2000  is More format string cleanup by sommerfeld.
 1.3 01-Jul-1998  phil branches: 1.3.2; 1.3.10;
Bug fixes, tweeks to scrolling, beginnings of dynamic menus.
 1.2 09-Nov-1997  phil Add code for handling NULL return from initscr(). Added "ERROR ACTION"
for user code for above error.
 1.1 26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1 26-Sep-1997  phil branches: 1.1.1.1.2;
Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.1.1.1.2.1 09-Nov-1997  mellon Pull rev 1.2 up from trunk (phil)
 1.3.10.1 18-Oct-2000  tv Pullup usr.bin string format fixes [is].
See "cvs log" for explicit revision numbers per file, from sommerfeld.
 1.3.2.1 19-Oct-2000  he Pull up revision 1.4 (requested by he):
Format string cleanup.
 1.8.56.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.8.56.1 17-Apr-2012  yamt sync with head
 1.9.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10.26.1 10-Jun-2019  christos Sync with HEAD
 1.10.24.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.11 06-Mar-2012  mbalmer Remove the advertising clause and appease the eye a bit (still not good, but
better). Almost no functional change.
 1.10 20-Jun-2004  jmc branches: 1.10.50;
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
 1.9 17-Jul-2003  lukem branches: 1.9.2;
only use __RCSID() if it is #defined
 1.8 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.7 03-Jul-2000  matt Make gcc 2.96 (and maybe earlier) happier. Include <stdlib.h>,<string.>,
etc. as appropriate to get exit,srncmp,abs,abort,etc.
Add -I${.CURDIR} to a few Makefiles
 1.6 20-Jun-1999  cgd provide the ability to do horizontal centering of menus, and make that
the default. XXX: currently can't be turned back on for individual menus
if overridden by the menu definition's default setting.
 1.5 20-Jun-1999  cgd provide a way to set the string used for the 'Exit' menu item.
 1.4 03-Feb-1998  perry branches: 1.4.2;
<stdlib.h> -> <unistd.h> to fix compiler warning
 1.3 19-Oct-1997  lukem fix up .Nm usage, getopt returns -1 not EOF
 1.2 26-Sep-1997  phil Correct the usage() for reality.
 1.1 26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1 26-Sep-1997  phil Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.4.2.1 24-Jun-1999  cgd pull up rev(s) 1.5-1.6 from trunk. (cgd)
 1.9.2.1 22-Jun-2004  tron Pull up revision 1.10 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
 1.10.50.1 17-Apr-2012  yamt sync with head
 1.53 23-Jun-2019  martin Menu 0 does not exist anymore (it is now OPT_NOMENU), so emit an empty
menu defintion for it.
 1.52 22-Jun-2019  christos Conserve space: make ints to shorts and make OPT_NOMENU 0 instead of -1
so we don't require initializing it.
 1.51 25-Feb-2019  martin Add an option to supress the vertical space between menu title and
menu items.
 1.50 06-Feb-2019  martin Provide an accessor for the menu description structure by manu identifier.
Usefull for dynamic menus where you want to change details on the
fly "from the outside" (i.e. while not in one of the callback functions).
 1.49 09-Jan-2019  martin Allow argument expansion in menu titles as well.
 1.48 04-Jan-2019  martin Add an option for single (disabled) menu lines to have no shortcut.
 1.47 21-Nov-2018  martin Add (optional) support for expanded static menu texts - that is: whatever
the application programmer defines as expansion, e.g. to implement
parameter substitution.
While here add rudimentary documentation of the dynamic messages
feature (so at least the parser and the syntax documented here
are in sync).
The man page could use some typesetting help...
 1.46 06-Mar-2012  mbalmer branches: 1.46.30; 1.46.32;
Remove the advertising clause and appease the eye a bit (still not good, but
better). Almost no functional change.
 1.45 06-Sep-2011  joerg branches: 1.45.2;
Mark __menu_initerror as dead in the output.
 1.44 16-Jan-2008  tls Fix PR37377 from Devon O'Dell: num_menus can be referenced without being
emitted if dynamic menus are not enabled.
 1.43 23-Oct-2006  he branches: 1.43.8;
Fully initialize the last element of menu_def[].
 1.42 20-Feb-2006  dsl Allow menu entry option names to be code fragments that (should) call
wprintw(menu->mw, ftm, args) to generate the menu label.
Allows static menu labels to contain the current value (like a lot of the
dynamic menus do).
Correct width calculations, and bound menu table lookup.
 1.41 02-Aug-2004  dsl Support menu windows that preserve the underlying screen contents.
(Needs a libcurses fix as well).
No need to ponce about with __m_endwin (to remember we've done endwin()),
the old recovery was wrong in any case - but I've left something that
will do an explicit redraw.
Allow the 'help' text to be from a variable (and hence translated).
Fix the display of help so that the screen underneath is actually cleared.
Preserve the screen contents while displaying help - redraw is too hard.
Use endwin(); doupdate(); to do the full refresh when ^L is typed.
Move menus up the screen if they would hit the bottom with too few lines
to show an item and the scroll text (happens with big titles).
Make 'y=0' center the window vertically - use of 0 means you can't have
a menu starting on the topline, but this is unlikely to be a problem.
Make all the menu options settable from the control file, not just from
dynamic menus.
Redo menu option list part of man page.
 1.40 20-Jun-2004  jmc Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
 1.39 18-Oct-2003  dsl branches: 1.39.2;
Add an MC_ALWAYS_SCROLL to mean "always allow space for 'scrolltext'".
All scrolltext to be #defined so it can be translated.
 1.38 27-Jul-2003  dsl More tweaks for sysinst.
Let 'display action' routine set menu->cursel (ie default menu item).
Remove 'opt' parameter I added to action routine (not that useful).
Make man page slightly closer to reality.
 1.37 25-Jul-2003  dsl Spinkle some consts and remove/change parameter names so that sysinst
will compile with WARNS=3.
 1.36 17-Jul-2003  lukem only use __RCSID() if it is #defined
 1.35 07-Jul-2003  dsl Add OPT_IGNORE flag which makes menu item inactive.
Add menu-dependant function to draw menu lines (when opt_name NULL).
 1.34 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.33 10-Jun-2003  dsl Add extra command 'allow dynamic messages' which will push all texts through
the msgc translation service.
Allow for texts being NULL as well as "", don't use strlen() to test for "".
 1.32 09-Jun-2003  dsl More changes to improve sysinst:
- pass 'menudesc' and 'arg' values to post_act() and exit_act()
- add set_menu_numopt() for variable length menus
- fix (badly broken) allocation/free of dynamic menus
- option to allow default selection to be the exit line
 1.31 04-Jun-2003  dsl Add 'exit' (for exit text) parameter to new_menu() for dynamic menus.
Correct calculation of menu height and whether scrolling needs (was wrong
if a height was specified that was smaller that the number of lines needed).
Move keypad(m->mw, TRUE) to stop core dump when newwin() fails.
Allow for calling code hacking m->h (to reduce number of lines displayed).
Add a MC_NOCLEAR option to leave menu text showing when doing action.
 1.30 03-Jun-2003  dsl Add a 'void *' argument to process_menu() so that some more global variables
can be killed.
 1.29 16-May-2003  dsl Re-instate last change, the sysinst I've just commited doesn't stand
a chance unless those fields are const char *.
 1.28 09-May-2003  lukem Revert part of previous, and remove "const" from "char *opt_name" and
"char *title", since it causes compile problems for the only program
that uses menuc (sysinst).
 1.27 09-May-2003  dsl Finger trouble in previous commit.
 1.26 09-May-2003  dsl Update man page for recent changes, update code to match man page...
 1.25 08-May-2003  dsl Accept variable names for menu titles and options to allow internationalisation.
Allow user code to define a hook to lookup message texts before any get used.
It is now possible to have a langauge independant menu file.
 1.24 10-Jan-2003  christos produce lint free code.
 1.23 07-Mar-2002  tv MAX has special meaning in host tools. #undef it first.
 1.22 15-Oct-2001  bjh21 Move hard-coded /usr/share/misc from mdb.c to pathnames.h, in accordance
with KNF.
 1.21 20-Feb-2001  cgd use getprogname()
 1.20 07-Jan-2001  phil Improve a parameter list, add the actual documentation for menuc.
 1.19 28-Dec-2000  mrg fix oversight in previous.
 1.18 22-Dec-2000  mrg say "<progname>: Could not initialize curses", with the progname
 1.17 15-Aug-2000  phil Tweek the "no shortcut" code.
MC_NOSHORTKEY to NOSHORTCUT
added option "shortcut" to menuc input language.
added example of this kind of menu in testm.
 1.16 15-Aug-2000  hubertf Changes:
* bring closer to KNF
* when selecting a item in a menu, call the opt_action() callback with
a pointer to the struct menudesc, so the callback has a chance to find
out which item was selected. Having a seperate callback for each
item is ok for small menus, but not for ones with many objects.
* Add menu-option MC_NOSHORTCUT to not print letters ("a: ", ...)
in front of list items. Again, this is for menues with lots of entries
as e.g. the upcoming sysinst set_timezone() function composes.
* Fix a long-standing bug WRT pagewise scrolling - the cursor is now
properly placed one page up/down
 1.15 23-Jul-2000  wiz Add format string to fprintf().
 1.14 20-Jun-1999  cgd branches: 1.14.8;
provide a way to set the string used for the 'Exit' menu item.
 1.13 19-Jun-1999  cgd * be more descriptive with the windor/screen too small for menu messages
(say width or height).
* work harder to make menu fit width-wise. (if necessary, move the menu
further left, and if that's not good enough exit with an error.)
* move menu system initialization out of process_menu() so that it can
be called earlier (e.g. by the sysinst main()), since it initializes
curses and other code might want to access the curses data structures
before process_menu() is invoked.
 1.12 23-Jul-1998  phil branches: 1.12.2;
Put back "return value" meaning in option actions accidentally removed
in chanages for dynamic menus. (Return !=0 means to exit menu dynamically.)
 1.11 16-Jul-1998  phil Major restructuring of the runtime code, now supports dynamic menus.
Fixed a bug is scrolling. Added dynamic menu to test meuns in testm.
 1.10 02-Jul-1998  phil Small tweeks, redoing language for dynamic menus.
 1.9 01-Jul-1998  phil Bug fixes, tweeks to scrolling, beginnings of dynamic menus.
 1.8 29-Jun-1998  phil Bug fixes in scrolling menues, better error detection with small screens,
bettern keypad support with suport form multiple key "commands" like
ESC-v for previous page.
 1.7 25-Jun-1998  phil Tweeks to option lettering ... to allow 51 options per menu. Also
to generate an error if there are more. (Checkpoint before furthur
changes to recognize more keypad keys.)
 1.6 25-Jun-1998  phil Add scrollable menus. Tweek testm's Makefile to remake if menu_sys.def
is modified.
 1.5 24-Jun-1998  phil Add a online help facility. Each menu can specify a help screen associated
with that menu. The help screen is scrollable for long help screens.
The char '?' accesses the help screen as a menu command. Help screen text
is specified in the menu definition file with the menu.
 1.4 30-Mar-1998  mrg use static int instead of static
 1.3 15-Jan-1998  cgd fgetc() returns 'int'. (char)EOF != EOF on unsigned-char machines.
 1.2 09-Nov-1997  phil Add code for handling NULL return from initscr(). Added "ERROR ACTION"
for user code for above error.
 1.1 26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1 26-Sep-1997  phil branches: 1.1.1.1.2;
Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.1.1.1.2.2 29-Jan-1998  mellon Pull up 1.3 (cgd)
 1.1.1.1.2.1 09-Nov-1997  mellon Pull rev 1.2 up from trunk (phil)
 1.12.2.1 24-Jun-1999  cgd pull up rev(s) 1.13-1.14 from trunk. (cgd)
 1.14.8.2 15-Mar-2003  he Pull up revision 1.20 (via patch, requested by gmcgarry in ticket #9):
Improve some argument lists, to allow this to compile cleanly
with later toolchains.
 1.14.8.1 15-Aug-2000  hubertf Pull up to netbsd-1-5 branch, OK'd by thorpej:

Revisions:
> cvs rdiff -r1.15 -r1.16 basesrc/usr.bin/menuc/mdb.c
> cvs rdiff -r1.22 -r1.23 basesrc/usr.bin/menuc/menu_sys.def

Log Message:
> * bring closer to KNF
> * when selecting a item in a menu, call the opt_action() callback with
> a pointer to the struct menudesc, so the callback has a chance to find
> out which item was selected. Having a seperate callback for each
> item is ok for small menus, but not for ones with many objects.
> * Add menu-option MC_NOSHORTCUT to not print letters ("a: ", ...)
> in front of list items. Again, this is for menues with lots of entries
> as e.g. the upcoming sysinst set_timezone() function composes.
> * Fix a long-standing bug WRT pagewise scrolling - the cursor is now
> properly placed one page up/down
 1.39.2.1 22-Jun-2004  tron branches: 1.39.2.1.2;
Pull up revision 1.40 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
 1.39.2.1.2.1 23-Jul-2005  snj Pull up revision 1.41 (requested by riz in ticket #5515):
Support menu windows that preserve the underlying screen contents.
(Needs a libcurses fix as well).
No need to ponce about with __m_endwin (to remember we've done endwin()),
the old recovery was wrong in any case - but I've left something that
will do an explicit redraw.
Allow the 'help' text to be from a variable (and hence translated).
Fix the display of help so that the screen underneath is actually cleared.
Preserve the screen contents while displaying help - redraw is too hard.
Use endwin(); doupdate(); to do the full refresh when ^L is typed.
Move menus up the screen if they would hit the bottom with too few lines
to show an item and the scroll text (happens with big titles).
Make 'y=0' center the window vertically - use of 0 means you can't have
a menu starting on the topline, but this is unlikely to be a problem.
Make all the menu options settable from the control file, not just from
dynamic menus.
Redo menu option list part of man page.
 1.43.8.1 23-Mar-2008  matt sync with HEAD
 1.45.2.1 17-Apr-2012  yamt sync with head
 1.46.32.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.46.32.1 10-Jun-2019  christos Sync with HEAD
 1.46.30.2 18-Jan-2019  pgoyette Synch with HEAD
 1.46.30.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.12 23-Jun-2019  christos define as hex and make MC_VALID smaller so it fits in a short.
 1.11 25-Feb-2019  martin Add an option to supress the vertical space between menu title and
menu items.
 1.10 21-Nov-2018  martin Add (optional) support for expanded static menu texts - that is: whatever
the application programmer defines as expansion, e.g. to implement
parameter substitution.
While here add rudimentary documentation of the dynamic messages
feature (so at least the parser and the syntax documented here
are in sync).
The man page could use some typesetting help...
 1.9 06-Mar-2012  mbalmer branches: 1.9.30; 1.9.32;
Remove the advertising clause and appease the eye a bit (still not good, but
better). Almost no functional change.
 1.8 20-Feb-2006  dsl branches: 1.8.44;
Allow menu entry option names to be code fragments that (should) call
wprintw(menu->mw, ftm, args) to generate the menu label.
Allows static menu labels to contain the current value (like a lot of the
dynamic menus do).
Correct width calculations, and bound menu table lookup.
 1.7 02-Aug-2004  dsl Support menu windows that preserve the underlying screen contents.
(Needs a libcurses fix as well).
No need to ponce about with __m_endwin (to remember we've done endwin()),
the old recovery was wrong in any case - but I've left something that
will do an explicit redraw.
Allow the 'help' text to be from a variable (and hence translated).
Fix the display of help so that the screen underneath is actually cleared.
Preserve the screen contents while displaying help - redraw is too hard.
Use endwin(); doupdate(); to do the full refresh when ^L is typed.
Move menus up the screen if they would hit the bottom with too few lines
to show an item and the scroll text (happens with big titles).
Make 'y=0' center the window vertically - use of 0 means you can't have
a menu starting on the topline, but this is unlikely to be a problem.
Make all the menu options settable from the control file, not just from
dynamic menus.
Redo menu option list part of man page.
 1.6 30-Nov-2003  dsl branches: 1.6.4;
Add '[no] clear' to lex/yacc spec.
Fix some menu sizing bugs for menus where the user code changes the size.
Don't reduce the size of a menu with 'scroll' every timeit is displayed.
 1.5 15-Aug-2000  phil Tweek the "no shortcut" code.
MC_NOSHORTKEY to NOSHORTCUT
added option "shortcut" to menuc input language.
added example of this kind of menu in testm.
 1.4 20-Jun-1999  cgd provide a way to set the string used for the 'Exit' menu item.
 1.3 25-Jun-1998  phil branches: 1.3.2;
Add scrollable menus. Tweek testm's Makefile to remake if menu_sys.def
is modified.
 1.2 24-Jun-1998  phil Add a online help facility. Each menu can specify a help screen associated
with that menu. The help screen is scrollable for long help screens.
The char '?' accesses the help screen as a menu command. Help screen text
is specified in the menu definition file with the menu.
 1.1 26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1 26-Sep-1997  phil Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.3.2.1 24-Jun-1999  cgd pull up rev(s) 1.4 from trunk. (cgd)
 1.6.4.1 23-Jul-2005  snj Pull up revision 1.7 (requested by riz in ticket #5515):
Support menu windows that preserve the underlying screen contents.
(Needs a libcurses fix as well).
No need to ponce about with __m_endwin (to remember we've done endwin()),
the old recovery was wrong in any case - but I've left something that
will do an explicit redraw.
Allow the 'help' text to be from a variable (and hence translated).
Fix the display of help so that the screen underneath is actually cleared.
Preserve the screen contents while displaying help - redraw is too hard.
Use endwin(); doupdate(); to do the full refresh when ^L is typed.
Move menus up the screen if they would hit the bottom with too few lines
to show an item and the scroll text (happens with big titles).
Make 'y=0' center the window vertically - use of 0 means you can't have
a menu starting on the topline, but this is unlikely to be a problem.
Make all the menu options settable from the control file, not just from
dynamic menus.
Redo menu option list part of man page.
 1.8.44.1 17-Apr-2012  yamt sync with head
 1.9.32.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.9.32.1 10-Jun-2019  christos Sync with HEAD
 1.9.30.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.72 23-Jun-2019  christos use calloc properly.
 1.71 23-Jun-2019  martin Use OPT_NOMENU as error return for new_menu (instead of old hard coded -1).
Update man page for the OPT_NOMENU change.
 1.70 22-Jun-2019  christos Conserve space: make ints to shorts and make OPT_NOMENU 0 instead of -1
so we don't require initializing it.
 1.69 12-Apr-2019  martin Backout previous - our pool is zeroed, no need to reinitializ here.
 1.68 12-Apr-2019  martin new_menu: add missing initializations - we might be using a previously
freed menu entry which has not been zeroed.
 1.67 25-Feb-2019  martin Add an option to supress the vertical space between menu title and
menu items.
 1.66 16-Feb-2019  martin Document return values from menu items opt_action functions, add a
new variant: -1 when functions have fundamentally changed the menu
definition on the fly and the processing functions needs to restart
without looking at the old state (or stale cached pointers).
 1.65 06-Feb-2019  martin Provide an accessor for the menu description structure by manu identifier.
Usefull for dynamic menus where you want to change details on the
fly "from the outside" (i.e. while not in one of the callback functions).
 1.64 09-Jan-2019  martin Allow argument expansion in menu titles as well.
 1.63 06-Jan-2019  martin Fix a potential NULL deref in previous - some menus start up with no
"opts" array allocated yet.
 1.62 04-Jan-2019  martin Add an option for single (disabled) menu lines to have no shortcut.
 1.61 02-Jan-2019  martin If a menu starts with disabled options, skip those and start at the
first enabled one instead.
 1.60 21-Nov-2018  martin Add (optional) support for expanded static menu texts - that is: whatever
the application programmer defines as expansion, e.g. to implement
parameter substitution.
While here add rudimentary documentation of the dynamic messages
feature (so at least the parser and the syntax documented here
are in sync).
The man page could use some typesetting help...
 1.59 06-Mar-2012  mbalmer branches: 1.59.30; 1.59.32;
Remove the advertising clause and appease the eye a bit (still not good, but
better). Almost no functional change.
 1.58 20-Feb-2006  dsl branches: 1.58.44;
Allow menu entry option names to be code fragments that (should) call
wprintw(menu->mw, ftm, args) to generate the menu label.
Allows static menu labels to contain the current value (like a lot of the
dynamic menus do).
Correct width calculations, and bound menu table lookup.
 1.57 17-Sep-2004  wrstuden In procese_menu, make sure we initializie the menus
_before_ we access the MENUS macro. Otherwise we get a segfault.
 1.56 17-Sep-2004  wrstuden Add parenthesis to silence a compiler warning.
 1.55 14-Aug-2004  dsl Call doupdate() before copying out of stdscr (avoids PR 26660)
Delete a diagnostic variable.
 1.54 02-Aug-2004  dsl Support menu windows that preserve the underlying screen contents.
(Needs a libcurses fix as well).
No need to ponce about with __m_endwin (to remember we've done endwin()),
the old recovery was wrong in any case - but I've left something that
will do an explicit redraw.
Allow the 'help' text to be from a variable (and hence translated).
Fix the display of help so that the screen underneath is actually cleared.
Preserve the screen contents while displaying help - redraw is too hard.
Use endwin(); doupdate(); to do the full refresh when ^L is typed.
Move menus up the screen if they would hit the bottom with too few lines
to show an item and the scroll text (happens with big titles).
Make 'y=0' center the window vertically - use of 0 means you can't have
a menu starting on the topline, but this is unlikely to be a problem.
Make all the menu options settable from the control file, not just from
dynamic menus.
Redo menu option list part of man page.
 1.53 29-Feb-2004  dsl branches: 1.53.4;
Allow menu boxes to be forced down the screen if the message text is long.
 1.52 21-Dec-2003  dsl Use an array of pointers to menu definitions so the array can grow without
leaving code having stale pointers to menu ites.
 1.51 30-Nov-2003  dsl Add '[no] clear' to lex/yacc spec.
Fix some menu sizing bugs for menus where the user code changes the size.
Don't reduce the size of a menu with 'scroll' every timeit is displayed.
 1.50 22-Nov-2003  dsl - Call delwin() when we stop displaying a window, saves space and newwin
is fast enough anyway. Lets the calling code change some fields (eg
the title for the 'yes/no' menu) between calls.
- Don't update m->x, m->y, m->w the changed values aren't needed once
the window has been created.
- Allow the window title to span multiple lines.
- Fix a nasty bug caused by having pointers into the memory area freed
by realloc when creating lots of dynamic menus.
- Fix check that ought to have allowed dynamic menus to be deleted.
 1.49 20-Nov-2003  dsl Fix box width calculation for menus without a 'shortcut' ("a: ").
 1.48 18-Oct-2003  dsl Add an MC_ALWAYS_SCROLL to mean "always allow space for 'scrolltext'".
All scrolltext to be #defined so it can be translated.
 1.47 27-Sep-2003  dsl Allow -ve integer constants in menu file.
Make y == -1 => after current messages (if msg_defs.h included).
Defer menu initialisation until after post_act() called (so function can
fiddle with more things.)
 1.46 21-Sep-2003  takemura Fixed array index checking to avoid segmentation fault problem.
 1.45 27-Jul-2003  dsl More tweaks for sysinst.
Let 'display action' routine set menu->cursel (ie default menu item).
Remove 'opt' parameter I added to action routine (not that useful).
Make man page slightly closer to reality.
 1.44 25-Jul-2003  dsl Spinkle some consts and remove/change parameter names so that sysinst
will compile with WARNS=3.
 1.43 07-Jul-2003  dsl Add OPT_IGNORE flag which makes menu item inactive.
Add menu-dependant function to draw menu lines (when opt_name NULL).
 1.42 27-Jun-2003  dsl Improve diagnostic message
 1.41 16-Jun-2003  dsl Do not let the cursor sit on menu lines that do nothing.
(Maybe page up/down should behave similarly - but that one is harder)
 1.40 10-Jun-2003  dsl Add extra command 'allow dynamic messages' which will push all texts through
the msgc translation service.
Allow for texts being NULL as well as "", don't use strlen() to test for "".
 1.39 09-Jun-2003  dsl More changes to improve sysinst:
- pass 'menudesc' and 'arg' values to post_act() and exit_act()
- add set_menu_numopt() for variable length menus
- fix (badly broken) allocation/free of dynamic menus
- option to allow default selection to be the exit line
 1.38 04-Jun-2003  dsl Add 'exit' (for exit text) parameter to new_menu() for dynamic menus.
Correct calculation of menu height and whether scrolling needs (was wrong
if a height was specified that was smaller that the number of lines needed).
Move keypad(m->mw, TRUE) to stop core dump when newwin() fails.
Allow for calling code hacking m->h (to reduce number of lines displayed).
Add a MC_NOCLEAR option to leave menu text showing when doing action.
 1.37 03-Jun-2003  dsl Add a 'void *' argument to process_menu() so that some more global variables
can be killed.
 1.36 03-Jun-2003  dsl More trivial changes...
Exclude '<: page up, >: page down' line from m->h count to simplify code.
 1.35 02-Jun-2003  dsl Whitespace and other layout stuff.
Change an elsif sequence to switch()
 1.34 09-May-2003  dsl Need 'const' on local variable - since I added const to the structure field.
 1.33 08-May-2003  dsl Accept variable names for menu titles and options to allow internationalisation.
Allow user code to define a hook to lookup message texts before any get used.
It is now possible to have a langauge independant menu file.
 1.32 07-May-2003  dsl Let page up/down go to first/last menu item when it is already showing.
 1.31 07-May-2003  dsl Add left and right arrows to list of keys that page menes up/down.
Make 'page down' go to 'exit' extry on menu (not stop one short).
Make 'exitstring' imply 'exit'.
 1.30 10-Jan-2003  christos produce lint free code.
 1.29 04-Apr-2002  blymn branches: 1.29.2;
Modified input key handling to use libcurses keypad mode to assemble
multi-byte key sequences instead of doing it itself.
 1.28 08-Dec-2001  ross tweak previous for lp64 so sysinst will compile on alpha
 1.27 06-Dec-2001  christos Fix for the new curses code. Inspired by changes from MINOURA Makoto.
 1.26 17-Nov-2001  perry 1) Use standard box drawing characters. It looks a whole lot better
than *'s.
2) On displays that handle color, do a cheesy white-on-blue theme.

As silly as it may seem, many people seem to respond better to color
and nice borders for sysinst.

XXX will rig up a way to do this more cleanly.
 1.25 07-Jan-2001  phil Improve a parameter list, add the actual documentation for menuc.
 1.24 15-Aug-2000  phil Tweek the "no shortcut" code.
MC_NOSHORTKEY to NOSHORTCUT
added option "shortcut" to menuc input language.
added example of this kind of menu in testm.
 1.23 15-Aug-2000  hubertf Changes:
* bring closer to KNF
* when selecting a item in a menu, call the opt_action() callback with
a pointer to the struct menudesc, so the callback has a chance to find
out which item was selected. Having a seperate callback for each
item is ok for small menus, but not for ones with many objects.
* Add menu-option MC_NOSHORTCUT to not print letters ("a: ", ...)
in front of list items. Again, this is for menues with lots of entries
as e.g. the upcoming sysinst set_timezone() function composes.
* Fix a long-standing bug WRT pagewise scrolling - the cursor is now
properly placed one page up/down
 1.22 22-Apr-2000  thorpej branches: 1.22.4;
Make this work again now that curses no longer does an implicit tgetent()
via initscr() by calling t_getstr() with curses' internal terminal info
initialized in setterm() (which is called by initscr()).

XXX THIS IS A HORRIBLE KLUDGE! ...and I'm almost embarassed to commit it.
XXX It really should be fixed by using normal curses facilities.
 1.21 20-Jun-1999  cgd need to provide an exit string for dynamic menus. hardcodes "Exit".
not pretty, but no worse than what the code did before.
 1.20 20-Jun-1999  cgd provide the ability to do horizontal centering of menus, and make that
the default. XXX: currently can't be turned back on for individual menus
if overridden by the menu definition's default setting.
 1.19 20-Jun-1999  cgd provide a way to set the string used for the 'Exit' menu item.
 1.18 20-Jun-1999  cgd size menus without titles correctly. also, correctly position titles so
that they don't have to be coded to include leading spaces.
 1.17 19-Jun-1999  cgd * be more descriptive with the windor/screen too small for menu messages
(say width or height).
* work harder to make menu fit width-wise. (if necessary, move the menu
further left, and if that's not good enough exit with an error.)
* move menu system initialization out of process_menu() so that it can
be called earlier (e.g. by the sysinst main()), since it initializes
curses and other code might want to access the curses data structures
before process_menu() is invoked.
 1.16 18-Apr-1999  simonb Don't frob the interals of a WINDOW*, use the getmaxy() macro.
 1.15 23-Jul-1998  phil branches: 1.15.2;
Put back "return value" meaning in option actions accidentally removed
in chanages for dynamic menus. (Return !=0 means to exit menu dynamically.)
 1.14 16-Jul-1998  phil Major restructuring of the runtime code, now supports dynamic menus.
Fixed a bug is scrolling. Added dynamic menu to test meuns in testm.
 1.13 03-Jul-1998  phil Fix bugs found in scrolling, make scrolling never leave blank
lines in the menu.
 1.12 01-Jul-1998  phil Stop scrolling of a non-scrolling menu using arrow keys.
 1.11 01-Jul-1998  phil Bug fixes, tweeks to scrolling, beginnings of dynamic menus.
 1.10 30-Jun-1998  phil Fixed a couple of simple bugs, added data returned for arrow keys for
xterm that is different than xterm termcap entry states. (Does curses
change what is returned for arrow keys?)
 1.9 29-Jun-1998  phil Bug fixes in scrolling menues, better error detection with small screens,
bettern keypad support with suport form multiple key "commands" like
ESC-v for previous page.
 1.8 25-Jun-1998  phil Tweeks to option lettering ... to allow 51 options per menu. Also
to generate an error if there are more. (Checkpoint before furthur
changes to recognize more keypad keys.)
 1.7 25-Jun-1998  phil Add scrollable menus. Tweek testm's Makefile to remake if menu_sys.def
is modified.
 1.6 24-Jun-1998  phil Beep if no help is defined for a menu.
 1.5 24-Jun-1998  phil Add a online help facility. Each menu can specify a help screen associated
with that menu. The help screen is scrollable for long help screens.
The char '?' accesses the help screen as a menu command. Help screen text
is specified in the menu definition file with the menu.
 1.4 14-Nov-1997  phil Do screen refresh correctly.
 1.3 14-Nov-1997  phil Make ^L redisplay the screen.
 1.2 09-Nov-1997  phil Add code for handling NULL return from initscr(). Added "ERROR ACTION"
for user code for above error.
 1.1 26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1 26-Sep-1997  phil branches: 1.1.1.1.2;
Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.1.1.1.2.2 18-Nov-1997  mellon Pull rev 1.3 and 1.4 up from trunk (phil)
 1.1.1.1.2.1 09-Nov-1997  mellon Pull rev 1.2 up from trunk (phil)
 1.15.2.1 24-Jun-1999  cgd pull up rev(s) 1.16-1.21 from trunk. (cgd)
 1.22.4.2 12-Aug-2003  itojun usr.bin/menuc/menuc.1 1.5
usr.bin/menuc/menu_sys.def 1.25 via patch

Improve a parameter list, add the actual documentation for menuc.
To make sysinst compile.
[masanobu, ticket #65]
 1.22.4.1 15-Aug-2000  hubertf Pull up to netbsd-1-5 branch, OK'd by thorpej:

Revisions:
> cvs rdiff -r1.15 -r1.16 basesrc/usr.bin/menuc/mdb.c
> cvs rdiff -r1.22 -r1.23 basesrc/usr.bin/menuc/menu_sys.def

Log Message:
> * bring closer to KNF
> * when selecting a item in a menu, call the opt_action() callback with
> a pointer to the struct menudesc, so the callback has a chance to find
> out which item was selected. Having a seperate callback for each
> item is ok for small menus, but not for ones with many objects.
> * Add menu-option MC_NOSHORTCUT to not print letters ("a: ", ...)
> in front of list items. Again, this is for menues with lots of entries
> as e.g. the upcoming sysinst set_timezone() function composes.
> * Fix a long-standing bug WRT pagewise scrolling - the cursor is now
> properly placed one page up/down
 1.29.2.1 24-Dec-2003  jmc Pullup hand patch (requested by martin in ticket #1571)
The opt_action function may allocate new menus,
which may make m a stale pointer into the old
menus array. So re-target it.
 1.53.4.4 23-Jul-2005  snj Pull up revision 1.57 (requested by riz in ticket #5515):
In procese_menu, make sure we initializie the menus
_before_ we access the MENUS macro. Otherwise we get a segfault.
 1.53.4.3 23-Jul-2005  snj Pull up revision 1.56 (requested by riz in ticket #5515):
Add parenthesis to silence a compiler warning.
 1.53.4.2 23-Jul-2005  snj Pull up revision 1.55 (requested by riz in ticket #5515):
Call doupdate() before copying out of stdscr (avoids PR 26660)
Delete a diagnostic variable.
 1.53.4.1 23-Jul-2005  snj Pull up revision 1.54 (requested by riz in ticket #5515):
Support menu windows that preserve the underlying screen contents.
(Needs a libcurses fix as well).
No need to ponce about with __m_endwin (to remember we've done endwin()),
the old recovery was wrong in any case - but I've left something that
will do an explicit redraw.
Allow the 'help' text to be from a variable (and hence translated).
Fix the display of help so that the screen underneath is actually cleared.
Preserve the screen contents while displaying help - redraw is too hard.
Use endwin(); doupdate(); to do the full refresh when ^L is typed.
Move menus up the screen if they would hit the bottom with too few lines
to show an item and the scroll text (happens with big titles).
Make 'y=0' center the window vertically - use of 0 means you can't have
a menu starting on the topline, but this is unlikely to be a problem.
Make all the menu options settable from the control file, not just from
dynamic menus.
Redo menu option list part of man page.
 1.58.44.1 17-Apr-2012  yamt sync with head
 1.59.32.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.59.32.1 10-Jun-2019  christos Sync with HEAD
 1.59.30.2 18-Jan-2019  pgoyette Synch with HEAD
 1.59.30.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.39 07-Nov-2021  andvar fix few typos.
 1.38 23-Jun-2019  martin Use OPT_NOMENU as error return for new_menu (instead of old hard coded -1).
Update man page for the OPT_NOMENU change.
 1.37 25-Feb-2019  martin Add an option to supress the vertical space between menu title and
menu items.
 1.36 16-Feb-2019  martin Typo in member variable name
 1.35 16-Feb-2019  martin Document return values from menu items opt_action functions, add a
new variant: -1 when functions have fundamentally changed the menu
definition on the fly and the processing functions needs to restart
without looking at the old state (or stale cached pointers).
 1.34 04-Jan-2019  martin Add an option for single (disabled) menu lines to have no shortcut.
 1.33 21-Nov-2018  uwe Try to provide the typesetting help requested.
 1.32 21-Nov-2018  martin Add (optional) support for expanded static menu texts - that is: whatever
the application programmer defines as expansion, e.g. to implement
parameter substitution.
While here add rudimentary documentation of the dynamic messages
feature (so at least the parser and the syntax documented here
are in sync).
The man page could use some typesetting help...
 1.31 03-Jul-2017  wiz branches: 1.31.4; 1.31.6;
Remove workaround for ancient HTML generation code.
 1.30 06-Mar-2012  mbalmer Remove the advertising clause and appease the eye a bit (still not good, but
better). Almost no functional change.
 1.29 11-Jul-2009  joerg branches: 1.29.6;
mandoc(1): -width is redundant for a item list
 1.28 10-Mar-2009  joerg Specify width for tag list.
 1.27 09-Mar-2009  joerg Fix preamble to match order set out by mdoc(7). Discussed with wiz.
 1.26 17-Jun-2006  reed branches: 1.26.28;
Another mispelling fix. I should have done these all in one commmit
but I was editing several files and didn't realize the multiple
were all in one file.
 1.25 17-Jun-2006  reed Fix typo (or mispelling).
 1.24 17-Jun-2006  reed Fix mispelling.
 1.23 02-Aug-2004  wiz branches: 1.23.6;
Sort sections; avoid to mark up punctuation unnecessarily; use \*[Lt]\*[Gt]
instead of <>; use Sq.
 1.22 02-Aug-2004  dsl Support menu windows that preserve the underlying screen contents.
(Needs a libcurses fix as well).
No need to ponce about with __m_endwin (to remember we've done endwin()),
the old recovery was wrong in any case - but I've left something that
will do an explicit redraw.
Allow the 'help' text to be from a variable (and hence translated).
Fix the display of help so that the screen underneath is actually cleared.
Preserve the screen contents while displaying help - redraw is too hard.
Use endwin(); doupdate(); to do the full refresh when ^L is typed.
Move menus up the screen if they would hit the bottom with too few lines
to show an item and the scroll text (happens with big titles).
Make 'y=0' center the window vertically - use of 0 means you can't have
a menu starting on the topline, but this is unlikely to be a problem.
Make all the menu options settable from the control file, not just from
dynamic menus.
Redo menu option list part of man page.
 1.21 11-Nov-2003  wiz branches: 1.21.4;
Bump date for last changes; remove duplicate "the"; mark up NULL.
 1.20 18-Oct-2003  dsl Add an MC_ALWAYS_SCROLL to mean "always allow space for 'scrolltext'".
All scrolltext to be #defined so it can be translated.
 1.19 27-Jul-2003  dsl More tweaks for sysinst.
Let 'display action' routine set menu->cursel (ie default menu item).
Remove 'opt' parameter I added to action routine (not that useful).
Make man page slightly closer to reality.
 1.18 09-Jun-2003  dsl More changes to improve sysinst:
- pass 'menudesc' and 'arg' values to post_act() and exit_act()
- add set_menu_numopt() for variable length menus
- fix (badly broken) allocation/free of dynamic menus
- option to allow default selection to be the exit line
 1.17 04-Jun-2003  dsl Add 'exit' (for exit text) parameter to new_menu() for dynamic menus.
Correct calculation of menu height and whether scrolling needs (was wrong
if a height was specified that was smaller that the number of lines needed).
Move keypad(m->mw, TRUE) to stop core dump when newwin() fails.
Allow for calling code hacking m->h (to reduce number of lines displayed).
Add a MC_NOCLEAR option to leave menu text showing when doing action.
 1.16 09-May-2003  wiz Join some lines; mdoc improvements; use more macros.
 1.15 09-May-2003  dsl Update man page for recent changes, update code to match man page...
 1.14 09-May-2003  phil Remove extra characters in example strings.
 1.13 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.12 05-Oct-2002  wiz Replace some \n with \en for correct display. Closes PR 18539.
 1.11 26-Sep-2002  wiz Ispell. Begin new sentences on a new line. mdoc fixes.
 1.10 24-May-2002  wiz Correct `.Na' misuses reported in bin/17007, and some other mandoc improvements
while I'm here.
 1.9 21-Mar-2002  phil branches: 1.9.2;
Fix bug in AVL tree routines. Correct man page.
 1.8 08-Feb-2002  ross Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.7 01-Dec-2001  wiz Sort sections, punctuation nits, use standard headers..
 1.6 01-Dec-2001  wiz Whitespace cleanup.
 1.5 07-Jan-2001  phil Improve a parameter list, add the actual documentation for menuc.
 1.4 31-Dec-1999  garbled branches: 1.4.4;
Add FILES and EVIRONMENT sections detailing what files these programs use,
where they live, and how to modify that behavior.
 1.3 22-Mar-1999  garbled More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Many more to
come.
 1.2 19-Oct-1997  lukem fix up .Nm usage, getopt returns -1 not EOF
 1.1 26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1 26-Sep-1997  phil Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.4.4.1 12-Aug-2003  itojun usr.bin/menuc/menuc.1 1.5
usr.bin/menuc/menu_sys.def 1.25 via patch

Improve a parameter list, add the actual documentation for menuc.
To make sysinst compile.
[masanobu, ticket #65]
 1.9.2.1 16-Jun-2003  grant Pull up revision 1.12 (requested by manu in ticket #1226):

Replace some \n with \en for correct display. Closes PR 18539.
 1.21.4.2 23-Jul-2005  snj Pull up revision 1.23 (requested by riz in ticket #5515):
Sort sections; avoid to mark up punctuation unnecessarily; use \*[Lt]\*[Gt]
instead of <>; use Sq.
 1.21.4.1 23-Jul-2005  snj Pull up revision 1.22 (requested by riz in ticket #5515):
Support menu windows that preserve the underlying screen contents.
(Needs a libcurses fix as well).
No need to ponce about with __m_endwin (to remember we've done endwin()),
the old recovery was wrong in any case - but I've left something that
will do an explicit redraw.
Allow the 'help' text to be from a variable (and hence translated).
Fix the display of help so that the screen underneath is actually cleared.
Preserve the screen contents while displaying help - redraw is too hard.
Use endwin(); doupdate(); to do the full refresh when ^L is typed.
Move menus up the screen if they would hit the bottom with too few lines
to show an item and the scroll text (happens with big titles).
Make 'y=0' center the window vertically - use of 0 means you can't have
a menu starting on the topline, but this is unlikely to be a problem.
Make all the menu options settable from the control file, not just from
dynamic menus.
Redo menu option list part of man page.
 1.23.6.1 19-Jun-2006  chap Sync with head.
 1.26.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.29.6.1 17-Apr-2012  yamt sync with head
 1.31.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.31.6.1 10-Jun-2019  christos Sync with HEAD
 1.31.4.2 18-Jan-2019  pgoyette Synch with HEAD
 1.31.4.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.19 23-Jun-2019  christos Use OPT_NOMENU instead of -1
 1.18 25-Feb-2019  martin Add an option to supress the vertical space between menu title and
menu items.
 1.17 21-Nov-2018  martin Add (optional) support for expanded static menu texts - that is: whatever
the application programmer defines as expansion, e.g. to implement
parameter substitution.
While here add rudimentary documentation of the dynamic messages
feature (so at least the parser and the syntax documented here
are in sync).
The man page could use some typesetting help...
 1.16 06-Mar-2012  mbalmer branches: 1.16.30; 1.16.32;
Remove the advertising clause and appease the eye a bit (still not good, but
better). Almost no functional change.
 1.15 20-Feb-2006  dsl branches: 1.15.44;
Allow menu entry option names to be code fragments that (should) call
wprintw(menu->mw, ftm, args) to generate the menu label.
Allows static menu labels to contain the current value (like a lot of the
dynamic menus do).
Correct width calculations, and bound menu table lookup.
 1.14 02-Aug-2004  dsl Support menu windows that preserve the underlying screen contents.
(Needs a libcurses fix as well).
No need to ponce about with __m_endwin (to remember we've done endwin()),
the old recovery was wrong in any case - but I've left something that
will do an explicit redraw.
Allow the 'help' text to be from a variable (and hence translated).
Fix the display of help so that the screen underneath is actually cleared.
Preserve the screen contents while displaying help - redraw is too hard.
Use endwin(); doupdate(); to do the full refresh when ^L is typed.
Move menus up the screen if they would hit the bottom with too few lines
to show an item and the scroll text (happens with big titles).
Make 'y=0' center the window vertically - use of 0 means you can't have
a menu starting on the topline, but this is unlikely to be a problem.
Make all the menu options settable from the control file, not just from
dynamic menus.
Redo menu option list part of man page.
 1.13 30-Nov-2003  dsl branches: 1.13.4;
Add '[no] clear' to lex/yacc spec.
Fix some menu sizing bugs for menus where the user code changes the size.
Don't reduce the size of a menu with 'scroll' every timeit is displayed.
 1.12 10-Jun-2003  dsl Add extra command 'allow dynamic messages' which will push all texts through
the msgc translation service.
Allow for texts being NULL as well as "", don't use strlen() to test for "".
 1.11 08-May-2003  dsl Accept variable names for menu titles and options to allow internationalisation.
Allow user code to define a hook to lookup message texts before any get used.
It is now possible to have a langauge independant menu file.
 1.10 07-May-2003  dsl Add left and right arrows to list of keys that page menes up/down.
Make 'page down' go to 'exit' extry on menu (not stop one short).
Make 'exitstring' imply 'exit'.
 1.9 15-Aug-2000  phil Tweek the "no shortcut" code.
MC_NOSHORTKEY to NOSHORTCUT
added option "shortcut" to menuc input language.
added example of this kind of menu in testm.
 1.8 26-Jul-1999  christos declare EXITSTRING
 1.7 20-Jun-1999  cgd provide a way to set the string used for the 'Exit' menu item.
 1.6 02-Jul-1998  phil branches: 1.6.2;
Small tweeks, redoing language for dynamic menus.
 1.5 01-Jul-1998  phil Bug fixes, tweeks to scrolling, beginnings of dynamic menus.
 1.4 25-Jun-1998  phil Add scrollable menus. Tweek testm's Makefile to remake if menu_sys.def
is modified.
 1.3 24-Jun-1998  phil Add a online help facility. Each menu can specify a help screen associated
with that menu. The help screen is scrollable for long help screens.
The char '?' accesses the help screen as a menu command. Help screen text
is specified in the menu definition file with the menu.
 1.2 09-Nov-1997  phil Add code for handling NULL return from initscr(). Added "ERROR ACTION"
for user code for above error.
 1.1 26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1 26-Sep-1997  phil branches: 1.1.1.1.2;
Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.1.1.1.2.1 09-Nov-1997  mellon Pull rev 1.2 up from trunk (phil)
 1.6.2.1 24-Jun-1999  cgd pull up rev(s) 1.7 from trunk. (cgd)
 1.13.4.1 23-Jul-2005  snj Pull up revision 1.14 (requested by riz in ticket #5515):
Support menu windows that preserve the underlying screen contents.
(Needs a libcurses fix as well).
No need to ponce about with __m_endwin (to remember we've done endwin()),
the old recovery was wrong in any case - but I've left something that
will do an explicit redraw.
Allow the 'help' text to be from a variable (and hence translated).
Fix the display of help so that the screen underneath is actually cleared.
Preserve the screen contents while displaying help - redraw is too hard.
Use endwin(); doupdate(); to do the full refresh when ^L is typed.
Move menus up the screen if they would hit the bottom with too few lines
to show an item and the scroll text (happens with big titles).
Make 'y=0' center the window vertically - use of 0 means you can't have
a menu starting on the topline, but this is unlikely to be a problem.
Make all the menu options settable from the control file, not just from
dynamic menus.
Redo menu option list part of man page.
 1.15.44.1 17-Apr-2012  yamt sync with head
 1.16.32.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.16.32.1 10-Jun-2019  christos Sync with HEAD
 1.16.30.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.1 15-Oct-2001  bjh21 Move hard-coded /usr/share/misc from mdb.c to pathnames.h, in accordance
with KNF.
 1.18 25-Feb-2019  martin Add an option to supress the vertical space between menu title and
menu items.
 1.17 21-Nov-2018  martin Add (optional) support for expanded static menu texts - that is: whatever
the application programmer defines as expansion, e.g. to implement
parameter substitution.
While here add rudimentary documentation of the dynamic messages
feature (so at least the parser and the syntax documented here
are in sync).
The man page could use some typesetting help...
 1.16 06-Mar-2012  mbalmer branches: 1.16.30; 1.16.32;
Remove the advertising clause and appease the eye a bit (still not good, but
better). Almost no functional change.
 1.15 29-Oct-2009  christos branches: 1.15.6;
option noinput
 1.14 02-Aug-2004  dsl Support menu windows that preserve the underlying screen contents.
(Needs a libcurses fix as well).
No need to ponce about with __m_endwin (to remember we've done endwin()),
the old recovery was wrong in any case - but I've left something that
will do an explicit redraw.
Allow the 'help' text to be from a variable (and hence translated).
Fix the display of help so that the screen underneath is actually cleared.
Preserve the screen contents while displaying help - redraw is too hard.
Use endwin(); doupdate(); to do the full refresh when ^L is typed.
Move menus up the screen if they would hit the bottom with too few lines
to show an item and the scroll text (happens with big titles).
Make 'y=0' center the window vertically - use of 0 means you can't have
a menu starting on the topline, but this is unlikely to be a problem.
Make all the menu options settable from the control file, not just from
dynamic menus.
Redo menu option list part of man page.
 1.13 18-Jul-2004  dsl Make '0' be a valid number
 1.12 30-Nov-2003  dsl branches: 1.12.4;
Add '[no] clear' to lex/yacc spec.
Fix some menu sizing bugs for menus where the user code changes the size.
Don't reduce the size of a menu with 'scroll' every timeit is displayed.
 1.11 27-Sep-2003  dsl Allow -ve integer constants in menu file.
Make y == -1 => after current messages (if msg_defs.h included).
Defer menu initialisation until after post_act() called (so function can
fiddle with more things.)
 1.10 10-Jun-2003  dsl Add extra command 'allow dynamic messages' which will push all texts through
the msgc translation service.
Allow for texts being NULL as well as "", don't use strlen() to test for "".
 1.9 15-Aug-2000  phil Tweek the "no shortcut" code.
MC_NOSHORTKEY to NOSHORTCUT
added option "shortcut" to menuc input language.
added example of this kind of menu in testm.
 1.8 20-Jun-1999  cgd provide a way to set the string used for the 'Exit' menu item.
 1.7 02-Jul-1998  phil branches: 1.7.2;
Small tweeks, redoing language for dynamic menus.
 1.6 01-Jul-1998  phil Bug fixes, tweeks to scrolling, beginnings of dynamic menus.
 1.5 25-Jun-1998  phil Add scrollable menus. Tweek testm's Makefile to remake if menu_sys.def
is modified.
 1.4 24-Jun-1998  phil Add a online help facility. Each menu can specify a help screen associated
with that menu. The help screen is scrollable for long help screens.
The char '?' accesses the help screen as a menu command. Help screen text
is specified in the menu definition file with the menu.
 1.3 09-Apr-1998  tv .y.c <sys.mk> rule fixes. Don't create a y.tab.h file unless asked for,
and use smarter creation of the header file.
 1.2 09-Nov-1997  phil Add code for handling NULL return from initscr(). Added "ERROR ACTION"
for user code for above error.
 1.1 26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1 26-Sep-1997  phil branches: 1.1.1.1.2;
Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.1.1.1.2.1 09-Nov-1997  mellon Pull rev 1.2 up from trunk (phil)
 1.7.2.1 24-Jun-1999  cgd pull up rev(s) 1.8 from trunk. (cgd)
 1.12.4.2 23-Jul-2005  snj Pull up revision 1.13 (requested by riz in ticket #5515):
Make '0' be a valid number
 1.12.4.1 23-Jul-2005  snj Pull up revision 1.14 (requested by riz in ticket #5515):
Support menu windows that preserve the underlying screen contents.
(Needs a libcurses fix as well).
No need to ponce about with __m_endwin (to remember we've done endwin()),
the old recovery was wrong in any case - but I've left something that
will do an explicit redraw.
Allow the 'help' text to be from a variable (and hence translated).
Fix the display of help so that the screen underneath is actually cleared.
Preserve the screen contents while displaying help - redraw is too hard.
Use endwin(); doupdate(); to do the full refresh when ^L is typed.
Move menus up the screen if they would hit the bottom with too few lines
to show an item and the scroll text (happens with big titles).
Make 'y=0' center the window vertically - use of 0 means you can't have
a menu starting on the topline, but this is unlikely to be a problem.
Make all the menu options settable from the control file, not just from
dynamic menus.
Redo menu option list part of man page.
 1.15.6.1 17-Apr-2012  yamt sync with head
 1.16.32.1 10-Jun-2019  christos Sync with HEAD
 1.16.30.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.6 23-Jun-2019  christos don't cast malloc.
 1.5 06-Mar-2012  mbalmer branches: 1.5.32;
Remove the advertising clause and appease the eye a bit (still not good, but
better). Almost no functional change.
 1.4 20-Jun-2004  jmc branches: 1.4.50;
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
 1.3 17-Jul-2003  lukem branches: 1.3.2;
only use __RCSID() if it is #defined
 1.2 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.1 26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1 26-Sep-1997  phil Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.3.2.1 22-Jun-2004  tron Pull up revision 1.4 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
 1.4.50.1 17-Apr-2012  yamt sync with head
 1.5.32.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.17 21-Apr-2012  roy Add capfile(5) to describe the termcap format.
Adjust various man pages and other documentation to point to capfile(5)
instead of termcap(5).
Remove getcap(3) as curses hasn't been building it for a long time.
Punt wrterm.c as tset no longer uses it.
 1.16 14-Apr-2009  lukem branches: 1.16.6;
Enable WARNS=4 by default for usr.bin, except for:
awk bdes checknr compile_et error gss hxtool kgetcred kinit
klist ldd less lex locale login m4 man menuc mk_cmds
mklocale msgc openssl rpcgen rpcinfo sdiff spell ssh
string2key telnet tn3270 verify_krb5_conf xlint
 1.15 12-Dec-2001  lukem branches: 1.15.44;
Set NOxxx= before <bsd.own.mk> is pulled in (even indirectly).
Otherwise the appropriate MKxxx=no won't be defined .
 1.14 12-Dec-2001  tv MKfoo=no -> NOfoo
 1.13 07-Jan-2001  phil Include the definition of PRINTOBJDIR before using it.
 1.12 30-Dec-2000  sommerfeld Let src/usr.bin build with recursive parallel make..
- add .WAIT and .NOTPARALLEL in a few places
- change ${MAKE} print-objdir to ${PRINTOBJDIR}
- convert other ad-hoc forms to use ${PRINTOBJDIR}
 1.11 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.10 23-Jul-1998  phil Put back "return value" meaning in option actions accidentally removed
in chanages for dynamic menus. (Return !=0 means to exit menu dynamically.)
 1.9 16-Jul-1998  phil Major restructuring of the runtime code, now supports dynamic menus.
Fixed a bug is scrolling. Added dynamic menu to test meuns in testm.
 1.8 29-Jun-1998  phil Bug fixes in scrolling menues, better error detection with small screens,
bettern keypad support with suport form multiple key "commands" like
ESC-v for previous page.
 1.7 25-Jun-1998  phil Add scrollable menus. Tweek testm's Makefile to remake if menu_sys.def
is modified.
 1.6 24-Jun-1998  phil Add -ltermcap.
 1.5 18-Feb-1998  jtc Simply include -lcurses instead of -lcurses -ltermcap
 1.4 22-Oct-1997  lukem use CPPFLAGS instead of CFLAGS
 1.3 11-Oct-1997  mycroft branches: 1.3.2;
Also need -I. to get menu_defs.h in an obj dir.
 1.2 11-Oct-1997  mycroft Clean this up, and make it work with obj directories.
 1.1 26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1 26-Sep-1997  phil Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.3.2.1 08-Nov-1997  lukem sync with trunk (approved by thorpej)
 1.15.44.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.16.6.1 23-May-2012  yamt sync with head.
 1.8 03-Dec-2019  uwe Fix typo in ad clause. Ok perry@.
 1.7 23-Jan-2018  sevan branches: 1.7.4; 1.7.6;
drop main() prototype
 1.6 17-Sep-2004  wrstuden Catch up with current menuc.
 1.5 04-Jun-2003  dsl branches: 1.5.4;
Add 'exit' (for exit text) parameter to new_menu() for dynamic menus.
Correct calculation of menu height and whether scrolling needs (was wrong
if a height was specified that was smaller that the number of lines needed).
Move keypad(m->mw, TRUE) to stop core dump when newwin() fails.
Allow for calling code hacking m->h (to reduce number of lines displayed).
Add a MC_NOCLEAR option to leave menu text showing when doing action.
 1.4 15-Aug-2000  phil Tweek the "no shortcut" code.
MC_NOSHORTKEY to NOSHORTCUT
added option "shortcut" to menuc input language.
added example of this kind of menu in testm.
 1.3 23-Jul-1998  phil Put back "return value" meaning in option actions accidentally removed
in chanages for dynamic menus. (Return !=0 means to exit menu dynamically.)
 1.2 16-Jul-1998  phil Major restructuring of the runtime code, now supports dynamic menus.
Fixed a bug is scrolling. Added dynamic menu to test meuns in testm.
 1.1 26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1 26-Sep-1997  phil Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.5.4.1 23-Jul-2005  snj Pull up revision 1.6 (requested by riz in ticket #5515):
Catch up with current menuc.
 1.7.6.1 09-Dec-2019  martin Pull up following revision(s) (requested by uwe in ticket #520):

usr.bin/menuc/testm/main.c: revision 1.8
usr.bin/menuc/testm/menus.mc: revision 1.13

Fix typo in ad clause. Ok perry@.
 1.7.4.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.13 03-Dec-2019  uwe Fix typo in ad clause. Ok perry@.
 1.12 25-Feb-2019  martin branches: 1.12.2;
Add an option to supress the vertical space between menu title and
menu items.
 1.11 17-Sep-2004  wrstuden branches: 1.11.92;
Scoot a menu so it fits better in an xterm.
 1.10 15-Aug-2000  phil branches: 1.10.6;
Tweek the "no shortcut" code.
MC_NOSHORTKEY to NOSHORTCUT
added option "shortcut" to menuc input language.
added example of this kind of menu in testm.
 1.9 16-Jul-1998  phil Major restructuring of the runtime code, now supports dynamic menus.
Fixed a bug is scrolling. Added dynamic menu to test meuns in testm.
 1.8 02-Jul-1998  phil Small tweeks, redoing language for dynamic menus.
 1.7 01-Jul-1998  phil Bug fixes, tweeks to scrolling, beginnings of dynamic menus.
 1.6 29-Jun-1998  phil Correct a menu title.
 1.5 29-Jun-1998  phil Bug fixes in scrolling menues, better error detection with small screens,
bettern keypad support with suport form multiple key "commands" like
ESC-v for previous page.
 1.4 25-Jun-1998  phil Add scrollable menus. Tweek testm's Makefile to remake if menu_sys.def
is modified.
 1.3 24-Jun-1998  phil Add a online help facility. Each menu can specify a help screen associated
with that menu. The help screen is scrollable for long help screens.
The char '?' accesses the help screen as a menu command. Help screen text
is specified in the menu definition file with the menu.
 1.2 09-Nov-1997  phil Add code for handling NULL return from initscr(). Added "ERROR ACTION"
for user code for above error.
 1.1 26-Sep-1997  phil branches: 1.1.1;
Initial revision
 1.1.1.1 26-Sep-1997  phil Add a curses based menu compiler system. (Used by the new system install
program sysinst.)
 1.10.6.1 23-Jul-2005  snj Pull up revision 1.11 (requested by riz in ticket #5515):
Scoot a menu so it fits better in an xterm.
 1.11.92.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.11.92.1 10-Jun-2019  christos Sync with HEAD
 1.12.2.1 09-Dec-2019  martin Pull up following revision(s) (requested by uwe in ticket #520):

usr.bin/menuc/testm/main.c: revision 1.8
usr.bin/menuc/testm/menus.mc: revision 1.13

Fix typo in ad clause. Ok perry@.
 1.1 16-Jul-1998  phil Major restructuring of the runtime code, now supports dynamic menus.
Fixed a bug is scrolling. Added dynamic menu to test meuns in testm.

RSS XML Feed