summaryrefslogtreecommitdiffhomepage
path: root/mixlib/mix_config.h
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2001-07-02 22:39:39 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2001-07-02 22:39:39 +0000
commit2de8990414149bdd213a39deb89f709a277190e2 (patch)
tree99d586b310771c678c5643e1706f138540fd09bd /mixlib/mix_config.h
parentcd17b702add9f9fe6c13b010c5186748cbf58017 (diff)
downloadmdk-2de8990414149bdd213a39deb89f709a277190e2.tar.gz
mdk-2de8990414149bdd213a39deb89f709a277190e2.tar.bz2
shared config handler
Diffstat (limited to 'mixlib/mix_config.h')
-rw-r--r--mixlib/mix_config.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/mixlib/mix_config.h b/mixlib/mix_config.h
new file mode 100644
index 0000000..b763160
--- /dev/null
+++ b/mixlib/mix_config.h
@@ -0,0 +1,62 @@
+/* -*-c-*- ---------------- mix_config.h :
+ * Basic config storage utility.
+ * ------------------------------------------------------------------
+ * Last change: Time-stamp: <2001-07-02 01:21:11 jao>
+ * ------------------------------------------------------------------
+ * Copyright (C) 2001 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+
+#ifndef MIX_CONFIG_H
+#define MIX_CONFIG_H
+
+#include "mix.h"
+
+/* the config type */
+typedef struct mix_config_t mix_config_t;
+
+/* create a new config handler, giving the dir and name of the config file */
+extern mix_config_t *
+mix_config_new (const gchar *dirname, const gchar *filename);
+
+/* delete a config handler, saving the configuration if needed */
+extern void
+mix_config_delete (mix_config_t *config);
+
+/* get a config item's value from its key */
+extern const gchar *
+mix_config_get (const mix_config_t *config, const gchar *key);
+
+/* update (or create if it does not exist) a new config item */
+extern void
+mix_config_update (mix_config_t *config, const gchar *key, const gchar *value);
+
+/* save the current configuration */
+extern void
+mix_config_save (const mix_config_t *config);
+
+/* set autosave on delete flag */
+extern void
+mix_config_set_autosave (mix_config_t *config, gboolean autosave);
+
+extern gboolean
+mix_config_is_autosave (const mix_config_t *config);
+
+
+#endif /* MIX_CONFIG_H */
+