7016
|
1 /**
|
|
2 * @file ssl.c Main SSL plugin
|
|
3 *
|
|
4 * gaim
|
|
5 *
|
|
6 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org>
|
|
7 *
|
|
8 * This program is free software; you can redistribute it and/or modify
|
|
9 * it under the terms of the GNU General Public License as published by
|
|
10 * the Free Software Foundation; either version 2 of the License, or
|
|
11 * (at your option) any later version.
|
|
12 *
|
|
13 * This program is distributed in the hope that it will be useful,
|
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16 * GNU General Public License for more details.
|
|
17 *
|
|
18 * You should have received a copy of the GNU General Public License
|
|
19 * along with this program; if not, write to the Free Software
|
|
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
21 */
|
|
22 #include "internal.h"
|
|
23 #include "debug.h"
|
|
24 #include "plugin.h"
|
|
25 #include "sslconn.h"
|
|
26
|
|
27 #define SSL_PLUGIN_ID "core-ssl"
|
|
28
|
|
29 static GaimPlugin *ssl_plugin = NULL;
|
|
30
|
|
31 static gboolean
|
|
32 probe_ssl_plugins(GaimPlugin *my_plugin)
|
|
33 {
|
|
34 GaimPlugin *plugin;
|
|
35 GList *l;
|
|
36
|
|
37 ssl_plugin = NULL;
|
|
38
|
|
39 for (l = gaim_plugins_get_all(); l != NULL; l = l->next)
|
|
40 {
|
|
41 plugin = (GaimPlugin *)l->data;
|
|
42
|
|
43 if (plugin == my_plugin)
|
|
44 continue;
|
|
45
|
|
46 if (plugin->info != NULL && plugin->info->id != NULL &&
|
|
47 strncmp(plugin->info->id, "ssl-", 4) == 0)
|
|
48 {
|
|
49 if (gaim_plugin_is_loaded(plugin) || gaim_plugin_load(plugin))
|
|
50 {
|
|
51 ssl_plugin = plugin;
|
|
52
|
|
53 break;
|
|
54 }
|
|
55 }
|
|
56 }
|
|
57
|
|
58 return (ssl_plugin != NULL);
|
|
59 }
|
|
60
|
|
61 static gboolean
|
|
62 plugin_load(GaimPlugin *plugin)
|
|
63 {
|
|
64 return probe_ssl_plugins(plugin);
|
|
65 }
|
|
66
|
|
67 static gboolean
|
|
68 plugin_unload(GaimPlugin *plugin)
|
|
69 {
|
|
70 if (ssl_plugin != NULL)
|
|
71 {
|
|
72 gaim_plugin_unload(ssl_plugin);
|
|
73
|
|
74 ssl_plugin = NULL;
|
|
75 }
|
|
76
|
|
77 return TRUE;
|
|
78 }
|
|
79
|
|
80 static GaimPluginInfo info =
|
|
81 {
|
|
82 2, /**< api_version */
|
|
83 GAIM_PLUGIN_STANDARD, /**< type */
|
|
84 NULL, /**< ui_requirement */
|
|
85 GAIM_PLUGIN_FLAG_INVISIBLE, /**< flags */
|
|
86 NULL, /**< dependencies */
|
|
87 GAIM_PRIORITY_DEFAULT, /**< priority */
|
|
88
|
|
89 SSL_PLUGIN_ID, /**< id */
|
|
90 N_("SSL"), /**< name */
|
|
91 VERSION, /**< version */
|
|
92 /** summary */
|
|
93 N_("Provides a wrapper around SSL support libraries."),
|
|
94 /** description */
|
|
95 N_("Provides a wrapper around SSL support libraries."),
|
|
96 "Christian Hammond <chipx86@gnupdate.org>",
|
|
97 GAIM_WEBSITE, /**< homepage */
|
|
98
|
|
99 plugin_load, /**< load */
|
|
100 plugin_unload, /**< unload */
|
|
101 NULL, /**< destroy */
|
|
102
|
|
103 NULL, /**< ui_info */
|
|
104 NULL /**< extra_info */
|
|
105 };
|
|
106
|
|
107 static void
|
|
108 init_plugin(GaimPlugin *plugin)
|
|
109 {
|
|
110 }
|
|
111
|
|
112 GAIM_INIT_PLUGIN(ssl, init_plugin, info)
|