[grilo] Add get all registered keys function



commit 65914148e1a5d7a6ce2493b47ffe6920b82bf90b
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Tue Jun 1 11:41:33 2010 +0200

    Add get all registered keys function
    
    This new function allows to get all available registered keys from registry.

 src/grl-plugin-registry.c |   21 +++++++++++++++++++++
 src/grl-plugin-registry.h |    2 ++
 2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/grl-plugin-registry.c b/src/grl-plugin-registry.c
index a0358fb..1fe7e13 100644
--- a/src/grl-plugin-registry.c
+++ b/src/grl-plugin-registry.c
@@ -620,6 +620,27 @@ grl_plugin_registry_lookup_metadata_key (GrlPluginRegistry *registry,
 }
 
 /**
+ * grl_plugin_registry_get_metadata_keys:
+ * @registry: the registry instance
+ *
+ * Returns a list with all registered keys in system.
+ *
+ * Returns: a list with all keys
+ **/
+GList *
+grl_plugin_registry_get_metadata_keys (GrlPluginRegistry *registry)
+{
+  GrlKeyID last_key = GRL_METADATA_KEY_LAST_POSITION;
+  GrlKeyID key;
+  GList *keys = NULL;
+
+  for (key = last_key; key > 0; key--) {
+    keys = g_list_prepend (keys, GRLKEYID_TO_POINTER (key));
+  }
+
+  return g_list_reverse (keys);
+}
+/**
  * grl_plugin_registry_add_config:
  * @registry: the registry instance
  * @config: a configuration set
diff --git a/src/grl-plugin-registry.h b/src/grl-plugin-registry.h
index 54fff5e..b925cb6 100644
--- a/src/grl-plugin-registry.h
+++ b/src/grl-plugin-registry.h
@@ -243,6 +243,8 @@ GrlMediaPlugin **grl_plugin_registry_get_sources_by_operations (GrlPluginRegistr
 const GrlMetadataKey *grl_plugin_registry_lookup_metadata_key (GrlPluginRegistry *registry,
                                                                GrlKeyID key_id);
 
+GList *grl_plugin_registry_get_metadata_keys (GrlPluginRegistry *registry);
+
 void grl_plugin_registry_add_config (GrlPluginRegistry *registry,
                                      GrlConfig *config);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]