Mercurial > pidgin
annotate plugins/ipc-test-server.c @ 11033:50224ac8184d
[gaim-migrate @ 12919]
Ok, this is debug window filtering. Sadrul was going to do this with a text entry, but I like this better, feel free to disagree with me. It's not the prettiest in a couple places, most notable gtkmain.c where a bunch of categories that don't currently have a home get registered. I added some plugin_(un)load functions to some plugins to place the (un)register functions. Though I didn't do that for the prpls. Comments and cleanups welcome. (Oh, I've been seeing some crashes on quit, but I haven't been able to get it to happen reliably so I'm not sure if it's my code or some transient HEAD oscar/other crash.)
committer: Tailor Script <tailor@pidgin.im>
| author | Etan Reisner <pidgin@unreliablesource.net> |
|---|---|
| date | Tue, 28 Jun 2005 06:13:07 +0000 |
| parents | a9fb4493ae22 |
| children | bb0d7b719af2 |
| 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" | |
| 9954 | 26 #include "version.h" |
| 6822 | 27 |
| 28 static int | |
| 29 add_func(int i1, int i2) | |
| 30 { | |
| 31 gaim_debug_misc("ipc-test-server", "Got %d, %d, returning %d\n", | |
| 32 i1, i2, i1 + i2); | |
| 33 return i1 + i2; | |
| 34 } | |
| 35 | |
| 36 static int | |
| 37 sub_func(int i1, int i2) | |
| 38 { | |
| 39 gaim_debug_misc("ipc-test-server", "Got %d, %d, returning %d\n", | |
| 40 i1, i2, i1 - i2); | |
| 41 return i1 - i2; | |
| 42 } | |
| 43 | |
| 44 static gboolean | |
| 45 plugin_load(GaimPlugin *plugin) | |
| 46 { | |
|
11033
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
9954
diff
changeset
|
47 gaim_debug_register_category("ipc-test-server"); |
|
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
9954
diff
changeset
|
48 |
| 6822 | 49 gaim_plugin_ipc_register(plugin, "add", GAIM_CALLBACK(add_func), |
| 50 gaim_marshal_INT__INT_INT, | |
| 51 gaim_value_new(GAIM_TYPE_INT), 2, | |
| 52 gaim_value_new(GAIM_TYPE_INT), | |
| 53 gaim_value_new(GAIM_TYPE_INT)); | |
| 54 | |
| 55 gaim_plugin_ipc_register(plugin, "sub", GAIM_CALLBACK(sub_func), | |
| 56 gaim_marshal_INT__INT_INT, | |
| 57 gaim_value_new(GAIM_TYPE_INT), 2, | |
| 58 gaim_value_new(GAIM_TYPE_INT), | |
| 59 gaim_value_new(GAIM_TYPE_INT)); | |
| 60 | |
| 61 return TRUE; | |
| 62 } | |
| 63 | |
|
11033
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
9954
diff
changeset
|
64 static gboolean |
|
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
9954
diff
changeset
|
65 plugin_unload(GaimPlugin *plugin) |
|
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
9954
diff
changeset
|
66 { |
|
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
9954
diff
changeset
|
67 gaim_debug_unregister_category("ipc-test-server"); |
|
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
9954
diff
changeset
|
68 } |
|
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
9954
diff
changeset
|
69 |
| 6822 | 70 static GaimPluginInfo info = |
| 71 { | |
| 9954 | 72 GAIM_PLUGIN_MAGIC, |
| 73 GAIM_MAJOR_VERSION, | |
| 74 GAIM_MINOR_VERSION, | |
| 6822 | 75 GAIM_PLUGIN_STANDARD, /**< type */ |
| 76 NULL, /**< ui_requirement */ | |
| 77 0, /**< flags */ | |
| 78 NULL, /**< dependencies */ | |
| 79 GAIM_PRIORITY_DEFAULT, /**< priority */ | |
| 80 | |
| 81 IPC_TEST_SERVER_PLUGIN_ID, /**< id */ | |
| 82 N_("IPC Test Server"), /**< name */ | |
| 83 VERSION, /**< version */ | |
| 84 /** summary */ | |
| 85 N_("Test plugin IPC support, as a server."), | |
| 86 /** description */ | |
| 87 N_("Test plugin IPC support, as a server. This registers the IPC " | |
| 88 "commands."), | |
| 89 "Christian Hammond <chipx86@gnupdate.org>", /**< author */ | |
| 90 GAIM_WEBSITE, /**< homepage */ | |
| 91 | |
| 92 plugin_load, /**< load */ | |
|
11033
50224ac8184d
[gaim-migrate @ 12919]
Etan Reisner <pidgin@unreliablesource.net>
parents:
9954
diff
changeset
|
93 plugin_unload, /**< unload */ |
| 6822 | 94 NULL, /**< destroy */ |
| 95 | |
| 96 NULL, /**< ui_info */ | |
| 8993 | 97 NULL, /**< extra_info */ |
| 98 NULL, | |
| 99 NULL | |
| 6822 | 100 }; |
| 101 | |
| 102 static void | |
| 103 init_plugin(GaimPlugin *plugin) | |
| 104 { | |
| 105 } | |
| 106 | |
| 107 GAIM_INIT_PLUGIN(ipctestserver, init_plugin, info) |
