diff options
Diffstat (limited to 'config_file.c')
-rw-r--r-- | config_file.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/config_file.c b/config_file.c index 5bfbe65..602eb92 100644 --- a/config_file.c +++ b/config_file.c @@ -21,20 +21,30 @@ gboolean config_open(struct config_file* config_file) { if(config_file->key_file) + { + debug("Freeing config_file->keyfile\n"); g_key_file_free(config_file->key_file); + } + debug("Creating new config_file->key_file\n"); config_file->key_file = g_key_file_new(); - gboolean success = g_key_file_load_from_file(config_file->key_file, config_file->file_name, G_KEY_FILE_NONE, NULL); - return success; + return g_key_file_load_from_file( config_file->key_file, + config_file->file_name, + G_KEY_FILE_NONE, + NULL); } void config_close(struct config_file* config_file) { + debug("Freeing key_file with %s value\n",config_file->key_file == NULL? "NULL":"non-NULL"); g_key_file_free(config_file->key_file); } gchar* config_get_key(struct config_file* config_file, const gchar* group_name, const gchar* key_name) { - return g_key_file_get_value(config_file->key_file, group_name, key_name, NULL); -}
\ No newline at end of file + return g_key_file_get_value(config_file->key_file, + group_name, + key_name, + NULL); +} |