[PATCH 2/6] core: Replaced grl-media-plugin defines with functions



---
 src/grl-media-plugin.c |   90 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/grl-media-plugin.h |   78 +++++------------------------------------
 2 files changed, 99 insertions(+), 69 deletions(-)

diff --git a/src/grl-media-plugin.c b/src/grl-media-plugin.c
index 1ab7fe4..4a3026b 100644
--- a/src/grl-media-plugin.c
+++ b/src/grl-media-plugin.c
@@ -98,6 +98,96 @@ grl_media_plugin_set_plugin_info (GrlMediaPlugin *plugin,
 }
 
 /**
+ * grl_media_plugin_get_name:
+ * @plugin: a plugin
+ *
+ * Get the name of the plugin
+ *
+ * Returns: (transfer none): the name of the @plugin
+ */
+const gchar *
+grl_media_plugin_get_name (GrlMediaPlugin *plugin)
+{
+  return grl_media_plugin_get_info (plugin,
+                                    GRL_MEDIA_PLUGIN_NAME);
+}
+
+/**
+ * grl_media_plugin_get_description:
+ * @plugin: a plugin
+ *
+ * Get the description of the plugin
+ *
+ * Returns: (transfer none): the description of the @plugin
+ */
+const gchar *
+grl_media_plugin_get_description (GrlMediaPlugin *plugin)
+{
+  return grl_media_plugin_get_info (plugin,
+                                    GRL_MEDIA_PLUGIN_DESCRIPTION);
+}
+
+/**
+ * grl_media_plugin_get_version:
+ * @plugin: a plugin
+ *
+ * Get the version of the plugin
+ *
+ * Returns: (transfer none): the version of the @plugin
+ */
+const gchar *
+grl_media_plugin_get_version (GrlMediaPlugin *plugin)
+{
+  return grl_media_plugin_get_info (plugin,
+                                   GRL_MEDIA_PLUGIN_VERSION);
+}
+
+/**
+ * grl_media_plugin_get_license:
+ * @plugin: a plugin
+ *
+ * Get the license of the plugin
+ *
+ * Returns: (transfer none): the license of the @plugin
+ */
+const gchar *
+grl_media_plugin_get_license (GrlMediaPlugin *plugin)
+{
+  return grl_media_plugin_get_info (plugin,
+                                    GRL_MEDIA_PLUGIN_LICENSE);
+}
+
+/**
+ * grl_media_plugin_get_author:
+ * @plugin: a plugin
+ *
+ * Get the author of the plugin
+ *
+ * Returns: (transfer none): the author of the @plugin
+ */
+const gchar *
+grl_media_plugin_get_author (GrlMediaPlugin *plugin)
+{
+  return grl_media_plugin_get_info (plugin,
+                                    GRL_MEDIA_PLUGIN_AUTHOR);
+}
+
+/**
+ * grl_media_plugin_get_site:
+ * @plugin: a plugin
+ *
+ * Get the site of the plugin
+ *
+ * Returns: (transfer none): the site of the @plugin
+ */
+const gchar *
+grl_media_plugin_get_site (GrlMediaPlugin *plugin)
+{
+  return grl_media_plugin_get_info (plugin,
+                                    GRL_MEDIA_PLUGIN_SITE);
+}
+
+/**
  * grl_media_plugin_get_id:
  * @plugin: a plugin
  *
diff --git a/src/grl-media-plugin.h b/src/grl-media-plugin.h
index a60eb8c..8947500 100644
--- a/src/grl-media-plugin.h
+++ b/src/grl-media-plugin.h
@@ -94,83 +94,23 @@ struct _GrlMediaPluginClass {
 
 };
 
-/**
- * grl_media_plugin_get_name:
- * @plugin: a plugin
- *
- * Get the name of the plugin
- *
- * Returns: (transfer none): the name of the @plugin
- */
-#define grl_media_plugin_get_name(plugin)		\
-  grl_media_plugin_get_info(GRL_MEDIA_PLUGIN(plugin),	\
-			    GRL_MEDIA_PLUGIN_NAME)
+/* Function prototypes */
 
-/**
- * grl_media_plugin_get_description:
- * @plugin: a plugin
- *
- * Get the description of the plugin
- *
- * Returns: (transfer none): the description of the @plugin
- */
-#define grl_media_plugin_get_description(plugin)      \
-  grl_media_plugin_get_info(GRL_MEDIA_PLUGIN(plugin), \
-			    GRL_MEDIA_PLUGIN_DESCRIPTION)
+G_BEGIN_DECLS
 
-/**
- * grl_media_plugin_get_version:
- * @plugin: a plugin
- *
- * Get the version of the plugin
- *
- * Returns: (transfer none): the version of the @plugin
- */
-#define grl_media_plugin_get_version(plugin)	      \
-  grl_media_plugin_get_info(GRL_MEDIA_PLUGIN(plugin), \
-			    GRL_MEDIA_PLUGIN_VERSION)
+GType grl_media_plugin_get_type (void);
 
-/**
- * grl_media_plugin_get_license:
- * @plugin: a plugin
- *
- * Get the license of the plugin
- *
- * Returns: (transfer none): the license of the @plugin
- */
-#define grl_media_plugin_get_license(plugin)	      \
-  grl_media_plugin_get_info(GRL_MEDIA_PLUGIN(plugin), \
-			    GRL_MEDIA_PLUGIN_LICENSE)
+const gchar *grl_media_plugin_get_name (GrlMediaPlugin *plugin);
 
-/**
- * grl_media_plugin_get_author:
- * @plugin: a plugin
- *
- * Get the author of the plugin
- *
- * Returns: (transfer none): the author of the @plugin
- */
-#define grl_media_plugin_get_author(plugin)	      \
-  grl_media_plugin_get_info(GRL_MEDIA_PLUGIN(plugin), \
-			    GRL_MEDIA_PLUGIN_AUTHOR)
+const gchar *grl_media_plugin_get_description (GrlMediaPlugin *plugin);
 
-/**
- * grl_media_plugin_get_site:
- * @plugin: a plugin
- *
- * Get the site of the plugin
- *
- * Returns: (transfer none): the site of the @plugin
- */
-#define grl_media_plugin_get_site(plugin)	      \
-  grl_media_plugin_get_info(GRL_MEDIA_PLUGIN(plugin), \
-			    GRL_MEDIA_PLUGIN_SITE)
+const gchar *grl_media_plugin_get_version (GrlMediaPlugin *plugin);
 
-/* Function prototypes */
+const gchar *grl_media_plugin_get_license (GrlMediaPlugin *plugin);
 
-G_BEGIN_DECLS
+const gchar *grl_media_plugin_get_author (GrlMediaPlugin *plugin);
 
-GType grl_media_plugin_get_type (void);
+const gchar *grl_media_plugin_get_site (GrlMediaPlugin *plugin);
 
 const gchar *grl_media_plugin_get_id (GrlMediaPlugin *plugin);
 
-- 
1.7.0.4



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