Thu, 11 Sep 2014 14:55:39 -0700
Better indentation and debug message.
| 7016 | 1 | /** |
| 2 | * @file ssl.c Main SSL plugin | |
| 3 | * | |
| 15884 | 4 | * purple |
| 7016 | 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 | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16744
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 7016 | 21 | */ |
| 22 | #include "internal.h" | |
| 23 | #include "debug.h" | |
| 24 | #include "plugin.h" | |
| 25 | #include "sslconn.h" | |
| 9943 | 26 | #include "version.h" |
| 7016 | 27 | |
| 28 | #define SSL_PLUGIN_ID "core-ssl" | |
| 29 | ||
| 15884 | 30 | static PurplePlugin *ssl_plugin = NULL; |
| 7016 | 31 | |
| 32 | static gboolean | |
| 15884 | 33 | probe_ssl_plugins(PurplePlugin *my_plugin) |
| 7016 | 34 | { |
| 15884 | 35 | PurplePlugin *plugin; |
| 7016 | 36 | GList *l; |
| 37 | ||
| 38 | ssl_plugin = NULL; | |
| 39 | ||
| 15884 | 40 | for (l = purple_plugins_get_all(); l != NULL; l = l->next) |
| 7016 | 41 | { |
| 15884 | 42 | plugin = (PurplePlugin *)l->data; |
| 7016 | 43 | |
| 44 | if (plugin == my_plugin) | |
| 45 | continue; | |
| 46 | ||
| 47 | if (plugin->info != NULL && plugin->info->id != NULL && | |
| 48 | strncmp(plugin->info->id, "ssl-", 4) == 0) | |
| 49 | { | |
| 15884 | 50 | if (purple_plugin_is_loaded(plugin) || purple_plugin_load(plugin)) |
| 7016 | 51 | { |
| 52 | ssl_plugin = plugin; | |
| 53 | ||
| 54 | break; | |
| 55 | } | |
| 56 | } | |
| 57 | } | |
| 58 | ||
| 59 | return (ssl_plugin != NULL); | |
| 60 | } | |
| 61 | ||
| 62 | static gboolean | |
| 15884 | 63 | plugin_load(PurplePlugin *plugin) |
| 7016 | 64 | { |
| 65 | return probe_ssl_plugins(plugin); | |
| 66 | } | |
| 67 | ||
| 68 | static gboolean | |
| 15884 | 69 | plugin_unload(PurplePlugin *plugin) |
| 7016 | 70 | { |
|
7040
a7560306d591
[gaim-migrate @ 7603]
Christian Hammond <chipx86@chipx86.com>
parents:
7016
diff
changeset
|
71 | if (ssl_plugin != NULL && |
| 15884 | 72 | g_list_find(purple_plugins_get_loaded(), ssl_plugin) != NULL) |
| 7016 | 73 | { |
| 15884 | 74 | purple_plugin_unload(ssl_plugin); |
|
7040
a7560306d591
[gaim-migrate @ 7603]
Christian Hammond <chipx86@chipx86.com>
parents:
7016
diff
changeset
|
75 | } |
| 7016 | 76 | |
|
7040
a7560306d591
[gaim-migrate @ 7603]
Christian Hammond <chipx86@chipx86.com>
parents:
7016
diff
changeset
|
77 | ssl_plugin = NULL; |
| 7016 | 78 | |
| 79 | return TRUE; | |
| 80 | } | |
| 81 | ||
| 15884 | 82 | static PurplePluginInfo info = |
| 7016 | 83 | { |
| 15884 | 84 | PURPLE_PLUGIN_MAGIC, |
| 85 | PURPLE_MAJOR_VERSION, | |
| 86 | PURPLE_MINOR_VERSION, | |
| 87 | PURPLE_PLUGIN_STANDARD, /**< type */ | |
| 7016 | 88 | NULL, /**< ui_requirement */ |
| 15884 | 89 | PURPLE_PLUGIN_FLAG_INVISIBLE, /**< flags */ |
| 7016 | 90 | NULL, /**< dependencies */ |
| 15884 | 91 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
| 7016 | 92 | |
| 93 | SSL_PLUGIN_ID, /**< id */ | |
| 94 | N_("SSL"), /**< name */ | |
|
20288
5ca925a094e2
applied changes from 03b709ec2a153e7e82719df0ba4635108bb1d3c6
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
95 | DISPLAY_VERSION, /**< version */ |
| 7016 | 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>", | |
| 15884 | 101 | PURPLE_WEBSITE, /**< homepage */ |
| 7016 | 102 | |
| 103 | plugin_load, /**< load */ | |
| 104 | plugin_unload, /**< unload */ | |
| 105 | NULL, /**< destroy */ | |
| 106 | ||
| 107 | NULL, /**< ui_info */ | |
| 8993 | 108 | NULL, /**< extra_info */ |
| 109 | NULL, | |
|
16744
fcdab37ba1c2
Added NULL pads to ssl stuff
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
110 | NULL, |
|
fcdab37ba1c2
Added NULL pads to ssl stuff
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
111 | |
|
fcdab37ba1c2
Added NULL pads to ssl stuff
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
112 | /* padding */ |
|
fcdab37ba1c2
Added NULL pads to ssl stuff
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
113 | NULL, |
|
fcdab37ba1c2
Added NULL pads to ssl stuff
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
114 | NULL, |
|
fcdab37ba1c2
Added NULL pads to ssl stuff
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
115 | NULL, |
| 8993 | 116 | NULL |
| 7016 | 117 | }; |
| 118 | ||
| 119 | static void | |
| 15884 | 120 | init_plugin(PurplePlugin *plugin) |
| 7016 | 121 | { |
| 122 | } | |
| 123 | ||
| 15884 | 124 | PURPLE_INIT_PLUGIN(ssl, init_plugin, info) |