[PATCH 2/7] [grl-plugin-registry] Use a hashtable for plugins' info
- From: Joaquim Rocha <jrocha igalia com>
- To: grilo-list gnome org
- Subject: [PATCH 2/7] [grl-plugin-registry] Use a hashtable for plugins' info
- Date: Fri, 11 Jun 2010 21:38:19 +0200
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 d95da01..763feac 100644
--- a/src/grl-plugin-registry.c
+++ b/src/grl-plugin-registry.c
@@ -352,8 +352,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 d0b6dbb..e1516d7 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]