INN config file parsing infrastructure

Aidan Cully aidan at
Fri May 19 05:23:47 UTC 2000

If you're willing to change the syntax to be more line-oriented, allow
me to show you a syntax I've been using in a local project.  The
following groups are all equivalent:

in main file:
group "name" {
	param: "string"
group "name" param: "string"
group "name" include "file1"
group "name" {
	include "file1"
include "file2"

in file "file1":
param: "string"

in file "file2":
group "name" param: "string"

The interesting line, to me, is 'group "name" include "file1"'.  Neat
properties of this are:
 * it can seperate out administrative control over different parts of
   the configuration.
 * you could provide backwards-compatible support for inn.conf (and to
   a lesser extent, incoming.conf, storage.conf and readers.conf),
   while still allowing for all configuration to happen in a single
   file, if you want.
A 'news.conf' file could look like:
options include "inn.conf"
incoming include "incoming.conf"
readers include "readers.conf"
storage include "storage.conf"
(which also allows another benefit, in that users could rename the
inn.conf, &c., if they wanted, without really hacking the source.  the
location of the 'news.conf' file could be an argument to configure, or
Of course, if it's wanted, you could do the same sort of thing in the
readers.conf, and elsewheres:
access "users" include "access/users"

I have code to parse this stuff kind of generically, but I don't think
anyone (and I include myself, here) would want to use it, since I know
of a couple of bugs.  I consider this time a kind of a "brainstorming"
time, and you may want to consider the feature when working out your
configuration engine.  And then maybe I can steal your engine for use
in my local projects. :-)

Aidan Cully       "Specialists without spirit, sensualists without heart;
Not Panix Staff    this nullity imagines that it has attained a level of
aidan at    civilization never before achieved."   -- Goethe

More information about the inn-workers mailing list