diff plugins/filectl.c @ 5255:c0baa01cdeda

[gaim-migrate @ 5627] Paul A (darkrain) writes: " This patch updates the events.c, filectl.c, gaiminc.c, and mailchk.c plugins to the new api as well as updating mailchk.c to the new buddy list code. events.so, gaiminc.so, and mailchk.so all load and function properly on my computer. filectl doesn't even compile, but then, it has been a while since it did actually compile. I didn't even bother to update a few of the other plugins, since they're completely out of date. Perhaps one of the developers needs to go through and prune out a bunch of the plugins that are not kept up to date. Out of date plugins: chatlist.c - superceded by faceprint's recent commit to cvs. filectl.c - doesn't support multiple accounts for IMs and away messages. raw.c - does anyone use this? it doesn't compile, but it looks like an easy fix. " committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Mon, 28 Apr 2003 18:45:38 +0000
parents 6d1707dc8c3d
children dae79aefac8d
line wrap: on
line diff
--- a/plugins/filectl.c	Mon Apr 28 16:21:03 2003 +0000
+++ b/plugins/filectl.c	Mon Apr 28 18:45:38 2003 +0000
@@ -9,7 +9,7 @@
 #include <string.h>
 #include <ctype.h>
 
-static void *handle;
+#define FILECTL_PLUGIN_ID "core-filectl"
 static int check;
 static time_t mtime;
 
@@ -107,36 +107,6 @@
 	mtime = finfo.st_mtime;
 }
 
-char *gaim_plugin_init(GModule *h) {
-	handle = h;
-	init_file();
-	check = g_timeout_add(5000, check_file, NULL);
-	return NULL;
-}
-
-void gaim_plugin_remove() {
-	g_source_remove(check);
-}
-
-struct gaim_plugin_description desc; 
-struct gaim_plugin_description *gaim_plugin_desc() {
-	desc.api_version = GAIM_PLUGIN_API_VERSION;
-	desc.name = g_strdup("Gaim File Control");
-	desc.version = g_strdup(VERSION);
-	desc.description = g_strdup("Allows you to control Gaim by entering commands in aa file.");
-	desc.authors = g_strdup("Eric Warmehoven &lt;eric@warmenhoven.org>");
-	desc.url = g_strdup(WEBSITE);
-	return &desc;
-}
- 
-char *name() {
-	return "Gaim File Control";
-}
-
-char *description() {
-	return "Allows you to control gaim by entering commands in a file.";
-}
-
 /* check to see if the size of the file is > 0. if so, run commands */
 void init_file() {
 	/* most of this was taken from Bash v2.04 by the FSF */
@@ -199,3 +169,57 @@
 	free(arr);
 	return val;
 }
+/*
+ *  EXPORTED FUNCTIONS
+ */
+
+static gboolean
+plugin_load(GaimPlugin *plugin)
+{
+	init_file();
+	check = g_timeout_add(5000, check_file, NULL);
+
+	return TRUE;
+}
+
+static gboolean
+plugin_unload(GaimPlugin *plugin)
+{
+	g_source_remove(check);
+
+	return TRUE;
+}
+
+static GaimPluginInfo info =
+{
+	2,                                                /**< api_version    */
+	GAIM_PLUGIN_STANDARD,                             /**< type           */
+	NULL,                                             /**< ui_requirement */
+	0,                                                /**< flags          */
+	NULL,                                             /**< dependencies   */
+	GAIM_PRIORITY_DEFAULT,                            /**< priority       */
+
+	FILECTL_PLUGIN_ID,                                /**< id             */
+	N_("Gaim File Control"),                          /**< name           */
+	VERSION,                                          /**< version        */
+	                                                  /**  summary        */
+	N_("Allows you to control Gaim by entering commands in a file."),
+	                                                  /**  description    */
+	N_("Allows you to control Gaim by entering commands in a file."),
+	"Eric Warmenhoven <eric@warmenhoven.org>",        /**< author         */
+	WEBSITE,                                          /**< homepage       */
+
+	plugin_load,                                      /**< load           */
+	plugin_unload,                                    /**< unload         */
+	NULL,                                             /**< destroy        */
+
+	NULL,                                             /**< ui_info        */
+	NULL                                              /**< extra_info     */
+};
+
+static void
+__init_plugin(GaimPlugin *plugin)
+{
+}
+
+GAIM_INIT_PLUGIN(filectl, __init_plugin, info);