2 * Copyright (C) 2007-2008 Thadeu Lima de Souza Cascardo
3 * <cascardo@holoscopio.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include <atompub/atom.h>
25 gkeyfile_atom_config_get_str (AtomCtx *ctx, gchar *group, gchar * key)
30 keyfile = atom_config_data (atom_config (ctx));
31 value = g_key_file_get_string (keyfile, group, key, &error);
34 AtomError *aerr = atom_error_new ();
35 atom_error_code_set (aerr, 500);
36 atom_error_message_set (aerr, error->message);
37 atom_error_set (ctx, aerr);
44 gkeyfile_atom_config_init (AtomCtx *ctx, char *name)
49 keyfile = g_key_file_new ();
50 if (!g_key_file_load_from_file (keyfile, name,
51 G_KEY_FILE_NONE, &error))
53 AtomError *aerr = atom_error_new ();
54 atom_error_code_set (aerr, 500);
55 atom_error_message_set (aerr, error->message);
56 atom_error_set (ctx, aerr);
60 config = atom_config_new ();
61 atom_config_get_str_set (config, gkeyfile_atom_config_get_str);
62 atom_config_data_set (config, keyfile);