Add terminfo(5) support (via WANT_TERMCAP_PREFER_TERMINFO)..
On most modern systems termcap(5) is in fact provided by
ncurses(3) from GNU a.k.a. Thomas Dickey, being only a wrapper
around terminfo(5) functionality.
For one this wrapper mechanism is not for free.
And then Thomas Dickey has a strong preference for terminfo(5),
and has so even longer than he is maintainer of ncurses(3), that
being twenty years. For termcap(5) this means that many keycodes
that terminfo(5) provides have no equivalence in termcap(5), or
could have an equivalence but noone ever cared: this includes the
entire BSD community which seemed and seems to leave him alone.
Of course the names of these combinations would be sick due to the
two-letter restriction of termcap(5), whereas terminfo(5) can use
names like kLFT7 (for control-alt-cursor-left). ^.^
Support terminfo(5) if available, give users the option to choose
termcap(5) nonetheless via the new WANT_TERMCAP_PREFER_TERMINFO
option, but which defaults to yes.
For the commands which are always queried and which need to be
termcap(5)-compatible forever continue to use termcap(5) names.
But for the now lazy-loaded queries switch and use the longer and
most often more descriptive and thus user friendlier terminfo(5)
names instead. (Easier for the upcoming `bind' functionality of
the MLE.)
To ease maintenance take the same approach that has been chosen
for the internal variables (enum okeys) and add a small script
that generates the new header tcaps.h from enum information found
in nail.h. This also allows saving space by separating the string
information (terminfo(5) are variable-sized) from the control
flags etc.