override_config_file(3)
π override_config_file(3) π
okay bestie, welcome to the Allegro manual, we're doing override_config_file today and honestly? it's giving "quietly running the whole show" energy. π
β¨ NAME β¨
override_config_file β Specifies a file containing config overrides. Part of the Allegro game programming library. π¦
πΈ SYNOPSIS πΈ
#include <allegro.h>
void override_config_file(const char *filename);
π DESCRIPTION π
So here's the tea, bestie: this function specifies a file that contains config overrides. Those settings get used in addition to the parameters in the main config file, and where a variable shows up in both files, this version takes priority. π
Why do you care? Because it lets application programmers override some of the config settings straight from their code, while still leaving the main config file free for the end user to customise however they want. Like, you could specify a particular sample frequency and IBK instrument file, but the user could still use an allegro.cfg file to specify the port settings and irq numbers. Everybody eats. π
And the override config file isn't just first in line when reading β it's also used for storing values. So when you're done with it, you can call override_config_file with a NULL parameter, and config data will be directly read from the current config file again. Clean exit, no drama. β¨
Note, bestie, this one matters: The override file is completely independent from the current configuration. You can e.g. callset_config_file, and the override file will still be active. Also theflush_config_filefunction will only affect the current config file (which can be changed withset_config_file), never the overriding one specified with this function. The modified override config is written back to disk whenever you calloverride_config_file. π
π§ Example π§
override_config_file("my.cfg");
/* This will read from my.cfg, and if it doesn't find a
* setting, will read from the current config file instead.
*/
language = get_config_string("system", "language", NULL);
/* This will always write to my.cfg, no matter if the
* settings is already present or not.
*/
set_config_string("system", "language", "RU");
/* This forces the changed setting to be written back to
* disk. Else it is written back at the next call to
* override_config_file, or when Allegro shuts down.
*/
override_config_file(NULL);
Also, heads up: this function and override_config_data() are mutually exclusive, i.e. calling one will cancel the effects of the other. Pick a lane, bestie. π
π SEE ALSO π
That's the whole page, babes β brought to you by Allegro, version 4.4.3, and override_config_file(3) itself. go forth and override responsibly πβ¨π
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms