new function: config_get_tristate()

This commit is contained in:
marschap
2007-05-12 16:08:40 +00:00
parent 4f81466fc1
commit 3e84564e6a
2 changed files with 62 additions and 6 deletions
+13
View File
@@ -45,6 +45,19 @@ int config_read_string(const char *sectionname, const char *str);
short config_get_bool(const char *sectionname, const char *keyname,
int skip, short default_value);
/* Tries to interpret a value in the config file as a boolean.
* 0, false, off, no, n = 0
* 1, true, on, yes, y = 1
* 2, or the given 3rd name = 2
* If the key is not found or cannot be interpreted, the given default value is
* returned.
* The skip value can be used to iterate over multiple values with the same
* key. Should be 0 to get the first one, 1 for the second etc. and -1 for the
* last.
*/
short config_get_tristate(const char *sectionname, const char *keyname,
int skip, const char *name3rd, short default_value);
/* Tries to interpret a value in the config file as an integer.*/
long int config_get_int(const char *sectionname, const char *keyname,
int skip, long int default_value);