[AD] Config routines, alpha 3

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


Changes:

- Applied David's patch, with little modifications
- Hash table can now be configured to automatically increase its size if
the number of collisions per entry is bigger than a specified value
(default = 3 collisions max before increasing table size)
- al_get_* now don't return an error, but a specified default return
value on errors
- al_unset has been implemented (removes specified variable)
- al_unload_config can now remove "subdirectories"
- some more optimizations to read_entry and write_entry functions
- new al_set_read_only function to mark a variable as read-only (writing
will fail)

The read-only thing doesn't yet support marking a whole "directory" as
read-only though.

About the path issue discussed in previous posts: is that really
necessary? Why can't one simply do like this:

#define MY_ADDON_PATH "my_addon/"

al_load_config(MY_ADDON_PATH, "myaddon.cfg");
al_set_bool(MY_ADDON_PATH "my_var", TRUE);
al_save_config(MY_ADDON_PATH, "myaddon.cfg");
al_unload_config(MY_ADDON_PATH);

--
Angelo Mottola
a.mottola@xxxxxxxxxx
http://www.ecplusplus.com

Attachment: config3.c
Description: Binary data



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