help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] How to access environment variables ?


From: Mehul Sanghvi
Subject: Re: [Help-smalltalk] How to access environment variables ?
Date: Sat, 26 Mar 2011 10:04:37 -0400

On Sat, Mar 26, 2011 at 03:10, Paolo Bonzini <address@hidden> wrote:
> On 03/26/2011 02:12 AM, Mehul Sanghvi wrote:
>>
>> OK so once I  modify kernel/CFuncs.st and I believe I need to also
>> modify libgst/cint.c what else do I need to do in order to get this to
>> work ?
>>
>>
>> In kernel/CFuncs.st
>>
>>     environ: aString [
>>        <category: 'c call-outs'>
>>        <cCall: 'environ' returning: #(#ptr #string) args: #()>
>>
>>     ]
>
> Where did you add this?
>

I did that right below where there was a similar
bit of code for getenv.  I just copied that piece of
code and adjusted it based on the information
in this mailing list thread.


>> and in libgst/cint.c
>>
>>   _gst_define_cfunc ("getenv", getenv);
>>   _gst_define_cfunc ("environ", environ);
>
> You should do
>
> static char **get_environ(void)
> {
>  return environ;
> }
>
> ...
>
>  _gst_define_cfunc ("get_environ", get_environ);
>
> Paolo
>



-- 
Mehul N. Sanghvi
email: address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]