[PATCH 2/6] [grl-plugin-registry] 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 1fe7e13..a1d86f9 100644
--- a/src/grl-plugin-registry.c
+++ b/src/grl-plugin-registry.c
@@ -383,8 +383,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 b925cb6..896491e 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;
 
-- 
1.7.0.4



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