summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2001-09-18 22:49:56 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2001-09-18 22:49:56 +0000
commit26df59d07ce82109b1f2c6efd1464835b330e1b3 (patch)
tree4eac15ddb0a24447623da15d81c7c84394e6e76f
parent58e4d7c93549558c5247b3bad7b247266742f245 (diff)
downloadmdk-26df59d07ce82109b1f2c6efd1464835b330e1b3.tar.gz
mdk-26df59d07ce82109b1f2c6efd1464835b330e1b3.tar.bz2
(mix_config_remove) new function to remove configuration items
-rw-r--r--mixlib/mix_config.c18
-rw-r--r--mixlib/mix_config.h5
2 files changed, 21 insertions, 2 deletions
diff --git a/mixlib/mix_config.c b/mixlib/mix_config.c
index f55ee48..74a669f 100644
--- a/mixlib/mix_config.c
+++ b/mixlib/mix_config.c
@@ -1,7 +1,7 @@
/* -*-c-*- -------------- mix_config.c :
* Implementation of the functions declared in mix_config.h
* ------------------------------------------------------------------
- * Last change: Time-stamp: "01/02/12 00:35:28 jose"
+ * $Id: mix_config.c,v 1.7 2001/09/18 22:49:56 jao Exp $
* ------------------------------------------------------------------
* Copyright (C) 2001 Free Software Foundation, Inc.
*
@@ -182,6 +182,22 @@ mix_config_update_integer (mix_config_t *config, const gchar *key, gint value)
g_free (val);
}
+void
+mix_config_remove (mix_config_t *config, const gchar *key)
+{
+ gchar *val;
+
+ g_return_if_fail (config != NULL);
+ g_return_if_fail (key != NULL);
+
+ val = g_hash_table_lookup (config->items, key);
+ if (val != NULL)
+ {
+ g_hash_table_remove (config->items, key);
+ g_free (val);
+ }
+}
+
/* save the current configuration */
static void
save_ (gpointer key, gpointer value, gpointer file)
diff --git a/mixlib/mix_config.h b/mixlib/mix_config.h
index 2f1b1a0..1b82a51 100644
--- a/mixlib/mix_config.h
+++ b/mixlib/mix_config.h
@@ -1,7 +1,7 @@
/* -*-c-*- ---------------- mix_config.h :
* Basic config storage utility.
* ------------------------------------------------------------------
- * Last change: Time-stamp: <2001-07-02 01:21:11 jao>
+ * $Id: mix_config.h,v 1.5 2001/09/18 22:49:56 jao Exp $
* ------------------------------------------------------------------
* Copyright (C) 2001 Free Software Foundation, Inc.
*
@@ -59,6 +59,9 @@ mix_config_update (mix_config_t *config, const gchar *key, const gchar *value);
extern void
mix_config_update_integer (mix_config_t *config, const gchar *key, gint value);
+extern void
+mix_config_remove (mix_config_t *config, const gchar *key);
+
/* save the current configuration */
extern void
mix_config_save (const mix_config_t *config);