(BWDIC!) Rewrite variable handling..
commitf0ac705f5884e07b9200cab4860f0a55c1535220
authorSteffen (Daode) Nurpmeso <steffen@sdaoden.eu>
Thu, 12 May 2016 14:58:01 +0000 (12 16:58 +0200)
committerSteffen (Daode) Nurpmeso <steffen@sdaoden.eu>
Thu, 15 Sep 2016 13:57:41 +0000 (15 15:57 +0200)
treee7e1309a34fb6001716e09463c008924eab9c0dc
parentc15c4f7e3eea0c3e160159915a8a2c04eb5b7f2c
(BWDIC!) Rewrite variable handling..

Thinking about (accmacvar.c+: add VM_ENVIRON..): this is not
sufficient.  For long we have had TODO entries of being more
automatic, and so go the hard way and implement that _now_!

This means that we need informations wether a variable needs to be
synchronized with the environment, wether it shall be imported
from there at first, we need to be able to deduce default values
for unset variables, learn about first-time-init values in order
to honour POSIX default settings etc., and honour them.

Since this required to add all environment-based variables to our
enum okeys, we now can drop the env_*() function series, and can
get rid of some unrolled string matches to prevent undesired key
deletions.
This however means that some no longer covered special cases must
be handled by directly calling getenv(3) (again), but i think
that's worth it!

Since one of (un)?setenv(3) or putenv(3) is now mandatory we have
all the necessary wisdom to synchronize ourselves as appropriate.
We don't provide full-featured support for the putenv(3)/environ
case in respect to "environ unset" because it would be much too
cumbersome, especially given that setenv(3) has been standardized
~Y2000.  We simply don't support adjusting ANY environment
variable then, but only those that we somehow learned to manage.

Note that these changes mean that we _no longer accept environment
variables as internal variables_!!
E.g.,
  password=PASS s-nail
will NOT work no more!

Also, let's drop `setenv' and `unsetenv' commands, but instead
replace them with an `environ' multiplexer that knows about
the subcommands "set", "unset" and "link", the latter allows ANY
variable to become imported as an internal variable, with
automatic environment update on change.  Unfortunately we cannot
simply extend the syntax _today_ for something like awk(1)
ENVIRON[] array, which is a real pity.

Change the `set' listing mode so that more information about
variables are shown if *debug* or *verbose* is set.
Ditto, change `varshow' to simply produce the same output but for
the given variables only.
Drop *bsdset*, it won't work out no more.
accmacvar.c
cmd_tab.h
main.c
nail.1
nail.rc
nailfuns.h
openssl.c
quit.c