comparison src/audacious/configdb.h @ 2536:b06d60a5cb15 trunk

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