2006-05-17 [wwp] 2.2.0cvs25
[claws.git] / src / plugins / demo / demo.c
index 65ff9e0339fe15fc6247eb7e1b2b373488b83d9a..2766372dbfed47945b7505e6a70e20d58dfea8bf 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2002 Hiroyuki Yamamoto and the Sylpheed-Claws Team
+ * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws Team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#include "intl.h"
+ #include <glib.h>
+#include <glib/gi18n.h>
+
+
+#include "version.h"
+#include "sylpheed.h"
 #include "plugin.h"
 #include "utils.h"
 #include "hooks.h"
@@ -36,6 +41,16 @@ static guint hook_id;
 
 gint plugin_init(gchar **error)
 {
+       if ((sylpheed_get_version() > VERSION_NUMERIC)) {
+               *error = g_strdup("Your sylpheed-claws version is newer than the version the plugin was built with");
+               return -1;
+       }
+
+       if ((sylpheed_get_version() < MAKE_NUMERIC_VERSION(0, 8, 11, 39))) {
+               *error = g_strdup("Your sylpheed-claws version is too old");
+               return -1;
+       }
+
        hook_id = hooks_register_hook(LOG_APPEND_TEXT_HOOKLIST, my_log_hook, NULL);
        if (hook_id == -1) {
                *error = g_strdup("Failed to register log text hook");
@@ -61,7 +76,7 @@ const gchar *plugin_name(void)
 
 const gchar *plugin_desc(void)
 {
-       return _("This Plugin is only a demo of how to write plugins for Sylpheed. "
+       return _("This Plugin is only a demo of how to write plugins for Sylpheed-Claws. "
                 "It installs a hook for new log output and writes it to stdout."
                 "\n\n"
                 "It is not really useful");
@@ -71,3 +86,13 @@ const gchar *plugin_type(void)
 {
        return "Common";
 }
+
+const gchar *plugin_licence(void)
+{
+       return "GPL";
+}
+
+const gchar *plugin_version(void)
+{
+       return VERSION;
+}