mirror of
https://github.com/irssi/irssi.git
synced 2026-08-16 15:12:11 +02:00
implement server-time
This commit is contained in:
parent
33d8cc3254
commit
d535a79730
21 changed files with 323 additions and 39 deletions
|
|
@ -68,3 +68,29 @@ PPCODE:
|
|||
(void) hv_store(hv, "text", 4, new_pv(l->info.text), 0);
|
||||
}
|
||||
XPUSHs(sv_2mortal(newRV_noinc((SV *) hv)));
|
||||
|
||||
void
|
||||
textbuffer_line_get_meta(line)
|
||||
Irssi::TextUI::Line line
|
||||
PREINIT:
|
||||
HV *hv;
|
||||
LINE_REC *l;
|
||||
TEXT_BUFFER_META_REC *m;
|
||||
GHashTableIter iter;
|
||||
char *key;
|
||||
char *val;
|
||||
PPCODE:
|
||||
hv = newHV();
|
||||
l = line->line;
|
||||
if (l->info.meta != NULL) {
|
||||
m = l->info.meta;
|
||||
if (m->hash != NULL) {
|
||||
g_hash_table_iter_init(&iter, m->hash);
|
||||
while (
|
||||
g_hash_table_iter_next(&iter, (gpointer *) &key, (gpointer *) &val)) {
|
||||
(void) hv_store(hv, key, strlen(key), new_pv(val), 0);
|
||||
}
|
||||
}
|
||||
(void) hv_store(hv, "server_time", 11, newSViv(m->server_time), 0);
|
||||
}
|
||||
XPUSHs(sv_2mortal(newRV_noinc((SV *) hv)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue