122 |
func = function; |
func = function; |
123 |
PERL_SET_CONTEXT (script->interpreter); |
PERL_SET_CONTEXT (script->interpreter); |
124 |
#endif |
#endif |
125 |
perl_current_script = script; |
|
|
|
|
126 |
dSP; |
dSP; |
127 |
ENTER; |
ENTER; |
128 |
SAVETMPS; |
SAVETMPS; |
134 |
argv[1] = arguments; |
argv[1] = arguments; |
135 |
argv[2] = NULL; |
argv[2] = NULL; |
136 |
|
|
137 |
|
perl_current_script = script; |
138 |
|
|
139 |
count = perl_call_argv (func, G_EVAL | G_SCALAR, argv); |
count = perl_call_argv (func, G_EVAL | G_SCALAR, argv); |
140 |
|
|
141 |
|
perl_current_script = NULL; |
142 |
|
|
143 |
SPAGAIN; |
SPAGAIN; |
144 |
|
|
145 |
sv = GvSV (gv_fetchpv ("@", TRUE, SVt_PV)); |
sv = GvSV (gv_fetchpv ("@", TRUE, SVt_PV)); |
563 |
{ |
{ |
564 |
t_plugin_dcc_info *dcc_info, *ptr_dcc; |
t_plugin_dcc_info *dcc_info, *ptr_dcc; |
565 |
int dcc_count; |
int dcc_count; |
566 |
|
char timebuffer1[64]; |
567 |
|
char timebuffer2[64]; |
568 |
|
struct in_addr in; |
569 |
dXSARGS; |
dXSARGS; |
570 |
|
|
571 |
/* make gcc happy */ |
/* make gcc happy */ |
588 |
|
|
589 |
for (ptr_dcc = dcc_info; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc) |
for (ptr_dcc = dcc_info; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc) |
590 |
{ |
{ |
591 |
|
strftime(timebuffer1, sizeof(timebuffer1), "%F %T", |
592 |
|
localtime(&ptr_dcc->start_time)); |
593 |
|
strftime(timebuffer2, sizeof(timebuffer2), "%F %T", |
594 |
|
localtime(&ptr_dcc->start_transfer)); |
595 |
|
in.s_addr = htonl(ptr_dcc->addr); |
596 |
|
|
597 |
HV *infohash = (HV *) sv_2mortal((SV *) newHV()); |
HV *infohash = (HV *) sv_2mortal((SV *) newHV()); |
598 |
|
|
599 |
hv_store (infohash, "server", 6, newSVpv (ptr_dcc->server, 0), 0); |
hv_store (infohash, "server", 6, newSVpv (ptr_dcc->server, 0), 0); |
600 |
hv_store (infohash, "channel", 7, newSVpv (ptr_dcc->channel, 0), 0); |
hv_store (infohash, "channel", 7, newSVpv (ptr_dcc->channel, 0), 0); |
601 |
hv_store (infohash, "type", 4, newSViv (ptr_dcc->type), 0); |
hv_store (infohash, "type", 4, newSViv (ptr_dcc->type), 0); |
602 |
hv_store (infohash, "status", 6, newSViv (ptr_dcc->status), 0); |
hv_store (infohash, "status", 6, newSViv (ptr_dcc->status), 0); |
603 |
hv_store (infohash, "start_time", 10, newSViv (ptr_dcc->start_time), 0); |
hv_store (infohash, "start_time", 10, newSVpv (timebuffer1, 0), 0); |
604 |
hv_store (infohash, "start_transfer", 14, newSViv (ptr_dcc->start_transfer), 0); |
hv_store (infohash, "start_transfer", 14, newSVpv (timebuffer2, 0), 0); |
605 |
hv_store (infohash, "address", 7, newSViv (ptr_dcc->addr), 0); |
hv_store (infohash, "address", 7, newSVpv (inet_ntoa(in), 0), 0); |
606 |
hv_store (infohash, "port", 4, newSViv (ptr_dcc->port), 0); |
hv_store (infohash, "port", 4, newSViv (ptr_dcc->port), 0); |
607 |
hv_store (infohash, "nick", 4, newSVpv (ptr_dcc->nick, 0), 0); |
hv_store (infohash, "nick", 4, newSVpv (ptr_dcc->nick, 0), 0); |
608 |
hv_store (infohash, "remote_file", 11, newSVpv (ptr_dcc->filename, 0), 0); |
hv_store (infohash, "remote_file", 11, newSVpv (ptr_dcc->filename, 0), 0); |