Mercurial > audlegacy
annotate src/audacious/configdb.h @ 3021:e3d7490ffd15 trunk
branch merge
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Tue, 10 Jul 2007 11:33:37 +0200 |
parents | d226b83fa329 |
children | 4c758281fe8f |
rev | line source |
---|---|
2865
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
1 /* |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
2 * audacious: Cross-platform multimedia player. |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
3 * configdb.h: Compatibility API for BMP's ConfigDB system. |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
4 * |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
5 * Copyright (c) 2005-2007 Audacious development team. |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
6 * Copyright (c) 2003-2005 BMP development team. |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
7 * |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
8 * Redistribution and use in source and binary forms, with or without |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
9 * modification, are permitted provided that the following conditions are |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
10 * met: |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
11 * |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
12 * 1. Redistributions of source code must retain the above copyright notice, |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
13 * this list of conditions and the following disclaimer. |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
14 * |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
15 * 2. Redistributions in binary form must reproduce the above copyright |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
16 * notice, this list of conditions and the following disclaimer in the |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
17 * documentation and/or other materials provided with the distribution. |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
18 * |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
19 * 3. The name of the author may not be used to endorse or promote products |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
20 * derived from this software without specific prior written permission. |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
21 * |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
24 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
25 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
31 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
32 * POSSIBILITY OF SUCH DAMAGE. |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
33 */ |
d226b83fa329
BSD relicensing (pass 6).
William Pitcock <nenolod@atheme.org>
parents:
2712
diff
changeset
|
34 |
2313 | 35 #ifndef CONFIGDB_H |
36 #define CONFIGDB_H | |
37 | |
38 #include <glib.h> | |
39 | |
40 /** | |
41 * ConfigDb: | |
42 * | |
43 * A configuration database handle, opened with bmp_cfg_db_open(). | |
44 **/ | |
45 typedef struct _ConfigDb ConfigDb; | |
46 | |
47 | |
48 G_BEGIN_DECLS | |
49 | |
50 /** | |
51 * bmp_cfg_db_open: | |
52 * | |
53 * Opens the configuration database. | |
54 * | |
55 * Return value: A configuration database handle. | |
56 **/ | |
57 ConfigDb *bmp_cfg_db_open(); | |
58 | |
59 /** | |
60 * bmp_cfg_db_close: | |
61 * @db: A configuration database handle. | |
62 * | |
63 * Closes the configuration database. | |
64 **/ | |
65 void bmp_cfg_db_close(ConfigDb *db); | |
66 | |
67 /** | |
68 * bmp_cfg_db_get_string: | |
69 * @db: A configuration database handle. | |
70 * @section: The section of the configuration database to search. | |
71 * @key: The name of the field in the configuration database to look up. | |
72 * @value: Pointer to a buffer to put the data in. | |
73 * | |
74 * Searches the configuration database for a value. | |
75 * | |
76 * Return value: TRUE if successful, FALSE otherwise. | |
77 **/ | |
78 gboolean bmp_cfg_db_get_string(ConfigDb *db, | |
79 const gchar *section, | |
80 const gchar *key, | |
81 gchar **value); | |
82 | |
83 /** | |
84 * bmp_cfg_db_get_int: | |
85 * @db: A configuration database handle. | |
86 * @section: The section of the configuration database to search. | |
87 * @key: The name of the field in the configuration database to look up. | |
88 * @value: Pointer to an integer to put the data in. | |
89 * | |
90 * Searches the configuration database for a value. | |
91 * | |
92 * Return value: TRUE if successful, FALSE otherwise. | |
93 **/ | |
94 gboolean bmp_cfg_db_get_int(ConfigDb *db, | |
95 const gchar *section, | |
96 const gchar *key, | |
97 gint *value); | |
98 | |
99 /** | |
100 * bmp_cfg_db_get_bool: | |
101 * @db: A configuration database handle. | |
102 * @section: The section of the configuration database to search. | |
103 * @key: The name of the field in the configuration database to look up. | |
104 * @value: Pointer to a boolean to put the data in. | |
105 * | |
106 * Searches the configuration database for a value. | |
107 * | |
108 * Return value: TRUE if successful, FALSE otherwise. | |
109 **/ | |
110 gboolean bmp_cfg_db_get_bool(ConfigDb *db, | |
111 const gchar *section, | |
112 const gchar *key, | |
113 gboolean *value); | |
114 | |
115 /** | |
116 * bmp_cfg_db_get_float: | |
117 * @db: A configuration database handle. | |
118 * @section: The section of the configuration database to search. | |
119 * @key: The name of the field in the configuration database to look up. | |
120 * @value: Pointer to a floating point integer to put the data in. | |
121 * | |
122 * Searches the configuration database for a value. | |
123 * | |
124 * Return value: TRUE if successful, FALSE otherwise. | |
125 **/ | |
126 gboolean bmp_cfg_db_get_float(ConfigDb *db, | |
127 const gchar *section, | |
128 const gchar *key, | |
129 gfloat *value); | |
130 | |
131 /** | |
132 * bmp_cfg_db_get_double: | |
133 * @db: A configuration database handle. | |
134 * @section: The section of the configuration database to search. | |
135 * @key: The name of the field in the configuration database to look up. | |
136 * @value: Pointer to a double-precision floating point integer to put the data in. | |
137 * | |
138 * Searches the configuration database for a value. | |
139 * | |
140 * Return value: TRUE if successful, FALSE otherwise. | |
141 **/ | |
142 gboolean bmp_cfg_db_get_double(ConfigDb *db, | |
143 const gchar *section, | |
144 const gchar *key, | |
145 gdouble *value); | |
146 | |
147 /** | |
148 * bmp_cfg_db_set_string: | |
149 * @db: A configuration database handle. | |
150 * @section: The section of the configuration database to search. | |
151 * @key: The name of the field in the configuration database to set. | |
152 * @value: Pointer to a buffer containing the data. | |
153 * | |
154 * Sets a value in the configuration database. | |
155 **/ | |
156 void bmp_cfg_db_set_string(ConfigDb *db, | |
157 const gchar *section, | |
158 const gchar *key, | |
2346
0b98ad8c8b17
[svn] removed xmms_create_dirbrowser, small config db fixes
mf0102
parents:
2313
diff
changeset
|
159 const gchar *value); |
2313 | 160 |
161 /** | |
162 * bmp_cfg_db_set_int: | |
163 * @db: A configuration database handle. | |
164 * @section: The section of the configuration database to search. | |
165 * @key: The name of the field in the configuration database to set. | |
166 * @value: Pointer to an integer containing the data. | |
167 * | |
168 * Sets a value in the configuration database. | |
169 **/ | |
170 void bmp_cfg_db_set_int(ConfigDb *db, | |
171 const gchar *section, | |
172 const gchar *key, | |
173 gint value); | |
174 | |
175 /** | |
176 * bmp_cfg_db_set_bool: | |
177 * @db: A configuration database handle. | |
178 * @section: The section of the configuration database to search. | |
179 * @key: The name of the field in the configuration database to set. | |
180 * @value: Pointer to a boolean containing the data. | |
181 * | |
182 * Sets a value in the configuration database. | |
183 **/ | |
184 void bmp_cfg_db_set_bool(ConfigDb *db, | |
185 const gchar *section, | |
186 const gchar *key, | |
187 gboolean value); | |
188 | |
189 /** | |
190 * bmp_cfg_db_set_float: | |
191 * @db: A configuration database handle. | |
192 * @section: The section of the configuration database to search. | |
193 * @key: The name of the field in the configuration database to set. | |
194 * @value: Pointer to a floating point integer containing the data. | |
195 * | |
196 * Sets a value in the configuration database. | |
197 **/ | |
198 void bmp_cfg_db_set_float(ConfigDb *db, | |
199 const gchar *section, | |
200 const gchar *key, | |
201 gfloat value); | |
202 | |
203 /** | |
204 * bmp_cfg_db_set_double: | |
205 * @db: A configuration database handle. | |
206 * @section: The section of the configuration database to search. | |
207 * @key: The name of the field in the configuration database to set. | |
208 * @value: Pointer to a double precision floating point integer containing the data. | |
209 * | |
210 * Sets a value in the configuration database. | |
211 **/ | |
212 void bmp_cfg_db_set_double(ConfigDb *db, | |
213 const gchar *section, | |
214 const gchar *key, | |
215 gdouble value); | |
216 | |
217 /** | |
218 * bmp_cfg_db_unset_key: | |
219 * @db: A configuration database handle. | |
220 * @section: The section of the configuration database to search. | |
221 * @key: The name of the field in the configuration database to set. | |
222 * | |
223 * Removes a value from the configuration database. | |
224 **/ | |
225 void bmp_cfg_db_unset_key(ConfigDb *db, | |
226 const gchar *section, | |
227 const gchar *key); | |
228 | |
229 G_END_DECLS | |
230 | |
2521 | 231 #endif /* CONFIGDB_H */ |
2313 | 232 |