Re: [dev] Config files

From: Patrick Haller <201009-suckless_AT_haller.ws>
Date: Wed, 9 Feb 2011 23:23:15 +0800

On Wed, Feb 09, 2011 at 02:28:42PM +0100, crap_AT_wzff.de wrote:
>
> An alternative to this would be exporting these variables as
> environment variables. This way you don't have to do any parsing on
> your own (well, maybe inside the strings but not externally). Of
> course it only works for very simple use cases which don't need dozens
> of variables

well, don't beat up only one of the twins:

extern char **environ;
extern char **argv;

char *foo = NULL;
foo = getenv("foo");
environ = argv;
if (getenv("foo") != NULL)
    foo = getenv("foo");

Patrick
Received on Wed Feb 09 2011 - 16:23:15 CET

This archive was generated by hypermail 2.2.0 : Wed Feb 09 2011 - 16:36:02 CET