[grilo] core: Add API to remove a key from GrlRelatedKeys set
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] core: Add API to remove a key from GrlRelatedKeys set
- Date: Sat, 3 Nov 2012 00:42:44 +0000 (UTC)
commit fe2409ee0e395af0bb2588d249f877f9e023812c
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Fri Nov 2 16:53:35 2012 +0000
core: Add API to remove a key from GrlRelatedKeys set
src/data/grl-related-keys.c | 17 +++++++++++++++++
src/data/grl-related-keys.h | 3 +++
2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/data/grl-related-keys.c b/src/data/grl-related-keys.c
index 9199508..bfc1e6e 100644
--- a/src/data/grl-related-keys.c
+++ b/src/data/grl-related-keys.c
@@ -537,6 +537,23 @@ grl_related_keys_get_boxed (GrlRelatedKeys *relkeys,
}
/**
+ * grl_related_keys_remove:
+ * @relkeys: set of related keys
+ * @key: (type GrlKeyID): key to remove
+ *
+ * Removes @key from @relkeys set.
+ **/
+void
+grl_related_keys_remove (GrlRelatedKeys *relkeys,
+ GrlKeyID key)
+{
+ g_return_if_fail (GRL_IS_RELATED_KEYS (relkeys));
+ g_return_if_fail (key != GRL_METADATA_KEY_INVALID);
+
+ g_hash_table_remove (relkeys->priv->data, GRLKEYID_TO_POINTER (key));
+}
+
+/**
* grl_related_keys_has_key:
* @relkeys: set of related keys to inspect
* @key: (type GrlKeyID): key to search
diff --git a/src/data/grl-related-keys.h b/src/data/grl-related-keys.h
index 9cb1371..da53327 100644
--- a/src/data/grl-related-keys.h
+++ b/src/data/grl-related-keys.h
@@ -141,6 +141,9 @@ const guint8 *grl_related_keys_get_binary(GrlRelatedKeys *relkeys,
gconstpointer grl_related_keys_get_boxed (GrlRelatedKeys *relkeys,
GrlKeyID key);
+void grl_related_keys_remove (GrlRelatedKeys *relkeys,
+ GrlKeyID key);
+
gboolean grl_related_keys_has_key (GrlRelatedKeys *relkeys,
GrlKeyID key);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]