annotate src/signals.c @ 13961:b0e37dcb3987

[gaim-migrate @ 16514] Fix the makefile. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 17 Jul 2006 23:57:12 +0000
parents f61428cc4019
children f94309c7c480
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
6488
e5e8d21bd4d8 [gaim-migrate @ 7002]
Christian Hammond <chipx86@chipx86.com>
parents: 6485
diff changeset
2 * @file signals.c Signal API
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 * @ingroup core
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 *
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 * gaim
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8004
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8004
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 8004
diff changeset
9 * source distribution.
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 *
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * (at your option) any later version.
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 *
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * GNU General Public License for more details.
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 *
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 */
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 #include "internal.h"
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26
11080
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11064
diff changeset
27 #include "dbus-maybe.h"
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 #include "debug.h"
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29 #include "signals.h"
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
30 #include "value.h"
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31
9127
f4d981c9c4ab [gaim-migrate @ 9905]
Nathan Walp <nwalp@pidgin.im>
parents: 8142
diff changeset
32 /* must include this to use G_VA_COPY */
f4d981c9c4ab [gaim-migrate @ 9905]
Nathan Walp <nwalp@pidgin.im>
parents: 8142
diff changeset
33 #include <string.h>
f4d981c9c4ab [gaim-migrate @ 9905]
Nathan Walp <nwalp@pidgin.im>
parents: 8142
diff changeset
34
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35 typedef struct
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 void *instance;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 GHashTable *signals;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 size_t signal_count;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 gulong next_signal_id;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 } GaimInstanceData;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46 typedef struct
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48 gulong id;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
49
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50 GaimSignalMarshalFunc marshal;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
52 int num_values;
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
53 GaimValue **values;
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
54 GaimValue *ret_value;
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
55
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
56 GList *handlers;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
57 size_t handler_count;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
58
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59 gulong next_handler_id;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
60 } GaimSignalData;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
61
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62 typedef struct
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64 gulong id;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 GaimCallback cb;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66 void *handle;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 void *data;
6547
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
68 gboolean use_vargs;
10656
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
69 int priority;
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71 } GaimSignalHandlerData;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73 static GHashTable *instance_table = NULL;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 static void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 destroy_instance_data(GaimInstanceData *instance_data)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 g_hash_table_destroy(instance_data->signals);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80 g_free(instance_data);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83 static void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 destroy_signal_data(GaimSignalData *signal_data)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 GaimSignalHandlerData *handler_data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 GList *l;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 for (l = signal_data->handlers; l != NULL; l = l->next)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 handler_data = (GaimSignalHandlerData *)l->data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93 g_free(l->data);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96 g_list_free(signal_data->handlers);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
97
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
98 if (signal_data->values != NULL)
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
99 {
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
100 int i;
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
101
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
102 for (i = 0; i < signal_data->num_values; i++)
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
103 gaim_value_destroy((GaimValue *)signal_data->values[i]);
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
104
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
105 g_free(signal_data->values);
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
106 }
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
107
10542
def1c69ae8af [gaim-migrate @ 11907]
Mark Doliner <mark@kingant.net>
parents: 10276
diff changeset
108 if (signal_data->ret_value != NULL)
def1c69ae8af [gaim-migrate @ 11907]
Mark Doliner <mark@kingant.net>
parents: 10276
diff changeset
109 gaim_value_destroy(signal_data->ret_value);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110 g_free(signal_data);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
111 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
112
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
113 gulong
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
114 gaim_signal_register(void *instance, const char *signal,
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
115 GaimSignalMarshalFunc marshal,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
116 GaimValue *ret_value, int num_values, ...)
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
117 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
118 GaimInstanceData *instance_data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
119 GaimSignalData *signal_data;
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
120 va_list args;
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
122 g_return_val_if_fail(instance != NULL, 0);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123 g_return_val_if_fail(signal != NULL, 0);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
124 g_return_val_if_fail(marshal != NULL, 0);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
125
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
126 instance_data =
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
127 (GaimInstanceData *)g_hash_table_lookup(instance_table, instance);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
128
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
129 if (instance_data == NULL)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
130 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
131 instance_data = g_new0(GaimInstanceData, 1);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
132
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
133 instance_data->instance = instance;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
134 instance_data->next_signal_id = 1;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
135
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
136 instance_data->signals =
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
137 g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
138 (GDestroyNotify)destroy_signal_data);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
139
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
140 g_hash_table_insert(instance_table, instance, instance_data);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
141 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
142
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
143 signal_data = g_new0(GaimSignalData, 1);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
144 signal_data->id = instance_data->next_signal_id;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
145 signal_data->marshal = marshal;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
146 signal_data->next_handler_id = 1;
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
147 signal_data->ret_value = ret_value;
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
148 signal_data->num_values = num_values;
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
149
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
150 if (num_values > 0)
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
151 {
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
152 int i;
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
153
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
154 signal_data->values = g_new0(GaimValue *, num_values);
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
155
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
156 va_start(args, num_values);
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
157
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
158 for (i = 0; i < num_values; i++)
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
159 signal_data->values[i] = va_arg(args, GaimValue *);
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
160
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
161 va_end(args);
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
162 }
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
163
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
164 g_hash_table_insert(instance_data->signals,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
165 g_strdup(signal), signal_data);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
166
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
167 instance_data->next_signal_id++;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
168 instance_data->signal_count++;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
169
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
170 return signal_data->id;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
171 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
172
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
173 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
174 gaim_signal_unregister(void *instance, const char *signal)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
175 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
176 GaimInstanceData *instance_data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
177
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
178 g_return_if_fail(instance != NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
179 g_return_if_fail(signal != NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
180
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
181 instance_data =
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
182 (GaimInstanceData *)g_hash_table_lookup(instance_table, instance);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
183
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
184 g_return_if_fail(instance_data != NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
185
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
186 g_hash_table_remove(instance_data->signals, signal);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
187
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
188 instance_data->signal_count--;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
189
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
190 if (instance_data->signal_count == 0)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
191 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
192 /* Unregister the instance. */
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
193 g_hash_table_remove(instance_table, instance);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
194 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
195 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
196
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
197 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
198 gaim_signals_unregister_by_instance(void *instance)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
199 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
200 gboolean found;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
201
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
202 g_return_if_fail(instance != NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
203
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
204 found = g_hash_table_remove(instance_table, instance);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
205
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
206 /*
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
207 * Makes things easier (more annoying?) for developers who don't have
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
208 * things registering and unregistering in the right order :)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
209 */
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
210 g_return_if_fail(found);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
211 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
212
6564
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
213 void
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
214 gaim_signal_get_values(void *instance, const char *signal,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
215 GaimValue **ret_value,
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
216 int *num_values, GaimValue ***values)
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
217 {
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
218 GaimInstanceData *instance_data;
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
219 GaimSignalData *signal_data;
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
220
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
221 g_return_if_fail(instance != NULL);
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
222 g_return_if_fail(signal != NULL);
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
223 g_return_if_fail(num_values != NULL);
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
224 g_return_if_fail(values != NULL);
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
225
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
226 /* Get the instance data */
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
227 instance_data =
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
228 (GaimInstanceData *)g_hash_table_lookup(instance_table, instance);
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
229
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
230 g_return_if_fail(instance_data != NULL);
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
231
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
232 /* Get the signal data */
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
233 signal_data =
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
234 (GaimSignalData *)g_hash_table_lookup(instance_data->signals, signal);
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
235
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
236 g_return_if_fail(signal_data != NULL);
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
237
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
238 *num_values = signal_data->num_values;
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
239 *values = signal_data->values;
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
240
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
241 if (ret_value != NULL)
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
242 *ret_value = signal_data->ret_value;
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
243 }
800ef4a51096 [gaim-migrate @ 7086]
Christian Hammond <chipx86@chipx86.com>
parents: 6553
diff changeset
244
10656
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
245 static gint handler_priority(void * a, void * b) {
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
246 GaimSignalHandlerData *ah = (GaimSignalHandlerData*)a;
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
247 GaimSignalHandlerData *bh = (GaimSignalHandlerData*)b;
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
248 if (ah->priority > bh->priority) return 1;
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
249 if (ah->priority < bh->priority) return -1;
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
250 return 0;
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
251 }
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
252
6547
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
253 static gulong
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
254 signal_connect_common(void *instance, const char *signal, void *handle,
10656
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
255 GaimCallback func, void *data, int priority, gboolean use_vargs)
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
256 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
257 GaimInstanceData *instance_data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
258 GaimSignalData *signal_data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
259 GaimSignalHandlerData *handler_data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
260
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
261 g_return_val_if_fail(instance != NULL, 0);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
262 g_return_val_if_fail(signal != NULL, 0);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
263 g_return_val_if_fail(handle != NULL, 0);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
264 g_return_val_if_fail(func != NULL, 0);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
265
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
266 /* Get the instance data */
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
267 instance_data =
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
268 (GaimInstanceData *)g_hash_table_lookup(instance_table, instance);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
269
13956
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13056
diff changeset
270 if (instance_data == NULL)
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13056
diff changeset
271 {
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13056
diff changeset
272 gaim_debug_warning("signals", "Something tried to register a callback "
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13056
diff changeset
273 "for the '%s' signal, but we do not have any signals "
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13056
diff changeset
274 "registered with the given handle\n", signal);
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13056
diff changeset
275 g_return_val_if_reached(0);
f61428cc4019 [gaim-migrate @ 16505]
Mark Doliner <mark@kingant.net>
parents: 13056
diff changeset
276 }
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
277
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
278 /* Get the signal data */
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
279 signal_data =
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
280 (GaimSignalData *)g_hash_table_lookup(instance_data->signals, signal);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
281
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
282 if (signal_data == NULL)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
283 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
284 gaim_debug(GAIM_DEBUG_ERROR, "signals",
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
285 "Signal data for %s not found!\n", signal);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
286 return 0;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
287 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
288
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
289 /* Create the signal handler data */
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
290 handler_data = g_new0(GaimSignalHandlerData, 1);
6547
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
291 handler_data->id = signal_data->next_handler_id;
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
292 handler_data->cb = func;
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
293 handler_data->handle = handle;
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
294 handler_data->data = data;
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
295 handler_data->use_vargs = use_vargs;
10656
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
296 handler_data->priority = priority;
10758
c80a609bd747 [gaim-migrate @ 12361]
Mark Doliner <mark@kingant.net>
parents: 10656
diff changeset
297
10656
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
298 signal_data->handlers = g_list_insert_sorted(signal_data->handlers, handler_data, (GCompareFunc)handler_priority);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
299 signal_data->handler_count++;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
300 signal_data->next_handler_id++;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
301
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
302 return handler_data->id;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
303 }
6553
9e4fa4853cfe [gaim-migrate @ 7075]
Christian Hammond <chipx86@chipx86.com>
parents: 6547
diff changeset
304
6547
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
305 gulong
10656
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
306 gaim_signal_connect_priority(void *instance, const char *signal, void *handle,
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
307 GaimCallback func, void *data, int priority)
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
308 {
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
309 return signal_connect_common(instance, signal, handle, func, data, priority, FALSE);
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
310 }
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
311
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
312 gulong
6547
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
313 gaim_signal_connect(void *instance, const char *signal, void *handle,
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
314 GaimCallback func, void *data)
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
315 {
10656
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
316 return signal_connect_common(instance, signal, handle, func, data, GAIM_SIGNAL_PRIORITY_DEFAULT, FALSE);
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
317 }
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
318
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
319 gulong
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
320 gaim_signal_connect_priority_vargs(void *instance, const char *signal, void *handle,
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
321 GaimCallback func, void *data, int priority)
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
322 {
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
323 return signal_connect_common(instance, signal, handle, func, data, priority, TRUE);
6547
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
324 }
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
325
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
326 gulong
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
327 gaim_signal_connect_vargs(void *instance, const char *signal, void *handle,
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
328 GaimCallback func, void *data)
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
329 {
10656
9b223bf37ca0 [gaim-migrate @ 12186]
Mark Doliner <mark@kingant.net>
parents: 10542
diff changeset
330 return signal_connect_common(instance, signal, handle, func, data, GAIM_SIGNAL_PRIORITY_DEFAULT, TRUE);
6547
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
331 }
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
332
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
333 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
334 gaim_signal_disconnect(void *instance, const char *signal,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
335 void *handle, GaimCallback func)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
336 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
337 GaimInstanceData *instance_data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
338 GaimSignalData *signal_data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
339 GaimSignalHandlerData *handler_data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
340 GList *l;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
341 gboolean found = FALSE;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
342
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
343 g_return_if_fail(instance != NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
344 g_return_if_fail(signal != NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
345 g_return_if_fail(handle != NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
346 g_return_if_fail(func != NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
347
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
348 /* Get the instance data */
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
349 instance_data =
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
350 (GaimInstanceData *)g_hash_table_lookup(instance_table, instance);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
351
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
352 g_return_if_fail(instance_data != NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
353
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
354 /* Get the signal data */
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
355 signal_data =
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
356 (GaimSignalData *)g_hash_table_lookup(instance_data->signals, signal);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
357
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
358 if (signal_data == NULL)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
359 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
360 gaim_debug(GAIM_DEBUG_ERROR, "signals",
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
361 "Signal data for %s not found!\n", signal);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
362 return;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
363 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
364
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
365 /* Find the handler data. */
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
366 for (l = signal_data->handlers; l != NULL; l = l->next)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
367 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
368 handler_data = (GaimSignalHandlerData *)l->data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
369
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
370 if (handler_data->handle == handle && handler_data->cb == func)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
371 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
372 g_free(handler_data);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
373
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
374 signal_data->handlers = g_list_remove(signal_data->handlers,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
375 handler_data);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
376 signal_data->handler_count--;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
377
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
378 found = TRUE;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
379
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
380 break;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
381 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
382 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
383
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
384 /* See note somewhere about this actually helping developers.. */
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
385 g_return_if_fail(found);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
386 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
387
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
388 /*
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
389 * TODO: Make this all more efficient by storing a list of handlers, keyed
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
390 * to a handle.
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
391 */
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
392 static void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
393 disconnect_handle_from_signals(const char *signal,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
394 GaimSignalData *signal_data, void *handle)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
395 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
396 GList *l, *l_next;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
397 GaimSignalHandlerData *handler_data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
398
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
399 for (l = signal_data->handlers; l != NULL; l = l_next)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
400 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
401 handler_data = (GaimSignalHandlerData *)l->data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
402 l_next = l->next;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
403
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
404 if (handler_data->handle == handle)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
405 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
406 g_free(handler_data);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
407
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
408 signal_data->handler_count--;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
409 signal_data->handlers = g_list_remove(signal_data->handlers,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
410 handler_data);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
411 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
412 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
413 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
414
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
415 static void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
416 disconnect_handle_from_instance(void *instance,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
417 GaimInstanceData *instance_data,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
418 void *handle)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
419 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
420 g_hash_table_foreach(instance_data->signals,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
421 (GHFunc)disconnect_handle_from_signals, handle);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
422 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
423
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
424 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
425 gaim_signals_disconnect_by_handle(void *handle)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
426 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
427 g_return_if_fail(handle != NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
428
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
429 g_hash_table_foreach(instance_table,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
430 (GHFunc)disconnect_handle_from_instance, handle);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
431 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
432
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
433 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
434 gaim_signal_emit(void *instance, const char *signal, ...)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
435 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
436 va_list args;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
437
7584
9e93a4bf1934 [gaim-migrate @ 8202]
Christian Hammond <chipx86@chipx86.com>
parents: 6822
diff changeset
438 g_return_if_fail(instance != NULL);
9e93a4bf1934 [gaim-migrate @ 8202]
Christian Hammond <chipx86@chipx86.com>
parents: 6822
diff changeset
439 g_return_if_fail(signal != NULL);
9e93a4bf1934 [gaim-migrate @ 8202]
Christian Hammond <chipx86@chipx86.com>
parents: 6822
diff changeset
440
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
441 va_start(args, signal);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
442 gaim_signal_emit_vargs(instance, signal, args);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
443 va_end(args);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
444 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
445
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
446 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
447 gaim_signal_emit_vargs(void *instance, const char *signal, va_list args)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
448 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
449 GaimInstanceData *instance_data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
450 GaimSignalData *signal_data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
451 GaimSignalHandlerData *handler_data;
8004
07dc83303503 [gaim-migrate @ 8681]
Christian Hammond <chipx86@chipx86.com>
parents: 7597
diff changeset
452 GList *l, *l_next;
8090
fb0eab758560 [gaim-migrate @ 8789]
Ethan Blanton <elb@pidgin.im>
parents: 8046
diff changeset
453 va_list tmp;
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
454
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
455 g_return_if_fail(instance != NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
456 g_return_if_fail(signal != NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
457
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
458 instance_data =
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
459 (GaimInstanceData *)g_hash_table_lookup(instance_table, instance);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
460
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
461 g_return_if_fail(instance_data != NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
462
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
463 signal_data =
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
464 (GaimSignalData *)g_hash_table_lookup(instance_data->signals, signal);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
465
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
466 if (signal_data == NULL)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
467 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
468 gaim_debug(GAIM_DEBUG_ERROR, "signals",
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
469 "Signal data for %s not found!\n", signal);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
470 return;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
471 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
472
8004
07dc83303503 [gaim-migrate @ 8681]
Christian Hammond <chipx86@chipx86.com>
parents: 7597
diff changeset
473 for (l = signal_data->handlers; l != NULL; l = l_next)
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
474 {
8004
07dc83303503 [gaim-migrate @ 8681]
Christian Hammond <chipx86@chipx86.com>
parents: 7597
diff changeset
475 l_next = l->next;
07dc83303503 [gaim-migrate @ 8681]
Christian Hammond <chipx86@chipx86.com>
parents: 7597
diff changeset
476
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
477 handler_data = (GaimSignalHandlerData *)l->data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
478
8090
fb0eab758560 [gaim-migrate @ 8789]
Ethan Blanton <elb@pidgin.im>
parents: 8046
diff changeset
479 /* This is necessary because a va_list may only be
fb0eab758560 [gaim-migrate @ 8789]
Ethan Blanton <elb@pidgin.im>
parents: 8046
diff changeset
480 * evaluated once */
8142
f2919ca98e78 [gaim-migrate @ 8850]
Ethan Blanton <elb@pidgin.im>
parents: 8140
diff changeset
481 G_VA_COPY(tmp, args);
8090
fb0eab758560 [gaim-migrate @ 8789]
Ethan Blanton <elb@pidgin.im>
parents: 8046
diff changeset
482
6547
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
483 if (handler_data->use_vargs)
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
484 {
8090
fb0eab758560 [gaim-migrate @ 8789]
Ethan Blanton <elb@pidgin.im>
parents: 8046
diff changeset
485 ((void (*)(va_list, void *))handler_data->cb)(tmp,
6547
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
486 handler_data->data);
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
487 }
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
488 else
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
489 {
8090
fb0eab758560 [gaim-migrate @ 8789]
Ethan Blanton <elb@pidgin.im>
parents: 8046
diff changeset
490 signal_data->marshal(handler_data->cb, tmp,
6547
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
491 handler_data->data, NULL);
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
492 }
8090
fb0eab758560 [gaim-migrate @ 8789]
Ethan Blanton <elb@pidgin.im>
parents: 8046
diff changeset
493
fb0eab758560 [gaim-migrate @ 8789]
Ethan Blanton <elb@pidgin.im>
parents: 8046
diff changeset
494 va_end(tmp);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
495 }
11080
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11064
diff changeset
496
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11064
diff changeset
497 #ifdef HAVE_DBUS
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
498 gaim_dbus_signal_emit_gaim(signal, signal_data->num_values,
11080
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11064
diff changeset
499 signal_data->values, args);
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11064
diff changeset
500 #endif /* HAVE_DBUS */
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11064
diff changeset
501
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
502 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
503
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
504 void *
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
505 gaim_signal_emit_return_1(void *instance, const char *signal, ...)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
506 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
507 void *ret_val;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
508 va_list args;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
509
7597
191e5b9a249b [gaim-migrate @ 8218]
Christian Hammond <chipx86@chipx86.com>
parents: 7585
diff changeset
510 g_return_val_if_fail(instance != NULL, NULL);
191e5b9a249b [gaim-migrate @ 8218]
Christian Hammond <chipx86@chipx86.com>
parents: 7585
diff changeset
511 g_return_val_if_fail(signal != NULL, NULL);
7585
404f4a4b81da [gaim-migrate @ 8203]
Christian Hammond <chipx86@chipx86.com>
parents: 7584
diff changeset
512
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
513 va_start(args, signal);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
514 ret_val = gaim_signal_emit_vargs_return_1(instance, signal, args);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
515 va_end(args);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
516
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
517 return ret_val;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
518 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
519
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
520 void *
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
521 gaim_signal_emit_vargs_return_1(void *instance, const char *signal,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
522 va_list args)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
523 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
524 GaimInstanceData *instance_data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
525 GaimSignalData *signal_data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
526 GaimSignalHandlerData *handler_data;
8004
07dc83303503 [gaim-migrate @ 8681]
Christian Hammond <chipx86@chipx86.com>
parents: 7597
diff changeset
527 GList *l, *l_next;
8140
47046ceedf0b [gaim-migrate @ 8846]
Ethan Blanton <elb@pidgin.im>
parents: 8090
diff changeset
528 va_list tmp;
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
529
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
530 g_return_val_if_fail(instance != NULL, NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
531 g_return_val_if_fail(signal != NULL, NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
532
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
533 instance_data =
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
534 (GaimInstanceData *)g_hash_table_lookup(instance_table, instance);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
535
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
536 g_return_val_if_fail(instance_data != NULL, NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
537
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
538 signal_data =
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
539 (GaimSignalData *)g_hash_table_lookup(instance_data->signals, signal);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
540
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
541 if (signal_data == NULL)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
542 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
543 gaim_debug(GAIM_DEBUG_ERROR, "signals",
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
544 "Signal data for %s not found!\n", signal);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
545 return 0;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
546 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
547
11080
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11064
diff changeset
548 #ifdef HAVE_DBUS
13056
b00a592651b6 [gaim-migrate @ 15418]
Etan Reisner <pidgin@unreliablesource.net>
parents: 13055
diff changeset
549 G_VA_COPY(tmp, args);
11171
ebb02ea3c789 [gaim-migrate @ 13272]
Piotr Zielinski <zielaj>
parents: 11146
diff changeset
550 gaim_dbus_signal_emit_gaim(signal, signal_data->num_values,
13055
48a72998676c [gaim-migrate @ 15417]
Richard Laager <rlaager@wiktel.com>
parents: 12737
diff changeset
551 signal_data->values, tmp);
48a72998676c [gaim-migrate @ 15417]
Richard Laager <rlaager@wiktel.com>
parents: 12737
diff changeset
552 va_end(tmp);
11080
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11064
diff changeset
553 #endif /* HAVE_DBUS */
f54740547c95 [gaim-migrate @ 13092]
Piotr Zielinski <zielaj>
parents: 11064
diff changeset
554
8004
07dc83303503 [gaim-migrate @ 8681]
Christian Hammond <chipx86@chipx86.com>
parents: 7597
diff changeset
555 for (l = signal_data->handlers; l != NULL; l = l_next)
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
556 {
10789
0caa9827edf5 [gaim-migrate @ 12431]
Luke Schierer <lschiere@pidgin.im>
parents: 10758
diff changeset
557 void *ret_val = NULL;
0caa9827edf5 [gaim-migrate @ 12431]
Luke Schierer <lschiere@pidgin.im>
parents: 10758
diff changeset
558
8004
07dc83303503 [gaim-migrate @ 8681]
Christian Hammond <chipx86@chipx86.com>
parents: 7597
diff changeset
559 l_next = l->next;
07dc83303503 [gaim-migrate @ 8681]
Christian Hammond <chipx86@chipx86.com>
parents: 7597
diff changeset
560
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
561 handler_data = (GaimSignalHandlerData *)l->data;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
562
8142
f2919ca98e78 [gaim-migrate @ 8850]
Ethan Blanton <elb@pidgin.im>
parents: 8140
diff changeset
563 G_VA_COPY(tmp, args);
6547
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
564 if (handler_data->use_vargs)
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
565 {
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
566 ret_val = ((void *(*)(va_list, void *))handler_data->cb)(
8140
47046ceedf0b [gaim-migrate @ 8846]
Ethan Blanton <elb@pidgin.im>
parents: 8090
diff changeset
567 tmp, handler_data->data);
6547
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
568 }
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
569 else
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
570 {
8140
47046ceedf0b [gaim-migrate @ 8846]
Ethan Blanton <elb@pidgin.im>
parents: 8090
diff changeset
571 signal_data->marshal(handler_data->cb, tmp,
6547
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
572 handler_data->data, &ret_val);
adf168f002ad [gaim-migrate @ 7069]
Christian Hammond <chipx86@chipx86.com>
parents: 6509
diff changeset
573 }
8140
47046ceedf0b [gaim-migrate @ 8846]
Ethan Blanton <elb@pidgin.im>
parents: 8090
diff changeset
574 va_end(tmp);
10789
0caa9827edf5 [gaim-migrate @ 12431]
Luke Schierer <lschiere@pidgin.im>
parents: 10758
diff changeset
575
0caa9827edf5 [gaim-migrate @ 12431]
Luke Schierer <lschiere@pidgin.im>
parents: 10758
diff changeset
576 if (ret_val != NULL)
0caa9827edf5 [gaim-migrate @ 12431]
Luke Schierer <lschiere@pidgin.im>
parents: 10758
diff changeset
577 return ret_val;
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
578 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
579
10789
0caa9827edf5 [gaim-migrate @ 12431]
Luke Schierer <lschiere@pidgin.im>
parents: 10758
diff changeset
580 return NULL;
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
581 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
582
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
583 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
584 gaim_signals_init()
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
585 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
586 g_return_if_fail(instance_table == NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
587
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
588 instance_table =
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
589 g_hash_table_new_full(g_direct_hash, g_direct_equal,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
590 NULL, (GDestroyNotify)destroy_instance_data);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
591 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
592
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
593 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
594 gaim_signals_uninit()
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
595 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
596 g_return_if_fail(instance_table != NULL);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
597
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
598 g_hash_table_destroy(instance_table);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
599 instance_table = NULL;
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
600 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
601
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
602 /**************************************************************************
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
603 * Marshallers
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
604 **************************************************************************/
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
605 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
606 gaim_marshal_VOID(GaimCallback cb, va_list args, void *data,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
607 void **return_val)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
608 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
609 ((void (*)(void *))cb)(data);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
610 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
611
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
612 void
6822
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
613 gaim_marshal_VOID__INT(GaimCallback cb, va_list args, void *data,
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
614 void **return_val)
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
615 {
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
616 gint arg1 = va_arg(args, gint);
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
617
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
618 ((void (*)(gint, void *))cb)(arg1, data);
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
619 }
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
620
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
621 void
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
622 gaim_marshal_VOID__INT_INT(GaimCallback cb, va_list args, void *data,
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
623 void **return_val)
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
624 {
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
625 gint arg1 = va_arg(args, gint);
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
626 gint arg2 = va_arg(args, gint);
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
627
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
628 ((void (*)(gint, gint, void *))cb)(arg1, arg2, data);
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
629 }
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
630
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
631 void
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
632 gaim_marshal_VOID__POINTER(GaimCallback cb, va_list args, void *data,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
633 void **return_val)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
634 {
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
635 void *arg1 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
636
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
637 ((void (*)(void *, void *))cb)(arg1, data);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
638 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
639
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
640 void
9734
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9554
diff changeset
641 gaim_marshal_VOID__POINTER_UINT(GaimCallback cb, va_list args,
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9554
diff changeset
642 void *data, void **return_val)
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9554
diff changeset
643 {
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9554
diff changeset
644 void *arg1 = va_arg(args, void *);
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9554
diff changeset
645 guint arg2 = va_arg(args, guint);
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9554
diff changeset
646
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9554
diff changeset
647 ((void (*)(void *, guint, void *))cb)(arg1, arg2, data);
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9554
diff changeset
648 }
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9554
diff changeset
649
11935
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11256
diff changeset
650 void gaim_marshal_VOID__POINTER_INT_INT(GaimCallback cb, va_list args,
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11256
diff changeset
651 void *data, void **return_val)
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11256
diff changeset
652 {
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11256
diff changeset
653 void *arg1 = va_arg(args, void *);
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11256
diff changeset
654 gint arg2 = va_arg(args, gint);
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11256
diff changeset
655 gint arg3 = va_arg(args, gint);
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11256
diff changeset
656
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11256
diff changeset
657 ((void (*)(void *, gint, gint, void *))cb)(arg1, arg2, arg3, data);
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11256
diff changeset
658 }
cb73483c9f63 [gaim-migrate @ 14226]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11256
diff changeset
659
9734
676cf082d29c [gaim-migrate @ 10595]
Mark Doliner <mark@kingant.net>
parents: 9554
diff changeset
660 void
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
661 gaim_marshal_VOID__POINTER_POINTER(GaimCallback cb, va_list args,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
662 void *data, void **return_val)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
663 {
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
664 void *arg1 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
665 void *arg2 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
666
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
667 ((void (*)(void *, void *, void *))cb)(arg1, arg2, data);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
668 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
669
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
670 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
671 gaim_marshal_VOID__POINTER_POINTER_UINT(GaimCallback cb, va_list args,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
672 void *data, void **return_val)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
673 {
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
674 void *arg1 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
675 void *arg2 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
676 guint arg3 = va_arg(args, guint);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
677
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
678 ((void (*)(void *, void *, guint, void *))cb)(arg1, arg2, arg3, data);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
679 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
680
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
681 void
9554
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
682 gaim_marshal_VOID__POINTER_POINTER_UINT_UINT(GaimCallback cb, va_list args,
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
683 void *data, void **return_val)
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
684 {
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
685 void *arg1 = va_arg(args, void *);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
686 void *arg2 = va_arg(args, void *);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
687 guint arg3 = va_arg(args, guint);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
688 guint arg4 = va_arg(args, guint);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
689
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
690 ((void (*)(void *, void *, guint, guint, void *))cb)(arg1, arg2, arg3, arg4, data);
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
691 }
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
692
8b2451878e26 [gaim-migrate @ 10387]
Luke Schierer <lschiere@pidgin.im>
parents: 9514
diff changeset
693 void
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
694 gaim_marshal_VOID__POINTER_POINTER_POINTER(GaimCallback cb, va_list args,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
695 void *data, void **return_val)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
696 {
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
697 void *arg1 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
698 void *arg2 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
699 void *arg3 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
700
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
701 ((void (*)(void *, void *, void *, void *))cb)(arg1, arg2, arg3, data);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
702 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
703
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
704 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
705 gaim_marshal_VOID__POINTER_POINTER_POINTER_POINTER(GaimCallback cb,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
706 va_list args,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
707 void *data,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
708 void **return_val)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
709 {
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
710 void *arg1 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
711 void *arg2 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
712 void *arg3 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
713 void *arg4 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
714
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
715 ((void (*)(void *, void *, void *, void *, void *))cb)(arg1, arg2, arg3, arg4, data);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
716 }
6509
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
717
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
718 void
9514
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
719 gaim_marshal_VOID__POINTER_POINTER_POINTER_POINTER_POINTER(GaimCallback cb,
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
720 va_list args,
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
721 void *data,
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
722 void **return_val)
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
723 {
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
724 void *arg1 = va_arg(args, void *);
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
725 void *arg2 = va_arg(args, void *);
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
726 void *arg3 = va_arg(args, void *);
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
727 void *arg4 = va_arg(args, void *);
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
728 void *arg5 = va_arg(args, void *);
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
729
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
730 ((void (*)(void *, void *, void *, void *, void *, void *))cb)(arg1, arg2, arg3, arg4, arg5, data);
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
731 }
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
732
1fac0336890c [gaim-migrate @ 10341]
Luke Schierer <lschiere@pidgin.im>
parents: 9127
diff changeset
733 void
6509
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
734 gaim_marshal_VOID__POINTER_POINTER_POINTER_UINT(GaimCallback cb,
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
735 va_list args,
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
736 void *data,
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
737 void **return_val)
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
738 {
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
739 void *arg1 = va_arg(args, void *);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
740 void *arg2 = va_arg(args, void *);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
741 void *arg3 = va_arg(args, void *);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
742 guint arg4 = va_arg(args, guint);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
743
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
744 ((void (*)(void *, void *, void *, guint, void *))cb)(arg1, arg2, arg3, arg4, data);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
745 }
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
746
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
747 void
10104
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
748 gaim_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT(GaimCallback cb,
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
749 va_list args,
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
750 void *data,
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
751 void **return_val)
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
752 {
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
753 void *arg1 = va_arg(args, void *);
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
754 void *arg2 = va_arg(args, void *);
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
755 void *arg3 = va_arg(args, void *);
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
756 void *arg4 = va_arg(args, void *);
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
757 guint arg5 = va_arg(args, guint);
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
758
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
759 ((void (*)(void *, void *, void *, void *, guint, void *))cb)(arg1, arg2, arg3, arg4, arg5, data);
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
760 }
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
761
60db14d54914 [gaim-migrate @ 11131]
Stu Tomlinson <stu@nosnilmot.com>
parents: 9734
diff changeset
762 void
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
763 gaim_marshal_VOID__POINTER_POINTER_POINTER_UINT_UINT(GaimCallback cb,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
764 va_list args,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
765 void *data,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
766 void **return_val)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
767 {
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
768 void *arg1 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
769 void *arg2 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
770 void *arg3 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
771 guint arg4 = va_arg(args, guint);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
772 guint arg5 = va_arg(args, guint);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
773
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
774 ((void (*)(void *, void *, void *, guint, guint, void *))cb)(
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
775 arg1, arg2, arg3, arg4, arg5, data);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
776 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
777
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
778 void
6822
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
779 gaim_marshal_INT__INT(GaimCallback cb, va_list args, void *data,
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
780 void **return_val)
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
781 {
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
782 gint ret_val;
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
783 gint arg1 = va_arg(args, gint);
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
784
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
785 ret_val = ((gint (*)(gint, void *))cb)(arg1, data);
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
786
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
787 if (return_val != NULL)
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
788 *return_val = GINT_TO_POINTER(ret_val);
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
789 }
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
790
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
791 void
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
792 gaim_marshal_INT__INT_INT(GaimCallback cb, va_list args, void *data,
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
793 void **return_val)
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
794 {
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
795 gint ret_val;
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
796 gint arg1 = va_arg(args, gint);
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
797 gint arg2 = va_arg(args, gint);
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
798
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
799 ret_val = ((gint (*)(gint, gint, void *))cb)(arg1, arg2, data);
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
800
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
801 if (return_val != NULL)
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
802 *return_val = GINT_TO_POINTER(ret_val);
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
803 }
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
804
11064
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
805
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
806 void
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
807 gaim_marshal_INT__POINTER_POINTER_POINTER_POINTER_POINTER(
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
808 GaimCallback cb, va_list args, void *data, void **return_val)
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
809 {
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
810 gint ret_val;
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
811 void *arg1 = va_arg(args, void *);
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
812 void *arg2 = va_arg(args, void *);
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
813 void *arg3 = va_arg(args, void *);
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
814 void *arg4 = va_arg(args, void *);
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
815 void *arg5 = va_arg(args, void *);
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
816
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
817 ret_val =
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
818 ((gint (*)(void *, void *, void *, void *, void *, void *))cb)(
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
819 arg1, arg2, arg3, arg4, arg5, data);
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
820
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
821 if (return_val != NULL)
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
822 *return_val = GINT_TO_POINTER(ret_val);
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
823 }
e4459e8ccfb5 [gaim-migrate @ 13035]
Richard Laager <rlaager@wiktel.com>
parents: 11033
diff changeset
824
6822
7dba3e17cb21 [gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents: 6564
diff changeset
825 void
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
826 gaim_marshal_BOOLEAN__POINTER(GaimCallback cb, va_list args, void *data,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
827 void **return_val)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
828 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
829 gboolean ret_val;
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
830 void *arg1 = va_arg(args, void *);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
831
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
832 ret_val = ((gboolean (*)(void *, void *))cb)(arg1, data);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
833
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
834 if (return_val != NULL)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
835 *return_val = GINT_TO_POINTER(ret_val);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
836 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
837
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
838 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
839 gaim_marshal_BOOLEAN__POINTER_POINTER(GaimCallback cb, va_list args,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
840 void *data, void **return_val)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
841 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
842 gboolean ret_val;
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
843 void *arg1 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
844 void *arg2 = va_arg(args, void *);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
845
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
846 ret_val = ((gboolean (*)(void *, void *, void *))cb)(arg1, arg2, data);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
847
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
848 if (return_val != NULL)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
849 *return_val = GINT_TO_POINTER(ret_val);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
850 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
851
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
852 void
6509
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
853 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER(GaimCallback cb, va_list args,
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
854 void *data, void **return_val)
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
855 {
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
856 gboolean ret_val;
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
857 void *arg1 = va_arg(args, void *);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
858 void *arg2 = va_arg(args, void *);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
859 void *arg3 = va_arg(args, void *);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
860
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
861 ret_val = ((gboolean (*)(void *, void *, void *, void *))cb)(arg1, arg2,
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
862 arg3, data);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
863
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
864 if (return_val != NULL)
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
865 *return_val = GINT_TO_POINTER(ret_val);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
866 }
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
867
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
868 void
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
869 gaim_marshal_BOOLEAN__POINTER_POINTER_UINT(GaimCallback cb,
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
870 va_list args,
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
871 void *data,
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
872 void **return_val)
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
873 {
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
874 gboolean ret_val;
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
875 void *arg1 = va_arg(args, void *);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
876 void *arg2 = va_arg(args, void *);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
877 guint arg3 = va_arg(args, guint);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
878
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
879 ret_val = ((gboolean (*)(void *, void *, guint, void *))cb)(
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
880 arg1, arg2, arg3, data);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
881
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
882 if (return_val != NULL)
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
883 *return_val = GINT_TO_POINTER(ret_val);
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
884 }
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
885
e74e378e86bf [gaim-migrate @ 7026]
Ethan Blanton <elb@pidgin.im>
parents: 6505
diff changeset
886 void
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
887 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_UINT(GaimCallback cb,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
888 va_list args,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
889 void *data,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
890 void **return_val)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
891 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
892 gboolean ret_val;
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
893 void *arg1 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
894 void *arg2 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
895 void *arg3 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
896 guint arg4 = va_arg(args, guint);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
897
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
898 ret_val = ((gboolean (*)(void *, void *, void *, guint, void *))cb)(
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
899 arg1, arg2, arg3, arg4, data);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
900
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
901 if (return_val != NULL)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
902 *return_val = GINT_TO_POINTER(ret_val);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
903 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
904
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
905 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
906 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER(GaimCallback cb,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
907 va_list args,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
908 void *data,
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
909 void **return_val)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
910 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
911 gboolean ret_val;
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
912 void *arg1 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
913 void *arg2 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
914 void *arg3 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
915 void *arg4 = va_arg(args, void *);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
916
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
917 ret_val = ((gboolean (*)(void *, void *, void *, void *, void *))cb)(
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
918 arg1, arg2, arg3, arg4, data);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
919
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
920 if (return_val != NULL)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
921 *return_val = GINT_TO_POINTER(ret_val);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
922 }
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
923
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
924 void
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
925 gaim_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER(
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
926 GaimCallback cb, va_list args, void *data, void **return_val)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
927 {
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
928 gboolean ret_val;
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
929 void *arg1 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
930 void *arg2 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
931 void *arg3 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
932 void *arg4 = va_arg(args, void *);
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
933 void *arg5 = va_arg(args, void *);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
934
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
935 ret_val =
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
936 ((gboolean (*)(void *, void *, void *, void *, void *, void *))cb)(
6505
5ca59294698d [gaim-migrate @ 7021]
Ethan Blanton <elb@pidgin.im>
parents: 6488
diff changeset
937 arg1, arg2, arg3, arg4, arg5, data);
6485
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
938
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
939 if (return_val != NULL)
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
940 *return_val = GINT_TO_POINTER(ret_val);
70d5122bc3ff [gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
941 }
12291
5bc3d67ceb24 [gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11935
diff changeset
942
5bc3d67ceb24 [gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11935
diff changeset
943 void
5bc3d67ceb24 [gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11935
diff changeset
944 gaim_marshal_BOOLEAN__INT_POINTER(GaimCallback cb, va_list args, void *data,
5bc3d67ceb24 [gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11935
diff changeset
945 void **return_val)
5bc3d67ceb24 [gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11935
diff changeset
946 {
5bc3d67ceb24 [gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11935
diff changeset
947 gboolean ret_val;
5bc3d67ceb24 [gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11935
diff changeset
948 gint arg1 = va_arg(args, gint);
5bc3d67ceb24 [gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11935
diff changeset
949 void *arg2 = va_arg(args, void *);
5bc3d67ceb24 [gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11935
diff changeset
950
5bc3d67ceb24 [gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11935
diff changeset
951 ret_val = ((gboolean (*)(gint, void *, void *))cb)(arg1, arg2, data);
5bc3d67ceb24 [gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11935
diff changeset
952
5bc3d67ceb24 [gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11935
diff changeset
953 if (return_val != NULL)
5bc3d67ceb24 [gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11935
diff changeset
954 *return_val = GINT_TO_POINTER(ret_val);
5bc3d67ceb24 [gaim-migrate @ 14595]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11935
diff changeset
955 }
12737
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 12291
diff changeset
956
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 12291
diff changeset
957 void
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 12291
diff changeset
958 gaim_marshal_POINTER__POINTER_POINTER(GaimCallback cb, va_list args, void *data,
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 12291
diff changeset
959 void **return_val)
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 12291
diff changeset
960 {
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 12291
diff changeset
961 gpointer ret_val;
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 12291
diff changeset
962 void *arg1 = va_arg(args, void *);
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 12291
diff changeset
963 void *arg2 = va_arg(args, void *);
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 12291
diff changeset
964
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 12291
diff changeset
965 ret_val = ((gpointer (*)(void *, void *, void *))cb)(arg1, arg2, data);
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 12291
diff changeset
966
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 12291
diff changeset
967 if (return_val != NULL)
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 12291
diff changeset
968 *return_val = ret_val;
a1e241dd50b6 [gaim-migrate @ 15082]
Richard Laager <rlaager@wiktel.com>
parents: 12291
diff changeset
969 }