mirror of
https://github.com/irssi/irssi.git
synced 2026-08-19 00:22:17 +02:00
Added support to define new default abstracts at runtime.
Irssi::abstracts_register([key => value, ...]); git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3079 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
3a1ceaf3d0
commit
9c18cb00e7
3 changed files with 87 additions and 20 deletions
|
|
@ -136,6 +136,31 @@ CODE:
|
|||
|
||||
printformat_perl(&dest, format, arglist);
|
||||
|
||||
void
|
||||
abstracts_register(SV *abstracts)
|
||||
PREINIT:
|
||||
AV *av;
|
||||
char *key, *value;
|
||||
int i, len;
|
||||
CODE:
|
||||
if (!SvROK(abstracts))
|
||||
croak("abstracts is not a reference to list");
|
||||
av = (AV *) SvRV(abstracts);
|
||||
len = av_len(av)+1;
|
||||
if (len == 0 || (len & 1) != 0)
|
||||
croak("abstracts list is invalid - not divisible by 2 (%d)", len);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
key = SvPV(*av_fetch(av, i, 0), PL_na); i++;
|
||||
value = SvPV(*av_fetch(av, i, 0), PL_na);
|
||||
|
||||
theme_set_default_abstract(key, value);
|
||||
}
|
||||
themes_reload();
|
||||
|
||||
void
|
||||
themes_reload()
|
||||
|
||||
#*******************************
|
||||
MODULE = Irssi::UI::Themes PACKAGE = Irssi::Server
|
||||
#*******************************
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue