Mercurial > pidgin
annotate plugins/ipc-test-server.c @ 8815:ada0cf2f49fe
[gaim-migrate @ 9577]
" This patch creates the subsystem like most of the core
to connect to signals and emit them. It also adds a
"gtkblist-created" signal so plugins that want to add
something to the gtkblist know when it's created.
Using the same subsytem setup as the rest of gaim helps
plugin authors avoid connecting to the buddy signon
even to know when they can connect to the
"drawing-menu" signal." --Gary Kramlich
committer: Tailor Script <tailor@pidgin.im>
| author | Luke Schierer <lschiere@pidgin.im> |
|---|---|
| date | Mon, 26 Apr 2004 16:10:16 +0000 |
| parents | d7b8eb1f0a18 |
| children | 294ae6548d4e |
| rev | line source |
|---|---|
| 6822 | 1 /* |
| 2 * IPC test server 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 | |
| 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
| 19 * 02111-1307, USA. | |
| 20 */ | |
| 21 #define IPC_TEST_SERVER_PLUGIN_ID "core-ipc-test-server" | |
| 22 | |
| 23 #include "internal.h" | |
| 24 #include "debug.h" | |
| 25 #include "plugin.h" | |
| 26 | |
| 27 static int | |
| 28 add_func(int i1, int i2) | |
| 29 { | |
| 30 gaim_debug_misc("ipc-test-server", "Got %d, %d, returning %d\n", | |
| 31 i1, i2, i1 + i2); | |
| 32 return i1 + i2; | |
| 33 } | |
| 34 | |
| 35 static int | |
| 36 sub_func(int i1, int i2) | |
| 37 { | |
| 38 gaim_debug_misc("ipc-test-server", "Got %d, %d, returning %d\n", | |
| 39 i1, i2, i1 - i2); | |
| 40 return i1 - i2; | |
| 41 } | |
| 42 | |
| 43 static gboolean | |
| 44 plugin_load(GaimPlugin *plugin) | |
| 45 { | |
| 46 gaim_plugin_ipc_register(plugin, "add", GAIM_CALLBACK(add_func), | |
| 47 gaim_marshal_INT__INT_INT, | |
| 48 gaim_value_new(GAIM_TYPE_INT), 2, | |
| 49 gaim_value_new(GAIM_TYPE_INT), | |
| 50 gaim_value_new(GAIM_TYPE_INT)); | |
| 51 | |
| 52 gaim_plugin_ipc_register(plugin, "sub", GAIM_CALLBACK(sub_func), | |
| 53 gaim_marshal_INT__INT_INT, | |
| 54 gaim_value_new(GAIM_TYPE_INT), 2, | |
| 55 gaim_value_new(GAIM_TYPE_INT), | |
| 56 gaim_value_new(GAIM_TYPE_INT)); | |
| 57 | |
| 58 return TRUE; | |
| 59 } | |
| 60 | |
| 61 static GaimPluginInfo info = | |
| 62 { | |
|
8749
d7b8eb1f0a18
[gaim-migrate @ 9504]
Christian Hammond <chipx86@chipx86.com>
parents:
6822
diff
changeset
|
63 GAIM_PLUGIN_API_VERSION, /**< api_version */ |
| 6822 | 64 GAIM_PLUGIN_STANDARD, /**< type */ |
| 65 NULL, /**< ui_requirement */ | |
| 66 0, /**< flags */ | |
| 67 NULL, /**< dependencies */ | |
| 68 GAIM_PRIORITY_DEFAULT, /**< priority */ | |
| 69 | |
| 70 IPC_TEST_SERVER_PLUGIN_ID, /**< id */ | |
| 71 N_("IPC Test Server"), /**< name */ | |
| 72 VERSION, /**< version */ | |
| 73 /** summary */ | |
| 74 N_("Test plugin IPC support, as a server."), | |
| 75 /** description */ | |
| 76 N_("Test plugin IPC support, as a server. This registers the IPC " | |
| 77 "commands."), | |
| 78 "Christian Hammond <chipx86@gnupdate.org>", /**< author */ | |
| 79 GAIM_WEBSITE, /**< homepage */ | |
| 80 | |
| 81 plugin_load, /**< load */ | |
| 82 NULL, /**< unload */ | |
| 83 NULL, /**< destroy */ | |
| 84 | |
| 85 NULL, /**< ui_info */ | |
| 86 NULL /**< extra_info */ | |
| 87 }; | |
| 88 | |
| 89 static void | |
| 90 init_plugin(GaimPlugin *plugin) | |
| 91 { | |
| 92 } | |
| 93 | |
| 94 GAIM_INIT_PLUGIN(ipctestserver, init_plugin, info) |
