Added more environment functions.
authorIain Patterson <me@iain.cx>
Thu, 23 Jan 2014 21:12:43 +0000 (21:12 +0000)
committerIain Patterson <me@iain.cx>
Thu, 23 Jan 2014 21:12:43 +0000 (21:12 +0000)
commit2e3a41e1d5dea82a7f36b331df59ed7532b30b8c
treedc2579c41f1f8d58cf8159862fc3a7b496aa0c63
parent77855b77fa52ac6e844377a191c2ae836a32b5bd
Added more environment functions.

useful_environment() skips the uninteresting variables at the start of
an environment block, returning a pointer to the first useful variable.

expand_environment_string() expands a string with
ExpandEnvironmentStrings() and returns a pointer to the expanded string,
which must be freed after use.

set_environment_block() iterates through all the variables in an
environment block, expands each one with expand_environment_string() and
calls SetEnvironmentVariable() with the expanded value.

clear_environment() removes all variables from the current environment.

duplicate_environment() duplicates an environment block by first calling
clear_environment() then set_environment_block() with the source block.
Thus it ensures that the variables in the block - and only those - are
set in the current environment.
env.cpp
env.h