diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2007-02-26 04:46:35 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2007-02-26 04:46:35 +0000 |
commit | 723e611603236aab794ffbbc312705b8309b3f81 (patch) | |
tree | 92ac66928d75355c1bc9b62bb726bbabb474f388 /set.h | |
parent | b6423a0964c121edfb7a4318b1d909916d099d4d (diff) |
Removed boolean code from set_getint() and added bits of help to set.h.
Diffstat (limited to 'set.h')
-rw-r--r-- | set.h | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -31,7 +31,10 @@ remembers a default value for every setting. And to prevent the user from setting invalid values, you can write an evaluator function for every setting, which can check a new value and block it by returning - NULL, or replace it by returning a new value. See struct set.eval. */ + NULL, or replace it by returning a new value. See struct set.eval. + One thing that is really missing here is additional data for the + evaluator. This could be useful to add minimum and maximum values for + integers, for example. */ typedef char *(*set_eval) ( struct set *set, char *value ); @@ -45,7 +48,9 @@ typedef struct set char *def; /* Default value. If the set_setstr() function notices a new value is exactly the same as the default, value gets set to NULL. So when - you read a setting, don't forget about this! */ + you read a setting, don't forget about this! + In fact, you should only read values using + set_getstr/int(). */ int flags; /* See account.h, for example. set.c doesn't use this (yet?). */ @@ -67,9 +72,8 @@ set_t *set_find( set_t **head, char *key ); returned string, and don't free() it! */ G_MODULE_EXPORT char *set_getstr( set_t **head, char *key ); -/* Get an integer. Right now this also converts true/false/on/off/etc to - numbers, but this is for historical reasons, please use set_getbool() - for booleans instead. */ +/* Get an integer. In previous versions set_getint() was also used to read + boolean values, but this SHOULD be done with set_getbool() now! */ G_MODULE_EXPORT int set_getint( set_t **head, char *key ); G_MODULE_EXPORT int set_getbool( set_t **head, char *key ); |