Mercurial > pidgin
comparison plugins/tcl/tcl_signals.c @ 13815:724e4c08391a
[gaim-migrate @ 16247]
This cleans up a few missed account and conversation cases, and moves
GaimConnections to the typed pointer references.
committer: Tailor Script <tailor@pidgin.im>
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Sat, 10 Jun 2006 19:16:58 +0000 |
parents | a84523152a24 |
children | ad8ddfa756ad |
comparison
equal
deleted
inserted
replaced
13814:6e14740ea2a0 | 13815:724e4c08391a |
---|---|
132 } | 132 } |
133 if (found) | 133 if (found) |
134 tcl_callbacks = g_list_remove_all(tcl_callbacks, NULL); | 134 tcl_callbacks = g_list_remove_all(tcl_callbacks, NULL); |
135 } | 135 } |
136 | 136 |
137 static GaimStringref *ref_type(GaimSubType type) | |
138 { | |
139 switch (type) { | |
140 case GAIM_SUBTYPE_ACCOUNT: | |
141 return GaimTclRefAccount; | |
142 case GAIM_SUBTYPE_CONNECTION: | |
143 return GaimTclRefConnection; | |
144 case GAIM_SUBTYPE_CONVERSATION: | |
145 return GaimTclRefConversation; | |
146 case GAIM_SUBTYPE_STATUS: | |
147 return GaimTclRefStatus; | |
148 default: | |
149 return NULL; | |
150 } | |
151 } | |
152 | |
137 static void *tcl_signal_callback(va_list args, struct tcl_signal_handler *handler) | 153 static void *tcl_signal_callback(va_list args, struct tcl_signal_handler *handler) |
138 { | 154 { |
139 GString *name, *val; | 155 GString *name, *val; |
140 GaimBlistNode *node; | 156 GaimBlistNode *node; |
141 int error, i; | 157 int error, i; |
254 case GAIM_TYPE_SUBTYPE: | 270 case GAIM_TYPE_SUBTYPE: |
255 switch (gaim_value_get_subtype(handler->argtypes[i])) { | 271 switch (gaim_value_get_subtype(handler->argtypes[i])) { |
256 case GAIM_SUBTYPE_UNKNOWN: | 272 case GAIM_SUBTYPE_UNKNOWN: |
257 gaim_debug(GAIM_DEBUG_ERROR, "tcl", "subtype unknown\n"); | 273 gaim_debug(GAIM_DEBUG_ERROR, "tcl", "subtype unknown\n"); |
258 case GAIM_SUBTYPE_ACCOUNT: | 274 case GAIM_SUBTYPE_ACCOUNT: |
275 case GAIM_SUBTYPE_CONNECTION: | |
259 case GAIM_SUBTYPE_CONVERSATION: | 276 case GAIM_SUBTYPE_CONVERSATION: |
277 case GAIM_SUBTYPE_STATUS: | |
260 if (gaim_value_is_outgoing(handler->argtypes[i])) | 278 if (gaim_value_is_outgoing(handler->argtypes[i])) |
261 gaim_debug_error("tcl", "pointer subtypes do not currently support outgoing arguments\n"); | 279 gaim_debug_error("tcl", "pointer subtypes do not currently support outgoing arguments\n"); |
262 arg = gaim_tcl_ref_new(GaimTclRefAccount, va_arg(args, void *)); | 280 arg = gaim_tcl_ref_new(ref_type(gaim_value_get_subtype(handler->argtypes[i])), va_arg(args, void *)); |
263 break; | 281 break; |
264 case GAIM_SUBTYPE_CONNECTION: | |
265 case GAIM_SUBTYPE_PLUGIN: | 282 case GAIM_SUBTYPE_PLUGIN: |
266 case GAIM_SUBTYPE_XFER: | 283 case GAIM_SUBTYPE_XFER: |
267 /* pointers again */ | 284 /* pointers again */ |
268 if (gaim_value_is_outgoing(handler->argtypes[i])) { | 285 if (gaim_value_is_outgoing(handler->argtypes[i])) { |
269 vals[i] = va_arg(args, void **); | 286 vals[i] = va_arg(args, void **); |