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).
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...
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.
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.
(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.
_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