/* * Written by Sebastien Tricaud * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include static GKeyFile *keyfile; extern int config_init(char *conf) { int retval; keyfile = g_key_file_new(); if ( conf ) retval = g_key_file_load_from_file(keyfile, conf, G_KEY_FILE_NONE, NULL); else retval = g_key_file_load_from_file(keyfile, CONFIG_FILE, G_KEY_FILE_NONE, NULL); return retval; } extern char * config_get_val(char *group, char *key) { return g_key_file_get_string(keyfile, group, key, NULL); } extern void config_set_val(char *group, char *key, char *val) { g_key_file_set_string(keyfile, group, key, val); } extern void config_destroy(void) { g_key_file_free(keyfile); }