summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2009-01-10 15:00:06 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2009-01-10 15:00:06 +0000
commit5b4e05c55366ab66a4d75c09ed7a9ad45fb8f194 (patch)
treeb022b80e58687262df8fd0c5c020b300a884d723 /src/fe-common
parentedc7dc26fe4b949d8fd8a912ae198140753a5c96 (diff)
downloadirssi-5b4e05c55366ab66a4d75c09ed7a9ad45fb8f194.zip
Factor out printformat_module_dest_charargs function from
printformat_module_dest_args and use it in printformat_perl to remove code duplication. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4979 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/printtext.c15
-rw-r--r--src/fe-common/core/printtext.h1
2 files changed, 12 insertions, 4 deletions
diff --git a/src/fe-common/core/printtext.c b/src/fe-common/core/printtext.c
index 0e409ecd..24aba66d 100644
--- a/src/fe-common/core/printtext.c
+++ b/src/fe-common/core/printtext.c
@@ -49,16 +49,23 @@ void printformat_module_dest_args(const char *module, TEXT_DEST_REC *dest,
char *arglist[MAX_FORMAT_PARAMS];
char buffer[DEFAULT_FORMAT_ARGLIST_SIZE];
FORMAT_REC *formats;
- THEME_REC *theme;
- char *str;
-
- theme = window_get_theme(dest->window);
formats = g_hash_table_lookup(default_formats, module);
format_read_arglist(va, &formats[formatnum],
arglist, sizeof(arglist)/sizeof(char *),
buffer, sizeof(buffer));
+ printformat_module_dest_charargs(module, dest, formatnum, arglist);
+}
+
+void printformat_module_dest_charargs(const char *module, TEXT_DEST_REC *dest,
+ int formatnum, char **arglist)
+{
+ THEME_REC *theme;
+ char *str;
+
+ theme = window_get_theme(dest->window);
+
if (!sending_print_starting) {
sending_print_starting = TRUE;
signal_emit_id(signal_print_starting, 1, dest);
diff --git a/src/fe-common/core/printtext.h b/src/fe-common/core/printtext.h
index 463f3572..66ba28f4 100644
--- a/src/fe-common/core/printtext.h
+++ b/src/fe-common/core/printtext.h
@@ -11,6 +11,7 @@ void printformat_module_dest(const char *module, TEXT_DEST_REC *dest, int format
void printformat_module_args(const char *module, void *server, const char *target, int level, int formatnum, va_list va);
void printformat_module_window_args(const char *module, WINDOW_REC *window, int level, int formatnum, va_list va);
void printformat_module_dest_args(const char *module, TEXT_DEST_REC *dest, int formatnum, va_list va);
+void printformat_module_dest_charargs(const char *module, TEXT_DEST_REC *dest, int formatnum, char **arglist);
void printtext(void *server, const char *target, int level, const char *text, ...);
void printtext_string(void *server, const char *target, int level, const char *text);