summaryrefslogtreecommitdiff
path: root/src/perl/common/Rawlog.xs
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-12-06 05:03:11 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-12-06 05:03:11 +0000
commite95f309b500e37ceb65f533fa0267a2864511228 (patch)
treee5f9e8705ceaa33fdd6c62c389312652de961865 /src/perl/common/Rawlog.xs
parenta99e93ef5d8dd4002580532ee25316c3860c1e4a (diff)
downloadirssi-e95f309b500e37ceb65f533fa0267a2864511228.zip
perl changes - values() method doesn't exist anymore, instead of
$server->values()->{...} you now use directly $server->{...} git-svn-id: http://svn.irssi.org/repos/irssi/trunk@972 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/perl/common/Rawlog.xs')
-rw-r--r--src/perl/common/Rawlog.xs23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/perl/common/Rawlog.xs b/src/perl/common/Rawlog.xs
index c7422bac..c9a37d56 100644
--- a/src/perl/common/Rawlog.xs
+++ b/src/perl/common/Rawlog.xs
@@ -32,23 +32,24 @@ MODULE = Irssi PACKAGE = Irssi::Rawlog PREFIX = rawlog_
#*******************************
void
-values(rawlog)
+init(rawlog)
Irssi::Rawlog rawlog
PREINIT:
HV *hv;
AV *av;
GSList *tmp;
-PPCODE:
- hv = newHV();
- hv_store(hv, "logging", 7, newSViv(rawlog->logging), 0);
- hv_store(hv, "nlines", 6, newSViv(rawlog->nlines), 0);
-
- av = newAV();
- for (tmp = rawlog->lines; tmp != NULL; tmp = tmp->next) {
- av_push(av, new_pv(tmp->data));
+CODE:
+ hv = hvref(ST(0));
+ if (hv != NULL) {
+ hv_store(hv, "logging", 7, newSViv(rawlog->logging), 0);
+ hv_store(hv, "nlines", 6, newSViv(rawlog->nlines), 0);
+
+ av = newAV();
+ for (tmp = rawlog->lines; tmp != NULL; tmp = tmp->next) {
+ av_push(av, new_pv(tmp->data));
+ }
+ hv_store(hv, "lines", 5, newRV_noinc((SV*)av), 0);
}
- hv_store(hv, "lines", 5, newRV_noinc((SV*)av), 0);
- XPUSHs(sv_2mortal(newRV_noinc((SV*)hv)));
void
rawlog_destroy(rawlog)