summaryrefslogtreecommitdiff
path: root/src/list.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-04-15 21:25:10 +0000
committersabetts <sabetts>2001-04-15 21:25:10 +0000
commitb87be52b56c7f62294c49c40a49c766b958d0809 (patch)
tree34a8eb4bae8f1ad42990457715156fe1378264f7 /src/list.c
parent58b76fc72cd88e4a6a45b12f97810e63c75e97d6 (diff)
downloadratpoison-b87be52b56c7f62294c49c40a49c766b958d0809.zip
* src/number.h (add_window_number): new prototype
* src/number.c (add_window_number): renamed from add_to_list. Dependant code updated. * src/messages.h (MESSAGE_WINDOW_INFORMATION): new define * src/list.h (print_window_information): new prototype * src/list.c (print_window_information): new function * src/actions.h (cmd_number): new prototype
Diffstat (limited to 'src/list.c')
-rw-r--r--src/list.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/list.c b/src/list.c
index 34517b2..750221e 100644
--- a/src/list.c
+++ b/src/list.c
@@ -439,3 +439,23 @@ goto_window (rp_window *win)
set_active_window (win);
}
}
+
+void
+print_window_information (rp_window *win)
+{
+ char number[3];
+ char *str;
+
+ snprintf (number, 3, "%d", win->number);
+
+ /* There is a bit of extra memory being allocated from the
+ formatting tags in MESSAGE_WINDOW_INFORMATION, but it is not a
+ couple bytes. */
+ str = xmalloc (strlen (number) + strlen (win->name) + strlen (MESSAGE_WINDOW_INFORMATION) + 1);
+
+ sprintf (str, MESSAGE_WINDOW_INFORMATION, number, win->name);
+ message (str);
+ free (str);
+
+ return;
+}