Open an explorer.exe window at the location of the file when clicking
[pidgin-git.git] / libpurple / plugins / ssl / ssl.c
blob2113755c463a5094f8283cf2dd9953171b31486b
1 /**
2 * @file ssl.c Main SSL plugin
4 * purple
6 * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org>
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 #include "internal.h"
23 #include "debug.h"
24 #include "plugin.h"
25 #include "sslconn.h"
26 #include "version.h"
28 #define SSL_PLUGIN_ID "core-ssl"
30 static PurplePlugin *ssl_plugin = NULL;
32 static gboolean
33 probe_ssl_plugins(PurplePlugin *my_plugin)
35 PurplePlugin *plugin;
36 GList *l;
38 ssl_plugin = NULL;
40 for (l = purple_plugins_get_all(); l != NULL; l = l->next)
42 plugin = (PurplePlugin *)l->data;
44 if (plugin == my_plugin)
45 continue;
47 if (plugin->info != NULL && plugin->info->id != NULL &&
48 strncmp(plugin->info->id, "ssl-", 4) == 0)
50 if (purple_plugin_is_loaded(plugin) || purple_plugin_load(plugin))
52 ssl_plugin = plugin;
54 break;
59 return (ssl_plugin != NULL);
62 static gboolean
63 plugin_load(PurplePlugin *plugin)
65 return probe_ssl_plugins(plugin);
68 static gboolean
69 plugin_unload(PurplePlugin *plugin)
71 if (ssl_plugin != NULL &&
72 g_list_find(purple_plugins_get_loaded(), ssl_plugin) != NULL)
74 purple_plugin_unload(ssl_plugin);
77 ssl_plugin = NULL;
79 return TRUE;
82 static PurplePluginInfo info =
84 PURPLE_PLUGIN_MAGIC,
85 PURPLE_MAJOR_VERSION,
86 PURPLE_MINOR_VERSION,
87 PURPLE_PLUGIN_STANDARD, /**< type */
88 NULL, /**< ui_requirement */
89 PURPLE_PLUGIN_FLAG_INVISIBLE, /**< flags */
90 NULL, /**< dependencies */
91 PURPLE_PRIORITY_DEFAULT, /**< priority */
93 SSL_PLUGIN_ID, /**< id */
94 N_("SSL"), /**< name */
95 DISPLAY_VERSION, /**< version */
96 /** summary */
97 N_("Provides a wrapper around SSL support libraries."),
98 /** description */
99 N_("Provides a wrapper around SSL support libraries."),
100 "Christian Hammond <chipx86@gnupdate.org>",
101 PURPLE_WEBSITE, /**< homepage */
103 plugin_load, /**< load */
104 plugin_unload, /**< unload */
105 NULL, /**< destroy */
107 NULL, /**< ui_info */
108 NULL, /**< extra_info */
109 NULL,
110 NULL,
112 /* padding */
113 NULL,
114 NULL,
115 NULL,
116 NULL
119 static void
120 init_plugin(PurplePlugin *plugin)
124 PURPLE_INIT_PLUGIN(ssl, init_plugin, info)