diff src/core.h @ 3551:cd938f18f3f8

[gaim-migrate @ 3626] In the interest of continued progress, I pulled what's usable out of my development tree and am committing it. Here, we have gotten rid of the plugins dialog and perl menu under Tools and put them both in preferences. Perl scripts now work like plugins--you have to load them explicitly (it will probe $prefix/lib/gaim and $HOME/.gaim for them) and you can unload them (although right now, this is entirely unreliable) Oh, and I broke all your perl scripts. Sorry about that. Don't try fixing them yet, though--I'm gonna make unloading single scripts more reliable tommorow. I should also finish Phase Two tommorow as well. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Thu, 26 Sep 2002 07:37:52 +0000
parents 6b0cb60162f4
children e120097bbd72
line wrap: on
line diff
--- a/src/core.h	Wed Sep 25 14:27:18 2002 +0000
+++ b/src/core.h	Thu Sep 26 07:37:52 2002 +0000
@@ -109,21 +109,37 @@
 	guint inpa;
 };
 
-#ifdef GAIM_PLUGINS
+#define USE_PLUGINS GAIM_PLUGINS || USE_PERL
+#define PLUGIN_API_VERSION 1
+enum gaim_plugin_type {
+	perl_script,
+	plugin
+};
+
+struct gaim_plugin_description {	
+	int api_version;
+	gchar *name;
+	gchar *version;
+	gchar *description;
+	gchar *authors;
+	gchar *url;
+	gchar *iconfile;
+};
 
 struct gaim_plugin {
-	GModule *handle;
-	char *name;
-	char *description;
+	enum gaim_plugin_type type;
+	void *handle;
+	gchar path[128];
+	struct gaim_plugin_description desc;
 };
 
+#ifdef GAIM_PLUGINS
 struct gaim_callback {
 	GModule *handle;
 	enum gaim_event event;
 	void *function;
 	void *data;
 };
-
 #endif
 
 #define BUDDY_ALIAS_MAXLEN 388	/* because MSN names can be 387 characters */
@@ -155,6 +171,7 @@
 
 /* Globals in plugins.c */
 extern GList *plugins;
+extern GList *probed_plugins;
 extern GList *callbacks;
 
 /* Functions in buddy.c */
@@ -188,12 +205,13 @@
 
 /* Functions in perl.c */
 #ifdef USE_PERL
-extern void perl_autoload();
 extern void perl_end();
 extern int perl_event(enum gaim_event, void *, void *, void *, void *, void *);
 extern int perl_load_file(char *);
+extern void perl_unload_file(struct gaim_plugin *);
 extern void unload_perl_scripts();
 extern void list_perl_scripts();
+extern struct gaim_plugin *probe_perl(const char *);
 #endif
 
 /* Functions in plugins.c */
@@ -206,6 +224,7 @@
 extern void gaim_plugin_unload(GModule *);
 extern void remove_all_plugins();
 #endif
+extern void gaim_probe_plugins();
 extern int plugin_event(enum gaim_event, ...);
 extern char *event_name(enum gaim_event);