summaryrefslogtreecommitdiff
path: root/common/gdm-common-config.h
blob: b03ed46e0424936e2bac95314677e61dc23eab6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
 *
 * Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef _GDM_COMMON_CONFIG_H
#define _GDM_COMMON_CONFIG_H

#include <glib.h>

G_BEGIN_DECLS

GKeyFile * gdm_common_config_load             (const char *filename,
					       GError    **error);
GKeyFile * gdm_common_config_load_from_dirs   (const char  *filename,
					       const char **dirs,
					       GError    **error);
gboolean   gdm_common_config_save             (GKeyFile   *config,
					       const char *filename,
					       GError    **error);

gboolean   gdm_common_config_get_string       (GKeyFile   *config,
					       const char *keystring,
					       char      **value,
					       GError    **error);
gboolean   gdm_common_config_get_translated_string (GKeyFile   *config,
						    const char *keystring,
						    char      **value,
						    GError    **error);
gboolean   gdm_common_config_get_int          (GKeyFile   *config,
					       const char *keystring,
					       int        *value,
					       GError    **error);
gboolean   gdm_common_config_get_boolean      (GKeyFile   *config,
					       const char *keystring,
					       gboolean   *value,
					       GError    **error);
gboolean   gdm_common_config_parse_key_string (const char *keystring,
					       char      **group,
					       char      **key,
					       char      **locale,
					       char      **value);

void       gdm_common_config_set_string       (GKeyFile   *config,
					       const char *keystring,
					       const char *value);
void       gdm_common_config_set_boolean      (GKeyFile   *config,
					       const char *keystring,
					       gboolean    value);
void       gdm_common_config_set_int          (GKeyFile   *config,
					       const char *keystring,
					       int         value);

void       gdm_common_config_remove_key       (GKeyFile   *config,
					       const char *keystring,
					       GError    **error);

G_END_DECLS

#endif /* _GDM_COMMON_CONFIG_H */