[grilo] Use a hashtable for plugins' info



commit f05711dcee0c27ce934a4b2236d8cc3f62f31ae2
Author: Joaquim Rocha <jrocha igalia com>
Date:   Fri Jun 11 21:38:19 2010 +0200

    Use a hashtable for plugins' info
    
    Removes the usage of strings in the GrlPluginInfo struct (apart from the id)
    and adds a hashtable for that purpose.
    
    Also removes the check for the plugin's name when loading it since the name
    is now optional.

 src/grl-plugin-registry.c |    3 +--
 src/grl-plugin-registry.h |   28 +++++-----------------------
 2 files changed, 6 insertions(+), 25 deletions(-)
---
diff --git a/src/grl-plugin-registry.c b/src/grl-plugin-registry.c
index 86418b4..373fda8 100644
--- a/src/grl-plugin-registry.c
+++ b/src/grl-plugin-registry.c
@@ -364,8 +364,7 @@ grl_plugin_registry_load (GrlPluginRegistry *registry, const gchar *path)
   }
 
   if (!plugin->plugin_init ||
-      !plugin->info.id ||
-      !plugin->info.name) {
+      !plugin->info.id) {
     g_warning ("Plugin descriptor is not valid: '%s'", path);
     return FALSE;
   }
diff --git a/src/grl-plugin-registry.h b/src/grl-plugin-registry.h
index 3a01149..9df9141 100644
--- a/src/grl-plugin-registry.h
+++ b/src/grl-plugin-registry.h
@@ -86,23 +86,9 @@
  */
 #define GRL_PLUGIN_REGISTER(init,               \
                             deinit,             \
-                            id,                 \
-                            name,               \
-                            desc,               \
-                            version,            \
-                            author,             \
-                            license,            \
-                            site)                                       \
+                            id)			\
   G_MODULE_EXPORT GrlPluginDescriptor GRL_PLUGIN_DESCRIPTOR = {		\
-    {									\
-      id,								\
-      name,								\
-      desc,								\
-      version,								\
-      author,								\
-      license,								\
-      site,								\
-    },									\
+    .info = {id, NULL},							\
     .plugin_init = init,						\
     .plugin_deinit = deinit,						\
   }
@@ -123,15 +109,11 @@ typedef struct _GrlPluginRegistry GrlPluginRegistry;
  * @rank: the plugin priority rank
  *
  * This structure stores the information related to a module
- */
+*/
+
 typedef struct _GrlPluginInfo {
   const gchar *id;
-  const gchar *name;
-  const gchar *desc;
-  const gchar *version;
-  const gchar *author;
-  const gchar *license;
-  const gchar *site;
+  GHashTable *optional_info;
   gint rank;
 } GrlPluginInfo;
 



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