Mercurial > pidgin
annotate plugins/ssl/ssl.c @ 8907:00138e366ef8
[gaim-migrate @ 9677]
" Fixes a few warnings on 64bit machines. Also fixes
yahoo auth on 64bit machines which would have taken me
awhile if marv didn't point me in the right direction.
I've applied to my local 32bit copy and everything
seems to be working fine." --Gary Kramlich
committer: Tailor Script <tailor@pidgin.im>
| author | Luke Schierer <lschiere@pidgin.im> |
|---|---|
| date | Sat, 08 May 2004 23:34:30 +0000 |
| parents | d7b8eb1f0a18 |
| children | 294ae6548d4e |
| rev | line source |
|---|---|
| 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 { | |
|
7040
ccadd1da839b
[gaim-migrate @ 7603]
Christian Hammond <chipx86@chipx86.com>
parents:
7016
diff
changeset
|
70 if (ssl_plugin != NULL && |
|
7041
a671a28bc50b
[gaim-migrate @ 7604]
Christian Hammond <chipx86@chipx86.com>
parents:
7040
diff
changeset
|
71 g_list_find(gaim_plugins_get_loaded(), ssl_plugin) != NULL) |
| 7016 | 72 { |
| 73 gaim_plugin_unload(ssl_plugin); | |
|
7040
ccadd1da839b
[gaim-migrate @ 7603]
Christian Hammond <chipx86@chipx86.com>
parents:
7016
diff
changeset
|
74 } |
| 7016 | 75 |
|
7040
ccadd1da839b
[gaim-migrate @ 7603]
Christian Hammond <chipx86@chipx86.com>
parents:
7016
diff
changeset
|
76 ssl_plugin = NULL; |
| 7016 | 77 |
| 78 return TRUE; | |
| 79 } | |
| 80 | |
| 81 static GaimPluginInfo info = | |
| 82 { | |
|
8749
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
7041
diff
changeset
|
83 GAIM_PLUGIN_API_VERSION, /**< api_version */ |
| 7016 | 84 GAIM_PLUGIN_STANDARD, /**< type */ |
| 85 NULL, /**< ui_requirement */ | |
| 86 GAIM_PLUGIN_FLAG_INVISIBLE, /**< flags */ | |
| 87 NULL, /**< dependencies */ | |
| 88 GAIM_PRIORITY_DEFAULT, /**< priority */ | |
| 89 | |
| 90 SSL_PLUGIN_ID, /**< id */ | |
| 91 N_("SSL"), /**< name */ | |
| 92 VERSION, /**< version */ | |
| 93 /** summary */ | |
| 94 N_("Provides a wrapper around SSL support libraries."), | |
| 95 /** description */ | |
| 96 N_("Provides a wrapper around SSL support libraries."), | |
| 97 "Christian Hammond <chipx86@gnupdate.org>", | |
| 98 GAIM_WEBSITE, /**< homepage */ | |
| 99 | |
| 100 plugin_load, /**< load */ | |
| 101 plugin_unload, /**< unload */ | |
| 102 NULL, /**< destroy */ | |
| 103 | |
| 104 NULL, /**< ui_info */ | |
| 105 NULL /**< extra_info */ | |
| 106 }; | |
| 107 | |
| 108 static void | |
| 109 init_plugin(GaimPlugin *plugin) | |
| 110 { | |
| 111 } | |
| 112 | |
| 113 GAIM_INIT_PLUGIN(ssl, init_plugin, info) |
