comparison plugins/perl/perl-handlers.c @ 6566:f6c2a7b5afa7

[gaim-migrate @ 7088] PERL SIGNAL HANDLING WORKS!!!! Ahem. I shall now continue professionally developing other aspects of this instant messenger application. WOOHOO committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 21 Aug 2003 23:41:52 +0000
parents 28b38803d0bb
children 6e25e1e08ffb
comparison
equal deleted inserted replaced
6565:cb00e9647033 6566:f6c2a7b5afa7
53 53
54 static void * 54 static void *
55 perl_signal_cb(va_list args, void *data) 55 perl_signal_cb(va_list args, void *data)
56 { 56 {
57 GaimPerlSignalHandler *handler = (GaimPerlSignalHandler *)data; 57 GaimPerlSignalHandler *handler = (GaimPerlSignalHandler *)data;
58 void *arg;
59 void *ret_val = NULL; 58 void *ret_val = NULL;
59 int i;
60 int count; 60 int count;
61 int value_count;
62 GaimValue *ret_value, **values;
61 63
62 dSP; 64 dSP;
63 ENTER; 65 ENTER;
64 SAVETMPS; 66 SAVETMPS;
65 PUSHMARK(sp); 67 PUSHMARK(sp);
66 68
67 while ((arg = va_arg(args, void *)) != NULL) 69 gaim_signal_get_values(handler->instance, handler->signal,
68 XPUSHs((SV *)arg); 70 &ret_value, &value_count, &values);
69 71
72 for (i = 0; i < value_count; i++)
73 {
74 SV *sv = gaim_perl_sv_from_vargs(values[i], args);
75
76 gaim_debug(GAIM_DEBUG_INFO, "perl", "Pushing arg %p\n", sv);
77
78 XPUSHs(sv);
79 }
80
81 gaim_debug(GAIM_DEBUG_INFO, "perl", "Pushing data %p\n", handler->data);
70 XPUSHs((SV *)handler->data); 82 XPUSHs((SV *)handler->data);
71 83
72 PUTBACK; 84 PUTBACK;
85 gaim_debug(GAIM_DEBUG_INFO, "perl", "Calling handler %s\n",
86 handler->func);
73 count = call_pv(handler->func, G_EVAL | G_SCALAR); 87 count = call_pv(handler->func, G_EVAL | G_SCALAR);
74 SPAGAIN; 88 SPAGAIN;
75 89
76 if (count > 1) 90 if (count > 1)
77 ret_val = POPp; 91 ret_val = POPp;