From 0f7ee7e53f6bcb2d1d262a94c278440413c0103a Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 11 Oct 2009 13:57:29 +0100 Subject: Copy all the string/bool/int account settings with their defaults to "account set". They can be changed, but changes don't yet have any effect. --- set.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'set.h') diff --git a/set.h b/set.h index 19ea73fb..d20a58d3 100644 --- a/set.h +++ b/set.h @@ -72,7 +72,7 @@ typedef struct set } set_t; /* Should be pretty clear. */ -set_t *set_add( set_t **head, char *key, char *def, set_eval eval, void *data ); +set_t *set_add( set_t **head, const char *key, const char *def, set_eval eval, void *data ); /* Returns the raw set_t. Might be useful sometimes. */ set_t *set_find( set_t **head, char *key ); -- cgit v1.2.3 From b74b287af7ee980b01b89e911e21ec8f163d24b3 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 11 Oct 2009 22:08:26 +0100 Subject: Fixed account cleanup (use remove, not destroy) and now using user's account settings. --- set.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'set.h') diff --git a/set.h b/set.h index d20a58d3..42522506 100644 --- a/set.h +++ b/set.h @@ -75,23 +75,23 @@ typedef struct set set_t *set_add( set_t **head, const char *key, const char *def, set_eval eval, void *data ); /* Returns the raw set_t. Might be useful sometimes. */ -set_t *set_find( set_t **head, char *key ); +set_t *set_find( set_t **head, const char *key ); /* Returns a pointer to the string value of this setting. Don't modify the returned string, and don't free() it! */ -G_MODULE_EXPORT char *set_getstr( set_t **head, char *key ); +G_MODULE_EXPORT char *set_getstr( set_t **head, const char *key ); /* 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 ); +G_MODULE_EXPORT int set_getint( set_t **head, const char *key ); +G_MODULE_EXPORT int set_getbool( set_t **head, const char *key ); /* set_setstr() strdup()s the given value, so after using this function you can free() it, if you want. */ -int set_setstr( set_t **head, char *key, char *value ); -int set_setint( set_t **head, char *key, int value ); -void set_del( set_t **head, char *key ); -int set_reset( set_t **head, char *key ); +int set_setstr( set_t **head, const char *key, char *value ); +int set_setint( set_t **head, const char *key, int value ); +void set_del( set_t **head, const char *key ); +int set_reset( set_t **head, const char *key ); /* Two very useful generic evaluators. */ char *set_eval_int( set_t *set, char *value ); -- cgit v1.2.3 From 56244c0a88b603a683da9c0cc6abfccdc7616265 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 12 Mar 2010 00:38:40 +0000 Subject: Added set_eval_list which I will need for the Purple module now to make QQ (and others) work. --- set.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'set.h') diff --git a/set.h b/set.h index 42522506..7ff1f985 100644 --- a/set.h +++ b/set.h @@ -68,6 +68,7 @@ typedef struct set the passed value variable. When returning a corrected value, set_setstr() should be able to free() the returned string! */ set_eval eval; + void *eval_data; struct set *next; } set_t; @@ -97,6 +98,9 @@ int set_reset( set_t **head, const char *key ); char *set_eval_int( set_t *set, char *value ); char *set_eval_bool( set_t *set, char *value ); +/* Another more complicated one. */ +char *set_eval_list( set_t *set, char *value ); + /* Some not very generic evaluators that really shouldn't be here... */ char *set_eval_to_char( set_t *set, char *value ); char *set_eval_ops( set_t *set, char *value ); -- cgit v1.2.3