aboutsummaryrefslogtreecommitdiffstats
path: root/set.h
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-06-06 00:21:02 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-06-06 00:21:02 +0100
commitb308cf9bafbdf76da73a57607b65c4763aa3057b (patch)
treec686906b479a0edd52b18a213e1d420f7343855d /set.h
parent3ab1d317831a6c1830bb648a1a8d63a41c92f651 (diff)
parente774815bc621af90bb64ca314b84367659c5a005 (diff)
Merging libpurple branch into killerbee. It's fairly usable already, and
Debian packaging is now properly separated. This also picks up a load of stuff from mainline it seems.
Diffstat (limited to 'set.h')
-rw-r--r--set.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/set.h b/set.h
index 19ea73fb..7ff1f985 100644
--- a/set.h
+++ b/set.h
@@ -68,35 +68,39 @@ 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;
/* 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 );
+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 );
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 );