summaryrefslogtreecommitdiff
path: root/src/bar.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-08-23 16:58:28 +0000
committersabetts <sabetts>2001-08-23 16:58:28 +0000
commit64bf4e18b28591e8b6a6b133b440fa9f28d8e693 (patch)
tree80245a33b3fc14f3e5e72cd58a77e64848bddb4c /src/bar.c
parentb4bbd9206ca9a5f9b0fec30bb70b04d29e84a8c8 (diff)
downloadratpoison-64bf4e18b28591e8b6a6b133b440fa9f28d8e693.zip
new rudeness command
Diffstat (limited to 'src/bar.c')
-rw-r--r--src/bar.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/bar.c b/src/bar.c
index 3208cac..305ff5c 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <stdarg.h>
#include "ratpoison.h"
@@ -106,6 +107,32 @@ update_window_names (screen_info *s)
}
void
+marked_message_printf (int mark_start, int mark_end, char *fmt, ...)
+{
+ int size, nchars;
+ char *buffer;
+ va_list ap;
+
+ va_start (ap, fmt);
+
+ /* A resonable starting value. */
+ size = strlen (fmt) + 1;
+ buffer = (char *)xmalloc (size);
+
+ nchars = vsnprintf (buffer, size, fmt, ap);
+ if (nchars >= size)
+ {
+ buffer = (char *)xrealloc (buffer, nchars + 1);
+ vsnprintf (buffer, nchars + 1, fmt, ap);
+ }
+
+ va_end (ap);
+
+ marked_message (buffer, mark_start, mark_end);
+ free (buffer);
+}
+
+void
marked_message (char *msg, int mark_start, int mark_end)
{
XGCValues lgv;