Mercurial > pidgin
diff src/module.c @ 3572:bdd0bebd2d04
[gaim-migrate @ 3670]
Phase II. No longer do you have to worry about protocol plugins. When
Gaim probes plugins on load, it will detect protocol plugins and add them
to the list of available protocols. When you try to log an account on with
one of them, Gaim will automatically load the plugin--when no more accounts
need the protocol--Gaim will automatically unload it. Protocol plugins are
no longer available in the plugins ui, and no protocols are compiled statically
by default.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 30 Sep 2002 01:05:18 +0000 |
parents | 154c4a9d9b6d |
children | 9682c0e022c6 |
line wrap: on
line diff
--- a/src/module.c Sun Sep 29 17:00:14 2002 +0000 +++ b/src/module.c Mon Sep 30 01:05:18 2002 +0000 @@ -35,6 +35,7 @@ #endif #include "gaim.h" +#include "prpl.h" #include <string.h> #include <sys/time.h> @@ -92,7 +93,9 @@ int l; #if GAIM_PLUGINS char *(*gaim_plugin_init)(GModule *); + char *(*gaim_prpl_init)(struct prpl *); char *(*cfunc)(); + struct prpl * new_prpl; struct gaim_plugin_description *(*desc)(); GModule *handle; #endif @@ -111,6 +114,25 @@ debug_printf("%s is unloadable: %s\n", file, g_module_error()); continue; } + if (g_module_symbol(handle, "gaim_prpl_init", (gpointer *)&gaim_prpl_init)) { + plug = g_new0(struct gaim_plugin, 1); + g_snprintf(plug->path, sizeof(plug->path), path); + plug->type = plugin; + + new_prpl = g_new0(struct prpl, 1); + new_prpl->plug = plug; + gaim_prpl_init(new_prpl); + if (new_prpl->protocol == PROTO_ICQ || + find_prpl(new_prpl->protocol)) { + /* Nothing to see here--move along, move along */ + unload_protocol(new_prpl); + continue; + } + protocols = g_slist_insert_sorted(protocols, new_prpl, (GCompareFunc)proto_compare); + g_module_close(handle); + continue; + } + if (!g_module_symbol(handle, "gaim_plugin_init", (gpointer *)&gaim_plugin_init)) { debug_printf("%s is unloadable %s\n", file, g_module_error()); g_module_close(handle);