From dev-return-17583-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Mon Nov 20 19:44:35 2006 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 73926 invoked from network); 20 Nov 2006 19:44:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Nov 2006 19:44:34 -0000 Received: (qmail 61043 invoked by uid 500); 20 Nov 2006 19:44:43 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 60891 invoked by uid 500); 20 Nov 2006 19:44:42 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 60880 invoked by uid 99); 20 Nov 2006 19:44:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Nov 2006 11:44:42 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [207.155.248.4] (HELO repulse.cnchost.com) (207.155.248.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Nov 2006 11:44:28 -0800 Received: from [192.168.0.21] (c-24-15-193-17.hsd1.il.comcast.net [24.15.193.17]) (as wrowe@rowe-clan.net) by repulse.cnchost.com (ConcentricHost(2.54) Relay) with ESMTP id EE0173932; Mon, 20 Nov 2006 14:44:07 -0500 (EST) Message-ID: <45620589.6070508@rowe-clan.net> Date: Mon, 20 Nov 2006 13:44:09 -0600 From: "William A. Rowe, Jr." User-Agent: Thunderbird 1.5.0.7 (X11/20060913) MIME-Version: 1.0 To: Lucian Adrian Grijincu CC: Mike Mueller , dev@apr.apache.org Subject: Re: Getting the current environment (all of it) References: <4561A625.3060809@avira.com> In-Reply-To: <4561A625.3060809@avira.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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 :) >