Mon, 29 Jul 2013 11:52:27 +0530
Renamed plugin.[ch] to plugins.[ch], since we (will) no longer have a PurplePlugin structure.
| 6822 | 1 | /* |
| 2 | * IPC test client plugin. | |
| 3 | * | |
| 4 | * Copyright (C) 2003 Christian Hammond. | |
| 5 | * | |
| 6 | * This program is free software; you can redistribute it and/or | |
| 7 | * modify it under the terms of the GNU General Public License as | |
| 8 | * published by the Free Software Foundation; either version 2 of the | |
| 9 | * License, or (at your option) any later version. | |
| 10 | * | |
| 11 | * This program is distributed in the hope that it will be useful, but | |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 14 | * General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU General Public License | |
| 17 | * 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:
15884
diff
changeset
|
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
15884
diff
changeset
|
19 | * 02111-1301, USA. |
| 6822 | 20 | */ |
| 21 | #include "internal.h" | |
| 22 | #include "debug.h" | |
|
36367
891eea799578
Renamed plugin.[ch] to plugins.[ch], since we (will) no longer have a PurplePlugin structure.
Ankit Vani <a@nevitus.org>
parents:
20288
diff
changeset
|
23 | #include "plugins.h" |
| 9954 | 24 | #include "version.h" |
| 6822 | 25 | |
| 26 | #define IPC_TEST_CLIENT_PLUGIN_ID "core-ipc-test-client" | |
| 27 | ||
| 28 | static gboolean | |
| 15884 | 29 | plugin_load(PurplePlugin *plugin) |
| 6822 | 30 | { |
| 15884 | 31 | PurplePlugin *server_plugin; |
| 6822 | 32 | gboolean ok; |
| 33 | int result; | |
| 34 | ||
| 15884 | 35 | server_plugin = purple_plugins_find_with_id("core-ipc-test-server"); |
| 6822 | 36 | |
| 37 | if (server_plugin == NULL) | |
| 38 | { | |
| 15884 | 39 | purple_debug_error("ipc-test-client", |
| 6822 | 40 | "Unable to locate plugin core-ipc-test-server, " |
| 41 | "needed for IPC.\n"); | |
| 42 | ||
| 43 | return TRUE; | |
| 44 | } | |
| 45 | ||
| 15884 | 46 | result = (int)purple_plugin_ipc_call(server_plugin, "add", &ok, 36, 6); |
| 6822 | 47 | |
| 48 | if (!ok) | |
| 49 | { | |
| 15884 | 50 | purple_debug_error("ipc-test-client", |
| 6822 | 51 | "Unable to call IPC function 'add' in " |
| 52 | "core-ipc-test-server plugin."); | |
| 53 | ||
| 54 | return TRUE; | |
| 55 | } | |
| 56 | ||
| 15884 | 57 | purple_debug_info("ipc-test-client", "36 + 6 = %d\n", result); |
| 6822 | 58 | |
| 15884 | 59 | result = (int)purple_plugin_ipc_call(server_plugin, "sub", &ok, 50, 8); |
| 6822 | 60 | |
| 61 | if (!ok) | |
| 62 | { | |
| 15884 | 63 | purple_debug_error("ipc-test-client", |
| 6822 | 64 | "Unable to call IPC function 'sub' in " |
| 65 | "core-ipc-test-server plugin."); | |
| 66 | ||
| 67 | return TRUE; | |
| 68 | } | |
| 69 | ||
| 15884 | 70 | purple_debug_info("ipc-test-client", "50 - 8 = %d\n", result); |
| 6822 | 71 | |
| 72 | return TRUE; | |
| 73 | } | |
| 74 | ||
| 15884 | 75 | static PurplePluginInfo info = |
| 6822 | 76 | { |
| 15884 | 77 | PURPLE_PLUGIN_MAGIC, |
| 78 | PURPLE_MAJOR_VERSION, | |
| 79 | PURPLE_MINOR_VERSION, | |
| 80 | PURPLE_PLUGIN_STANDARD, /**< type */ | |
| 6822 | 81 | NULL, /**< ui_requirement */ |
| 82 | 0, /**< flags */ | |
| 83 | NULL, /**< dependencies */ | |
| 15884 | 84 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
| 6822 | 85 | |
| 86 | IPC_TEST_CLIENT_PLUGIN_ID, /**< id */ | |
| 87 | N_("IPC Test Client"), /**< name */ | |
|
20288
5ca925a094e2
applied changes from 03b709ec2a153e7e82719df0ba4635108bb1d3c6
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19859
diff
changeset
|
88 | DISPLAY_VERSION, /**< version */ |
| 6822 | 89 | /** summary */ |
| 90 | N_("Test plugin IPC support, as a client."), | |
| 91 | /** description */ | |
| 92 | N_("Test plugin IPC support, as a client. This locates the server " | |
| 93 | "plugin and calls the commands registered."), | |
| 94 | "Christian Hammond <chipx86@gnupdate.org>", /**< author */ | |
| 15884 | 95 | PURPLE_WEBSITE, /**< homepage */ |
| 6822 | 96 | |
| 97 | plugin_load, /**< load */ | |
|
11256
fe82a0c5e5ec
[gaim-migrate @ 13430]
Gary Kramlich <grim@reaperworld.com>
parents:
11033
diff
changeset
|
98 | NULL, /**< unload */ |
| 6822 | 99 | NULL, /**< destroy */ |
| 100 | ||
| 101 | NULL, /**< ui_info */ | |
| 8993 | 102 | NULL, /**< extra_info */ |
| 103 | NULL, | |
| 104 | NULL | |
| 6822 | 105 | }; |
| 106 | ||
| 107 | static void | |
| 15884 | 108 | init_plugin(PurplePlugin *plugin) |
| 6822 | 109 | { |
| 110 | info.dependencies = g_list_append(info.dependencies, | |
| 111 | "core-ipc-test-server"); | |
| 112 | } | |
| 113 | ||
| 15884 | 114 | PURPLE_INIT_PLUGIN(ipctestclient, init_plugin, info) |