Re: [AD] [WIN] mt timer disable option

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Vincent Penquerc'h wrote:
> 
> > If we wanted to have an end-of-section marker, we could just use
> > [] and make NULL section name be equivalent to the empty string.
> > It's a bit hacky though, and kind of pointless if we change
> > Allegro and recommend that people (in their own code) either use
> > sections for everything, or for nothing at all.
> 
> I do not like the end of section marker, for the same reason you
> mention. My vote would be to deprecate the NULL section, and add a
> comment in the manual to say so, and to encourage people who want
> to add sppecific data in a config file to do so with a section name.
> another solution would be to rewrite the parser to have a different
> syntax, like:
> 
> graphics = {
>   gfx_card = "FB",
>   width = "640",
>   height = "480"
> }
> 
> but this is probably overkill :)
> this would allow nested sections though ...

overkill? If you want one theres one on my website :)
syntax looks like:

[graphics] {
  gfx_card = "FB"
  width = "640"
  height = "480"
}

and if you really like the standard format just
add a ':simple' and the lib will read the rest of the section
in regular nonested .ini mode. To change back before the
section ends add a ':nested'.

[graphics] {
  gfx_card = "FB"
  width = "640"
  height = "480"
:simple
  [FB]
    foo = 1
    bar = 2
  [XWin]
    foo = 1
    bar = 3 
:nested
  [foo] {
    [bar] {
      joe = 3
    }
  }
}

The C api is very similar to Allegro's
cfg code. except it doesn't have those
Oh so usefull push_config_state and
pop_config_state functions :)

[/end plug]

-- 
"Computer programmers don't byte, they nybble a bit."
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx
http://strangesoft.net/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/