Re: [dev] Config files

From: <crap_AT_wzff.de>
Date: Wed, 09 Feb 2011 14:28:42 +0100

Excerpts from Connor Lane Smith's message of Wed Feb 09 12:29:31 +0100 2011:
> If your options are fairly simple (i.e., no nested structures etc),
> you could just make the config file valid shell:
>
> > key1=value1
> > key2=value2
>
> Trivial to parse in C, and you can pull the config into your script with:
> . config

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
Received on Wed Feb 09 2011 - 14:28:42 CET

This archive was generated by hypermail 2.2.0 : Wed Feb 09 2011 - 14:36:03 CET