apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: Getting the current environment (all of it)
Date Mon, 20 Nov 2006 19:44:09 GMT
Just be aware we get the ENTIRE environment table from unicode as UTF-8,
which means it's lossless (as opposed to most C programs which translate
the unicode to the SBCS in use, and can't handle arbitrary unicode envvar
text), and also means what you inject should also be in UTF-8.

We update our own API as well as _environ.

Lucian Adrian Grijincu wrote:
> in windows you can access the environ variable the same way as you would
> on unices, just that it's named _environ.
>     http://msdn2.microsoft.com/en-us/library/stxk41x1(VS.80).aspx
> you just need to #define environ _environ and you've got the same name
> on both windows and unices.
> and I believe that you can do the same on other systems too
> you could make a deep copy of this variable (let's name this copy
> newenviron), append the new entries that you require(or modify existing
> ones) and pass newenviron to apr_proc_create. this way you don't have to
> modify the parent's variables and reset them.
> en entry in environ is a NUL terminated string of the form
> ENV_VARIABLE=ENV_VALUE and the last entry must be a NULL one.
> HTH :)

View raw message