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