Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.lyse.net!news.lyse.net.POSTED!not-for-mail NNTP-Posting-Date: Wed, 14 Dec 2011 01:49:23 -0600 Date: Wed, 14 Dec 2011 08:48:01 +0100 From: David Brown User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 Newsgroups: comp.os.linux.development.apps Subject: Re: file parsing References: <8762hkyu5j.fsf@araminta.anjou.terraraq.org.uk> <87r508ulm1.fsf@sapphire.mobileactivedefense.com> In-Reply-To: <87r508ulm1.fsf@sapphire.mobileactivedefense.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <2dGdnSLHFvOeyHXTnZ2dnUVZ7rSdnZ2d@lyse.net> Lines: 27 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-hqkBzrCHoQgluo2JULHL3+A28PJop4EFN596+2lCq4Hn3q5KzlIixIT0BwviXgZwSGlY3lVrncM3vgb!CFBoDMT40HJ09MLzLcFVSFYS3cvgfkR/6qU8cDZ3oOkulqVwa2t/SnhhVfuw7jCi/jGCKgCpOyF4!Y8Ir X-Complaints-To: abuse@altibox.no X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2225 Xref: x330-a1.tempe.blueboxinc.net comp.os.linux.development.apps:315 On 13/12/2011 23:56, Rainer Weikusat wrote: > Bill M writes: >> On 12/13/2011 4:38 PM, Richard Kettlewell wrote: > > [...] > >>> XML is a poor choice for config files, > > [...] > >> I found this for parsing ini config files: >> >> http://code.google.com/p/inih/ >> >> Looks like exactly what I'm looking for. > > If your requirements are simple enough, consider not parsing a config > file: Anything which can be expressed as otherwise unstructured list > of name=value pairs can be put into a file the shell can source and > then start another program with a set of command-line arguments > derived from the parameters. It also depends on your choice of language. For example, if the program is in Python or Perl, you could have your settings in a Python or Perl program - use the language itself as the parser. Obviously you'll want to be careful about security in such cases.