[gvfs] Add metafile_key_unset
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Subject: [gvfs] Add metafile_key_unset
- Date: Tue, 23 Jun 2009 11:10:58 -0400 (EDT)
commit aa9ddac43dde6b17bec09a5490d698960290101c
Author: Alexander Larsson <alexl redhat com>
Date: Mon Jun 22 11:48:17 2009 +0200
Add metafile_key_unset
metadata/metabuilder.c | 14 ++++++++++++++
metadata/metabuilder.h | 2 ++
2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/metadata/metabuilder.c b/metadata/metabuilder.c
index 8e0fff2..4d58355 100644
--- a/metadata/metabuilder.c
+++ b/metadata/metabuilder.c
@@ -200,6 +200,20 @@ metadata_clear (MetaData *data)
}
void
+metafile_key_unset (MetaFile *metafile,
+ const char *key)
+{
+ MetaData *data;
+
+ data = metafile_key_lookup (metafile, key, FALSE);
+ if (data)
+ {
+ metafile->data = g_list_remove (metafile->data, data);
+ metadata_free (data);
+ }
+}
+
+void
metafile_key_set_value (MetaFile *metafile,
const char *key,
const char *value)
diff --git a/metadata/metabuilder.h b/metadata/metabuilder.h
index ba6e555..3af05bb 100644
--- a/metadata/metabuilder.h
+++ b/metadata/metabuilder.h
@@ -45,6 +45,8 @@ MetaFile * metafile_lookup_child (MetaFile *metafile,
MetaData * metafile_key_lookup (MetaFile *file,
const char *key,
gboolean create);
+void metafile_key_unset (MetaFile *metafile,
+ const char *key);
void metafile_key_set_value (MetaFile *metafile,
const char *key,
const char *value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]