0
|
1 #ifndef CONFIGDB_H
|
|
2 #define CONFIGDB_H
|
|
3
|
|
4 #include <glib.h>
|
|
5
|
|
6
|
|
7 typedef struct _ConfigDb ConfigDb;
|
|
8
|
|
9
|
|
10 G_BEGIN_DECLS
|
|
11
|
2049
|
12 /**
|
|
13 * bmp_cfg_db_open:
|
|
14 *
|
|
15 * Opens the configuration database.
|
|
16 *
|
|
17 * Return value: A configuration database handle.
|
|
18 **/
|
0
|
19 ConfigDb *bmp_cfg_db_open();
|
2049
|
20
|
|
21 /**
|
|
22 * bmp_cfg_db_close:
|
|
23 * @db: A configuration database handle.
|
|
24 *
|
|
25 * Closes the configuration database.
|
|
26 **/
|
0
|
27 void bmp_cfg_db_close(ConfigDb *db);
|
|
28
|
2049
|
29 /**
|
|
30 * bmp_cfg_db_get_string:
|
|
31 * @db: A configuration database handle.
|
|
32 * @section: The section of the configuration database to search.
|
|
33 * @key: The name of the field in the configuration database to look up.
|
|
34 * @value: Pointer to a buffer to put the data in.
|
|
35 *
|
|
36 * Searches the configuration database for a value.
|
|
37 *
|
|
38 * Return value: TRUE if successful, FALSE otherwise.
|
|
39 **/
|
0
|
40 gboolean bmp_cfg_db_get_string(ConfigDb *db,
|
|
41 const gchar *section,
|
|
42 const gchar *key,
|
|
43 gchar **value);
|
2049
|
44
|
|
45 /**
|
|
46 * bmp_cfg_db_get_int:
|
|
47 * @db: A configuration database handle.
|
|
48 * @section: The section of the configuration database to search.
|
|
49 * @key: The name of the field in the configuration database to look up.
|
|
50 * @value: Pointer to an integer to put the data in.
|
|
51 *
|
|
52 * Searches the configuration database for a value.
|
|
53 *
|
|
54 * Return value: TRUE if successful, FALSE otherwise.
|
|
55 **/
|
0
|
56 gboolean bmp_cfg_db_get_int(ConfigDb *db,
|
|
57 const gchar *section,
|
|
58 const gchar *key,
|
|
59 gint *value);
|
2049
|
60
|
|
61 /**
|
|
62 * bmp_cfg_db_get_bool:
|
|
63 * @db: A configuration database handle.
|
|
64 * @section: The section of the configuration database to search.
|
|
65 * @key: The name of the field in the configuration database to look up.
|
|
66 * @value: Pointer to a boolean to put the data in.
|
|
67 *
|
|
68 * Searches the configuration database for a value.
|
|
69 *
|
|
70 * Return value: TRUE if successful, FALSE otherwise.
|
|
71 **/
|
0
|
72 gboolean bmp_cfg_db_get_bool(ConfigDb *db,
|
|
73 const gchar *section,
|
|
74 const gchar *key,
|
|
75 gboolean *value);
|
2049
|
76
|
|
77 /**
|
|
78 * bmp_cfg_db_get_float:
|
|
79 * @db: A configuration database handle.
|
|
80 * @section: The section of the configuration database to search.
|
|
81 * @key: The name of the field in the configuration database to look up.
|
|
82 * @value: Pointer to a floating point integer to put the data in.
|
|
83 *
|
|
84 * Searches the configuration database for a value.
|
|
85 *
|
|
86 * Return value: TRUE if successful, FALSE otherwise.
|
|
87 **/
|
0
|
88 gboolean bmp_cfg_db_get_float(ConfigDb *db,
|
|
89 const gchar *section,
|
|
90 const gchar *key,
|
|
91 gfloat *value);
|
2049
|
92
|
|
93 /**
|
|
94 * bmp_cfg_db_get_double:
|
|
95 * @db: A configuration database handle.
|
|
96 * @section: The section of the configuration database to search.
|
|
97 * @key: The name of the field in the configuration database to look up.
|
|
98 * @value: Pointer to a double-precision floating point integer to put the data in.
|
|
99 *
|
|
100 * Searches the configuration database for a value.
|
|
101 *
|
|
102 * Return value: TRUE if successful, FALSE otherwise.
|
|
103 **/
|
0
|
104 gboolean bmp_cfg_db_get_double(ConfigDb *db,
|
|
105 const gchar *section,
|
|
106 const gchar *key,
|
|
107 gdouble *value);
|
|
108
|
2049
|
109 /**
|
|
110 * bmp_cfg_db_set_string:
|
|
111 * @db: A configuration database handle.
|
|
112 * @section: The section of the configuration database to search.
|
|
113 * @key: The name of the field in the configuration database to set.
|
|
114 * @value: Pointer to a buffer containing the data.
|
|
115 *
|
|
116 * Sets a value in the configuration database.
|
|
117 **/
|
0
|
118 void bmp_cfg_db_set_string(ConfigDb *db,
|
|
119 const gchar *section,
|
|
120 const gchar *key,
|
|
121 gchar *value);
|
2049
|
122
|
|
123 /**
|
|
124 * bmp_cfg_db_set_int:
|
|
125 * @db: A configuration database handle.
|
|
126 * @section: The section of the configuration database to search.
|
|
127 * @key: The name of the field in the configuration database to set.
|
|
128 * @value: Pointer to an integer containing the data.
|
|
129 *
|
|
130 * Sets a value in the configuration database.
|
|
131 **/
|
0
|
132 void bmp_cfg_db_set_int(ConfigDb *db,
|
|
133 const gchar *section,
|
|
134 const gchar *key,
|
|
135 gint value);
|
2049
|
136
|
|
137 /**
|
|
138 * bmp_cfg_db_set_bool:
|
|
139 * @db: A configuration database handle.
|
|
140 * @section: The section of the configuration database to search.
|
|
141 * @key: The name of the field in the configuration database to set.
|
|
142 * @value: Pointer to a boolean containing the data.
|
|
143 *
|
|
144 * Sets a value in the configuration database.
|
|
145 **/
|
0
|
146 void bmp_cfg_db_set_bool(ConfigDb *db,
|
|
147 const gchar *section,
|
|
148 const gchar *key,
|
|
149 gboolean value);
|
2049
|
150
|
|
151 /**
|
|
152 * bmp_cfg_db_set_float:
|
|
153 * @db: A configuration database handle.
|
|
154 * @section: The section of the configuration database to search.
|
|
155 * @key: The name of the field in the configuration database to set.
|
|
156 * @value: Pointer to a floating point integer containing the data.
|
|
157 *
|
|
158 * Sets a value in the configuration database.
|
|
159 **/
|
0
|
160 void bmp_cfg_db_set_float(ConfigDb *db,
|
|
161 const gchar *section,
|
|
162 const gchar *key,
|
|
163 gfloat value);
|
2049
|
164
|
|
165 /**
|
|
166 * bmp_cfg_db_set_double:
|
|
167 * @db: A configuration database handle.
|
|
168 * @section: The section of the configuration database to search.
|
|
169 * @key: The name of the field in the configuration database to set.
|
|
170 * @value: Pointer to a double precision floating point integer containing the data.
|
|
171 *
|
|
172 * Sets a value in the configuration database.
|
|
173 **/
|
0
|
174 void bmp_cfg_db_set_double(ConfigDb *db,
|
|
175 const gchar *section,
|
|
176 const gchar *key,
|
|
177 gdouble value);
|
|
178
|
2049
|
179 /**
|
|
180 * bmp_cfg_db_unset_key:
|
|
181 * @db: A configuration database handle.
|
|
182 * @section: The section of the configuration database to search.
|
|
183 * @key: The name of the field in the configuration database to set.
|
|
184 *
|
|
185 * Removes a value from the configuration database.
|
|
186 **/
|
0
|
187 void bmp_cfg_db_unset_key(ConfigDb *db,
|
|
188 const gchar *section,
|
|
189 const gchar *key);
|
|
190
|
|
191 G_END_DECLS
|
|
192
|
|
193 #endif // CONFIGDB_H
|
|
194
|