Csound Csound-dev Csound-tekno Search About

[Cs-dev] [PATCH] Environment variable delimiter for multiple paths

Date2013-09-02 08:56
FromJesse Lucas
Subject[Cs-dev] [PATCH] Environment variable delimiter for multiple paths
AttachmentsNone  

Date2013-09-02 15:04
FromRichard Henninger
SubjectRe: [Cs-dev] [PATCH] Environment variable delimiter for multiple paths
AttachmentsNone  None  
This seems similar to the forward and back slash issue with unix and windows paths.  Permitting either has promoted sharing of csd’s, for example, by not having to change relative path syntax between platforms.
 
I’d think that environment variable delimiters might optimally be solved in a similar manner: that any reasonable delimiter - semicolon, colon or even whitespace or comma be allowed on input to a function whether it be by stack argument, csd value or environment variable read.  Simply apply character substitution into an internal delimiter before applying any internal algorithm to the list.
 
On output from an algorithm, say to an environment variable, use character substitution from an internal delimiter to the standard  delimiter for a given platform.  Writing to an OS asset is the only time csound should care about platform specific delimiters - similar to when it works with file paths.
 
This seems to better promote platform independence in exchanging csound data than would accomodating delimiters on a platform specific basis.
 
Richard Henninger
richard@rghmusic.com
 
From: Jesse Lucas
Sent: ‎Monday‎, ‎September‎ ‎02‎, ‎2013 ‎4‎:‎16‎ ‎AM
To: csound-devel@lists.sourceforge.net
 
For a long time I thought Csound environment variables like $INCDIR
were only able to contain one path.  When I finally looked at the code
I realized they do support multiple paths, but the paths must be
separated by semicolons.

Using semicolons for path separators in environment variables is a
Microsoft Windows convention.  Unix traditionally uses colons for this
purpose.

Maybe you will consider something like the following patch which sets
the default environment variable path separator to a colon, and only
uses a semicolon when WIN32 is defined.

I hope this would make the multiple path behavior more easily
discoverable for Unix users.

This patch was built and tested on Linux only, so definitely needs a
look on Windows and other platforms.

Cheers,

J

P.S. Currently in git include/sysdep.h is duplicated in its entirety
in...

    iOS/Csound iOS Examples/csound-iOS/headers/sysdep.h

This patch does not modify that copy of the file.

Jesse Lucas (1):
  Use colon as env var element delimiter on Unix

 Engine/envvar.c  |   16 +++++++++-------
 include/sysdep.h |    6 ++++++
 2 files changed, 15 insertions(+), 7 deletions(-)

--
1.7.10.4


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Date2013-09-07 15:29
FromSteven Yi
SubjectRe: [Cs-dev] [PATCH] Environment variable delimiter for multiple paths
Hi Richard and Jesse,

Could one of you perhaps add a ticket to the Csound tracker for this?
I think most of the main devs have been pre-occupied with DAFx and
probably won't get to look at this for a little bit, and I didn't want
this issue to get lost.

Thanks!
steven

On Mon, Sep 2, 2013 at 3:04 PM, Richard Henninger  wrote:
> This seems similar to the forward and back slash issue with unix and windows
> paths.  Permitting either has promoted sharing of csd’s, for example, by not
> having to change relative path syntax between platforms.
>
> I’d think that environment variable delimiters might optimally be solved in
> a similar manner: that any reasonable delimiter - semicolon, colon or even
> whitespace or comma be allowed on input to a function whether it be by stack
> argument, csd value or environment variable read.  Simply apply character
> substitution into an internal delimiter before applying any internal
> algorithm to the list.
>
> On output from an algorithm, say to an environment variable, use character
> substitution from an internal delimiter to the standard  delimiter for a
> given platform.  Writing to an OS asset is the only time csound should care
> about platform specific delimiters - similar to when it works with file
> paths.
>
> This seems to better promote platform independence in exchanging csound data
> than would accomodating delimiters on a platform specific basis.
>
> Richard Henninger
> richard@rghmusic.com
>
> From: Jesse Lucas
> Sent: Monday, September 02, 2013 4:16 AM
> To: csound-devel@lists.sourceforge.net
>
> For a long time I thought Csound environment variables like $INCDIR
> were only able to contain one path.  When I finally looked at the code
> I realized they do support multiple paths, but the paths must be
> separated by semicolons.
>
> Using semicolons for path separators in environment variables is a
> Microsoft Windows convention.  Unix traditionally uses colons for this
> purpose.
>
> Maybe you will consider something like the following patch which sets
> the default environment variable path separator to a colon, and only
> uses a semicolon when WIN32 is defined.
>
> I hope this would make the multiple path behavior more easily
> discoverable for Unix users.
>
> This patch was built and tested on Linux only, so definitely needs a
> look on Windows and other platforms.
>
> Cheers,
>
> J
>
> P.S. Currently in git include/sysdep.h is duplicated in its entirety
> in...
>
>     iOS/Csound iOS Examples/csound-iOS/headers/sysdep.h
>
> This patch does not modify that copy of the file.
>
> Jesse Lucas (1):
>   Use colon as env var element delimiter on Unix
>
>  Engine/envvar.c  |   16 +++++++++-------
>  include/sysdep.h |    6 ++++++
>  2 files changed, 15 insertions(+), 7 deletions(-)
>
> --
> 1.7.10.4
>
>
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-09-07 15:43
FromRichard Henninger
SubjectRe: [Cs-dev] [PATCH] Environment variable delimiter for multiple paths
AttachmentsNone  None  
Happy to do so.
 
