Csound Csound-dev Csound-tekno Search About

[Cs-dev] Static hunt and env vars

Date2011-04-10 11:47
Fromjohn ffitch
Subject[Cs-dev] Static hunt and env vars
There is an API function (?)
PUBLIC int csoundSetGlobalEnv(const char *name, const char *value);
which does not take a CSOUND* argument.  Actually this function sets a
static variable which seems to me to break re-entrance.  Clearly the
static in question (globalEnvVars) can be moved to the CSOUND
structure, but then csoundSetGlobalEnv cannot see it. 

The "easiest" fix is to add a CSOUND* argument to csoundSetGlobalEnv,
but that means a major API bump.

What solution have I missed?

==John ffitch
  (who is after another static hunt)

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2011-04-10 11:55
FromAndres Cabrera
SubjectRe: [Cs-dev] Static hunt and env vars
Hi,

Maybe there are cases where the envvars need to be set before the
CSOUND struct is allocated? (e.g. OPCODEDIR?)

Cheers,
Andres

On Sun, Apr 10, 2011 at 11:47 AM, john ffitch  wrote:
> There is an API function (?)
> PUBLIC int csoundSetGlobalEnv(const char *name, const char *value);
> which does not take a CSOUND* argument.  Actually this function sets a
> static variable which seems to me to break re-entrance.  Clearly the
> static in question (globalEnvVars) can be moved to the CSOUND
> structure, but then csoundSetGlobalEnv cannot see it.
>
> The "easiest" fix is to add a CSOUND* argument to csoundSetGlobalEnv,
> but that means a major API bump.
>
> What solution have I missed?
>
> ==John ffitch
>  (who is after another static hunt)
>
> ------------------------------------------------------------------------------
> Xperia(TM) PLAY
> It's a major breakthrough. An authentic gaming
> smartphone on the nation's most reliable network.
> And it wants your games.
> http://p.sf.net/sfu/verizon-sfdev
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sour

Date2011-04-10 12:14
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] Static hunt and env vars
> Hi,
>
> Maybe there are cases where the envvars need to be set before the
> CSOUND struct is allocated? (e.g. OPCODEDIR?)
>


Ye sI guess so; so does this static not matter?  It is glbal to the entire
process and not lonked to the csound instance?.  So all instances must
have the same OPCODEDIR, directoiries etc....?

If everyone is happy with that i will continue the static hunt elsewhere
Just found one in new parser, and there are some others in the lexer.

==John ff


------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net