annotate src/audacious/configdb.c @ 3780:ec989c2cde74

Make selective subtunes support actually work.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 18 Oct 2007 01:30:05 +0300
parents 259b7d3e0976
children a6a2e84e2b2e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3112
4c758281fe8f Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents: 2865
diff changeset
1 /* This program is free software; you can redistribute it and/or modify
4c758281fe8f Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents: 2865
diff changeset
2 * it under the terms of the GNU General Public License as published by
3121
3b6d316f8b09 GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents: 3112
diff changeset
3 * the Free Software Foundation; under version 3 of the License.
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
4 *
3112
4c758281fe8f Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents: 2865
diff changeset
5 * This program is distributed in the hope that it will be useful,
4c758281fe8f Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents: 2865
diff changeset
6 * but WITHOUT ANY WARRANTY; without even the implied warranty of
4c758281fe8f Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents: 2865
diff changeset
7 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4c758281fe8f Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents: 2865
diff changeset
8 * GNU General Public License for more details.
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
9 *
3112
4c758281fe8f Backed out changeset d226b83fa3298fc92f25f9519befcd754f44b0ef
William Pitcock <nenolod@atheme-project.org>
parents: 2865
diff changeset
10 * You should have received a copy of the GNU General Public License
3121
3b6d316f8b09 GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents: 3112
diff changeset
11 * along with this program. If not, see <http://www.gnu.org/licenses>.
3123
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
12 *
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
13 * The Audacious team does not consider modular code linking to
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
14 * Audacious or using our public API to be a derived work.
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
15 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
16
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
17 #ifdef HAVE_CONFIG_H
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
18 # include "config.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
19 #endif
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
20
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
21 #include "configdb.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
22
2314
d5d95a459a19 [svn] - fix: E:configdb_rcfile.c(45) [bmp_cfg_db_open]:Autoconversion of integer to pointer is not allowed in C99
nenolod
parents: 2313
diff changeset
23 #include <stdlib.h>
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
24 #include <string.h>
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
25
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
26 #include <libmcs/mcs.h>
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
27
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
28
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
29 #define RCFILE_DEFAULT_SECTION_NAME "audacious"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
30
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
31 static gboolean mcs_initted = FALSE;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
32
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
33 struct _ConfigDb
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
34 {
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
35 mcs_handle_t *handle;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
36 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
37
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
38
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
39 ConfigDb *
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
40 cfg_db_open()
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
41 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
42 ConfigDb *db;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
43
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
44 db = g_new(ConfigDb, 1);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
45
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
46 if (!mcs_initted)
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
47 {
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
48 mcs_init();
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
49 mcs_initted = TRUE;
2325
63c9a2724e73 [svn] - revert r3646 because it is not a user-friendly method of transitioning.
nenolod
parents: 2318
diff changeset
50 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
51
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
52 db->handle = mcs_new(RCFILE_DEFAULT_SECTION_NAME);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
53
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
54 return db;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
55 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
56
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
57 void
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
58 cfg_db_close(ConfigDb * db)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
59 {
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
60 mcs_destroy(db->handle);
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
61 g_free(db);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
62 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
63
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
64 gboolean
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
65 cfg_db_get_string(ConfigDb * db,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
66 const gchar * section,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
67 const gchar * key,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
68 gchar ** value)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
69 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
70 if (!section)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
71 section = RCFILE_DEFAULT_SECTION_NAME;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
72
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
73 return mcs_get_string(db->handle, section, key, value);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
74 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
75
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
76 gboolean
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
77 cfg_db_get_int(ConfigDb * db,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
78 const gchar * section, const gchar * key, gint * value)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
79 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
80 if (!section)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
81 section = RCFILE_DEFAULT_SECTION_NAME;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
82
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
83 return mcs_get_int(db->handle, section, key, value);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
84 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
85
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
86 gboolean
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
87 cfg_db_get_bool(ConfigDb * db,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
88 const gchar * section,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
89 const gchar * key,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
90 gboolean * value)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
91 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
92 if (!section)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
93 section = RCFILE_DEFAULT_SECTION_NAME;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
94
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
95 return mcs_get_bool(db->handle, section, key, value);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
96 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
97
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
98 gboolean
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
99 cfg_db_get_float(ConfigDb * db,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
100 const gchar * section,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
101 const gchar * key,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
102 gfloat * value)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
103 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
104 if (!section)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
105 section = RCFILE_DEFAULT_SECTION_NAME;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
106
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
107 return mcs_get_float(db->handle, section, key, value);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
108 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
109
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
110 gboolean
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
111 cfg_db_get_double(ConfigDb * db,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
112 const gchar * section,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
113 const gchar * key,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
114 gdouble * value)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
115 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
116 if (!section)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
117 section = RCFILE_DEFAULT_SECTION_NAME;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
118
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
119 return mcs_get_double(db->handle, section, key, value);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
120 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
121
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
122 void
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
123 cfg_db_set_string(ConfigDb * db,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
124 const gchar * section,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
125 const gchar * key,
2346
0b98ad8c8b17 [svn] removed xmms_create_dirbrowser, small config db fixes
mf0102
parents: 2326
diff changeset
126 const gchar * value)
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
127 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
128 if (!section)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
129 section = RCFILE_DEFAULT_SECTION_NAME;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
130
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
131 mcs_set_string(db->handle, section, key, value);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
132 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
133
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
134 void
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
135 cfg_db_set_int(ConfigDb * db,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
136 const gchar * section,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
137 const gchar * key,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
138 gint value)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
139 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
140 if (!section)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
141 section = RCFILE_DEFAULT_SECTION_NAME;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
142
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
143 mcs_set_int(db->handle, section, key, value);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
144 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
145
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
146 void
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
147 cfg_db_set_bool(ConfigDb * db,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
148 const gchar * section,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
149 const gchar * key,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
150 gboolean value)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
151 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
152 if (!section)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
153 section = RCFILE_DEFAULT_SECTION_NAME;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
154
2359
75598f596c92 [svn] - support for libmcs (pass --enable-mcs to configure)
nenolod
parents: 2358
diff changeset
155 mcs_set_bool(db->handle, section, key, value);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
156 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
157
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
158 void
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
159 cfg_db_set_float(ConfigDb * db,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
160 const gchar * section,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
161 const gchar * key,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
162 gfloat value)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
163 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
164 if (!section)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
165 section = RCFILE_DEFAULT_SECTION_NAME;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
166
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
167 mcs_set_float(db->handle, section, key, value);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
168 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
169
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
170 void
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
171 cfg_db_set_double(ConfigDb * db,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
172 const gchar * section,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
173 const gchar * key,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
174 gdouble value)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
175 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
176 if (!section)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
177 section = RCFILE_DEFAULT_SECTION_NAME;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
178
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
179 mcs_set_double(db->handle, section, key, value);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
180 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
181
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
182 void
3686
259b7d3e0976 sed s/bmp_cfg_db/cfg_db/.
William Pitcock <nenolod@atheme.org>
parents: 3123
diff changeset
183 cfg_db_unset_key(ConfigDb * db,
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
184 const gchar * section,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
185 const gchar * key)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
186 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
187 g_return_if_fail(db != NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
188 g_return_if_fail(key != NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
189
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
190 if (!section)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
191 section = RCFILE_DEFAULT_SECTION_NAME;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
192
2358
9c84ab3eb2c6 [svn] - add configdb backend based on libmcs.
nenolod
parents: 2346
diff changeset
193 mcs_unset_key(db->handle, section, key);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
194 }