mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Irssi::signal_emit() was broken.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1027 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
84d672ee42
commit
e50535a64e
@ -11,7 +11,12 @@ CODE:
|
||||
|
||||
memset(p, 0, sizeof(p));
|
||||
for (n = 1; n < items && n < 7; n++) {
|
||||
p[n-1] = SvPOKp(ST(n)) ? SvPV(ST(n), n_a) : (void *) SvIV((SV*)SvRV(ST(n)));
|
||||
if (SvPOKp(ST(n)))
|
||||
p[n-1] = SvPV(ST(n), n_a);
|
||||
else if (irssi_is_ref_object(ST(n)))
|
||||
p[n-1] = irssi_ref_object(ST(n));
|
||||
else
|
||||
p[n-1] = (void *) SvIV((SV*)SvRV(ST(n)));
|
||||
}
|
||||
signal_emit(signal, items-1, p[0], p[1], p[2], p[3], p[4], p[5], p[6]);
|
||||
|
||||
|
@ -96,6 +96,21 @@ SV *irssi_bless_plain(const char *stash, void *object)
|
||||
return sv_bless(newRV_noinc((SV*)hv), gv_stashpv((char *)stash, 1));
|
||||
}
|
||||
|
||||
int irssi_is_ref_object(SV *o)
|
||||
{
|
||||
SV **sv;
|
||||
HV *hv;
|
||||
|
||||
hv = hvref(o);
|
||||
if (hv != NULL) {
|
||||
sv = hv_fetch(hv, "_irssi", 6, 0);
|
||||
if (sv != NULL)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void *irssi_ref_object(SV *o)
|
||||
{
|
||||
SV **sv;
|
||||
|
@ -32,6 +32,7 @@ char *perl_get_package(void);
|
||||
irssi_bless_iobject((object)->type, (object)->chat_type, object))
|
||||
SV *irssi_bless_iobject(int type, int chat_type, void *object);
|
||||
SV *irssi_bless_plain(const char *stash, void *object);
|
||||
int irssi_is_ref_object(SV *o);
|
||||
void *irssi_ref_object(SV *o);
|
||||
|
||||
void irssi_add_object(int type, int chat_type, const char *stash,
|
||||
|
Loading…
Reference in New Issue
Block a user