summaryrefslogtreecommitdiff
path: root/src/perl/ui/Formats.xs
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-11-17 00:25:20 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-11-17 00:25:20 +0000
commit00423151f9c0b8d9f3d92ebdc5f2cc83829960c7 (patch)
treed964b971bf4c34afd2d9a1fe2444a2fb8784e354 /src/perl/ui/Formats.xs
parent93d69f50ee2d1251d0e24d93bd2dc3b3b6d1a50f (diff)
downloadirssi-00423151f9c0b8d9f3d92ebdc5f2cc83829960c7.zip
Didn't I already commit these? .. added format_get_text(),
gui_printtext_after(), last_line_insert() and fixed a few memleaks. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2040 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/perl/ui/Formats.xs')
-rw-r--r--src/perl/ui/Formats.xs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/perl/ui/Formats.xs b/src/perl/ui/Formats.xs
new file mode 100644
index 00000000..84368d78
--- /dev/null
+++ b/src/perl/ui/Formats.xs
@@ -0,0 +1,28 @@
+#include "module.h"
+
+MODULE = Irssi::UI::Formats PACKAGE = Irssi::UI::Window
+PROTOTYPES: ENABLE
+
+void
+format_get_text(window, module, server, target, formatnum, ...)
+ Irssi::UI::Window window
+ char *module
+ Irssi::Server server
+ char *target
+ int formatnum
+PREINIT:
+ char **charargs;
+ char *ret;
+ int n;
+ STRLEN n_a;
+PPCODE:
+ charargs = g_new0(char *, items-5+1);
+ charargs[items-5] = NULL;
+ for (n = 5; n < items; n++) {
+ charargs[n-5] = (char *)SvPV(ST(n), n_a);
+ }
+ ret = format_get_text(module, window, server, target, formatnum, charargs);
+ g_free(charargs);
+
+ XPUSHs(sv_2mortal(new_pv(ret)));
+ g_free_not_null(ret);