diff options
author | Timo Sirainen <cras@irssi.org> | 2000-10-17 23:37:21 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-10-17 23:37:21 +0000 |
commit | 0977ab90e5feb02ad53eb660b693adda83c666fc (patch) | |
tree | 8c75684a281d38dfabe796e9a8f739febc96ee76 /src/perl/common/Log.xs | |
parent | f1b328beda8eaff25b1fcedda0f8efb57811407a (diff) | |
download | irssi-0977ab90e5feb02ad53eb660b693adda83c666fc.zip |
Logging fixes. Autologging with same named channels in different
networks should work correctly.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@765 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/perl/common/Log.xs')
-rw-r--r-- | src/perl/common/Log.xs | 53 |
1 files changed, 41 insertions, 12 deletions
diff --git a/src/perl/common/Log.xs b/src/perl/common/Log.xs index 06b72d0b..c341cf30 100644 --- a/src/perl/common/Log.xs +++ b/src/perl/common/Log.xs @@ -12,21 +12,14 @@ PPCODE: } Irssi::Log -log_create_rec(fname, level, items) +log_create_rec(fname, level) char *fname int level - char *items Irssi::Log log_find(fname) char *fname -void -log_write(item, level, str) - char *item - int level - char *str - #******************************* MODULE = Irssi PACKAGE = Irssi::Log PREFIX = log_ #******************************* @@ -35,9 +28,9 @@ void values(log) Irssi::Log log PREINIT: - HV *hv; + HV *hv, *stash; AV *av; - char **tmp; + GSList *tmp; PPCODE: hv = newHV(); hv_store(hv, "fname", 5, new_pv(log->fname), 0); @@ -45,16 +38,37 @@ PPCODE: hv_store(hv, "level", 5, newSViv(log->level), 0); hv_store(hv, "last", 4, newSViv(log->last), 0); hv_store(hv, "autoopen", 8, newSViv(log->autoopen), 0); + hv_store(hv, "failed", 6, newSViv(log->failed), 0); hv_store(hv, "temp", 4, newSViv(log->temp), 0); + stash = gv_stashpv("Irssi::LogItem", 0); av = newAV(); - for (tmp = log->items; *tmp != NULL; tmp++) { - av_push(av, new_pv(*tmp)); + for (tmp = log->items; tmp != NULL; tmp = tmp->next) { + av_push(av, sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); } hv_store(hv, "items", 4, newRV_noinc((SV*)av), 0); XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); void +log_item_add(log, type, name, server) + Irssi::Log log + int type + char *name + Irssi::Server server + +void +log_item_destroy(log, item) + Irssi::Log log + Irssi::LogItem item + +Irssi::LogItem +log_item_find(log, type, item, server) + Irssi::Log log + int type + char *item + Irssi::Server server + +void log_update(log) Irssi::Log log @@ -74,3 +88,18 @@ log_start_logging(log) void log_stop_logging(log) Irssi::Log log + +#******************************* +MODULE = Irssi PACKAGE = Irssi::LogItem +#******************************* + +void +values(item) + Irssi::LogItem item +PREINIT: + HV *hv; +PPCODE: + hv = newHV(); + hv_store(hv, "type", 4, newSViv(item->type), 0); + hv_store(hv, "name", 4, new_pv(item->name), 0); + hv_store(hv, "servertag", 9, new_pv(item->servertag), 0); |