Richard Henninger
richard@rghmusic.com
 
From: Steven Yi
Sent: ‎Saturday‎, ‎September‎ ‎07‎, ‎2013 ‎10‎:‎30‎ ‎AM
To: Developer discussions
 
Hi Richard and Jesse,

Could one of you perhaps add a ticket to the Csound tracker for this?
I think most of the main devs have been pre-occupied with DAFx and
probably won't get to look at this for a little bit, and I didn't want
this issue to get lost.

Thanks!
steven

On Mon, Sep 2, 2013 at 3:04 PM, Richard Henninger <richard@rghmusic.com> wrote:
> This seems similar to the forward and back slash issue with unix and windows
> paths.  Permitting either has promoted sharing of csd’s, for example, by not
> having to change relative path syntax between platforms.
>
> I’d think that environment variable delimiters might optimally be solved in
> a similar manner: that any reasonable delimiter - semicolon, colon or even
> whitespace or comma be allowed on input to a function whether it be by stack
> argument, csd value or environment variable read.  Simply apply character
> substitution into an internal delimiter before applying any internal
> algorithm to the list.
>
> On output from an algorithm, say to an environment variable, use character
> substitution from an internal delimiter to the standard  delimiter for a
> given platform.  Writing to an OS asset is the only time csound should care
> about platform specific delimiters - similar to when it works with file
> paths.
>
> This seems to better promote platform independence in exchanging csound data
> than would accomodating delimiters on a platform specific basis.
>
> Richard Henninger
> richard@rghmusic.com
>
> From: Jesse Lucas
> Sent: Monday, September 02, 2013 4:16 AM
> To: csound-devel@lists.sourceforge.net
>
> For a long time I thought Csound environment variables like $INCDIR
> were only able to contain one path.  When I finally looked at the code
> I realized they do support multiple paths, but the paths must be
> separated by semicolons.
>
> Using semicolons for path separators in environment variables is a
> Microsoft Windows convention.  Unix traditionally uses colons for this
> purpose.
>
> Maybe you will consider something like the following patch which sets
> the default environment variable path separator to a colon, and only
> uses a semicolon when WIN32 is defined.
>
> I hope this would make the multiple path behavior more easily
> discoverable for Unix users.
>
> This patch was built and tested on Linux only, so definitely needs a
> look on Windows and other platforms.
>
> Cheers,
>
> J
>
> P.S. Currently in git include/sysdep.h is duplicated in its entirety
> in...
>
>     iOS/Csound iOS Examples/csound-iOS/headers/sysdep.h
>
> This patch does not modify that copy of the file.
>
> Jesse Lucas (1):
>   Use colon as env var element delimiter on Unix
>
>  Engine/envvar.c  |   16 +++++++++-------
>  include/sysdep.h |    6 ++++++
>  2 files changed, 15 insertions(+), 7 deletions(-)
>
> --
> 1.7.10.4
>
>
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

Date2013-09-09 02:57
FromJesse Lucas
SubjectRe: [Cs-dev] Environment variable delimiter for multiple paths
AttachmentsNone