Merged Irssi SVN (upcoming irssi 0.8.11).
[silc.git] / apps / irssi / src / perl / ui / Themes.xs
index 7f1c5277f14470e74be46f9fd68316b93828001f..4afd437c4dc92f03c466715b7b08e6e3169deb40 100644 (file)
@@ -136,6 +136,32 @@ CODE:
 
         printformat_perl(&dest, format, arglist);
 
+void
+abstracts_register(abstracts)
+       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
 #*******************************