summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-04 13:46:40 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-04 13:46:40 (EDT)
commit925f3333f6330aea8ebc3fb7a5091a5ba9147b84 (patch)
tree46d466fb49fab6221d7d2045243a3403e1a8890f
parent90598c17e5c215d26f36f078f3a64050cbb0f7e1 (diff)
downloadmarquee-925f3333f6330aea8ebc3fb7a5091a5ba9147b84.zip
marquee-925f3333f6330aea8ebc3fb7a5091a5ba9147b84.tar.gz
marquee-925f3333f6330aea8ebc3fb7a5091a5ba9147b84.tar.bz2
src/config.c: Set up hash table of types and callbacks
-rw-r--r--src/config.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/config.c b/src/config.c
index ef9a4a7..18e6875 100644
--- a/src/config.c
+++ b/src/config.c
@@ -47,16 +47,20 @@ split_name(const gchar *name, gchar **group, gchar **key)
static void
set_boolean(MqConfig *config, const gchar *name, gboolean value)
{
- gchar *group;
- gchar *key;
+ gchar *group;
+ gchar *key;
+ ConfigItem *item;
split_name(name, &group, &key);
g_key_file_set_boolean(config->key_file, group, name, value);
if (!config->types_and_cbs_set) {
+ item = g_malloc(sizeof(*item));
+ item->type = TYPE_BOOLEAN;
+ item-callbacks = NULL;
g_hash_table_insert(config->types_and_cbs, g_strdup(name),
- TYPE_BOOLEAN);
+ item);
}
}