Update of /cvsroot/gaim/gaim/src/protocols/toc
In directory usw-pr-cvs1:/tmp/cvs-serv18273/src/protocols/toc
Modified Files:
toc.c
Log Message:
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.
Index: toc.c
===================================================================
RCS file: /cvsroot/gaim/gaim/src/protocols/toc/toc.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- toc.c 7 Sep 2002 18:41:09 -0000 1.52
+++ toc.c 30 Sep 2002 01:05:18 -0000 1.53
@@ -927,11 +927,6 @@
}
}
-static char *toc_name()
-{
- return "TOC";
-}
-
static int toc_send_im(struct gaim_connection *gc, char *name, char *message, int len, int flags)
{
char buf[BUF_LEN * 2];
@@ -1230,26 +1225,6 @@
return m;
}
-static GList *toc_user_opts()
-{
- GList *m = NULL;
- struct proto_user_opt *puo;
-
- puo = g_new0(struct proto_user_opt, 1);
- puo->label = "TOC Host:";
- puo->def = "toc.oscar.aol.com";
- puo->pos = USEROPT_AUTH;
- m = g_list_append(m, puo);
-
- puo = g_new0(struct proto_user_opt, 1);
- puo->label = "TOC Port:";
- puo->def = "9898";
- puo->pos = USEROPT_AUTHPORT;
- m = g_list_append(m, puo);
-
- return m;
-}
-
static void toc_add_permit(struct gaim_connection *gc, char *who)
{
char buf2[BUF_LEN * 2];
@@ -1382,16 +1357,16 @@
static struct prpl *my_protocol = NULL;
void toc_init(struct prpl *ret)
-{
+{
+ struct proto_user_opt *puo;
ret->protocol = PROTO_TOC;
ret->options = OPT_PROTO_CORRECT_TIME;
- ret->name = toc_name;
+ ret->name = g_strdup("TOC");
ret->list_icon = toc_list_icon;
ret->away_states = toc_away_states;
ret->actions = toc_actions;
ret->do_action = toc_do_action;
ret->buddy_menu = toc_buddy_menu;
- ret->user_opts = toc_user_opts;
ret->login = toc_login;
ret->close = toc_close;
ret->send_im = toc_send_im;
@@ -1421,32 +1396,27 @@
ret->chat_send = toc_chat_send;
ret->keepalive = toc_keepalive;
- my_protocol = ret;
-}
-
-#ifndef STATIC
+ puo = g_new0(struct proto_user_opt, 1);
+ puo->label = g_strdup("TOC Host:");
+ puo->def = g_strdup("toc.oscar.aol.com");
+ puo->pos = USEROPT_AUTH;
+ ret->user_opts = g_list_append(ret->user_opts, puo);
-char *gaim_plugin_init(GModule *handle)
-{
- load_protocol(toc_init, sizeof(struct prpl));
- return NULL;
-}
+ puo = g_new0(struct proto_user_opt, 1);
+ puo->label = g_strdup("TOC Port:");
+ puo->def = g_strdup("9898");
+ puo->pos = USEROPT_AUTHPORT;
+ ret->user_opts = g_list_append(ret->user_opts, puo);
-void gaim_plugin_remove()
-{
- struct prpl *p = find_prpl(PROTO_TOC);
- if (p == my_protocol)
- unload_protocol(p);
+ my_protocol = ret;
}
-char *name()
-{
- return "TOC";
-}
+#ifndef STATIC
-char *description()
+void *gaim_prpl_init(struct prpl *prpl)
{
- return PRPL_DESC("TOC");
+ toc_init(prpl);
+ prpl->plug->desc.api_version = PLUGIN_API_VERSION;
}
#endif
|