Re: [AD] patch for config.c

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


On Sun, 2004-10-31 at 14:55 +0100, Elias Pschernig wrote:
> On Sat, 2004-10-30 at 22:37 -0300, David A. Capello wrote:
> > With this patch the configuration routines will try to set variables
> > in the config_override file first (if it's open), if not, it will use
> > the current Allegro configuration file.
> > 
> > This is useful to make an override_config_file("myfile.cfg") at the
> > beginning of your program without use pop/push config states everytime
> > you want to set a variable.
> > 
> > The override_config_file(NULL) closes the config_override file (this
> > should be documented).
> > 
> 
> I didn't try the patch yet - but this makes sense to me.
> 
> The docs for override_config_file say:
> "Specifies a file containing config overrides. These settings will be
> used in addition to the parameters in the main config file, and where a
> variable is present in both files this version will take priority."
> 
> And the docs for flush_config_file:
> "Writes the current config file to disk if the contents have changed
> since it was loaded or since the latest call to the function."
> 
> It nowhere says that the override file only takes priority for reading -
> so actually, it should already have worked like your patch makes it.
> 

Does anyone else have an opinion on this? The patch changes the behavior
of:

override_config_file("my.cfg");
set_config_int("bla", "bla", 0);
flush_config_file();



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