From 26df59d07ce82109b1f2c6efd1464835b330e1b3 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Tue, 18 Sep 2001 22:49:56 +0000 Subject: (mix_config_remove) new function to remove configuration items --- mixlib/mix_config.c | 18 +++++++++++++++++- mixlib/mix_config.h | 5 ++++- 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); -- cgit v1.2.3